|
@@ -294,7 +294,7 @@ module.exports = app => {
|
|
|
if (d.change) {
|
|
|
for (const c of d.change) {
|
|
|
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 ncs = { tid: stage.tid, sid: stage.id, lid: b.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);
|
|
|
insertChangeData.push(ncs);
|