@feedmepos/mf-inventory-portal 0.0.23-dev.31 → 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-CEmWJ9lp.js → App-DReDvY0M.js} +73 -85
- package/dist/{ApprovalView-jDll4AVe.js → ApprovalView-BMZlYmRk.js} +27 -24
- package/dist/{BindingsDialog-BC_gRSif.js → BindingsDialog-Y2K4I7H7.js} +4 -4
- package/dist/{BindingsPicker-BJsGoBzM.js → BindingsPicker-DKBq9c37.js} +9 -8
- package/dist/{BindingsTable-DSdwNK_q.js → BindingsTable-45v4SDfp.js} +22 -18
- package/dist/{ClosingTemplateView-BzG16gl5.js → ClosingTemplateView-CKJVYSbj.js} +286 -272
- package/dist/FmDroppableField-8RzKjEdL.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DW2IOPST.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-DDuZEf_v.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C1DjyjyH.js} +49 -48
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CiNvnaaE.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-zjvFEF5C.js} +5 -5
- package/dist/{IngredientGroupView-DL8eBhkk.js → IngredientGroupView-BuP-HGeg.js} +69 -63
- package/dist/IngredientsView-DMRN-odY.js +1613 -0
- package/dist/{IntegrationView-BeFT5S24.js → IntegrationView-kYCaKG0o.js} +95 -92
- package/dist/{InventoryBindingForm-DJ3uwq_X.js → InventoryBindingForm-BXHq4h-n.js} +1 -1
- package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DIviTipZ.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CVxJ_bV3.js} +27 -25
- package/dist/{InventoryBindingSummary-CvB5j9xq.js → InventoryBindingSummary-Bjasfc_v.js} +1 -1
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CQPdnXEF.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DM0C4raP.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BdscwUGn.js → PremiumBadge.vue_vue_type_script_setup_true_lang-C3O3JebE.js} +24 -23
- package/dist/{PurchaseOrderPrintPreview-3_6nBajH.js → PurchaseOrderPrintPreview-CmjkfTTS.js} +14 -13
- package/dist/{ReceiveRequestView-B_0UldQ7.js → ReceiveRequestView-aQZJO8sq.js} +1302 -1325
- package/dist/{RecipeView-D9p0Ou_I.js → RecipeView-DXO43tFi.js} +85 -79
- package/dist/{StockView-TIdUgG3O.js → StockView-D9no-mrA.js} +1446 -1338
- package/dist/{SupplierView-B1b9Otcr.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-BrpzJ7D3.js → UnitView-CQPGZ8-r.js} +44 -40
- package/dist/{WarehouseView-CjbdEy8o.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 +3 -3
- 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-DHYZglKx.js → decimal-BAc9M88Q.js} +1 -1
- package/dist/defineDeepModel-BfuQAIoM.js +13 -0
- package/dist/{feature-G-NnqKcY.js → feature-dwB4OxRQ.js} +6 -12
- package/dist/format-time-from-id-BbvzyIN6.js +15 -0
- package/dist/{format-unit-display-BWqJsV_R.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 +2 -70
- package/dist/stores/inventory.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/{supplier-DTUUR48O.js → supplier-DJC0UZWv.js} +15 -15
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-inventory-binding-dialog-DvC_i-Ih.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/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +0 -2
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -9
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -9
- 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-UfWdRXb-.js +0 -1190
- package/dist/IngredientsView-B_HC9fgq.js +0 -1657
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-jUYB4L8Y.js +0 -1275
- package/dist/TransferTemplateView-Dxk5b-2j.js +0 -1264
- package/dist/api/adjustment-template.d.ts +0 -23
- package/dist/api/closing-draft.d.ts +0 -6
- package/dist/app-AcMtTQ07.js +0 -84202
- package/dist/index-Bt8vaUdT.js +0 -12087
- package/dist/stock-VZXyPw2C.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
- package/dist/views/receive-request/components/netsuite/NetSuiteInfo.vue.d.ts +0 -12
- package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +0 -13
- package/dist/views/receive-request/components/netsuite/NetSuiteSync.vue.d.ts +0 -12
|
@@ -1,61 +1,70 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { F as ne, D as W, R as A } from "./row-action.enum-PMKMRrZR.js";
|
|
2
|
+
import { c as Ce } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
3
|
+
import { j as Ie, a as L, u as z, i as Ne, x as oe, s as Ae, c as Z, R as ae } from "./app-KnSMkJBV.js";
|
|
4
|
+
import { f as De } from "./format-time-from-id-BbvzyIN6.js";
|
|
2
5
|
import { useCoreStore as J, useI18n as X } from "@feedmepos/mf-common";
|
|
3
|
-
import { useDialogChild as
|
|
4
|
-
import { defineStore as
|
|
5
|
-
import { defineComponent as
|
|
6
|
-
import { useRouter as
|
|
7
|
-
import {
|
|
8
|
-
|
|
6
|
+
import { useDialogChild as Fe, useSnackbar as de, useDialog as Oe, FmButtonVariant as se, components as ie } from "@feedmepos/ui-library";
|
|
7
|
+
import { defineStore as pe } from "pinia";
|
|
8
|
+
import { defineComponent as fe, resolveComponent as B, openBlock as T, createElementBlock as w, createElementVNode as $, normalizeClass as M, createTextVNode as Pe, toDisplayString as I, unref as C, createCommentVNode as Q, createVNode as D, withCtx as G, Fragment as O, renderList as j, ref as R, onMounted as Ue, computed as le, watch as Be, createSlots as Me, createBlock as H, h as Y } from "vue";
|
|
9
|
+
import { useRouter as Qe } from "vue-router";
|
|
10
|
+
import { F as Le } from "./FmMultiselectDialog-D7YtdoyJ.js";
|
|
11
|
+
import { a as P, b as ye, d as he, s as ve, r as He } from "./xlsx.util-BSO4SHJi.js";
|
|
12
|
+
import { F as qe } from "./FmDroppableField-8RzKjEdL.js";
|
|
13
|
+
import { c as Ve, a as U, t as q, g as V, m as je, B as ze } from "./rules-C12nWDD1.js";
|
|
14
|
+
import { f as Ke } from "./date2-CIeUqUIc.js";
|
|
15
|
+
import { u as ee } from "./supplier-DJC0UZWv.js";
|
|
16
|
+
import { u as ge } from "./netsuite-ByWOS6tI.js";
|
|
17
|
+
const be = Ie((e, r) => {
|
|
9
18
|
function i() {
|
|
10
19
|
var n;
|
|
11
20
|
return `business_${((n = J().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
|
|
12
21
|
}
|
|
13
22
|
return {
|
|
14
|
-
async getTemplate(
|
|
15
|
-
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template/${
|
|
23
|
+
async getTemplate(c) {
|
|
24
|
+
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template/${c}`;
|
|
16
25
|
return r.get(n);
|
|
17
26
|
},
|
|
18
27
|
async readTemplates() {
|
|
19
|
-
const
|
|
28
|
+
const c = i(), a = `${e.inventoryBackendUrl}/${c}/purchase-order-template`;
|
|
20
29
|
return r.get(a);
|
|
21
30
|
},
|
|
22
|
-
async createTemplate(
|
|
31
|
+
async createTemplate(c) {
|
|
23
32
|
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
|
|
24
|
-
return r.post(n,
|
|
33
|
+
return r.post(n, c);
|
|
25
34
|
},
|
|
26
|
-
async updateTemplate(
|
|
35
|
+
async updateTemplate(c) {
|
|
27
36
|
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
|
|
28
|
-
return r.put(n,
|
|
37
|
+
return r.put(n, c);
|
|
29
38
|
},
|
|
30
|
-
async deleteTemplate(
|
|
39
|
+
async deleteTemplate(c) {
|
|
31
40
|
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template`;
|
|
32
|
-
return r.delete(n, { _id:
|
|
41
|
+
return r.delete(n, { _id: c._id, _rev: c._rev });
|
|
33
42
|
},
|
|
34
|
-
async importTemplates(
|
|
43
|
+
async importTemplates(c) {
|
|
35
44
|
const a = i(), n = `${e.inventoryBackendUrl}/${a}/purchase-order-template/import`;
|
|
36
|
-
return r.post(n,
|
|
45
|
+
return r.post(n, c);
|
|
37
46
|
}
|
|
38
47
|
};
|
|
39
48
|
});
|
|
40
49
|
function xe(e) {
|
|
41
|
-
const r = L(), i = e.sku,
|
|
42
|
-
if (
|
|
50
|
+
const r = L(), i = e.sku, c = r.skuById[i._id];
|
|
51
|
+
if (c.unit._id !== i.unit._id) return !0;
|
|
43
52
|
const a = e.measurement;
|
|
44
|
-
return a ? !r.unitById[
|
|
53
|
+
return a ? !r.unitById[c.unit._id].measurements.find((s) => s.id === a.id) : !1;
|
|
45
54
|
}
|
|
46
|
-
var
|
|
47
|
-
const
|
|
55
|
+
var E = /* @__PURE__ */ ((e) => (e.PURCHASE = "PURCHASE", e.TRANSFER = "TRANSFER", e))(E || {}), te = /* @__PURE__ */ ((e) => (e.Source = "Source", e.Destination = "Destination", e.Ingredient = "Ingredient", e))(te || {});
|
|
56
|
+
const me = Ve(0);
|
|
48
57
|
function Se(e) {
|
|
49
|
-
var
|
|
58
|
+
var c;
|
|
50
59
|
const r = e.sku;
|
|
51
60
|
return {
|
|
52
61
|
code: r.code,
|
|
53
62
|
name: r.name,
|
|
54
|
-
unit: ((
|
|
55
|
-
defaultQuantity: +
|
|
56
|
-
minimumQuantity: +
|
|
57
|
-
maximumQuantity: +
|
|
58
|
-
quantityStep: +
|
|
63
|
+
unit: ((c = r.unit.measurements.find((a) => a.id === r.trackingMeasurement)) == null ? void 0 : c.abbrev) ?? r.unit.abbrev,
|
|
64
|
+
defaultQuantity: +U(e.quantity),
|
|
65
|
+
minimumQuantity: +U(e.minimumQuantity ?? me),
|
|
66
|
+
maximumQuantity: +U(e.maximumQuantity ?? me),
|
|
67
|
+
quantityStep: +U(e.quantityStep)
|
|
59
68
|
};
|
|
60
69
|
}
|
|
61
70
|
function Te() {
|
|
@@ -94,7 +103,7 @@ function We(e) {
|
|
|
94
103
|
var s;
|
|
95
104
|
const i = J().currentBusiness.value, a = (s = e.map((l) => {
|
|
96
105
|
var f;
|
|
97
|
-
const
|
|
106
|
+
const m = l.purchaseOrder.items.map(Se), h = Te(), b = [
|
|
98
107
|
["Template ID", l._id],
|
|
99
108
|
["Template name", l.name],
|
|
100
109
|
["Business name", i == null ? void 0 : i.name],
|
|
@@ -102,7 +111,7 @@ function We(e) {
|
|
|
102
111
|
["Menu version", i == null ? void 0 : i.menuVersion],
|
|
103
112
|
[
|
|
104
113
|
"Purchase/Transfer",
|
|
105
|
-
typeof l.purchaseOrder.supplier.internal == "string" ?
|
|
114
|
+
typeof l.purchaseOrder.supplier.internal == "string" ? E.TRANSFER : E.PURCHASE
|
|
106
115
|
],
|
|
107
116
|
[
|
|
108
117
|
"Transfer from",
|
|
@@ -116,24 +125,24 @@ function We(e) {
|
|
|
116
125
|
["Remark", l.purchaseOrder.remark ?? ""],
|
|
117
126
|
[],
|
|
118
127
|
h.map((t) => t.name),
|
|
119
|
-
...
|
|
120
|
-
], v = h.map((t) => `system:${t.id}`), y =
|
|
128
|
+
...m.map((t) => h.map((S) => t[S.id]))
|
|
129
|
+
], v = h.map((t) => `system:${t.id}`), y = P(b, v);
|
|
121
130
|
return { name: l.name, sheet: y };
|
|
122
131
|
}).reduce(
|
|
123
|
-
(l,
|
|
132
|
+
(l, m) => {
|
|
124
133
|
var b;
|
|
125
|
-
const h =
|
|
126
|
-
return (b = l.sheetOccurence)[h] ?? (b[h] = 0), l.sheetOccurence[h] += 1, l.sheets[`${h} (${l.sheetOccurence[h]})`] =
|
|
134
|
+
const h = m.name.slice(0, 12);
|
|
135
|
+
return (b = l.sheetOccurence)[h] ?? (b[h] = 0), l.sheetOccurence[h] += 1, l.sheets[`${h} (${l.sheetOccurence[h]})`] = m.sheet, l;
|
|
127
136
|
},
|
|
128
137
|
{
|
|
129
138
|
sheets: {},
|
|
130
139
|
sheetOccurence: {}
|
|
131
140
|
}
|
|
132
|
-
)) == null ? void 0 : s.sheets, n = `${i == null ? void 0 : i.name} transfer templates (${
|
|
133
|
-
return
|
|
141
|
+
)) == null ? void 0 : s.sheets, n = `${i == null ? void 0 : i.name} transfer templates (${Ke(/* @__PURE__ */ new Date())}).xlsx`, p = ye(a);
|
|
142
|
+
return he(p, n), n;
|
|
134
143
|
}
|
|
135
144
|
function Ye() {
|
|
136
|
-
const e = J(), r = ee(), i = z(),
|
|
145
|
+
const e = J(), r = ee(), i = z(), c = L(), a = e.currentBusiness.value, n = Se({
|
|
137
146
|
sku: {
|
|
138
147
|
unit: {
|
|
139
148
|
_id: "",
|
|
@@ -186,7 +195,7 @@ function Ye() {
|
|
|
186
195
|
[],
|
|
187
196
|
p.map((t) => t.name),
|
|
188
197
|
p.map((t) => n[t.id])
|
|
189
|
-
], l = p.map((t) => `system:${t.id}`),
|
|
198
|
+
], l = p.map((t) => `system:${t.id}`), m = P(s, l), h = P(
|
|
190
199
|
[
|
|
191
200
|
...r.businessSuppliers.map((t) => [
|
|
192
201
|
`${t.name} (${t._id})`,
|
|
@@ -213,7 +222,7 @@ function Ye() {
|
|
|
213
222
|
})
|
|
214
223
|
],
|
|
215
224
|
["Name", "Type", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
|
|
216
|
-
), b =
|
|
225
|
+
), b = P(
|
|
217
226
|
i.locations.map((t) => {
|
|
218
227
|
var S, _, d, o, u, x;
|
|
219
228
|
return [
|
|
@@ -227,32 +236,32 @@ function Ye() {
|
|
|
227
236
|
];
|
|
228
237
|
}),
|
|
229
238
|
["Name", "Line 1", "Line 2", "City", "Postal", "State", "Country"]
|
|
230
|
-
), v =
|
|
231
|
-
|
|
239
|
+
), v = P(
|
|
240
|
+
c.skus.map((t) => [
|
|
232
241
|
t.code,
|
|
233
242
|
t.name,
|
|
234
243
|
t.unit.abbrev,
|
|
235
244
|
...t.unit.measurements.map((S) => S.abbrev)
|
|
236
245
|
]),
|
|
237
246
|
["Code", "Name", "Base unit", "Measurements"]
|
|
238
|
-
), y =
|
|
239
|
-
Template:
|
|
247
|
+
), y = ye({
|
|
248
|
+
Template: m,
|
|
240
249
|
Source: h,
|
|
241
250
|
Destination: b,
|
|
242
251
|
Ingredient: v
|
|
243
252
|
}), f = `${a == null ? void 0 : a.name} transfer templates import.xlsx`;
|
|
244
|
-
return
|
|
253
|
+
return he(y, f), f;
|
|
245
254
|
}
|
|
246
255
|
function Ge(e, r) {
|
|
247
|
-
const i = new Array(),
|
|
248
|
-
if (!
|
|
256
|
+
const i = new Array(), c = /(.*) \(((supplier_|warehouse_|restaurant_).{24,})\)/, n = z().locationByDbName, s = ee().supplierById, l = e.trim(), m = c.exec(l);
|
|
257
|
+
if (!m)
|
|
249
258
|
return i.push(`Transfer from location value of ${l} cannot be read.`), {
|
|
250
259
|
errors: i
|
|
251
260
|
};
|
|
252
|
-
const h =
|
|
261
|
+
const h = m[1], b = m[2];
|
|
253
262
|
let v;
|
|
254
263
|
if (b.startsWith("supplier"))
|
|
255
|
-
v = s[b], r !==
|
|
264
|
+
v = s[b], r !== E.PURCHASE && i.push(`Expected transfer type Purchase but found ${r} instead.`);
|
|
256
265
|
else {
|
|
257
266
|
const y = n[b];
|
|
258
267
|
if (!y)
|
|
@@ -272,7 +281,7 @@ function Ge(e, r) {
|
|
|
272
281
|
postcode: "",
|
|
273
282
|
coordinates: [0, 0]
|
|
274
283
|
},
|
|
275
|
-
internal: b.split("_")[0] === "restaurant" ?
|
|
284
|
+
internal: b.split("_")[0] === "restaurant" ? oe.enum.restaurant : oe.enum.warehouse,
|
|
276
285
|
phoneNumber: y.doc.profile.phoneNo ?? "",
|
|
277
286
|
email: y.doc.profile.email ?? "",
|
|
278
287
|
_rev: "",
|
|
@@ -288,20 +297,20 @@ function Ge(e, r) {
|
|
|
288
297
|
function Ze(e) {
|
|
289
298
|
if (!e.length || `${e[0]}`.toLocaleLowerCase() === "all")
|
|
290
299
|
return [];
|
|
291
|
-
const r = /(.*) \(((warehouse_|restaurant_).{24,})\)/,
|
|
300
|
+
const r = /(.*) \(((warehouse_|restaurant_).{24,})\)/, c = z().locationByDbName;
|
|
292
301
|
return e.map((a) => {
|
|
293
302
|
const n = new Array(), p = a.trim(), s = r.exec(p);
|
|
294
303
|
if (!s)
|
|
295
304
|
return n.push(`Enabled location value of ${p} cannot be read.`), {
|
|
296
305
|
errors: n
|
|
297
306
|
};
|
|
298
|
-
const l = s[1],
|
|
307
|
+
const l = s[1], m = s[2], h = c[m];
|
|
299
308
|
return h ? (l !== h.name && n.push(
|
|
300
|
-
`Location id ${
|
|
309
|
+
`Location id ${m} has non-matching name. Found ${l} but expected ${h.name}`
|
|
301
310
|
), {
|
|
302
311
|
errors: n,
|
|
303
312
|
location: h
|
|
304
|
-
}) : (n.push(`Location (${l}) of id ${
|
|
313
|
+
}) : (n.push(`Location (${l}) of id ${m} is not found.`), {
|
|
305
314
|
errors: n
|
|
306
315
|
});
|
|
307
316
|
});
|
|
@@ -310,22 +319,22 @@ function Je(e) {
|
|
|
310
319
|
const [
|
|
311
320
|
r,
|
|
312
321
|
i,
|
|
313
|
-
|
|
322
|
+
c,
|
|
314
323
|
a,
|
|
315
324
|
n,
|
|
316
325
|
p,
|
|
317
326
|
s,
|
|
318
327
|
l,
|
|
319
|
-
|
|
328
|
+
m,
|
|
320
329
|
h,
|
|
321
330
|
b
|
|
322
|
-
] =
|
|
331
|
+
] = ve(e);
|
|
323
332
|
return {
|
|
324
333
|
id: `${i[1] ?? ""}`.trim(),
|
|
325
|
-
name: `${
|
|
326
|
-
type: `${s[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ?
|
|
334
|
+
name: `${c[1] ?? ""}`.trim(),
|
|
335
|
+
type: `${s[1] ?? ""}`.trim().toLocaleLowerCase() === "transfer" ? E.TRANSFER : E.PURCHASE,
|
|
327
336
|
transferFrom: `${l[1] ?? ""}`.trim(),
|
|
328
|
-
locations:
|
|
337
|
+
locations: m.slice(1).map((v) => `${v}`.trim()).filter((v) => v),
|
|
329
338
|
reference: `${h[1] ?? ""}`.trim(),
|
|
330
339
|
remark: `${b[1] ?? ""}`.trim()
|
|
331
340
|
};
|
|
@@ -334,19 +343,19 @@ function Xe(e) {
|
|
|
334
343
|
const [
|
|
335
344
|
r,
|
|
336
345
|
i,
|
|
337
|
-
|
|
346
|
+
c,
|
|
338
347
|
a,
|
|
339
348
|
n,
|
|
340
349
|
p,
|
|
341
350
|
s,
|
|
342
351
|
l,
|
|
343
|
-
|
|
352
|
+
m,
|
|
344
353
|
h,
|
|
345
354
|
b,
|
|
346
355
|
v,
|
|
347
356
|
y,
|
|
348
357
|
...f
|
|
349
|
-
] =
|
|
358
|
+
] = ve(e);
|
|
350
359
|
if (!r || !r.length || r.some((o) => o.length && !o.startsWith("system:")))
|
|
351
360
|
throw new Error("Missing meta header. Excel file does not come from the template.");
|
|
352
361
|
const t = r.map((o) => o.split(":")[1]), _ = [
|
|
@@ -406,25 +415,25 @@ function et(e, r, i) {
|
|
|
406
415
|
templateItem: u
|
|
407
416
|
};
|
|
408
417
|
}
|
|
409
|
-
const l =
|
|
418
|
+
const l = q(
|
|
410
419
|
e.quantityStep,
|
|
411
|
-
|
|
420
|
+
V(p, s)
|
|
412
421
|
);
|
|
413
422
|
(Number.isNaN(Number(e.quantityStep)) || Number(e.quantityStep) <= 0) && n.push("Amount step must be more than 0");
|
|
414
|
-
const
|
|
423
|
+
const m = je(l), h = q(
|
|
415
424
|
e.minimumQuantity,
|
|
416
|
-
|
|
417
|
-
), b =
|
|
425
|
+
V(p, s)
|
|
426
|
+
), b = m(h);
|
|
418
427
|
typeof b == "string" && n.push(`Minimum amount: ${b}`);
|
|
419
|
-
const v =
|
|
428
|
+
const v = q(
|
|
420
429
|
e.maximumQuantity,
|
|
421
|
-
|
|
422
|
-
), y =
|
|
430
|
+
V(p, s)
|
|
431
|
+
), y = m(v);
|
|
423
432
|
typeof y == "string" && n.push(`Maximum amount: ${y}`), +e.minimumQuantity > +e.maximumQuantity && n.push("Minimum amount must be less than or equal to maximum amount");
|
|
424
|
-
const f =
|
|
433
|
+
const f = ze(+e.minimumQuantity, +e.maximumQuantity), t = q(
|
|
425
434
|
e.defaultQuantity,
|
|
426
|
-
|
|
427
|
-
), S =
|
|
435
|
+
V(p, s)
|
|
436
|
+
), S = m(t), _ = f(`${e.defaultQuantity}`);
|
|
428
437
|
typeof S == "string" && n.push(`Default amount: ${S}`), typeof _ == "string" && n.push(`Default amount: ${_}`);
|
|
429
438
|
const d = {
|
|
430
439
|
sku: a,
|
|
@@ -445,14 +454,14 @@ function et(e, r, i) {
|
|
|
445
454
|
function tt(e) {
|
|
446
455
|
const r = e.SheetNames.filter(
|
|
447
456
|
(n) => !Object.values(te).map(String).includes(n)
|
|
448
|
-
),
|
|
457
|
+
), c = $e().templates, a = Ne(c, "_id");
|
|
449
458
|
try {
|
|
450
459
|
return r.reduce(
|
|
451
460
|
(n, p) => {
|
|
452
461
|
var o;
|
|
453
|
-
const s = new Array(), l = e.Sheets[p],
|
|
462
|
+
const s = new Array(), l = e.Sheets[p], m = Je(l), h = Ge(m.transferFrom, m.type);
|
|
454
463
|
s.push(...h.errors);
|
|
455
|
-
const b = h.from, v = Ze(
|
|
464
|
+
const b = h.from, v = Ze(m.locations), y = v.filter((u) => u.location).map((u) => u.location);
|
|
456
465
|
s.push(...v.flatMap((u) => u.errors));
|
|
457
466
|
const f = Xe(l).filter((u) => u.data.code), t = f.map(
|
|
458
467
|
(u, x) => et(u.data, x, f)
|
|
@@ -463,16 +472,16 @@ function tt(e) {
|
|
|
463
472
|
)
|
|
464
473
|
);
|
|
465
474
|
const S = t.filter((u) => u.templateItem).map((u) => u.templateItem);
|
|
466
|
-
if (
|
|
467
|
-
const u = a[
|
|
475
|
+
if (m.id) {
|
|
476
|
+
const u = a[m.id];
|
|
468
477
|
if (!u) {
|
|
469
478
|
const k = {
|
|
470
|
-
_id:
|
|
479
|
+
_id: m.id,
|
|
471
480
|
_rev: "",
|
|
472
|
-
name:
|
|
481
|
+
name: m.name || `(unnamed from sheet ${p || "<unnamed sheet>"})`,
|
|
473
482
|
purchaseOrder: rt()
|
|
474
483
|
};
|
|
475
|
-
return s.push(`Template ID ${
|
|
484
|
+
return s.push(`Template ID ${m.id} is not found.`), n.importUpdateResult.push({
|
|
476
485
|
type: "update",
|
|
477
486
|
original: k,
|
|
478
487
|
template: k,
|
|
@@ -485,13 +494,13 @@ function tt(e) {
|
|
|
485
494
|
original: u,
|
|
486
495
|
template: {
|
|
487
496
|
...u,
|
|
488
|
-
name:
|
|
497
|
+
name: m.name,
|
|
489
498
|
locations: y.length ? y : null,
|
|
490
499
|
purchaseOrder: {
|
|
491
500
|
...u.purchaseOrder,
|
|
492
501
|
supplier: b ?? ((o = u.purchaseOrder) == null ? void 0 : o.supplier),
|
|
493
|
-
ref:
|
|
494
|
-
remark:
|
|
502
|
+
ref: m.reference,
|
|
503
|
+
remark: m.remark,
|
|
495
504
|
items: S
|
|
496
505
|
}
|
|
497
506
|
},
|
|
@@ -503,12 +512,12 @@ function tt(e) {
|
|
|
503
512
|
const d = {
|
|
504
513
|
type: "create",
|
|
505
514
|
template: {
|
|
506
|
-
name:
|
|
515
|
+
name: m.id,
|
|
507
516
|
locations: y,
|
|
508
517
|
purchaseOrder: {
|
|
509
518
|
supplier: b ?? _e(),
|
|
510
|
-
ref:
|
|
511
|
-
remark:
|
|
519
|
+
ref: m.reference,
|
|
520
|
+
remark: m.remark,
|
|
512
521
|
items: S
|
|
513
522
|
}
|
|
514
523
|
},
|
|
@@ -557,7 +566,7 @@ function rt() {
|
|
|
557
566
|
const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-col" }, at = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, st = { class: "text-fm-color-typo-secondary fm-typo-en-body-md-400" }, it = {
|
|
558
567
|
key: 0,
|
|
559
568
|
class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
|
|
560
|
-
}, lt = { key: 0 },
|
|
569
|
+
}, lt = { key: 0 }, ce = /* @__PURE__ */ fe({
|
|
561
570
|
__name: "TransferTemplateImportItem",
|
|
562
571
|
props: {
|
|
563
572
|
type: {},
|
|
@@ -570,29 +579,29 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
570
579
|
setup(e) {
|
|
571
580
|
return (r, i) => {
|
|
572
581
|
var n, p, s;
|
|
573
|
-
const
|
|
582
|
+
const c = B("FmIcon"), a = B("FmTooltip");
|
|
574
583
|
return T(), w("div", nt, [
|
|
575
584
|
i[0] || (i[0] = $("div", null, "•", -1)),
|
|
576
585
|
$("div", ot, [
|
|
577
586
|
$("div", at, [
|
|
578
587
|
$("div", {
|
|
579
|
-
class:
|
|
588
|
+
class: M({
|
|
580
589
|
"text-fm-color-system-error-300": r.errors.length
|
|
581
590
|
})
|
|
582
591
|
}, [
|
|
583
|
-
|
|
584
|
-
$("span", st, " (" + I(C(
|
|
592
|
+
Pe(I(r.name) + " ", 1),
|
|
593
|
+
$("span", st, " (" + I(C(Ae)(`${r.transferType}`)) + ") ", 1),
|
|
585
594
|
r.type === "create" ? (T(), w("span", it, "(new)")) : Q("", !0)
|
|
586
595
|
], 2),
|
|
587
596
|
r.errors.length ? (T(), w("div", lt, [
|
|
588
597
|
D(a, { "z-index": 50 }, {
|
|
589
598
|
content: G(() => [
|
|
590
599
|
$("ol", null, [
|
|
591
|
-
(T(!0), w(
|
|
600
|
+
(T(!0), w(O, null, j(r.errors, (l, m) => (T(), w("li", { key: m }, I(l), 1))), 128))
|
|
592
601
|
])
|
|
593
602
|
]),
|
|
594
603
|
default: G(() => [
|
|
595
|
-
D(
|
|
604
|
+
D(c, {
|
|
596
605
|
name: "error",
|
|
597
606
|
size: "sm",
|
|
598
607
|
color: "system-error-300"
|
|
@@ -603,7 +612,7 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
603
612
|
])) : Q("", !0)
|
|
604
613
|
]),
|
|
605
614
|
$("div", {
|
|
606
|
-
class:
|
|
615
|
+
class: M([
|
|
607
616
|
"fm-typo-en-body-sm-400",
|
|
608
617
|
{
|
|
609
618
|
"text-fm-color-system-error-200": r.errors.length,
|
|
@@ -615,7 +624,7 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
615
624
|
]);
|
|
616
625
|
};
|
|
617
626
|
}
|
|
618
|
-
}),
|
|
627
|
+
}), mt = { class: "flex flex-col gap-24" }, ct = {
|
|
619
628
|
key: 0,
|
|
620
629
|
class: "flex items-center gap-8"
|
|
621
630
|
}, ut = { class: "flex flex-col gap-8" }, dt = { class: "line-clamp-2 text-ellipsis break-all" }, pt = {
|
|
@@ -627,16 +636,16 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
627
636
|
}, yt = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, ht = {
|
|
628
637
|
key: 0,
|
|
629
638
|
class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
|
|
630
|
-
}, vt = { class: "fm-typo-en-body-lg-600" }, gt = /* @__PURE__ */
|
|
639
|
+
}, vt = { class: "fm-typo-en-body-lg-600" }, gt = /* @__PURE__ */ fe({
|
|
631
640
|
__name: "TransferTemplateImport",
|
|
632
641
|
setup(e) {
|
|
633
|
-
const r =
|
|
634
|
-
|
|
642
|
+
const r = R(null), i = Fe(), c = de(), a = R(!1), n = R(!1), p = ee();
|
|
643
|
+
Ue(async () => {
|
|
635
644
|
n.value = !0;
|
|
636
645
|
try {
|
|
637
646
|
await p.readSuppliers().delayed(1e3);
|
|
638
647
|
} catch {
|
|
639
|
-
|
|
648
|
+
c.open({
|
|
640
649
|
title: "Something went wrong.",
|
|
641
650
|
message: "Error at reading suppliers list. Please try again.",
|
|
642
651
|
type: "error"
|
|
@@ -645,17 +654,17 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
645
654
|
n.value = !1;
|
|
646
655
|
}
|
|
647
656
|
});
|
|
648
|
-
const s =
|
|
649
|
-
() => !!s.value.length || l.value.some((f) => f.errors.length) ||
|
|
657
|
+
const s = R(new Array()), l = R([]), m = R([]), h = le(
|
|
658
|
+
() => !!s.value.length || l.value.some((f) => f.errors.length) || m.value.some((f) => f.errors.length)
|
|
650
659
|
), b = le(
|
|
651
|
-
() => !!l.value.length || !!
|
|
660
|
+
() => !!l.value.length || !!m.value.length
|
|
652
661
|
), { t: v } = X();
|
|
653
662
|
async function y(f) {
|
|
654
|
-
s.value = [], l.value = [],
|
|
663
|
+
s.value = [], l.value = [], m.value = [];
|
|
655
664
|
try {
|
|
656
665
|
a.value = !0;
|
|
657
666
|
const [t] = await Promise.all([
|
|
658
|
-
|
|
667
|
+
He(f),
|
|
659
668
|
// fake buffer
|
|
660
669
|
new Promise((o) => setTimeout(o, 1e3))
|
|
661
670
|
]);
|
|
@@ -672,31 +681,31 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
672
681
|
);
|
|
673
682
|
return;
|
|
674
683
|
}
|
|
675
|
-
if (l.value = d.importCreateResult,
|
|
684
|
+
if (l.value = d.importCreateResult, m.value = d.importUpdateResult, !l.value.length && !m.value.length) {
|
|
676
685
|
s.value.push(v("inventory.ingredient.import.fileError.noData"));
|
|
677
686
|
return;
|
|
678
687
|
}
|
|
679
688
|
i.emitData(d);
|
|
680
689
|
} catch (t) {
|
|
681
|
-
|
|
690
|
+
c.open({
|
|
682
691
|
title: v("inventory.ingredient.import.fileError.unableToRead"),
|
|
683
692
|
message: t == null ? void 0 : t.message,
|
|
684
693
|
type: "error"
|
|
685
694
|
}), console.error("Error in reading file", t);
|
|
686
695
|
} finally {
|
|
687
|
-
s.value.length &&
|
|
696
|
+
s.value.length && c.open({
|
|
688
697
|
title: v("inventory.ingredient.import.fileError.invalidExcel"),
|
|
689
698
|
type: "error"
|
|
690
699
|
}), a.value = !1;
|
|
691
700
|
}
|
|
692
701
|
}
|
|
693
|
-
return
|
|
702
|
+
return Be(r, (f) => {
|
|
694
703
|
f && y(f);
|
|
695
704
|
}), (f, t) => {
|
|
696
|
-
const S =
|
|
697
|
-
return T(), w("div",
|
|
705
|
+
const S = B("FmCircularProgress"), _ = B("FmIcon"), d = B("FmButton");
|
|
706
|
+
return T(), w("div", mt, [
|
|
698
707
|
t[2] || (t[2] = $("div", { class: "fm-typo-en-body-md-400" }, "Import transfer templates from excel sheets.", -1)),
|
|
699
|
-
n.value ? (T(), w("div",
|
|
708
|
+
n.value ? (T(), w("div", ct, [
|
|
700
709
|
$("div", null, [
|
|
701
710
|
D(S, {
|
|
702
711
|
size: "md",
|
|
@@ -704,9 +713,9 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
704
713
|
})
|
|
705
714
|
]),
|
|
706
715
|
t[1] || (t[1] = $("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "Loading...", -1))
|
|
707
|
-
])) : (T(), w(
|
|
708
|
-
D(
|
|
709
|
-
class:
|
|
716
|
+
])) : (T(), w(O, { key: 1 }, [
|
|
717
|
+
D(qe, {
|
|
718
|
+
class: M({
|
|
710
719
|
"w-full": !0,
|
|
711
720
|
"h-[200px]": !r.value
|
|
712
721
|
}),
|
|
@@ -714,13 +723,13 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
714
723
|
onFileUpload: t[0] || (t[0] = (o) => r.value = o),
|
|
715
724
|
label: C(v)("inventory.ingredient.import.uploadTemplate"),
|
|
716
725
|
"button-label": C(v)("inventory.ingredient.import.selectFile")
|
|
717
|
-
},
|
|
726
|
+
}, Me({ _: 2 }, [
|
|
718
727
|
r.value ? {
|
|
719
728
|
name: "default",
|
|
720
729
|
fn: G(({ openFileDialog: o }) => [
|
|
721
730
|
$("div", ut, [
|
|
722
731
|
$("div", {
|
|
723
|
-
class:
|
|
732
|
+
class: M([
|
|
724
733
|
"fm-corner-radius-md p-16 flex items-center gap-16",
|
|
725
734
|
{
|
|
726
735
|
"border border-fm-color-neutral-gray-100": a.value,
|
|
@@ -729,18 +738,18 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
729
738
|
}
|
|
730
739
|
])
|
|
731
740
|
}, [
|
|
732
|
-
a.value ? (T(),
|
|
741
|
+
a.value ? (T(), H(S, {
|
|
733
742
|
key: 0,
|
|
734
743
|
size: "md",
|
|
735
744
|
color: "neutral-gray-200"
|
|
736
|
-
})) : (T(),
|
|
745
|
+
})) : (T(), H(_, {
|
|
737
746
|
key: 1,
|
|
738
747
|
name: h.value ? "error" : "attach_file",
|
|
739
748
|
outline: "",
|
|
740
749
|
color: h.value ? "system-error-300" : void 0
|
|
741
750
|
}, null, 8, ["name", "color"])),
|
|
742
751
|
$("div", {
|
|
743
|
-
class:
|
|
752
|
+
class: M([
|
|
744
753
|
"fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
|
|
745
754
|
{
|
|
746
755
|
"text-fm-color-typo-disabled": a.value,
|
|
@@ -760,7 +769,7 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
760
769
|
]))
|
|
761
770
|
], 2),
|
|
762
771
|
s.value.length ? (T(), w("div", ft, [
|
|
763
|
-
(T(!0), w(
|
|
772
|
+
(T(!0), w(O, null, j(s.value, (u, x) => (T(), w("div", {
|
|
764
773
|
key: x,
|
|
765
774
|
class: "flex gap-8 items-center"
|
|
766
775
|
}, [
|
|
@@ -779,19 +788,19 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
779
788
|
]), 1032, ["class", "label", "button-label"]),
|
|
780
789
|
b.value ? (T(), w("div", ht, [
|
|
781
790
|
$("div", vt, I(C(v)("inventory.ingredient.import.summary")), 1),
|
|
782
|
-
(T(!0), w(
|
|
791
|
+
(T(!0), w(O, null, j(l.value, (o, u) => (T(), H(ce, {
|
|
783
792
|
key: u,
|
|
784
793
|
name: o.template.name,
|
|
785
|
-
"transfer-type": typeof o.template.purchaseOrder.supplier.internal == "string" ? C(
|
|
794
|
+
"transfer-type": typeof o.template.purchaseOrder.supplier.internal == "string" ? C(E).TRANSFER : C(E).PURCHASE,
|
|
786
795
|
locations: o.template.locations,
|
|
787
796
|
items: o.template.purchaseOrder.items,
|
|
788
797
|
errors: o.errors,
|
|
789
798
|
type: "create"
|
|
790
799
|
}, null, 8, ["name", "transfer-type", "locations", "items", "errors"]))), 128)),
|
|
791
|
-
(T(!0), w(
|
|
800
|
+
(T(!0), w(O, null, j(m.value, (o) => (T(), H(ce, {
|
|
792
801
|
key: o.template._id,
|
|
793
802
|
name: o.template.name,
|
|
794
|
-
"transfer-type": typeof o.template.purchaseOrder.supplier.internal == "string" ? C(
|
|
803
|
+
"transfer-type": typeof o.template.purchaseOrder.supplier.internal == "string" ? C(E).TRANSFER : C(E).PURCHASE,
|
|
795
804
|
locations: o.template.locations,
|
|
796
805
|
items: o.template.purchaseOrder.items,
|
|
797
806
|
errors: o.errors,
|
|
@@ -805,20 +814,20 @@ const nt = { class: "flex items-center gap-12 pl-8" }, ot = { class: "flex flex-
|
|
|
805
814
|
});
|
|
806
815
|
function bt(e) {
|
|
807
816
|
var n, p;
|
|
808
|
-
const r =
|
|
817
|
+
const r = ge();
|
|
809
818
|
if (!r.isEnabled) return !0;
|
|
810
819
|
if (!e.internal) {
|
|
811
|
-
const s = r.getNetSuiteVendor(e._id), l = s == null ? void 0 : s.subsidiaryId,
|
|
812
|
-
return l && l ==
|
|
820
|
+
const s = r.getNetSuiteVendor(e._id), l = s == null ? void 0 : s.subsidiaryId, m = (n = r.currentVendorSubsidiary(e._id)) == null ? void 0 : n.id;
|
|
821
|
+
return l && l == m;
|
|
813
822
|
}
|
|
814
|
-
const i = r.getNetSuiteLocation(`${e.internal}_${e._id}`),
|
|
815
|
-
return
|
|
823
|
+
const i = r.getNetSuiteLocation(`${e.internal}_${e._id}`), c = r.getLocationSubsidiary(i == null ? void 0 : i.netSuiteId).id, a = (p = r.currentLocationSubsidiary()) == null ? void 0 : p.id;
|
|
824
|
+
return c && c == a;
|
|
816
825
|
}
|
|
817
|
-
const xt =
|
|
818
|
-
const e =
|
|
819
|
-
function
|
|
826
|
+
const xt = pe("transferTemplateActions", () => {
|
|
827
|
+
const e = Oe(), r = de(), i = z(), c = $e(), a = be(), n = ge(), p = Qe(), { t: s } = X(), l = R({});
|
|
828
|
+
function m() {
|
|
820
829
|
l.value = {
|
|
821
|
-
mode:
|
|
830
|
+
mode: ne.CREATE,
|
|
822
831
|
show: !0,
|
|
823
832
|
"onUpdate:show"(d) {
|
|
824
833
|
l.value.show = d;
|
|
@@ -827,7 +836,7 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
827
836
|
}
|
|
828
837
|
function h(d) {
|
|
829
838
|
l.value = {
|
|
830
|
-
mode:
|
|
839
|
+
mode: ne.UPDATE,
|
|
831
840
|
modelValue: d,
|
|
832
841
|
show: !0,
|
|
833
842
|
"onUpdate:show"(o) {
|
|
@@ -876,7 +885,7 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
876
885
|
}
|
|
877
886
|
});
|
|
878
887
|
}
|
|
879
|
-
const v =
|
|
888
|
+
const v = R({});
|
|
880
889
|
function y(d) {
|
|
881
890
|
v.value = {
|
|
882
891
|
template: d,
|
|
@@ -892,10 +901,10 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
892
901
|
function f() {
|
|
893
902
|
const { promise: d, resolve: o } = Promise.withResolvers(), u = (g) => {
|
|
894
903
|
o(g);
|
|
895
|
-
}, x =
|
|
904
|
+
}, x = c.templates.filter(
|
|
896
905
|
(g) => {
|
|
897
906
|
var N;
|
|
898
|
-
return (!g.locations || g.locations.find((
|
|
907
|
+
return (!g.locations || g.locations.find((F) => F.doc._id === i.currentLocation.doc._id)) && ((N = g.purchaseOrder.supplier) == null ? void 0 : N._id) !== i.currentLocation.doc._id;
|
|
899
908
|
}
|
|
900
909
|
);
|
|
901
910
|
if (!x.length)
|
|
@@ -915,20 +924,20 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
915
924
|
}).onSecondary(() => u(void 0)).onClose(() => u(void 0)), d;
|
|
916
925
|
const k = x.map((g) => {
|
|
917
926
|
var re;
|
|
918
|
-
const N = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(xe),
|
|
927
|
+
const N = !g.purchaseOrder.items.length || g.purchaseOrder.items.some(xe), F = !bt(g.purchaseOrder.supplier), K = g.purchaseOrder.supplier.internal ? n.getNetSuiteLocation(
|
|
919
928
|
`${g.purchaseOrder.supplier.internal}_${g.purchaseOrder.supplier._id}`
|
|
920
|
-
) : n.getNetSuiteVendor(g.purchaseOrder.supplier._id), we =
|
|
921
|
-
location is ${(re = n.getLocationSubsidiary(K == null ? void 0 : K.netSuiteId)) == null ? void 0 : re.fullName}.` : void 0, ke = N ||
|
|
929
|
+
) : n.getNetSuiteVendor(g.purchaseOrder.supplier._id), we = F ? `The subsidiary of the request
|
|
930
|
+
location is ${(re = n.getLocationSubsidiary(K == null ? void 0 : K.netSuiteId)) == null ? void 0 : re.fullName}.` : void 0, ke = N || F, Re = N ? "This template is invalid. Update this template." : F ? we : void 0, Ee = `${g.purchaseOrder.supplier.internal ? "Transfer" : "Purchase"} from ${g.purchaseOrder.supplier.name}`;
|
|
922
931
|
return {
|
|
923
932
|
label: g.name,
|
|
924
933
|
value: g._id,
|
|
925
934
|
disabled: ke,
|
|
926
|
-
sublabel:
|
|
935
|
+
sublabel: Re ?? Ee
|
|
927
936
|
};
|
|
928
937
|
});
|
|
929
938
|
return k.sort((g, N) => +!!g.disabled - +!!N.disabled), e.open({
|
|
930
939
|
title: "Select one template",
|
|
931
|
-
contentComponent:
|
|
940
|
+
contentComponent: Le,
|
|
932
941
|
contentComponentProps: {
|
|
933
942
|
items: k,
|
|
934
943
|
singleSelect: !0
|
|
@@ -1027,11 +1036,11 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
1027
1036
|
type: "error"
|
|
1028
1037
|
}), console.error("Error in importing skus", d, o);
|
|
1029
1038
|
} finally {
|
|
1030
|
-
|
|
1039
|
+
c.fetchTemplates();
|
|
1031
1040
|
}
|
|
1032
1041
|
}
|
|
1033
1042
|
function _() {
|
|
1034
|
-
const d = We(
|
|
1043
|
+
const d = We(c.templates);
|
|
1035
1044
|
r.open({
|
|
1036
1045
|
title: s("inventory.ingredient.export.success"),
|
|
1037
1046
|
message: s("inventory.ingredient.export.filename", [d]),
|
|
@@ -1039,7 +1048,7 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
1039
1048
|
});
|
|
1040
1049
|
}
|
|
1041
1050
|
return {
|
|
1042
|
-
createTemplate:
|
|
1051
|
+
createTemplate: m,
|
|
1043
1052
|
viewTemplate: y,
|
|
1044
1053
|
updateTemplate: h,
|
|
1045
1054
|
deleteTemplate: b,
|
|
@@ -1052,13 +1061,13 @@ const xt = ve("transferTemplateActions", () => {
|
|
|
1052
1061
|
});
|
|
1053
1062
|
function ue(e) {
|
|
1054
1063
|
const { skuById: r } = L(), i = Z(e);
|
|
1055
|
-
return i.purchaseOrder.items = e.purchaseOrder.items.filter((
|
|
1064
|
+
return i.purchaseOrder.items = e.purchaseOrder.items.filter((c) => r[c.sku._id]), i;
|
|
1056
1065
|
}
|
|
1057
|
-
const $e =
|
|
1066
|
+
const $e = pe(
|
|
1058
1067
|
"transferTemplateTable",
|
|
1059
1068
|
function() {
|
|
1060
|
-
const { t: r } = X(), { viewTemplate: i, updateTemplate:
|
|
1061
|
-
async function
|
|
1069
|
+
const { t: r } = X(), { viewTemplate: i, updateTemplate: c, deleteTemplate: a } = xt(), n = R(!1), p = R(new Array()), s = be(), l = L();
|
|
1070
|
+
async function m() {
|
|
1062
1071
|
p.value = [], n.value = !0;
|
|
1063
1072
|
try {
|
|
1064
1073
|
const [y] = await Promise.all([
|
|
@@ -1091,9 +1100,9 @@ const $e = ve(
|
|
|
1091
1100
|
case A.Details:
|
|
1092
1101
|
return i(f);
|
|
1093
1102
|
case A.Edit:
|
|
1094
|
-
return
|
|
1103
|
+
return c(f);
|
|
1095
1104
|
case A.Delete:
|
|
1096
|
-
return a(f, n,
|
|
1105
|
+
return a(f, n, m);
|
|
1097
1106
|
}
|
|
1098
1107
|
}
|
|
1099
1108
|
return {
|
|
@@ -1103,7 +1112,7 @@ const $e = ve(
|
|
|
1103
1112
|
accessorKey: "_id",
|
|
1104
1113
|
header: () => r("inventory.transfer.table.createdAt"),
|
|
1105
1114
|
cell(y) {
|
|
1106
|
-
return
|
|
1115
|
+
return De(`${y.getValue()}`);
|
|
1107
1116
|
},
|
|
1108
1117
|
enableSorting: !0
|
|
1109
1118
|
},
|
|
@@ -1176,7 +1185,7 @@ const $e = ve(
|
|
|
1176
1185
|
W[A.Edit],
|
|
1177
1186
|
W[A.Delete]
|
|
1178
1187
|
];
|
|
1179
|
-
return
|
|
1188
|
+
return Ce(t, (S) => b(S, f));
|
|
1180
1189
|
},
|
|
1181
1190
|
enableSorting: !1,
|
|
1182
1191
|
size: 40,
|
|
@@ -1188,20 +1197,20 @@ const $e = ve(
|
|
|
1188
1197
|
],
|
|
1189
1198
|
templates: p,
|
|
1190
1199
|
loading: n,
|
|
1191
|
-
fetchTemplates:
|
|
1200
|
+
fetchTemplates: m,
|
|
1192
1201
|
loadTemplate: h
|
|
1193
1202
|
};
|
|
1194
1203
|
}
|
|
1195
1204
|
);
|
|
1196
|
-
function
|
|
1197
|
-
const
|
|
1198
|
-
return `${
|
|
1205
|
+
function Bt(e, r, i) {
|
|
1206
|
+
const c = (i == null ? void 0 : i.abbrev) ?? r.abbrev;
|
|
1207
|
+
return `${U(e, !1)} ${c}`;
|
|
1199
1208
|
}
|
|
1200
1209
|
export {
|
|
1201
|
-
|
|
1210
|
+
E as P,
|
|
1202
1211
|
be as a,
|
|
1203
1212
|
xt as b,
|
|
1204
|
-
|
|
1213
|
+
Bt as f,
|
|
1205
1214
|
xe as t,
|
|
1206
1215
|
$e as u
|
|
1207
1216
|
};
|