Skip to content

Commit

Permalink
fix(portal): show PO pay button if payments installed
Browse files Browse the repository at this point in the history
  • Loading branch information
GursheenK committed Jan 30, 2024
1 parent f8a9554 commit ae7be84
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
12 changes: 12 additions & 0 deletions erpnext/templates/pages/order.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,18 @@ <h3 class="m-0">{{ doc.name }}</h3>
</a>
</ul>
</div>
{% if show_pay_button %}
<div class="form-column col-sm-6">
<div class="page-header-actions-block" data-html-block="header-actions">
<p>
<a href="/api/method/erpnext.accounts.doctype.payment_request.payment_request.make_payment_request?dn={{ doc.name }}&dt={{ doc.doctype }}&submit_doc=1&order_type=Shopping Cart"
class="btn btn-primary btn-sm" id="pay-for-order">
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
</a>
</p>
</div>
</div>
{% endif %}
</div>
{% endblock %}

Expand Down
5 changes: 4 additions & 1 deletion erpnext/templates/pages/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae7be84

Please sign in to comment.