From 3a056335bb66b7ae89015e4b077247101057a616 Mon Sep 17 00:00:00 2001 From: dxc Date: Fri, 27 Feb 2026 16:22:51 +0800 Subject: [PATCH] refactor: adapt price fields to StockBuy model changes in export_excel Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) --- inventory-backend/app/services/inbound/base_service.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inventory-backend/app/services/inbound/base_service.py b/inventory-backend/app/services/inbound/base_service.py index 97bc2a9..bbfb7d7 100644 --- a/inventory-backend/app/services/inbound/base_service.py +++ b/inventory-backend/app/services/inbound/base_service.py @@ -368,9 +368,9 @@ class MaterialBaseService: # 处理采购件 for stock, base in list_buy: # 价格计算 - unit_price = float(stock.unit_price or 0) + unit_price = float(stock.pre_tax_unit_price or 0) tax_rate = float(stock.tax_rate or 0) - price_incl = unit_price * (1 + tax_rate / 100.0) + price_incl = float(stock.post_tax_unit_price or (unit_price * (1 + tax_rate / 100.0))) qty = float(stock.stock_quantity or 0) # 计算不含税总价 = 数量 * 不含税单价 @@ -535,4 +535,4 @@ class MaterialBaseService: except Exception as e: traceback.print_exc() - raise e \ No newline at end of file + raise e