Skip to content

feat:Implement PDC Maturity email notification #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

ZakkiyathLulu
Copy link

@ZakkiyathLulu ZakkiyathLulu commented Jun 2, 2025

##Feature Description

This PR introduces a scheduled notification system that alerts internal users and external parties when a Post Dated Cheque (PDC) is nearing its maturity date.

##Solution Description
1.Created doctype PDC Management Settings with fields

  • Maturity Notification Before

  • Maturity Notification Template

  • Notification Role
    2.Created PDC Payment reference - child table

  • Type

  • Name

  • Amount

  • Outstanding amount

  • Allocated amount

  • Pdc clearance date

3.Scheduled email notification if the maturity date is approaching.
Sends email to:
All internal users with the specified role (if configured).
The primary email of the linked Supplier/Customer contact (if available).

##Output Screenshots
image
image
image

##Areas Affected and Ensured
PDC doctype.

##Tested On
Google Chrome

@ZakkiyathLulu ZakkiyathLulu requested a review from mpmuhammad June 2, 2025 11:17
Comment on lines 44 to 46
for user in internal_users
if frappe.db.get_value("User", user, "enabled") and frappe.db.get_value("User", user, "email")
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please recheck this

Comment on lines 68 to 75
for email in recipients:
frappe.sendmail(
recipients=[email],
subject=subject,
message=message,
reference_doctype="Post Dated Cheque",
reference_name=pdc["name"]
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why like this?

Comment on lines +83 to +88
SELECT ce.email_id
FROM `tabDynamic Link` dl
JOIN `tabContact Email` ce ON ce.parent = dl.parent
WHERE dl.link_doctype = %s AND dl.link_name = %s
ORDER BY ce.is_primary DESC
LIMIT 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants