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