Subversion Repositories SmartDukaan

Rev

Rev 30466 | Rev 31215 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 30466 Rev 30471
Line 1... Line -...
1
 
-
 
2
<style>
1
<style>
3
.table {
2
    .table {
4
	background-image:
-
 
5
		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>");
3
        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>");
-
 
4
    }
6
}
5
 
7
.highlight-br {
6
    .highlight-br {
8
 border-right:1px solid #aaa !important;
7
        border-right: 1px solid #aaa !important;
9
}
8
    }
10
</style>
9
</style>
11
 
10
 
12
<script type="text/javascript">
11
<script type="text/javascript">
13
	$(document).ready(function() {
12
    $(document).ready(function () {
-
 
13
 
14
 
14
 
15
	
-
 
16
	});
15
    });
17
</script>
16
</script>
18
 
17
 
19
<body>
18
<body>
20
	<div class="col-lg-12">
19
<div class="col-lg-12">
21
		<h4>Note</h4>
20
    <h4>Note</h4>
22
		<b>Hygiene Payout</b> - Hygiene Payout calculation is subject to sales
21
    <b>Hygiene Payout</b> - Hygiene Payout calculation is subject to sales
23
		hygiene including customer & other details entered in the system, pl
22
    hygiene including customer & other details entered in the system, pl
24
		refer to hygiene meter in your Dashboard.<br> <b>Tertiary
23
    refer to hygiene meter in your Dashboard.<br> <b>Tertiary
25
			Payout</b> - Tertiary Payout calculation is subject to activation of the
24
    Payout</b> - Tertiary Payout calculation is subject to activation of the
26
		handset against the sales entered in system. <br> <b>Investment
25
    handset against the sales entered in system. <br> <b>Investment
27
		Payout</b> - Investment Payout calculation is subject to maintenance of
26
    Payout</b> - Investment Payout calculation is subject to maintenance of
28
		90% of minimum Investments for minimum 12 days in a month as per below
27
    90% of minimum Investments for minimum 12 days in a month as per below
29
		slabs
28
    slabs
30
		<ul>
29
    <ul>
31
			<li>a) 2% in case minimum investment is 90% or above for 12 days
30
        <li>a) 2% in case minimum investment is 90% or above for 12 days
32
				or more in a month
31
            or more in a month
33
			</li>
32
        </li>
34
			<li>b) 1% in case of minimum investment is 90% or above for 8-11
33
        <li>b) 1% in case of minimum investment is 90% or above for 8-11
35
				days in a month
34
            days in a month
36
			</li>
35
        </li>
37
			<li>c) No payout in case of minimum investment is less than 8
36
        <li>c) No payout in case of minimum investment is less than 8
38
				days in a month.
37
            days in a month.
39
			</li>
38
        </li>
40
		</ul>
39
    </ul>
41
		<b>Below Price Structure is subject to change at the discretion of
40
    <b>Below Price Structure is subject to change at the discretion of
42
			SmartDukaan.</b>
41
        SmartDukaan.</b>
43
 
42
 
44
	</div>
43
</div>
45
 
44
 
46
	<div class="col-lg-12">
45
<div class="col-lg-12">
47
		<table class="table table-border table-condensed table-bordered"
46
    <table class="table table-border table-condensed table-bordered"
48
			   id="circular-table">
47
           id="circular-table">
49
 
48
 
50
			<thead>
49
        <thead>
51
				<tr>
50
        <tr>
52
 
51
 
53
					<th rowspan=2>Model</th>
52
            <th rowspan=2>Model</th>
54
					<th rowspan=2>Type</th>
53
            <th rowspan=2>Type</th>
55
					<th rowspan=2>MRP</th>
54
            <th rowspan=2>MRP</th>
56
					<th rowspan=2>MOP</th>
55
            <th rowspan=2>MOP</th>
57
					<th rowspan=2>DP</th>
56
            <th rowspan=2>DP</th>
58
					<th colspan=3 style="text-align: center">Sell In Margin</th>
57
            #if($sellins.size() > 0)
59
					<th colspan=4 style="text-align: center">Sell Out Margin</th>
58
                <th colspan="$sellins.size()" style="text-align: center">Sell In</th>
60
					<th rowspan=2>Activation Payout</th>
59
            #end
61
					#set($add=0)
60
            #if($sellouts.size() > 0)
62
					#if($upgradeOffer)
61
                <th colspan="$sellouts.size()" style="text-align: center
63
					<th rowspan=2>Upgrade Offer</th>
62
                ">Sell Out
64
					#set($add=1)
63
                </th>
65
					#end
64
            #end
66
					#foreach($offer in $offers)
65
            #set($add=0)
67
						#set($fieldIndex=$velocityCount*2 + (11 + $add))
66
            #if($upgradeOffer)
68
						<th data-idx="$fieldIndex" colspan=2 data-offerid="$offer.getId()"><a href="javascript:void(0)" class="mk_partner_view">$offer.getName()</a></th>
67
                <th rowspan=2>Upgrade Offer</th>
69
					#end
68
                #set($add=1)
70
					<th rowspan=2>Total Margin</th>
69
            #end
71
					<th rowspan=2>Net Landing Price</th>
70
            #foreach($offer in $offers)
72
					<th rowspan=2>MOP-DP</th>
71
                #set($fieldIndex=$velocityCount*2 + (4 + $allMargins.size() + $add))
73
					<th rowspan=2>Total Profit</th>
72
                <th data-idx="$fieldIndex" colspan=2 data-offerid="$offer.getId()"><a href="javascript:void(0)"
74
					<th rowspan=2>Net % Margin</th>
73
                                                                                      class="mk_partner_view">$offer.getName()</a>
75
 
74
                </th>
76
				</tr>
75
            #end
77
 
76
            <th rowspan=2>Total Margin</th>
78
				<tr>
77
            <th rowspan=2>Net Landing Price</th>
79
 
78
            <th rowspan=2>MOP-DP</th>
80
 
79
            <th rowspan=2>Total Profit</th>
81
					<th>Base Payout</th>
80
            <th rowspan=2>Net % Margin</th>
82
					<th>Cash Discount</th>
81
 
83
					<th>Upfront Margin</th>
82
        </tr>
84
					<th>Tertiary Payout</th>
83
        <tr>
85
					<th>Hygiene Payout</th>
84
            #foreach($marginName in $allMargins)
86
					<th>Category Payout</th>
85
                <th>$marginName</th>
87
					<th>Investment Payout</th>
86
            #end
88
					#foreach($offer in $offers)
87
            #foreach($offer in $offers)
89
						<th>Target</th>
88
                <th>Target</th>
90
						<th>Margin</th>
89
                <th>Margin</th>
91
					#end
90
            #end
92
 
91
        </tr>
93
 
92
        </thead>
94
 
93
        <tbody>
95
				</tr>
94
            #foreach($pc in $priceCircular )
96
 
95
            <tr>
97
 
96
                <td>$pc.getModelName() $pc.getModelNumber()</td>
98
 
97
                <td>$pc.getType()</td>
99
			</thead>
98
                <td class="currency">$pc.getMrp()</td>
100
			<tbody>
99
                <td class="currency">$pc.getMop()</td>
101
				#foreach($pc in $priceCircular )
100
                <td class="currency dp" data-value="$pc.getSellingPrice()">$pc.getSellingPrice()</td>
102
				<tr>
101
                #foreach($marginName in $allMargins)
103
					<td>$pc.getModelName() $pc.getModelNumber()</td>
102
                    <td class="currency">$pc.getByPayoutType($marginName)</td>
104
					<td>$pc.getType()</td>
103
                #end
105
					<td class="currency">$pc.getMrp()</td>
104
                #if($upgradeOffer)
106
					<td class="currency">$pc.getMop()</td>
105
                    <td class="currency">$pc.getUpgradeOffer()</td>
107
					<td class="currency dp" data-value="$pc.getSellingPrice()">$pc.getSellingPrice()</td>
106
                #end
108
					<td class="currency">$pc.getBasePayout()</td>
107
                #foreach($slabPayouts in $pc.getSlabPayouts())
109
					<td class="currency">$pc.getCashDiscount()</td>
108
                    #if($slabPayouts && $slabPayouts.size()>0)
110
					<td class="currency">$pc.getUpfrontMargin()</td>
109
                        <td>
111
					<td class="currency">$pc.getTertiaryPayout()</td>
110
                            <select class="mk_criteria_slab"
112
					<td class="currency">$pc.getHygienePayout()</td>
111
                                    data-value="$slabPayouts.entrySet().iterator().next().getValue()">
113
					<td class="currency">$pc.getCategoryPayout()</td>
112
                                #foreach($payout in $slabPayouts.entrySet())
114
					<td class="currency">$pc.getInvestmentPayout()</td>
113
                                    <option data-value="$payout.getValue()"
115
					<td class="currency">$pc.getModelSpecfic()</td>
114
                                            value="$payout.getKey()">$payout.getKey()
116
					#if($upgradeOffer)
115
                                        onwards
117
						<td class="currency">$pc.getUpgradeOffer()</td>
116
                                    </option>
118
					#end
117
                                #end
119
					#foreach($slabPayouts in $pc.getSlabPayouts())
118
                            </select>
120
						#if($slabPayouts && $slabPayouts.size()>0)
119
                        </td>
121
							<td>
120
                        <td class="currency">$slabPayouts.values().iterator().next()</td>
122
								<select class="mk_criteria_slab"
121
                    #else
123
										data-value="$slabPayouts.entrySet().iterator().next().getValue()">
122
                        <td> -</td>
124
									#foreach($payout in $slabPayouts.entrySet())
123
                        <td> -</td>
125
										<option data-value="$payout.getValue()"
124
                    #end
126
												value="$payout.getKey()">$payout.getKey()
125
                #end
127
											onwards
126
                <td class="currency totalmargin" data-value="$pc.getTotalScheme()">$pc.getTotalScheme()</td>
128
										</option>
127
                <td class="currency netprice" data-value="$pc.getNetPrice()">$pc.getNetPrice()</td>
129
									#end
128
                <td class="currency">$pc.getMopdp()</td>
130
								</select>
129
                <td class="currency totalprofit" data-value="$pc.getTotalProfit()">$pc.getTotalProfit()</td>
131
							</td>
130
                <td class="netmargin">$pc.getNetMargin()</td>
132
							<td class="currency">$slabPayouts.values().iterator().next()</td>
131
 
133
						#else
132
            </tr>
134
							<td> -</td>
133
            #end
135
							<td> -</td>
134
        </tbody>
136
						#end
135
    </table>
137
					#end
136
</div>
138
					<td class="currency totalmargin" data-value="$pc.getTotalScheme()">$pc.getTotalScheme()</td>
137
 
139
					<td class="currency netprice" data-value="$pc.getNetPrice()">$pc.getNetPrice()</td>
138
<div class="offer-margin-container">
140
					<td class="currency">$pc.getMopdp()</td>
139
    <div class="modal  text-center" id="offerDescription">
141
					<td class="currency totalprofit" data-value="$pc.getTotalProfit()">$pc.getTotalProfit()</td>
140
        <div class="modal-dialog modal-lg modal-dialog-scrollable">
142
					<td class="netmargin">$pc.getNetMargin()</td>
141
            <div class="modal-content">
143
 
-
 
144
				</tr>
-
 
145
				#end
-
 
146
			</tbody>
-
 
147
		</table>
-
 
148
	</div>
-
 
149
	
-
 
150
			<div class="offer-margin-container">
-
 
151
            <div class="modal  text-center" id="offerDescription">
-
 
152
                <div class="modal-dialog modal-lg modal-dialog-scrollable">
-
 
153
                    <div class="modal-content">
-
 
154
                    </div>
-
 
155
                </div>
-
 
156
            </div>
142
            </div>
157
        </div>
143
        </div>
-
 
144
    </div>
-
 
145
</div>
158
</body>
146
</body>
159
<script type="text/javascript">
147
<script type="text/javascript">
160
	$(document).ready(function() {
148
    $(document).ready(function () {
161
		priceCircularTable = $('#circular-table').DataTable({
149
        priceCircularTable = $('#circular-table').DataTable({
162
			"scrollX": true,
150
            "scrollX": true,
163
			"bPaginate" : true,
151
            "bPaginate": true,
164
			"bLengthChange" : true,
152
            "bLengthChange": true,
165
			"bFilter" : true,
153
            "bFilter": true,
166
			"bInfo" : false,
154
            "bInfo": false,
167
			"bAutoWidth" : false,
155
            "bAutoWidth": false,
168
			"pageLength": 100
156
            "pageLength": 100
169
 
157
 
170
		});
158
        });
171
	});
159
    });
172
	$('select.mk_criteria_slab').change(function() {
160
    $('select.mk_criteria_slab').change(function () {
173
		debugger;
161
        debugger;
174
		oldSelectedValue = $(this).data("value");
162
        oldSelectedValue = $(this).data("value");
175
		$(this).closest('td').next().html($(this).find("option:selected").data("value"));
163
        $(this).closest('td').next().html($(this).find("option:selected").data("value"));
176
		let diff=oldSelectedValue - $(this).find("option:selected").data("value");
164
        let diff = oldSelectedValue - $(this).find("option:selected").data("value");
177
		let $tr = $(this).closest('tr');
165
        let $tr = $(this).closest('tr');
178
		let totalMargin = numberToComma($tr.find('.totalmargin').data('value') - diff);
166
        let totalMargin = numberToComma($tr.find('.totalmargin').data('value') - diff);
179
		$tr.find('.totalmargin').html(totalMargin);
167
            $tr.find('.totalmargin').html(totalMargin);
180
		let netLanding =  $tr.find('.netprice').data('value') + diff;
168
        let netLanding = $tr.find('.netprice').data('value') + diff;
181
		let netLandingString = numberToComma(netLanding);
169
        let netLandingString = numberToComma(netLanding);
182
		$tr.find('.netprice').html(netLandingString);
170
            $tr.find('.netprice').html(netLandingString);
183
		
171
 
184
		let totalProfit =  $tr.find('.totalprofit').data('value') - diff;
172
        let totalProfit = $tr.find('.totalprofit').data('value') - diff;
185
		let totalProfitString =  numberToComma(totalProfit);
173
        let totalProfitString = numberToComma(totalProfit);
186
		$tr.find('.totalprofit').html(totalProfitString);
174
            $tr.find('.totalprofit').html(totalProfitString);
187
		
175
 
188
		##let rouoff = totalProfit / (netLanding / 1.18) * 100;
176
        ##let rouoff = totalProfit / (netLanding / 1.18) * 100;
189
		let rouoff = totalProfit / ($tr.find('.dp').data('value') / 1.18) * 100;
177
        let rouoff = totalProfit / ($tr.find('.dp').data('value') / 1.18) * 100;
190
		let roundOff = Math.round(rouoff * 100.0) / 100.0;
178
        let roundOff = Math.round(rouoff * 100.0) / 100.0;
191
		$tr.find('.netmargin').html(roundOff);
179
            $tr.find('.netmargin').html(roundOff);
192
	});
180
    });
193
</script>
181
</script>
194
182