Subversion Repositories SmartDukaan

Rev

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

Rev 9734 Rev 9780
Line 110... Line 110...
110
	$('input#commission').val('0.00');
110
	$('input#commission').val('0.00');
111
	$('input#serviceTax').val('0.00');
111
	$('input#serviceTax').val('0.00');
112
	$('input#').val('0.00');
112
	$('input#').val('0.00');
113
}
113
}
114
else{
114
else{
115
var comRate=$('#commissionRate').val();
115
var com=$('#commissionRate').val();
-
 
116
var comRate=com/100;
-
 
117
var serviceTaxRate=$('#serviceTaxRate').val();
-
 
118
console.log(serviceTaxRate)
-
 
119
var stRate = serviceTaxRate/100;
-
 
120
var emiFeeRate=$('#emiFee').val();
-
 
121
console.log(emiFeeRate);
-
 
122
var emiFee=emiFeeRate/100;
-
 
123
var closingFee=parseFloat($('#closingFee').val());
-
 
124
var returnProvision=parseFloat($('#returnProvision').val());
-
 
125
console.log(returnProvision);
-
 
126
console.log(closingFee);
116
var margin=$('#margin').val();
127
var margin=$('#margin').val();
117
var vatRate=$('#vat').val();
128
var vatRate=$('#vat').val();
118
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
129
if ( vatRate==null || vatRate=="" || isNaN(vatRate)){
119
	jAlert('Please enter VAT Rate for item','ERROR');
130
	jAlert('Please enter VAT Rate for item','ERROR');
-
 
131
	$('input#sellingPrice').val('0.00');
120
	return false;
132
	return false;
121
}
133
}
122
var vat=vatRate/100;
134
var vat=vatRate/100;
123
var commisionPrice=((comRate/100)*sellingPrice).toFixed(2);
135
var commisionPrice=((comRate)*sellingPrice).toFixed(2);
124
var ourTp=(sellingPrice-sellingPrice*1.1236*(comRate/100)-((courierCost+0)*1.1236));
136
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate)));
125
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
137
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
126
inHouseCost=(+vatValue+15+((.5/100)*sellingPrice)+othCost);
138
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
127
var lowestTp=(+nlc+inHouseCost).toFixed(2);
139
var lowestTp=(+nlc+inHouseCost).toFixed(2);
128
var lowestSp=(+nlc+(courierCost+0)*1.1236*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate/100+0)*1.1236*(1+vat)-.005*(1+vat));
140
var lowestSp=(+nlc+(courierCost+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
129
ourTp = (parseFloat(ourTp)).toFixed(2);
141
ourTp = (parseFloat(ourTp)).toFixed(2);
130
$('input#minPosTp').val(lowestTp);
142
$('input#minPosTp').val(lowestTp);
131
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
143
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
132
$('input#transferPrice').val(ourTp);
144
$('input#transferPrice').val(ourTp);
133
var serviceTax=(.1236*(+commisionPrice+courierCost)).toFixed(2);
145
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
134
lowest_possible_tp=parseFloat(lowestTp);
146
lowest_possible_tp=parseFloat(lowestTp);
135
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
147
newMargin=(ourTp-lowest_possible_tp).toFixed(2);
136
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
148
marginPercentage=(((ourTp-lowest_possible_tp)/sellingPrice)*100).toFixed(2);
137
$('input#marginPer').val(marginPercentage);
149
$('input#marginPer').val(marginPercentage);
138
$('input#margin').val(newMargin);
150
$('input#margin').val(newMargin);
Line 178... Line 190...
178
		$('input#itemWeight').val(parsedData.Weight);
190
		$('input#itemWeight').val(parsedData.Weight);
179
		$('input#risky').val(parsedData.Risky);
191
		$('input#risky').val(parsedData.Risky);
180
		$('input#status').val(parsedData.Status);
192
		$('input#status').val(parsedData.Status);
181
		$('input#webisteMrp').val(parsedData.MRP);
193
		$('input#webisteMrp').val(parsedData.MRP);
182
		$('input#webisteSellingPrice').val(parsedData.SellingPrice);
194
		$('input#webisteSellingPrice').val(parsedData.SellingPrice);
-
 
195
		$('input#commissionRate').val(parsedData.CommissionRate);
-
 
196
		$('input#returnProvision').val(parsedData.ReturnProvision);
-
 
197
		$('input#emiFee').val(parsedData.EmiFee);
-
 
198
		$('input#closingFee').val(parsedData.ClosingFee);
-
 
199
		$('input#serviceTaxRate').val(parsedData.ServiceTaxRate);
183
		$('input#sellingPrice').val('0.0');
200
		$('input#sellingPrice').val('0.0');
184
		$('input#transferPrice').val('0.0');
201
		$('input#transferPrice').val('0.0');
185
		$('input#exceptionPrice').val('0.0');
202
		$('input#exceptionPrice').val('0.0');
186
		$('input#commission').val('0.0');
203
		$('input#commission').val('0.0');
187
		$('input#serviceTax').val('0.0');
204
		$('input#serviceTax').val('0.0');
Line 248... Line 265...
248
<td class="detail">Warehouse Id</td>
265
<td class="detail">Warehouse Id</td>
249
<td class="value">
266
<td class="value">
250
	<input id="warehouseId" name="warehouseId" value='' type="text"/></td>
267
	<input id="warehouseId" name="warehouseId" value='' type="text"/></td>
251
</tr>
268
</tr>
252
<tr>
269
<tr>
-
 
270
<td class="detail">Max NLC</td>
-
 
271
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text" readonly/></td>
-
 
272
</tr>
-
 
273
<tr>
253
<td class="detail">Snapdeal Selling Price</td>
274
<td class="detail">Snapdeal Selling Price</td>
254
<td class="value">
275
<td class="value">
255
	<input id="sellingPrice" name="sellingPrice" value='' type="text" onkeyup="calculateStuff()"></td>
276
	<input id="sellingPrice" name="sellingPrice" value='' type="text" onkeyup="calculateStuff()"></td>
256
</tr>
277
</tr>
257
<tr>
278
<tr>
Line 262... Line 283...
262
<td class="detail">Other Cost</td>
283
<td class="detail">Other Cost</td>
263
<td class="value"><input id="otherCost" name="otherCost" value='0.0' type="text" onkeyup="calculateStuff()"</td>
284
<td class="value"><input id="otherCost" name="otherCost" value='0.0' type="text" onkeyup="calculateStuff()"</td>
264
</tr>
285
</tr>
265
<tr>
286
<tr>
266
<td class="detail">Minimum Possible SP (Calculated)</td>
287
<td class="detail">Minimum Possible SP (Calculated)</td>
267
<td class="value"><input id="minPosSp" name="minPosSp" value='' type="text" readonly/></td>
288
<td class="value"><input id="minPosSp" name="minPosSp" value='' type="text" readonly/></td><!--Inventory details end-->
268
</tr>
289
</tr>
269
<tr>
290
<tr>
270
<td class="detail">Minimum Possible TP (Calculated)</td>
291
<td class="detail">Minimum Possible TP (Calculated)</td>
271
<td class="value">
292
<td class="value">
272
	<input id="minPosTp" name="minPosTp" value='' type="text" readonly/>
293
	<input id="minPosTp" name="minPosTp" value='' type="text" readonly/>
Line 278... Line 299...
278
</tr>
299
</tr>
279
<tr>
300
<tr>
280
<td class="detail">Website Selling Price</td>
301
<td class="detail">Website Selling Price</td>
281
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" disabled/></td>
302
<td class="value"><input id="webisteSellingPrice" name="webisteSellingPrice" value='' type="text" disabled/></td>
282
</tr>
303
</tr>
283
<tr>
-
 
284
<td class="detail">Max NLC</td>
-
 
285
<td class="value"><input id="maxNlc" name="maxNlc" value=''type="text" readonly/></td>
-
 
286
</tr>
-
 
287
</tbody>
304
</tbody>
288
</table>
305
</table>
289
</div>
306
</div>
290
<div class="left" style="float: right; width: 48%;">
307
<div class="left" style="float: right; width: 48%;">
291
<table id="upload" style="text-align: center;width: 100%;height:200px;">
308
<table id="upload" style="text-align: center;width: 100%;height:200px;">
Line 340... Line 357...
340
<td class="detail">Exception Price</td>
357
<td class="detail">Exception Price</td>
341
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
358
<td class="value"><input id="exceptionPrice" name="exceptionPrice" value='' type="text"/></td>
342
</tr>
359
</tr>
343
<tr>
360
<tr>
344
<td class="detail">Commission&nbsp;&#37;</td>
361
<td class="detail">Commission&nbsp;&#37;</td>
345
<td class="value"><input id="commissionRate" name="commissionRate" value='3.59'type="text" disabled/></td>
362
<td class="value"><input id="commissionRate" name="commissionRate" value=''type="text" disabled/></td>
346
</tr>
363
</tr>
347
<tr>
364
<tr>
348
<td class="detail">Commission</td>
365
<td class="detail">Commission</td>
349
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
366
<td class="value"><input id="commission" name="commission" value='' type="text" readonly/></td>
350
</tr>
367
</tr>
351
<tr>
368
<tr>
352
<td class="detail">VAT&nbsp;&#37;</td>
369
<td class="detail">VAT&nbsp;&#37;</td>
353
<td class="value"><input id="vat" name="vat" value='' type="text" ></td>
370
<td class="value"><input id="vat" name="vat" value='' type="text" onkeyup="calculateStuff()"></td>
354
</tr>
371
</tr>
355
<tr>
372
<tr>
356
<td class="detail">Service Tax</td>
373
<td class="detail">Service Tax</td>
357
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
374
<td class="value"><input id="serviceTax" name="serviceTax" value='' type="text" readonly/></td>
358
</tr>
375
</tr>
Line 372... Line 389...
372
<td class="detail">Action</td>
389
<td class="detail">Action</td>
373
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
390
<td class="value"><input type="submit" value="Update" name="upload" style="width: 25%;">
374
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
391
<input type="button" style="padding-left: 5px; margin-left: 10px;width: 25%;" id="cancelbutton" name="cancel" value="Cancel">
375
</td>
392
</td>
376
</tr>
393
</tr>
-
 
394
<tr class="detail" style="display:none;"></td>
-
 
395
<td>
-
 
396
	<input id="returnProvision" name="returnProvision" value='' type="text" disabled/>
-
 
397
</td>
-
 
398
</tr>
-
 
399
<tr class="detail" style="display:none;"></td>
-
 
400
<td>
-
 
401
	<input id="emiFee" name="emiFee" value='' type="text" disabled/>
-
 
402
</td>
-
 
403
</tr>
-
 
404
<tr class="detail" style="display:none;"></td>
-
 
405
<td>
-
 
406
	<input id="closingFee" name="closingFee" value='' type="text" disabled/>
-
 
407
</td>
-
 
408
</tr>
-
 
409
<tr class="detail" style="display:none;"></td>
-
 
410
<td>
-
 
411
	<input id="serviceTaxRate" name="serviceTaxRate" value='' type="text" disabled/>
-
 
412
</td>
-
 
413
</tr>
377
</tbody>
414
</tbody>
378
</table>
415
</table>
379
</div>
416
</div>
380
</form>
417
</form>