Commit 55df39dd6dec6dedd9cb86761dc7e5efaf74297d

Authored by yeqianyong
1 parent 3b785bc7

楚江erp:台账报表总欠款逻辑处理

... ... @@ -573,10 +573,24 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
573 573 waitDeliveredOrderTotal += count;
574 574 reportDetail.setWaitDeliveredOrder(count);
575 575 }
  576 + // 计算总欠款
  577 + BigDecimal debtTotal = reportDetail.getDebtTotal();
  578 + if (debtTotal == null) {
  579 + debtTotal = BigDecimal.ZERO;
  580 + }
  581 + debtTotal = debtTotal.add(debtAmount);
  582 + reportDetail.setDebtTotal(debtTotal);
576 583
577 584 reportDetailMap.put(reportDetail.getCustomerName(), reportDetail);
578 585 }
579 586 List<ReceiptLedgerReportDetail> details = new ArrayList<>(reportDetailMap.values());
  587 + if (CollectionUtils.isNotEmpty(details)) {
  588 + // 转换成万元
  589 + for (ReceiptLedgerReportDetail detail : details) {
  590 + BigDecimal debtTotal = detail.getDebtTotal();
  591 + detail.setDebtTotal(valueConvert(debtTotal));
  592 + }
  593 + }
580 594 report.setDetailList(details);
581 595
582 596 // 处理约定内、一次协调、二次协调、清欠小计数据
... ...
... ... @@ -283,7 +283,6 @@
283 283 </foreach>
284 284 </if>
285 285 </where>
286   - and tb.debt_status is not null
287 286 group by c.name,cs.short_name,tb.debt_status
288 287 </select>
289 288
... ...