main #7
@@ -84,9 +84,15 @@ class ValuationBase(ModelSQL):
|
|||||||
|
|
||||||
qty = lot.get_current_quantity_converted()
|
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({
|
values.update({
|
||||||
'reference': f"{pc.get_name()} / {pc.ratio}%",
|
'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,
|
'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,
|
'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)}%"
|
values['state'] = f"part. fixed {round(pc.fixed_qt / Decimal(base) * 100, 0)}%"
|
||||||
|
|
||||||
if pc.price and pc.ratio:
|
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
|
base_amount = amount
|
||||||
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
|
currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id
|
||||||
rate = Decimal(1)
|
rate = Decimal(1)
|
||||||
|
|||||||
Reference in New Issue
Block a user