|
|
@@ -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;
|