Skip to content

Commit

Permalink
Merge pull request #44687 from ruthra-kumar/backport_v14_pr_42989
Browse files Browse the repository at this point in the history
fix: Wrong allocated_amount for sales_team in gross_profit report (backport #43989)
  • Loading branch information
ruthra-kumar authored Dec 13, 2024
2 parents 00898be + d83cc57 commit 4c8b441
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion erpnext/accounts/report/gross_profit/gross_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ""
Expand Down

0 comments on commit 4c8b441

Please sign in to comment.