MaiXinRong 2 周之前
父节点
当前提交
34cdaca9cc
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/service/stage_change.js

+ 2 - 2
app/service/stage_change.js

@@ -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);
             }