fix: Supplier Leaderboard fix

This commit is contained in:
marination 2020-09-03 19:45:04 +05:30
parent d19947fccd
commit 2a56000460

View File

@ -123,7 +123,8 @@ def get_all_suppliers(date_range, company, field, limit = None):
if field == "outstanding_amount":
filters = [['docstatus', '=', '1'], ['company', '=', company]]
if date_range:
filters.append(['posting_date', 'between' [date_range[0], date_range[1]]])
date_range = frappe.parse_json(date_range)
filters.append(['posting_date', 'between', [date_range[0], date_range[1]]])
return frappe.db.get_all('Purchase Invoice',
fields = ['supplier as name', 'sum(outstanding_amount) as value'],
filters = filters,