Updated invoice and autopay logic.

This commit is contained in:
Ty Reynolds
2026-02-10 08:42:57 -05:00
parent 75600fdbeb
commit 4357ce7fcc
2 changed files with 36 additions and 36 deletions

View File

@@ -8,8 +8,8 @@ def check_autopay(customer):
cust = frappe.get_doc("Customer", customer)
return {
"autopay_enabled": bool(cust.auto_pay),
"autopay_id": cust.auto_pay_id if cust.auto_pay else None
"autopay_enabled": bool(cust.custom_auto_pay_status),
"autopay_id": cust.auto_pay_id if cust.custom_auto_pay_status else None
}
@@ -22,7 +22,7 @@ def run_autopay_payment(invoice):
cust = frappe.get_doc("Customer", inv.customer)
if not cust.auto_pay or not cust.auto_pay_id:
if not cust.custom_auto_pay_status or not cust.auto_pay_id:
frappe.throw("Customer does not have AutoPay enabled")
payload = {