Subversion Repositories SmartDukaan

Rev

Rev 30012 | Rev 30206 | 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 to change at the discretion of SmartDukaan.</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>
                                <tr>

                                        <th rowspan=2>Model</th>
                                        <th rowspan=2>Type</th>
                                        <th rowspan=2>MRP</th>
                                        <th rowspan=2>MOP</th>
                                        <th rowspan=2>DP</th>
                                        <th colspan=3 style="text-align: center">Sell In Margin</th>
                                        <th colspan=4 style="text-align: center">Sell Out Margin</th>
                                        <th rowspan=2>Activation Payout</th>
                                        #set($add=0)
                                        #if($upgradeOffer)
                                        <th rowspan=2>Upgrade Offer</th>
                                        #set($add=1)
                                        #end
                                        #foreach($offer in $offers)
                                                #set($fieldIndex=$velocityCount*2 + (11 + $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=2>Total Margin</th>
                                        <th rowspan=2>Net Landing Price</th>
                                        <th rowspan=2>MOP-DP</th>
                                        <th rowspan=2>Total Profit</th>
                                        <th rowspan=2>Net % Margin</th>

                                </tr>

                                <tr>


                                        <th>Base Payout</th>
                                        <th>Cash Discount</th>
                                        <th>Upfront Margin</th>
                                        <th>Tertiary Payout</th>
                                        <th>Hygiene Payout</th>
                                        <th>Category Payout</th>
                                        <th>Investment Payout</th>
                                        #foreach($offer in $offers)
                                                <th>Target</th>
                                                <th>Margin</th>
                                        #end



                                </tr>



                        </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>
                                        <td class="currency">$pc.getBasePayout()</td>
                                        <td class="currency">$pc.getCashDiscount()</td>
                                        <td class="currency">$pc.getUpfrontMargin()</td>
                                        <td class="currency">$pc.getTertiaryPayout()</td>
                                        <td class="currency">$pc.getHygienePayout()</td>
                                        <td class="currency">$pc.getCategoryPayout()</td>
                                        <td class="currency">$pc.getInvestmentPayout()</td>
                                        <td class="currency">$pc.getModelSpecfic()</td>
                                        #if($upgradeOffer)
                                        <td class="currency">$pc.getUpgradeOffer()</td>
                                        #end
                                        #foreach($slabPayout in $pc.getSlabPayouts())
                                        #if($slabPayout && $slabPayout.size()>0)
                                                <td>
                                                        <select class="mk_criteria_slab"
                                                                        data-value="$slabPayout.entrySet().iterator().next().getValue()">
                                                                #foreach($payout in $slabPayout.entrySet())
                                                                        <option data-value="$payout.getValue()" value="$payout.getKey()">$payout.getKey()
                                                                                onwards
                                                                        </option>
                                                                #end
                                                        </select>
                                                </td>
                                                <td class="currency">$slabPayout.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>