|
@@ -167,7 +167,7 @@ class autoUseChange {
|
|
|
end_contract_qty = this.helper.add(end_contract_qty, preSb.contract_qty);
|
|
|
}
|
|
|
const end_contract_tp = this.helper.mul(this.helper.div(end_contract_qty, activeQty), bills.total_price, this.decimal.tp);
|
|
|
- return preSb ? this.helper.sub(end_contract_tp, preSb.pre_contract_tp) : end_contract_tp;
|
|
|
+ return preSb ? this.helper.sub(end_contract_tp, preSb.contract_tp) : end_contract_tp;
|
|
|
} else if (info.calc_type === 'up') {
|
|
|
if (this.correct) {
|
|
|
const preSb = this.preStageBills.find(x => { return x.lid === bills.id; });
|
|
@@ -178,7 +178,7 @@ class autoUseChange {
|
|
|
end_contract_qty = this.helper.add(end_contract_qty, preSb.contract_qty);
|
|
|
}
|
|
|
const end_contract_tp = this.helper.mul(end_contract_qty, bills.unit_price, this.decimal.tp);
|
|
|
- return activeQty === end_contract_qty ? this.helper.sub(end_contract_tp, preSb.pre_contract_tp) : this.helper.mul(contract_qty, bills.unit_price, this.decimal.tp);
|
|
|
+ return activeQty === end_contract_qty ? this.helper.sub(end_contract_tp, preSb.contract_tp) : this.helper.mul(contract_qty, bills.unit_price, this.decimal.tp);
|
|
|
} else {
|
|
|
return this.helper.mul(contract_qty, bills.unit_price, this.decimal.tp);
|
|
|
}
|