refactor: adapt price fields to StockBuy model changes in export_excel

Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
dxc
2026-02-27 16:22:51 +08:00
parent fbff519ac9
commit 3a056335bb

View File

@ -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)
# 计算不含税总价 = 数量 * 不含税单价