diff --git a/inventory/views.py b/inventory/views.py index 276b1428..df316832 100644 --- a/inventory/views.py +++ b/inventory/views.py @@ -1830,7 +1830,7 @@ def create_estimate(request): items_txs.append( { "item_number": item_instance.item_number, - "quantity": float(item.get("quantity")), + "quantity": Decimal(item.get("quantity")), "unit_cost": car_instance.finances.cost_price, "unit_revenue": car_instance.finances.selling_price, "total_amount": (car_instance.finances.total_vat) @@ -1854,7 +1854,7 @@ def create_estimate(request): item.item_number: { "unit_cost": instance.finances.cost_price, "unit_revenue": instance.finances.selling_price, - "quantity": float(quantities), + "quantity": Decimal(quantities), "total_amount": instance.finances.total_vat * int(quantities), } } @@ -2143,8 +2143,8 @@ def invoice_create(request, pk): "unit_cost": car.finances.total_vat, "unit_revenue": car.finances.total_vat, "quantity": item.ce_quantity, - "total_amount": float(car.finances.total_vat) - * float(item.ce_quantity), + "total_amount": Decimal(car.finances.total_vat) + * Decimal(item.ce_quantity), } ) invoice_itemtxs = {