Преглед на файлове

变更概况计算问题

MaiXinRong преди 3 години
родител
ревизия
b8e9c18fbb
променени са 2 файла, в които са добавени 3 реда и са изтрити 3 реда
  1. 2 2
      app/service/report_memory.js
  2. 1 1
      app/view/stage/pay_modal.ejs

+ 2 - 2
app/service/report_memory.js

@@ -1323,8 +1323,8 @@ module.exports = app => {
                     b.qty = this.ctx.helper._.toNumber(b.samount);
                     b.tp = this.ctx.helper.round(this.ctx.helper.mul(b.qty, b.unit_price), this.ctx.tender.info.decimal.tp);
 
-                    const u = cbu.find(x => { return x.id === b.id; });
-                    b.used_qty = u ? u.used_qty : 0;
+                    const u = cbu.filter(x => { return x.cbid === b.id; });
+                    b.used_qty = u.length > 0 ? this.ctx.helper.sum(u.map(x => { return x.qty})) : 0;
 
                     b.valid_qty = this.ctx.helper.sub(b.qty, b.used_qty);
                     const cur = this.ctx.helper._.filter(curUsedBills, { cbid: b.id });

+ 1 - 1
app/view/stage/pay_modal.ejs

@@ -114,7 +114,7 @@
             <div class="modal-body">
                 <table class="table table-sm table-bordered">
                     <thead>
-                    <tr class="text-center"><th>章节名称</th><th>本期合同计量金额</th><th>本期变更计量金额</th><th>本期完成计量金</th><th>累计完成计量金额</th></tr>
+                    <tr class="text-center"><th>章节名称</th><th>本期合同计量金额</th><th>本期变更计量金额</th><th>本期完成计量金</th><th>累计完成计量金额</th></tr>
                     </thead>
                     <tbody id="detail-list"></tbody>
                 </table>