From e1b5e5a884384d2b2058c9e02efe626e4f9675b4 Mon Sep 17 00:00:00 2001
From: liyong <18434998025@163.com>
Date: 星期一, 14 七月 2025 13:02:52 +0800
Subject: [PATCH] 采购台账-付款登记查询、修改、删除 付款流水信息

---
 src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)

diff --git a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
index fe9550b..135d3b0 100644
--- a/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
+++ b/src/main/java/com/ruoyi/sales/service/impl/ReceiptPaymentServiceImpl.java
@@ -247,7 +247,19 @@
             customerInteractionDto.setUnReceiptAmount(amountTotal);
             result.add(customerInteractionDto);
         }
-        return result;
+        ArrayList<CustomerInteractionDto> newResult = new ArrayList<>();
+        for (int i = 0; i < result.size(); i++) {
+            CustomerInteractionDto customerInteractionDto = result.get(i);
+            if (i == 0) {
+                customerInteractionDto.setUnReceiptAmount(customerInteractionDto.getInvoiceAmount().subtract(customerInteractionDto.getReceiptAmount()));
+            }else {
+                CustomerInteractionDto customerInteractionDto1 = result.get(i-1);
+                customerInteractionDto.setUnReceiptAmount(customerInteractionDto1.getUnReceiptAmount()
+                        .add(customerInteractionDto.getInvoiceAmount()).subtract(customerInteractionDto.getReceiptAmount()));
+            }
+            newResult.add(customerInteractionDto);
+        }
+        return newResult;
     }
 
     /**

--
Gitblit v1.9.3