From 9bb07cede2c66972526ee3ace524991570c1a31c Mon Sep 17 00:00:00 2001
From: 云 <2163098428@qq.com>
Date: 星期二, 26 五月 2026 17:07:37 +0800
Subject: [PATCH] fix(account): 修复出库金额计算中的除零错误

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

diff --git a/src/main/resources/mapper/account/sales/AccountInvoiceApplicationMapper.xml b/src/main/resources/mapper/account/sales/AccountInvoiceApplicationMapper.xml
index 842e94c..05c014c 100644
--- a/src/main/resources/mapper/account/sales/AccountInvoiceApplicationMapper.xml
+++ b/src/main/resources/mapper/account/sales/AccountInvoiceApplicationMapper.xml
@@ -36,7 +36,7 @@
         p.product_name,
         pm.model as specification_model,
         slp.tax_rate,
-        sor.stock_out_num * slp.tax_inclusive_unit_price as outboundAmount,
+        sor.stock_out_num * slp.tax_inclusive_unit_price / IFNULL(NULLIF(slp.single_quantity, 0), 1) as outboundAmount,
         s.shipping_no,
         sl.sales_contract_no
         FROM stock_out_record sor

--
Gitblit v1.9.3