This commit is contained in:
2026-03-23 17:09:11 +01:00
parent 4e3818d46a
commit 6b841db4ce

View File

@@ -84,9 +84,15 @@ class ValuationBase(ModelSQL):
qty = lot.get_current_quantity_converted()
price = pc.price
if line.terms:
c = [t for t in line.terms if t.component == pc.id]
if c:
price = c[0].manual_price
values.update({
'reference': f"{pc.get_name()} / {pc.ratio}%",
'price': round(pc.price, 4),
'price': round(price, 4),
'counterparty': sale_line.sale.party.id if sale_line else line.purchase.party.id,
'product': sale_line.product.id if sale_line else line.product.id,
})
@@ -101,7 +107,7 @@ class ValuationBase(ModelSQL):
values['state'] = f"part. fixed {round(pc.fixed_qt / Decimal(base) * 100, 0)}%"
if pc.price and pc.ratio:
amount = round(pc.price * qty * Decimal(sign) * pc.ratio / 100, 2)
amount = round(price * qty * Decimal(sign) * pc.ratio / 100, 2)
base_amount = amount
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
rate = Decimal(1)