@feedmepos/mf-report 5.28.4-beta.4 → 5.28.4-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{App-Djjl57h1.js → App-c2BxKgqk.js} +4 -4
- package/dist/{DateRangeSelect-BLMCCQe6.js → DateRangeSelect-BpBpNlAF.js} +1 -1
- package/dist/{Default.vue_vue_type_script_setup_true_lang-B_2SI6LW.js → Default.vue_vue_type_script_setup_true_lang-D-Se8EHw.js} +1 -1
- package/dist/{DynamicWidget.vue_vue_type_script_setup_true_lang-jQ1nPG2W.js → DynamicWidget.vue_vue_type_script_setup_true_lang-CUomxbbm.js} +4 -4
- package/dist/{GlobalFilterSelect.vue_vue_type_script_setup_true_lang-C_9MCXdv.js → GlobalFilterSelect.vue_vue_type_script_setup_true_lang-D43rK-ar.js} +3 -3
- package/dist/{InsightView-K3vQVr7P.js → InsightView-DPRA524-.js} +5 -5
- package/dist/{Integration-DlTrxZMm.js → Integration-BayS_wae.js} +3 -3
- package/dist/{Integrations-JGAGoCyo.js → Integrations-6UBvLfz6.js} +2 -2
- package/dist/{Layout-D7hDkjS0.js → Layout-CvY-cS3c.js} +1 -1
- package/dist/{LocationSelect.vue_vue_type_script_setup_true_lang-vRpj6FDQ.js → LocationSelect.vue_vue_type_script_setup_true_lang-CGAnWHiG.js} +2 -2
- package/dist/{MenuTab.vue_vue_type_script_setup_true_lang-BQLwZjxv.js → MenuTab.vue_vue_type_script_setup_true_lang-DeQo93qA.js} +5 -5
- package/dist/{NavigationTab.vue_vue_type_script_setup_true_lang-B-fFAm9x.js → NavigationTab.vue_vue_type_script_setup_true_lang-Dl2ZSI8f.js} +5 -5
- package/dist/{OverviewView-BbyaS0w_.js → OverviewView-SxYadRgK.js} +4 -4
- package/dist/{Report-B2iXUeAj.js → Report-OGP3775t.js} +247 -236
- package/dist/{ReportCanvasView-CqUPNxab.js → ReportCanvasView-5pLCE58u.js} +3 -3
- package/dist/{ReportEditor-EdMUVHKG.js → ReportEditor-C3r_5wKe.js} +7 -7
- package/dist/{ReportView-DjVEhVEQ.js → ReportView-BeNILR1t.js} +6 -6
- package/dist/{ReportViewRoute-MZCFhrBo.js → ReportViewRoute-Cw8EbetI.js} +2 -2
- package/dist/{Setting-Br_ALEEg.js → Setting-_scvQJEC.js} +3 -3
- package/dist/{Template-DQVX1HBw.js → Template-CnDYWRaV.js} +3 -3
- package/dist/{TileEditor-O4AspIIL.js → TileEditor-Caal9QVe.js} +6 -6
- package/dist/{TilePageStack.vue_vue_type_script_setup_true_lang-C5zloxIx.js → TilePageStack.vue_vue_type_script_setup_true_lang-4IWIJo_S.js} +2 -2
- package/dist/{TransitionFade-C5MRU6gb.js → TransitionFade-DSsnM6J9.js} +5 -5
- package/dist/{app-DEsnATwZ.js → app-e8Pud10z.js} +12 -12
- package/dist/app.js +1 -1
- package/dist/{report-vndE_X4l.js → report-AhRrPMU6.js} +1 -1
- package/dist/style.css +1 -1
- package/dist/{useRestaurantPermission-BCn9Dv7A.js → useRestaurantPermission-D2RhNs5d.js} +1 -1
- package/package.json +1 -1
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { storeToRefs as
|
|
3
|
-
import { u as
|
|
4
|
-
import { _ as
|
|
5
|
-
import { u as
|
|
6
|
-
import { u as
|
|
7
|
-
import { useSnackbar as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { c as
|
|
10
|
-
import { useRouter as
|
|
11
|
-
import { useI18n as
|
|
12
|
-
import { r as
|
|
13
|
-
const
|
|
1
|
+
import { defineComponent as Te, ref as $, watch as Se, computed as R, h as d, withModifiers as we, resolveComponent as I, createBlock as ee, openBlock as z, withCtx as m, createVNode as c, createElementVNode as v, unref as t, normalizeStyle as Ae, normalizeClass as g, withDirectives as he, createElementBlock as ze, Fragment as Je, renderList as Be, toDisplayString as k, createTextVNode as Ke, vShow as Re } from "vue";
|
|
2
|
+
import { storeToRefs as xe } from "pinia";
|
|
3
|
+
import { u as Ee, s as je } from "./report-AhRrPMU6.js";
|
|
4
|
+
import { _ as Ye } from "./Default.vue_vue_type_script_setup_true_lang-D-Se8EHw.js";
|
|
5
|
+
import { u as qe } from "./message-dialog-UoMWOnil.js";
|
|
6
|
+
import { u as He } from "./global-loader-BuxFfehu.js";
|
|
7
|
+
import { useSnackbar as Ge, useBreakpoints as Qe, components as We, FmButtonColorThemeVariant as Xe } from "@feedmepos/ui-library";
|
|
8
|
+
import { _ as Ze } from "./SelectComponent.vue_vue_type_script_setup_true_lang-DW7Dk7iQ.js";
|
|
9
|
+
import { c as et, a as Pe, h as tt } from "./app-e8Pud10z.js";
|
|
10
|
+
import { useRouter as ot, useRoute as at, onBeforeRouteLeave as st } from "vue-router";
|
|
11
|
+
import { useI18n as rt } from "@feedmepos/mf-common";
|
|
12
|
+
import { r as te } from "./i18n-DbyciK4x.js";
|
|
13
|
+
const nt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, lt = { class: "w-[343px]" }, ct = { class: "fm-typo-en-body-md-600" }, it = ["tabindex", "aria-disabled", "onClick"], pt = { class: "fm-typo-en-body-md-400 max-w-[240px]" }, Pt = /* @__PURE__ */ Te({
|
|
14
14
|
__name: "Report",
|
|
15
|
-
setup(
|
|
16
|
-
const { t: a, te: J } =
|
|
17
|
-
reports:
|
|
15
|
+
setup(dt) {
|
|
16
|
+
const { t: a, te: J } = rt(), oe = ot(), ae = at(), S = Ee(), Ce = et(), { business: Ie } = xe(Pe()), {
|
|
17
|
+
reports: f,
|
|
18
18
|
overviewReport: B,
|
|
19
|
-
categories:
|
|
20
|
-
pinReport:
|
|
21
|
-
isOpenAddReportDialog:
|
|
22
|
-
scrollPositionY:
|
|
23
|
-
customReportQuota:
|
|
24
|
-
canCreateCustomReport:
|
|
25
|
-
} =
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}),
|
|
29
|
-
|
|
30
|
-
|
|
19
|
+
categories: O,
|
|
20
|
+
pinReport: F,
|
|
21
|
+
isOpenAddReportDialog: ke,
|
|
22
|
+
scrollPositionY: se,
|
|
23
|
+
customReportQuota: L,
|
|
24
|
+
canCreateCustomReport: re
|
|
25
|
+
} = xe(S), { promptMessage: ne } = qe(), { promptLoader: K } = He(), l = Ge(), { breakpoints: p } = Qe(), { canRead: le, canUpdate: ce, canDuplicate: ie, canDelete: E, canCreateReport: _e } = tt(), h = $();
|
|
26
|
+
st(() => {
|
|
27
|
+
h.value && (se.value = h.value.$el.children[0].scrollTop);
|
|
28
|
+
}), Se(h, () => {
|
|
29
|
+
h.value && setTimeout(() => {
|
|
30
|
+
h.value && (h.value.$el.children[0].scrollTop = se.value);
|
|
31
31
|
}, 200);
|
|
32
32
|
});
|
|
33
|
-
const
|
|
33
|
+
const j = R(() => F.value && f.value ? f.value.filter((o) => {
|
|
34
34
|
var e;
|
|
35
|
-
return (e =
|
|
35
|
+
return (e = F.value) == null ? void 0 : e.includes(o.id);
|
|
36
36
|
}) : []);
|
|
37
|
-
|
|
37
|
+
Se(
|
|
38
38
|
[() => Ie.value],
|
|
39
39
|
() => {
|
|
40
|
-
|
|
40
|
+
S.refreshPinReport();
|
|
41
41
|
},
|
|
42
42
|
{ immediate: !0 }
|
|
43
43
|
);
|
|
44
|
-
const
|
|
45
|
-
(o) =>
|
|
46
|
-
) :
|
|
44
|
+
const pe = R(() => j.value.length > 0 ? f.value.filter(
|
|
45
|
+
(o) => j.value.findIndex((e) => e.id === o.id) === -1
|
|
46
|
+
) : f.value), { FmButton: De, FmMenu: Y, FmMenuItem: x, FmIcon: q, FmChip: H, FmTooltip: $e, FmSwitch: de } = We, b = $(/* @__PURE__ */ new Set()), G = $(/* @__PURE__ */ new Map()), ue = /* @__PURE__ */ new Set([
|
|
47
47
|
"closeup",
|
|
48
48
|
"dailySales",
|
|
49
49
|
"hourlySales",
|
|
@@ -59,50 +59,50 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
59
59
|
"timesheet",
|
|
60
60
|
"void_",
|
|
61
61
|
"refund"
|
|
62
|
-
]),
|
|
62
|
+
]), me = R(() => [
|
|
63
63
|
{ value: void 0, label: "All" },
|
|
64
|
-
|
|
64
|
+
...O.value.map((o) => ({
|
|
65
65
|
value: o.id,
|
|
66
66
|
label: o.name
|
|
67
67
|
}))
|
|
68
|
-
]),
|
|
69
|
-
...
|
|
70
|
-
const r =
|
|
68
|
+
]), V = $(me.value[0]), Q = $(""), P = R(() => pe.value.length === 0 || O.value.length === 0 ? [] : [
|
|
69
|
+
...j.value.map((e) => {
|
|
70
|
+
const r = O.value.find((n) => n.id === e.category);
|
|
71
71
|
return {
|
|
72
|
-
name:
|
|
72
|
+
name: te(a, J, e.name, "other"),
|
|
73
73
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
74
74
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
75
75
|
reportId: e.id,
|
|
76
76
|
editable: e.editable,
|
|
77
77
|
description: e.description || "",
|
|
78
78
|
pin: !0,
|
|
79
|
-
canUpdate:
|
|
80
|
-
canRead:
|
|
79
|
+
canUpdate: ce(e),
|
|
80
|
+
canRead: le(e),
|
|
81
81
|
isSupportPos: !!e.isSupportPos,
|
|
82
|
-
isMandatoryPosReport: e.isDefault &&
|
|
82
|
+
isMandatoryPosReport: e.isDefault && ue.has(e.permissionKey ?? ""),
|
|
83
83
|
reportType: e.reportType
|
|
84
84
|
};
|
|
85
85
|
}),
|
|
86
|
-
...
|
|
87
|
-
const r =
|
|
86
|
+
...pe.value.map((e) => {
|
|
87
|
+
const r = O.value.find((n) => n.id === e.category);
|
|
88
88
|
return {
|
|
89
|
-
name:
|
|
89
|
+
name: te(a, J, e.name, "other"),
|
|
90
90
|
categoryId: (r == null ? void 0 : r.id) ?? "",
|
|
91
91
|
category: r != null && r.name ? a(`report.category.${r.name}`) : a("report.common.uncategorized"),
|
|
92
92
|
reportId: e.id,
|
|
93
93
|
editable: e.editable,
|
|
94
94
|
description: e.description || "",
|
|
95
95
|
pin: !1,
|
|
96
|
-
canUpdate:
|
|
97
|
-
canRead:
|
|
96
|
+
canUpdate: ce(e),
|
|
97
|
+
canRead: le(e),
|
|
98
98
|
isSupportPos: !!e.isSupportPos,
|
|
99
|
-
isMandatoryPosReport: e.isDefault &&
|
|
99
|
+
isMandatoryPosReport: e.isDefault && ue.has(e.permissionKey ?? ""),
|
|
100
100
|
reportType: e.reportType
|
|
101
101
|
};
|
|
102
102
|
})
|
|
103
|
-
].filter((e) =>
|
|
104
|
-
() =>
|
|
105
|
-
),
|
|
103
|
+
].filter((e) => V.value.value && e.categoryId !== V.value.value ? !1 : `${(e == null ? void 0 : e.name) || ""}${(e == null ? void 0 : e.description) || ""}`.toLowerCase().indexOf(Q.value.toLowerCase()) !== -1)), Oe = R(
|
|
104
|
+
() => P.value.map((o) => `${o.name}${o.category}`).toString()
|
|
105
|
+
), Fe = R(() => [
|
|
106
106
|
{
|
|
107
107
|
accessorKey: "name",
|
|
108
108
|
header: a("report.common.name"),
|
|
@@ -124,7 +124,7 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
124
124
|
width: "100px"
|
|
125
125
|
},
|
|
126
126
|
cell: (o) => d(
|
|
127
|
-
|
|
127
|
+
H,
|
|
128
128
|
{
|
|
129
129
|
// grey out chip text when user cannot read report
|
|
130
130
|
class: `${o.getValue() !== a("report.common.uncategorized") ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${o.row.original.canRead ? "" : "opacity-40 cursor-not-allowed"} fm-typo-en-body-sm-600`,
|
|
@@ -154,12 +154,12 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
154
154
|
width: "130px"
|
|
155
155
|
},
|
|
156
156
|
cell: (o) => {
|
|
157
|
-
var
|
|
158
|
-
const e = o.row.original, r = e.reportId, n =
|
|
157
|
+
var u;
|
|
158
|
+
const e = o.row.original, r = e.reportId, n = f.value.find((y) => y.id === r), Z = r === ((u = B.value) == null ? void 0 : u.id), T = !e.canRead, D = n ? ie(n) : !1, A = n ? E(n) : !1, s = !e.canUpdate || e.isMandatoryPosReport || b.value.has(r), C = e.isMandatoryPosReport ? a("reportV5.reportList.mandatoryPosReportHint") : a("reportV5.reportList.posV8Hint"), i = [
|
|
159
159
|
{
|
|
160
160
|
label: a("report.common.duplicate"),
|
|
161
161
|
onClick: () => {
|
|
162
|
-
n && D ?
|
|
162
|
+
n && D ? be(n) : D || l.open({
|
|
163
163
|
message: a("report.messages.noPermissionDuplicateReport"),
|
|
164
164
|
type: "error"
|
|
165
165
|
});
|
|
@@ -168,9 +168,9 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
168
168
|
disabled: !D
|
|
169
169
|
},
|
|
170
170
|
{
|
|
171
|
-
label: a(
|
|
171
|
+
label: a(Z ? "report.common.unsetAsOverview" : "report.common.setAsOverview"),
|
|
172
172
|
onClick: async () => {
|
|
173
|
-
n &&
|
|
173
|
+
n && fe(n);
|
|
174
174
|
},
|
|
175
175
|
variant: "",
|
|
176
176
|
disabled: !1
|
|
@@ -178,7 +178,7 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
178
178
|
{
|
|
179
179
|
label: a("report.common.remove"),
|
|
180
180
|
onClick: () => {
|
|
181
|
-
n && (A ?
|
|
181
|
+
n && (A ? ve(n) : l.open({
|
|
182
182
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
183
183
|
type: "error"
|
|
184
184
|
}));
|
|
@@ -195,20 +195,20 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
195
195
|
{
|
|
196
196
|
default: () => [
|
|
197
197
|
d(
|
|
198
|
-
|
|
199
|
-
{ content:
|
|
198
|
+
$e,
|
|
199
|
+
{ content: C, placement: "bottom", zIndex: 2e3 },
|
|
200
200
|
{
|
|
201
|
-
default: () => d("div", { class: "mr-2 flex items-center
|
|
201
|
+
default: () => d("div", { class: "mr-2 flex items-center" }, [
|
|
202
202
|
d("span", { class: "fm-typo-en-body-sm-400 whitespace-nowrap" }, "POS v8"),
|
|
203
|
-
d(
|
|
203
|
+
d(de, {
|
|
204
204
|
modelValue: e.isSupportPos,
|
|
205
205
|
disabled: s,
|
|
206
206
|
"aria-label": a("report.common.showInPOS"),
|
|
207
207
|
class: "pos-v8-switch",
|
|
208
208
|
"onUpdate:modelValue": () => {
|
|
209
|
-
n &&
|
|
209
|
+
n && ye(n);
|
|
210
210
|
},
|
|
211
|
-
onClick:
|
|
211
|
+
onClick: we(() => {
|
|
212
212
|
}, ["stop"])
|
|
213
213
|
})
|
|
214
214
|
])
|
|
@@ -219,15 +219,16 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
219
219
|
{
|
|
220
220
|
disabled: T,
|
|
221
221
|
title: T ? a("report.messages.noPermission") : void 0,
|
|
222
|
-
|
|
223
|
-
|
|
222
|
+
"aria-label": e.pin ? "Unpin" : "Pin",
|
|
223
|
+
onClick: we(() => {
|
|
224
|
+
n && ge(n);
|
|
224
225
|
}, ["stop"]),
|
|
225
|
-
class:
|
|
226
|
+
class: "text-fm-color-neutral-gray-400 hover:bg-fm-color-opacity-sm rounded-lg flex items-center justify-center"
|
|
226
227
|
},
|
|
227
228
|
{
|
|
228
229
|
default: () => [
|
|
229
230
|
d(
|
|
230
|
-
|
|
231
|
+
q,
|
|
231
232
|
{
|
|
232
233
|
name: "keep",
|
|
233
234
|
class: "px-12 p-8",
|
|
@@ -240,7 +241,7 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
240
241
|
}
|
|
241
242
|
),
|
|
242
243
|
d(
|
|
243
|
-
|
|
244
|
+
Y,
|
|
244
245
|
{
|
|
245
246
|
stopClickPropagation: !0,
|
|
246
247
|
shift: !0,
|
|
@@ -248,16 +249,16 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
248
249
|
},
|
|
249
250
|
{
|
|
250
251
|
default: () => i.map(
|
|
251
|
-
(
|
|
252
|
-
|
|
252
|
+
(y) => d(
|
|
253
|
+
x,
|
|
253
254
|
{
|
|
254
|
-
onClick:
|
|
255
|
-
label:
|
|
256
|
-
class:
|
|
257
|
-
disabled:
|
|
255
|
+
onClick: y.disabled ? {} : y.onClick,
|
|
256
|
+
label: y.label,
|
|
257
|
+
class: y.disabled ? "text-fm-color-typo-disabled" : y.variant === "destructive" ? "text-fm-color-typo-error" : "",
|
|
258
|
+
disabled: y.disabled
|
|
258
259
|
},
|
|
259
260
|
{
|
|
260
|
-
label: () => d("p",
|
|
261
|
+
label: () => d("p", y.label)
|
|
261
262
|
}
|
|
262
263
|
)
|
|
263
264
|
),
|
|
@@ -267,7 +268,7 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
267
268
|
variant: "tertiary",
|
|
268
269
|
size: "md",
|
|
269
270
|
icon: "more_vert",
|
|
270
|
-
iconColor:
|
|
271
|
+
iconColor: Xe.NeutralGray400,
|
|
271
272
|
disabled: !1
|
|
272
273
|
},
|
|
273
274
|
{}
|
|
@@ -280,12 +281,12 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
283
|
]);
|
|
283
|
-
async function
|
|
284
|
+
async function fe(o) {
|
|
284
285
|
await K(async () => {
|
|
285
286
|
var e;
|
|
286
287
|
try {
|
|
287
288
|
const r = o.id === ((e = B.value) == null ? void 0 : e.id);
|
|
288
|
-
await
|
|
289
|
+
await S.updateDefaultReport(r ? null : o.id), l.open({
|
|
289
290
|
message: `Successfully ${r ? "unset" : "set"} ${o.name} as Overview`,
|
|
290
291
|
type: "success"
|
|
291
292
|
});
|
|
@@ -294,25 +295,31 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
294
295
|
}
|
|
295
296
|
});
|
|
296
297
|
}
|
|
297
|
-
async function
|
|
298
|
-
if (!
|
|
299
|
-
|
|
298
|
+
async function ye(o) {
|
|
299
|
+
if (!b.value.has(o.id)) {
|
|
300
|
+
b.value = new Set(b.value).add(o.id);
|
|
300
301
|
try {
|
|
301
302
|
const e = !o.isSupportPos;
|
|
302
|
-
await
|
|
303
|
+
await je(o.id, e), o.isSupportPos = e, G.value = new Map(G.value).set(
|
|
304
|
+
o.id,
|
|
305
|
+
e
|
|
306
|
+
);
|
|
303
307
|
} catch (e) {
|
|
304
308
|
console.log(e), l.open({
|
|
305
309
|
message: a("report.messages.failedToAction", { action: a("report.common.update") }),
|
|
306
310
|
type: "error"
|
|
307
311
|
});
|
|
308
312
|
} finally {
|
|
309
|
-
const e = new Set(
|
|
310
|
-
e.delete(o.id),
|
|
313
|
+
const e = new Set(b.value);
|
|
314
|
+
e.delete(o.id), b.value = e;
|
|
311
315
|
}
|
|
312
316
|
}
|
|
313
317
|
}
|
|
314
|
-
|
|
315
|
-
|
|
318
|
+
function Le(o, e) {
|
|
319
|
+
return G.value.get(o) ?? e;
|
|
320
|
+
}
|
|
321
|
+
async function Ve(o) {
|
|
322
|
+
if (await ne({
|
|
316
323
|
title: a("report.common.duplicate"),
|
|
317
324
|
message: a("report.messages.confirmAction", {
|
|
318
325
|
action: a("report.common.duplicate"),
|
|
@@ -322,7 +329,7 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
322
329
|
const r = JSON.parse(JSON.stringify(o));
|
|
323
330
|
r.editable = !0, r.id = "", r.name = `${r.name} ${a("report.common.duplicate")}`, r.isDefault = !1, K(async () => {
|
|
324
331
|
try {
|
|
325
|
-
await
|
|
332
|
+
await S.createOrUpdateReport(r), l.open({
|
|
326
333
|
message: `${a("report.messages.duplicateSuccess", { name: r.name })}`,
|
|
327
334
|
type: "success"
|
|
328
335
|
});
|
|
@@ -332,15 +339,15 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
332
339
|
});
|
|
333
340
|
}
|
|
334
341
|
}
|
|
335
|
-
function Q(o) {
|
|
336
|
-
const e = m.value.find((r) => r.id === o.reportId);
|
|
337
|
-
return !e || !ce(e);
|
|
338
|
-
}
|
|
339
342
|
function W(o) {
|
|
340
|
-
const e =
|
|
343
|
+
const e = f.value.find((r) => r.id === o.reportId);
|
|
344
|
+
return !e || !ie(e);
|
|
345
|
+
}
|
|
346
|
+
function X(o) {
|
|
347
|
+
const e = f.value.find((r) => r.id === o.reportId);
|
|
341
348
|
return !o.editable || !e || !E(e);
|
|
342
349
|
}
|
|
343
|
-
async function
|
|
350
|
+
async function ve(o) {
|
|
344
351
|
if (!E(o)) {
|
|
345
352
|
l.open({
|
|
346
353
|
message: a("report.messages.noPermissionDeleteReport"),
|
|
@@ -348,12 +355,12 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
348
355
|
});
|
|
349
356
|
return;
|
|
350
357
|
}
|
|
351
|
-
await
|
|
358
|
+
await ne({
|
|
352
359
|
title: a("report.messages.deleteReport"),
|
|
353
360
|
message: a("report.messages.confirmDelete", { name: o.name })
|
|
354
361
|
}) && K(async () => {
|
|
355
362
|
try {
|
|
356
|
-
await
|
|
363
|
+
await S.removeReport(o), l.open({
|
|
357
364
|
message: a("report.messages.deleteSuccess", { name: o.name }),
|
|
358
365
|
type: "success"
|
|
359
366
|
});
|
|
@@ -362,53 +369,53 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
362
369
|
}
|
|
363
370
|
});
|
|
364
371
|
}
|
|
365
|
-
async function
|
|
366
|
-
if (
|
|
367
|
-
await
|
|
372
|
+
async function be(o) {
|
|
373
|
+
if (re.value)
|
|
374
|
+
await Ve(o);
|
|
368
375
|
else {
|
|
369
|
-
let e = `Your current plan only support up to ${
|
|
370
|
-
|
|
376
|
+
let e = `Your current plan only support up to ${L.value} custom reports.`;
|
|
377
|
+
L.value === 0 && (e = "Your current plan does not support custom report."), l.open({
|
|
371
378
|
message: e,
|
|
372
379
|
type: "error"
|
|
373
380
|
});
|
|
374
381
|
}
|
|
375
382
|
}
|
|
376
|
-
function
|
|
377
|
-
if (!
|
|
383
|
+
function Ne() {
|
|
384
|
+
if (!_e.value) {
|
|
378
385
|
l.open({
|
|
379
386
|
message: a("report.messages.noPermission"),
|
|
380
387
|
type: "error"
|
|
381
388
|
});
|
|
382
389
|
return;
|
|
383
390
|
}
|
|
384
|
-
if (
|
|
385
|
-
|
|
391
|
+
if (re.value)
|
|
392
|
+
ke.value = !0;
|
|
386
393
|
else {
|
|
387
|
-
let o = `Your current plan only support up to ${
|
|
388
|
-
|
|
394
|
+
let o = `Your current plan only support up to ${L.value} custom reports.`;
|
|
395
|
+
L.value === 0 && (o = "Your current plan does not support custom report."), l.open({
|
|
389
396
|
message: o,
|
|
390
397
|
type: "error"
|
|
391
398
|
});
|
|
392
399
|
}
|
|
393
400
|
}
|
|
394
|
-
function
|
|
395
|
-
const e =
|
|
396
|
-
|
|
401
|
+
function ge(o) {
|
|
402
|
+
const e = te(a, J, o.name, "other") ?? "";
|
|
403
|
+
F.value && F.value.includes(o.id) ? (l.open({
|
|
397
404
|
message: `${a("report.common.unpin")} ${e} ${a("report.common.successful")}`,
|
|
398
405
|
type: "success"
|
|
399
|
-
}),
|
|
406
|
+
}), S.clearPinReport(o.id)) : (l.open({
|
|
400
407
|
message: `${a("report.common.pin")} ${e} ${a("report.common.successful")}`,
|
|
401
408
|
type: "success"
|
|
402
|
-
}),
|
|
409
|
+
}), S.cachePinReport(o));
|
|
403
410
|
}
|
|
404
|
-
function
|
|
405
|
-
|
|
411
|
+
function Ue(o) {
|
|
412
|
+
V.value = o;
|
|
406
413
|
}
|
|
407
|
-
const { selectedLocationIds:
|
|
414
|
+
const { selectedLocationIds: _, dateRange: N, compareDateRange: U, timeRange: w, locations: Me } = Pe(), M = R(() => _.length === Me.length);
|
|
408
415
|
return (o, e) => {
|
|
409
|
-
const r =
|
|
410
|
-
return z(),
|
|
411
|
-
default:
|
|
416
|
+
const r = I("FmPageHead"), n = I("FmSearch"), Z = I("FmForm"), T = I("FmListItem"), D = I("FmList"), A = I("FmTable");
|
|
417
|
+
return z(), ee(Ye, null, {
|
|
418
|
+
default: m(() => [
|
|
412
419
|
c(r, {
|
|
413
420
|
title: t(a)("report.common.report", 1),
|
|
414
421
|
class: "h-[68px]",
|
|
@@ -420,60 +427,60 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
420
427
|
prependIcon: "add"
|
|
421
428
|
}
|
|
422
429
|
],
|
|
423
|
-
"onClick:action": e[0] || (e[0] = (s) =>
|
|
430
|
+
"onClick:action": e[0] || (e[0] = (s) => Ne())
|
|
424
431
|
}, null, 8, ["title", "actions"]),
|
|
425
|
-
|
|
426
|
-
class:
|
|
427
|
-
style:
|
|
432
|
+
v("div", {
|
|
433
|
+
class: g(`overflow-y-hidden flex flex-col gap-8 ${t(p).sm || t(p).xs ? "mb-20" : ""}`),
|
|
434
|
+
style: Ae({ height: `calc(100% - ${t(p).lg || t(p).md ? 72 : 64}px)` })
|
|
428
435
|
}, [
|
|
429
|
-
c(
|
|
430
|
-
class:
|
|
436
|
+
c(Z, {
|
|
437
|
+
class: g(`flex items-center gap-2 ${t(p).sm || t(p).xs ? "px-3" : "px-24"}`)
|
|
431
438
|
}, {
|
|
432
|
-
default:
|
|
433
|
-
c(t(
|
|
434
|
-
"menu-button":
|
|
435
|
-
c(t(
|
|
436
|
-
default:
|
|
437
|
-
|
|
438
|
-
c(t(
|
|
439
|
+
default: m(() => [
|
|
440
|
+
c(t(Y), null, {
|
|
441
|
+
"menu-button": m(() => [
|
|
442
|
+
c(t(H), { class: "fm-typo-en-body-md-600 text-fm-color-neutral-gray-400" }, {
|
|
443
|
+
default: m(() => [
|
|
444
|
+
v("p", null, k(t(a)(`report.category.${V.value.label}`)), 1),
|
|
445
|
+
c(t(q), { name: "expand_more" })
|
|
439
446
|
]),
|
|
440
447
|
_: 1
|
|
441
448
|
})
|
|
442
449
|
]),
|
|
443
|
-
default:
|
|
444
|
-
(z(!0),
|
|
445
|
-
key:
|
|
450
|
+
default: m(() => [
|
|
451
|
+
(z(!0), ze(Je, null, Be(me.value, (s, C) => (z(), ee(t(x), {
|
|
452
|
+
key: C,
|
|
446
453
|
label: t(a)(`report.category.${s.label}`),
|
|
447
|
-
onClick: () =>
|
|
454
|
+
onClick: () => Ue(s)
|
|
448
455
|
}, null, 8, ["label", "onClick"]))), 128))
|
|
449
456
|
]),
|
|
450
457
|
_: 1
|
|
451
458
|
}),
|
|
452
|
-
|
|
453
|
-
class:
|
|
459
|
+
v("div", {
|
|
460
|
+
class: g(`flex ${t(p).sm || t(p).xs ? "justify-center items-center" : ""}`)
|
|
454
461
|
}, [
|
|
455
|
-
|
|
462
|
+
v("p", nt, k(t(a)("report.common.results", { count: P.value.length })), 1)
|
|
456
463
|
], 2),
|
|
457
|
-
e[3] || (e[3] =
|
|
458
|
-
|
|
464
|
+
e[3] || (e[3] = v("div", { class: "grow" }, null, -1)),
|
|
465
|
+
v("div", lt, [
|
|
459
466
|
c(n, {
|
|
460
|
-
modelValue:
|
|
461
|
-
"onUpdate:modelValue": e[1] || (e[1] = (s) =>
|
|
462
|
-
class:
|
|
467
|
+
modelValue: Q.value,
|
|
468
|
+
"onUpdate:modelValue": e[1] || (e[1] = (s) => Q.value = s),
|
|
469
|
+
class: g(`${t(p).lg || t(p).md ? "grow" : ""}`)
|
|
463
470
|
}, null, 8, ["modelValue", "class"])
|
|
464
471
|
])
|
|
465
472
|
]),
|
|
466
473
|
_: 1
|
|
467
474
|
}, 8, ["class"]),
|
|
468
|
-
he((z(),
|
|
469
|
-
key:
|
|
475
|
+
he((z(), ee(A, {
|
|
476
|
+
key: Oe.value,
|
|
470
477
|
ref_key: "table",
|
|
471
|
-
ref:
|
|
472
|
-
class:
|
|
478
|
+
ref: h,
|
|
479
|
+
class: g([t(p).sm || t(p).xs ? "px-0" : "px-24", "report-table"]),
|
|
473
480
|
style: { height: "calc(100% - 40px)" },
|
|
474
|
-
"column-defs":
|
|
475
|
-
"row-data":
|
|
476
|
-
"page-size":
|
|
481
|
+
"column-defs": Fe.value,
|
|
482
|
+
"row-data": P.value,
|
|
483
|
+
"page-size": P.value.length,
|
|
477
484
|
"hide-footer": !0,
|
|
478
485
|
"row-class-name": "row",
|
|
479
486
|
onRowClick: e[2] || (e[2] = (s) => {
|
|
@@ -484,24 +491,24 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
484
491
|
});
|
|
485
492
|
return;
|
|
486
493
|
}
|
|
487
|
-
t(Ce).suppressReportRouteSync = !0, t(
|
|
494
|
+
t(Ce).suppressReportRouteSync = !0, t(S).updateCurrentReportId(s.original.reportId), t(oe).push({
|
|
488
495
|
name: "reportView",
|
|
489
496
|
query: {
|
|
490
|
-
...t(
|
|
497
|
+
...t(ae).query,
|
|
491
498
|
reportId: s.original.reportId,
|
|
492
|
-
startDate: t(
|
|
493
|
-
endDate: t(
|
|
494
|
-
compareStartDate: t(
|
|
495
|
-
compareEndDate: t(
|
|
496
|
-
timeStart: t(
|
|
497
|
-
timeEnd: t(
|
|
498
|
-
isAllLocation:
|
|
499
|
-
locationIds:
|
|
499
|
+
startDate: t(N).startDate,
|
|
500
|
+
endDate: t(N).endDate,
|
|
501
|
+
compareStartDate: t(U).startDate,
|
|
502
|
+
compareEndDate: t(U).endDate,
|
|
503
|
+
timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
|
|
504
|
+
timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
|
|
505
|
+
isAllLocation: M.value.toString(),
|
|
506
|
+
locationIds: M.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
|
|
500
507
|
}
|
|
501
508
|
});
|
|
502
509
|
})
|
|
503
510
|
}, {
|
|
504
|
-
"list-row":
|
|
511
|
+
"list-row": m(({ original: s }) => [
|
|
505
512
|
c(D, {
|
|
506
513
|
onClick: () => {
|
|
507
514
|
if (!s.canRead) {
|
|
@@ -511,133 +518,137 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
511
518
|
});
|
|
512
519
|
return;
|
|
513
520
|
}
|
|
514
|
-
s.reportId && (t(
|
|
521
|
+
s.reportId && (t(S).updateCurrentReportId(s.reportId), t(oe).push({
|
|
515
522
|
name: "reportView",
|
|
516
523
|
query: {
|
|
517
|
-
...t(
|
|
524
|
+
...t(ae).query,
|
|
518
525
|
reportId: s.reportId,
|
|
519
|
-
startDate: t(
|
|
520
|
-
endDate: t(
|
|
521
|
-
compareStartDate: t(
|
|
522
|
-
compareEndDate: t(
|
|
523
|
-
timeStart: t(
|
|
524
|
-
timeEnd: t(
|
|
525
|
-
isAllLocation:
|
|
526
|
-
locationIds:
|
|
526
|
+
startDate: t(N).startDate,
|
|
527
|
+
endDate: t(N).endDate,
|
|
528
|
+
compareStartDate: t(U).startDate,
|
|
529
|
+
compareEndDate: t(U).endDate,
|
|
530
|
+
timeStart: t(w).start ? JSON.stringify(t(w).start) : null,
|
|
531
|
+
timeEnd: t(w).end ? JSON.stringify(t(w).end) : null,
|
|
532
|
+
isAllLocation: M.value.toString(),
|
|
533
|
+
locationIds: M.value ? void 0 : t(_) ? JSON.stringify(t(_)) : void 0
|
|
527
534
|
}
|
|
528
535
|
}));
|
|
529
536
|
}
|
|
530
537
|
}, {
|
|
531
|
-
default:
|
|
538
|
+
default: m(() => [
|
|
532
539
|
c(T, {
|
|
533
540
|
tag: "label",
|
|
534
541
|
clickable: ""
|
|
535
542
|
}, {
|
|
536
|
-
append:
|
|
537
|
-
c(t(
|
|
538
|
-
class:
|
|
543
|
+
append: m(() => [
|
|
544
|
+
c(t(H), {
|
|
545
|
+
class: g(`${s.category !== "Uncategorized" ? "bg-fm-color-system-info-100 text-fm-color-typo-info" : "text-fm-color-typo-secondary"} ${s.canRead ? "" : "opacity-40 cursor-not-allowed"}`),
|
|
539
546
|
compact: !0
|
|
540
547
|
}, {
|
|
541
|
-
default:
|
|
542
|
-
|
|
548
|
+
default: m(() => [
|
|
549
|
+
v("p", ct, k(s.category), 1)
|
|
543
550
|
]),
|
|
544
551
|
_: 2
|
|
545
552
|
}, 1032, ["class"]),
|
|
546
|
-
c(t(
|
|
553
|
+
c(t(Y), {
|
|
547
554
|
placement: "left",
|
|
548
555
|
"stop-click-propagation": !0
|
|
549
556
|
}, {
|
|
550
|
-
"menu-button":
|
|
551
|
-
c(t(
|
|
557
|
+
"menu-button": m(() => [
|
|
558
|
+
c(t(q), {
|
|
552
559
|
name: "more_vert",
|
|
553
560
|
class: "btn-color"
|
|
554
561
|
})
|
|
555
562
|
]),
|
|
556
|
-
default:
|
|
557
|
-
var
|
|
563
|
+
default: m(() => {
|
|
564
|
+
var C;
|
|
558
565
|
return [
|
|
559
|
-
c(t(
|
|
566
|
+
c(t(x), {
|
|
560
567
|
label: s.pin ? "Unpin" : "Pin",
|
|
561
568
|
onClick: () => {
|
|
562
|
-
const i = t(
|
|
563
|
-
(
|
|
569
|
+
const i = t(f).find(
|
|
570
|
+
(u) => u.id === s.reportId
|
|
564
571
|
);
|
|
565
|
-
i &&
|
|
572
|
+
i && ge(i);
|
|
566
573
|
}
|
|
567
574
|
}, null, 8, ["label", "onClick"]),
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
v("div", {
|
|
576
|
+
role: "menuitem",
|
|
577
|
+
"data-testid": "mobile-pos-v8-toggle",
|
|
578
|
+
tabindex: !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId) ? void 0 : -1,
|
|
579
|
+
"aria-disabled": !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId),
|
|
580
|
+
class: g(
|
|
581
|
+
!s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId) ? "flex max-h-[78px] w-full cursor-not-allowed items-center justify-between gap-2 rounded px-3 py-2 pl-12 text-fm-color-typo-disabled" : "flex max-h-[78px] w-full cursor-pointer items-center justify-between gap-2 rounded px-3 py-2 pl-12 hover:bg-fm-color-opacity-sm"
|
|
574
582
|
),
|
|
575
|
-
onClick: () => {
|
|
576
|
-
if (!s.canUpdate) {
|
|
583
|
+
onClick: (i) => {
|
|
584
|
+
if (i.stopPropagation(), !s.canUpdate) {
|
|
577
585
|
t(l).open({
|
|
578
586
|
message: t(a)("report.messages.noPermissionUpdateReport"),
|
|
579
587
|
type: "error"
|
|
580
588
|
});
|
|
581
589
|
return;
|
|
582
590
|
}
|
|
583
|
-
const
|
|
584
|
-
(
|
|
591
|
+
const u = t(f).find(
|
|
592
|
+
(y) => y.id === s.reportId
|
|
585
593
|
);
|
|
586
|
-
|
|
594
|
+
u && ye(u);
|
|
587
595
|
}
|
|
588
|
-
},
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
596
|
+
}, [
|
|
597
|
+
v("span", pt, k(t(a)("report.common.showInPOS")), 1),
|
|
598
|
+
v("span", null, [
|
|
599
|
+
c(t(de), {
|
|
600
|
+
"model-value": Le(
|
|
601
|
+
s.reportId,
|
|
602
|
+
s.isSupportPos
|
|
603
|
+
),
|
|
604
|
+
disabled: !s.canUpdate || s.isMandatoryPosReport || b.value.has(s.reportId),
|
|
593
605
|
"aria-label": "Show in POS v8",
|
|
594
606
|
class: "pointer-events-none"
|
|
595
607
|
}, null, 8, ["model-value", "disabled"])
|
|
596
|
-
])
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
c(t(R), {
|
|
608
|
+
])
|
|
609
|
+
], 10, it),
|
|
610
|
+
c(t(x), {
|
|
600
611
|
label: t(a)("report.common.duplicate"),
|
|
601
|
-
disabled:
|
|
602
|
-
class:
|
|
603
|
-
|
|
612
|
+
disabled: W(s),
|
|
613
|
+
class: g(
|
|
614
|
+
W(s) ? "text-fm-color-typo-disabled" : ""
|
|
604
615
|
),
|
|
605
616
|
onClick: () => {
|
|
606
|
-
const i = t(
|
|
607
|
-
(
|
|
617
|
+
const i = t(f).find(
|
|
618
|
+
(u) => u.id === s.reportId
|
|
608
619
|
);
|
|
609
|
-
i && !
|
|
620
|
+
i && !W(s) ? be(i) : t(l).open({
|
|
610
621
|
message: t(a)("report.messages.noPermissionDuplicateReport"),
|
|
611
622
|
type: "error"
|
|
612
623
|
});
|
|
613
624
|
}
|
|
614
625
|
}, null, 8, ["label", "disabled", "class", "onClick"]),
|
|
615
|
-
c(t(
|
|
626
|
+
c(t(x), {
|
|
616
627
|
label: t(a)(
|
|
617
|
-
s.reportId === ((
|
|
628
|
+
s.reportId === ((C = t(B)) == null ? void 0 : C.id) ? "report.common.unsetAsOverview" : "report.common.setAsOverview"
|
|
618
629
|
),
|
|
619
630
|
onClick: () => {
|
|
620
|
-
const i = t(
|
|
621
|
-
(
|
|
631
|
+
const i = t(f).find(
|
|
632
|
+
(u) => u.id === s.reportId
|
|
622
633
|
);
|
|
623
|
-
i &&
|
|
634
|
+
i && fe(i);
|
|
624
635
|
}
|
|
625
636
|
}, null, 8, ["label", "onClick"]),
|
|
626
|
-
c(t(
|
|
637
|
+
c(t(x), {
|
|
627
638
|
label: t(a)("report.common.delete"),
|
|
628
|
-
disabled:
|
|
629
|
-
class:
|
|
630
|
-
|
|
639
|
+
disabled: X(s),
|
|
640
|
+
class: g(
|
|
641
|
+
X(s) ? "text-fm-color-typo-disabled" : "text-fm-color-typo-error"
|
|
631
642
|
),
|
|
632
643
|
onClick: () => {
|
|
633
|
-
const i = t(
|
|
634
|
-
(
|
|
644
|
+
const i = t(f).find(
|
|
645
|
+
(u) => u.id === s.reportId
|
|
635
646
|
);
|
|
636
|
-
i && !
|
|
647
|
+
i && !X(s) && ve(i);
|
|
637
648
|
}
|
|
638
649
|
}, {
|
|
639
|
-
label:
|
|
640
|
-
|
|
650
|
+
label: m(() => [
|
|
651
|
+
Ke(k(t(a)("report.common.delete")), 1)
|
|
641
652
|
]),
|
|
642
653
|
_: 2
|
|
643
654
|
}, 1032, ["label", "disabled", "class", "onClick"])
|
|
@@ -646,10 +657,10 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
646
657
|
_: 2
|
|
647
658
|
}, 1024)
|
|
648
659
|
]),
|
|
649
|
-
default:
|
|
650
|
-
|
|
651
|
-
class:
|
|
652
|
-
},
|
|
660
|
+
default: m(() => [
|
|
661
|
+
v("span", {
|
|
662
|
+
class: g(["fm-typo-en-body-lg-400 line-clamp-1 break-all text-fm-color-typo-primary", s.canRead ? "" : "opacity-40 cursor-not-allowed"])
|
|
663
|
+
}, k(s.name), 3)
|
|
653
664
|
]),
|
|
654
665
|
_: 2
|
|
655
666
|
}, 1024)
|
|
@@ -659,10 +670,10 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
659
670
|
]),
|
|
660
671
|
_: 1
|
|
661
672
|
}, 8, ["class", "column-defs", "row-data", "page-size"])), [
|
|
662
|
-
[
|
|
673
|
+
[Re, P.value.length > 0]
|
|
663
674
|
]),
|
|
664
|
-
he(c(
|
|
665
|
-
[
|
|
675
|
+
he(c(Ze, null, null, 512), [
|
|
676
|
+
[Re, P.value.length === 0]
|
|
666
677
|
])
|
|
667
678
|
], 6)
|
|
668
679
|
]),
|
|
@@ -672,5 +683,5 @@ const st = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rt
|
|
|
672
683
|
}
|
|
673
684
|
});
|
|
674
685
|
export {
|
|
675
|
-
|
|
686
|
+
Pt as default
|
|
676
687
|
};
|