| Line 127... |
Line 127... |
| 127 |
$('input#margin').removeClass();
|
127 |
$('input#margin').removeClass();
|
| 128 |
$('input#marginPer').removeClass();
|
128 |
$('input#marginPer').removeClass();
|
| 129 |
var itemWeight=$('#itemWeight').val();
|
129 |
var itemWeight=$('#itemWeight').val();
|
| 130 |
itemWeight = +itemWeight+.05;
|
130 |
itemWeight = +itemWeight+.05;
|
| 131 |
console.log(itemWeight);
|
131 |
console.log(itemWeight);
|
| - |
|
132 |
var packagingCost=$('#packagingCost').val();
|
| 132 |
if (itemWeight==0){
|
133 |
if (itemWeight==0){
|
| 133 |
var courierCost =45;
|
134 |
var courierCost =45;
|
| 134 |
}
|
135 |
}
|
| 135 |
else{
|
136 |
else{
|
| 136 |
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
|
137 |
var slabs = parseInt((parseFloat(itemWeight)-.001)/.5)
|
| Line 145... |
Line 146... |
| 145 |
var courierCostSnapdeal=$('#courierCostMarketplace').val();
|
146 |
var courierCostSnapdeal=$('#courierCostMarketplace').val();
|
| 146 |
var sellingPrice=$('#sellingPrice').val();
|
147 |
var sellingPrice=$('#sellingPrice').val();
|
| 147 |
var nlc=$('#maxNlc').val();
|
148 |
var nlc=$('#maxNlc').val();
|
| 148 |
var otherCost=$('#otherCost').val();
|
149 |
var otherCost=$('#otherCost').val();
|
| 149 |
var othCost=parseFloat(otherCost);
|
150 |
var othCost=parseFloat(otherCost);
|
| - |
|
151 |
var pc=parseFloat(packagingCost);
|
| 150 |
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
|
152 |
if ( sellingPrice==null || sellingPrice=="" || isNaN(sellingPrice) || nlc==null || nlc=="" || isNaN(nlc)){
|
| 151 |
$('input#courierCost').val('0.00');
|
153 |
$('input#courierCost').val('0.00');
|
| 152 |
$('input#commission').val('0.00');
|
154 |
$('input#commission').val('0.00');
|
| 153 |
$('input#serviceTax').val('0.00');
|
155 |
$('input#serviceTax').val('0.00');
|
| 154 |
$('input#').val('0.00');
|
156 |
$('input#').val('0.00');
|
| Line 187... |
Line 189... |
| 187 |
console.log("Default pg fee block");
|
189 |
console.log("Default pg fee block");
|
| 188 |
}
|
190 |
}
|
| 189 |
console.log(+courierCostSnapdeal);
|
191 |
console.log(+courierCostSnapdeal);
|
| 190 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCostSnapdeal+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
|
192 |
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((+courierCostSnapdeal+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
|
| 191 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
193 |
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
|
| 192 |
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
|
194 |
var inHouseCost=(+vatValue+pc+((returnProvision/100)*sellingPrice)+othCost);
|
| 193 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
195 |
var lowestTp=(+nlc+inHouseCost).toFixed(2);
|
| 194 |
if (pgFeeRate*parseFloat(sellingPrice)>=20){
|
196 |
if (pgFeeRate*parseFloat(sellingPrice)>=20){
|
| 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));
|
197 |
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));
|
| 196 |
}
|
198 |
}
|
| 197 |
else{
|
199 |
else{
|
| 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));
|
200 |
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));
|
| 199 |
}
|
201 |
}
|
| 200 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
202 |
ourTp = (parseFloat(ourTp)).toFixed(2);
|
| 201 |
$('input#minPosTp').val(lowestTp);
|
203 |
$('input#minPosTp').val(lowestTp);
|
| 202 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
204 |
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
|
| 203 |
$('input#transferPrice').val(ourTp);
|
205 |
$('input#transferPrice').val(ourTp);
|
| Line 274... |
Line 276... |
| 274 |
$('input#courierCost').val('0.0');
|
276 |
$('input#courierCost').val('0.0');
|
| 275 |
$('input#maxNlc').val(parsedData.MaxNlc);
|
277 |
$('input#maxNlc').val(parsedData.MaxNlc);
|
| 276 |
$('input#warehouseId').val(whId);
|
278 |
$('input#warehouseId').val(whId);
|
| 277 |
$('input#vat').val(parsedData.VatRate);
|
279 |
$('input#vat').val(parsedData.VatRate);
|
| 278 |
$('input#pgFee').val(parsedData.PgFee);
|
280 |
$('input#pgFee').val(parsedData.PgFee);
|
| - |
|
281 |
$('input#packagingCost').val(parsedData.PackagingCost);
|
| 279 |
calculateStuff();
|
282 |
calculateStuff();
|
| 280 |
},
|
283 |
},
|
| 281 |
error : function() {
|
284 |
error : function() {
|
| 282 |
alert("Either item id is already present in snapdeal item or not a valid item Id");
|
285 |
alert("Either item id is already present in snapdeal item or not a valid item Id");
|
| 283 |
},
|
286 |
},
|
| Line 351... |
Line 354... |
| 351 |
<td class="detail">Transfer Price</td>
|
354 |
<td class="detail">Transfer Price</td>
|
| 352 |
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" readonly/></td>
|
355 |
<td class="value"><input id="transferPrice" name="transferPrice" value='' type="text" readonly/></td>
|
| 353 |
</tr>
|
356 |
</tr>
|
| 354 |
<tr>
|
357 |
<tr>
|
| 355 |
<td class="detail">Other Cost</td>
|
358 |
<td class="detail">Other Cost</td>
|
| - |
|
359 |
<td class="value">
|
| 356 |
<td class="value"><input id="otherCost" name="otherCost" value='0.0' type="text" onkeyup="calculateStuff()"</td>
|
360 |
<input id="otherCost" name="otherCost" value='0.0' type="text" onkeyup="calculateStuff()" style="width:20%;" />
|
| - |
|
361 |
<span style="font-weight:bold;color:black;">Packaging Cost</span>
|
| - |
|
362 |
<input id="packagingCost" name="packagingCost" value='0.0' type="text" style="width:20%;" readonly/>
|
| - |
|
363 |
</td>
|
| 357 |
</tr>
|
364 |
</tr>
|
| 358 |
<tr>
|
365 |
<tr>
|
| 359 |
<td class="detail">Minimum Possible SP (Calculated)</td>
|
366 |
<td class="detail">Minimum Possible SP (Calculated)</td>
|
| 360 |
<td class="value"><input id="minPosSp" name="minPosSp" value='' type="text" readonly/></td><!--Inventory details end-->
|
367 |
<td class="value"><input id="minPosSp" name="minPosSp" value='' type="text" readonly/></td><!--Inventory details end-->
|
| 361 |
</tr>
|
368 |
</tr>
|