refactor: Simplify code

This commit is contained in:
Suraj Shetty 2020-08-23 16:56:46 +05:30
parent 314551ceb2
commit 99dfb9556d

View File

@ -123,7 +123,7 @@ 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]]])
filters.append(['posting_date', 'between', date_range])
return frappe.db.get_all('Purchase Invoice',
fields = ['supplier as name', 'sum(outstanding_amount) as value'],
filters = filters,