瀏覽代碼

报表,变更方案、变更申请,小数位数问题

MaiXinRong 1 年之前
父節點
當前提交
5c554b12eb
共有 2 個文件被更改,包括 2 次插入2 次删除
  1. 1 1
      app/lib/rm/change_apply.js
  2. 1 1
      app/lib/rm/change_plan.js

+ 1 - 1
app/lib/rm/change_apply.js

@@ -40,7 +40,7 @@ class rptMemChange extends RptMemBase {
 
         const bills = await this.ctx.service.changeApplyList.getAllDataByCondition({ where: { caid: apply.id} });
         bills.forEach(x => {
-            const a_decimal = apply.decimal ? JSON.stringify(apply.decimal) : { tp: decimal.tp, up: decimal.up };
+            const a_decimal = apply.decimal ? JSON.parse(apply.decimal) : { tp: decimal.tp, up: decimal.up };
             x.o_tp = helper.mul(x.oamount, x.unit_price, a_decimal.tp);
             x.c_tp = helper.mul(x.camount, x.unit_price, a_decimal.tp);
         });

+ 1 - 1
app/lib/rm/change_plan.js

@@ -40,7 +40,7 @@ class rptMemChange extends RptMemBase {
 
         const bills = await this.ctx.service.changePlanList.getAllDataByCondition({ where: { cpid: this.ctx.change_plan.id} });
         bills.forEach(x => {
-            const p_decimal = plan.decimal ? JSON.stringify(plan.decimal) : { tp: decimal.tp, up: decimal.up };
+            const p_decimal = plan.decimal ? JSON.parse(plan.decimal) : { tp: decimal.tp, up: decimal.up };
             x.o_tp = helper.mul(x.oamount, x.unit_price, p_decimal.tp);
             x.c_tp = helper.mul(x.camount, x.unit_price, p_decimal.tp);
             x.s_tp = helper.mul(x.samount, x.unit_price, p_decimal.tp);