|
@@ -1007,8 +1007,9 @@ module.exports = app => {
|
|
|
info.sjcl_qty = this.ctx.helper.add(info.sjcl_qty, data.sjcl_qty);
|
|
|
info.qtcl_qty = this.ctx.helper.add(info.qtcl_qty, data.qtcl_qty);
|
|
|
info.quantity = this.ctx.helper.add(info.quantity, data.quantity);
|
|
|
+ info.ex_qty1 = this.ctx.helper.add(info.ex_qty1, data.ex_qty1);
|
|
|
} else {
|
|
|
- needUpdateLedgerList.push({ id: data.lid, sgfh_qty: data.sgfh_qty, sjcl_qty: data.sjcl_qty, qtcl_qty: data.qtcl_qty, quantity: data.quantity });
|
|
|
+ needUpdateLedgerList.push({ id: data.lid, sgfh_qty: data.sgfh_qty, sjcl_qty: data.sjcl_qty, qtcl_qty: data.qtcl_qty, quantity: data.quantity, ex_qty1: data.ex_qty1 });
|
|
|
}
|
|
|
} else {
|
|
|
const info = this._.find(needUpdateChangeLedgerList, { id: data.lid });
|
|
@@ -1017,8 +1018,9 @@ module.exports = app => {
|
|
|
info.sjcl_qty = this.ctx.helper.add(info.sjcl_qty, data.sjcl_qty);
|
|
|
info.qtcl_qty = this.ctx.helper.add(info.qtcl_qty, data.qtcl_qty);
|
|
|
info.quantity = this.ctx.helper.add(info.quantity, data.quantity);
|
|
|
+ info.ex_qty1 = this.ctx.helper.add(info.ex_qty1, data.ex_qty1);
|
|
|
} else {
|
|
|
- needUpdateChangeLedgerList.push({ id: data.lid, sgfh_qty: data.sgfh_qty, sjcl_qty: data.sjcl_qty, qtcl_qty: data.qtcl_qty, quantity: data.quantity });
|
|
|
+ needUpdateChangeLedgerList.push({ id: data.lid, sgfh_qty: data.sgfh_qty, sjcl_qty: data.sjcl_qty, qtcl_qty: data.qtcl_qty, quantity: data.quantity, ex_qty1: data.ex_qty1 });
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -1034,6 +1036,8 @@ module.exports = app => {
|
|
|
now.sjcl_tp = this.ctx.helper.mul(now.sjcl_qty, now.unit_price, tpDecimal);
|
|
|
now.qtcl_tp = this.ctx.helper.mul(now.qtcl_qty, now.unit_price, tpDecimal);
|
|
|
now.total_price = this.ctx.helper.mul(now.quantity, now.unit_price, tpDecimal);
|
|
|
+ now.ex_qty1 = nucl.ex_qty1;
|
|
|
+ now.ex_tp1 = this.ctx.helper.mul(now.ex_qty1, now.unit_price, tpDecimal);
|
|
|
}
|
|
|
}
|
|
|
// 更新到ledger上
|
|
@@ -1048,6 +1052,8 @@ module.exports = app => {
|
|
|
ledgerInfo.sjcl_tp = this.ctx.helper.mul(ledgerInfo.sjcl_qty, ledgerInfo.unit_price, tpDecimal);
|
|
|
ledgerInfo.qtcl_tp = this.ctx.helper.mul(ledgerInfo.qtcl_qty, ledgerInfo.unit_price, tpDecimal);
|
|
|
ledgerInfo.total_price = this.ctx.helper.mul(ledgerInfo.quantity, ledgerInfo.unit_price, tpDecimal);
|
|
|
+ ledgerInfo.ex_qty1 = this.ctx.helper.add(ledgerInfo.ex_qty1, nul.ex_qty1);
|
|
|
+ ledgerInfo.ex_tp1 = this.ctx.helper.mul(ledgerInfo.ex_qty1, ledgerInfo.unit_price, tpDecimal);
|
|
|
await transaction.update(this.ctx.service.ledger.tableName, ledgerInfo);
|
|
|
}
|
|
|
}
|
|
@@ -1093,6 +1099,7 @@ module.exports = app => {
|
|
|
l.sgfh_qty, l.sgfh_tp, l.sjcl_qty, l.sjcl_tp, l.qtcl_qty, l.qtcl_tp, l.node_type, l.crid, l.ccid,
|
|
|
l.tender_id, l.sgfh_expr, l.sjcl_expr, l.qtcl_expr, l.check_calc,
|
|
|
l.ex_memo1, l.ex_memo2, l.ex_memo3,
|
|
|
+ l.ex_qty1, l.ex_tp1,
|
|
|
];
|
|
|
insertLedgerArr.push('(' + this.ctx.helper.getInArrStrSqlFilter(insertL) + ')');
|
|
|
await transaction.delete(this.ctx.service.changeLedger.tableName, { id: l.id });
|
|
@@ -1105,7 +1112,7 @@ module.exports = app => {
|
|
|
' quantity, total_price, unit_price, drawing_code, memo, features, dgn_qty1, dgn_qty2, deal_qty, deal_tp,' +
|
|
|
' sgfh_qty, sgfh_tp, sjcl_qty, sjcl_tp, qtcl_qty, qtcl_tp, node_type, crid, ccid, tender_id,' +
|
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, check_calc,' +
|
|
|
- ' ex_memo1, ex_memo2, ex_memo3) VALUES ' + insertLedgerArr.join(',') + ';';
|
|
|
+ ' ex_memo1, ex_memo2, ex_memo3, ex_qty1, ex_tp1) VALUES ' + insertLedgerArr.join(',') + ';';
|
|
|
await transaction.query(bSql, []);
|
|
|
}
|
|
|
if (posList.length > 0) {
|
|
@@ -1115,7 +1122,7 @@ module.exports = app => {
|
|
|
p.id, p.tid, p.lid, p.name, p.drawing_code, p.quantity, p.add_stage, p.add_stage_order, p.add_times,
|
|
|
p.add_user, p.sgfh_qty, p.sjcl_qty, p.qtcl_qty, p.crid, p.ccid, p.porder, p.position,
|
|
|
p.sgfh_expr, p.sjcl_expr, p.qtcl_expr, p.real_qty,
|
|
|
- p.ex_memo1, p.ex_memo2, p.ex_memo3,
|
|
|
+ p.ex_memo1, p.ex_memo2, p.ex_memo3, p.ex_qty1,
|
|
|
];
|
|
|
insertPosArr.push('(' + this.ctx.helper.getInArrStrSqlFilter(insertp) + ')');
|
|
|
await transaction.delete(this.ctx.service.changePos.tableName, { id: p.id });
|
|
@@ -1128,7 +1135,7 @@ module.exports = app => {
|
|
|
' (id, tid, lid, name, drawing_code, quantity, add_stage, add_stage_order, add_times, add_user,' +
|
|
|
' sgfh_qty, sjcl_qty, qtcl_qty, crid, ccid, porder, position, ' +
|
|
|
' sgfh_expr, sjcl_expr, qtcl_expr, real_qty,' +
|
|
|
- ' ex_memo1, ex_memo2, ex_memo3) VALUES ' + insertPosArr.join(',') + ';';
|
|
|
+ ' ex_memo1, ex_memo2, ex_memo3, ex_qty1) VALUES ' + insertPosArr.join(',') + ';';
|
|
|
await transaction.query(pSql, []);
|
|
|
}
|
|
|
}
|