| Line 153... |
Line 153... |
| 153 |
courierCost = courierCost + 35;
|
153 |
courierCost = courierCost + 35;
|
| 154 |
}
|
154 |
}
|
| 155 |
}
|
155 |
}
|
| 156 |
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
|
156 |
//courierCost = ((courierCost+0)*1.1236).toFixed(2);
|
| 157 |
var sellingPrice=$('#sellingPrice').val();
|
157 |
var sellingPrice=$('#sellingPrice').val();
|
| - |
|
158 |
var courierCostSnapdeal=$('#courierCostMarketplace').val();
|
| 158 |
var nlc=$('#maxNlc').val();
|
159 |
var nlc=$('#maxNlc').val();
|
| 159 |
var otherCost=$('#otherCost').val();
|
160 |
var otherCost=$('#otherCost').val();
|
| 160 |
var othCost=parseFloat(otherCost);
|
161 |
var othCost=parseFloat(otherCost);
|
| 161 |
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
|
162 |
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
|
| 162 |
$('input#courierCost').val('0.00');
|
163 |
$('input#courierCost').val('0.00');
|
| Line 172... |
Line 173... |
| 172 |
var com=$('#commissionRate').val();
|
173 |
var com=$('#commissionRate').val();
|
| 173 |
var pgFee=$('#pgFee').val();
|
174 |
var pgFee=$('#pgFee').val();
|
| 174 |
var comRate=(com/100);
|
175 |
var comRate=(com/100);
|
| 175 |
console.log(comRate);
|
176 |
console.log(comRate);
|
| 176 |
console.log(pgFee);
|
177 |
console.log(pgFee);
|
| - |
|
178 |
console.log(courierCostSnapdeal);
|
| 177 |
var pgFeeRate=pgFee/100;
|
179 |
var pgFeeRate=pgFee/100;
|
| 178 |
var emiFeeRate=$('#emiFee').val();
|
180 |
var emiFeeRate=$('#emiFee').val();
|
| 179 |
var emiFee=emiFeeRate/100;
|
181 |
var emiFee=emiFeeRate/100;
|
| 180 |
var closingFee=parseFloat($('#closingFee').val());
|
182 |
var closingFee=parseFloat($('#closingFee').val());
|
| 181 |
var returnProvision=parseFloat($('#returnProvision').val());
|
183 |
var returnProvision=parseFloat($('#returnProvision').val());
|
| Line 186... |
Line 188... |
| 186 |
var commisionPrice=((comRate+pgFeeRate)*sellingPrice).toFixed(2);
|
188 |
var commisionPrice=((comRate+pgFeeRate)*sellingPrice).toFixed(2);
|
| 187 |
}
|
189 |
}
|
| 188 |
else{
|
190 |
else{
|
| 189 |
var commisionPrice=(comRate*sellingPrice+20).toFixed(2);
|
191 |
var commisionPrice=(comRate*sellingPrice+20).toFixed(2);
|
| 190 |
}
|
192 |
}
|
| 191 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
|
193 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCostSnapdeal+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
|
| 192 |
console.log(ourTp);
|
194 |
console.log(ourTp);
|
| 193 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
195 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
| 194 |
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
|
196 |
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
|
| 195 |
console.log(inHouseCost);
|
197 |
console.log(inHouseCost);
|
| 196 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
198 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
| 197 |
if (pgFeeRate*parseFloat(sellingPrice)>=20){
|
199 |
if (pgFeeRate*parseFloat(sellingPrice)>=20){
|
| 198 |
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));
|
200 |
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));
|
| 199 |
}
|
201 |
}
|
| 200 |
else{
|
202 |
else{
|
| 201 |
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));
|
203 |
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));
|
| 202 |
}
|
204 |
}
|
| 203 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
205 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
| 204 |
$('input#minPosTp').val(lowestTp);
|
206 |
$('input#minPosTp').val(lowestTp);
|
| 205 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
207 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
| 206 |
$('input#transferPrice').val(ourTp);
|
208 |
$('input#transferPrice').val(ourTp);
|
| 207 |
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
|
209 |
var serviceTax=(stRate*(+commisionPrice+(+courierCostSnapdeal))).toFixed(2);
|
| 208 |
lowest_possible_tp=parseFloat(lowestTp);
|
210 |
lowest_possible_tp=parseFloat(lowestTp);
|
| 209 |
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
|
211 |
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
|
| 210 |
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
|
212 |
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
|
| 211 |
$('input#marginPer').val(marginPercentage);
|
213 |
$('input#marginPer').val(marginPercentage);
|
| 212 |
$('input#margin').val(newMargin);
|
214 |
$('input#margin').val(newMargin);
|
| Line 496... |
Line 498... |
| 496 |
<td class="detail">Service Tax</td>
|
498 |
<td class="detail">Service Tax</td>
|
| 497 |
<td class="value"><input id="serviceTax" name="serviceTax" value='$itemDetail.getServiceTax()'type="text" readonly/></td>
|
499 |
<td class="value"><input id="serviceTax" name="serviceTax" value='$itemDetail.getServiceTax()'type="text" readonly/></td>
|
| 498 |
</tr>
|
500 |
</tr>
|
| 499 |
<tr>
|
501 |
<tr>
|
| 500 |
<td class="detail">Courier Cost</td>
|
502 |
<td class="detail">Courier Cost</td>
|
| 501 |
<td class="value"><input id="courierCost" name="courierCost" value='$itemDetail.getCourierCost()'type="text" readonly/></td>
|
503 |
<td class="value"><input id="courierCost" name="courierCost" value='$itemDetail.getCourierCost()'type="text" style="width:20%;" readonly/>
|
| - |
|
504 |
<span style="font-weight:bold;color:black;">Snapdeal</span>
|
| - |
|
505 |
<input id="courierCostMarketplace" name="courierCostMarketplace" value='$itemDetail.getCourierCostMarketplace()'type="text" style="width:20%;" onkeyup="calculateStuff()">
|
| - |
|
506 |
</td>
|
| - |
|
507 |
|
| 502 |
</tr>
|
508 |
</tr>
|
| 503 |
<tr>
|
509 |
<tr>
|
| 504 |
<td class="detail">VAT %</td>
|
510 |
<td class="detail">VAT %</td>
|
| 505 |
<td class="value"><input id="vat" name="vat" value='$mpDetail.getVat()' type="text" onkeyup="calculateStuff()"></td>
|
511 |
<td class="value"><input id="vat" name="vat" value='$mpDetail.getVat()' type="text" onkeyup="calculateStuff()"></td>
|
| 506 |
</tr>
|
512 |
</tr>
|