fix: ignore cancelled dunnings
This commit is contained in:
parent
0a06241e7c
commit
8bfe865759
@ -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:
|
||||
|
Loading…
x
Reference in New Issue
Block a user