mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-03 20:29:09 +00:00
fix: Don't fetch already discounted invoice
This commit is contained in:
@@ -190,9 +190,11 @@ def get_invoices(filters):
|
|||||||
customer,
|
customer,
|
||||||
posting_date,
|
posting_date,
|
||||||
outstanding_amount
|
outstanding_amount
|
||||||
from `tabSales Invoice`
|
from `tabSales Invoice` si
|
||||||
where
|
where
|
||||||
docstatus = 1
|
docstatus = 1
|
||||||
and outstanding_amount > 0
|
and outstanding_amount > 0
|
||||||
%s
|
%s
|
||||||
|
and not exists(select di.name from `tabDiscounted Invoice` di
|
||||||
|
where di.docstatus=1 and di.sales_invoice=si.name)
|
||||||
""" % where_condition, filters, as_dict=1)
|
""" % where_condition, filters, as_dict=1)
|
||||||
Reference in New Issue
Block a user