@feedmepos/mf-inventory-portal 0.0.23-dev.30 → 0.0.23-dev.4
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-Brc7GX7l.js → App-DReDvY0M.js} +73 -85
- package/dist/{ApprovalView-CMRd7pcC.js → ApprovalView-BMZlYmRk.js} +27 -24
- package/dist/{BindingsDialog-DoakDtFI.js → BindingsDialog-Y2K4I7H7.js} +4 -4
- package/dist/{BindingsPicker-BC3rjqKw.js → BindingsPicker-DKBq9c37.js} +9 -8
- package/dist/{BindingsTable-xKRvhEV5.js → BindingsTable-45v4SDfp.js} +22 -18
- package/dist/{ClosingTemplateView-DFxLuV8k.js → ClosingTemplateView-CKJVYSbj.js} +286 -272
- package/dist/FmDroppableField-8RzKjEdL.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DjGGEGQ9.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CMEOp-0r.js} +23 -22
- package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BhdcqRh-.js +436 -0
- package/dist/FmMultiselectDialog-D7YtdoyJ.js +415 -0
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DNEwc797.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C1DjyjyH.js} +49 -48
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DlM-xGKh.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-zjvFEF5C.js} +5 -5
- package/dist/{IngredientGroupView-C4bL0O5L.js → IngredientGroupView-BuP-HGeg.js} +69 -63
- package/dist/IngredientsView-DMRN-odY.js +1613 -0
- package/dist/{IntegrationView-aSAeFNtp.js → IntegrationView-kYCaKG0o.js} +95 -92
- package/dist/{InventoryBindingForm-C7rIUyV1.js → InventoryBindingForm-BXHq4h-n.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ba6WLcom.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CVxJ_bV3.js} +27 -25
- package/dist/{InventoryBindingSummary-Ix92wSE6.js → InventoryBindingSummary-Bjasfc_v.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-6BUIvm7C.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Cd6LQ6Yz.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C3O3JebE.js} +24 -23
- package/dist/{PurchaseOrderPrintPreview-DJSF8YaR.js → PurchaseOrderPrintPreview-CmjkfTTS.js} +14 -13
- package/dist/{ReceiveRequestView-BUyShiP2.js → ReceiveRequestView-aQZJO8sq.js} +1302 -1325
- package/dist/{RecipeView-c0XB2_P8.js → RecipeView-DXO43tFi.js} +85 -79
- package/dist/{StockView-DNPNymCW.js → StockView-D9no-mrA.js} +1446 -1338
- package/dist/{SupplierView-Cz0hgito.js → SupplierView-DAx7E7sR.js} +787 -2325
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DCA0RUfu.js +1209 -0
- package/dist/TransferTemplateView-CfxdQF1t.js +1261 -0
- package/dist/{UnitView-BKWbaZfc.js → UnitView-CQPGZ8-r.js} +44 -40
- package/dist/{WarehouseView-BgE3teyT.js → WarehouseView-jy-RNCgy.js} +100 -94
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/api/closing.d.ts +0 -1
- package/dist/api/netsuite.d.ts +1 -1
- package/dist/app-KnSMkJBV.js +33496 -0
- package/dist/app.d.ts +0 -56
- package/dist/app.js +2 -2
- package/dist/components/FmMultiselectDialogProps.d.ts +0 -1
- package/dist/components/row-action.enum.d.ts +0 -1
- package/dist/composable/defineDeepModel.d.ts +1 -1
- package/dist/date2-CIeUqUIc.js +117 -0
- package/dist/dayjs.min-Df5jSnDJ.js +282 -0
- package/dist/{decimal-CZ3lFF__.js → decimal-BAc9M88Q.js} +1 -1
- package/dist/defineDeepModel-BfuQAIoM.js +13 -0
- package/dist/{feature-By_PNrnn.js → feature-dwB4OxRQ.js} +6 -12
- package/dist/format-time-from-id-BbvzyIN6.js +15 -0
- package/dist/{format-unit-display-ZlJT10zr.js → format-unit-display-BBWblJEt.js} +171 -162
- package/dist/fuzzy-B9ryZ9VZ.js +41 -0
- package/dist/index-BN0CY3sZ.js +22277 -0
- package/dist/index-Bj1fJum-.js +45 -0
- package/dist/index-C4yL_7rR.js +10545 -0
- package/dist/netsuite-ByWOS6tI.js +194 -0
- package/dist/normalizeArguments-DP7Hrren.js +1552 -0
- package/dist/router/name.d.ts +0 -2
- package/dist/row-action.enum-PMKMRrZR.js +50 -0
- package/dist/rules-C12nWDD1.js +198 -0
- package/dist/stores/feature.d.ts +0 -1
- package/dist/stores/integration/netsuite.d.ts +1 -69
- package/dist/stores/inventory.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-eaFF1izE.js → supplier-DJC0UZWv.js} +15 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-14JW4t6q.js → use-inventory-binding-dialog-PEQbFRvO.js} +11 -10
- package/dist/use-template-enabled-locations-2-k9g5t8tt.js +86 -0
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +192 -24
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +193 -25
- package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
- package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
- package/dist/xlsx-B4XHad7S.js +24004 -0
- package/dist/xlsx.util-BSO4SHJi.js +78 -0
- package/package.json +3 -3
- package/dist/ClosingDraftView-DlaVbAHy.js +0 -1190
- package/dist/IngredientsView-CfS8FgxA.js +0 -1657
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-ySR4KngR.js +0 -1227
- package/dist/TransferTemplateView-B7kzPdfT.js +0 -1264
- package/dist/api/adjustment-template.d.ts +0 -23
- package/dist/api/closing-draft.d.ts +0 -6
- package/dist/app-Bkg0JUKr.js +0 -84182
- package/dist/index-B4nO9Djl.js +0 -12087
- package/dist/stock-DNajb8lV.js +0 -125
- package/dist/views/adjustment-template/import/AdjustmentTemplateImport.vue.d.ts +0 -2
- package/dist/views/adjustment-template/import/AdjustmentTemplateImportItem.vue.d.ts +0 -18
- package/dist/views/adjustment-template/import/export.d.ts +0 -60
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDetails.vue.d.ts +0 -2
- package/dist/views/adjustment-template/wastage-template/WastageTemplateDialog.vue.d.ts +0 -22
- package/dist/views/adjustment-template/wastage-template/WastageTemplatePublish.vue.d.ts +0 -6
- package/dist/views/adjustment-template/wastage-template/WastageTemplateView.vue.d.ts +0 -2
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +0 -1295
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateForm.vue.d.ts +0 -16
- package/dist/views/adjustment-template/wastage-template/form/WastageTemplateItemTable.vue.d.ts +0 -35
- package/dist/views/adjustment-template/wastage-template/form/useAdjustmentTemplateItems.d.ts +0 -20
- package/dist/views/adjustment-template/wastage-template/props.d.ts +0 -29
- package/dist/views/adjustment-template/wastage-template/table.d.ts +0 -1273
- package/dist/views/closing-draft/ClosingDraftView.vue.d.ts +0 -2
- package/dist/views/closing-draft/components/closing-draft-action/ClosingDraftAction.vue.d.ts +0 -22
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -621
- package/dist/views/closing-draft/composables/use-closing-draft-actions.d.ts +0 -25
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -3621
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +0 -1
- package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +0 -19
- package/dist/views/closing-draft/helpers/get-calculated-total.helper.d.ts +0 -4
|
@@ -1,12 +1,25 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
import {
|
|
3
|
-
import { useCoreStore as
|
|
4
|
-
import { useDialogChild as
|
|
5
|
-
import { defineStore as
|
|
6
|
-
|
|
1
|
+
import { ref as M, h as F, defineComponent as j, resolveComponent as R, openBlock as k, createElementBlock as I, createElementVNode as _, normalizeClass as Y, createTextVNode as Fe, toDisplayString as C, unref as v, createCommentVNode as G, createVNode as T, withCtx as P, Fragment as H, renderList as J, computed as E, watch as Re, createSlots as Pe, createBlock as V, isRef as Oe, normalizeStyle as Ye, Teleport as Ke, normalizeProps as Ge, guardReactiveProps as Je, mergeProps as We } from "vue";
|
|
2
|
+
import { u as qe, _ as Qe, a as Xe } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BhdcqRh-.js";
|
|
3
|
+
import { useCoreStore as le, useI18n as B } from "@feedmepos/mf-common";
|
|
4
|
+
import { useDialogChild as Ze, useSnackbar as Z, useDialog as ae, FmButtonVariant as Se, components as L, useProxiedModel as et, useBreakpoints as tt } from "@feedmepos/ui-library";
|
|
5
|
+
import { defineStore as Ae, storeToRefs as Ee } from "pinia";
|
|
6
|
+
import { D as Me, R as N, F as z } from "./row-action.enum-PMKMRrZR.js";
|
|
7
|
+
import { j as nt, u as re, c as Ue, a as ie, i as ot } from "./app-KnSMkJBV.js";
|
|
8
|
+
import { a as oe, b as Ve, d as Ne, s as Be, r as st } from "./xlsx.util-BSO4SHJi.js";
|
|
9
|
+
import { F as lt } from "./FmDroppableField-8RzKjEdL.js";
|
|
10
|
+
import { f as at, d as ne } from "./date2-CIeUqUIc.js";
|
|
11
|
+
import { c as rt, F as O, _ as Le } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
12
|
+
import { f as it } from "./format-time-from-id-BbvzyIN6.js";
|
|
13
|
+
import { u as ct } from "./netsuite-ByWOS6tI.js";
|
|
14
|
+
import { R as mt, A as ut } from "./rules-C12nWDD1.js";
|
|
15
|
+
import { F as dt } from "./FmMultiselectDialog-D7YtdoyJ.js";
|
|
16
|
+
import { d as pt } from "./defineDeepModel-BfuQAIoM.js";
|
|
17
|
+
import { u as ft } from "./use-template-enabled-locations-2-k9g5t8tt.js";
|
|
18
|
+
import { _ as vt } from "./_plugin-vue_export-helper-CHgC5LLL.js";
|
|
19
|
+
const ee = nt((r, s) => {
|
|
7
20
|
function o() {
|
|
8
21
|
var t;
|
|
9
|
-
return `business_${((t =
|
|
22
|
+
return `business_${((t = le().currentBusiness.value) == null ? void 0 : t._id) ?? ""}`;
|
|
10
23
|
}
|
|
11
24
|
return {
|
|
12
25
|
async getRecentPublishingJob() {
|
|
@@ -42,32 +55,32 @@ const ee = qe((r, s) => {
|
|
|
42
55
|
return s.post(t, l);
|
|
43
56
|
}
|
|
44
57
|
};
|
|
45
|
-
}), te =
|
|
46
|
-
"
|
|
58
|
+
}), te = Ae(
|
|
59
|
+
"closingTable",
|
|
47
60
|
function() {
|
|
48
|
-
const { t: s } = B(), o = se(), l =
|
|
49
|
-
async function
|
|
50
|
-
if (e.value = [], !!
|
|
61
|
+
const { t: s } = B(), o = se(), l = M({}), e = M(new Array()), t = M(!1), y = re(), p = ee();
|
|
62
|
+
async function f() {
|
|
63
|
+
if (e.value = [], !!y._currentLocation) {
|
|
51
64
|
t.value = !0;
|
|
52
65
|
try {
|
|
53
|
-
const [
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
const [g, h] = await Promise.all([
|
|
67
|
+
p.readTemplates(),
|
|
68
|
+
p.getRecentPublishingJob()
|
|
56
69
|
]).delayed(1e3);
|
|
57
|
-
e.value =
|
|
58
|
-
} catch (
|
|
59
|
-
console.log("Something went wrong when fetching templates:",
|
|
70
|
+
e.value = g, l.value = h;
|
|
71
|
+
} catch (g) {
|
|
72
|
+
console.log("Something went wrong when fetching templates:", g);
|
|
60
73
|
} finally {
|
|
61
74
|
t.value = !1;
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
77
|
}
|
|
65
|
-
async function i(
|
|
66
|
-
if (!e.value.find((h) => h._id) &&
|
|
78
|
+
async function i(g) {
|
|
79
|
+
if (!e.value.find((h) => h._id) && y._currentLocation) {
|
|
67
80
|
t.value = !0;
|
|
68
81
|
try {
|
|
69
82
|
const [h] = await Promise.all([
|
|
70
|
-
|
|
83
|
+
p.getTemplate(g),
|
|
71
84
|
new Promise((u) => setTimeout(u, 1e3))
|
|
72
85
|
]);
|
|
73
86
|
e.value = [h];
|
|
@@ -78,14 +91,14 @@ const ee = qe((r, s) => {
|
|
|
78
91
|
}
|
|
79
92
|
}
|
|
80
93
|
}
|
|
81
|
-
function d(
|
|
82
|
-
switch (h =
|
|
94
|
+
function d(g, h) {
|
|
95
|
+
switch (h = Ue(h), g) {
|
|
83
96
|
case N.Details:
|
|
84
97
|
return o.viewTemplate(h);
|
|
85
98
|
case N.Edit:
|
|
86
99
|
return o.updateTemplate(h);
|
|
87
100
|
case N.Delete:
|
|
88
|
-
return o.deleteTemplate(h, t,
|
|
101
|
+
return o.deleteTemplate(h, t, f);
|
|
89
102
|
}
|
|
90
103
|
}
|
|
91
104
|
return {
|
|
@@ -94,8 +107,8 @@ const ee = qe((r, s) => {
|
|
|
94
107
|
id: "_id",
|
|
95
108
|
accessorKey: "_id",
|
|
96
109
|
header: () => s("inventory.closing.table.createdAt"),
|
|
97
|
-
cell(
|
|
98
|
-
return
|
|
110
|
+
cell(g) {
|
|
111
|
+
return it(`${g.getValue()}`);
|
|
99
112
|
},
|
|
100
113
|
enableSorting: !0
|
|
101
114
|
},
|
|
@@ -120,9 +133,9 @@ const ee = qe((r, s) => {
|
|
|
120
133
|
id: "enabledLocations",
|
|
121
134
|
accessorKey: "locations.length",
|
|
122
135
|
header: () => s("inventory.closing.table.enabledOutlets"),
|
|
123
|
-
cell(
|
|
136
|
+
cell(g) {
|
|
124
137
|
var u;
|
|
125
|
-
const h = (u =
|
|
138
|
+
const h = (u = g.row.original.locations) == null ? void 0 : u.length;
|
|
126
139
|
return h ? `${h}` : "All";
|
|
127
140
|
},
|
|
128
141
|
enableSorting: !1,
|
|
@@ -142,9 +155,9 @@ const ee = qe((r, s) => {
|
|
|
142
155
|
id: "status",
|
|
143
156
|
header: () => s("inventory.closing.table.status"),
|
|
144
157
|
enableSorting: !1,
|
|
145
|
-
cell(
|
|
158
|
+
cell(g) {
|
|
146
159
|
var x;
|
|
147
|
-
const h =
|
|
160
|
+
const h = g.row.original, u = h._rev, n = (x = l.value.publishedRevs) == null ? void 0 : x[h._id], a = u === n;
|
|
148
161
|
return F(
|
|
149
162
|
"div",
|
|
150
163
|
{
|
|
@@ -165,12 +178,12 @@ const ee = qe((r, s) => {
|
|
|
165
178
|
},
|
|
166
179
|
{
|
|
167
180
|
id: "action",
|
|
168
|
-
cell(
|
|
169
|
-
const h =
|
|
170
|
-
|
|
171
|
-
|
|
181
|
+
cell(g) {
|
|
182
|
+
const h = g.row.original, u = [
|
|
183
|
+
Me[N.Edit],
|
|
184
|
+
Me[N.Delete]
|
|
172
185
|
];
|
|
173
|
-
return
|
|
186
|
+
return rt(u, (n) => d(n, h));
|
|
174
187
|
},
|
|
175
188
|
enableSorting: !1,
|
|
176
189
|
size: 40,
|
|
@@ -183,7 +196,7 @@ const ee = qe((r, s) => {
|
|
|
183
196
|
recentPublish: l,
|
|
184
197
|
templates: e,
|
|
185
198
|
loading: t,
|
|
186
|
-
fetchTemplates:
|
|
199
|
+
fetchTemplates: f,
|
|
187
200
|
loadTemplate: i
|
|
188
201
|
};
|
|
189
202
|
}
|
|
@@ -225,40 +238,40 @@ function He() {
|
|
|
225
238
|
];
|
|
226
239
|
}
|
|
227
240
|
function gt(r) {
|
|
228
|
-
var
|
|
229
|
-
const o =
|
|
241
|
+
var p;
|
|
242
|
+
const o = le().currentBusiness.value, e = (p = r.map((f) => {
|
|
230
243
|
var u;
|
|
231
|
-
const i =
|
|
232
|
-
["Template ID",
|
|
233
|
-
["Template name",
|
|
244
|
+
const i = f.items.flatMap(ze), d = He(), m = [
|
|
245
|
+
["Template ID", f._id],
|
|
246
|
+
["Template name", f.name],
|
|
234
247
|
["Business name", o == null ? void 0 : o.name],
|
|
235
248
|
["Business ID", o == null ? void 0 : o._id],
|
|
236
249
|
["Menu version", o == null ? void 0 : o.menuVersion],
|
|
237
250
|
[
|
|
238
251
|
"Locations",
|
|
239
|
-
...(u =
|
|
252
|
+
...(u = f.locations) != null && u.length ? [f.locations.map((n) => `${n.name} (${n.dbName})`)] : ["All"]
|
|
240
253
|
],
|
|
241
|
-
["Reference",
|
|
254
|
+
["Reference", f.ref ?? ""],
|
|
242
255
|
[],
|
|
243
256
|
d.map((n) => n.name),
|
|
244
257
|
...i.map((n) => d.map((a) => n[a.id]))
|
|
245
|
-
],
|
|
246
|
-
return { name:
|
|
258
|
+
], g = d.map((n) => `system:${n.id}`), h = oe(m, g);
|
|
259
|
+
return { name: f.name, sheet: h };
|
|
247
260
|
}).reduce(
|
|
248
|
-
(
|
|
261
|
+
(f, i) => {
|
|
249
262
|
var m;
|
|
250
263
|
const d = i.name.slice(0, 12);
|
|
251
|
-
return (m =
|
|
264
|
+
return (m = f.sheetOccurence)[d] ?? (m[d] = 0), f.sheetOccurence[d] += 1, f.sheets[`${d} (${f.sheetOccurence[d]})`] = i.sheet, f;
|
|
252
265
|
},
|
|
253
266
|
{
|
|
254
267
|
sheets: {},
|
|
255
268
|
sheetOccurence: {}
|
|
256
269
|
}
|
|
257
|
-
)) == null ? void 0 :
|
|
258
|
-
return
|
|
270
|
+
)) == null ? void 0 : p.sheets, t = `${o == null ? void 0 : o.name} closing templates (${at(/* @__PURE__ */ new Date())}).xlsx`, y = Ve(e);
|
|
271
|
+
return Ne(y, t), t;
|
|
259
272
|
}
|
|
260
273
|
function yt() {
|
|
261
|
-
const r =
|
|
274
|
+
const r = le(), s = ie(), o = ct(), l = ze({
|
|
262
275
|
sku: {
|
|
263
276
|
unit: {
|
|
264
277
|
_id: "",
|
|
@@ -271,7 +284,7 @@ function yt() {
|
|
|
271
284
|
_id: "",
|
|
272
285
|
name: "Sugar"
|
|
273
286
|
}
|
|
274
|
-
})[0], e = r.currentBusiness.value, t = He(),
|
|
287
|
+
})[0], e = r.currentBusiness.value, t = He(), y = [
|
|
275
288
|
["Template ID (leave empty to create new)", ""],
|
|
276
289
|
["Template Name", "New template"],
|
|
277
290
|
["Business name", e == null ? void 0 : e.name],
|
|
@@ -286,7 +299,7 @@ function yt() {
|
|
|
286
299
|
[],
|
|
287
300
|
t.map((u) => u.name),
|
|
288
301
|
t.map((u) => l[u.id])
|
|
289
|
-
],
|
|
302
|
+
], p = t.map((u) => `system:${u.id}`), f = oe(y, p), i = o.isEnabled ? o.state.setting.childItems ?? [] : [], d = i.reduce(
|
|
290
303
|
(u, n) => {
|
|
291
304
|
var b, w;
|
|
292
305
|
const a = (b = o.netSuiteItemIdToSkuId.get(n.parentNetSuiteId)) == null ? void 0 : b[0], x = (w = o.netSuiteMeasurementIdToMeasurementId.get(
|
|
@@ -332,29 +345,29 @@ function yt() {
|
|
|
332
345
|
"Enabled (true/false)",
|
|
333
346
|
...i.length ? ["Netsuite Parent"] : []
|
|
334
347
|
]
|
|
335
|
-
),
|
|
336
|
-
Template:
|
|
348
|
+
), g = Ve({
|
|
349
|
+
Template: f,
|
|
337
350
|
Ingredients: m
|
|
338
351
|
}), h = `${e == null ? void 0 : e.name} transfer templates import.xlsx`;
|
|
339
|
-
return
|
|
352
|
+
return Ne(g, h), h;
|
|
340
353
|
}
|
|
341
354
|
function ht(r) {
|
|
342
355
|
if (!r.length || `${r[0]}`.toLocaleLowerCase() === "all")
|
|
343
356
|
return [];
|
|
344
|
-
const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l =
|
|
357
|
+
const s = /(.*) \(((warehouse_|restaurant_).{24,})\)/, l = re().locationByDbName;
|
|
345
358
|
return r.map((e) => {
|
|
346
|
-
const t = new Array(),
|
|
347
|
-
if (!
|
|
348
|
-
return t.push(`Enabled location value of ${
|
|
359
|
+
const t = new Array(), y = e.trim(), p = s.exec(y);
|
|
360
|
+
if (!p)
|
|
361
|
+
return t.push(`Enabled location value of ${y} cannot be read.`), {
|
|
349
362
|
errors: t
|
|
350
363
|
};
|
|
351
|
-
const
|
|
352
|
-
return d ? (
|
|
353
|
-
`Location id ${i} has non-matching name. Found ${
|
|
364
|
+
const f = p[1], i = p[2], d = l[i];
|
|
365
|
+
return d ? (f !== d.name && t.push(
|
|
366
|
+
`Location id ${i} has non-matching name. Found ${f} but expected ${d.name}`
|
|
354
367
|
), {
|
|
355
368
|
errors: t,
|
|
356
369
|
location: d
|
|
357
|
-
}) : (t.push(`Location (${
|
|
370
|
+
}) : (t.push(`Location (${f}) of id ${i} is not found.`), {
|
|
358
371
|
errors: t
|
|
359
372
|
});
|
|
360
373
|
});
|
|
@@ -366,15 +379,15 @@ function bt(r) {
|
|
|
366
379
|
l,
|
|
367
380
|
e,
|
|
368
381
|
t,
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
] =
|
|
382
|
+
y,
|
|
383
|
+
p,
|
|
384
|
+
f
|
|
385
|
+
] = Be(r);
|
|
373
386
|
return {
|
|
374
387
|
id: `${o[1] ?? ""}`.trim(),
|
|
375
388
|
name: `${l[1] ?? ""}`.trim(),
|
|
376
|
-
locations:
|
|
377
|
-
reference: `${
|
|
389
|
+
locations: p.slice(1).map((i) => `${i}`.trim()).filter((i) => i),
|
|
390
|
+
reference: `${f[1] ?? ""}`.trim()
|
|
378
391
|
};
|
|
379
392
|
}
|
|
380
393
|
function _t(r) {
|
|
@@ -384,24 +397,24 @@ function _t(r) {
|
|
|
384
397
|
l,
|
|
385
398
|
e,
|
|
386
399
|
t,
|
|
387
|
-
|
|
388
|
-
f,
|
|
400
|
+
y,
|
|
389
401
|
p,
|
|
402
|
+
f,
|
|
390
403
|
i,
|
|
391
404
|
d,
|
|
392
405
|
...m
|
|
393
|
-
] =
|
|
406
|
+
] = Be(r);
|
|
394
407
|
if (!s || !s.length || s.some((a) => a.length && !a.startsWith("system:")))
|
|
395
408
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
396
|
-
const
|
|
409
|
+
const g = s.map((a) => a.split(":")[1]), u = ["code", "name", "unit", "enabled"].filter((a) => !g.includes(a));
|
|
397
410
|
if (u.length)
|
|
398
411
|
throw new Error(
|
|
399
412
|
`Missing meta headers (${u.join()}). Excel file does not come from the template.`
|
|
400
413
|
);
|
|
401
414
|
return m.map((a, x) => {
|
|
402
415
|
const c = {};
|
|
403
|
-
for (const $ in
|
|
404
|
-
const b =
|
|
416
|
+
for (const $ in g) {
|
|
417
|
+
const b = g[$];
|
|
405
418
|
Object.assign(c, { [b]: a[$] });
|
|
406
419
|
}
|
|
407
420
|
return {
|
|
@@ -421,44 +434,45 @@ function xt(r) {
|
|
|
421
434
|
);
|
|
422
435
|
}
|
|
423
436
|
function wt(r) {
|
|
424
|
-
const s = r.parent.data, o = new Array(), e =
|
|
437
|
+
const s = r.parent.data, o = new Array(), e = ie().skuByCode[s.code ?? ""];
|
|
425
438
|
if (!e)
|
|
426
439
|
return o.push(`Cannot find ingredient of code ${s.code} ${s.name}`), { errors: o };
|
|
427
440
|
const t = {
|
|
428
441
|
sku: e
|
|
429
|
-
},
|
|
430
|
-
s.unit !== e.unit.abbrev && !
|
|
442
|
+
}, y = e.unit.measurements.find((f) => f.abbrev === s.unit);
|
|
443
|
+
s.unit !== e.unit.abbrev && !y ? o.push(
|
|
431
444
|
`Cannot find measurement unit of ${s.unit} for (${s.code}) ${s.name}.`
|
|
432
|
-
) : (s.enabled
|
|
433
|
-
for (const
|
|
434
|
-
const i =
|
|
445
|
+
) : (!s.enabled || `${s.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((y == null ? void 0 : y.id) ?? e.unit._id));
|
|
446
|
+
for (const f of r.children) {
|
|
447
|
+
const i = f.data, d = i.unit === e.unit.abbrev ? e.unit : void 0, m = e.unit.measurements.find((g) => g.abbrev === i.unit);
|
|
435
448
|
if (!m && !d) {
|
|
436
449
|
o.push(
|
|
437
450
|
`Cannot find measurement unit of ${i.unit} for (${s.code}) ${s.name}.`
|
|
438
451
|
);
|
|
439
452
|
continue;
|
|
440
453
|
}
|
|
441
|
-
(i.enabled
|
|
454
|
+
(!i.enabled || `${i.enabled}`.toLocaleLowerCase() === "false") && (t.disabledMeasurements ?? (t.disabledMeasurements = []), t.disabledMeasurements.push((m == null ? void 0 : m.id) ?? (d == null ? void 0 : d._id) ?? ""));
|
|
442
455
|
}
|
|
443
|
-
|
|
456
|
+
const p = new Set(t.disabledMeasurements);
|
|
457
|
+
return p.has(e.unit._id) && t.sku.unit.measurements.every((f) => p.has(f.id)) && o.push(`Ingredient ${e.code} - ${e.name} must have at least one unit enabled.`), { errors: o, templateItem: t };
|
|
444
458
|
}
|
|
445
459
|
function kt(r) {
|
|
446
460
|
const s = r.SheetNames.filter(
|
|
447
461
|
(t) => !Object.values(ce).map(String).includes(t)
|
|
448
|
-
), l = te().templates, e =
|
|
462
|
+
), l = te().templates, e = ot(l, "_id");
|
|
449
463
|
try {
|
|
450
464
|
return s.reduce(
|
|
451
|
-
(t,
|
|
452
|
-
const
|
|
453
|
-
|
|
454
|
-
const
|
|
465
|
+
(t, y) => {
|
|
466
|
+
const p = new Array(), f = r.Sheets[y], i = bt(f), d = ht(i.locations), m = d.filter((c) => c.location).map((c) => c.location);
|
|
467
|
+
p.push(...d.flatMap((c) => c.errors));
|
|
468
|
+
const g = _t(f).filter(
|
|
455
469
|
(c) => c.data.code || c.data.unit
|
|
456
|
-
), h = xt(
|
|
457
|
-
|
|
470
|
+
), h = xt(g);
|
|
471
|
+
p.push(...h.errors);
|
|
458
472
|
const u = h.result.map(
|
|
459
473
|
(c) => wt(c)
|
|
460
474
|
);
|
|
461
|
-
|
|
475
|
+
p.push(...u.flatMap((c) => c.errors));
|
|
462
476
|
const n = u.filter((c) => c.templateItem).map((c) => c.templateItem);
|
|
463
477
|
if (i.id) {
|
|
464
478
|
const c = e[i.id];
|
|
@@ -466,15 +480,15 @@ function kt(r) {
|
|
|
466
480
|
const b = {
|
|
467
481
|
_id: i.id,
|
|
468
482
|
_rev: "",
|
|
469
|
-
name: i.name || `(unnamed from sheet ${
|
|
483
|
+
name: i.name || `(unnamed from sheet ${y || "<unnamed sheet>"})`,
|
|
470
484
|
items: []
|
|
471
485
|
};
|
|
472
|
-
return
|
|
486
|
+
return p.push(`Template ID ${i.id} is not found.`), t.importUpdateResult.push({
|
|
473
487
|
type: "update",
|
|
474
488
|
original: b,
|
|
475
489
|
template: b,
|
|
476
|
-
excelSheetName:
|
|
477
|
-
errors:
|
|
490
|
+
excelSheetName: y,
|
|
491
|
+
errors: p
|
|
478
492
|
}), t;
|
|
479
493
|
}
|
|
480
494
|
const $ = {
|
|
@@ -487,8 +501,8 @@ function kt(r) {
|
|
|
487
501
|
ref: i.reference,
|
|
488
502
|
items: n
|
|
489
503
|
},
|
|
490
|
-
excelSheetName:
|
|
491
|
-
errors:
|
|
504
|
+
excelSheetName: y,
|
|
505
|
+
errors: p
|
|
492
506
|
};
|
|
493
507
|
return t.importUpdateResult.push($), t;
|
|
494
508
|
}
|
|
@@ -500,8 +514,8 @@ function kt(r) {
|
|
|
500
514
|
ref: i.reference,
|
|
501
515
|
items: n
|
|
502
516
|
},
|
|
503
|
-
excelSheetName:
|
|
504
|
-
errors:
|
|
517
|
+
excelSheetName: y,
|
|
518
|
+
errors: p
|
|
505
519
|
};
|
|
506
520
|
return t.importCreateResult.push(x), t;
|
|
507
521
|
},
|
|
@@ -523,7 +537,7 @@ function kt(r) {
|
|
|
523
537
|
const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-col" }, Ct = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, It = {
|
|
524
538
|
key: 0,
|
|
525
539
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
526
|
-
}, St = { key: 0 },
|
|
540
|
+
}, St = { key: 0 }, De = /* @__PURE__ */ j({
|
|
527
541
|
__name: "ClosingTemplateImportItem",
|
|
528
542
|
props: {
|
|
529
543
|
type: {},
|
|
@@ -535,7 +549,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
535
549
|
setup(r) {
|
|
536
550
|
const { t: s } = B();
|
|
537
551
|
return (o, l) => {
|
|
538
|
-
var
|
|
552
|
+
var y, p, f;
|
|
539
553
|
const e = R("FmIcon"), t = R("FmTooltip");
|
|
540
554
|
return k(), I("div", Tt, [
|
|
541
555
|
l[0] || (l[0] = _("div", null, "•", -1)),
|
|
@@ -547,13 +561,13 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
547
561
|
})
|
|
548
562
|
}, [
|
|
549
563
|
Fe(C(o.name) + " ", 1),
|
|
550
|
-
o.type === "create" ? (k(), I("span", It, "(" + C(v(s)("inventory.closing.template.import.new")) + ")", 1)) :
|
|
564
|
+
o.type === "create" ? (k(), I("span", It, "(" + C(v(s)("inventory.closing.template.import.new")) + ")", 1)) : G("", !0)
|
|
551
565
|
], 2),
|
|
552
566
|
o.errors.length ? (k(), I("div", St, [
|
|
553
567
|
T(t, { "z-index": 50 }, {
|
|
554
568
|
content: P(() => [
|
|
555
569
|
_("ol", null, [
|
|
556
|
-
(k(!0), I(H, null,
|
|
570
|
+
(k(!0), I(H, null, J(o.errors, (i, d) => (k(), I("li", { key: d }, C(i), 1))), 128))
|
|
557
571
|
])
|
|
558
572
|
]),
|
|
559
573
|
default: P(() => [
|
|
@@ -565,7 +579,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
565
579
|
]),
|
|
566
580
|
_: 1
|
|
567
581
|
})
|
|
568
|
-
])) :
|
|
582
|
+
])) : G("", !0)
|
|
569
583
|
]),
|
|
570
584
|
_("div", {
|
|
571
585
|
class: Y([
|
|
@@ -575,12 +589,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
575
589
|
"text-fm-color-typo-secondary": !o.errors.length
|
|
576
590
|
}
|
|
577
591
|
])
|
|
578
|
-
}, C((
|
|
592
|
+
}, C((y = o.locations) != null && y.length ? v(s)("inventory.closing.template.import.nLocations", { count: (p = o.locations) == null ? void 0 : p.length }) : v(s)("inventory.closing.template.import.allLocations")) + ", " + C(v(s)("inventory.closing.template.import.nItems", { count: (f = o.items) == null ? void 0 : f.length })), 3)
|
|
579
593
|
])
|
|
580
594
|
]);
|
|
581
595
|
};
|
|
582
596
|
}
|
|
583
|
-
}),
|
|
597
|
+
}), Mt = { class: "flex flex-col gap-24" }, Dt = { class: "fm-typo-en-body-md-400" }, Ft = {
|
|
584
598
|
key: 0,
|
|
585
599
|
class: "flex items-center gap-8"
|
|
586
600
|
}, Rt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pt = { class: "flex flex-col gap-8" }, At = { class: "line-clamp-2 text-ellipsis break-all" }, Et = {
|
|
@@ -592,38 +606,38 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
592
606
|
}, Vt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, Nt = {
|
|
593
607
|
key: 0,
|
|
594
608
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
595
|
-
}, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = /* @__PURE__ */
|
|
609
|
+
}, Bt = { class: "fm-typo-en-body-lg-600" }, Lt = /* @__PURE__ */ j({
|
|
596
610
|
__name: "ClosingTemplateImport",
|
|
597
611
|
setup(r) {
|
|
598
|
-
const s =
|
|
599
|
-
() => !!
|
|
612
|
+
const s = M(null), o = Ze(), l = Z(), e = M(!1), t = M(!1), y = M(new Array()), p = M([]), f = M([]), i = E(
|
|
613
|
+
() => !!y.value.length || p.value.some((h) => h.errors.length) || f.value.some((h) => h.errors.length)
|
|
600
614
|
), d = E(
|
|
601
|
-
() => !!
|
|
615
|
+
() => !!p.value.length || !!f.value.length
|
|
602
616
|
), { t: m } = B();
|
|
603
|
-
async function
|
|
604
|
-
|
|
617
|
+
async function g(h) {
|
|
618
|
+
y.value = [], p.value = [], f.value = [];
|
|
605
619
|
try {
|
|
606
620
|
e.value = !0;
|
|
607
621
|
const [u] = await Promise.all([
|
|
608
|
-
|
|
622
|
+
st(h),
|
|
609
623
|
// fake buffer
|
|
610
624
|
new Promise((c) => setTimeout(c, 1e3))
|
|
611
625
|
]);
|
|
612
626
|
if (!u.SheetNames.filter(
|
|
613
627
|
(c) => !Object.values(ce).map(String).includes(c)
|
|
614
628
|
).find((c) => c)) {
|
|
615
|
-
|
|
629
|
+
y.value.push(m("inventory.ingredient.import.fileError.noSheet"));
|
|
616
630
|
return;
|
|
617
631
|
}
|
|
618
632
|
const x = kt(u);
|
|
619
633
|
if (x.invalidExcel) {
|
|
620
|
-
|
|
634
|
+
y.value.push(
|
|
621
635
|
x.invalidExcelMessage ?? m("inventory.ingredient.import.fileError.invalidExcel")
|
|
622
636
|
);
|
|
623
637
|
return;
|
|
624
638
|
}
|
|
625
|
-
if (
|
|
626
|
-
|
|
639
|
+
if (p.value = x.importCreateResult, f.value = x.importUpdateResult, !p.value.length && !f.value.length) {
|
|
640
|
+
y.value.push(m("inventory.ingredient.import.fileError.noData"));
|
|
627
641
|
return;
|
|
628
642
|
}
|
|
629
643
|
o.emitData(x);
|
|
@@ -634,18 +648,18 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
634
648
|
type: "error"
|
|
635
649
|
}), console.error("Error in reading file", u);
|
|
636
650
|
} finally {
|
|
637
|
-
|
|
651
|
+
y.value.length && l.open({
|
|
638
652
|
title: m("inventory.ingredient.import.fileError.invalidExcel"),
|
|
639
653
|
type: "error"
|
|
640
654
|
}), e.value = !1;
|
|
641
655
|
}
|
|
642
656
|
}
|
|
643
657
|
return Re(s, (h) => {
|
|
644
|
-
h &&
|
|
658
|
+
h && g(h);
|
|
645
659
|
}), (h, u) => {
|
|
646
660
|
const n = R("FmCircularProgress"), a = R("FmIcon"), x = R("FmButton");
|
|
647
|
-
return k(), I("div",
|
|
648
|
-
_("div",
|
|
661
|
+
return k(), I("div", Mt, [
|
|
662
|
+
_("div", Dt, C(v(m)("inventory.closing.template.import.message")), 1),
|
|
649
663
|
t.value ? (k(), I("div", Ft, [
|
|
650
664
|
_("div", null, [
|
|
651
665
|
T(n, {
|
|
@@ -655,7 +669,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
655
669
|
]),
|
|
656
670
|
_("div", Rt, C(v(m)("inventory.formField.loading")), 1)
|
|
657
671
|
])) : (k(), I(H, { key: 1 }, [
|
|
658
|
-
T(
|
|
672
|
+
T(lt, {
|
|
659
673
|
class: Y({
|
|
660
674
|
"w-full": !0,
|
|
661
675
|
"h-[200px]": !s.value
|
|
@@ -700,7 +714,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
700
714
|
}, [
|
|
701
715
|
_("div", At, C(s.value.name), 1)
|
|
702
716
|
], 2),
|
|
703
|
-
e.value ?
|
|
717
|
+
e.value ? G("", !0) : (k(), I("div", Et, [
|
|
704
718
|
T(x, {
|
|
705
719
|
label: v(m)("inventory.ingredient.import.replaceFile"),
|
|
706
720
|
variant: i.value ? "destructive" : "secondary",
|
|
@@ -709,8 +723,8 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
709
723
|
}, null, 8, ["label", "variant", "prepend-icon", "onClick"])
|
|
710
724
|
]))
|
|
711
725
|
], 2),
|
|
712
|
-
|
|
713
|
-
(k(!0), I(H, null,
|
|
726
|
+
y.value.length ? (k(), I("div", Ut, [
|
|
727
|
+
(k(!0), I(H, null, J(y.value, ($, b) => (k(), I("div", {
|
|
714
728
|
key: b,
|
|
715
729
|
class: "flex gap-8 items-center"
|
|
716
730
|
}, [
|
|
@@ -721,7 +735,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
721
735
|
}),
|
|
722
736
|
_("div", Vt, C($), 1)
|
|
723
737
|
]))), 128))
|
|
724
|
-
])) :
|
|
738
|
+
])) : G("", !0)
|
|
725
739
|
])
|
|
726
740
|
]),
|
|
727
741
|
key: "0"
|
|
@@ -729,7 +743,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
729
743
|
]), 1032, ["class", "label", "button-label"]),
|
|
730
744
|
d.value ? (k(), I("div", Nt, [
|
|
731
745
|
_("div", Bt, C(v(m)("inventory.ingredient.import.summary")), 1),
|
|
732
|
-
(k(!0), I(H, null,
|
|
746
|
+
(k(!0), I(H, null, J(p.value, (c, $) => (k(), V(De, {
|
|
733
747
|
key: $,
|
|
734
748
|
name: c.template.name,
|
|
735
749
|
locations: c.template.locations,
|
|
@@ -737,7 +751,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
737
751
|
errors: c.errors,
|
|
738
752
|
type: "create"
|
|
739
753
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128)),
|
|
740
|
-
(k(!0), I(H, null,
|
|
754
|
+
(k(!0), I(H, null, J(f.value, (c) => (k(), V(De, {
|
|
741
755
|
key: c.template._id,
|
|
742
756
|
name: c.template.name,
|
|
743
757
|
locations: c.template.locations,
|
|
@@ -745,29 +759,29 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
745
759
|
errors: c.errors,
|
|
746
760
|
type: "update"
|
|
747
761
|
}, null, 8, ["name", "locations", "items", "errors"]))), 128))
|
|
748
|
-
])) :
|
|
762
|
+
])) : G("", !0)
|
|
749
763
|
], 64))
|
|
750
764
|
]);
|
|
751
765
|
};
|
|
752
766
|
}
|
|
753
|
-
}), se =
|
|
754
|
-
const { t: r } = B(), s =
|
|
755
|
-
function
|
|
756
|
-
|
|
767
|
+
}), se = Ae("closingTemplateActions", () => {
|
|
768
|
+
const { t: r } = B(), s = ae(), o = Z(), l = ee(), e = te(), { loading: t } = Ee(e), y = M({});
|
|
769
|
+
function p() {
|
|
770
|
+
y.value = {
|
|
757
771
|
mode: z.CREATE,
|
|
758
772
|
show: !0,
|
|
759
773
|
"onUpdate:show"(n) {
|
|
760
|
-
|
|
774
|
+
y.value.show = n;
|
|
761
775
|
}
|
|
762
776
|
};
|
|
763
777
|
}
|
|
764
|
-
function
|
|
765
|
-
|
|
778
|
+
function f(n) {
|
|
779
|
+
y.value = {
|
|
766
780
|
mode: z.UPDATE,
|
|
767
781
|
modelValue: n,
|
|
768
782
|
show: !0,
|
|
769
783
|
"onUpdate:show"(a) {
|
|
770
|
-
|
|
784
|
+
y.value.show = a;
|
|
771
785
|
}
|
|
772
786
|
};
|
|
773
787
|
}
|
|
@@ -777,12 +791,12 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
777
791
|
message: "Deleted template can no longer be retrieved",
|
|
778
792
|
primaryActions: {
|
|
779
793
|
text: "Delete",
|
|
780
|
-
variant:
|
|
794
|
+
variant: Se.Destructive,
|
|
781
795
|
close: !0
|
|
782
796
|
},
|
|
783
797
|
secondaryActions: {
|
|
784
798
|
text: "Cancel",
|
|
785
|
-
variant:
|
|
799
|
+
variant: Se.Plain,
|
|
786
800
|
close: !0
|
|
787
801
|
}
|
|
788
802
|
}).onPrimary(async () => {
|
|
@@ -812,7 +826,7 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
812
826
|
}
|
|
813
827
|
});
|
|
814
828
|
}
|
|
815
|
-
const d =
|
|
829
|
+
const d = M({});
|
|
816
830
|
function m(n) {
|
|
817
831
|
d.value = {
|
|
818
832
|
template: n,
|
|
@@ -821,11 +835,11 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
821
835
|
d.value.show = a;
|
|
822
836
|
},
|
|
823
837
|
"onAction:edit"() {
|
|
824
|
-
d.value.show = !1,
|
|
838
|
+
d.value.show = !1, f(Ue(n));
|
|
825
839
|
}
|
|
826
840
|
};
|
|
827
841
|
}
|
|
828
|
-
function
|
|
842
|
+
function g() {
|
|
829
843
|
if (!e.templates.length) {
|
|
830
844
|
o.open({
|
|
831
845
|
title: "No data to export",
|
|
@@ -923,17 +937,17 @@ const Tt = { class: "flex items-center gap-12 pl-8" }, $t = { class: "flex flex-
|
|
|
923
937
|
}
|
|
924
938
|
}
|
|
925
939
|
return {
|
|
926
|
-
createTemplate:
|
|
940
|
+
createTemplate: p,
|
|
927
941
|
viewTemplate: m,
|
|
928
|
-
updateTemplate:
|
|
942
|
+
updateTemplate: f,
|
|
929
943
|
deleteTemplate: i,
|
|
930
|
-
exportTemplates:
|
|
944
|
+
exportTemplates: g,
|
|
931
945
|
importTemplates: h,
|
|
932
|
-
templateDialogProps:
|
|
946
|
+
templateDialogProps: y,
|
|
933
947
|
templateDetailsProps: d
|
|
934
948
|
};
|
|
935
949
|
});
|
|
936
|
-
var
|
|
950
|
+
var K = /* @__PURE__ */ ((r) => (r.Name = "Name", r.Unit = "Unit", r.Delete = "Delete", r))(K || {});
|
|
937
951
|
function zt(r) {
|
|
938
952
|
return {
|
|
939
953
|
columnDefs: E(() => {
|
|
@@ -976,14 +990,14 @@ function zt(r) {
|
|
|
976
990
|
minSize: 200,
|
|
977
991
|
maxSize: 400,
|
|
978
992
|
cell(e) {
|
|
979
|
-
var
|
|
993
|
+
var y, p, f;
|
|
980
994
|
const t = e.row.original;
|
|
981
995
|
return F("div", { class: "flex items-center gap-32" }, [
|
|
982
996
|
F(
|
|
983
997
|
L.FmFormGroup,
|
|
984
998
|
{
|
|
985
999
|
value: t.sku.unit._id,
|
|
986
|
-
modelValue: !((
|
|
1000
|
+
modelValue: !((y = t.disabledMeasurements) != null && y.includes(t.sku.unit._id))
|
|
987
1001
|
},
|
|
988
1002
|
F(
|
|
989
1003
|
"div",
|
|
@@ -994,8 +1008,8 @@ function zt(r) {
|
|
|
994
1008
|
[
|
|
995
1009
|
F(L.FmCheckbox, {
|
|
996
1010
|
value: t.sku.unit._id,
|
|
997
|
-
modelValue: !((
|
|
998
|
-
disabled: r.disabled || !((
|
|
1011
|
+
modelValue: !((p = t.disabledMeasurements) != null && p.includes(t.sku.unit._id)),
|
|
1012
|
+
disabled: r.disabled || !((f = t.disabledMeasurements) != null && f.includes(t.sku.unit._id)) && t.sku.unit.measurements.every(
|
|
999
1013
|
(i) => {
|
|
1000
1014
|
var d;
|
|
1001
1015
|
return (d = t.disabledMeasurements) == null ? void 0 : d.includes(i.id);
|
|
@@ -1040,12 +1054,12 @@ function zt(r) {
|
|
|
1040
1054
|
),
|
|
1041
1055
|
...Array.from({ length: Math.max(o, 0) }).map((i, d) => {
|
|
1042
1056
|
var h, u, n, a;
|
|
1043
|
-
const m = e.row.original,
|
|
1044
|
-
return
|
|
1057
|
+
const m = e.row.original, g = m.sku.unit.measurements[d];
|
|
1058
|
+
return g ? F(
|
|
1045
1059
|
L.FmFormGroup,
|
|
1046
1060
|
{
|
|
1047
|
-
modelValue: !((h = m.disabledMeasurements) != null && h.includes(
|
|
1048
|
-
value:
|
|
1061
|
+
modelValue: !((h = m.disabledMeasurements) != null && h.includes(g.id)),
|
|
1062
|
+
value: g.id
|
|
1049
1063
|
},
|
|
1050
1064
|
F(
|
|
1051
1065
|
"div",
|
|
@@ -1055,9 +1069,9 @@ function zt(r) {
|
|
|
1055
1069
|
},
|
|
1056
1070
|
[
|
|
1057
1071
|
F(L.FmCheckbox, {
|
|
1058
|
-
value:
|
|
1059
|
-
modelValue: !((u = m.disabledMeasurements) != null && u.includes(
|
|
1060
|
-
disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(
|
|
1072
|
+
value: g.id,
|
|
1073
|
+
modelValue: !((u = m.disabledMeasurements) != null && u.includes(g.id)),
|
|
1074
|
+
disabled: r.disabled || !((n = m.disabledMeasurements) != null && n.includes(g.id)) && ((a = m.disabledMeasurements) == null ? void 0 : a.includes(m.sku.unit._id)) && m.sku.unit.measurements.filter((x) => x.id != g.id).every((x) => {
|
|
1061
1075
|
var c;
|
|
1062
1076
|
return (c = m.disabledMeasurements) == null ? void 0 : c.includes(x.id);
|
|
1063
1077
|
}),
|
|
@@ -1067,14 +1081,14 @@ function zt(r) {
|
|
|
1067
1081
|
r.updateItem({
|
|
1068
1082
|
...m,
|
|
1069
1083
|
disabledMeasurements: (c = m.disabledMeasurements) == null ? void 0 : c.filter(
|
|
1070
|
-
($) => $ !==
|
|
1084
|
+
($) => $ !== g.id
|
|
1071
1085
|
)
|
|
1072
1086
|
});
|
|
1073
1087
|
else {
|
|
1074
1088
|
const $ = m.disabledMeasurements ?? [];
|
|
1075
1089
|
r.updateItem({
|
|
1076
1090
|
...m,
|
|
1077
|
-
disabledMeasurements: [...$,
|
|
1091
|
+
disabledMeasurements: [...$, g.id]
|
|
1078
1092
|
});
|
|
1079
1093
|
}
|
|
1080
1094
|
}
|
|
@@ -1084,13 +1098,13 @@ function zt(r) {
|
|
|
1084
1098
|
{ zIndex: 51 },
|
|
1085
1099
|
{
|
|
1086
1100
|
content() {
|
|
1087
|
-
return
|
|
1101
|
+
return g.abbrev;
|
|
1088
1102
|
},
|
|
1089
1103
|
default() {
|
|
1090
1104
|
return F(
|
|
1091
1105
|
"div",
|
|
1092
1106
|
{ class: "line-clamp-2 fm-typo-en-body-lg-400" },
|
|
1093
|
-
|
|
1107
|
+
g.abbrev
|
|
1094
1108
|
);
|
|
1095
1109
|
}
|
|
1096
1110
|
}
|
|
@@ -1135,7 +1149,7 @@ function zt(r) {
|
|
|
1135
1149
|
})
|
|
1136
1150
|
};
|
|
1137
1151
|
}
|
|
1138
|
-
const Ht = { class: "flex flex-col gap-16 py-12" },
|
|
1152
|
+
const Ht = { class: "flex flex-col gap-16 py-12" }, jt = { class: "flex" }, Ot = { class: "flex-1 flex flex-col" }, Yt = { class: "fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, Kt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Gt = { class: "flex flex-col gap-4" }, Jt = /* @__PURE__ */ j({
|
|
1139
1153
|
__name: "ClosingTemplateItem",
|
|
1140
1154
|
props: {
|
|
1141
1155
|
cellByColId: {},
|
|
@@ -1143,32 +1157,32 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1143
1157
|
},
|
|
1144
1158
|
setup(r) {
|
|
1145
1159
|
const s = r, o = E(() => s.row), l = E(
|
|
1146
|
-
() => o.value.getVisibleCells().filter((e) => e.column.id !==
|
|
1160
|
+
() => o.value.getVisibleCells().filter((e) => e.column.id !== K.Name && e.column.id !== K.Delete)
|
|
1147
1161
|
);
|
|
1148
1162
|
return (e, t) => {
|
|
1149
|
-
var
|
|
1163
|
+
var y, p, f, i, d;
|
|
1150
1164
|
return k(), I("div", Ht, [
|
|
1151
|
-
_("div",
|
|
1152
|
-
_("div",
|
|
1165
|
+
_("div", jt, [
|
|
1166
|
+
_("div", Ot, [
|
|
1153
1167
|
_("div", Yt, C(o.value.original.sku.name), 1),
|
|
1154
|
-
_("div",
|
|
1168
|
+
_("div", Kt, C(o.value.original.sku.code), 1)
|
|
1155
1169
|
]),
|
|
1156
1170
|
_("div", null, [
|
|
1157
|
-
T(v(
|
|
1158
|
-
render: (
|
|
1159
|
-
props: (d = (i = e.cellByColId[v(
|
|
1171
|
+
T(v(O), {
|
|
1172
|
+
render: (f = (p = (y = e.cellByColId[v(K).Delete]) == null ? void 0 : y.column) == null ? void 0 : p.columnDef) == null ? void 0 : f.cell,
|
|
1173
|
+
props: (d = (i = e.cellByColId[v(K).Delete]) == null ? void 0 : i.getContext) == null ? void 0 : d.call(i)
|
|
1160
1174
|
}, null, 8, ["render", "props"])
|
|
1161
1175
|
])
|
|
1162
1176
|
]),
|
|
1163
|
-
_("div",
|
|
1177
|
+
_("div", Gt, [
|
|
1164
1178
|
t[0] || (t[0] = _("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, null, -1)),
|
|
1165
|
-
(k(!0), I(H, null,
|
|
1166
|
-
var
|
|
1179
|
+
(k(!0), I(H, null, J(l.value, (m) => {
|
|
1180
|
+
var g, h, u;
|
|
1167
1181
|
return k(), I("div", {
|
|
1168
1182
|
key: m.id
|
|
1169
1183
|
}, [
|
|
1170
|
-
T(v(
|
|
1171
|
-
render: (h = (
|
|
1184
|
+
T(v(O), {
|
|
1185
|
+
render: (h = (g = m.column) == null ? void 0 : g.columnDef) == null ? void 0 : h.cell,
|
|
1172
1186
|
props: (u = m.getContext) == null ? void 0 : u.call(m)
|
|
1173
1187
|
}, null, 8, ["render", "props"])
|
|
1174
1188
|
]);
|
|
@@ -1177,25 +1191,25 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1177
1191
|
]);
|
|
1178
1192
|
};
|
|
1179
1193
|
}
|
|
1180
|
-
}),
|
|
1194
|
+
}), Wt = { class: "flex flex-col gap-16" }, qt = { class: "flex flex-col gap-24" }, Qt = { class: "flex flex-col gap-16" }, Xt = { class: "flex items-center" }, Zt = { class: "flex-1 fm-typo-en-title-sm-600" }, en = { class: "flex flex-col gap-16" }, tn = { class: "flex items-center" }, nn = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, on = /* @__PURE__ */ j({
|
|
1181
1195
|
__name: "ClosingTemplateForm",
|
|
1182
1196
|
props: {
|
|
1183
1197
|
modelValue: {},
|
|
1184
1198
|
disabled: { type: Boolean }
|
|
1185
1199
|
},
|
|
1186
1200
|
setup(r, { expose: s }) {
|
|
1187
|
-
const o = r, l =
|
|
1188
|
-
promptSelectLocations:
|
|
1189
|
-
columnDefs:
|
|
1201
|
+
const o = r, l = pt(), { t: e } = B(), t = ie(), y = ae(), {
|
|
1202
|
+
promptSelectLocations: p,
|
|
1203
|
+
columnDefs: f,
|
|
1190
1204
|
rowData: i
|
|
1191
|
-
} =
|
|
1205
|
+
} = ft({
|
|
1192
1206
|
getLocations() {
|
|
1193
1207
|
return l.locations;
|
|
1194
1208
|
},
|
|
1195
1209
|
setLocations(n) {
|
|
1196
1210
|
l.locations = n;
|
|
1197
1211
|
}
|
|
1198
|
-
}), d =
|
|
1212
|
+
}), d = M(), m = M("");
|
|
1199
1213
|
s({
|
|
1200
1214
|
validateInputs: () => {
|
|
1201
1215
|
var n, a;
|
|
@@ -1210,7 +1224,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1210
1224
|
(a = (n = d.value) == null ? void 0 : n.resetInputs) == null || a.call(n);
|
|
1211
1225
|
}
|
|
1212
1226
|
});
|
|
1213
|
-
const
|
|
1227
|
+
const g = zt({
|
|
1214
1228
|
updateItem: (n) => {
|
|
1215
1229
|
l.items = l.items.map((a) => a.sku._id !== n.sku._id ? a : n);
|
|
1216
1230
|
},
|
|
@@ -1223,7 +1237,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1223
1237
|
get disabled() {
|
|
1224
1238
|
return o.disabled;
|
|
1225
1239
|
}
|
|
1226
|
-
}), h = E(() =>
|
|
1240
|
+
}), h = E(() => g.columnDefs.value);
|
|
1227
1241
|
function u() {
|
|
1228
1242
|
const n = t.skus.map((x) => ({
|
|
1229
1243
|
label: x.name,
|
|
@@ -1233,10 +1247,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1233
1247
|
var c;
|
|
1234
1248
|
return (c = l.items) == null ? void 0 : c.find(($) => $.sku._id === x.value._id);
|
|
1235
1249
|
}).map((x) => x.value);
|
|
1236
|
-
|
|
1250
|
+
y.open({
|
|
1237
1251
|
title: e("inventory.closing.form.items.selectItem"),
|
|
1238
1252
|
closeButton: !0,
|
|
1239
|
-
contentComponent:
|
|
1253
|
+
contentComponent: dt,
|
|
1240
1254
|
contentComponentProps: {
|
|
1241
1255
|
modelValue: a,
|
|
1242
1256
|
items: n,
|
|
@@ -1253,7 +1267,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1253
1267
|
}
|
|
1254
1268
|
}).onPrimary((x) => {
|
|
1255
1269
|
const c = l.items ?? [], $ = x.map((b) => {
|
|
1256
|
-
const w = c.find((
|
|
1270
|
+
const w = c.find((D) => D.sku._id === b._id);
|
|
1257
1271
|
return w || {
|
|
1258
1272
|
sku: b
|
|
1259
1273
|
};
|
|
@@ -1270,20 +1284,20 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1270
1284
|
disabled: n.disabled
|
|
1271
1285
|
}, {
|
|
1272
1286
|
default: P(() => [
|
|
1273
|
-
_("div",
|
|
1287
|
+
_("div", Wt, [
|
|
1274
1288
|
_("div", qt, [
|
|
1275
1289
|
T(x, {
|
|
1276
1290
|
label: v(e)("inventory.closing.form.name"),
|
|
1277
1291
|
"label-mark": "required",
|
|
1278
1292
|
modelValue: v(l).name,
|
|
1279
|
-
"onUpdate:modelValue": a[0] || (a[0] = (
|
|
1280
|
-
rules: [v(
|
|
1293
|
+
"onUpdate:modelValue": a[0] || (a[0] = (D) => v(l).name = D),
|
|
1294
|
+
rules: [v(mt)()]
|
|
1281
1295
|
}, null, 8, ["label", "modelValue", "rules"]),
|
|
1282
1296
|
T(x, {
|
|
1283
1297
|
label: v(e)("inventory.closing.form.reference"),
|
|
1284
1298
|
"label-mark": "optional",
|
|
1285
1299
|
modelValue: v(l).ref,
|
|
1286
|
-
"onUpdate:modelValue": a[1] || (a[1] = (
|
|
1300
|
+
"onUpdate:modelValue": a[1] || (a[1] = (D) => v(l).ref = D)
|
|
1287
1301
|
}, null, 8, ["label", "modelValue"])
|
|
1288
1302
|
])
|
|
1289
1303
|
]),
|
|
@@ -1296,14 +1310,14 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1296
1310
|
"prepend-icon": "add",
|
|
1297
1311
|
variant: "plain",
|
|
1298
1312
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
1299
|
-
onClick: v(
|
|
1313
|
+
onClick: v(p)
|
|
1300
1314
|
}, null, 8, ["disabled", "label", "onClick"])
|
|
1301
1315
|
]),
|
|
1302
1316
|
T($, {
|
|
1303
|
-
"column-defs": v(
|
|
1317
|
+
"column-defs": v(f),
|
|
1304
1318
|
"row-data": v(i),
|
|
1305
1319
|
"shrink-at": 9999,
|
|
1306
|
-
onRowClick: v(
|
|
1320
|
+
onRowClick: v(p),
|
|
1307
1321
|
"hide-footer": ""
|
|
1308
1322
|
}, null, 8, ["column-defs", "row-data", "onRowClick"])
|
|
1309
1323
|
]),
|
|
@@ -1316,21 +1330,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1316
1330
|
"prepend-icon": "add",
|
|
1317
1331
|
variant: "plain",
|
|
1318
1332
|
class: "border-2 rounded-lg border-fm-color-primary",
|
|
1319
|
-
onClick: a[2] || (a[2] = (
|
|
1333
|
+
onClick: a[2] || (a[2] = (D) => u()),
|
|
1320
1334
|
size: "md"
|
|
1321
1335
|
}, null, 8, ["disabled", "label"])
|
|
1322
1336
|
]),
|
|
1323
1337
|
T(x, {
|
|
1324
1338
|
placeholder: "Filter items",
|
|
1325
1339
|
modelValue: m.value,
|
|
1326
|
-
"onUpdate:modelValue": a[4] || (a[4] = (
|
|
1340
|
+
"onUpdate:modelValue": a[4] || (a[4] = (D) => m.value = D)
|
|
1327
1341
|
}, Pe({ _: 2 }, [
|
|
1328
1342
|
m.value ? {
|
|
1329
1343
|
name: "append",
|
|
1330
1344
|
fn: P(() => [
|
|
1331
1345
|
T(b, {
|
|
1332
1346
|
name: "close",
|
|
1333
|
-
onClick: a[3] || (a[3] = (
|
|
1347
|
+
onClick: a[3] || (a[3] = (D) => m.value = ""),
|
|
1334
1348
|
class: "cursor-pointer"
|
|
1335
1349
|
})
|
|
1336
1350
|
]),
|
|
@@ -1341,18 +1355,18 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1341
1355
|
"search-value": m.value,
|
|
1342
1356
|
"column-defs": h.value,
|
|
1343
1357
|
"row-data": v(l).items,
|
|
1344
|
-
key: v(l).items.map((
|
|
1358
|
+
key: v(l).items.map((D) => D.sku._id).join("."),
|
|
1345
1359
|
"hide-footer": v(l).items.length <= 10,
|
|
1346
1360
|
"page-size": Math.min(10, v(l).items.length)
|
|
1347
1361
|
}, {
|
|
1348
|
-
"list-row": P((
|
|
1349
|
-
(k(), V(
|
|
1350
|
-
row:
|
|
1362
|
+
"list-row": P((D) => [
|
|
1363
|
+
(k(), V(Le, {
|
|
1364
|
+
row: D,
|
|
1351
1365
|
key: v(l).items.map((S) => S.sku._id).join(".")
|
|
1352
1366
|
}, {
|
|
1353
1367
|
default: P((S) => [
|
|
1354
|
-
T(
|
|
1355
|
-
row:
|
|
1368
|
+
T(Jt, {
|
|
1369
|
+
row: D,
|
|
1356
1370
|
"cell-by-col-id": S
|
|
1357
1371
|
}, null, 8, ["row", "cell-by-col-id"])
|
|
1358
1372
|
]),
|
|
@@ -1363,7 +1377,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1363
1377
|
}, 8, ["search-value", "column-defs", "row-data", "hide-footer", "page-size"])),
|
|
1364
1378
|
T(w, {
|
|
1365
1379
|
"model-value": v(l).items.length,
|
|
1366
|
-
rules: [v(
|
|
1380
|
+
rules: [v(ut)(1)]
|
|
1367
1381
|
}, null, 8, ["model-value", "rules"])
|
|
1368
1382
|
])
|
|
1369
1383
|
]),
|
|
@@ -1371,7 +1385,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1371
1385
|
}, 8, ["disabled"]);
|
|
1372
1386
|
};
|
|
1373
1387
|
}
|
|
1374
|
-
}), sn = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-600" }, an = { class: "flex gap-4" }, rn = /* @__PURE__ */
|
|
1388
|
+
}), sn = { class: "flex items-center" }, ln = { class: "fm-typo-en-title-md-600" }, an = { class: "flex gap-4" }, rn = /* @__PURE__ */ j({
|
|
1375
1389
|
__name: "ClosingTemplateDialog",
|
|
1376
1390
|
props: {
|
|
1377
1391
|
mode: {},
|
|
@@ -1381,7 +1395,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1381
1395
|
emits: ["update:show", "submitted"],
|
|
1382
1396
|
setup(r, { expose: s, emit: o }) {
|
|
1383
1397
|
var $;
|
|
1384
|
-
const l = r, e = o, t = ee(),
|
|
1398
|
+
const l = r, e = o, t = ee(), y = Z(), { t: p } = B(), f = et(l, "show");
|
|
1385
1399
|
function i() {
|
|
1386
1400
|
return {
|
|
1387
1401
|
_id: "",
|
|
@@ -1389,7 +1403,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1389
1403
|
items: []
|
|
1390
1404
|
};
|
|
1391
1405
|
}
|
|
1392
|
-
const d =
|
|
1406
|
+
const d = M(l.modelValue ?? i()), m = M((($ = l.modelValue) == null ? void 0 : $._id) ?? `${Math.random()}`);
|
|
1393
1407
|
Re(
|
|
1394
1408
|
() => l.show,
|
|
1395
1409
|
(b) => {
|
|
@@ -1397,17 +1411,17 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1397
1411
|
b && (d.value = l.modelValue ?? i(), m.value = ((w = l.modelValue) == null ? void 0 : w._id) ?? `${Math.random()}`);
|
|
1398
1412
|
}
|
|
1399
1413
|
);
|
|
1400
|
-
const
|
|
1414
|
+
const g = M(!1), h = E(() => {
|
|
1401
1415
|
switch (l.mode) {
|
|
1402
1416
|
case z.READ:
|
|
1403
1417
|
return "";
|
|
1404
1418
|
case z.CREATE:
|
|
1405
|
-
return
|
|
1419
|
+
return p("inventory.closing.template.create.title");
|
|
1406
1420
|
case z.UPDATE:
|
|
1407
|
-
return
|
|
1421
|
+
return p("inventory.closing.template.update.title");
|
|
1408
1422
|
}
|
|
1409
1423
|
return "";
|
|
1410
|
-
}), u =
|
|
1424
|
+
}), u = M();
|
|
1411
1425
|
s({
|
|
1412
1426
|
validateInputs: () => {
|
|
1413
1427
|
var b, w;
|
|
@@ -1425,45 +1439,45 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1425
1439
|
async function n() {
|
|
1426
1440
|
const b = d.value;
|
|
1427
1441
|
if (b) {
|
|
1428
|
-
|
|
1442
|
+
g.value = !0;
|
|
1429
1443
|
try {
|
|
1430
|
-
await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)),
|
|
1431
|
-
title:
|
|
1432
|
-
message:
|
|
1444
|
+
await t.createTemplate(b), await new Promise((w) => setTimeout(w, 1e3)), y.open({
|
|
1445
|
+
title: p("inventory.closing.template.create.success"),
|
|
1446
|
+
message: p("inventory.closing.template.create.successMessage"),
|
|
1433
1447
|
type: "success"
|
|
1434
1448
|
}), e("update:show", !1), e("submitted");
|
|
1435
1449
|
} catch (w) {
|
|
1436
|
-
|
|
1437
|
-
title:
|
|
1438
|
-
message:
|
|
1450
|
+
y.open({
|
|
1451
|
+
title: p("inventory.closing.template.create.error"),
|
|
1452
|
+
message: p("inventory.closing.template.create.errorMessage"),
|
|
1439
1453
|
type: "error"
|
|
1440
1454
|
}), console.error("Error in creating closing template", w);
|
|
1441
1455
|
} finally {
|
|
1442
|
-
|
|
1456
|
+
g.value = !1;
|
|
1443
1457
|
}
|
|
1444
1458
|
}
|
|
1445
1459
|
}
|
|
1446
1460
|
async function a() {
|
|
1447
1461
|
const b = d.value;
|
|
1448
1462
|
if (b) {
|
|
1449
|
-
|
|
1463
|
+
g.value = !0;
|
|
1450
1464
|
try {
|
|
1451
1465
|
await t.updateTemplate({
|
|
1452
1466
|
...b,
|
|
1453
1467
|
_rev: b._rev ?? ""
|
|
1454
|
-
}), await new Promise((w) => setTimeout(w, 1e3)),
|
|
1455
|
-
title:
|
|
1456
|
-
message:
|
|
1468
|
+
}), await new Promise((w) => setTimeout(w, 1e3)), y.open({
|
|
1469
|
+
title: p("inventory.closing.template.update.success"),
|
|
1470
|
+
message: p("inventory.closing.template.update.successMessage"),
|
|
1457
1471
|
type: "success"
|
|
1458
1472
|
}), e("update:show", !1), e("submitted");
|
|
1459
1473
|
} catch (w) {
|
|
1460
|
-
|
|
1461
|
-
title:
|
|
1462
|
-
message:
|
|
1474
|
+
y.open({
|
|
1475
|
+
title: p("inventory.closing.template.update.error"),
|
|
1476
|
+
message: p("inventory.closing.template.update.errorMessage"),
|
|
1463
1477
|
type: "error"
|
|
1464
1478
|
}), console.error("Error in updating closing template", w);
|
|
1465
1479
|
} finally {
|
|
1466
|
-
|
|
1480
|
+
g.value = !1;
|
|
1467
1481
|
}
|
|
1468
1482
|
}
|
|
1469
1483
|
}
|
|
@@ -1480,10 +1494,10 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1480
1494
|
(w = (b = u.value) == null ? void 0 : b.validateInputs) == null || w.call(b);
|
|
1481
1495
|
}
|
|
1482
1496
|
return (b, w) => {
|
|
1483
|
-
const A = R("FmButton"),
|
|
1484
|
-
return k(), V(
|
|
1485
|
-
modelValue: v(
|
|
1486
|
-
"onUpdate:modelValue": w[2] || (w[2] = (S) =>
|
|
1497
|
+
const A = R("FmButton"), D = R("FmSideSheet");
|
|
1498
|
+
return k(), V(D, {
|
|
1499
|
+
modelValue: v(f),
|
|
1500
|
+
"onUpdate:modelValue": w[2] || (w[2] = (S) => Oe(f) ? f.value = S : null),
|
|
1487
1501
|
"dismiss-away": "",
|
|
1488
1502
|
"close-button": "",
|
|
1489
1503
|
"max-width": 800
|
|
@@ -1501,21 +1515,21 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1501
1515
|
onValidationSuccess: x,
|
|
1502
1516
|
"model-value": d.value,
|
|
1503
1517
|
"onUpdate:modelValue": w[0] || (w[0] = (S) => d.value = S),
|
|
1504
|
-
disabled:
|
|
1518
|
+
disabled: g.value,
|
|
1505
1519
|
key: m.value
|
|
1506
1520
|
}, null, 8, ["model-value", "disabled"]))
|
|
1507
1521
|
]),
|
|
1508
1522
|
"side-sheet-footer": P(() => [
|
|
1509
1523
|
_("div", an, [
|
|
1510
1524
|
T(A, {
|
|
1511
|
-
loading:
|
|
1512
|
-
label: v(
|
|
1525
|
+
loading: g.value,
|
|
1526
|
+
label: v(p)("common.save"),
|
|
1513
1527
|
onClick: c
|
|
1514
1528
|
}, null, 8, ["loading", "label"]),
|
|
1515
1529
|
T(A, {
|
|
1516
|
-
disabled:
|
|
1530
|
+
disabled: g.value,
|
|
1517
1531
|
variant: "tertiary",
|
|
1518
|
-
label: v(
|
|
1532
|
+
label: v(p)("common.close"),
|
|
1519
1533
|
onClick: w[1] || (w[1] = (S) => e("update:show", !1))
|
|
1520
1534
|
}, null, 8, ["disabled", "label"])
|
|
1521
1535
|
])
|
|
@@ -1528,7 +1542,7 @@ const Ht = { class: "flex flex-col gap-16 py-12" }, Ot = { class: "flex" }, jt =
|
|
|
1528
1542
|
function mn(r, s) {
|
|
1529
1543
|
return k(), I("div");
|
|
1530
1544
|
}
|
|
1531
|
-
const un = /* @__PURE__ */
|
|
1545
|
+
const un = /* @__PURE__ */ vt(cn, [["render", mn]]), dn = { class: "flex flex-col gap-40" }, pn = { key: 0 }, fn = {
|
|
1532
1546
|
key: 1,
|
|
1533
1547
|
class: "flex gap-8 items-center"
|
|
1534
1548
|
}, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary" }, gn = {
|
|
@@ -1537,12 +1551,12 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1537
1551
|
}, yn = {
|
|
1538
1552
|
key: 3,
|
|
1539
1553
|
class: "fm-typo-en-body-lg-400 text-fm-color-typo-primary flex flex-col gap-12"
|
|
1540
|
-
}, hn = { class: "fm-typo-en-body-md-600" }, bn = { class: "fm-typo-en-body-md-600" }, _n = { key: 4 }, xn = { class: "fm-typo-en-body-md-600" }, wn = { class: "fm-typo-en-body-md-600" }, kn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Tn = /* @__PURE__ */
|
|
1554
|
+
}, hn = { class: "fm-typo-en-body-md-600" }, bn = { class: "fm-typo-en-body-md-600" }, _n = { key: 4 }, xn = { class: "fm-typo-en-body-md-600" }, wn = { class: "fm-typo-en-body-md-600" }, kn = { class: "flex sm:flex-col xs:flex-col justify-end gap-8 w-full mb-16" }, Tn = /* @__PURE__ */ j({
|
|
1541
1555
|
__name: "ClosingTemplatePublish",
|
|
1542
1556
|
emits: ["close"],
|
|
1543
1557
|
setup(r, { emit: s }) {
|
|
1544
|
-
const o =
|
|
1545
|
-
async function
|
|
1558
|
+
const o = M(!1), l = Z(), e = ee(), t = te(), { t: y } = B(), p = s;
|
|
1559
|
+
async function f() {
|
|
1546
1560
|
o.value = !0;
|
|
1547
1561
|
try {
|
|
1548
1562
|
await e.startNewPublish().delayed(1e3), l.open({
|
|
@@ -1550,12 +1564,12 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1550
1564
|
message: "You may refresh after a while to review publish status",
|
|
1551
1565
|
type: "success"
|
|
1552
1566
|
}), m();
|
|
1553
|
-
} catch (
|
|
1567
|
+
} catch (g) {
|
|
1554
1568
|
l.open({
|
|
1555
1569
|
title: "Something went wrong",
|
|
1556
1570
|
message: "Please try again",
|
|
1557
1571
|
type: "error"
|
|
1558
|
-
}), console.error("error on creating publish task",
|
|
1572
|
+
}), console.error("error on creating publish task", g);
|
|
1559
1573
|
} finally {
|
|
1560
1574
|
o.value = !1;
|
|
1561
1575
|
}
|
|
@@ -1564,9 +1578,9 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1564
1578
|
() => t.templates.length && (!i.value || i.value.outlets.length === i.value.completed.length)
|
|
1565
1579
|
);
|
|
1566
1580
|
function m() {
|
|
1567
|
-
|
|
1581
|
+
p("close");
|
|
1568
1582
|
}
|
|
1569
|
-
return (
|
|
1583
|
+
return (g, h) => {
|
|
1570
1584
|
const u = R("FmCircularProgress"), n = R("i18n-t"), a = R("FmButton");
|
|
1571
1585
|
return k(), I("div", dn, [
|
|
1572
1586
|
v(t).templates.length ? o.value ? (k(), I("div", fn, [
|
|
@@ -1577,7 +1591,7 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1577
1591
|
})
|
|
1578
1592
|
]),
|
|
1579
1593
|
_("div", vn, [
|
|
1580
|
-
_("span", null, C(v(
|
|
1594
|
+
_("span", null, C(v(y)("inventory.closing.template.publish.publishing")), 1)
|
|
1581
1595
|
])
|
|
1582
1596
|
])) : i.value ? i.value.outlets.length === i.value.completed.length ? (k(), I("div", yn, [
|
|
1583
1597
|
T(n, {
|
|
@@ -1592,7 +1606,7 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1592
1606
|
]),
|
|
1593
1607
|
_: 1
|
|
1594
1608
|
}),
|
|
1595
|
-
_("p", null, C(v(
|
|
1609
|
+
_("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
|
|
1596
1610
|
])) : (k(), I("div", _n, [
|
|
1597
1611
|
T(n, {
|
|
1598
1612
|
keypath: "inventory.closing.template.publish.stillPublishing",
|
|
@@ -1608,17 +1622,17 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1608
1622
|
}),
|
|
1609
1623
|
Fe(" Your recent publishing task is still pending (" + C(i.value.completed.length) + " / " + C(i.value.outlets.length) + "). Please wait until all publishing task has completed. ", 1)
|
|
1610
1624
|
])) : (k(), I("div", gn, [
|
|
1611
|
-
_("p", null, C(v(
|
|
1612
|
-
_("p", null, C(v(
|
|
1625
|
+
_("p", null, C(v(y)("inventory.closing.template.publish.noRecentActivity")), 1),
|
|
1626
|
+
_("p", null, C(v(y)("inventory.closing.template.publish.message")), 1)
|
|
1613
1627
|
])) : (k(), I("div", pn, [
|
|
1614
|
-
_("p", null, C(v(
|
|
1628
|
+
_("p", null, C(v(y)("inventory.closing.template.publish.nothingToPublish")), 1)
|
|
1615
1629
|
])),
|
|
1616
1630
|
_("div", kn, [
|
|
1617
1631
|
T(a, {
|
|
1618
1632
|
disabled: !d.value,
|
|
1619
1633
|
loading: o.value,
|
|
1620
1634
|
label: "Publish to all outlets",
|
|
1621
|
-
onClick:
|
|
1635
|
+
onClick: f
|
|
1622
1636
|
}, null, 8, ["disabled", "loading"]),
|
|
1623
1637
|
T(a, {
|
|
1624
1638
|
variant: "tertiary",
|
|
@@ -1629,12 +1643,12 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1629
1643
|
]);
|
|
1630
1644
|
};
|
|
1631
1645
|
}
|
|
1632
|
-
}), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" },
|
|
1646
|
+
}), $n = { class: "flex-1 flex flex-col gap-8" }, Cn = { class: "flex flex-col" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Mn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, Dn = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, Wn = /* @__PURE__ */ j({
|
|
1633
1647
|
__name: "ClosingTemplateView",
|
|
1634
1648
|
setup(r) {
|
|
1635
|
-
const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps:
|
|
1636
|
-
|
|
1637
|
-
const h = E(() => d.loading), u =
|
|
1649
|
+
const { t: s } = B(), { createTemplate: o, updateTemplate: l, exportTemplates: e, importTemplates: t } = se(), { templateDialogProps: y, templateDetailsProps: p } = Ee(se()), f = re(), i = ae(), d = te(), m = qe(), { breakpoints: g } = tt();
|
|
1650
|
+
f.watchLocation(d.fetchTemplates);
|
|
1651
|
+
const h = E(() => d.loading), u = M(""), n = E(() => g.value.xs || g.value.sm), a = E(() => n.value ? 10 : 20);
|
|
1638
1652
|
function x(w) {
|
|
1639
1653
|
switch (w) {
|
|
1640
1654
|
case N.Add:
|
|
@@ -1719,9 +1733,9 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1719
1733
|
}
|
|
1720
1734
|
]);
|
|
1721
1735
|
return (w, A) => {
|
|
1722
|
-
const
|
|
1736
|
+
const D = R("FmTable");
|
|
1723
1737
|
return k(), I(H, null, [
|
|
1724
|
-
T(
|
|
1738
|
+
T(Qe, {
|
|
1725
1739
|
title: v(s)("inventory.closing.template.title"),
|
|
1726
1740
|
actions: b.value,
|
|
1727
1741
|
"onClick:action": x
|
|
@@ -1736,12 +1750,12 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1736
1750
|
}
|
|
1737
1751
|
])
|
|
1738
1752
|
}, [
|
|
1739
|
-
T(
|
|
1753
|
+
T(Xe, {
|
|
1740
1754
|
searchable: "",
|
|
1741
1755
|
search: u.value,
|
|
1742
1756
|
"onUpdate:search": A[0] || (A[0] = (S) => u.value = S)
|
|
1743
1757
|
}, null, 8, ["search"]),
|
|
1744
|
-
T(
|
|
1758
|
+
T(D, {
|
|
1745
1759
|
style: Ye(v(m).tableHeight),
|
|
1746
1760
|
"column-defs": v(d).columnDefs,
|
|
1747
1761
|
"row-data": v(d).templates,
|
|
@@ -1751,23 +1765,23 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1751
1765
|
"page-size": a.value
|
|
1752
1766
|
}, {
|
|
1753
1767
|
"list-row": P((S) => [
|
|
1754
|
-
T(
|
|
1768
|
+
T(Le, {
|
|
1755
1769
|
row: S,
|
|
1756
1770
|
onRowClick: (U) => v(l)(U)
|
|
1757
1771
|
}, {
|
|
1758
1772
|
default: P((U) => {
|
|
1759
|
-
var me, ue, de,
|
|
1773
|
+
var me, ue, de, W, pe, fe, ve, ge, q, ye, he, be, _e, xe, we, Q, ke, Te, $e, Ce, X, Ie;
|
|
1760
1774
|
return [
|
|
1761
1775
|
_("div", $n, [
|
|
1762
1776
|
_("div", Cn, [
|
|
1763
1777
|
_("div", In, [
|
|
1764
|
-
T(v(
|
|
1778
|
+
T(v(O), {
|
|
1765
1779
|
render: (de = (ue = (me = U._id) == null ? void 0 : me.column) == null ? void 0 : ue.columnDef) == null ? void 0 : de.cell,
|
|
1766
|
-
props: (pe = (
|
|
1780
|
+
props: (pe = (W = U._id) == null ? void 0 : W.getContext) == null ? void 0 : pe.call(W)
|
|
1767
1781
|
}, null, 8, ["render", "props"])
|
|
1768
1782
|
]),
|
|
1769
1783
|
_("div", Sn, [
|
|
1770
|
-
T(v(
|
|
1784
|
+
T(v(O), {
|
|
1771
1785
|
render: (ge = (ve = (fe = U.name) == null ? void 0 : fe.column) == null ? void 0 : ve.columnDef) == null ? void 0 : ge.cell,
|
|
1772
1786
|
props: (ye = (q = U.name) == null ? void 0 : q.getContext) == null ? void 0 : ye.call(q)
|
|
1773
1787
|
}, null, 8, ["render", "props"])
|
|
@@ -1775,19 +1789,19 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1775
1789
|
_("div", null, C((he = S.original.locations) != null && he.length ? v(s)("inventory.closing.table.enabledForN", {
|
|
1776
1790
|
count: ((be = S.original.locations) == null ? void 0 : be.length) ?? 0
|
|
1777
1791
|
}) : v(s)("inventory.closing.table.enabledForAll")), 1),
|
|
1778
|
-
_("div",
|
|
1779
|
-
...S.original.items.slice(0, 3).map((
|
|
1792
|
+
_("div", Mn, C([
|
|
1793
|
+
...S.original.items.slice(0, 3).map((je) => je.sku.name),
|
|
1780
1794
|
...S.original.items.length >= 3 ? [`and ${S.original.items.length - 3} more items`] : []
|
|
1781
1795
|
].join(", ")), 1),
|
|
1782
|
-
_("div",
|
|
1783
|
-
T(v(
|
|
1796
|
+
_("div", Dn, [
|
|
1797
|
+
T(v(O), {
|
|
1784
1798
|
render: (we = (xe = (_e = U.ref) == null ? void 0 : _e.column) == null ? void 0 : xe.columnDef) == null ? void 0 : we.cell,
|
|
1785
1799
|
props: (ke = (Q = U.ref) == null ? void 0 : Q.getContext) == null ? void 0 : ke.call(Q)
|
|
1786
1800
|
}, null, 8, ["render", "props"])
|
|
1787
1801
|
])
|
|
1788
1802
|
]),
|
|
1789
1803
|
_("div", null, [
|
|
1790
|
-
T(v(
|
|
1804
|
+
T(v(O), {
|
|
1791
1805
|
render: (Ce = ($e = (Te = U.status) == null ? void 0 : Te.column) == null ? void 0 : $e.columnDef) == null ? void 0 : Ce.cell,
|
|
1792
1806
|
props: (Ie = (X = U.status) == null ? void 0 : X.getContext) == null ? void 0 : Ie.call(X)
|
|
1793
1807
|
}, null, 8, ["render", "props"])
|
|
@@ -1804,9 +1818,9 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1804
1818
|
]),
|
|
1805
1819
|
_: 1
|
|
1806
1820
|
}, 8, ["title", "actions"]),
|
|
1807
|
-
(k(), V(
|
|
1808
|
-
T(un,
|
|
1809
|
-
T(rn,
|
|
1821
|
+
(k(), V(Ke, { to: "body" }, [
|
|
1822
|
+
T(un, Ge(Je(v(p))), null, 16),
|
|
1823
|
+
T(rn, We(v(y), {
|
|
1810
1824
|
onSubmitted: A[2] || (A[2] = (S) => v(d).fetchTemplates())
|
|
1811
1825
|
}), null, 16)
|
|
1812
1826
|
]))
|
|
@@ -1815,5 +1829,5 @@ const un = /* @__PURE__ */ ct(cn, [["render", mn]]), dn = { class: "flex flex-co
|
|
|
1815
1829
|
}
|
|
1816
1830
|
});
|
|
1817
1831
|
export {
|
|
1818
|
-
|
|
1832
|
+
Wn as default
|
|
1819
1833
|
};
|