|
|
@@ -166,7 +166,7 @@ class autoUseChange {
|
|
|
activeQty = this.helper.add(activeQty, preSb.qc_minus_qty);
|
|
|
end_contract_qty = this.helper.add(end_contract_qty, preSb.contract_qty);
|
|
|
}
|
|
|
- const end_contract_tp = activeQty ? bills.total_price : this.helper.mul(this.helper.div(end_contract_qty, activeQty), bills.total_price, this.decimal.tp);
|
|
|
+ const end_contract_tp = activeQty ? this.helper.mul(this.helper.div(end_contract_qty, activeQty), bills.total_price, this.decimal.tp) : bills.total_price;
|
|
|
return preSb ? this.helper.sub(end_contract_tp, preSb.contract_tp) : end_contract_tp;
|
|
|
} else if (info.calc_type === 'up') {
|
|
|
if (this.correct) {
|
|
|
@@ -250,9 +250,11 @@ class autoUseChange {
|
|
|
|
|
|
if (sb) {
|
|
|
const contract_tp = qc_minus_qty ? this.calcContractTp(this.info, cb.bills, sb.contract_qty || 0, qc_minus_qty) : sb.contract_tp;
|
|
|
+ console.log(qc_minus_qty, contract_tp);
|
|
|
this.updateBills.push({ id: sb.id, qc_qty, qc_tp, positive_qc_qty, positive_qc_tp, negative_qc_qty, negative_qc_tp, qc_minus_qty, contract_tp });
|
|
|
} else {
|
|
|
const contract_tp = qc_minus_qty ? this.calcContractTp(this.info, cb.bills, 0, qc_minus_qty) : 0;
|
|
|
+ console.log(qc_minus_qty, contract_tp);
|
|
|
this.insertBills.push({
|
|
|
tid: this.default.tid, sid: this.default.sid, said: this.default.said,
|
|
|
lid, contract_tp, qc_qty, qc_tp, positive_qc_qty, positive_qc_tp, negative_qc_qty, negative_qc_tp, qc_minus_qty, times: 1, order: 0
|