This commit is contained in:
2026-02-14 20:59:35 +01:00
parent 6f4649c778
commit e040a4fc11

View File

@@ -293,16 +293,20 @@ class ValuationBase(ModelSQL):
fees = [e.fee for e in fl]
for sf in cls.group_fees_by_type_supplier(line, fees):
sign = -1 if sf.p_r == 'pay' else 1
qty = round(lot.get_current_quantity_converted(), 5)
if sf.mode == 'ppack':
price = sf.price
amount = sf.amount
elif sf.mode == 'lumpsum':
price = sf.price
amount = sf.price
qty = 1
else:
price = Decimal(sf.get_price_per_qt())
amount = round(price * lot.get_current_quantity_converted() * sign, 2)
if sf.currency != line.purchase.currency:
with Transaction().set_context(date=Date.today()):
price = Currency.compute(sf.currency, price, line.purchase.currency)
qty = round(lot.get_current_quantity_converted(), 5)
if line.mtm:
for strat in line.mtm:
fee_lines.append({