浏览代码

小数位数计算问题

MaiXinRong 1 周之前
父节点
当前提交
aaba0a0be4
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      app/service/tender_info.js

+ 2 - 2
app/service/tender_info.js

@@ -263,7 +263,7 @@ module.exports = app => {
                     const contract_tp = this.ctx.helper.mul(b.unit_price, sb.contract_qty, decimal.tp);
                     const qc_tp = this.ctx.helper.mul(b.unit_price, sb.qc_qty, decimal.tp);
                     const positive_qc_tp = this.ctx.helper.mul(b.unit_price, sb.positive_qc_qty, decimal.tp);
-                    const negative_qc_tp = this.ctx.helper.mul(b.unit_price, sb.positive_qc_qty, decimal.tp);
+                    const negative_qc_tp = this.ctx.helper.mul(b.unit_price, sb.negative_qc_qty, decimal.tp);
                     const ex_stage_tp1 = this.ctx.helper.mul(b.unit_price, sb.ex_stage_qty1, decimal.tp);
                     if (contract_tp == sb.contract_tp && qc_tp === sb.qc_tp && ex_stage_tp1 === sb.ex_stage_tp1
                         && positive_qc_tp === sb.positive_qc_tp && negative_qc_tp === sb.negative_qc_tp) continue;
@@ -312,7 +312,7 @@ module.exports = app => {
                     const contract_tp = preSb ? this.ctx.helper.sub(end_contract_tp, preSb.contract_tp) : end_contract_tp;
                     const qc_tp = this.ctx.helper.mul(b.unit_price, sb.qc_qty, decimal.tp);
                     const positive_qc_tp = this.ctx.helper.mul(b.unit_price, sb.positive_qc_qty, decimal.tp);
-                    const negative_qc_tp = this.ctx.helper.mul(b.unit_price, sb.positive_qc_qty, decimal.tp);
+                    const negative_qc_tp = this.ctx.helper.mul(b.unit_price, sb.negative_qc_qty, decimal.tp);
                     const ex_stage_tp1 = this.ctx.helper.mul(b.unit_price, sb.ex_stage_qty1, decimal.tp);
                     if (contract_tp == sb.contract_tp && qc_tp === sb.qc_tp && ex_stage_tp1 === sb.ex_stage_tp1
                         && positive_qc_tp === sb.positive_qc_tp && negative_qc_tp === sb.negative_qc_tp) continue;