Commit 5329db318bb152634f7e21152bff2e49c05df5d9

Authored by yeqianyong
2 parents f6d033e8 6e03acd3

Merge branch 'master_cj_zq' into master_sample_order

@@ -535,6 +535,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge @@ -535,6 +535,7 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
535 if (CollectionUtils.isEmpty(list)) { 535 if (CollectionUtils.isEmpty(list)) {
536 continue; 536 continue;
537 } 537 }
  538 + BigDecimal totalDebt = BigDecimal.ZERO;
538 long waitDeliveredOrderTotal = 0; 539 long waitDeliveredOrderTotal = 0;
539 Map<String, ReceiptLedgerReportDetail> reportDetailMap = new LinkedHashMap<>(); 540 Map<String, ReceiptLedgerReportDetail> reportDetailMap = new LinkedHashMap<>();
540 for (Map<String, Object> map : list) { 541 for (Map<String, Object> map : list) {
@@ -575,9 +576,11 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge @@ -575,9 +576,11 @@ public class ReceiptLedgerInfoServiceImpl extends BaseMpServiceImpl<ReceiptLedge
575 } 576 }
576 debtTotal = debtTotal.add(debtAmount); 577 debtTotal = debtTotal.add(debtAmount);
577 reportDetail.setDebtTotal(debtTotal); 578 reportDetail.setDebtTotal(debtTotal);
  579 + totalDebt = totalDebt.add(debtAmount);
578 580
579 reportDetailMap.put(reportDetail.getCustomerName(), reportDetail); 581 reportDetailMap.put(reportDetail.getCustomerName(), reportDetail);
580 } 582 }
  583 + report.setDebtTotal(totalDebt);
581 List<ReceiptLedgerReportDetail> details = new ArrayList<>(reportDetailMap.values()); 584 List<ReceiptLedgerReportDetail> details = new ArrayList<>(reportDetailMap.values());
582 if (CollectionUtils.isNotEmpty(details)) { 585 if (CollectionUtils.isNotEmpty(details)) {
583 for (ReceiptLedgerReportDetail detail : details) { 586 for (ReceiptLedgerReportDetail detail : details) {
@@ -231,8 +231,7 @@ @@ -231,8 +231,7 @@
231 tb.region, 231 tb.region,
232 r.name as region_name, 232 r.name as region_name,
233 max(cc.company_credit_limit) as quota, 233 max(cc.company_credit_limit) as quota,
234 - max(cc.company_settlement_period) as settle_term,  
235 - sum(rl.end_account_receivable) as debtTotal 234 + max(cc.company_settlement_period) as settle_term
236 from base_data_customer_short tb 235 from base_data_customer_short tb
237 left join sys_dept d on tb.dept_id = d.id 236 left join sys_dept d on tb.dept_id = d.id
238 left join sys_dept r on tb.region = r.id 237 left join sys_dept r on tb.region = r.id