This commit is contained in:
2026-03-23 17:47:36 +01:00
parent 412f8f00e0
commit 353cf17af7

View File

@@ -85,8 +85,10 @@ class ValuationBase(ModelSQL):
qty = lot.get_current_quantity_converted()
price = pc.price
logger.info("TERMS:%s",line.terms)
if line.terms:
c = [t for t in line.terms if t.component == pc.price_component.id]
logger.info("COMPONENTS:%s",c)
if c:
price = c[0].manual_price
@@ -106,8 +108,8 @@ class ValuationBase(ModelSQL):
base = sale_line.quantity_theorical if sale_line else line.quantity_theorical
values['state'] = f"part. fixed {round(pc.fixed_qt / Decimal(base) * 100, 0)}%"
if pc.price and pc.ratio:
amount = round(price * qty * Decimal(sign) * pc.ratio / 100, 2)
if price != None:
amount = round(price * qty * Decimal(sign), 2)
base_amount = amount
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
rate = Decimal(1)