|
@@ -942,16 +942,19 @@
|
|
|
prop.row.tariff = prop.row.tariff == '' || prop.row.tariff === null || !prop.row.tariff ? 0 : prop.row.tariff;
|
|
|
prop.row.intermediatorCommission =prop.row.intermediatorCommission == '' || prop.row.intermediatorCommission === null || !prop.row.intermediatorCommission? 0: prop.row.intermediatorCommission;
|
|
|
//计算销售单价
|
|
|
- if (prop.col.key == 'purchasePrice' || prop.col.key == 'taxRate' || prop.col.key == 'tariff' || prop.col.key == 'discount' || prop.col.key == 'grossMargin' || prop.col.key == 'customerCommision' || prop.col.key == 'intermediatorCommission') {
|
|
|
+ if (prop.col.key == 'purchasePrice' || prop.col.key == 'taxRate' || prop.col.key == 'tariff' || prop.col.key == 'grossMargin' || prop.col.key == 'customerCommision' || prop.col.key == 'intermediatorCommission') {
|
|
|
// var num =((prop.row.purchasePrice / Number(formData.exchangeRate)) *(1 + prop.row.taxRate / 100) *(1 + prop.row.tariff / 100) *(1 - prop.row.discount / 100)) /(1 - prop.row.grossMargin / 100 - prop.row.customerCommision / 100 - prop.row.intermediatorCommission / 100);
|
|
|
var num=(prop.row.purchasePrice * Number(formData.exchangeRate)*(1 + prop.row.tariff / 100))/(1 - prop.row.grossMargin / 100 - prop.row.customerCommision / 100-prop.row.intermediatorCommission / 100)*(1 + prop.row.taxRate / 100)
|
|
|
prop.row.salePrice = !isNaN(num) ? num.toFixed(2) : '';
|
|
|
- prop.row.preDiscountPrice =(prop.row.salePrice/(1-prop.row.discount / 100)).toFixed(2);
|
|
|
+ prop.row.taxPriceOriginal =(prop.row.salePrice/(1-prop.row.discount / 100)).toFixed(2);
|
|
|
if (prop.row.quantity) {
|
|
|
prop.row.taxAmount = (prop.row.salePrice * prop.row.quantity).toFixed(2); //计算金额
|
|
|
prop.row.purchaseAmount = (prop.row.purchasePrice * prop.row.quantity).toFixed(2); //计算采购金额
|
|
|
}
|
|
|
}
|
|
|
+ if (prop.col.key == 'discount'&& prop.row.taxPriceOriginal ) {
|
|
|
+ prop.row.salePrice = (Number(prop.row.taxPriceOriginal)*(1-prop.row.discount/100)).toFixed(2)
|
|
|
+ }
|
|
|
//计算金额
|
|
|
if (prop.col.key == 'quantity'&& prop.row.salePrice && prop.row.quantity) {
|
|
|
prop.row.taxAmount = (prop.row.salePrice * prop.row.quantity).toFixed(2);
|
|
@@ -961,7 +964,8 @@
|
|
|
prop.row.purchaseAmount = (prop.row.purchasePrice * prop.row.quantity).toFixed(2);
|
|
|
}
|
|
|
//计算毛利率/金额
|
|
|
- if (prop.col.key == 'salePrice') {
|
|
|
+ if (prop.col.key == 'taxPriceOriginal') {
|
|
|
+ prop.row.salePrice = (Number(prop.row.taxPriceOriginal)*(1-prop.row.discount/100)).toFixed(2)
|
|
|
// var num =1 - prop.row.customerCommision / 100 - prop.row.intermediatorCommission / 100-((prop.row.purchasePrice / Number(formData.exchangeRate)) *(1 + prop.row.taxRate / 100) *(1 + prop.row.tariff / 100) *(1 - prop.row.discount / 100)) /prop.row.salePrice;
|
|
|
var num = 1-(prop.row.customerCommision / 100)-(prop.row.intermediatorCommission / 100)-(prop.row.purchasePrice*Number(formData.exchangeRate)*(1 + prop.row.tariff / 100))*(1 + prop.row.tariff / 100)/prop.row.salePrice
|
|
|
num = (Number(num) * 100).toFixed(2);
|
|
@@ -969,7 +973,7 @@
|
|
|
if (prop.row.quantity) {
|
|
|
prop.row.taxAmount = (prop.row.salePrice * prop.row.quantity).toFixed(2);
|
|
|
}
|
|
|
- prop.row.preDiscountPrice =(prop.row.salePrice/(1-prop.row.discount / 100)).toFixed(2);
|
|
|
+ // prop.row.taxPriceOriginal =(prop.row.salePrice/(1-prop.row.discount / 100)).toFixed(2);
|
|
|
}
|
|
|
countGrossMargin()
|
|
|
}
|
|
@@ -986,7 +990,7 @@
|
|
|
//汇率默认为1
|
|
|
var num =(item.purchasePrice * Number(formData.exchangeRate)*(1 + item.tariff / 100))/(1 - item.grossMargin / 100 - item.customerCommision / 100-item.intermediatorCommission / 100)*(1 + item.taxRate / 100)
|
|
|
item.salePrice = !isNaN(num) ? num.toFixed(2) : '';
|
|
|
- item.preDiscountPrice =(item.salePrice/(1-item.discount / 100)).toFixed(2);
|
|
|
+ item.taxPriceOriginal =(item.salePrice/(1-item.discount / 100)).toFixed(2);
|
|
|
if (item.quantity) {
|
|
|
item.taxAmount = (item.salePrice * item.quantity).toFixed(2);
|
|
|
}
|