mirror of
https://github.com/frappe/erpnext.git
synced 2026-04-15 04:45:09 +00:00
fix: pos disable customer selection at payment (#47169)
(cherry picked from commit f52cbf6165)
Co-authored-by: Diptanil Saha <diptanil@frappe.io>
This commit is contained in:
@@ -188,6 +188,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
|
|
||||||
await me.events.checkout();
|
await me.events.checkout();
|
||||||
me.toggle_checkout_btn(false);
|
me.toggle_checkout_btn(false);
|
||||||
|
me.disable_customer_selection();
|
||||||
|
|
||||||
me.allow_discount_change && me.$add_discount_elem.removeClass("d-none");
|
me.allow_discount_change && me.$add_discount_elem.removeClass("d-none");
|
||||||
});
|
});
|
||||||
@@ -195,6 +196,7 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
this.$totals_section.on("click", ".edit-cart-btn", () => {
|
this.$totals_section.on("click", ".edit-cart-btn", () => {
|
||||||
this.events.edit_cart();
|
this.events.edit_cart();
|
||||||
this.toggle_checkout_btn(true);
|
this.toggle_checkout_btn(true);
|
||||||
|
me.enable_customer_selection();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.$component.on("click", ".add-discount-wrapper", () => {
|
this.$component.on("click", ".add-discount-wrapper", () => {
|
||||||
@@ -698,6 +700,25 @@ erpnext.PointOfSale.ItemCart = class {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disable_customer_selection() {
|
||||||
|
this.$customer_section.find(".reset-customer-btn").css("visibility", "hidden");
|
||||||
|
this.$customer_section.off("click", ".customer-display");
|
||||||
|
this.$customer_section.off("click", ".reset-customer-btn");
|
||||||
|
}
|
||||||
|
|
||||||
|
enable_customer_selection() {
|
||||||
|
this.$customer_section.find(".reset-customer-btn").css("visibility", "visible");
|
||||||
|
this.$customer_section.on("click", ".customer-display", (e) => {
|
||||||
|
if ($(e.target).closest(".reset-customer-btn").length) return;
|
||||||
|
|
||||||
|
const show = this.$cart_container.is(":visible");
|
||||||
|
this.toggle_customer_info(show);
|
||||||
|
});
|
||||||
|
this.$customer_section.on("click", ".reset-customer-btn", () => {
|
||||||
|
this.reset_customer_selector();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
highlight_checkout_btn(toggle) {
|
highlight_checkout_btn(toggle) {
|
||||||
if (toggle) {
|
if (toggle) {
|
||||||
this.$add_discount_elem.css("display", "flex");
|
this.$add_discount_elem.css("display", "flex");
|
||||||
|
|||||||
Reference in New Issue
Block a user