This commit is contained in:
2026-03-22 20:53:42 +01:00
parent 140eae06a0
commit ed11b23f79

View File

@@ -1438,14 +1438,18 @@ class Line(metaclass=PoolMeta):
p.price_component = pc.id
p.quantity = round(Decimal(pc.quota),5)
price = round(Decimal(self.getnearprice(pl,d,'price')),4)
logger.info("PL:%s",pl)
logger.info("PRICE:%s",price)
p.settl_price = price
if price > 0:
cumul_qt += pc.quota
p.fixed_qt = round(Decimal(cumul_qt),5)
p.fixed_qt_price = round(Decimal(self.getnearprice(pl,d,'avg')),4)
logger.info("PRICE_AVG:%s",p.fixed_qt_price)
#p.fixed_qt_price = p.get_fixed_price()
if p.fixed_qt_price == 0:
p.fixed_qt_price = round(Decimal(self.getnearprice(pl,d,'avg_minus_1')),4)
logger.info("PRICE_AVG_MIN:%s",p.fixed_qt_price)
p.unfixed_qt = round(Decimal(self.quantity_theorical) - Decimal(cumul_qt),5)
if p.unfixed_qt < 0.001:
p.unfixed_qt = Decimal(0)