Merge pull request #16955 from rohitwaghchaure/sales_person_showing_wrong_on_ars
fix: Accounts receivable report, remarks showing in the sales person column
diff --git a/erpnext/hr/doctype/leave_application/leave_application.py b/erpnext/hr/doctype/leave_application/leave_application.py
index b85f38b..692db8e 100755
--- a/erpnext/hr/doctype/leave_application/leave_application.py
+++ b/erpnext/hr/doctype/leave_application/leave_application.py
@@ -505,8 +505,6 @@
def add_leaves(events, start, end, filter_conditions=None):
conditions = []
- if filter_conditions:
- conditions.append(filter_conditions)
if not cint(frappe.db.get_value("HR Settings", None, "show_leaves_of_all_department_members_in_calendar")):
from frappe.desk.reportview import build_match_conditions
@@ -520,11 +518,14 @@
from `tabLeave Application` where
from_date <= %(end)s and to_date >= %(start)s <= to_date
and docstatus < 2
- and status!="Rejected" """
+ and status!='Rejected' """
if conditions:
query += ' and ' + ' and '.join(conditions)
+ if filter_conditions:
+ query += filter_conditions
+
for d in frappe.db.sql(query, {"start":start, "end": end}, as_dict=True):
e = {
"name": d.name,