Subversion Repositories SmartDukaan

Rev

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

Rev 9734 Rev 9780
Line 124... Line 124...
124
	$('input#transferPrice').val('0.00');
124
	$('input#transferPrice').val('0.00');
125
	$('input#minPosTp').val('0.00');
125
	$('input#minPosTp').val('0.00');
126
	$('input#minPosSp').val('0.00');
126
	$('input#minPosSp').val('0.00');
127
}
127
}
128
else{
128
else{
129
var comRate=$('#commissionRate').val();
129
var com=$('#commissionRate').val();
-
 
130
var comRate=com/100;
-
 
131
var serviceTaxRate=$('#serviceTaxRate').val();
-
 
132
var stRate = serviceTaxRate/100;
-
 
133
var emiFeeRate=$('#emiFee').val();
-
 
134
var emiFee=emiFeeRate/100;
-
 
135
var closingFee=parseFloat($('#closingFee').val());
-
 
136
var returnProvision=parseFloat($('#returnProvision').val());
130
var margin=$('#margin').val();
137
var margin=$('#margin').val();
131
var vatRate=$('#vat').val();
138
var vatRate=$('#vat').val();
132
var vat=vatRate/100;
139
var vat=vatRate/100;
133
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
140
var commisionPrice=((comRate)*sellingPrice).toFixed(2);
134
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
141
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate)));
135
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
142
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
136
console.log(vatValue);
-
 
137
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
143
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
-
 
144
console.log(inHouseCost);
138
var lowestTp=(+nlc+inHouseCost).toFixed(2);
145
var lowestTp=(+nlc+inHouseCost).toFixed(2);
139
var lowestSp=(+nlc+(courierCost+0)*1.1236*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate/100+0)*1.1236*(1+vat)-.005*(1+vat));
146
var lowestSp=(+nlc+(courierCost+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
140
ourTp = (parseFloat(ourTp)).toFixed(2);
147
ourTp = (parseFloat(ourTp)).toFixed(2);
141
$('input#minPosTp').val(lowestTp);
148
$('input#minPosTp').val(lowestTp);
142
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
149
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
143
$('input#transferPrice').val(ourTp);
150
$('input#transferPrice').val(ourTp);
144
var serviceTax=(.1236*(+commisionPrice+courierCost)).toFixed(2);
151
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
145
lowest_possible_tp=parseFloat(lowestTp);
152
lowest_possible_tp=parseFloat(lowestTp);
146
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
153
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
147
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
154
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
148
$('input#marginPer').val(marginPercentage);
155
$('input#marginPer').val(marginPercentage);
149
$('input#margin').val(newMargin);
156
$('input#margin').val(newMargin);
Line 179... Line 186...
179
		$('input#maxNlc').val(parsedData.MaxNlc);
186
		$('input#maxNlc').val(parsedData.MaxNlc);
180
		calculateStuff();
187
		calculateStuff();
181
        },
188
        },
182
		error : function() {
189
		error : function() {
183
			$('input#warehouseId').val('');
190
			$('input#warehouseId').val('');
-
 
191
			$('input#maxNlc').val('');
184
			alert("Unable to get max nlc possibly wrong warehouse");
192
			alert("Unable to get max nlc possibly wrong warehouse");
185
		 },
193
		 },
186
    });
194
    });
187
	return false;
195
	return false;
188
});
196
});
Line 206... Line 214...
206
<div class="top-header">
214
<div class="top-header">
207
<h2 style="font-weight: bolder; font-size: 20px; border-top: 4px solid rgb(134, 163, 189); background-color: rgb(134, 163, 189);color:white;">
215
<h2 style="font-weight: bolder; font-size: 20px; border-top: 4px solid rgb(134, 163, 189); background-color: rgb(134, 163, 189);color:white;">
208
	Product Details
216
	Product Details
209
</h2>
217
</h2>
210
</div>
218
</div>
211
<div class="product-detail" style="display: block; min-height: 650px;">
219
<div class="product-detail" style="display: block; min-height: 630px;">
212
<form id="snapdeal-form" action="/Support/snapdeal-list!update" enctype="multipart/form-data" method="post">
220
<form id="snapdeal-form" action="/Support/snapdeal-list!update" enctype="multipart/form-data" method="post">
213
<div class="left" style="float: left; width: 48%;">
221
<div class="left" style="float: left; width: 48%;">
214
<table id="upload" style="text-align: center;width: 100%;height:200px;">
222
<table id="upload" style="text-align: center;width: 100%;height:200px;">
215
<thead>
223
<thead>
216
</thead>
224
</thead>
Line 225... Line 233...
225
	<input id="warehouseId" name="warehouseId" value='$itemDetail.getWarehouseId()' style="width:25%; type="text" />
233
	<input id="warehouseId" name="warehouseId" value='$itemDetail.getWarehouseId()' style="width:25%; type="text" />
226
	<input type="button" id="getMxNlc" value="Get Max Nlc" style="width:25%;">
234
	<input type="button" id="getMxNlc" value="Get Max Nlc" style="width:25%;">
227
</td>
235
</td>
228
</tr>
236
</tr>
229
<tr>
237
<tr>
-
 
238
<td class="detail">Max NLC</td>
-
 
239
<td class="value"><input id="maxNlc" name="maxNlc" value='$itemDetail.getMaxNlc()'type="text" readonly/></td>
-
 
240
</tr>
-
 
241
<tr>
230
<td class="detail">Weight</td>
242
<td class="detail">Weight</td>
231
<td class="value">
243
<td class="value">
232
	<input id="weight" name="weight" value='$itemDetail.getWeight()' type="text" readonly/>
244
	<input id="weight" name="weight" value='$itemDetail.getWeight()' type="text" readonly/>
233
</td>
245
</td>
234
</tr>
246
</tr>
Line 248... Line 260...
248
<tr>
260
<tr>
249
<td class="detail">Webiste Selling Price</td>
261
<td class="detail">Webiste Selling Price</td>
250
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='$itemDetail.getWebsiteSellingPrice()'type="text" disabled/></td>
262
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='$itemDetail.getWebsiteSellingPrice()'type="text" disabled/></td>
251
</tr>
263
</tr>
252
<tr>
264
<tr>
253
<td class="detail">Max NLC</td>
-
 
254
<td class="value"><input id="maxNlc" name="maxNlc" value='$itemDetail.getMaxNlc()'type="text" readonly/></td>
-
 
255
</tr>
-
 
256
<tr>
-
 
257
<td class="detail">Other Cost</td>
265
<td class="detail">Other Cost</td>
258
<td class="value"><input id="otherCost" name="otherCost" value='$mpDetail.getOtherCost()' type="text" onkeyup="calculateStuff()"</td>
266
<td class="value"><input id="otherCost" name="otherCost" value='$mpDetail.getOtherCost()' type="text" onkeyup="calculateStuff()"</td>
259
</tr>
267
</tr>
260
<tr>
268
<tr>
261
<td class="detail">Minimum Possible SP (Calculated)</td>
269
<td class="detail">Minimum Possible SP (Calculated)</td>
Line 428... Line 436...
428
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
436
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
429
</td>
437
</td>
430
</tr>
438
</tr>
431
<tr class="detail" style="display:none;"></td>
439
<tr class="detail" style="display:none;"></td>
432
<td>
440
<td>
433
	<input id="itemWeight" name="itemWeight" value='$itemDetail.getWeight()'type="text"/>
441
	<input id="itemWeight" name="itemWeight" value='$itemDetail.getWeight()' type="text"/>
-
 
442
</td>
-
 
443
</tr>
-
 
444
<tr class="detail" style="display:none;"></td>
-
 
445
<td>
-
 
446
	<input id="returnProvision" name="returnProvision" value='$mpDetail.getReturnProvision()' type="text" disabled/>
-
 
447
</td>
-
 
448
</tr>
-
 
449
<tr class="detail" style="display:none;"></td>
-
 
450
<td>
-
 
451
	<input id="emiFee" name="emiFee" value='$mpDetail.getEmiFee()' type="text" disabled/>
-
 
452
</td>
-
 
453
</tr>
-
 
454
<tr class="detail" style="display:none;"></td>
-
 
455
<td>
-
 
456
	<input id="closingFee" name="closingFee" value='$mpDetail.getClosingFee()' type="text" disabled/>
-
 
457
</td>
-
 
458
</tr>
-
 
459
<tr class="detail" style="display:none;"></td>
-
 
460
<td>
-
 
461
	<input id="serviceTaxRate" name="serviceTaxRate" value='$mpDetail.getServiceTax()' type="text" disabled/>
434
</td>
462
</td>
435
</tr>
463
</tr>
436
</tbody>
464
</tbody>
437
</table>
465
</table>
438
</div>
466
</div>
Line 497... Line 525...
497
			#end
525
			#end
498
			#end
526
			#end
499
        </tbody>
527
        </tbody>
500
    </table>
528
    </table>
501
</div>
529
</div>
502
<!--Inventory details end-->
-
 
503
<!--
-
 
504
<div class="top-header-marketplace">
-
 
505
<h2 style="font-weight: bolder; font-size: 20px; border-top: 4px solid rgb(134, 163, 189); background-color: rgb(134, 163, 189);color:white;">
-
 
506
	Marketplace Related Details
-
 
507
</h2>
-
 
508
</div>
-
 
509
 
-
 
510
<div class="mp-detail">
-
 
511
<form id="mp-form" action="/Support/snapdeal-list!updateMpData" enctype="multipart/form-data" method="post">
-
 
512
</form>
-
 
513
<div class="left" style="float: left; width: 48%;">
-
 
514
<table class="mpUpload" style="text-align: center;width: 100%;height:200px;">
-
 
515
<thead>
-
 
516
</thead>
-
 
517
<tbody>
-
 
518
<tr>
-
 
519
<td class="detail">Minimum Possible SP</td>
-
 
520
<td class="value"><input id="minPosSp" name="minPosSp" value='$mpDetail.getMinimumPossibleSp()'type="text" readonly/></td>
-
 
521
</tr>
-
 
522
<tr>
-
 
523
<td class="detail">Minimum Possible TP</td>
-
 
524
<td class="value">
-
 
525
	<input id="minPosTp" name="minPosTp" value='$mpDetail.getMinimumPossibleTp()' type="text" readonly/>
-
 
526
</td>
-
 
527
</tr>
-
 
528
<tr>
-
 
529
<td class="detail">Last Updated SP</td>
-
 
530
<td class="value">
-
 
531
	<input id="currentSp" name="currentSp" value='$mpDetail.getCurrentSp()' type="text" readonly/>
-
 
532
</td>
-
 
533
</tr>
-
 
534
<tr>
-
 
535
<td class="detail">Last Updated TP</td>
-
 
536
<td class="value">
-
 
537
	<input id="currentTp" name="currentTp" value='$mpDetail.getCurrentTp()'type="text" readonly/></td>
-
 
538
</tr>
-
 
539
#set ($margin = $mpDetail.getCurrentTp() - $mpDetail.getMinimumPossibleTp())
-
 
540
<tr>
-
 
541
<td class="detail">Margin</td>
-
 
542
<td class="value"><input id="margin" name="margin" value='$margin'type="text" readonly/></td>
-
 
543
</tr>
-
 
544
</tbody>
-
 
545
</table>
-
 
546
</div>
-
 
547
<div class="left" style="float: right; width: 48%;">
-
 
548
<table class="mpUpload" style="text-align: center;width: 100%;height:200px;">
-
 
549
<thead>
-
 
550
</thead>
-
 
551
<tbody>
-
 
552
<tr>
-
 
553
<td class="detail">Margin&nbsp;&#37;</td>
-
 
554
#if($mpDetail.getCurrentSp()==0)
-
 
555
	#set ($marginPercentage = 0)
-
 
556
#else
-
 
557
	#set ($marginPercentage = ($margin/$mpDetail.getCurrentSp()*100))
-
 
558
#end
-
 
559
#set($roundMarginPer = $action.getRoundOfValue("$marginPercentage"))
-
 
560
<td class="value"><input id="marginPer" name="marginPer" value='$roundMarginPer' type="text" readonly/></td>
-
 
561
</tr>
-
 
562
<tr>
-
 
563
<td class="detail">Auto Increment</td>
-
 
564
<td class="value">#if ($mpDetail.isAutoIncrement())
-
 
565
      <select name="isAutoIncrement"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
-
 
566
	  #else
-
 
567
		<select name="isAutoIncrement"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
-
 
568
	  #end
-
 
569
</td>
-
 
570
</tr>
-
 
571
<tr>
-
 
572
<td class="detail">Auto Decrement</td>
-
 
573
<td class="value">#if ($mpDetail.isAutoDecrement())
-
 
574
      <select name="isAutoDecrement"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
-
 
575
	  #else
-
 
576
		<select name="isAutoDecrement"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
-
 
577
	  #end
-
 
578
</td>
-
 
579
</tr>
-
 
580
<tr>
-
 
581
<td class="detail">Auto Favourite</td>
-
 
582
<td class="value">#if ($mpDetail.isAutoFavourite())
-
 
583
      <select name="isAutoFavourite"><option selected="selected" value="True">Active</option></select>
-
 
584
	  #else
-
 
585
		<select name="isAutoFavourite"><option selected="selected" value="False">InActive</option></select>
-
 
586
	  #end
-
 
587
</td>
-
 
588
</tr>
-
 
589
<tr>
-
 
590
<td class="detail">Manual Favourite</td>
-
 
591
<td class="value">#if ($mpDetail.isManualFavourite())
-
 
592
      <select name="isManualFavourite"><option selected="selected" value="True">Active</option><option value="False">InActive</option></select>
-
 
593
	  #else
-
 
594
		<select name="isManualFavourite"><option selected="selected" value="False">InActive</option><option value="True">Active</option></select>
-
 
595
	  #end
-
 
596
</td>
-
 
597
</tr>
-
 
598
</tbody>
-
 
599
</table>
-
 
600
</div>
-
 
601
</form>
-
 
602
</div>
-
 
603
-->
-
 
604
 
530
 
605
 
531
 
606
 
532
 
607
 
533