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 d6b379b936)

Co-authored-by: Mihir Kandoi <kandoimihir@gmail.com>
This commit is contained in:
mergify[bot]
2026-04-19 12:52:15 +05:30
committed by GitHub
parent 78aaf6c7e8
commit 7556550158

View File

@@ -790,7 +790,7 @@ class GrossProfitGenerator:
table = frappe.qb.DocType("Purchase Invoice Item") table = frappe.qb.DocType("Purchase Invoice Item")
query = ( query = (
frappe.qb.from_(table) 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)) .where((table.po_detail.isin(po_details)) & (table.docstatus == 1))
) )
return flt(query.run()[0][0]) return flt(query.run()[0][0])