Browse Source

变更令报表数据问题

MaiXinRong 1 year ago
parent
commit
c162ffd6d2
1 changed files with 2 additions and 1 deletions
  1. 2 1
      app/lib/rm/change.js

+ 2 - 1
app/lib/rm/change.js

@@ -56,6 +56,7 @@ class rptMemChange extends RptMemBase {
     }
 
     async _getChangeBills() {
+        const decimal = this.ctx.tender.info.decimal;
         const changeBills = await this.ctx.service.changeAuditList.getAllDataByCondition({ where: { cid: this.ctx.change.cid} });
         for (const d of changeBills) {
             d.o_qty = d.oamount;
@@ -68,7 +69,7 @@ class rptMemChange extends RptMemBase {
             d.sp_tp = this.ctx.helper.mul(d.sp_qty, d.unit_price, decimal.tp);
 
             const auditAmount = d.audit_amount ? d.audit_amount.split(',') : [];
-            const relaChange = this.ctx.helper._.find(change, {cid: d.cid});
+            const relaChange = this.ctx.helper._.find(this.ctx.change, {cid: d.cid});
             for (const [i, aa] of auditAmount.entries()) {
                 const amountField = 'qty_' + (i+1), tpField = 'tp_' + (i+1);
                 d[amountField] = aa ? parseFloat(aa) : 0;