diff --git a/modules/purchase_trade/valuation.py b/modules/purchase_trade/valuation.py index 1c76b56..faea6ec 100644 --- a/modules/purchase_trade/valuation.py +++ b/modules/purchase_trade/valuation.py @@ -100,7 +100,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, 4) + amount = round(pc.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) @@ -109,14 +109,14 @@ class ValuationBase(ModelSQL): base_amount = Currency.compute(currency,amount, line.purchase.company.currency) rate = round(amount / base_amount,6) last_price = pc.get_last_price() - mtm = round(Decimal(last_price) * qty * Decimal(sign), 4) if last_price else Decimal(0) + mtm = round(Decimal(last_price) * qty * Decimal(sign), 2) if last_price else Decimal(0) values.update({ 'quantity': round(qty, 5), 'amount': amount, 'base_amount': base_amount, 'rate': rate, - 'mtm': round(amount - (mtm * pc.ratio / 100), 4), + 'mtm': round(amount - (mtm * pc.ratio / 100), 2), 'unit': sale_line.unit.id if sale_line else line.unit.id, 'currency': currency, }) @@ -135,7 +135,7 @@ class ValuationBase(ModelSQL): ) qty = lot.get_current_quantity_converted() - amount = round(price * qty * Decimal(sign), 4) + amount = round(price * qty * Decimal(sign), 2) base_amount = amount currency = sale_line.sale.currency.id if sale_line else line.purchase.currency.id company_currency = sale_line.sale.company.currency if sale_line else line.purchase.company.currency @@ -318,8 +318,8 @@ class ValuationBase(ModelSQL): 'product': d.product.id, 'state': 'fixed', 'quantity': round(d.quantity, 5), - 'amount': round(price * d.quantity * Decimal(-1), 4), - 'mtm': round((price * d.quantity * Decimal(-1)) - (mtm * d.quantity * Decimal(-1)), 4), + 'amount': round(price * d.quantity * Decimal(-1), 2), + 'mtm': round((price * d.quantity * Decimal(-1)) - (mtm * d.quantity * Decimal(-1)), 2), 'unit': line.unit.id, 'currency': line.purchase.currency.id, })