Subversion Repositories SmartDukaan

Rev

Rev 14780 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 14780 Rev 14862
Line 226... Line 226...
226
}
226
}
227
}
227
}
228
calculateStuffVOI();
228
calculateStuffVOI();
229
}
229
}
230
</script>
230
</script>
231
 
-
 
232
<script type="text/javascript">
231
<script type="text/javascript">
233
function calculateStuffVOI()
232
function calculateStuffVOI()
234
{
233
{
235
$('input#minPosTpVoi').removeClass("border-highlight");
234
$('input#minPosTpVoi').removeClass("border-highlight");
236
$('input#minPosSpVoi').removeClass("border-highlight");
235
$('input#minPosSpVoi').removeClass("border-highlight");
Line 255... Line 254...
255
}
254
}
256
}
255
}
257
console.log(courierCost);
256
console.log(courierCost);
258
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
257
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
259
var voiSellingPrice=$('#voiSellingPrice').val();
258
var voiSellingPrice=$('#voiSellingPrice').val();
-
 
259
var courierCostSnapdeal=$('#courierCostMarketplaceVoi').val();
260
var nlc=$('#maxNlc').val();
260
var nlc=$('#maxNlc').val();
261
var otherCost=$('#otherCost').val();
261
var otherCost=$('#otherCost').val();
262
var othCost=parseFloat(otherCost);
262
var othCost=parseFloat(otherCost);
263
var pc=parseFloat(packagingCost);
263
var pc=parseFloat(packagingCost);
264
if ( voiSellingPrice==null || voiSellingPrice=="" || isNaN(voiSellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
264
if ( voiSellingPrice==null || voiSellingPrice=="" || isNaN(voiSellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
Line 268... Line 268...
268
}
268
}
269
else{
269
else{
270
var serviceTaxRate=$('#serviceTaxRate').val();
270
var serviceTaxRate=$('#serviceTaxRate').val();
271
console.log(serviceTaxRate)
271
console.log(serviceTaxRate)
272
var stRate = serviceTaxRate/100;
272
var stRate = serviceTaxRate/100;
273
var com=$('#commissionRate').val();
273
var com=$('#commissionRateVoi').val();
274
var comRate=(com/100);
274
var comRate=(com/100);
275
console.log(comRate);
275
console.log(comRate);
276
var pgVal=$('#pgFee').val();
276
var pgVal=$('#pgFee').val();
277
var pgFeeRate=pgVal/100;
277
var pgFeeRate=pgVal/100;
278
console.log(pgVal);
278
console.log(pgVal);
Line 282... Line 282...
282
var closingFee=parseFloat($('#closingFee').val());
282
var closingFee=parseFloat($('#closingFee').val());
283
var returnProvision=parseFloat($('#returnProvision').val());
283
var returnProvision=parseFloat($('#returnProvision').val());
284
console.log(returnProvision);
284
console.log(returnProvision);
285
console.log(closingFee);
285
console.log(closingFee);
286
console.log(pgFeeRate);
286
console.log(pgFeeRate);
-
 
287
console.log(courierCostSnapdeal);
287
var margin=$('#margin').val();
288
var margin=$('#margin').val();
288
var vatRate=$('#vat').val();
289
var vatRate=$('#vat').val();
289
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
290
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
290
	jAlert('Please enter VAT Rate for item','ERROR');
291
	jAlert('Please enter VAT Rate for item','ERROR');
291
	$('input#voiSellingPrice').val('0.00');
292
	$('input#voiSellingPrice').val('0.00');
Line 298... Line 299...
298
else{
299
else{
299
	var commisionPrice=(comRate*parseFloat(voiSellingPrice)+20).toFixed(2);
300
	var commisionPrice=(comRate*parseFloat(voiSellingPrice)+20).toFixed(2);
300
	console.log("Default pg fee block");
301
	console.log("Default pg fee block");
301
}
302
}
302
console.log(+courierCost);
303
console.log(+courierCost);
303
var ourTp=(parseFloat(voiSellingPrice)-parseFloat(voiSellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCost+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(voiSellingPrice))*(1+stRate)));
304
var ourTp=(parseFloat(voiSellingPrice)-parseFloat(voiSellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCostSnapdeal+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(voiSellingPrice))*(1+stRate)));
304
var vatValue=(((voiSellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
305
var vatValue=(((voiSellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
305
var inHouseCost=(+vatValue+pc+((returnProvision/100)*voiSellingPrice)+othCost);
306
var inHouseCost=(+vatValue+pc+((returnProvision/100)*voiSellingPrice)+othCost);
306
var lowestTp=(+nlc+inHouseCost).toFixed(2);
307
var lowestTp=(+nlc+inHouseCost).toFixed(2);
307
if (pgFeeRate*parseFloat(voiSellingPrice)>=20){
308
if (pgFeeRate*parseFloat(voiSellingPrice)>=20){
308
	var lowestSp=(+nlc+(+courierCost+closingFee)*(1+stRate)*(1+vat)+(pc+othCost)*(1+vat))/(1-(comRate+emiFee+pgFeeRate)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));	
309
	var lowestSp=(+nlc+(+courierCostSnapdeal+closingFee)*(1+stRate)*(1+vat)+(pc+othCost)*(1+vat))/(1-(comRate+emiFee+pgFeeRate)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));	
309
}
310
}
310
else{
311
else{
311
	var lowestSp=(+nlc+(+courierCost+closingFee+20)*(1+stRate)*(1+vat)+(pc+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
312
	var lowestSp=(+nlc+(+courierCostSnapdeal+closingFee+20)*(1+stRate)*(1+vat)+(pc+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
312
}
313
}
313
ourTp = (parseFloat(ourTp)).toFixed(2);
314
ourTp = (parseFloat(ourTp)).toFixed(2);
314
$('input#minPosTpVoi').val(lowestTp);
315
$('input#minPosTpVoi').val(lowestTp);
315
$('input#minPosSpVoi').val(parseFloat(lowestSp).toFixed(2));
316
$('input#minPosSpVoi').val(parseFloat(lowestSp).toFixed(2));
316
$('input#transferPriceVOI').val(ourTp);
317
$('input#transferPriceVOI').val(ourTp);
317
var serviceTax=(stRate*(+commisionPrice+(+courierCost))).toFixed(2);
318
var serviceTax=(stRate*(+commisionPrice+(+courierCostSnapdeal))).toFixed(2);
318
lowest_possible_tp=parseFloat(lowestTp);
319
lowest_possible_tp=parseFloat(lowestTp);
319
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
320
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
320
marginPercentage=(((ourTp-lowest_possible_tp)/voiSellingPrice)*100).toFixed(2);
321
marginPercentage=(((ourTp-lowest_possible_tp)/voiSellingPrice)*100).toFixed(2);
321
$('input#marginPerVOI').val(marginPercentage);
322
$('input#marginPerVOI').val(marginPercentage);
322
$('input#marginVOI').val(newMargin);
323
$('input#marginVOI').val(newMargin);
Line 517... Line 518...
517
<tr>
518
<tr>
518
<td class="detail">SUPC Code</td>
519
<td class="detail">SUPC Code</td>
519
<td class="value"><input id="supc" name="supc" value='' type="text"></td>
520
<td class="value"><input id="supc" name="supc" value='' type="text"></td>
520
</tr>
521
</tr>
521
<tr>
522
<tr>
522
<td class="detail"></td>
523
<td class="detail">Item Id &#64; Snapdeal VOI</td>
523
<td class="value"></td>
524
	<td class="value"><input id="sdVoiItemCode" name="sdVoiItemCode" value='' type="text"></td>
524
</tr>
525
</tr>
-
 
526
<tr>
525
</tbody>
527
</tbody>
526
</table>
528
</table>
527
</div>
529
</div>
528
<div class="left" style="float: right; width: 48%;">
530
<div class="left" style="float: right; width: 48%;">
529
<table id="upload" style="text-align: center;width: 100%;height:200px;">
531
<table id="upload" style="text-align: center;width: 100%;height:200px;">
Line 601... Line 603...
601
<tr>
603
<tr>
602
<td class="detail">Commission&nbsp;&#37;</td>
604
<td class="detail">Commission&nbsp;&#37;</td>
603
<td class="value"><input id="commissionRate" name="commissionRate" value=''type="text" disabled/></td>
605
<td class="value"><input id="commissionRate" name="commissionRate" value=''type="text" disabled/></td>
604
</tr>
606
</tr>
605
<tr>
607
<tr>
-
 
608
<td class="detail">Commission VOI &nbsp;&#37;</td>
-
 
609
<td class="value"><input id="commissionRateVoi" name="commissionRateVoi" value=''type="text" onkeyup="calculateStuff()" /></td>
-
 
610
</tr>
-
 
611
<tr>
606
<td class="detail">Commission</td>
612
<td class="detail">Commission</td>
607
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
613
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
608
</tr>
614
</tr>
609
<tr>
615
<tr>
610
<td class="detail">Commission VOI</td>
616
<td class="detail">Commission VOI</td>
Line 629... Line 635...
629
<input id="courierCostMarketplace" name="courierCostMarketplace" value='' type="text" style="width:20%;" onkeyup="calculateStuff()">
635
<input id="courierCostMarketplace" name="courierCostMarketplace" value='' type="text" style="width:20%;" onkeyup="calculateStuff()">
630
</td>
636
</td>
631
</tr>
637
</tr>
632
<tr>
638
<tr>
633
<td class="detail">Courier Cost VOI</td>
639
<td class="detail">Courier Cost VOI</td>
634
<td>
-
 
635
<input id="courierCostVoi" name="courierCostVoi" value='' type="text" style="width:20%;" readonly/>
640
<td class="value"><input id="courierCostVoi" name="courierCostVoi" value='' type="text" style="width:20%;" readonly/>
-
 
641
<span style="font-weight:bold;color:black;">Snapdeal VOI</span>
-
 
642
<input id="courierCostMarketplaceVoi" name="courierCostMarketplaceVoi" value=''type="text" style="width:20%;" onkeyup="calculateStuff()">
636
</td>
643
</td>
637
</tr>
644
</tr>
638
<tr>
645
<tr>
639
<td class="detail">Item Id &#64; Snapdeal</td>
646
<td class="detail">Item Id &#64; Snapdeal</td>
640
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text">
647
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text">
641
</td>
648
</td>
642
</tr>
649
</tr>
643
<tr>
-
 
644
<td class="detail">Item Id &#64; Snapdeal VOI</td>
-
 
645
	<td class="value"><input id="sdVoiItemCode" name="sdVoiItemCode" value='' type="text"></td>
-
 
646
</tr>
-
 
647
<tr>
-
 
648
<td class="detail">Action</td>
650
<td class="detail">Action</td>
649
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
651
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
650
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
652
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
651
</td>
653
</td>
652
</tr>
654
</tr>