|
|
@@ -258,26 +258,27 @@ module.exports = app => {
|
|
|
let needUpdateBills;
|
|
|
for (const d of data) {
|
|
|
if (d.sgfh_qty !== undefined || d.sjcl_qty !== undefined || d.qtcl_qty !== undefined || d.ex_qty1 !== undefined) {
|
|
|
+ const od = billsPos.find(x => { return x.id === d.id; });
|
|
|
if (d.sgfh_qty !== undefined) {
|
|
|
d.sgfh_qty = this.round(d.sgfh_qty, precision.value);
|
|
|
- } else if (op) {
|
|
|
- d.sgfh_qty = op.sgfh_qty;
|
|
|
+ } else if (od) {
|
|
|
+ d.sgfh_qty = od.sgfh_qty;
|
|
|
}
|
|
|
if (d.sjcl_qty !== undefined) {
|
|
|
d.sjcl_qty = this.round(d.sjcl_qty, precision.value);
|
|
|
- } else if (op) {
|
|
|
- d.sjcl_qty = op.sjcl_qty;
|
|
|
+ } else if (od) {
|
|
|
+ d.sjcl_qty = od.sjcl_qty;
|
|
|
}
|
|
|
if (d.qtcl_qty !== undefined) {
|
|
|
d.qtcl_qty = this.round(d.qtcl_qty, precision.value);
|
|
|
- } else if (op) {
|
|
|
- d.qtcl_qty = op.qtcl_qty;
|
|
|
+ } else if (od) {
|
|
|
+ d.qtcl_qty = od.qtcl_qty;
|
|
|
}
|
|
|
d.quantity = this.ctx.helper.sum([d.sgfh_qty, d.qtcl_qty, d.sjcl_qty]);
|
|
|
if (d.ex_qty1 !== undefined) {
|
|
|
d.ex_qty1 = this.round(d.ex_qty1, precision.value);
|
|
|
- } else if (op) {
|
|
|
- d.ex_qty1 = op.ex_qty1;
|
|
|
+ } else if (od) {
|
|
|
+ d.ex_qty1 = od.ex_qty1;
|
|
|
}
|
|
|
needUpdateBills = true;
|
|
|
}
|