浏览代码

调差新建小数位问题

ellisran 11 月之前
父节点
当前提交
c8afd1b38e
共有 2 个文件被更改,包括 4 次插入4 次删除
  1. 2 2
      app/service/material_bills.js
  2. 2 2
      app/service/material_stage_bills.js

+ 2 - 2
app/service/material_bills.js

@@ -607,8 +607,8 @@ module.exports = app => {
         async calcQuantityByMB(transaction, mid, mb, materialCalculator, decimal, pre_is_stage_self, qty_source) {
             const [newmsg_spread, newm_spread] = await this.getSpread(mb, null, decimal.up);
             if (mb.t_type === materialConst.t_type[0].value) {
-                const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id, 0);
-                const newTp = this.ctx.helper.round(this.ctx.helper.mul(this.ctx.helper.round(newQuantity, decimal.qty), newm_spread), decimal.tp);
+                const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id);
+                const newTp = this.ctx.helper.round(this.ctx.helper.mul(newQuantity, newm_spread), decimal.tp);
                 const updateData = {
                     id: mb.id,
                     quantity: newQuantity,

+ 2 - 2
app/service/material_stage_bills.js

@@ -223,8 +223,8 @@ module.exports = app => {
         async calcQuantityByMB(transaction, mid, mb, msb, materialCalculator, decimal, pre_is_stage_self, qty_source) {
             const [newmsg_spread, newm_spread] = await this.getSpread(mb, null, decimal.up);
             if (mb.t_type === materialConst.t_type[0].value) {
-                const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id, msb.ms_id, 0);
-                const newTp = this.ctx.helper.round(this.ctx.helper.mul(this.ctx.helper.round(newQuantity, decimal.qty), newm_spread), decimal.tp);
+                const newQuantity = await this.ctx.service.materialList.getMbQuantity(transaction, mid, qty_source, decimal.qty, mb.id, msb.ms_id);
+                const newTp = this.ctx.helper.round(this.ctx.helper.mul(newQuantity, newm_spread), decimal.tp);
                 msb.quantity = newQuantity;
                 msb.msg_spread = newmsg_spread;
                 msb.m_spread = newm_spread;