Merge pull request #34077 from s-aga-r/purchase-order-portal
fix: show Purchase Order Portal `Pay` button based on configuration
This commit is contained in:
commit
c292859b59
@ -21,6 +21,7 @@
|
|||||||
"allow_multiple_items",
|
"allow_multiple_items",
|
||||||
"bill_for_rejected_quantity_in_purchase_invoice",
|
"bill_for_rejected_quantity_in_purchase_invoice",
|
||||||
"disable_last_purchase_rate",
|
"disable_last_purchase_rate",
|
||||||
|
"show_pay_button",
|
||||||
"subcontract",
|
"subcontract",
|
||||||
"backflush_raw_materials_of_subcontract_based_on",
|
"backflush_raw_materials_of_subcontract_based_on",
|
||||||
"column_break_11",
|
"column_break_11",
|
||||||
@ -140,6 +141,12 @@
|
|||||||
"fieldname": "disable_last_purchase_rate",
|
"fieldname": "disable_last_purchase_rate",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Disable Last Purchase Rate"
|
"label": "Disable Last Purchase Rate"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "show_pay_button",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Show Pay Button in Purchase Order Portal"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"icon": "fa fa-cog",
|
"icon": "fa fa-cog",
|
||||||
@ -147,7 +154,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-01-09 17:08:28.828173",
|
"modified": "2023-02-15 14:42:10.200679",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "Buying",
|
"module": "Buying",
|
||||||
"name": "Buying Settings",
|
"name": "Buying Settings",
|
||||||
|
|||||||
@ -34,16 +34,18 @@
|
|||||||
</a>
|
</a>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-column col-sm-6">
|
{% if show_pay_button %}
|
||||||
<div class="page-header-actions-block" data-html-block="header-actions">
|
<div class="form-column col-sm-6">
|
||||||
<p>
|
<div class="page-header-actions-block" data-html-block="header-actions">
|
||||||
<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"
|
<p>
|
||||||
class="btn btn-primary btn-sm" id="pay-for-order">
|
<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"
|
||||||
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
|
class="btn btn-primary btn-sm" id="pay-for-order">
|
||||||
</a>
|
{{ _("Pay") }} {{doc.get_formatted("grand_total") }}
|
||||||
</p>
|
</a>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,7 @@ 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_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