From 291f0a580be176a4c87c03e54372dd7a7cca9cb1 Mon Sep 17 00:00:00 2001 From: Dany Robert Date: Thu, 12 Sep 2024 09:18:19 +0000 Subject: [PATCH] fix: invalid gp calculation (cherry picked from commit c79851239cf3fa663dff2e10a5d5738e7bfa7abf) --- erpnext/controllers/selling_controller.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/controllers/selling_controller.py b/erpnext/controllers/selling_controller.py index 766e67be0f6..7ad12b54eff 100644 --- a/erpnext/controllers/selling_controller.py +++ b/erpnext/controllers/selling_controller.py @@ -640,7 +640,7 @@ class SellingController(StockController): if self.doctype in ["Sales Order", "Quotation"]: for item in self.items: item.gross_profit = flt( - ((item.base_rate - flt(item.valuation_rate)) * item.stock_qty), + ((flt(item.stock_uom_rate) - flt(item.valuation_rate)) * item.stock_qty), self.precision("amount", item), )