Merge branch 'staging' into develop

This commit is contained in:
Frappe Bot
2019-01-23 08:19:00 +00:00
35 changed files with 570 additions and 117 deletions

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):
def get_outstanding_invoices(party_type, party, account, condition=None, limit=1000):
outstanding_invoices = []
precision = frappe.get_precision("Sales Invoice", "outstanding_amount")
@@ -628,6 +628,7 @@ def get_outstanding_invoices(party_type, party, account, condition=None):
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)
invoice_list = frappe.db.sql("""
select
@@ -655,11 +656,12 @@ def get_outstanding_invoices(party_type, party, account, condition=None):
or (voucher_type not in ('Journal Entry', 'Payment Entry')))
group by voucher_type, voucher_no
having (invoice_amount - payment_amount) > 0.005
order by posting_date, creation""".format(
order by posting_date, name {limit_cond}""".format(
dr_or_cr=dr_or_cr,
invoice = invoice,
payment_dr_or_cr=payment_dr_or_cr,
condition=condition or ""
condition=condition or "",
limit_cond = limit_cond
), {
"party_type": party_type,
"party": party,