From d83cc57e582885097d0b251cd9e9361c0cc280d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Di=C3=B3genes=20Souza?= <103958767+devdiogenes@users.noreply.github.com> Date: Fri, 13 Dec 2024 03:26:55 -0300 Subject: [PATCH] fix: Wrong allocated_amount for sales_team in gross_profit report (#42989) * fix: Wrong allocated_amount for sales_team in gross_profit report * style: Removes whitespaces --------- Co-authored-by: ruthra kumar --- erpnext/accounts/report/gross_profit/gross_profit.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 833bb78a329f..15617a53cdff 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -768,7 +768,10 @@ def load_invoice_items(self): """ if self.filters.group_by == "Sales Person": - sales_person_cols = ", sales.sales_person, sales.allocated_amount, sales.incentives" + sales_person_cols = """, sales.sales_person, + sales.allocated_percentage * `tabSales Invoice Item`.base_net_amount / 100 as allocated_amount, + sales.incentives + """ sales_team_table = "left join `tabSales Team` sales on sales.parent = `tabSales Invoice`.name" else: sales_person_cols = ""