fix: don't send payment reminder if member has already paid later

This commit is contained in:
Jannat Patel
2025-03-04 17:24:03 +05:30
parent 73379a1bd8
commit cceff77bc2

View File

@@ -33,9 +33,24 @@ def send_payment_reminder():
)
for payment in incomplete_payments:
if has_paid_later(payment):
continue
send_mail(payment)
def has_paid_later(payment):
return frappe.db.exists(
"LMS Payment",
{
"member": payment.member,
"payment_received": 1,
"payment_for_document": payment.payment_for_document,
"payment_for_document_type": payment.payment_for_document_type,
},
)
def send_mail(payment):
subject = _("Complete Your Enrollment - Don't miss out!")
template = "payment_reminder"