Updated invoice and autopay logic.
This commit is contained in:
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user