Prechádzať zdrojové kódy

修复是否汇总bug

laiguoran 4 rokov pred
rodič
commit
7855e5d34d
1 zmenil súbory, kde vykonal 2 pridanie a 0 odobranie
  1. 2 0
      app/service/material_bills.js

+ 2 - 0
app/service/material_bills.js

@@ -193,6 +193,7 @@ module.exports = app => {
                     msg_times: null,
                     msg_spread: newmsg_spread,
                     m_spread: newm_spread,
+                    m_tp: this.ctx.helper.round(this.ctx.helper.mul(this.ctx.helper.round(mb_quantity.quantity, 3), newm_spread), 2),
                     pre_tp: mb.m_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.pre_tp, mb.m_tp), 2) : mb.pre_tp,
                 };
                 await transaction.update(this.tableName, updateData);
@@ -206,6 +207,7 @@ module.exports = app => {
                     msg_times: null,
                     msg_spread: newmsg_spread,
                     m_spread: newm_spread,
+                    m_tp: quantity !== 0 && quantity !== null ? this.ctx.helper.round(this.ctx.helper.mul(this.ctx.helper.round(quantity, 3), newm_spread), 2) : null,
                     pre_tp: mb.m_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.pre_tp, mb.m_tp), 2) : mb.pre_tp,
                 };
                 await transaction.update(this.tableName, updateData);