Subversion Repositories SmartDukaan

Rev

Rev 31232 | Rev 31234 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<style>
    .table {
        background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' version='1.1' height='100px' width='100px'><text transform='translate(20, 100) rotate(-45)' fill='rgb(211,211,211)' font-size='20'>$partnerCode</text></svg>");
    }

    .highlight-br {
        border-right: 1px solid #aaa !important;
    }
</style>

<script type="text/javascript">
    $(document).ready(function () {


    });
</script>

<body>
<div class="col-lg-12">
    <h4>Note</h4>
    <b>Hygiene Payout</b> - Hygiene Payout calculation is subject to sales
    hygiene including customer & other details entered in the system, pl
    refer to hygiene meter in your Dashboard.<br> <b>Tertiary
    Payout</b> - Tertiary Payout calculation is subject to activation of the
    handset against the sales entered in system. <br> <b>Investment
    Payout</b> - Investment Payout calculation is subject to maintenance of
    90% of minimum Investments for minimum 12 days in a month as per below
    slabs
    <ul>
        <li>a) 2% in case minimum investment is 90% or above for 12 days
            or more in a month
        </li>
        <li>b) 1% in case of minimum investment is 90% or above for 8-11
            days in a month
        </li>
        <li>c) No payout in case of minimum investment is less than 8
            days in a month.
        </li>
    </ul>
    <b>Below Price Structure is subject to change at the discretion of
        SmartDukaan.</b>

</div>

<div class="col-lg-12">
    <table class="table table-border table-condensed table-bordered"
           id="circular-table">

        <thead>
            #set($rowspan = 2)
            #if($allMargins.size() > 0 && $offers.size() > 0)
                #set($rowspan=1)
            #end

        <tr>
            <th rowspan=$rowspan>Model</th>
            <th rowspan=$rowspan>Type</th>
            <th rowspan=$rowspan>MRP</th>
            <th rowspan=$rowspan>MOP</th>
            <th rowspan=$rowspan>DP</th>
            #if($sellins.size() > 0)
                <th colspan="$sellins.size()" style="text-align: center">Sell In</th>
            #end
            #if($sellouts.size() > 0)
                <th colspan="$sellouts.size()" style="text-align: center
                ">Sell Out
                </th>
            #end
            #set($add=0)
            #if($upgradeOffer)
                <th rowspan=$rowspan>Upgrade Offer</th>
                #set($add=1)
            #end
            #foreach($offer in $offers)
                #set($fieldIndex=$velocityCount*2 + (4 + $allMargins.size() + $add))
                <th data-idx="$fieldIndex" colspan=2 data-offerid="$offer.getId()"><a href="javascript:void(0)"
                                                                                      class="mk_partner_view">$offer.getName()</a>
                </th>
            #end
            <th rowspan=$rowspan>Total Margin</th>
            <th rowspan=$rowspan>Net Landing Price</th>
            <th rowspan=$rowspan>MOP-DP</th>
            <th rowspan=$rowspan>Total Profit</th>
            <th rowspan=$rowspan>Net % Margin</th>

        </tr>
            #if($rowspan==2)
            <tr>
                #foreach($marginName in $allMargins)
                    <th>$marginName</th>
                #end
                #foreach($offer in $offers)
                    <th>Target</th>
                    <th>Margin</th>
                #end
            </tr>
            #end
        </thead>
        <tbody>
            #foreach($pc in $priceCircular )
            <tr>
                <td>$pc.getModelName() $pc.getModelNumber()</td>
                <td>$pc.getType()</td>
                <td class="currency">$pc.getMrp()</td>
                <td class="currency">$pc.getMop()</td>
                <td class="currency dp" data-value="$pc.getSellingPrice()">$pc.getSellingPrice()</td>
                #foreach($marginName in $allMargins)
                    <td class="currency">$pc.getByPayoutType($marginName)</td>
                #end
                #if($upgradeOffer)
                    <td class="currency">$pc.getUpgradeOffer()</td>
                #end
                #foreach($slabPayouts in $pc.getSlabPayouts())
                    #if($slabPayouts && $slabPayouts.size()>0)
                        <td>
                            <select class="mk_criteria_slab"
                                    data-value="$slabPayouts.entrySet().iterator().next().getValue()">
                                #foreach($payout in $slabPayouts.entrySet())
                                    <option data-value="$payout.getValue()"
                                            value="$payout.getKey()">$payout.getKey()
                                        onwards
                                    </option>
                                #end
                            </select>
                        </td>
                        <td class="currency">$slabPayouts.values().iterator().next()</td>
                    #else
                        <td> -</td>
                        <td> -</td>
                    #end
                #end
                <td class="currency totalmargin" data-value="$pc.getTotalScheme()">$pc.getTotalScheme()</td>
                <td class="currency netprice" data-value="$pc.getNetPrice()">$pc.getNetPrice()</td>
                <td class="currency">$pc.getMopdp()</td>
                <td class="currency totalprofit" data-value="$pc.getTotalProfit()">$pc.getTotalProfit()</td>
                <td class="netmargin">$pc.getNetMargin()</td>

            </tr>
            #end
        </tbody>
    </table>
</div>

<div class="offer-margin-container">
    <div class="modal  text-center" id="offerDescription">
        <div class="modal-dialog modal-lg modal-dialog-scrollable">
            <div class="modal-content">
            </div>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(document).ready(function () {
        priceCircularTable = $('#circular-table').DataTable({
            "scrollX": true,
            "bPaginate": true,
            "bLengthChange": true,
            "bFilter": true,
            "bInfo": false,
            "bAutoWidth": false,
            "pageLength": 100

        });
    });
    $('select.mk_criteria_slab').change(function () {
        debugger;
        oldSelectedValue = $(this).data("value");
        $(this).closest('td').next().html($(this).find("option:selected").data("value"));
        let diff = oldSelectedValue - $(this).find("option:selected").data("value");
        let $tr = $(this).closest('tr');
        let totalMargin = numberToComma($tr.find('.totalmargin').data('value') - diff);
            $tr.find('.totalmargin').html(totalMargin);
        let netLanding = $tr.find('.netprice').data('value') + diff;
        let netLandingString = numberToComma(netLanding);
            $tr.find('.netprice').html(netLandingString);

        let totalProfit = $tr.find('.totalprofit').data('value') - diff;
        let totalProfitString = numberToComma(totalProfit);
            $tr.find('.totalprofit').html(totalProfitString);

        ##let rouoff = totalProfit / (netLanding / 1.18) * 100;
        let rouoff = totalProfit / ($tr.find('.dp').data('value') / 1.18) * 100;
        let roundOff = Math.round(rouoff * 100.0) / 100.0;
            $tr.find('.netmargin').html(roundOff);
    });
</script>