Added finance book filtering logic to financial_statements.py

This commit is contained in:
Gaurav Naik 2018-04-23 04:10:01 +05:30 committed by Nabin Hait
parent 8cbbdfdf30
commit a78a0e241f

View File

@ -375,6 +375,11 @@ def get_additional_conditions(from_date, ignore_closing_entries, filters):
additional_conditions.append("project = '%s'" % (frappe.db.escape(filters.get("project"))))
if filters.get("cost_center"):
additional_conditions.append(get_cost_center_cond(filters.get("cost_center")))
if filters.get("finance_book"):
additional_conditions.append("finance_book = '%s'" % frappe.db.escape(filters.get("finance_book")))
else:
additional_conditions.append("ifnull(finance_book, '') = ''")
return " and {}".format(" and ".join(additional_conditions)) if additional_conditions else ""