Sfoglia il codice sorgente

暂存计量,正负变更初始化值

MaiXinRong 2 anni fa
parent
commit
e2c3070c67
1 ha cambiato i file con 4 aggiunte e 2 eliminazioni
  1. 4 2
      app/service/stage_stash.js

+ 4 - 2
app/service/stage_stash.js

@@ -244,13 +244,15 @@ module.exports = app => {
                         const nps = { tid: stage.tid, sid: stage.id, said, lid: b.id, pid: p.id, times: 1, order: 0 };
                         nps.contract_qty = this.ctx.helper.round(bp.contract_qty, decimal.qty);
                         nps.qc_qty = 0;
+                        nps.positive_qc_qty = 0;
+                        nps.negative_qc_qty = 0;
                         insertPosData.push(nps);
                         if (bp.change) {
                             for (const c of bp.change) {
                                 if (!c.qty) continue;
                                 const ncs = { tid: stage.tid, sid: stage.id, lid: b.id, pid: p.id, stimes: 1, sorder: 0, cid: c.cid, cbid: c.cbid, minus: c.minus, no_value: c.no_value };
                                 const validQty = await this.ctx.service.stageChangeFinal.getChangeBillsValidQty(c.cbid);
-                                ncs.qty = ncs.minus ? math.max(validQty, c.qty) : math.min(validQty, c.qty);
+                                ncs.qty = ncs.minus ? Math.max(validQty, c.qty) : Math.min(validQty, c.qty);
                                 insertChangeData.push(ncs);
                                 if (!ncs.no_value) nps.qc_qty = await this.ctx.helper.add(nps.qc_qty, ncs.qty);
                                 if (ncs.minus) {
@@ -286,7 +288,7 @@ module.exports = app => {
                                 if (!c.qty) continue;
                                 const ncs = { tid: stage.tid, sid: stage.id, lid: d.id, pid: -1, stimes: 1, sorder: 0, cid: c.cid, cbid: c.cbid, minus: c.minus, no_value: c.no_value };
                                 const validQty = await this.ctx.service.stageChangeFinal.getChangeBillsValidQty(c.cbid);
-                                ncs.qty = ncs.minus ? math.max(validQty, c.qty) : math.min(validQty, c.qty);
+                                ncs.qty = ncs.minus ? Math.max(validQty, c.qty) : Math.min(validQty, c.qty);
                                 insertChangeData.push(ncs);
                                 if (!ncs.no_value) nbs.qc_qty = this.ctx.helper.add(nbs.qc_qty, ncs.qty);
                                 if (ncs.minus) {