src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -69,8 +69,8 @@
            // 已回款金额
            SalesLedgerProduct salesLedgerProduct = salesLedgerProductMapper.selectById(receiptPayment.getSalesLedgerProductId());
            if(null==salesLedgerProduct) throw new RuntimeException("未找到销售单产品");
            if (salesLedgerProduct.getPendingInvoiceTotal().compareTo(receiptPayment.getReceiptPaymentAmount())<0){
                throw new RuntimeException("本次回款金额不能大于待回款金额");
            if (salesLedgerProduct.getPendingInvoiceTotal().add(receiptPayment.getReceiptPaymentAmount()).compareTo(byId.getReceiptPaymentAmount())<0){
                throw new RuntimeException("本次回款金额不能大于待回款金额+回款金额");
            }
            if(null==receiptPayment.getId()){
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(receiptPayment.getReceiptPaymentAmount()));
@@ -90,7 +90,7 @@
                accountIncome.setBusinessType(1);
                accountIncomeService.save(accountIncome);
            }else {
                BigDecimal subtract = receiptPayment.getReceiptPaymentAmount().subtract(byId.getReceiptPaymentAmount());
                BigDecimal subtract = byId.getReceiptPaymentAmount().subtract(receiptPayment.getReceiptPaymentAmount());
                salesLedgerProduct.setInvoiceTotal(salesLedgerProduct.getInvoiceTotal().add(subtract));
                salesLedgerProduct.setPendingInvoiceTotal(salesLedgerProduct.getTaxInclusiveTotalPrice().subtract(salesLedgerProduct.getInvoiceTotal()));
                receiptPayment.setReceiptPaymentAmount(byId.getReceiptPaymentAmount());