Browse Source

计量单元,父项无计算模板,复制粘贴整块问题

MaiXinRong 3 days ago
parent
commit
a75f77e128
2 changed files with 2 additions and 2 deletions
  1. 1 1
      app/lib/rm/tender_material.js
  2. 1 1
      app/service/pos.js

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

@@ -452,7 +452,7 @@ class ReportMemoryMaterial {
         if (!material) return [];
 
         const materials = await this.ctx.service.material.getAllDataByCondition({
-            where: {tid: this.ctx.material.tid},
+            where: {tid: material.tid},
             orders: [['order', 'desc']],
         });
         if (materials.length === 0) return [];

+ 1 - 1
app/service/pos.js

@@ -434,7 +434,7 @@ module.exports = app => {
 
             const bills = await this.ctx.service.ledger.getDataById(data.lid);
             const le = await this.ctx.service.ledgerExtra.getDataById(data.lid);
-            const calcTemplate = le.calc_template ? await this.ctx.service.calcTmpl.getTemplate(le.calc_template) : null;
+            const calcTemplate = le && le.calc_template ? await this.ctx.service.calcTmpl.getTemplate(le.calc_template) : null;
             const precision = this.ctx.helper.findPrecision(this.ctx.tender.info.precision, bills.unit);
             const existPos = await this.ctx.service.pos.getAllDataByCondition({ where : { lid: bills.id }, orders: [['porder', 'DESC']]});
             const maxOrder = existPos.length > 0 ? existPos[0].porder : 0;