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:
@ -368,9 +368,9 @@ class MaterialBaseService:
|
|||||||
# 处理采购件
|
# 处理采购件
|
||||||
for stock, base in list_buy:
|
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)
|
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)
|
qty = float(stock.stock_quantity or 0)
|
||||||
|
|
||||||
# 计算不含税总价 = 数量 * 不含税单价
|
# 计算不含税总价 = 数量 * 不含税单价
|
||||||
|
|||||||
Reference in New Issue
Block a user