Subversion Repositories SmartDukaan

Rev

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

Rev 9923 Rev 10287
Line 165... Line 165...
165
	$('input#transferPrice').val('0.00');
165
	$('input#transferPrice').val('0.00');
166
	$('input#minPosTp').val('0.00');
166
	$('input#minPosTp').val('0.00');
167
	$('input#minPosSp').val('0.00');
167
	$('input#minPosSp').val('0.00');
168
}
168
}
169
else{
169
else{
170
var com=$('#commissionRate').val();
-
 
171
var comRate=com/100;
-
 
172
var serviceTaxRate=$('#serviceTaxRate').val();
170
var serviceTaxRate=$('#serviceTaxRate').val();
173
var stRate = serviceTaxRate/100;
171
var stRate = serviceTaxRate/100;
-
 
172
var com=$('#commissionRate').val();
-
 
173
var pgFee=$('#pgFee').val();
-
 
174
var comRate=(com/100);
-
 
175
console.log(comRate);
-
 
176
console.log(pgFee);
-
 
177
var pgFeeRate=pgFee/100;
174
var emiFeeRate=$('#emiFee').val();
178
var emiFeeRate=$('#emiFee').val();
175
var emiFee=emiFeeRate/100;
179
var emiFee=emiFeeRate/100;
176
var closingFee=parseFloat($('#closingFee').val());
180
var closingFee=parseFloat($('#closingFee').val());
177
var returnProvision=parseFloat($('#returnProvision').val());
181
var returnProvision=parseFloat($('#returnProvision').val());
178
var margin=$('#margin').val();
182
var margin=$('#margin').val();
179
var vatRate=$('#vat').val();
183
var vatRate=$('#vat').val();
180
var vat=vatRate/100;
184
var vat=vatRate/100;
-
 
185
if (pgFeeRate*parseFloat(sellingPrice)>=20){
-
 
186
	var commisionPrice=((comRate+pgFeeRate)*sellingPrice).toFixed(2);
-
 
187
}
-
 
188
else{
181
var commisionPrice=((comRate)*sellingPrice).toFixed(2);
189
	var commisionPrice=(comRate*sellingPrice+20).toFixed(2);
-
 
190
}
182
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate)));
191
var ourTp=(parseFloat(sellingPrice)-parseFloat(sellingPrice)*(1+stRate)*((comRate)+emiFee)-((courierCost+closingFee)*(1+stRate))-(Math.max(20,pgFeeRate*parseFloat(sellingPrice))*(1+stRate)));
-
 
192
console.log(ourTp);
183
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
193
var vatValue=(((sellingPrice/(1+vat))-(nlc/(1+vat)))*vat).toFixed(2);
184
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
194
var inHouseCost=(+vatValue+15+((returnProvision/100)*sellingPrice)+othCost);
185
console.log(inHouseCost);
195
console.log(inHouseCost);
186
var lowestTp=(+nlc+inHouseCost).toFixed(2);
196
var lowestTp=(+nlc+inHouseCost).toFixed(2);
-
 
197
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));	
-
 
199
}
-
 
200
else{
187
var lowestSp=(+nlc+(courierCost+closingFee)*(1+stRate)*(1+vat)+(15+othCost)*(1+vat))/(1-(comRate+emiFee)*(1+stRate)*(1+vat)-(returnProvision/100)*(1+vat));
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));
-
 
202
}
188
ourTp = (parseFloat(ourTp)).toFixed(2);
203
ourTp = (parseFloat(ourTp)).toFixed(2);
189
$('input#minPosTp').val(lowestTp);
204
$('input#minPosTp').val(lowestTp);
190
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
205
$('input#minPosSp').val(parseFloat(lowestSp).toFixed(2));
191
$('input#transferPrice').val(ourTp);
206
$('input#transferPrice').val(ourTp);
192
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
207
var serviceTax=(stRate*(+commisionPrice+courierCost)).toFixed(2);
Line 533... Line 548...
533
</tr>
548
</tr>
534
<tr class="detail" style="display:none;"></td>
549
<tr class="detail" style="display:none;"></td>
535
<td>
550
<td>
536
	<input id="serviceTaxRate" name="serviceTaxRate" value='$mpDetail.getServiceTax()' type="text" disabled/>
551
	<input id="serviceTaxRate" name="serviceTaxRate" value='$mpDetail.getServiceTax()' type="text" disabled/>
537
</td>
552
</td>
-
 
553
<td>
-
 
554
	<input id="pgFee" name="pgFee" value='$mpDetail.getPgFee()' type="text" disabled/>
-
 
555
</td>
538
</tr>
556
</tr>
539
</tbody>
557
</tbody>
540
</table>
558
</table>
541
</div>
559
</div>
542
</form>
560
</form>