diff --git a/erpnext/buying/doctype/buying_settings/buying_settings.json b/erpnext/buying/doctype/buying_settings/buying_settings.json index 77ce5f7d19..d98a00f0af 100644 --- a/erpnext/buying/doctype/buying_settings/buying_settings.json +++ b/erpnext/buying/doctype/buying_settings/buying_settings.json @@ -151,6 +151,7 @@ }, { "default": "1", + "depends_on": "eval: frappe.boot.versions && frappe.boot.versions.payments", "fieldname": "show_pay_button", "fieldtype": "Check", "label": "Show Pay Button in Purchase Order Portal" @@ -213,7 +214,7 @@ "index_web_pages_for_search": 1, "issingle": 1, "links": [], - "modified": "2024-01-30 14:04:43.177427", + "modified": "2024-01-31 13:34:18.101256", "modified_by": "Administrator", "module": "Buying", "name": "Buying Settings", diff --git a/erpnext/templates/pages/order.html b/erpnext/templates/pages/order.html index 97bf48727c..6c59a9688d 100644 --- a/erpnext/templates/pages/order.html +++ b/erpnext/templates/pages/order.html @@ -34,6 +34,18 @@ + {% if show_pay_button %} +
+
+

+ + {{ _("Pay") }} {{doc.get_formatted("grand_total") }} + +

+
+
+ {% endif %} {% endblock %} diff --git a/erpnext/templates/pages/order.py b/erpnext/templates/pages/order.py index d0968bf88a..21d4b860d1 100644 --- a/erpnext/templates/pages/order.py +++ b/erpnext/templates/pages/order.py @@ -48,7 +48,10 @@ def get_context(context): ) context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points")) - context.show_pay_button = frappe.db.get_single_value("Buying Settings", "show_pay_button") + context.show_pay_button = ( + "payments" in frappe.get_installed_apps() + and frappe.db.get_single_value("Buying Settings", "show_pay_button") + ) context.show_make_pi_button = False if context.doc.get("supplier"): # show Make Purchase Invoice button based on permission