Browse Source

原单价问题

MaiXinRong 2 years ago
parent
commit
19b5d0e8d7
1 changed files with 4 additions and 0 deletions
  1. 4 0
      app/service/stage_bills_final.js

+ 4 - 0
app/service/stage_bills_final.js

@@ -110,6 +110,10 @@ module.exports = app => {
                     c.qc_tp = this.ctx.helper.add(c.qc_tp, cp.qc_pc_tp);
                     c.qc_tp = this.ctx.helper.add(c.qc_tp, cp.qc_pc_tp);
                     curPc.splice(curPc.indexOf(cp), 1);
                     curPc.splice(curPc.indexOf(cp), 1);
                 }
                 }
+                if (!c.org_price) {
+                    const bills = await this.ctx.service.ledger.getDataById(c.lid);
+                    c.unit_price = bills ? bills.unit_price || 0 : 0;
+                }
             }
             }
 
 
             for (const p of pre) {
             for (const p of pre) {