From a90721a1d1e7ec18f2a0a0c5e9688dedf9091610 Mon Sep 17 00:00:00 2001
From: liding <756868258@qq.com>
Date: 星期三, 24 六月 2026 17:11:27 +0800
Subject: [PATCH] fix: 优化退货管理中的退款金额计算和实际合同金额处理
---
src/main/resources/mapper/basic/CustomerMapper.xml | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/main/resources/mapper/basic/CustomerMapper.xml b/src/main/resources/mapper/basic/CustomerMapper.xml
index 37886d5..f001387 100644
--- a/src/main/resources/mapper/basic/CustomerMapper.xml
+++ b/src/main/resources/mapper/basic/CustomerMapper.xml
@@ -126,7 +126,7 @@
<select id="customewTransactions" resultType="com.ruoyi.sales.vo.CustomerTransactionsVo">
select T1.customer_id,
c.customer_name,
- T1.contractAmounts,
+ T1.contractAmounts - IFNULL(T4.returnAmount, 0) AS contractAmounts,
IFNULL(T2.receiptPaymentAmount, 0) AS receiptPaymentAmount,
IFNULL(T3.outboundAmount, 0) - IFNULL(T4.returnAmount, 0) AS receiptableAmount
from (select customer_id, sum(contract_amount) as contractAmounts from sales_ledger group by customer_id) T1
--
Gitblit v1.9.3