Subversion Repositories SmartDukaan

Rev

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

Rev 10287 Rev 11095
Line 140... Line 140...
140
	courierCost = courierCost + 35;
140
	courierCost = courierCost + 35;
141
}
141
}
142
}
142
}
143
console.log(courierCost);
143
console.log(courierCost);
144
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
144
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
-
 
145
var courierCostSnapdeal=$('#courierCostMarketplace').val();
145
var sellingPrice=$('#sellingPrice').val();
146
var sellingPrice=$('#sellingPrice').val();
146
var nlc=$('#maxNlc').val();
147
var nlc=$('#maxNlc').val();
147
var otherCost=$('#otherCost').val();
148
var otherCost=$('#otherCost').val();
148
var othCost=parseFloat(otherCost);
149
var othCost=parseFloat(otherCost);
149
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
150
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
Line 183... Line 184...
183
}
184
}
184
else{
185
else{
185
	var commisionPrice=(comRate*parseFloat(sellingPrice)+20).toFixed(2);
186
	var commisionPrice=(comRate*parseFloat(sellingPrice)+20).toFixed(2);
186
	console.log("Default pg fee block");
187
	console.log("Default pg fee block");
187
}
188
}
188
console.log(commisionPrice);
189
console.log(+courierCostSnapdeal);
189
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
190
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCostSnapdeal+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
190
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
191
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
191
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
192
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
192
var lowestTp=(+nlc+inHouseCost).toFixed(2);
193
var lowestTp=(+nlc+inHouseCost).toFixed(2);
193
if (pgFeeRate*parseFloat(sellingPrice)>=20){
194
if (pgFeeRate*parseFloat(sellingPrice)>=20){
194
	var lowestSp=(+nlc+(courierCost+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee+pgFeeRate)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));	
195
	var lowestSp=(+nlc+(+courierCostSnapdeal+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee+pgFeeRate)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));	
195
}
196
}
196
else{
197
else{
197
	var lowestSp=(+nlc+(courierCost+closingFee+20)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
198
	var lowestSp=(+nlc+(+courierCostSnapdeal+closingFee+20)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
198
}
199
}
199
ourTp = (parseFloat(ourTp)).toFixed(2);
200
ourTp = (parseFloat(ourTp)).toFixed(2);
200
$('input#minPosTp').val(lowestTp);
201
$('input#minPosTp').val(lowestTp);
201
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
202
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
202
$('input#transferPrice').val(ourTp);
203
$('input#transferPrice').val(ourTp);
203
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
204
var serviceTax=(stRate*(+commisionPrice+(+courierCostSnapdeal))).toFixed(2);
204
lowest_possible_tp=parseFloat(lowestTp);
205
lowest_possible_tp=parseFloat(lowestTp);
205
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
206
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
206
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
207
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
207
$('input#marginPer').val(marginPercentage);
208
$('input#marginPer').val(marginPercentage);
208
$('input#margin').val(newMargin);
209
$('input#margin').val(newMargin);
Line 446... Line 447...
446
<td class="detail">Service Tax</td>
447
<td class="detail">Service Tax</td>
447
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
448
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
448
</tr>
449
</tr>
449
<tr>
450
<tr>
450
<td class="detail">Courier Cost</td>
451
<td class="detail">Courier Cost</td>
451
<td class="value"><input id="courierCost" name="courierCost" value='' type="text" readonly/></td>
452
<td class="value"><input id="courierCost" name="courierCost" value='' type="text" style="width:20%;" readonly/>
-
 
453
<span style="font-weight:bold;color:black;">Snapdeal</span>
-
 
454
<input id="courierCostMarketplace" name="courierCostMarketplace" value='' type="text" style="width:20%;" onkeyup="calculateStuff()">
-
 
455
</td>
452
</tr>
456
</tr>
453
<tr>
457
<tr>
454
<td class="detail">Item Id &#64; Snapdeal</td>
458
<td class="detail">Item Id &#64; Snapdeal</td>
455
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text"></td>
459
<td class="value"><input id="sdItemCode" name="sdItemCode" value='' type="text">
-
 
460
</td>
456
</tr>
461
</tr>
457
<tr>
462
<tr>
458
<td class="detail">SUPC Code</td>
463
<td class="detail">SUPC Code</td>
459
<td class="value"><input id="supc" name="supc" value='' type="text"></td>
464
<td class="value"><input id="supc" name="supc" value='' type="text"></td>
460
</tr>
465
</tr>