Преглед изворни кода

甲供材料,单位、单价控制写入

MaiXinRong пре 4 година
родитељ
комит
0c569e2b6d
1 измењених фајлова са 8 додато и 6 уклоњено
  1. 8 6
      app/service/stage_jgcl.js

+ 8 - 6
app/service/stage_jgcl.js

@@ -139,12 +139,14 @@ module.exports = app => {
 
                 const nd = {id: od.id};
                 if (d.name) nd.name = d.name;
-                if (od.pre_used === null || od.pre_used === undefined || od.pre_used === 0) {
-                    if (d.unit !== undefined) nd.unit = d.unit;
-                    nd.unit_price = d.unit_price !== undefined ? this.ctx.helper.round(d.unit_price, info.decimal.up) : od.unit_price;
-                } else {
-                    nd.unit_price = od.unit_price;
-                }
+                if (d.unit !== undefined) nd.unit = d.unit;
+                nd.unit_price = d.unit_price !== undefined ? this.ctx.helper.round(d.unit_price, info.decimal.up) : od.unit_price;
+                // if (od.pre_used === null || od.pre_used === undefined || od.pre_used === 0) {
+                //     if (d.unit !== undefined) nd.unit = d.unit;
+                //     nd.unit_price = d.unit_price !== undefined ? this.ctx.helper.round(d.unit_price, info.decimal.up) : od.unit_price;
+                // } else {
+                //     nd.unit_price = od.unit_price;
+                // }
                 const precision = this.ctx.helper.findPrecision(info.precision, d.unit);
                 if (d.arrive_qty !== undefined) {
                     nd.arrive_qty = this.ctx.helper.round(d.arrive_qty, precision.value);