ellisran 6 dni temu
rodzic
commit
f5820ba47d
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      app/service/cost_stage_book.js

+ 1 - 1
app/service/cost_stage_book.js

@@ -216,7 +216,7 @@ module.exports = app => {
                 orgDetail = await this.ctx.service.costStageDetail.getAllDataByCondition({ where: { stage_id: this.ctx.costStage.relaStage.id }});
                 for (const cd of detailCalcData) {
                     const nd = { id: cd.id, ledger_id: cd.ledger_id, detail_id: cd.detail_id };
-                    const cl = orgDetail.find(x => { return x.id === cd.ledger_id });
+                    const cl = orgDetail.find(x => { return x.id === cd.detail_id });
                     nd.in_tp = this.ctx.helper.round(cd.in_tp, decimal.tp);
                     const divNum = cl && cl.tax ? this.ctx.helper.add(1, this.ctx.helper.div(cl.tax, 100)) : 1;
                     nd.in_excl_tax_tp = this.ctx.helper.div(nd.in_tp !== undefined ? nd.in_tp : nd.in_tp, divNum, decimal.excl_tax_tp);