feat: add post-tax unit price, company filter, and frontend price linkage
Co-authored-by: aider (openai/DeepSeek-V3.2-Thinking) <aider@aider.chat>
This commit is contained in:
@ -137,7 +137,7 @@ class BuyInboundService:
|
||||
warehouse_location=data.get('warehouse_location'),
|
||||
|
||||
# 价格信息
|
||||
unit_price=u_price,
|
||||
pre_tax_unit_price=u_price,
|
||||
post_tax_unit_price=float(data.get('post_tax_unit_price') or 0),
|
||||
tax_rate=tax_rate, # [新增]
|
||||
total_price=in_qty * u_price,
|
||||
@ -195,9 +195,9 @@ class BuyInboundService:
|
||||
stock.stock_quantity = float(stock.stock_quantity) + diff
|
||||
stock.available_quantity = float(stock.available_quantity) + diff
|
||||
|
||||
if 'unit_price' in data: stock.unit_price = float(data['unit_price'])
|
||||
if 'unit_price' in data: stock.pre_tax_unit_price = float(data['unit_price'])
|
||||
|
||||
stock.total_price = float(stock.in_quantity) * float(stock.unit_price)
|
||||
stock.total_price = float(stock.in_quantity) * float(stock.pre_tax_unit_price)
|
||||
db.session.commit()
|
||||
return stock
|
||||
except Exception as e:
|
||||
|
||||
Reference in New Issue
Block a user