From cec9817f5fd995676ef488f36bba6b9883cf9385 Mon Sep 17 00:00:00 2001 From: Jishnu-Epics Date: Sat, 10 May 2025 00:00:28 +0530 Subject: [PATCH] updated item cart branch --- posnext/public/js/pos_item_cart.js | 145 +++++++++++++---------------- 1 file changed, 67 insertions(+), 78 deletions(-) diff --git a/posnext/public/js/pos_item_cart.js b/posnext/public/js/pos_item_cart.js index 3a7cbdf..2df473f 100644 --- a/posnext/public/js/pos_item_cart.js +++ b/posnext/public/js/pos_item_cart.js @@ -108,14 +108,12 @@ posnext.PointOfSale.ItemCart = class { html += `
${__('Amount')}
-
` this.$component.append(html); this.$cart_container = this.$component.find('.cart-container'); - this.make_branch_section(); this.make_cart_totals_section(); this.make_cart_items_section(); this.make_cart_numpad(); @@ -154,86 +152,77 @@ posnext.PointOfSale.ItemCart = class { `; } - make_branch_section() { - if (this.show_branch) { - this.$branch_section = this.$component.find('.cart-branch-section'); - - if (this.$branch_section.length) { - this.$branch_section.append(` -
-
- ${this.get_branch_icon()} ${__('Add Branch')} -
- `); - // Change cursor on hover - this.$branch_section.find('.add-branch-wrapper').hover( - function () { - $(this).css("background-color", "#f9f9f9"); - }, - function () { - $(this).css("background-color", "transparent"); - } - ); - } - } - } - - make_cart_totals_section() { this.$totals_section = this.$component.find('.cart-totals-section'); - + + let branchHTML = ''; + if (this.show_branch) { + branchHTML = ` +
+
+ ${this.get_branch_icon()} ${__('Add Branch')} +
+
`; + } + this.$totals_section.append( - `
- ${this.get_discount_icon()} ${__('Add Discount')} -
-
-
${__('Total Items')}
-
0.00
+ `
+
+
+ ${this.get_discount_icon()} ${__('Add Discount')} +
-
-
${__("Net Total")}
-
0.00
-
-
-
-
${__('Grand Total')}
-
0.00
-
-
-
${__('Checkout (F1)')}
-
${__('Held (F2)')}
-
${__('Order List (F3)')}
-
-
${__('Edit Cart')}
` - ) - - this.$add_discount_elem = this.$component.find(".add-discount-wrapper"); -this.highlight_checkout_btn(true); - } + ${branchHTML} +
+ +
+
${__('Total Items')}
+
0.00
+
+
+
${__("Net Total")}
+
0.00
+
+
+
+
${__('Grand Total')}
+
0.00
+
+
+
${__('Checkout (F1)')}
+
${__('Held (F2)')}
+
${__('Order List (F3)')}
+
+
${__('Edit Cart')}
` + ); + + this.$component.find('.action-box').css({ + width: '100%', + padding: '10px', + border: '1px dashed #ccc', + borderRadius: '6px', + minHeight: '48px', + height: '30px', + display: 'flex', + alignItems: 'center', + justifyContent: 'center', + gap: '6px', + fontSize: '14px', + boxSizing: 'border-box' + }); + + this.$component.find('.action-box').hover( + function () { + $(this).css("background-color", "#f9f9f9"); + }, + function () { + $(this).css("background-color", "transparent"); + } + ); + + this.$add_discount_elem = this.$component.find('.add-discount-wrapper'); + this.highlight_checkout_btn(true); + } make_cart_numpad() { this.$numpad_section = this.$component.find('.numpad-section');