diff --git a/custom_ui/events/jobs.py b/custom_ui/events/jobs.py index c8cb80e..3ed0a59 100644 --- a/custom_ui/events/jobs.py +++ b/custom_ui/events/jobs.py @@ -81,6 +81,9 @@ def before_save(doc, method): def after_save(doc, method): print("DEBUG: After Save Triggered for Project:", doc.name) + if doc.status == "Completed": + print("DEBUG: Project marked as Completed. Generating and sending final invoice.") + if doc.ready_to_schedule: service_apt_ready_to_schedule = frappe.get_value("Service Address 2", doc.service_appointment, "ready_to_schedule") if not service_apt_ready_to_schedule: diff --git a/custom_ui/install.py b/custom_ui/install.py index 650208e..7f79c8a 100644 --- a/custom_ui/install.py +++ b/custom_ui/install.py @@ -1414,7 +1414,7 @@ def create_accounts(): "parent_account": account["parent_account"], "is_group": 0 }) - doc.insert(ignore_permissions=True) + doc.insert(ignore_permissions=True, ignore_if_duplicate=True) frappe.db.commit() diff --git a/custom_ui/www/cancelled_payment.html b/custom_ui/www/cancelled_payment.html new file mode 100644 index 0000000..4fbec21 --- /dev/null +++ b/custom_ui/www/cancelled_payment.html @@ -0,0 +1,141 @@ + + + + + + Payment Cancelled + + + + +
+
+

Payment Cancelled

+

Your payment has been cancelled.

+ +
+

Payment Not Processed

+

No charges have been made to your account. If you cancelled by mistake or need assistance, please try again or contact support.

+
+ +
+

What happens next?

+ +
+
+ +