From 7556550158d26f3744e4e3d2ed81218cd822668f Mon Sep 17 00:00:00 2001 From: "mergify[bot]" <37929162+mergify[bot]@users.noreply.github.com> Date: Sun, 19 Apr 2026 12:52:15 +0530 Subject: [PATCH] fix: use qty instead of stock qty dropship gross profit report (backport #54389) (#54391) fix: use qty instead of stock qty dropship gross profit report (#54389) (cherry picked from commit d6b379b936d4d2861c040f61308484fef18af15f) Co-authored-by: Mihir Kandoi --- erpnext/accounts/report/gross_profit/gross_profit.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index ad692f0fbbd..dfba16a77eb 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -790,7 +790,7 @@ class GrossProfitGenerator: table = frappe.qb.DocType("Purchase Invoice Item") query = ( frappe.qb.from_(table) - .select(Sum(table.stock_qty * table.base_net_rate)) + .select(Sum(table.qty * table.base_net_rate)) .where((table.po_detail.isin(po_details)) & (table.docstatus == 1)) ) return flt(query.run()[0][0])