Skip to content

Commit

Permalink
fix: server error while creating sales person
Browse files Browse the repository at this point in the history
issue: #75
  • Loading branch information
tinadn committed Oct 3, 2024
1 parent 2625fc5 commit 54b32f1
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions erpnext/setup/doctype/sales_person/sales_person.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,21 @@ def load_dashboard_info(self):
company_default_currency = get_default_currency()

allocated_amount_against_order = flt(
frappe.db.get_value(
"Sales Team",
{"docstatus": 1, "parenttype": "Sales Order", "sales_person": self.sales_person_name},
"sum(allocated_amount)",
frappe.db.sql(
"""
SELECT sum(allocated_amount)
FROM `tabSales Team`
WHERE parenttype = 'Sales Order' and docstatus = 1 and 'sales_person' = '{sales_person}'
""".format(sales_person=self.sales_person_name),
)
)

allocated_amount_against_invoice = flt(
frappe.db.get_value(
"Sales Team",
{"docstatus": 1, "parenttype": "Sales Invoice", "sales_person": self.sales_person_name},
"sum(allocated_amount)",
)
"""
SELECT sum(allocated_amount)
FROM `tabSales Team`
WHERE parenttype = 'Sales Invoice' and docstatus = 1 and 'sales_person' = '{sales_person}'
""".format(sales_person=self.sales_person_name),
)

info = {}
Expand Down

0 comments on commit 54b32f1

Please sign in to comment.