Subversion Repositories SmartDukaan

Rev

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

Rev 29845 Rev 29846
Line 59... Line 59...
59
					<th rowspan=2>MOP</th>
59
					<th rowspan=2>MOP</th>
60
					<th rowspan=2>DP</th>
60
					<th rowspan=2>DP</th>
61
					<th colspan=3 style="text-align: center">Sell In Margin</th>
61
					<th colspan=3 style="text-align: center">Sell In Margin</th>
62
					<th colspan=4 style="text-align: center">Sell Out Margin</th>
62
					<th colspan=4 style="text-align: center">Sell Out Margin</th>
63
					<th rowspan=2>Activation Payout</th>
63
					<th rowspan=2>Activation Payout</th>
-
 
64
					#set($add=0)
64
					#if($upgradeOffer)
65
					#if($upgradeOffer)
65
					<th rowspan=2>Upgrade Offer</th>
66
					<th rowspan=2>Upgrade Offer</th>
-
 
67
					#set($add=1)
66
					#end
68
					#end
67
					#foreach($offer in $offers)
69
					#foreach($offer in $offers)
68
						#set($fieldIndex=$velocityCount*2 + 12)
70
						#set($fieldIndex=$velocityCount*2 + (12 + $add))
69
						<th data-idx="$fieldIndex" colspan=2 data-offerid="$offer.getId()"><a href="javascript:void(0)" class="mk_partner_view">$offer.getName()</a></th>
71
						<th data-idx="$fieldIndex" colspan=2 data-offerid="$offer.getId()"><a href="javascript:void(0)" class="mk_partner_view">$offer.getName()</a></th>
70
					#end
72
					#end
71
					<th rowspan=2>Total Margin</th>
73
					<th rowspan=2>Total Margin</th>
72
					<th rowspan=2>Net Landing Price</th>
74
					<th rowspan=2>Net Landing Price</th>
73
					<th rowspan=2>MOP-DP</th>
75
					<th rowspan=2>MOP-DP</th>
Line 104... Line 106...
104
 
106
 
105
					<td>$pc.getItemId()</td>
107
					<td>$pc.getItemId()</td>
106
					<td>$pc.getModelName() $pc.getModelNumber() ($pc.getColor())</td>
108
					<td>$pc.getModelName() $pc.getModelNumber() ($pc.getColor())</td>
107
					<td>$pc.getType()</td>
109
					<td>$pc.getType()</td>
108
					<td class="currency">$pc.getMrp()</td>
110
					<td class="currency">$pc.getMrp()</td>
109
					<td class="currency">$pc.getMop()</td>
111
					<td class="currency mop" data-value="$pc.getMop()">$pc.getMop()</td>
110
					<td class="currency">$pc.getSellingPrice()</td>
112
					<td class="currency">$pc.getSellingPrice()</td>
111
					<td class="currency">$pc.getBasePayout()</td>
113
					<td class="currency">$pc.getBasePayout()</td>
112
					<td class="currency">$pc.getCashDiscount()</td>
114
					<td class="currency">$pc.getCashDiscount()</td>
113
					<td class="currency">$pc.getUpfrontMargin()</td>
115
					<td class="currency">$pc.getUpfrontMargin()</td>
114
					<td class="currency">$pc.getTertiaryPayout()</td>
116
					<td class="currency">$pc.getTertiaryPayout()</td>
Line 120... Line 122...
120
					<td class="currency">$pc.getUpgradeOffer()</td>
122
					<td class="currency">$pc.getUpgradeOffer()</td>
121
					#end
123
					#end
122
					#foreach($slabPayout in $pc.getSlabPayouts())
124
					#foreach($slabPayout in $pc.getSlabPayouts())
123
					#if($slabPayout.size()>0)
125
					#if($slabPayout.size()>0)
124
					<td>
126
					<td>
125
					<select>
127
					<select class="mk_criteria_slab" data-value="$slabPayout.entrySet().iterator().next().getValue()">
126
						#foreach($payout in $slabPayout.entrySet())
128
						#foreach($payout in $slabPayout.entrySet())
127
							<option data-value="$payout.getValue()" value="$payout.getKey()">$payout.getKey() onwards</option>
129
							<option data-value="$payout.getValue()" value="$payout.getKey()">$payout.getKey() onwards</option>
128
						#end
130
						#end
129
					</select>
131
					</select>
130
					</td>
132
					</td>
Line 132... Line 134...
132
					#else
134
					#else
133
					<td> - </td>
135
					<td> - </td>
134
					<td> - </td>
136
					<td> - </td>
135
					#end
137
					#end
136
					#end
138
					#end
137
					<td class="currency">$pc.getTotalScheme()</td>
139
					<td class="currency totalmargin" data-value="$pc.getTotalScheme()">$pc.getTotalScheme()</td>
138
					<td class="currency">$pc.getNetPrice()</td>
140
					<td class="currency netprice" data-value="$pc.getNetPrice()">$pc.getNetPrice()</td>
139
					<td class="currency">$pc.getMopdp()</td>
141
					<td class="currency">$pc.getMopdp()</td>
140
					<td class="currency">$pc.getTotalProfit()</td>
142
					<td class="currency totalprofit" data-value="$pc.getTotalProfit()">$pc.getTotalProfit()</td>
141
					<td>$pc.getNetMargin()</td>
143
					<td class="netmargin">$pc.getNetMargin()</td>
142
 
144
 
143
				</tr>
145
				</tr>
144
				#end
146
				#end
145
			</tbody>
147
			</tbody>
146
		</table>
148
		</table>
Line 165... Line 167...
165
			"bInfo" : false,
167
			"bInfo" : false,
166
			"bAutoWidth" : false,
168
			"bAutoWidth" : false,
167
 
169
 
168
		});
170
		});
169
	});
171
	});
-
 
172
	$('select.mk_criteria_slab').change(function() {
-
 
173
		debugger;
-
 
174
		oldSelectedValue = $(this).data("value");
-
 
175
		$(this).closest('td').next().html($(this).find("option:selected").data("value"));
-
 
176
		let diff=oldSelectedValue - $(this).find("option:selected").data("value");
-
 
177
		let $tr = $(this).closest('tr');
-
 
178
		let totalMargin = numberToComma($tr.find('.totalmargin').data('value') - diff);
-
 
179
		$tr.find('.totalmargin').html(totalMargin);
-
 
180
		let netLanding =  $tr.find('.netprice').data('value') + diff;
-
 
181
		let netLandingString = numberToComma(netLanding);
-
 
182
		$tr.find('.netprice').html(netLandingString);
-
 
183
		
-
 
184
		let totalProfit =  $tr.find('.totalprofit').data('value') - diff;
-
 
185
		let totalProfitString =  numberToComma(totalProfit);
-
 
186
		$tr.find('.totalprofit').html(totalProfit);
-
 
187
		
-
 
188
		##let rouoff = totalProfit / (netLanding / 1.18) * 100;
-
 
189
		let rouoff = totalProfit / ($tr.find('.mop').data('value') / 1.18) * 100;
-
 
190
		let roundOff = Math.round(rouoff * 100.0) / 100.0;
-
 
191
		$tr.find('.netmargin').html(roundOff);
-
 
192
	});
170
</script>
193
</script>
171
194