mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-20 23:35:11 +00:00
fix: ignore cancelled dunnings
This commit is contained in:
@@ -75,7 +75,8 @@ def resolve_dunning(doc, state):
|
||||
unresolved_dunnings = frappe.get_all("Dunning",
|
||||
filters={
|
||||
"sales_invoice": reference.reference_name,
|
||||
"status": ("!=", "Resolved")
|
||||
"status": ("!=", "Resolved"),
|
||||
"docstatus": ("!=", 2),
|
||||
},
|
||||
pluck="name"
|
||||
)
|
||||
|
||||
@@ -7,7 +7,7 @@ def execute():
|
||||
frappe.reload_doc("accounts", "doctype", "overdue_payment")
|
||||
frappe.reload_doc("accounts", "doctype", "dunning")
|
||||
|
||||
all_dunnings = frappe.get_all("Dunning", pluck="name")
|
||||
all_dunnings = frappe.get_all("Dunning", filters={"docstatus": ("!=", 2)}, pluck="name")
|
||||
for dunning_name in all_dunnings:
|
||||
dunning = frappe.get_doc("Dunning", dunning_name)
|
||||
if not dunning.sales_invoice:
|
||||
|
||||
Reference in New Issue
Block a user