diff --git a/POS/src/components/pos/POSHeader.vue b/POS/src/components/pos/POSHeader.vue
index bcb2edf8..cdc97830 100644
--- a/POS/src/components/pos/POSHeader.vue
+++ b/POS/src/components/pos/POSHeader.vue
@@ -214,8 +214,8 @@
-
-
+
+
{{ __("View Shift") }}
-
+
+
@@ -1166,6 +1190,8 @@ const profileWarehouses = computed(() => {
return [];
});
+const canAccessShiftActions = computed(() => shiftStore.hasOpenShift);
+
// Resize state
let resizeState = null;
let bodyStyleSnapshot = null;
@@ -1436,7 +1462,12 @@ watch(
(value) => {
if (value && typeof window !== "undefined") {
updateLayoutBounds();
+ return;
}
+
+ uiStore.showDraftDialog = false;
+ uiStore.showHistoryDialog = false;
+ uiStore.showReturnDialog = false;
}
);
@@ -2181,9 +2212,45 @@ async function handleOptionSelected(option) {
}
function handleCloseShift() {
+ if (!canAccessShiftActions.value) {
+ return;
+ }
+
uiStore.showCloseShiftDialog = true;
}
+function openDraftDialog() {
+ if (!canAccessShiftActions.value) {
+ return;
+ }
+
+ uiStore.showDraftDialog = true;
+}
+
+function openHistoryDialog() {
+ if (!canAccessShiftActions.value) {
+ return;
+ }
+
+ uiStore.showHistoryDialog = true;
+}
+
+function openReturnDialog() {
+ if (!canAccessShiftActions.value) {
+ return;
+ }
+
+ uiStore.showReturnDialog = true;
+}
+
+function switchToDesk() {
+ if (!canAccessShiftActions.value || typeof window === "undefined") {
+ return;
+ }
+
+ window.location.assign("/app");
+}
+
function formatCurrency(amount) {
return Number.parseFloat(amount || 0).toFixed(2);
}