@feedmepos/mf-inventory-portal 0.0.25-dev.51 → 0.0.25-dev.52
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-Bf7Ef5j4.js → App-DkPiRPu7.js} +34 -34
- package/dist/{ApprovalView-CTKJY1vM.js → ApprovalView-BEF-qPdZ.js} +13 -13
- package/dist/{BindingsDialog-Cb7aRRNk.js → BindingsDialog-B6vjaPiA.js} +2 -2
- package/dist/{BindingsPicker-DOI78hCt.js → BindingsPicker-BmWf3j6H.js} +1 -1
- package/dist/{BindingsTable-CZE4g-lw.js → BindingsTable-VVNmzkzf.js} +1 -1
- package/dist/{ClosingDraftView-ChjnuJSG.js → ClosingDraftView-C6sNEHK5.js} +77 -77
- package/dist/{ClosingTemplateView-gSQqeQ_q.js → ClosingTemplateView-5k8R-fMI.js} +241 -241
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BMFxe5xn.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DclFOxv5.js} +3 -3
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-PmKyuRhO.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BFqAE1ZI.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CnRG4x74.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DwAyTAFy.js} +1 -1
- package/dist/{IngredientGroupView-CaF4rmHy.js → IngredientGroupView-DAeurvqt.js} +1 -1
- package/dist/{IngredientsView-CX_MSjT3.js → IngredientsView-Ca8fShPE.js} +4 -4
- package/dist/{IntegrationView-BRkcILmI.js → IntegrationView-Db4XlQvK.js} +2 -2
- package/dist/{InventoryBindingForm-BK7OBXJt.js → InventoryBindingForm-BTtpF1P5.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D81eO5Mu.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByJPHKqO.js} +3 -3
- package/dist/{InventoryBindingSummary-B3m-PoE-.js → InventoryBindingSummary-Bb5gN9Bu.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DsTKgxFv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D4vUOy_R.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-8Sa_WUWa.js → PremiumBadge.vue_vue_type_script_setup_true_lang-fFfOjNOU.js} +1 -1
- package/dist/{PublishView-DZR7-XFd.js → PublishView-BqE9qfwb.js} +19 -19
- package/dist/{PurchaseOrderPrintPreview-BT5Khjs6.js → PurchaseOrderPrintPreview-Cp6a-P8I.js} +1 -1
- package/dist/{ReceiveRequestView-3nhyFqXE.js → ReceiveRequestView-DKPPCyAU.js} +11 -11
- package/dist/{RecipeView-R-lqVFmh.js → RecipeView-BEsrqzuU.js} +3 -3
- package/dist/{StockView-Did7vk97.js → StockView-DplJi2OM.js} +9 -9
- package/dist/{SupplierView-BGHR6LD2.js → SupplierView-DL3D84U2.js} +7 -7
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-vjDgXu5D.js → TransferDetails.vue_vue_type_script_setup_true_lang-BzFkrRui.js} +5 -5
- package/dist/{TransferTemplateView-Dh1iZbPZ.js → TransferTemplateView-DakAYozL.js} +159 -159
- package/dist/{UnitView-DE9WIvA-.js → UnitView-C_Wqv69Z.js} +3 -3
- package/dist/{WarehouseView-CgurMkHh.js → WarehouseView-CeoVZ9cs.js} +1 -1
- package/dist/{app-BoT0hU4y.js → app-CulzKCFs.js} +4768 -3926
- package/dist/app.d.ts +842 -0
- package/dist/app.js +1 -1
- package/dist/{decimal-CpTYRDjJ.js → decimal-DdjfkmJS.js} +1 -1
- package/dist/{feature-CW1D96VL.js → feature-jwErVPVw.js} +1 -1
- package/dist/{format-unit-display-D6lsq-iX.js → format-unit-display-BMC3HZ0N.js} +2 -2
- package/dist/{index-tTGOQaym.js → index-BDCZItPF.js} +1 -1
- package/dist/{index-TqOHI1Dk.js → index-C7-QVxlo.js} +1 -1
- package/dist/{stock-Cnh2comB.js → stock-Czw9__W8.js} +1 -1
- package/dist/{supplier-BY8xacQQ.js → supplier-f0XPCLm-.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-ingredient-select-dialog-BwbzsMlI.js → use-ingredient-select-dialog-DDeNnPW0.js} +1 -1
- package/dist/{use-inventory-binding-dialog-3srettA-.js → use-inventory-binding-dialog-BTE0Ceov.js} +1 -1
- package/dist/{vue-i18n-C9tRTjjd.js → vue-i18n-B0gOxrrS.js} +120 -120
- package/package.json +3 -3
|
@@ -1,74 +1,74 @@
|
|
|
1
1
|
import { ref as R, h as A, defineComponent as J, resolveComponent as E, openBlock as w, createElementBlock as I, createElementVNode as b, normalizeClass as q, createTextVNode as Fe, toDisplayString as C, unref as i, createCommentVNode as X, createVNode as T, withCtx as P, Fragment as O, renderList as Q, computed as U, watch as Re, createSlots as ie, createBlock as N, isRef as Pe, normalizeStyle as Ye, Teleport as Ge, normalizeProps as Ke, guardReactiveProps as Je, mergeProps as We } from "vue";
|
|
2
|
-
import { X as qe, u as ue, ad as Xe, D as Se, h as j, f as Qe, e as Ae, ae as ce, r as Ze, af as Ee, s as Ue, a as de, b as et, v as tt, w as Ve, x as nt, y as ot, d as K, E as W, G as st, ag as lt, l as at, ah as rt, C as Ne, A as it, ai as ct, aj as re, z as mt, _ as ut, B as dt } from "./app-
|
|
2
|
+
import { X as qe, u as ue, ad as Xe, D as Se, h as j, f as Qe, e as Ae, ae as ce, r as Ze, af as Ee, s as Ue, a as de, b as et, v as tt, w as Ve, x as nt, y as ot, d as K, E as W, G as st, ag as lt, l as at, ah as rt, C as Ne, A as it, ai as ct, aj as re, z as mt, _ as ut, B as dt } from "./app-CulzKCFs.js";
|
|
3
3
|
import { useCoreStore as pe, useI18n as Y } from "@feedmepos/mf-common";
|
|
4
|
-
import { useDialogChild as pt, useSnackbar as se, useDialog as Be, FmButtonVariant as De, components as G, useProxiedModel as ft, useBreakpoints as
|
|
4
|
+
import { useDialogChild as pt, useSnackbar as se, useDialog as Be, FmButtonVariant as De, components as G, useProxiedModel as ft, useBreakpoints as vt } from "@feedmepos/ui-library";
|
|
5
5
|
import { defineStore as Le, storeToRefs as ze } from "pinia";
|
|
6
|
-
import { u as
|
|
7
|
-
const le = qe((l,
|
|
8
|
-
function
|
|
6
|
+
import { u as gt } from "./use-ingredient-select-dialog-DDeNnPW0.js";
|
|
7
|
+
const le = qe((l, n) => {
|
|
8
|
+
function o() {
|
|
9
9
|
var t;
|
|
10
10
|
return `business_${((t = pe().currentBusiness.value) == null ? void 0 : t._id) ?? ""}`;
|
|
11
11
|
}
|
|
12
12
|
return {
|
|
13
13
|
async getRecentPublishingJob() {
|
|
14
|
-
const s =
|
|
15
|
-
return
|
|
14
|
+
const s = o(), e = `${l.inventoryBackendUrl}/${s}/closing-template/publish/recent`;
|
|
15
|
+
return n.get(e);
|
|
16
16
|
},
|
|
17
17
|
async startNewPublish() {
|
|
18
|
-
const s =
|
|
19
|
-
return
|
|
18
|
+
const s = o(), e = `${l.inventoryBackendUrl}/${s}/closing-template/publish`;
|
|
19
|
+
return n.post(e);
|
|
20
20
|
},
|
|
21
21
|
async getTemplate(s) {
|
|
22
|
-
const e =
|
|
23
|
-
return
|
|
22
|
+
const e = o(), t = `${l.inventoryBackendUrl}/${e}/closing-template/${s}`;
|
|
23
|
+
return n.get(t);
|
|
24
24
|
},
|
|
25
25
|
async readTemplates() {
|
|
26
|
-
const s =
|
|
27
|
-
return
|
|
26
|
+
const s = o(), e = `${l.inventoryBackendUrl}/${s}/closing-template`;
|
|
27
|
+
return n.get(e);
|
|
28
28
|
},
|
|
29
29
|
async createTemplate(s) {
|
|
30
|
-
const e =
|
|
31
|
-
return
|
|
30
|
+
const e = o(), t = `${l.inventoryBackendUrl}/${e}/closing-template`;
|
|
31
|
+
return n.post(t, s);
|
|
32
32
|
},
|
|
33
33
|
async updateTemplate(s) {
|
|
34
|
-
const e =
|
|
35
|
-
return
|
|
34
|
+
const e = o(), t = `${l.inventoryBackendUrl}/${e}/closing-template`;
|
|
35
|
+
return n.put(t, s);
|
|
36
36
|
},
|
|
37
37
|
async deleteTemplate(s) {
|
|
38
|
-
const e =
|
|
39
|
-
return
|
|
38
|
+
const e = o(), t = `${l.inventoryBackendUrl}/${e}/closing-template`;
|
|
39
|
+
return n.delete(t, { _id: s._id, _rev: s._rev });
|
|
40
40
|
},
|
|
41
41
|
async importTemplates(s) {
|
|
42
|
-
const e =
|
|
43
|
-
return
|
|
42
|
+
const e = o(), t = `${l.inventoryBackendUrl}/${e}/closing-template/import`;
|
|
43
|
+
return n.post(t, s);
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
46
|
}), ae = Le(
|
|
47
47
|
"closingTemplateTable",
|
|
48
48
|
function() {
|
|
49
|
-
const { t:
|
|
49
|
+
const { t: n } = Y(), o = me(), s = R({}), e = R(new Array()), t = R(!1), v = ue(), h = le();
|
|
50
50
|
async function f() {
|
|
51
|
-
if (e.value = [], !!
|
|
51
|
+
if (e.value = [], !!v._currentLocation) {
|
|
52
52
|
t.value = !0;
|
|
53
53
|
try {
|
|
54
|
-
const [
|
|
54
|
+
const [g, _] = await Promise.all([
|
|
55
55
|
h.readTemplates(),
|
|
56
56
|
h.getRecentPublishingJob()
|
|
57
57
|
]).delayed(1e3);
|
|
58
|
-
e.value =
|
|
59
|
-
} catch (
|
|
60
|
-
console.log("Something went wrong when fetching templates:",
|
|
58
|
+
e.value = g, s.value = _;
|
|
59
|
+
} catch (g) {
|
|
60
|
+
console.log("Something went wrong when fetching templates:", g);
|
|
61
61
|
} finally {
|
|
62
62
|
t.value = !1;
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
|
-
async function a(
|
|
67
|
-
if (!e.value.find((_) => _._id) &&
|
|
66
|
+
async function a(g) {
|
|
67
|
+
if (!e.value.find((_) => _._id) && v._currentLocation) {
|
|
68
68
|
t.value = !0;
|
|
69
69
|
try {
|
|
70
70
|
const [_] = await Promise.all([
|
|
71
|
-
h.getTemplate(
|
|
71
|
+
h.getTemplate(g),
|
|
72
72
|
new Promise((c) => setTimeout(c, 1e3))
|
|
73
73
|
]);
|
|
74
74
|
e.value = [_];
|
|
@@ -79,14 +79,14 @@ const le = qe((l, o) => {
|
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
|
-
function u(
|
|
83
|
-
switch (_ = Ae(_),
|
|
82
|
+
function u(g, _) {
|
|
83
|
+
switch (_ = Ae(_), g) {
|
|
84
84
|
case j.Details:
|
|
85
|
-
return
|
|
85
|
+
return o.viewTemplate(_);
|
|
86
86
|
case j.Edit:
|
|
87
|
-
return
|
|
87
|
+
return o.updateTemplate(_);
|
|
88
88
|
case j.Delete:
|
|
89
|
-
return
|
|
89
|
+
return o.deleteTemplate(_, t, f);
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
return {
|
|
@@ -94,23 +94,23 @@ const le = qe((l, o) => {
|
|
|
94
94
|
{
|
|
95
95
|
id: "_id",
|
|
96
96
|
accessorKey: "_id",
|
|
97
|
-
header: () =>
|
|
98
|
-
cell(
|
|
99
|
-
return Xe(`${
|
|
97
|
+
header: () => n("inventory.closing.table.createdAt"),
|
|
98
|
+
cell(g) {
|
|
99
|
+
return Xe(`${g.getValue()}`);
|
|
100
100
|
},
|
|
101
101
|
enableSorting: !0
|
|
102
102
|
},
|
|
103
103
|
{
|
|
104
104
|
id: "name",
|
|
105
105
|
accessorKey: "name",
|
|
106
|
-
header: () =>
|
|
106
|
+
header: () => n("inventory.closing.table.name"),
|
|
107
107
|
enableSorting: !0,
|
|
108
108
|
size: 200
|
|
109
109
|
},
|
|
110
110
|
{
|
|
111
111
|
id: "noOfItems",
|
|
112
112
|
accessorKey: "items.length",
|
|
113
|
-
header: () =>
|
|
113
|
+
header: () => n("inventory.closing.table.noOfItems"),
|
|
114
114
|
enableSorting: !1,
|
|
115
115
|
meta: {
|
|
116
116
|
width: "10rem",
|
|
@@ -120,10 +120,10 @@ const le = qe((l, o) => {
|
|
|
120
120
|
{
|
|
121
121
|
id: "enabledLocations",
|
|
122
122
|
accessorKey: "locations.length",
|
|
123
|
-
header: () =>
|
|
124
|
-
cell(
|
|
123
|
+
header: () => n("inventory.closing.table.enabledOutlets"),
|
|
124
|
+
cell(g) {
|
|
125
125
|
var c;
|
|
126
|
-
const _ = (c =
|
|
126
|
+
const _ = (c = g.row.original.locations) == null ? void 0 : c.length;
|
|
127
127
|
return _ ? `${_}` : "All";
|
|
128
128
|
},
|
|
129
129
|
enableSorting: !1,
|
|
@@ -135,17 +135,17 @@ const le = qe((l, o) => {
|
|
|
135
135
|
{
|
|
136
136
|
id: "ref",
|
|
137
137
|
accessorKey: "ref",
|
|
138
|
-
header: () =>
|
|
138
|
+
header: () => n("inventory.closing.table.reference"),
|
|
139
139
|
enableSorting: !1,
|
|
140
140
|
size: "auto"
|
|
141
141
|
},
|
|
142
142
|
{
|
|
143
143
|
id: "status",
|
|
144
|
-
header: () =>
|
|
144
|
+
header: () => n("inventory.closing.table.status"),
|
|
145
145
|
enableSorting: !1,
|
|
146
|
-
cell(
|
|
146
|
+
cell(g) {
|
|
147
147
|
var $;
|
|
148
|
-
const _ =
|
|
148
|
+
const _ = g.row.original, c = _._rev, r = ($ = s.value.publishedRevs) == null ? void 0 : $[_._id], y = c === r;
|
|
149
149
|
return A(
|
|
150
150
|
"div",
|
|
151
151
|
{
|
|
@@ -166,8 +166,8 @@ const le = qe((l, o) => {
|
|
|
166
166
|
},
|
|
167
167
|
{
|
|
168
168
|
id: "action",
|
|
169
|
-
cell(
|
|
170
|
-
const _ =
|
|
169
|
+
cell(g) {
|
|
170
|
+
const _ = g.row.original, c = [
|
|
171
171
|
Se[j.Edit],
|
|
172
172
|
Se[j.Delete]
|
|
173
173
|
];
|
|
@@ -191,17 +191,17 @@ const le = qe((l, o) => {
|
|
|
191
191
|
);
|
|
192
192
|
var fe = /* @__PURE__ */ ((l) => (l.Ingredients = "Ingredients", l))(fe || {});
|
|
193
193
|
function He(l) {
|
|
194
|
-
const
|
|
194
|
+
const n = l.sku, o = new Set(l.disabledMeasurements);
|
|
195
195
|
return [
|
|
196
196
|
{
|
|
197
|
-
code:
|
|
198
|
-
name:
|
|
199
|
-
unit:
|
|
200
|
-
enabled: !
|
|
197
|
+
code: n.code,
|
|
198
|
+
name: n.name,
|
|
199
|
+
unit: n.unit.abbrev,
|
|
200
|
+
enabled: !o.has(n.unit._id)
|
|
201
201
|
},
|
|
202
|
-
...
|
|
202
|
+
...n.unit.measurements.map((t) => ({
|
|
203
203
|
unit: t.abbrev,
|
|
204
|
-
enabled: !
|
|
204
|
+
enabled: !o.has(t.id)
|
|
205
205
|
}))
|
|
206
206
|
];
|
|
207
207
|
}
|
|
@@ -227,14 +227,14 @@ function je() {
|
|
|
227
227
|
}
|
|
228
228
|
function yt(l) {
|
|
229
229
|
var h;
|
|
230
|
-
const
|
|
230
|
+
const o = pe().currentBusiness.value, e = (h = l.map((f) => {
|
|
231
231
|
var c;
|
|
232
232
|
const a = f.items.flatMap(He), u = je(), p = [
|
|
233
233
|
["Template ID", f._id],
|
|
234
234
|
["Template name", f.name],
|
|
235
|
-
["Business name",
|
|
236
|
-
["Business ID",
|
|
237
|
-
["Menu version",
|
|
235
|
+
["Business name", o == null ? void 0 : o.name],
|
|
236
|
+
["Business ID", o == null ? void 0 : o._id],
|
|
237
|
+
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
238
238
|
[
|
|
239
239
|
"Locations",
|
|
240
240
|
...(c = f.locations) != null && c.length ? f.locations.map((r) => `${r.name} (${r.dbName})`) : ["All"]
|
|
@@ -243,7 +243,7 @@ function yt(l) {
|
|
|
243
243
|
[],
|
|
244
244
|
u.map((r) => r.name),
|
|
245
245
|
...a.map((r) => u.map((y) => r[y.id]))
|
|
246
|
-
],
|
|
246
|
+
], g = u.map((r) => `system:${r.id}`), _ = ce(p, g);
|
|
247
247
|
return { name: f.name, sheet: _ };
|
|
248
248
|
}).reduce(
|
|
249
249
|
(f, a) => {
|
|
@@ -255,11 +255,11 @@ function yt(l) {
|
|
|
255
255
|
sheets: {},
|
|
256
256
|
sheetOccurence: {}
|
|
257
257
|
}
|
|
258
|
-
)) == null ? void 0 : h.sheets, t = `${
|
|
259
|
-
return Ue(
|
|
258
|
+
)) == null ? void 0 : h.sheets, t = `${o == null ? void 0 : o.name} closing templates (${Ze(/* @__PURE__ */ new Date())}).xlsx`, v = Ee(e);
|
|
259
|
+
return Ue(v, t), t;
|
|
260
260
|
}
|
|
261
261
|
function ht() {
|
|
262
|
-
const l = pe(),
|
|
262
|
+
const l = pe(), n = de(), o = et(), s = He({
|
|
263
263
|
sku: {
|
|
264
264
|
unit: {
|
|
265
265
|
_id: "",
|
|
@@ -272,7 +272,7 @@ function ht() {
|
|
|
272
272
|
_id: "",
|
|
273
273
|
name: "Sugar"
|
|
274
274
|
}
|
|
275
|
-
})[0], e = l.currentBusiness.value, t = je(),
|
|
275
|
+
})[0], e = l.currentBusiness.value, t = je(), v = [
|
|
276
276
|
["Template ID (leave empty to create new)", ""],
|
|
277
277
|
["Template Name", "New template"],
|
|
278
278
|
["Business name", e == null ? void 0 : e.name],
|
|
@@ -287,17 +287,17 @@ function ht() {
|
|
|
287
287
|
[],
|
|
288
288
|
t.map((c) => c.name),
|
|
289
289
|
t.map((c) => s[c.id])
|
|
290
|
-
], h = t.map((c) => `system:${c.id}`), f = ce(
|
|
290
|
+
], h = t.map((c) => `system:${c.id}`), f = ce(v, h), a = o.isEnabled ? o.state.setting.childItems ?? [] : [], u = a.reduce(
|
|
291
291
|
(c, r) => {
|
|
292
292
|
var x, d;
|
|
293
|
-
const y = (x =
|
|
293
|
+
const y = (x = o.netSuiteItemIdToSkuId.get(r.parentNetSuiteId)) == null ? void 0 : x[0], $ = (d = o.netSuiteMeasurementIdToMeasurementId.get(
|
|
294
294
|
r.unitOfMeasureId
|
|
295
295
|
)) == null ? void 0 : d[0];
|
|
296
296
|
if (!r.externalId)
|
|
297
297
|
return c;
|
|
298
298
|
if (!y)
|
|
299
299
|
return console.error(`Item ${r.externalId} cannot be mapped to parent FdoInventorySku.`, r), c;
|
|
300
|
-
const m =
|
|
300
|
+
const m = n.skuById[y], D = m.unit.measurements.find((k) => k.id === $);
|
|
301
301
|
return D ? (c[r.externalId] = {
|
|
302
302
|
sku: m,
|
|
303
303
|
measurement: D
|
|
@@ -309,7 +309,7 @@ function ht() {
|
|
|
309
309
|
{}
|
|
310
310
|
), p = ce(
|
|
311
311
|
[
|
|
312
|
-
...
|
|
312
|
+
...n.skus.flatMap((c) => [
|
|
313
313
|
[c.code, c.name, c.unit.abbrev, !0],
|
|
314
314
|
...c.unit.measurements.map((y) => [
|
|
315
315
|
"",
|
|
@@ -333,20 +333,20 @@ function ht() {
|
|
|
333
333
|
"Enabled (true/false)",
|
|
334
334
|
...a.length ? ["Netsuite Parent"] : []
|
|
335
335
|
]
|
|
336
|
-
),
|
|
336
|
+
), g = Ee({
|
|
337
337
|
Template: f,
|
|
338
338
|
Ingredients: p
|
|
339
339
|
}), _ = `${e == null ? void 0 : e.name} transfer templates import.xlsx`;
|
|
340
|
-
return Ue(
|
|
340
|
+
return Ue(g, _), _;
|
|
341
341
|
}
|
|
342
342
|
function bt(l) {
|
|
343
343
|
if (!l.length || `${l[0]}`.toLocaleLowerCase() === "all")
|
|
344
344
|
return [];
|
|
345
|
-
const
|
|
345
|
+
const n = /(.*) \(((warehouse_|restaurant_).{24,})\)/, s = ue().locationByDbName;
|
|
346
346
|
return l.map((e) => {
|
|
347
|
-
const t = new Array(),
|
|
347
|
+
const t = new Array(), v = e.trim(), h = n.exec(v);
|
|
348
348
|
if (!h)
|
|
349
|
-
return t.push(`Enabled location value of ${
|
|
349
|
+
return t.push(`Enabled location value of ${v} cannot be read.`), {
|
|
350
350
|
errors: t
|
|
351
351
|
};
|
|
352
352
|
const f = h[1], a = h[2], u = s[a];
|
|
@@ -362,17 +362,17 @@ function bt(l) {
|
|
|
362
362
|
}
|
|
363
363
|
function _t(l) {
|
|
364
364
|
const [
|
|
365
|
-
o,
|
|
366
365
|
n,
|
|
366
|
+
o,
|
|
367
367
|
s,
|
|
368
368
|
e,
|
|
369
369
|
t,
|
|
370
|
-
|
|
370
|
+
v,
|
|
371
371
|
h,
|
|
372
372
|
f
|
|
373
373
|
] = Ve(l);
|
|
374
374
|
return {
|
|
375
|
-
id: `${
|
|
375
|
+
id: `${o[1] ?? ""}`.trim(),
|
|
376
376
|
name: `${s[1] ?? ""}`.trim(),
|
|
377
377
|
locations: h.slice(1).map((a) => `${a}`.trim()).filter((a) => a),
|
|
378
378
|
reference: `${f[1] ?? ""}`.trim()
|
|
@@ -380,29 +380,29 @@ function _t(l) {
|
|
|
380
380
|
}
|
|
381
381
|
function xt(l) {
|
|
382
382
|
const [
|
|
383
|
-
o,
|
|
384
383
|
n,
|
|
384
|
+
o,
|
|
385
385
|
s,
|
|
386
386
|
e,
|
|
387
387
|
t,
|
|
388
|
-
|
|
388
|
+
v,
|
|
389
389
|
h,
|
|
390
390
|
f,
|
|
391
391
|
a,
|
|
392
392
|
u,
|
|
393
393
|
...p
|
|
394
394
|
] = Ve(l);
|
|
395
|
-
if (!
|
|
395
|
+
if (!n || !n.length || n.some((y) => y.length && !y.startsWith("system:")))
|
|
396
396
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
397
|
-
const
|
|
397
|
+
const g = n.map((y) => y.split(":")[1]), c = ["code", "name", "unit", "enabled"].filter((y) => !g.includes(y));
|
|
398
398
|
if (c.length)
|
|
399
399
|
throw new Error(
|
|
400
400
|
`Missing meta headers (${c.join()}). Excel file does not come from the template.`
|
|
401
401
|
);
|
|
402
402
|
return p.map((y, $) => {
|
|
403
403
|
const m = {};
|
|
404
|
-
for (const D in
|
|
405
|
-
const x =
|
|
404
|
+
for (const D in g) {
|
|
405
|
+
const x = g[D];
|
|
406
406
|
Object.assign(m, { [x]: y[D] });
|
|
407
407
|
}
|
|
408
408
|
return {
|
|
@@ -413,48 +413,48 @@ function xt(l) {
|
|
|
413
413
|
}
|
|
414
414
|
function wt(l) {
|
|
415
415
|
return l.reduce(
|
|
416
|
-
(
|
|
416
|
+
(n, o) => {
|
|
417
417
|
var t;
|
|
418
|
-
const s =
|
|
419
|
-
return s.unit && (s.code ?
|
|
418
|
+
const s = o.data, e = o.index;
|
|
419
|
+
return s.unit && (s.code ? n.result.push({ parent: o, children: [] }) : n.result.length ? (t = n.result.at(-1)) == null || t.children.push(o) : n.errors.push(`Cannot find parent for row ${e + 9}`)), n;
|
|
420
420
|
},
|
|
421
421
|
{ result: new Array(), errors: new Array() }
|
|
422
422
|
);
|
|
423
423
|
}
|
|
424
424
|
function kt(l) {
|
|
425
|
-
const
|
|
425
|
+
const n = l.parent.data, o = new Array(), e = de().skuByCode[n.code ?? ""];
|
|
426
426
|
if (!e)
|
|
427
|
-
return
|
|
427
|
+
return o.push(`Cannot find ingredient of code ${n.code} ${n.name}`), { errors: o };
|
|
428
428
|
const t = {
|
|
429
429
|
sku: e
|
|
430
|
-
},
|
|
431
|
-
|
|
432
|
-
`Cannot find measurement unit of ${
|
|
433
|
-
) : (
|
|
430
|
+
}, v = /* @__PURE__ */ new Set([e.unit._id, ...e.unit.measurements.map((f) => f.id)]), h = e.unit.measurements.find((f) => f.abbrev === n.unit);
|
|
431
|
+
n.unit !== e.unit.abbrev && !h ? o.push(
|
|
432
|
+
`Cannot find measurement unit of ${n.unit} for (${n.code}) ${n.name}.`
|
|
433
|
+
) : (n.enabled === !0 || `${n.enabled}`.toLocaleLowerCase() === "true") && v.delete(e.unit._id);
|
|
434
434
|
for (const f of l.children) {
|
|
435
|
-
const a = f.data, u = a.unit === e.unit.abbrev ? e.unit : void 0, p = e.unit.measurements.find((
|
|
435
|
+
const a = f.data, u = a.unit === e.unit.abbrev ? e.unit : void 0, p = e.unit.measurements.find((g) => g.abbrev === a.unit);
|
|
436
436
|
if (!p && !u) {
|
|
437
|
-
|
|
438
|
-
`Cannot find measurement unit of ${a.unit} for (${
|
|
437
|
+
o.push(
|
|
438
|
+
`Cannot find measurement unit of ${a.unit} for (${n.code}) ${n.name}.`
|
|
439
439
|
);
|
|
440
440
|
continue;
|
|
441
441
|
}
|
|
442
|
-
(a.enabled === !0 || `${a.enabled}`.toLocaleLowerCase() === "true") &&
|
|
442
|
+
(a.enabled === !0 || `${a.enabled}`.toLocaleLowerCase() === "true") && v.delete((p == null ? void 0 : p.id) ?? (u == null ? void 0 : u._id) ?? "");
|
|
443
443
|
}
|
|
444
|
-
return
|
|
444
|
+
return v.has(e.unit._id) && t.sku.unit.measurements.every((f) => v.has(f.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), t.disabledMeasurements = [...v], { errors: o, templateItem: t };
|
|
445
445
|
}
|
|
446
446
|
function Tt(l) {
|
|
447
|
-
const
|
|
447
|
+
const n = l.SheetNames.filter(
|
|
448
448
|
(t) => !Object.values(fe).map(String).includes(t)
|
|
449
449
|
), s = ae().templates, e = tt(s, "_id");
|
|
450
450
|
try {
|
|
451
|
-
return
|
|
452
|
-
(t,
|
|
453
|
-
const h = new Array(), f = l.Sheets[
|
|
451
|
+
return n.reduce(
|
|
452
|
+
(t, v) => {
|
|
453
|
+
const h = new Array(), f = l.Sheets[v], a = _t(f), u = bt(a.locations), p = u.filter((m) => m.location).map((m) => m.location);
|
|
454
454
|
h.push(...u.flatMap((m) => m.errors));
|
|
455
|
-
const
|
|
455
|
+
const g = xt(f).filter(
|
|
456
456
|
(m) => m.data.code || m.data.unit
|
|
457
|
-
), _ = wt(
|
|
457
|
+
), _ = wt(g);
|
|
458
458
|
h.push(..._.errors);
|
|
459
459
|
const c = _.result.map(
|
|
460
460
|
(m) => kt(m)
|
|
@@ -467,14 +467,14 @@ function Tt(l) {
|
|
|
467
467
|
const x = {
|
|
468
468
|
_id: a.id,
|
|
469
469
|
_rev: "",
|
|
470
|
-
name: a.name || `(unnamed from sheet ${
|
|
470
|
+
name: a.name || `(unnamed from sheet ${v || "<unnamed sheet>"})`,
|
|
471
471
|
items: []
|
|
472
472
|
};
|
|
473
473
|
return h.push(`Template ID ${a.id} is not found.`), t.importUpdateResult.push({
|
|
474
474
|
type: "update",
|
|
475
475
|
original: x,
|
|
476
476
|
template: x,
|
|
477
|
-
excelSheetName:
|
|
477
|
+
excelSheetName: v,
|
|
478
478
|
errors: h
|
|
479
479
|
}), t;
|
|
480
480
|
}
|
|
@@ -488,7 +488,7 @@ function Tt(l) {
|
|
|
488
488
|
ref: a.reference,
|
|
489
489
|
items: r
|
|
490
490
|
},
|
|
491
|
-
excelSheetName:
|
|
491
|
+
excelSheetName: v,
|
|
492
492
|
errors: h
|
|
493
493
|
};
|
|
494
494
|
return t.importUpdateResult.push(D), t;
|
|
@@ -501,7 +501,7 @@ function Tt(l) {
|
|
|
501
501
|
ref: a.reference,
|
|
502
502
|
items: r
|
|
503
503
|
},
|
|
504
|
-
excelSheetName:
|
|
504
|
+
excelSheetName: v,
|
|
505
505
|
errors: h
|
|
506
506
|
};
|
|
507
507
|
return t.importCreateResult.push($), t;
|
|
@@ -534,9 +534,9 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
534
534
|
errors: {}
|
|
535
535
|
},
|
|
536
536
|
setup(l) {
|
|
537
|
-
const { t:
|
|
538
|
-
return (
|
|
539
|
-
var
|
|
537
|
+
const { t: n } = Y();
|
|
538
|
+
return (o, s) => {
|
|
539
|
+
var v, h, f;
|
|
540
540
|
const e = E("FmIcon"), t = E("FmTooltip");
|
|
541
541
|
return w(), I("div", $t, [
|
|
542
542
|
s[0] || (s[0] = b("div", null, "•", -1)),
|
|
@@ -544,17 +544,17 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
544
544
|
b("div", It, [
|
|
545
545
|
b("div", {
|
|
546
546
|
class: q({
|
|
547
|
-
"text-fm-color-system-error-300":
|
|
547
|
+
"text-fm-color-system-error-300": o.errors.length
|
|
548
548
|
})
|
|
549
549
|
}, [
|
|
550
|
-
Fe(C(
|
|
551
|
-
|
|
550
|
+
Fe(C(o.name) + " ", 1),
|
|
551
|
+
o.type === "create" ? (w(), I("span", St, "(" + C(i(n)("inventory.closing.template.import.new")) + ")", 1)) : X("", !0)
|
|
552
552
|
], 2),
|
|
553
|
-
|
|
553
|
+
o.errors.length ? (w(), I("div", Dt, [
|
|
554
554
|
T(t, { "z-index": 50 }, {
|
|
555
555
|
content: P(() => [
|
|
556
556
|
b("ol", null, [
|
|
557
|
-
(w(!0), I(O, null, Q(
|
|
557
|
+
(w(!0), I(O, null, Q(o.errors, (a, u) => (w(), I("li", { key: u }, C(a), 1))), 128))
|
|
558
558
|
])
|
|
559
559
|
]),
|
|
560
560
|
default: P(() => [
|
|
@@ -572,11 +572,11 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
572
572
|
class: q([
|
|
573
573
|
"fm-typo-en-body-sm-400",
|
|
574
574
|
{
|
|
575
|
-
"text-fm-color-system-error-200":
|
|
576
|
-
"text-fm-color-typo-secondary": !
|
|
575
|
+
"text-fm-color-system-error-200": o.errors.length,
|
|
576
|
+
"text-fm-color-typo-secondary": !o.errors.length
|
|
577
577
|
}
|
|
578
578
|
])
|
|
579
|
-
}, C((
|
|
579
|
+
}, C((v = o.locations) != null && v.length ? i(n)("inventory.closing.template.import.nLocations", { count: (h = o.locations) == null ? void 0 : h.length }) : i(n)("inventory.closing.template.import.allLocations")) + ", " + C(i(n)("inventory.closing.template.import.nItems", { count: (f = o.items) == null ? void 0 : f.length })), 3)
|
|
580
580
|
])
|
|
581
581
|
]);
|
|
582
582
|
};
|
|
@@ -596,13 +596,13 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
596
596
|
}, Lt = { class: "fm-typo-en-body-lg-600" }, zt = /* @__PURE__ */ J({
|
|
597
597
|
__name: "ClosingTemplateImport",
|
|
598
598
|
setup(l) {
|
|
599
|
-
const
|
|
600
|
-
() => !!
|
|
599
|
+
const n = R(null), o = pt(), s = se(), e = R(!1), t = R(!1), v = R(new Array()), h = R([]), f = R([]), a = U(
|
|
600
|
+
() => !!v.value.length || h.value.some((_) => _.errors.length) || f.value.some((_) => _.errors.length)
|
|
601
601
|
), u = U(
|
|
602
602
|
() => !!h.value.length || !!f.value.length
|
|
603
603
|
), { t: p } = Y();
|
|
604
|
-
async function
|
|
605
|
-
|
|
604
|
+
async function g(_) {
|
|
605
|
+
v.value = [], h.value = [], f.value = [];
|
|
606
606
|
try {
|
|
607
607
|
e.value = !0;
|
|
608
608
|
const [c] = await Promise.all([
|
|
@@ -613,21 +613,21 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
613
613
|
if (!c.SheetNames.filter(
|
|
614
614
|
(m) => !Object.values(fe).map(String).includes(m)
|
|
615
615
|
).find((m) => m)) {
|
|
616
|
-
|
|
616
|
+
v.value.push(p("inventory.ingredient.import.fileError.noSheet"));
|
|
617
617
|
return;
|
|
618
618
|
}
|
|
619
619
|
const $ = Tt(c);
|
|
620
620
|
if ($.invalidExcel) {
|
|
621
|
-
|
|
621
|
+
v.value.push(
|
|
622
622
|
$.invalidExcelMessage ?? p("inventory.ingredient.import.fileError.invalidExcel")
|
|
623
623
|
);
|
|
624
624
|
return;
|
|
625
625
|
}
|
|
626
626
|
if (h.value = $.importCreateResult, f.value = $.importUpdateResult, !h.value.length && !f.value.length) {
|
|
627
|
-
|
|
627
|
+
v.value.push(p("inventory.ingredient.import.fileError.noData"));
|
|
628
628
|
return;
|
|
629
629
|
}
|
|
630
|
-
|
|
630
|
+
o.emitData($);
|
|
631
631
|
} catch (c) {
|
|
632
632
|
s.open({
|
|
633
633
|
title: p("inventory.ingredient.import.fileError.unableToRead"),
|
|
@@ -635,14 +635,14 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
635
635
|
type: "error"
|
|
636
636
|
}), console.error("Error in reading file", c);
|
|
637
637
|
} finally {
|
|
638
|
-
|
|
638
|
+
v.value.length && s.open({
|
|
639
639
|
title: p("inventory.ingredient.import.fileError.invalidExcel"),
|
|
640
640
|
type: "error"
|
|
641
641
|
}), e.value = !1;
|
|
642
642
|
}
|
|
643
643
|
}
|
|
644
|
-
return Re(
|
|
645
|
-
_ &&
|
|
644
|
+
return Re(n, (_) => {
|
|
645
|
+
_ && g(_);
|
|
646
646
|
}), (_, c) => {
|
|
647
647
|
const r = E("FmCircularProgress"), y = E("FmIcon"), $ = E("FmButton");
|
|
648
648
|
return w(), I("div", Mt, [
|
|
@@ -659,14 +659,14 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
659
659
|
T(nt, {
|
|
660
660
|
class: q({
|
|
661
661
|
"w-full": !0,
|
|
662
|
-
"h-[200px]": !
|
|
662
|
+
"h-[200px]": !n.value
|
|
663
663
|
}),
|
|
664
664
|
accept: ".xlsx",
|
|
665
|
-
onFileUpload: c[0] || (c[0] = (m) =>
|
|
665
|
+
onFileUpload: c[0] || (c[0] = (m) => n.value = m),
|
|
666
666
|
label: i(p)("inventory.ingredient.import.uploadTemplate"),
|
|
667
667
|
"button-label": i(p)("inventory.ingredient.import.selectFile")
|
|
668
668
|
}, ie({ _: 2 }, [
|
|
669
|
-
|
|
669
|
+
n.value ? {
|
|
670
670
|
name: "default",
|
|
671
671
|
fn: P(({ openFileDialog: m }) => [
|
|
672
672
|
b("div", At, [
|
|
@@ -699,7 +699,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
699
699
|
}
|
|
700
700
|
])
|
|
701
701
|
}, [
|
|
702
|
-
b("div", Et, C(
|
|
702
|
+
b("div", Et, C(n.value.name), 1)
|
|
703
703
|
], 2),
|
|
704
704
|
e.value ? X("", !0) : (w(), I("div", Ut, [
|
|
705
705
|
T($, {
|
|
@@ -710,8 +710,8 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
710
710
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
711
711
|
]))
|
|
712
712
|
], 2),
|
|
713
|
-
|
|
714
|
-
(w(!0), I(O, null, Q(
|
|
713
|
+
v.value.length ? (w(), I("div", Vt, [
|
|
714
|
+
(w(!0), I(O, null, Q(v.value, (D, x) => (w(), I("div", {
|
|
715
715
|
key: x,
|
|
716
716
|
class: "flex gap-8 items-center"
|
|
717
717
|
}, [
|
|
@@ -752,28 +752,28 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
752
752
|
};
|
|
753
753
|
}
|
|
754
754
|
}), me = Le("closingTemplateActions", () => {
|
|
755
|
-
const { t: l } = Y(),
|
|
755
|
+
const { t: l } = Y(), n = Be(), o = se(), s = le(), e = ae(), { loading: t } = ze(e), v = R({});
|
|
756
756
|
function h() {
|
|
757
|
-
|
|
757
|
+
v.value = {
|
|
758
758
|
mode: K.CREATE,
|
|
759
759
|
show: !0,
|
|
760
760
|
"onUpdate:show"(r) {
|
|
761
|
-
|
|
761
|
+
v.value.show = r;
|
|
762
762
|
}
|
|
763
763
|
};
|
|
764
764
|
}
|
|
765
765
|
function f(r) {
|
|
766
|
-
|
|
766
|
+
v.value = {
|
|
767
767
|
mode: K.UPDATE,
|
|
768
768
|
modelValue: r,
|
|
769
769
|
show: !0,
|
|
770
770
|
"onUpdate:show"(y) {
|
|
771
|
-
|
|
771
|
+
v.value.show = y;
|
|
772
772
|
}
|
|
773
773
|
};
|
|
774
774
|
}
|
|
775
775
|
function a(r, y, $) {
|
|
776
|
-
|
|
776
|
+
n.open({
|
|
777
777
|
title: `Confirm deleting template ${r.name}?`,
|
|
778
778
|
message: "Deleted template can no longer be retrieved",
|
|
779
779
|
primaryActions: {
|
|
@@ -787,7 +787,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
787
787
|
close: !0
|
|
788
788
|
}
|
|
789
789
|
}).onPrimary(async () => {
|
|
790
|
-
|
|
790
|
+
o.open({
|
|
791
791
|
title: `Deleting ${r.name}`,
|
|
792
792
|
type: "info"
|
|
793
793
|
});
|
|
@@ -798,12 +798,12 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
798
798
|
new Promise((D) => setTimeout(D, 1e3))
|
|
799
799
|
]);
|
|
800
800
|
if (m.status === "rejected") throw m.reason;
|
|
801
|
-
|
|
801
|
+
o.open({
|
|
802
802
|
title: `Deleted ${r.name}`,
|
|
803
803
|
type: "success"
|
|
804
804
|
});
|
|
805
805
|
} catch (m) {
|
|
806
|
-
|
|
806
|
+
o.open({
|
|
807
807
|
title: `Unable to delete ${r.name}`,
|
|
808
808
|
message: `See error from server: ${m}`,
|
|
809
809
|
type: "error"
|
|
@@ -826,23 +826,23 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
826
826
|
}
|
|
827
827
|
};
|
|
828
828
|
}
|
|
829
|
-
function
|
|
829
|
+
function g() {
|
|
830
830
|
if (!e.templates.length) {
|
|
831
|
-
|
|
831
|
+
o.open({
|
|
832
832
|
title: "No data to export",
|
|
833
833
|
type: "error"
|
|
834
834
|
});
|
|
835
835
|
return;
|
|
836
836
|
}
|
|
837
837
|
const r = yt(e.templates);
|
|
838
|
-
|
|
838
|
+
o.open({
|
|
839
839
|
title: l("inventory.ingredient.export.success"),
|
|
840
840
|
message: l("inventory.ingredient.export.filename", [r]),
|
|
841
841
|
type: "success"
|
|
842
842
|
});
|
|
843
843
|
}
|
|
844
844
|
function _() {
|
|
845
|
-
e.loading ||
|
|
845
|
+
e.loading || n.open({
|
|
846
846
|
title: l("inventory.ingredient.import.title"),
|
|
847
847
|
contentComponent: zt,
|
|
848
848
|
overlay: !0,
|
|
@@ -862,14 +862,14 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
862
862
|
}
|
|
863
863
|
}).onPrimary((r) => {
|
|
864
864
|
if (!r) {
|
|
865
|
-
|
|
865
|
+
o.open({
|
|
866
866
|
title: l("inventory.ingredient.import.error.noData"),
|
|
867
867
|
type: "error"
|
|
868
868
|
});
|
|
869
869
|
return;
|
|
870
870
|
}
|
|
871
871
|
if (!r.importCreateResult.length && !r.importUpdateResult.length) {
|
|
872
|
-
|
|
872
|
+
o.open({
|
|
873
873
|
title: l("inventory.ingredient.import.error.invalidContent"),
|
|
874
874
|
message: l("inventory.ingredient.import.error.noImportData"),
|
|
875
875
|
type: "error"
|
|
@@ -877,14 +877,14 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
877
877
|
return;
|
|
878
878
|
}
|
|
879
879
|
if (r.importCreateResult.some((y) => y.errors.length) || r.importUpdateResult.some((y) => y.errors.length)) {
|
|
880
|
-
|
|
880
|
+
o.open({
|
|
881
881
|
title: l("inventory.ingredient.import.error.invalidContent"),
|
|
882
882
|
message: l("inventory.ingredient.import.error.hasErrors"),
|
|
883
883
|
type: "error"
|
|
884
884
|
});
|
|
885
885
|
return;
|
|
886
886
|
}
|
|
887
|
-
|
|
887
|
+
n.close(), c(r);
|
|
888
888
|
}).onTertiary(ht);
|
|
889
889
|
}
|
|
890
890
|
async function c(r) {
|
|
@@ -900,7 +900,7 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
900
900
|
], $ = 100;
|
|
901
901
|
let m = 0;
|
|
902
902
|
const D = () => {
|
|
903
|
-
m += $,
|
|
903
|
+
m += $, o.open({
|
|
904
904
|
title: l("inventory.ingredient.import.progress", [
|
|
905
905
|
Math.min(m, y.length),
|
|
906
906
|
y.length
|
|
@@ -909,12 +909,12 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
909
909
|
};
|
|
910
910
|
for (const x of y.chunk(100))
|
|
911
911
|
D(), await s.importTemplates(x);
|
|
912
|
-
|
|
912
|
+
o.open({
|
|
913
913
|
title: l("inventory.ingredient.import.success"),
|
|
914
914
|
type: "success"
|
|
915
915
|
});
|
|
916
916
|
} catch (y) {
|
|
917
|
-
|
|
917
|
+
o.open({
|
|
918
918
|
title: l("inventory.ingredient.import.error.failed"),
|
|
919
919
|
message: l("inventory.ingredient.import.error.systemMessage", [y == null ? void 0 : y.message]),
|
|
920
920
|
type: "error"
|
|
@@ -928,9 +928,9 @@ const $t = { class: "flex items-center gap-12 pl-8" }, Ct = { class: "flex flex-
|
|
|
928
928
|
viewTemplate: p,
|
|
929
929
|
updateTemplate: f,
|
|
930
930
|
deleteTemplate: a,
|
|
931
|
-
exportTemplates:
|
|
931
|
+
exportTemplates: g,
|
|
932
932
|
importTemplates: _,
|
|
933
|
-
templateDialogProps:
|
|
933
|
+
templateDialogProps: v,
|
|
934
934
|
templateDetailsProps: u
|
|
935
935
|
};
|
|
936
936
|
});
|
|
@@ -938,7 +938,7 @@ var ee = /* @__PURE__ */ ((l) => (l.Name = "Name", l.Unit = "Unit", l.Delete = "
|
|
|
938
938
|
function Ht(l) {
|
|
939
939
|
return {
|
|
940
940
|
columnDefs: U(() => {
|
|
941
|
-
const
|
|
941
|
+
const o = l.items.map((e) => e.sku.unit.measurements.length).reduce((e, t) => Math.max(e, t), 0);
|
|
942
942
|
return [
|
|
943
943
|
{
|
|
944
944
|
id: "Name",
|
|
@@ -977,14 +977,14 @@ function Ht(l) {
|
|
|
977
977
|
minSize: 200,
|
|
978
978
|
maxSize: 400,
|
|
979
979
|
cell(e) {
|
|
980
|
-
var
|
|
980
|
+
var v, h, f;
|
|
981
981
|
const t = e.row.original;
|
|
982
982
|
return A("div", { class: "flex items-center gap-32" }, [
|
|
983
983
|
A(
|
|
984
984
|
G.FmFormGroup,
|
|
985
985
|
{
|
|
986
986
|
value: t.sku.unit._id,
|
|
987
|
-
modelValue: !((
|
|
987
|
+
modelValue: !((v = t.disabledMeasurements) != null && v.includes(t.sku.unit._id))
|
|
988
988
|
},
|
|
989
989
|
A(
|
|
990
990
|
"div",
|
|
@@ -1039,14 +1039,14 @@ function Ht(l) {
|
|
|
1039
1039
|
]
|
|
1040
1040
|
)
|
|
1041
1041
|
),
|
|
1042
|
-
...Array.from({ length: Math.max(
|
|
1042
|
+
...Array.from({ length: Math.max(o, 0) }).map((a, u) => {
|
|
1043
1043
|
var _, c, r, y;
|
|
1044
|
-
const p = e.row.original,
|
|
1045
|
-
return
|
|
1044
|
+
const p = e.row.original, g = p.sku.unit.measurements[u];
|
|
1045
|
+
return g ? A(
|
|
1046
1046
|
G.FmFormGroup,
|
|
1047
1047
|
{
|
|
1048
|
-
modelValue: !((_ = p.disabledMeasurements) != null && _.includes(
|
|
1049
|
-
value:
|
|
1048
|
+
modelValue: !((_ = p.disabledMeasurements) != null && _.includes(g.id)),
|
|
1049
|
+
value: g.id
|
|
1050
1050
|
},
|
|
1051
1051
|
A(
|
|
1052
1052
|
"div",
|
|
@@ -1056,9 +1056,9 @@ function Ht(l) {
|
|
|
1056
1056
|
},
|
|
1057
1057
|
[
|
|
1058
1058
|
A(G.FmCheckbox, {
|
|
1059
|
-
value:
|
|
1060
|
-
modelValue: !((c = p.disabledMeasurements) != null && c.includes(
|
|
1061
|
-
disabled: l.disabled || !((r = p.disabledMeasurements) != null && r.includes(
|
|
1059
|
+
value: g.id,
|
|
1060
|
+
modelValue: !((c = p.disabledMeasurements) != null && c.includes(g.id)),
|
|
1061
|
+
disabled: l.disabled || !((r = p.disabledMeasurements) != null && r.includes(g.id)) && ((y = p.disabledMeasurements) == null ? void 0 : y.includes(p.sku.unit._id)) && p.sku.unit.measurements.filter(($) => $.id != g.id).every(($) => {
|
|
1062
1062
|
var m;
|
|
1063
1063
|
return (m = p.disabledMeasurements) == null ? void 0 : m.includes($.id);
|
|
1064
1064
|
}),
|
|
@@ -1068,14 +1068,14 @@ function Ht(l) {
|
|
|
1068
1068
|
l.updateItem({
|
|
1069
1069
|
...p,
|
|
1070
1070
|
disabledMeasurements: (m = p.disabledMeasurements) == null ? void 0 : m.filter(
|
|
1071
|
-
(D) => D !==
|
|
1071
|
+
(D) => D !== g.id
|
|
1072
1072
|
)
|
|
1073
1073
|
});
|
|
1074
1074
|
else {
|
|
1075
1075
|
const D = p.disabledMeasurements ?? [];
|
|
1076
1076
|
l.updateItem({
|
|
1077
1077
|
...p,
|
|
1078
|
-
disabledMeasurements: [...D,
|
|
1078
|
+
disabledMeasurements: [...D, g.id]
|
|
1079
1079
|
});
|
|
1080
1080
|
}
|
|
1081
1081
|
}
|
|
@@ -1085,13 +1085,13 @@ function Ht(l) {
|
|
|
1085
1085
|
{ zIndex: 51 },
|
|
1086
1086
|
{
|
|
1087
1087
|
content() {
|
|
1088
|
-
return
|
|
1088
|
+
return g.abbrev;
|
|
1089
1089
|
},
|
|
1090
1090
|
default() {
|
|
1091
1091
|
return A(
|
|
1092
1092
|
"div",
|
|
1093
1093
|
{ class: "line-clamp-2 fm-typo-en-body-lg-400" },
|
|
1094
|
-
|
|
1094
|
+
g.abbrev
|
|
1095
1095
|
);
|
|
1096
1096
|
}
|
|
1097
1097
|
}
|
|
@@ -1143,20 +1143,20 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1143
1143
|
row: {}
|
|
1144
1144
|
},
|
|
1145
1145
|
setup(l) {
|
|
1146
|
-
const
|
|
1147
|
-
() =>
|
|
1146
|
+
const n = l, o = U(() => n.row), s = U(
|
|
1147
|
+
() => o.value.getVisibleCells().filter((e) => e.column.id !== ee.Name && e.column.id !== ee.Delete)
|
|
1148
1148
|
);
|
|
1149
1149
|
return (e, t) => {
|
|
1150
|
-
var
|
|
1150
|
+
var v, h, f, a, u;
|
|
1151
1151
|
return w(), I("div", jt, [
|
|
1152
1152
|
b("div", Ot, [
|
|
1153
1153
|
b("div", Yt, [
|
|
1154
|
-
b("div", Gt, C(
|
|
1155
|
-
b("div", Kt, C(
|
|
1154
|
+
b("div", Gt, C(o.value.original.sku.name), 1),
|
|
1155
|
+
b("div", Kt, C(o.value.original.sku.code), 1)
|
|
1156
1156
|
]),
|
|
1157
1157
|
b("div", null, [
|
|
1158
1158
|
T(i(W), {
|
|
1159
|
-
render: (f = (h = (
|
|
1159
|
+
render: (f = (h = (v = e.cellByColId[i(ee).Delete]) == null ? void 0 : v.column) == null ? void 0 : h.columnDef) == null ? void 0 : f.cell,
|
|
1160
1160
|
props: (u = (a = e.cellByColId[i(ee).Delete]) == null ? void 0 : a.getContext) == null ? void 0 : u.call(a)
|
|
1161
1161
|
}, null, 8, ["render", "props"])
|
|
1162
1162
|
])
|
|
@@ -1164,12 +1164,12 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1164
1164
|
b("div", Jt, [
|
|
1165
1165
|
t[0] || (t[0] = b("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
|
|
1166
1166
|
(w(!0), I(O, null, Q(s.value, (p) => {
|
|
1167
|
-
var
|
|
1167
|
+
var g, _, c;
|
|
1168
1168
|
return w(), I("div", {
|
|
1169
1169
|
key: p.id
|
|
1170
1170
|
}, [
|
|
1171
1171
|
T(i(W), {
|
|
1172
|
-
render: (_ = (
|
|
1172
|
+
render: (_ = (g = p.column) == null ? void 0 : g.columnDef) == null ? void 0 : _.cell,
|
|
1173
1173
|
props: (c = p.getContext) == null ? void 0 : c.call(p)
|
|
1174
1174
|
}, null, 8, ["render", "props"])
|
|
1175
1175
|
]);
|
|
@@ -1190,15 +1190,15 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1190
1190
|
modelValue: {},
|
|
1191
1191
|
disabled: { type: Boolean }
|
|
1192
1192
|
},
|
|
1193
|
-
setup(l, { expose:
|
|
1194
|
-
const
|
|
1195
|
-
promptSelectLocations:
|
|
1193
|
+
setup(l, { expose: n }) {
|
|
1194
|
+
const o = l, s = st(), { t: e } = Y(), t = de(), {
|
|
1195
|
+
promptSelectLocations: v,
|
|
1196
1196
|
columnDefs: h,
|
|
1197
1197
|
rowData: f,
|
|
1198
1198
|
hasCustomTag: a,
|
|
1199
1199
|
locationTagModel: u,
|
|
1200
1200
|
locationTagAutocomplete: p,
|
|
1201
|
-
pushLocationTag:
|
|
1201
|
+
pushLocationTag: g,
|
|
1202
1202
|
removeLocationTag: _,
|
|
1203
1203
|
locationTagError: c
|
|
1204
1204
|
} = lt({
|
|
@@ -1215,7 +1215,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1215
1215
|
s.locationTags = d;
|
|
1216
1216
|
}
|
|
1217
1217
|
}), r = R(), y = R("");
|
|
1218
|
-
|
|
1218
|
+
n({
|
|
1219
1219
|
validateInputs: () => {
|
|
1220
1220
|
var d, k;
|
|
1221
1221
|
(k = (d = r.value) == null ? void 0 : d.validateInputs) == null || k.call(d);
|
|
@@ -1240,9 +1240,9 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1240
1240
|
return s.items;
|
|
1241
1241
|
},
|
|
1242
1242
|
get disabled() {
|
|
1243
|
-
return
|
|
1243
|
+
return o.disabled;
|
|
1244
1244
|
}
|
|
1245
|
-
}), m = U(() => $.columnDefs.value), { promptSelectIngredients: D } =
|
|
1245
|
+
}), m = U(() => $.columnDefs.value), { promptSelectIngredients: D } = gt();
|
|
1246
1246
|
async function x() {
|
|
1247
1247
|
const k = t.skus.map((S) => ({
|
|
1248
1248
|
label: S.name,
|
|
@@ -1297,14 +1297,14 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1297
1297
|
"prepend-icon": "add",
|
|
1298
1298
|
variant: "plain",
|
|
1299
1299
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
1300
|
-
onClick: i(
|
|
1300
|
+
onClick: i(v)
|
|
1301
1301
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1302
1302
|
]),
|
|
1303
1303
|
T(S, {
|
|
1304
1304
|
"column-defs": i(h),
|
|
1305
1305
|
"row-data": i(f),
|
|
1306
1306
|
"shrink-at": 9999,
|
|
1307
|
-
onRowClick: i(
|
|
1307
|
+
onRowClick: i(v),
|
|
1308
1308
|
"hide-footer": ""
|
|
1309
1309
|
}, null, 8, ["column-defs", "row-data", "onRowClick"]),
|
|
1310
1310
|
i(a) ? (w(), N(rt, {
|
|
@@ -1312,7 +1312,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1312
1312
|
label: "Location tag",
|
|
1313
1313
|
modelValue: i(u),
|
|
1314
1314
|
"onUpdate:modelValue": k[2] || (k[2] = (F) => Pe(u) ? u.value = F : null),
|
|
1315
|
-
"onClick:menuItem": i(
|
|
1315
|
+
"onClick:menuItem": i(g),
|
|
1316
1316
|
options: i(p),
|
|
1317
1317
|
placeholder: "Search location tag"
|
|
1318
1318
|
}, ie({
|
|
@@ -1339,7 +1339,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1339
1339
|
variant: "tertiary",
|
|
1340
1340
|
label: "Add",
|
|
1341
1341
|
icon: "add",
|
|
1342
|
-
onClick: i(
|
|
1342
|
+
onClick: i(g)
|
|
1343
1343
|
}, null, 8, ["onClick"])
|
|
1344
1344
|
])
|
|
1345
1345
|
]),
|
|
@@ -1419,9 +1419,9 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1419
1419
|
show: { type: Boolean }
|
|
1420
1420
|
},
|
|
1421
1421
|
emits: ["update:show", "submitted"],
|
|
1422
|
-
setup(l, { expose:
|
|
1422
|
+
setup(l, { expose: n, emit: o }) {
|
|
1423
1423
|
var D;
|
|
1424
|
-
const s = l, e =
|
|
1424
|
+
const s = l, e = o, t = le(), v = se(), { t: h } = Y(), f = ft(s, "show");
|
|
1425
1425
|
function a() {
|
|
1426
1426
|
return {
|
|
1427
1427
|
_id: "",
|
|
@@ -1437,7 +1437,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1437
1437
|
x && (u.value = s.modelValue ?? a(), p.value = ((d = s.modelValue) == null ? void 0 : d._id) ?? `${Math.random()}`);
|
|
1438
1438
|
}
|
|
1439
1439
|
);
|
|
1440
|
-
const
|
|
1440
|
+
const g = R(!1), _ = U(() => {
|
|
1441
1441
|
switch (s.mode) {
|
|
1442
1442
|
case K.READ:
|
|
1443
1443
|
return "";
|
|
@@ -1448,7 +1448,7 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1448
1448
|
}
|
|
1449
1449
|
return "";
|
|
1450
1450
|
}), c = R();
|
|
1451
|
-
|
|
1451
|
+
n({
|
|
1452
1452
|
validateInputs: () => {
|
|
1453
1453
|
var x, d;
|
|
1454
1454
|
(d = (x = c.value) == null ? void 0 : x.validateInputs) == null || d.call(x);
|
|
@@ -1465,45 +1465,45 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1465
1465
|
async function r() {
|
|
1466
1466
|
const x = u.value;
|
|
1467
1467
|
if (x) {
|
|
1468
|
-
|
|
1468
|
+
g.value = !0;
|
|
1469
1469
|
try {
|
|
1470
|
-
await t.createTemplate(x), await new Promise((d) => setTimeout(d, 1e3)),
|
|
1470
|
+
await t.createTemplate(x), await new Promise((d) => setTimeout(d, 1e3)), v.open({
|
|
1471
1471
|
title: h("inventory.closing.template.create.success"),
|
|
1472
1472
|
message: h("inventory.closing.template.create.successMessage"),
|
|
1473
1473
|
type: "success"
|
|
1474
1474
|
}), e("update:show", !1), e("submitted");
|
|
1475
1475
|
} catch (d) {
|
|
1476
|
-
|
|
1476
|
+
v.open({
|
|
1477
1477
|
title: h("inventory.closing.template.create.error"),
|
|
1478
1478
|
message: h("inventory.closing.template.create.errorMessage"),
|
|
1479
1479
|
type: "error"
|
|
1480
1480
|
}), console.error("Error in creating closing template", d);
|
|
1481
1481
|
} finally {
|
|
1482
|
-
|
|
1482
|
+
g.value = !1;
|
|
1483
1483
|
}
|
|
1484
1484
|
}
|
|
1485
1485
|
}
|
|
1486
1486
|
async function y() {
|
|
1487
1487
|
const x = u.value;
|
|
1488
1488
|
if (x) {
|
|
1489
|
-
|
|
1489
|
+
g.value = !0;
|
|
1490
1490
|
try {
|
|
1491
1491
|
await t.updateTemplate({
|
|
1492
1492
|
...x,
|
|
1493
1493
|
_rev: x._rev ?? ""
|
|
1494
|
-
}), await new Promise((d) => setTimeout(d, 1e3)),
|
|
1494
|
+
}), await new Promise((d) => setTimeout(d, 1e3)), v.open({
|
|
1495
1495
|
title: h("inventory.closing.template.update.success"),
|
|
1496
1496
|
message: h("inventory.closing.template.update.successMessage"),
|
|
1497
1497
|
type: "success"
|
|
1498
1498
|
}), e("update:show", !1), e("submitted");
|
|
1499
1499
|
} catch (d) {
|
|
1500
|
-
|
|
1500
|
+
v.open({
|
|
1501
1501
|
title: h("inventory.closing.template.update.error"),
|
|
1502
1502
|
message: h("inventory.closing.template.update.errorMessage"),
|
|
1503
1503
|
type: "error"
|
|
1504
1504
|
}), console.error("Error in updating closing template", d);
|
|
1505
1505
|
} finally {
|
|
1506
|
-
|
|
1506
|
+
g.value = !1;
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
1509
|
}
|
|
@@ -1541,19 +1541,19 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1541
1541
|
onValidationSuccess: $,
|
|
1542
1542
|
"model-value": u.value,
|
|
1543
1543
|
"onUpdate:modelValue": d[0] || (d[0] = (M) => u.value = M),
|
|
1544
|
-
disabled:
|
|
1544
|
+
disabled: g.value,
|
|
1545
1545
|
key: p.value
|
|
1546
1546
|
}, null, 8, ["model-value", "disabled"]))
|
|
1547
1547
|
]),
|
|
1548
1548
|
"side-sheet-footer": P(() => [
|
|
1549
1549
|
b("div", dn, [
|
|
1550
1550
|
T(k, {
|
|
1551
|
-
loading:
|
|
1551
|
+
loading: g.value,
|
|
1552
1552
|
label: i(h)("common.save"),
|
|
1553
1553
|
onClick: m
|
|
1554
1554
|
}, null, 8, ["loading", "label"]),
|
|
1555
1555
|
T(k, {
|
|
1556
|
-
disabled:
|
|
1556
|
+
disabled: g.value,
|
|
1557
1557
|
variant: "tertiary",
|
|
1558
1558
|
label: i(h)("common.close"),
|
|
1559
1559
|
onClick: d[1] || (d[1] = (M) => e("update:show", !1))
|
|
@@ -1565,10 +1565,10 @@ const jt = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, Yt =
|
|
|
1565
1565
|
};
|
|
1566
1566
|
}
|
|
1567
1567
|
}), fn = {};
|
|
1568
|
-
function
|
|
1568
|
+
function vn(l, n) {
|
|
1569
1569
|
return w(), I("div");
|
|
1570
1570
|
}
|
|
1571
|
-
const
|
|
1571
|
+
const gn = /* @__PURE__ */ ct(fn, [["render", vn]]), yn = { class: "flex flex-col gap-40" }, hn = { key: 0 }, bn = {
|
|
1572
1572
|
key: 1,
|
|
1573
1573
|
class: "flex gap-8 items-center"
|
|
1574
1574
|
}, _n = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, xn = {
|
|
@@ -1580,24 +1580,24 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1580
1580
|
}, kn = { class: "fm-typo-en-body-md-600" }, Tn = { class: "fm-typo-en-body-md-600" }, $n = { key: 4 }, Cn = { class: "fm-typo-en-body-md-600" }, In = { class: "fm-typo-en-body-md-600" }, Sn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Dn = /* @__PURE__ */ J({
|
|
1581
1581
|
__name: "ClosingTemplatePublish",
|
|
1582
1582
|
emits: ["close"],
|
|
1583
|
-
setup(l, { emit:
|
|
1584
|
-
const
|
|
1583
|
+
setup(l, { emit: n }) {
|
|
1584
|
+
const o = R(!1), s = se(), e = le(), t = ae(), { t: v } = Y(), h = n;
|
|
1585
1585
|
async function f() {
|
|
1586
|
-
|
|
1586
|
+
o.value = !0;
|
|
1587
1587
|
try {
|
|
1588
1588
|
await e.startNewPublish().delayed(1e3), s.open({
|
|
1589
1589
|
title: "Success",
|
|
1590
1590
|
message: "You may refresh after a while to review publish status",
|
|
1591
1591
|
type: "success"
|
|
1592
1592
|
}), p();
|
|
1593
|
-
} catch (
|
|
1593
|
+
} catch (g) {
|
|
1594
1594
|
s.open({
|
|
1595
1595
|
title: "Something went wrong",
|
|
1596
1596
|
message: "Please try again",
|
|
1597
1597
|
type: "error"
|
|
1598
|
-
}), console.error("error on creating publish task",
|
|
1598
|
+
}), console.error("error on creating publish task", g);
|
|
1599
1599
|
} finally {
|
|
1600
|
-
|
|
1600
|
+
o.value = !1;
|
|
1601
1601
|
}
|
|
1602
1602
|
}
|
|
1603
1603
|
const a = U(() => t.recentPublish.recentJob), u = U(
|
|
@@ -1606,10 +1606,10 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1606
1606
|
function p() {
|
|
1607
1607
|
h("close");
|
|
1608
1608
|
}
|
|
1609
|
-
return (
|
|
1609
|
+
return (g, _) => {
|
|
1610
1610
|
const c = E("FmCircularProgress"), r = E("i18n-t"), y = E("FmButton");
|
|
1611
1611
|
return w(), I("div", yn, [
|
|
1612
|
-
i(t).templates.length ?
|
|
1612
|
+
i(t).templates.length ? o.value ? (w(), I("div", bn, [
|
|
1613
1613
|
b("div", null, [
|
|
1614
1614
|
T(c, {
|
|
1615
1615
|
size: "md",
|
|
@@ -1617,7 +1617,7 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1617
1617
|
})
|
|
1618
1618
|
]),
|
|
1619
1619
|
b("div", _n, [
|
|
1620
|
-
b("span", null, C(i(
|
|
1620
|
+
b("span", null, C(i(v)("inventory.closing.template.publish.publishing")), 1)
|
|
1621
1621
|
])
|
|
1622
1622
|
])) : a.value ? a.value.outlets.length === a.value.completed.length ? (w(), I("div", wn, [
|
|
1623
1623
|
T(r, {
|
|
@@ -1632,7 +1632,7 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1632
1632
|
]),
|
|
1633
1633
|
_: 1
|
|
1634
1634
|
}),
|
|
1635
|
-
b("p", null, C(i(
|
|
1635
|
+
b("p", null, C(i(v)("inventory.closing.template.publish.message")), 1)
|
|
1636
1636
|
])) : (w(), I("div", $n, [
|
|
1637
1637
|
T(r, {
|
|
1638
1638
|
keypath: "inventory.closing.template.publish.stillPublishing",
|
|
@@ -1648,15 +1648,15 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1648
1648
|
}),
|
|
1649
1649
|
Fe(" Your recent publishing task is still pending (" + C(a.value.completed.length) + " / " + C(a.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
|
|
1650
1650
|
])) : (w(), I("div", xn, [
|
|
1651
|
-
b("p", null, C(i(
|
|
1652
|
-
b("p", null, C(i(
|
|
1651
|
+
b("p", null, C(i(v)("inventory.closing.template.publish.noRecentActivity")), 1),
|
|
1652
|
+
b("p", null, C(i(v)("inventory.closing.template.publish.message")), 1)
|
|
1653
1653
|
])) : (w(), I("div", hn, [
|
|
1654
|
-
b("p", null, C(i(
|
|
1654
|
+
b("p", null, C(i(v)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
1655
1655
|
])),
|
|
1656
1656
|
b("div", Sn, [
|
|
1657
1657
|
T(y, {
|
|
1658
1658
|
disabled: !u.value,
|
|
1659
|
-
loading:
|
|
1659
|
+
loading: o.value,
|
|
1660
1660
|
label: "Publish to all outlets",
|
|
1661
1661
|
onClick: f
|
|
1662
1662
|
}, null, 8, ["disabled", "loading"]),
|
|
@@ -1672,13 +1672,13 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1672
1672
|
}), Mn = { class: "flex-1 flex flex-col gap-8" }, Fn = { class: "flex flex-col" }, Rn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, An = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, En = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Hn = /* @__PURE__ */ J({
|
|
1673
1673
|
__name: "ClosingTemplateView",
|
|
1674
1674
|
setup(l) {
|
|
1675
|
-
const { t:
|
|
1675
|
+
const { t: n } = Y(), { createTemplate: o, updateTemplate: s, exportTemplates: e, importTemplates: t } = me(), { templateDialogProps: v, templateDetailsProps: h } = ze(me()), f = ue(), a = Be(), u = ae(), p = mt(), { breakpoints: g } = vt();
|
|
1676
1676
|
f.watchLocation(u.fetchTemplates);
|
|
1677
|
-
const _ = U(() => u.loading), c = R(""), r = U(() =>
|
|
1677
|
+
const _ = U(() => u.loading), c = R(""), r = U(() => g.value.xs || g.value.sm), y = U(() => r.value ? 10 : 20);
|
|
1678
1678
|
function $(d) {
|
|
1679
1679
|
switch (d) {
|
|
1680
1680
|
case j.Add:
|
|
1681
|
-
return
|
|
1681
|
+
return o();
|
|
1682
1682
|
case "publish":
|
|
1683
1683
|
return m();
|
|
1684
1684
|
case "import":
|
|
@@ -1705,13 +1705,13 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1705
1705
|
}
|
|
1706
1706
|
const x = U(() => r.value ? [
|
|
1707
1707
|
{
|
|
1708
|
-
label:
|
|
1708
|
+
label: n("inventory.closing.template.create.title"),
|
|
1709
1709
|
value: j.Add,
|
|
1710
1710
|
isPrimary: !0,
|
|
1711
1711
|
prependIcon: "add"
|
|
1712
1712
|
},
|
|
1713
1713
|
{
|
|
1714
|
-
label: "
|
|
1714
|
+
label: n("inventory.common.refresh"),
|
|
1715
1715
|
value: "refresh",
|
|
1716
1716
|
isPrimary: !1
|
|
1717
1717
|
},
|
|
@@ -1721,39 +1721,39 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1721
1721
|
isPrimary: !1
|
|
1722
1722
|
},
|
|
1723
1723
|
{
|
|
1724
|
-
label: "
|
|
1724
|
+
label: n("inventory.common.import"),
|
|
1725
1725
|
value: "import",
|
|
1726
1726
|
isPrimary: !1
|
|
1727
1727
|
},
|
|
1728
1728
|
{
|
|
1729
|
-
label: "
|
|
1729
|
+
label: n("inventory.common.export"),
|
|
1730
1730
|
value: "export",
|
|
1731
1731
|
isPrimary: !1
|
|
1732
1732
|
}
|
|
1733
1733
|
] : [
|
|
1734
1734
|
{
|
|
1735
|
-
label:
|
|
1735
|
+
label: n("inventory.closing.template.create.title"),
|
|
1736
1736
|
value: j.Add,
|
|
1737
1737
|
isPrimary: !0,
|
|
1738
1738
|
prependIcon: "add"
|
|
1739
1739
|
},
|
|
1740
1740
|
{
|
|
1741
|
-
label: "
|
|
1741
|
+
label: n("inventory.common.publish"),
|
|
1742
1742
|
value: "publish",
|
|
1743
1743
|
isPrimary: !1
|
|
1744
1744
|
},
|
|
1745
1745
|
{
|
|
1746
|
-
label: "
|
|
1746
|
+
label: n("inventory.common.import"),
|
|
1747
1747
|
value: "import",
|
|
1748
1748
|
isPrimary: !1
|
|
1749
1749
|
},
|
|
1750
1750
|
{
|
|
1751
|
-
label: "
|
|
1751
|
+
label: n("inventory.common.refresh"),
|
|
1752
1752
|
value: "refresh",
|
|
1753
1753
|
isPrimary: !1
|
|
1754
1754
|
},
|
|
1755
1755
|
{
|
|
1756
|
-
label: "
|
|
1756
|
+
label: n("inventory.common.export"),
|
|
1757
1757
|
value: "export",
|
|
1758
1758
|
isPrimary: !1
|
|
1759
1759
|
}
|
|
@@ -1762,7 +1762,7 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1762
1762
|
const B = E("FmTable");
|
|
1763
1763
|
return w(), I(O, null, [
|
|
1764
1764
|
T(ut, {
|
|
1765
|
-
title: i(
|
|
1765
|
+
title: i(n)("inventory.closing.template.title"),
|
|
1766
1766
|
actions: x.value,
|
|
1767
1767
|
"onClick:action": $
|
|
1768
1768
|
}, {
|
|
@@ -1796,7 +1796,7 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1796
1796
|
onRowClick: (S) => i(s)(S)
|
|
1797
1797
|
}, {
|
|
1798
1798
|
default: P((S) => {
|
|
1799
|
-
var V, L, Z, z, F, H,
|
|
1799
|
+
var V, L, Z, z, F, H, ve, ge, te, ye, he, be, _e, xe, we, ne, ke, Te, $e, Ce, oe, Ie;
|
|
1800
1800
|
return [
|
|
1801
1801
|
b("div", Mn, [
|
|
1802
1802
|
b("div", Fn, [
|
|
@@ -1808,13 +1808,13 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1808
1808
|
]),
|
|
1809
1809
|
b("div", Pn, [
|
|
1810
1810
|
T(i(W), {
|
|
1811
|
-
render: (
|
|
1811
|
+
render: (ge = (ve = (H = S.name) == null ? void 0 : H.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ge.cell,
|
|
1812
1812
|
props: (ye = (te = S.name) == null ? void 0 : te.getContext) == null ? void 0 : ye.call(te)
|
|
1813
1813
|
}, null, 8, ["render", "props"])
|
|
1814
1814
|
]),
|
|
1815
|
-
b("div", null, C((he = M.original.locations) != null && he.length ? i(
|
|
1815
|
+
b("div", null, C((he = M.original.locations) != null && he.length ? i(n)("inventory.closing.table.enabledForN", {
|
|
1816
1816
|
count: ((be = M.original.locations) == null ? void 0 : be.length) ?? 0
|
|
1817
|
-
}) : i(
|
|
1817
|
+
}) : i(n)("inventory.closing.table.enabledForAll")), 1),
|
|
1818
1818
|
b("div", An, C([
|
|
1819
1819
|
...M.original.items.slice(0, 3).map((Oe) => Oe.sku.name),
|
|
1820
1820
|
...M.original.items.length >= 3 ? [`and ${M.original.items.length - 3} more items`] : []
|
|
@@ -1845,8 +1845,8 @@ const vn = /* @__PURE__ */ ct(fn, [["render", gn]]), yn = { class: "flex flex-co
|
|
|
1845
1845
|
_: 1
|
|
1846
1846
|
}, 8, ["title", "actions"]),
|
|
1847
1847
|
(w(), N(Ge, { to: "body" }, [
|
|
1848
|
-
T(
|
|
1849
|
-
T(pn, We(i(
|
|
1848
|
+
T(gn, Ke(Je(i(h))), null, 16),
|
|
1849
|
+
T(pn, We(i(v), {
|
|
1850
1850
|
onSubmitted: k[2] || (k[2] = (M) => i(u).fetchTemplates())
|
|
1851
1851
|
}), null, 16)
|
|
1852
1852
|
]))
|