From c76d96646c28df3caa6c4dabd62991609ba459ac Mon Sep 17 00:00:00 2001 From: Ali Raza Date: Fri, 5 Jun 2026 12:05:03 +0500 Subject: [PATCH] refactor: remove unused permissions and related code from POS profile - Removed allow_rate_change, allow_discount_change, allow_print_last_invoice, and allow_print_draft_invoices from posStore and POSProfile type definitions. - Updated RolePermissionsView to reflect the removal of certain permissions. - Adjusted auth.py to remove unused permission keys. - Modified invoices.py and shifts.py to utilize new permission checks for printing draft invoices. - Cleaned up install.py by removing deprecated permissions and adjusting default role settings. - Updated pos_profile.json to remove fields related to removed permissions and added new fields for cashier settlement and backup receipt printing. - Updated pos_profile_user.json to reflect recent changes in the system. --- frontend/src/components/MenuBar.vue | 1 + frontend/src/components/Navbar.vue | 8 +- frontend/src/components/cart/CartItem.vue | 7 +- frontend/src/components/cart/CartSummary.vue | 3 +- .../components/dialogs/ItemDetailDialog.vue | 3 +- .../src/components/dialogs/PaymentDialog.vue | 48 +- frontend/src/services/userRights.ts | 54 +- frontend/src/stores/posStore.ts | 17 - frontend/src/types/pos.types.ts | 5 - frontend/src/views/RolePermissionsView.vue | 41 +- xpos/api/auth.py | 27 +- xpos/api/invoices.py | 6 +- xpos/api/shifts.py | 6 +- xpos/install.py | 35 +- xpos/x_pos/custom/pos_profile.json | 514 ++++++------------ xpos/x_pos/custom/pos_profile_user.json | 2 +- 16 files changed, 216 insertions(+), 561 deletions(-) diff --git a/frontend/src/components/MenuBar.vue b/frontend/src/components/MenuBar.vue index 674d2f4..96a61b6 100755 --- a/frontend/src/components/MenuBar.vue +++ b/frontend/src/components/MenuBar.vue @@ -364,6 +364,7 @@ const menus = computed(() => [ label: "Return Invoice", icon: RotateCcw, shortcut: "Ctrl+R", + hidden: () => !hasPermission("sale_return"), disabled: () => !posStore.allowReturn, action: () => { window.dispatchEvent(new CustomEvent("xpos:show-return-dialog")); diff --git a/frontend/src/components/Navbar.vue b/frontend/src/components/Navbar.vue index a37d928..d292949 100755 --- a/frontend/src/components/Navbar.vue +++ b/frontend/src/components/Navbar.vue @@ -95,7 +95,7 @@ - +