MaiXinRong %!s(int64=3) %!d(string=hai) anos
pai
achega
b7598c9393
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      app/service/stage_change.js

+ 3 - 1
app/service/stage_change.js

@@ -467,8 +467,10 @@ module.exports = app => {
             }
             const stageChangeBills = await this._getChangeBillsWithUsedInfo(stage);
             for (const scb of stageChangeBills) {
+                if (!scb.qty) continue;
+
                 const cb = changeBillsIndex[scb.cbid];
-                cb.used_qty = this.ctx.helper.add(cb.used_qty, scb.qty);
+                if (cb) cb.used_qty = this.ctx.helper.add(cb.used_qty, scb.qty);
             }
             for (const cid in changeBillsPart) {
                 const c = change.find(x => { return x.cid === cid });