Merge pull request #16679 from nabinhait/get_oustanding

Get outstanding invoices
This commit is contained in:
Nabin Hait 2019-02-15 14:23:07 +05:30 committed by GitHub
commit 9d85876086
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -615,7 +615,7 @@ def get_held_invoices(party_type, party):
return held_invoices
def get_outstanding_invoices(party_type, party, account, condition=None, limit=1000):
def get_outstanding_invoices(party_type, party, account, condition=None, limit=None):
outstanding_invoices = []
precision = frappe.get_precision("Sales Invoice", "outstanding_amount") or 2
@ -628,7 +628,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None, limit=1
invoice = 'Sales Invoice' if erpnext.get_party_account_type(party_type) == 'Receivable' else 'Purchase Invoice'
held_invoices = get_held_invoices(party_type, party)
limit_cond = "limit %s" % (limit or 1000)
limit_cond = "limit %s" % limit if limit else ""
invoice_list = frappe.db.sql("""
select