Merge pull request #39658 from frappe/mergify/bp/version-15-hotfix/pr-39643
fix(portal): show PO pay button if payments installed (backport #39643)
This commit is contained in:
commit
c74482a27c
@ -151,6 +151,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "1",
|
"default": "1",
|
||||||
|
"depends_on": "eval: frappe.boot.versions && frappe.boot.versions.payments",
|
||||||
"fieldname": "show_pay_button",
|
"fieldname": "show_pay_button",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Show Pay Button in Purchase Order Portal"
|
"label": "Show Pay Button in Purchase Order Portal"
|
||||||
@ -213,7 +214,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-01-30 14:04:43.177427",
|
"modified": "2024-01-31 13:34:18.101256",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Buying Settings",
|
"name": "Buying Settings",
|
||||||
@ -263,4 +264,4 @@
|
|||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
"states": [],
|
"states": [],
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,18 @@
|
|||||||
</a>
|
</a>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
@ -48,7 +48,10 @@ def get_context(context):
|
|||||||
)
|
)
|
||||||
context.available_loyalty_points = int(loyalty_program_details.get("loyalty_points"))
|
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
|
context.show_make_pi_button = False
|
||||||
if context.doc.get("supplier"):
|
if context.doc.get("supplier"):
|
||||||
# show Make Purchase Invoice button based on permission
|
# show Make Purchase Invoice button based on permission
|
||||||
|
Loading…
x
Reference in New Issue
Block a user