mirror of
https://github.com/frappe/erpnext.git
synced 2026-09-14 09:23:09 +00:00
Merge branch 'staging' into develop
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user