From 7dae2509ddb7d918f0ef0450a09ed721f6c7540f Mon Sep 17 00:00:00 2001
From: gongchunyi <deslre0381@gmail.com>
Date: 星期五, 24 四月 2026 11:07:04 +0800
Subject: [PATCH] fix: 应付金额去重并扣减历史记录

---
 src/main/resources/mapper/sales/SalesLedgerProductMapper.xml |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
index 0df9c91..0f977c8 100644
--- a/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
+++ b/src/main/resources/mapper/sales/SalesLedgerProductMapper.xml
@@ -166,7 +166,7 @@
             resultType="com.ruoyi.purchase.dto.ProcurementBusinessSummaryStatisticsDto">
         SELECT
         COALESCE(SUM(slp.tax_inclusive_total_price), 0) AS purchaseTotalAmount,
-        COALESCE(COUNT(DISTINCT slp.product_category), 0) AS productCategoryCount,
+        COALESCE(COUNT(DISTINCT slp.product_model_id), 0) AS productCategoryCount,
         COALESCE(SUM(rop.allocated_return_amount), 0) AS returnTotalAmount
         FROM sales_ledger_product slp
         LEFT JOIN purchase_ledger sl ON slp.sales_ledger_id = sl.id

--
Gitblit v1.9.3