chenrui
6 天以前 3512270362c77fe45bc68ab7b6f28bd1bd2f8bfb
src/main/java/com/ruoyi/sales/controller/SalesLedgerController.java
@@ -178,12 +178,20 @@
            return iPage;
        }
        for (SalesLedger salesLedger : iPage.getRecords()) {
            boolean existFlag = false;
            BigDecimal noInvoiceAmountTotal = BigDecimal.ZERO;
            for (InvoiceLedgerDto invoiceLedgerDto : invoiceLedgerDtoList) {
                if (salesLedger.getId().intValue() == invoiceLedgerDto.getSalesLedgerId()) {
                    BigDecimal noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal());
                    salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal);
                    noInvoiceAmountTotal = salesLedger.getContractAmount().subtract(invoiceLedgerDto.getInvoiceTotal());
                    existFlag = true;
                    break;
                }
            }
            if(existFlag){
                salesLedger.setNoInvoiceAmountTotal(noInvoiceAmountTotal);
            }else {
                salesLedger.setNoInvoiceAmountTotal(salesLedger.getContractAmount());
            }
        }
        return iPage;
    }