| Line 151... |
Line 151... |
| 151 |
$('input#commission').val('0.00');
|
151 |
$('input#commission').val('0.00');
|
| 152 |
$('input#serviceTax').val('0.00');
|
152 |
$('input#serviceTax').val('0.00');
|
| 153 |
$('input#').val('0.00');
|
153 |
$('input#').val('0.00');
|
| 154 |
}
|
154 |
}
|
| 155 |
else{
|
155 |
else{
|
| 156 |
var com=$('#commissionRate').val();
|
- |
|
| 157 |
var comRate=com/100;
|
- |
|
| 158 |
var serviceTaxRate=$('#serviceTaxRate').val();
|
156 |
var serviceTaxRate=$('#serviceTaxRate').val();
|
| 159 |
console.log(serviceTaxRate)
|
157 |
console.log(serviceTaxRate)
|
| 160 |
var stRate = serviceTaxRate/100;
|
158 |
var stRate = serviceTaxRate/100;
|
| - |
|
159 |
var com=$('#commissionRate').val();
|
| - |
|
160 |
var comRate=(com/100);
|
| - |
|
161 |
console.log(comRate);
|
| - |
|
162 |
var pgVal=$('#pgFee').val();
|
| - |
|
163 |
var pgFeeRate=pgVal/100;
|
| - |
|
164 |
console.log(pgVal);
|
| 161 |
var emiFeeRate=$('#emiFee').val();
|
165 |
var emiFeeRate=$('#emiFee').val();
|
| 162 |
console.log(emiFeeRate);
|
166 |
console.log(emiFeeRate);
|
| 163 |
var emiFee=emiFeeRate/100;
|
167 |
var emiFee=emiFeeRate/100;
|
| 164 |
var closingFee=parseFloat($('#closingFee').val());
|
168 |
var closingFee=parseFloat($('#closingFee').val());
|
| 165 |
var returnProvision=parseFloat($('#returnProvision').val());
|
169 |
var returnProvision=parseFloat($('#returnProvision').val());
|
| 166 |
console.log(returnProvision);
|
170 |
console.log(returnProvision);
|
| 167 |
console.log(closingFee);
|
171 |
console.log(closingFee);
|
| - |
|
172 |
console.log(pgFeeRate);
|
| 168 |
var margin=$('#margin').val();
|
173 |
var margin=$('#margin').val();
|
| 169 |
var vatRate=$('#vat').val();
|
174 |
var vatRate=$('#vat').val();
|
| 170 |
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
|
175 |
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
|
| 171 |
jAlert('Please enter VAT Rate for item','ERROR');
|
176 |
jAlert('Please enter VAT Rate for item','ERROR');
|
| 172 |
$('input#sellingPrice').val('0.00');
|
177 |
$('input#sellingPrice').val('0.00');
|
| 173 |
return false;
|
178 |
return false;
|
| 174 |
}
|
179 |
}
|
| 175 |
var vat=vatRate/100;
|
180 |
var vat=vatRate/100;
|
| - |
|
181 |
if (pgFeeRate*parseFloat(sellingPrice)>=20){
|
| - |
|
182 |
var commisionPrice=((comRate+pgFeeRate)*parseFloat(sellingPrice)).toFixed(2);
|
| - |
|
183 |
}
|
| - |
|
184 |
else{
|
| 176 |
var commisionPrice=((comRate)*sellingPrice).toFixed(2);
|
185 |
var commisionPrice=(comRate*parseFloat(sellingPrice)+20).toFixed(2);
|
| - |
|
186 |
console.log("Default pg fee block");
|
| - |
|
187 |
}
|
| - |
|
188 |
console.log(commisionPrice);
|
| 177 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate)));
|
189 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
|
| 178 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
190 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
| 179 |
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
|
191 |
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
|
| 180 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
192 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
| - |
|
193 |
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 |
}
|
| - |
|
196 |
else{
|
| 181 |
var lowestSp=(+nlc+(courierCost+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
|
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 |
}
|
| 182 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
199 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
| 183 |
$('input#minPosTp').val(lowestTp);
|
200 |
$('input#minPosTp').val(lowestTp);
|
| 184 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
201 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
| 185 |
$('input#transferPrice').val(ourTp);
|
202 |
$('input#transferPrice').val(ourTp);
|
| 186 |
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
|
203 |
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
|
| Line 255... |
Line 272... |
| 255 |
$('input#serviceTax').val('0.0');
|
272 |
$('input#serviceTax').val('0.0');
|
| 256 |
$('input#courierCost').val('0.0');
|
273 |
$('input#courierCost').val('0.0');
|
| 257 |
$('input#maxNlc').val(parsedData.MaxNlc);
|
274 |
$('input#maxNlc').val(parsedData.MaxNlc);
|
| 258 |
$('input#warehouseId').val(whId);
|
275 |
$('input#warehouseId').val(whId);
|
| 259 |
$('input#vat').val(parsedData.VatRate);
|
276 |
$('input#vat').val(parsedData.VatRate);
|
| - |
|
277 |
$('input#pgFee').val(parsedData.PgFee);
|
| 260 |
calculateStuff();
|
278 |
calculateStuff();
|
| 261 |
},
|
279 |
},
|
| 262 |
error : function() {
|
280 |
error : function() {
|
| 263 |
alert("Either item id is already present in snapdeal item or not a valid item Id");
|
281 |
alert("Either item id is already present in snapdeal item or not a valid item Id");
|
| 264 |
},
|
282 |
},
|
| Line 462... |
Line 480... |
| 462 |
</td>
|
480 |
</td>
|
| 463 |
</tr>
|
481 |
</tr>
|
| 464 |
<tr class="detail" style="display:none;"></td>
|
482 |
<tr class="detail" style="display:none;"></td>
|
| 465 |
<td>
|
483 |
<td>
|
| 466 |
<input id="serviceTaxRate" name="serviceTaxRate" value='' type="text" disabled/>
|
484 |
<input id="serviceTaxRate" name="serviceTaxRate" value='' type="text" disabled/>
|
| - |
|
485 |
<input id="pgFee" name="pgFee" value='' type="text" disabled/>
|
| 467 |
</td>
|
486 |
</td>
|
| 468 |
</tr>
|
487 |
</tr>
|
| 469 |
</tbody>
|
488 |
</tbody>
|
| 470 |
</table>
|
489 |
</table>
|
| 471 |
</div>
|
490 |
</div>
|