Browse Source

修复新建期bug

laiguoran 3 years ago
parent
commit
a4c93f4119
1 changed files with 2 additions and 2 deletions
  1. 2 2
      app/service/material_bills.js

+ 2 - 2
app/service/material_bills.js

@@ -263,7 +263,7 @@ module.exports = app => {
                     m_tp: newTp,
                     pre_tp: mb.m_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.pre_tp, mb.m_tp), 2) : mb.pre_tp,
                     m_tax_tp: this.ctx.helper.round(this.ctx.helper.mul(newTp, (1 + this.ctx.helper.div(mb.m_tax, 100))), 2),
-                    m_tax_pre_tp: mb.m_tax_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.m_tax_pre_tp, mb.m_tax_tp), 2) : mb.m_tax_pre_tp,
+                    tax_pre_tp: mb.m_tax_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.tax_pre_tp, mb.m_tax_tp), 2) : mb.tax_pre_tp,
                 };
                 await transaction.update(this.tableName, updateData);
                 const m_tp = mb.is_summary === 1 ? await this.ctx.helper.round(this.ctx.helper.mul(mb_quantity.quantity, newm_spread), 2) : 0;
@@ -283,7 +283,7 @@ module.exports = app => {
                     m_tp: newTp,
                     pre_tp: mb.m_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.pre_tp, mb.m_tp), 2) : mb.pre_tp,
                     m_tax_tp: this.ctx.helper.round(this.ctx.helper.mul(newTp, (1 + this.ctx.helper.div(mb.m_tax, 100))), 2),
-                    m_tax_pre_tp: mb.m_tax_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.m_tax_pre_tp, mb.m_tax_tp), 2) : mb.m_tax_pre_tp,
+                    tax_pre_tp: mb.m_tax_tp !== null ? this.ctx.helper.round(this.ctx.helper.add(mb.tax_pre_tp, mb.m_tax_tp), 2) : mb.tax_pre_tp,
                 };
                 await transaction.update(this.tableName, updateData);
                 const m_tp = mb.is_summary === 1 ? await this.ctx.helper.round(this.ctx.helper.mul(quantity, newm_spread), 2) : 0;