@feedmepos/mf-inventory-portal 0.0.22-dev.34 → 0.0.22-dev.37
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/{ApprovalView-2pX2IV1F.js → ApprovalView-Dco0PkEf.js} +8 -8
- package/dist/{BindingsDialog-EyImpE9g.js → BindingsDialog-DrCU_kIA.js} +9 -9
- package/dist/{BindingsPicker-CbBNBcWW.js → BindingsPicker-BMIIrlG6.js} +17 -17
- package/dist/{BindingsTable-CJeV7Dd2.js → BindingsTable-BHRmkL1P.js} +1 -1
- package/dist/{ClosingTemplateView-BDEooji1.js → ClosingTemplateView-kiej8Nah.js} +15 -15
- package/dist/FmDroppableField-Bl7A98it.js +152 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZtc5R4Z.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DQw4pBwH.js} +25 -25
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-z-BBBTkh.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DBh79EM_.js} +20 -20
- package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-3OkJNtvH.js +51 -0
- package/dist/IngredientsView-m44wAwSR.js +1611 -0
- package/dist/{IntegrationView-1lXCciJp.js → IntegrationView-B4gCx21K.js} +71 -71
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Bgd922-L.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D1frNXtV.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Bexig132.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Dbs29jm_.js} +16 -16
- package/dist/{PurchaseOrderPrintPreview-036mLqRD.js → PurchaseOrderPrintPreview-lKu0y_xw.js} +7 -7
- package/dist/ReceiveRequestView-DflWKxgq.js +4053 -0
- package/dist/{RecipeView-BuiA-2uY.js → RecipeView-DfsXdlPn.js} +30 -29
- package/dist/StockView-BSeSpxkV.js +7762 -0
- package/dist/{SupplierView-Ck5hH5gT.js → SupplierView-DPWh1si_.js} +11 -11
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DFDc3P3S.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dt1lRW3W.js} +260 -262
- package/dist/TransferTemplateView-DGOT4oZN.js +2054 -0
- package/dist/{UnitView-DB2hQFMC.js → UnitView-X9bCqAWe.js} +16 -16
- package/dist/{WarehouseView-CFJiuhpx.js → WarehouseView-BphA-Peq.js} +20 -20
- package/dist/api/bill.d.ts +84 -238
- package/dist/api/purchase-order-template.d.ts +4 -2
- package/dist/{app-Z9P39kGh.js → app-DZiCiBV7.js} +18175 -18188
- package/dist/app.js +2 -2
- package/dist/{decimal-DIe_fFDH.js → decimal-Bx1Y3uW1.js} +1 -1
- package/dist/defineDeepModel-4XZbatJF.js +13 -0
- package/dist/format-time-from-id-CFJvgP70.js +15 -0
- package/dist/helper/xlsx.util.d.ts +7 -0
- package/dist/purchase-order-transaction-type-Ds7YRAAp.js +348 -0
- package/dist/stores/inventory.d.ts +63 -0
- package/dist/stores/location.d.ts +89 -0
- package/dist/stores/netsuite.d.ts +1 -0
- package/dist/stores/supplier.d.ts +120 -3
- package/dist/stores/warehouse.d.ts +7 -4
- package/dist/supplier-BhJT8KOX.js +70 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-CeSeHnX0.js → use-template-enabled-locations-2-BrEPVOpT.js} +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2 -2
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2 -2
- package/dist/views/ingredients/composables/use-ingredient-form.d.ts +2 -2
- package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +44 -0
- package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +42 -34
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +75 -51
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +75 -51
- package/dist/views/recipe/composables/use-recipe-form.d.ts +2 -2
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +42 -119
- package/dist/views/stock/composables/use-stock-action.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImport.vue.d.ts +2 -0
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItem.vue.d.ts +12 -0
- package/dist/views/transfer-template/components/transfer-template-import/TransferTemplateImportItemProps.d.ts +9 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +10 -6
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +1850 -5
- package/dist/views/transfer-template/helpers/import-export.helper.d.ts +76 -0
- package/dist/views/transfer-template/helpers/remove-deleted-skus.helper.d.ts +1 -230
- package/dist/views/unit/composables/use-unit-form.d.ts +2 -2
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +14 -8
- package/dist/{xlsx-DrDljHnF.js → xlsx-B9lpxKgq.js} +651 -651
- package/dist/xlsx.util-DP5wVnRT.js +78 -0
- package/package.json +1 -1
- package/dist/IngredientsView-BvKaI0nb.js +0 -1755
- package/dist/ReceiveRequestView-BGlxEJkh.js +0 -1626
- package/dist/StockView-BKX6NX-g.js +0 -1909
- package/dist/TransferTemplateView-ByYEje9E.js +0 -1237
- package/dist/defineDeepModel-DH8vhBpR.js +0 -13
- package/dist/format-time-from-id-CAjL4U2X.js +0 -15
- package/dist/purchase-order-transaction-type-BJDnbhdk.js +0 -338
- package/dist/supplier-wJJ7ATk2.js +0 -69
- package/dist/xlsx.util-BwF0vRjF.js +0 -109
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { c as d, ak as i } from "./app-Z9P39kGh.js";
|
|
2
|
-
import { getCurrentInstance as r, reactive as m, watch as u } from "vue";
|
|
3
|
-
function b(e = "modelValue") {
|
|
4
|
-
var o, n;
|
|
5
|
-
const s = ((o = r()) == null ? void 0 : o.props) ?? {}, a = ((n = r()) == null ? void 0 : n.emit) ?? (() => {
|
|
6
|
-
}), t = m(d(s[e] ?? {})), c = `update:${i(e)}`;
|
|
7
|
-
return u(t, (p) => {
|
|
8
|
-
a(c, p);
|
|
9
|
-
}), t;
|
|
10
|
-
}
|
|
11
|
-
export {
|
|
12
|
-
b as d
|
|
13
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { an as e } from "./app-Z9P39kGh.js";
|
|
2
|
-
function d(r) {
|
|
3
|
-
const t = a(r);
|
|
4
|
-
return t === null ? "" : e(t);
|
|
5
|
-
}
|
|
6
|
-
function a(r) {
|
|
7
|
-
const t = r.match(/\w+_(\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z).*/);
|
|
8
|
-
if (!t) return null;
|
|
9
|
-
const n = /* @__PURE__ */ new Date(`${t[1]}`);
|
|
10
|
-
return isNaN(n.getTime()) ? null : n;
|
|
11
|
-
}
|
|
12
|
-
export {
|
|
13
|
-
d as f,
|
|
14
|
-
a as p
|
|
15
|
-
};
|
|
@@ -1,338 +0,0 @@
|
|
|
1
|
-
import { F as C, D as w, R as h } from "./row-action.enum-PMKMRrZR.js";
|
|
2
|
-
import { c as O } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
|
|
3
|
-
import { o as x, u as S, c as D, ao as P, z as B, j as M, a as L } from "./app-Z9P39kGh.js";
|
|
4
|
-
import { f as z } from "./format-time-from-id-CAjL4U2X.js";
|
|
5
|
-
import { useCoreStore as K, useI18n as j } from "@feedmepos/mf-common";
|
|
6
|
-
import { useDialog as V, useSnackbar as H, FmButtonVariant as R, components as U } from "@feedmepos/ui-library";
|
|
7
|
-
import { defineStore as q } from "pinia";
|
|
8
|
-
import { ref as b, h as A } from "vue";
|
|
9
|
-
import { useRouter as G } from "vue-router";
|
|
10
|
-
const F = x((t, a) => {
|
|
11
|
-
function o() {
|
|
12
|
-
var l;
|
|
13
|
-
return `business_${((l = K().currentBusiness.value) == null ? void 0 : l._id) ?? ""}`;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
async getTemplate(n) {
|
|
17
|
-
const r = o(), l = `${t.inventoryBackendUrl}/${r}/purchase-order-template/${n}`;
|
|
18
|
-
return a.get(l);
|
|
19
|
-
},
|
|
20
|
-
async readTemplates() {
|
|
21
|
-
const n = o(), r = `${t.inventoryBackendUrl}/${n}/purchase-order-template`;
|
|
22
|
-
return a.get(r);
|
|
23
|
-
},
|
|
24
|
-
async createTemplate(n) {
|
|
25
|
-
const r = o(), l = `${t.inventoryBackendUrl}/${r}/purchase-order-template`;
|
|
26
|
-
return a.post(l, n);
|
|
27
|
-
},
|
|
28
|
-
async updateTemplate(n) {
|
|
29
|
-
const r = o(), l = `${t.inventoryBackendUrl}/${r}/purchase-order-template`;
|
|
30
|
-
return a.put(l, n);
|
|
31
|
-
},
|
|
32
|
-
async deleteTemplate(n) {
|
|
33
|
-
const r = o(), l = `${t.inventoryBackendUrl}/${r}/purchase-order-template`;
|
|
34
|
-
return a.delete(l, { _id: n._id, _rev: n._rev });
|
|
35
|
-
}
|
|
36
|
-
};
|
|
37
|
-
});
|
|
38
|
-
function I(t) {
|
|
39
|
-
const a = S(), o = t.sku, n = a.skuById[o._id];
|
|
40
|
-
if (n.unit._id !== o.unit._id) return !0;
|
|
41
|
-
const r = t.measurement;
|
|
42
|
-
return r ? !a.unitById[n.unit._id].measurements.find((v) => v.id === r.id) : !1;
|
|
43
|
-
}
|
|
44
|
-
const J = q("transferTemplateActions", () => {
|
|
45
|
-
const t = V(), a = H(), o = F(), n = G(), r = b({});
|
|
46
|
-
function l() {
|
|
47
|
-
r.value = {
|
|
48
|
-
mode: C.CREATE,
|
|
49
|
-
show: !0,
|
|
50
|
-
"onUpdate:show"(e) {
|
|
51
|
-
r.value.show = e;
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
}
|
|
55
|
-
function m(e) {
|
|
56
|
-
r.value = {
|
|
57
|
-
mode: C.UPDATE,
|
|
58
|
-
modelValue: e,
|
|
59
|
-
show: !0,
|
|
60
|
-
"onUpdate:show"(i) {
|
|
61
|
-
r.value.show = i;
|
|
62
|
-
}
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
function v(e, i, f) {
|
|
66
|
-
t.open({
|
|
67
|
-
title: `Confirm deleting template ${e.name}?`,
|
|
68
|
-
message: "Deleted template can no longer be retrieved",
|
|
69
|
-
primaryActions: {
|
|
70
|
-
text: "Delete",
|
|
71
|
-
variant: R.Destructive,
|
|
72
|
-
close: !0
|
|
73
|
-
},
|
|
74
|
-
secondaryActions: {
|
|
75
|
-
text: "Cancel",
|
|
76
|
-
variant: R.Plain,
|
|
77
|
-
close: !0
|
|
78
|
-
}
|
|
79
|
-
}).onPrimary(async () => {
|
|
80
|
-
a.open({
|
|
81
|
-
title: `Deleting ${e.name}`,
|
|
82
|
-
type: "info"
|
|
83
|
-
});
|
|
84
|
-
try {
|
|
85
|
-
i.value = !0;
|
|
86
|
-
const [d] = await Promise.allSettled([
|
|
87
|
-
o.deleteTemplate(e),
|
|
88
|
-
new Promise((u) => setTimeout(u, 1e3))
|
|
89
|
-
]);
|
|
90
|
-
if (d.status === "rejected") throw d.reason;
|
|
91
|
-
a.open({
|
|
92
|
-
title: `Deleted ${e.name}`,
|
|
93
|
-
type: "success"
|
|
94
|
-
});
|
|
95
|
-
} catch (d) {
|
|
96
|
-
a.open({
|
|
97
|
-
title: `Unable to delete ${e.name}`,
|
|
98
|
-
message: `See error from server: ${d}`,
|
|
99
|
-
type: "error"
|
|
100
|
-
}), console.error("error on deleting purchase order template", d);
|
|
101
|
-
} finally {
|
|
102
|
-
i.value = !1, f();
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
const p = b({});
|
|
107
|
-
function _(e) {
|
|
108
|
-
p.value = {
|
|
109
|
-
template: e,
|
|
110
|
-
show: !0,
|
|
111
|
-
"onUpdate:show"(i) {
|
|
112
|
-
p.value.show = i;
|
|
113
|
-
},
|
|
114
|
-
"onAction:edit"() {
|
|
115
|
-
p.value.show = !1, m(D(e));
|
|
116
|
-
}
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
function s(e) {
|
|
120
|
-
const i = M(), { promise: f, resolve: d } = Promise.withResolvers(), u = (c) => {
|
|
121
|
-
d(c);
|
|
122
|
-
}, $ = e.filter(
|
|
123
|
-
(c) => {
|
|
124
|
-
var g;
|
|
125
|
-
return (!c.locations || c.locations.find((E) => E.doc._id === i.currentLocation.doc._id)) && ((g = c.purchaseOrder.supplier) == null ? void 0 : g._id) !== i.currentLocation.doc._id;
|
|
126
|
-
}
|
|
127
|
-
);
|
|
128
|
-
if (!$.length)
|
|
129
|
-
return t.open({
|
|
130
|
-
title: "Select one template",
|
|
131
|
-
message: "There is no available template in your business. Configure a new template?",
|
|
132
|
-
primaryActions: {
|
|
133
|
-
text: "Close",
|
|
134
|
-
close: !0
|
|
135
|
-
},
|
|
136
|
-
secondaryActions: {
|
|
137
|
-
text: "Close",
|
|
138
|
-
close: !0
|
|
139
|
-
}
|
|
140
|
-
}).onPrimary(() => {
|
|
141
|
-
n.push({ name: P.TRANSFER_TEMPLATE }), u(void 0);
|
|
142
|
-
}).onSecondary(() => u(void 0)).onClose(() => u(void 0)), f;
|
|
143
|
-
const N = $.map((c) => {
|
|
144
|
-
const g = !c.purchaseOrder.items.length || c.purchaseOrder.items.some(I);
|
|
145
|
-
return {
|
|
146
|
-
label: c.name,
|
|
147
|
-
value: c._id,
|
|
148
|
-
disabled: g,
|
|
149
|
-
sublabel: g ? "This template is invalid. Update this template." : void 0
|
|
150
|
-
};
|
|
151
|
-
});
|
|
152
|
-
return t.open({
|
|
153
|
-
title: "Select one template",
|
|
154
|
-
contentComponent: B,
|
|
155
|
-
contentComponentProps: {
|
|
156
|
-
items: N,
|
|
157
|
-
singleSelect: !0
|
|
158
|
-
},
|
|
159
|
-
primaryActions: {
|
|
160
|
-
text: "Confirm",
|
|
161
|
-
close: !0
|
|
162
|
-
},
|
|
163
|
-
secondaryActions: {
|
|
164
|
-
text: "Close",
|
|
165
|
-
close: !0
|
|
166
|
-
},
|
|
167
|
-
tertiaryActions: {
|
|
168
|
-
text: "Templates",
|
|
169
|
-
close: !0
|
|
170
|
-
}
|
|
171
|
-
}).onPrimary((c) => Array.isArray(c) ? u(c[0]) : null).onSecondary(() => u(void 0)).onTertiary(() => {
|
|
172
|
-
n.push({ name: P.TRANSFER_TEMPLATE }), u(void 0);
|
|
173
|
-
}).onClose(() => u(void 0)), f;
|
|
174
|
-
}
|
|
175
|
-
return {
|
|
176
|
-
createTemplate: l,
|
|
177
|
-
viewTemplate: _,
|
|
178
|
-
updateTemplate: m,
|
|
179
|
-
deleteTemplate: v,
|
|
180
|
-
getTemplateId: s,
|
|
181
|
-
templateDialogProps: r,
|
|
182
|
-
templateDetailsProps: p
|
|
183
|
-
};
|
|
184
|
-
});
|
|
185
|
-
function k(t) {
|
|
186
|
-
const { skuById: a } = S(), o = D(t);
|
|
187
|
-
return o.purchaseOrder.items = t.purchaseOrder.items.filter((n) => a[n.sku._id]), o;
|
|
188
|
-
}
|
|
189
|
-
const y = b(!1), T = b(new Array());
|
|
190
|
-
function ae() {
|
|
191
|
-
const { t } = j(), { viewTemplate: a, updateTemplate: o, deleteTemplate: n } = J(), r = F(), l = S();
|
|
192
|
-
async function m() {
|
|
193
|
-
T.value = [], y.value = !0;
|
|
194
|
-
try {
|
|
195
|
-
const [s] = await Promise.all([
|
|
196
|
-
r.readTemplates(),
|
|
197
|
-
l.readInventory()
|
|
198
|
-
]).delayed(1e3);
|
|
199
|
-
T.value = s.map(k);
|
|
200
|
-
} catch (s) {
|
|
201
|
-
console.log("Something went wrong when fetching templates:", s);
|
|
202
|
-
} finally {
|
|
203
|
-
y.value = !1;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
async function v(s) {
|
|
207
|
-
if (!T.value.find((e) => e._id)) {
|
|
208
|
-
y.value = !0;
|
|
209
|
-
try {
|
|
210
|
-
T.value = [
|
|
211
|
-
await r.getTemplate(s).then(k).delayed(1e3)
|
|
212
|
-
];
|
|
213
|
-
} catch (e) {
|
|
214
|
-
console.log("Something went wrong when fetching templates:", e);
|
|
215
|
-
} finally {
|
|
216
|
-
y.value = !1;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
}
|
|
220
|
-
function p(s, e) {
|
|
221
|
-
switch (e = D(e), s) {
|
|
222
|
-
case h.Details:
|
|
223
|
-
return a(e);
|
|
224
|
-
case h.Edit:
|
|
225
|
-
return o(e);
|
|
226
|
-
case h.Delete:
|
|
227
|
-
return n(e, y, m);
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
return {
|
|
231
|
-
columnDefs: [
|
|
232
|
-
{
|
|
233
|
-
id: "_id",
|
|
234
|
-
accessorKey: "_id",
|
|
235
|
-
header: () => t("inventory.transfer.table.createdAt"),
|
|
236
|
-
cell(s) {
|
|
237
|
-
return z(`${s.getValue()}`);
|
|
238
|
-
},
|
|
239
|
-
enableSorting: !0
|
|
240
|
-
},
|
|
241
|
-
{
|
|
242
|
-
id: "name",
|
|
243
|
-
accessorKey: "name",
|
|
244
|
-
header: () => t("inventory.transfer.table.name"),
|
|
245
|
-
enableSorting: !0,
|
|
246
|
-
size: 200
|
|
247
|
-
},
|
|
248
|
-
{
|
|
249
|
-
id: "noOfItems",
|
|
250
|
-
accessorKey: "purchaseOrder.items.length",
|
|
251
|
-
header: () => t("inventory.transfer.table.noOfItems"),
|
|
252
|
-
enableSorting: !1,
|
|
253
|
-
meta: {
|
|
254
|
-
width: "10rem",
|
|
255
|
-
textAlign: "right"
|
|
256
|
-
},
|
|
257
|
-
cell(s) {
|
|
258
|
-
const e = Number(s.getValue()) || 0, i = s.row.original.purchaseOrder.items.some(I);
|
|
259
|
-
return e === 0 || i ? A("div", { class: "flex justify-end gap-4 items-center" }, [
|
|
260
|
-
A(
|
|
261
|
-
U.FmTooltip,
|
|
262
|
-
{},
|
|
263
|
-
{
|
|
264
|
-
content() {
|
|
265
|
-
return i ? "The template is invalid due to invalid unit on some of the items. Please update this template." : "The template is invalid due to deleted ingredients. Please update this template.";
|
|
266
|
-
},
|
|
267
|
-
default() {
|
|
268
|
-
return A(U.FmIcon, {
|
|
269
|
-
name: "error",
|
|
270
|
-
color: "system-error-300",
|
|
271
|
-
size: "sm"
|
|
272
|
-
});
|
|
273
|
-
}
|
|
274
|
-
}
|
|
275
|
-
),
|
|
276
|
-
e
|
|
277
|
-
]) : e;
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
id: "enabledLocations",
|
|
282
|
-
accessorKey: "purchaseOrder.locations.length",
|
|
283
|
-
header: () => "Enabled outlets",
|
|
284
|
-
cell(s) {
|
|
285
|
-
var i;
|
|
286
|
-
const e = (i = s.row.original.locations) == null ? void 0 : i.length;
|
|
287
|
-
return e ? `${e}` : "All";
|
|
288
|
-
},
|
|
289
|
-
enableSorting: !1,
|
|
290
|
-
meta: {
|
|
291
|
-
width: "10rem",
|
|
292
|
-
textAlign: "right"
|
|
293
|
-
}
|
|
294
|
-
},
|
|
295
|
-
{
|
|
296
|
-
id: "ref",
|
|
297
|
-
accessorKey: "purchaseOrder.ref",
|
|
298
|
-
header: () => t("inventory.transfer.table.reference"),
|
|
299
|
-
enableSorting: !1,
|
|
300
|
-
size: "auto"
|
|
301
|
-
},
|
|
302
|
-
{
|
|
303
|
-
id: "action",
|
|
304
|
-
cell(s) {
|
|
305
|
-
const e = s.row.original, i = [
|
|
306
|
-
w[h.Details],
|
|
307
|
-
w[h.Edit],
|
|
308
|
-
w[h.Delete]
|
|
309
|
-
];
|
|
310
|
-
return O(i, (f) => p(f, e));
|
|
311
|
-
},
|
|
312
|
-
enableSorting: !1,
|
|
313
|
-
size: 40,
|
|
314
|
-
meta: {
|
|
315
|
-
cellClass: "",
|
|
316
|
-
headerClass: ""
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
],
|
|
320
|
-
templates: T,
|
|
321
|
-
loading: y,
|
|
322
|
-
fetchTemplates: m,
|
|
323
|
-
loadTemplate: v
|
|
324
|
-
};
|
|
325
|
-
}
|
|
326
|
-
function se(t, a, o) {
|
|
327
|
-
const n = (o == null ? void 0 : o.abbrev) ?? a.abbrev;
|
|
328
|
-
return `${L(t, !1)} ${n}`;
|
|
329
|
-
}
|
|
330
|
-
var Q = /* @__PURE__ */ ((t) => (t.PURCHASE = "PURCHASE", t.TRANSFER = "TRANSFER", t))(Q || {});
|
|
331
|
-
export {
|
|
332
|
-
Q as P,
|
|
333
|
-
F as a,
|
|
334
|
-
J as b,
|
|
335
|
-
se as f,
|
|
336
|
-
I as t,
|
|
337
|
-
ae as u
|
|
338
|
-
};
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import { o as S, j as u, V as m, W as y } from "./app-Z9P39kGh.js";
|
|
2
|
-
import { useCoreStore as c } from "@feedmepos/mf-common";
|
|
3
|
-
import { defineStore as b } from "pinia";
|
|
4
|
-
import { ref as l, computed as v } from "vue";
|
|
5
|
-
const p = S((s, n) => {
|
|
6
|
-
function a() {
|
|
7
|
-
var o;
|
|
8
|
-
const e = c(), r = u(), t = r.businessLevel, i = `business_${((o = e.currentBusiness.value) == null ? void 0 : o._id) ?? ""}`, d = r.currentLocation.dbName;
|
|
9
|
-
return t ? i : d;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
async readSuppliers() {
|
|
13
|
-
const e = a(), r = `${s.inventoryBackendUrl}/${e}/supplier`;
|
|
14
|
-
return await n.get(r);
|
|
15
|
-
},
|
|
16
|
-
async readLocationSuppliers() {
|
|
17
|
-
const r = u().currentLocation.dbName, t = `${s.inventoryBackendUrl}/${r}/supplier`;
|
|
18
|
-
return await n.get(t);
|
|
19
|
-
},
|
|
20
|
-
async readBusinessSuppliers() {
|
|
21
|
-
var i;
|
|
22
|
-
const r = `business_${((i = c().currentBusiness.value) == null ? void 0 : i._id) ?? ""}`, t = `${s.inventoryBackendUrl}/${r}/supplier`;
|
|
23
|
-
return await n.get(t);
|
|
24
|
-
},
|
|
25
|
-
async createSupplier(e) {
|
|
26
|
-
const r = a(), t = `${s.inventoryBackendUrl}/${r}/supplier`;
|
|
27
|
-
return await n.post(t, e);
|
|
28
|
-
},
|
|
29
|
-
async updateSupplier(e) {
|
|
30
|
-
const r = a(), t = `${s.inventoryBackendUrl}/${r}/supplier`;
|
|
31
|
-
return await n.put(t, e);
|
|
32
|
-
},
|
|
33
|
-
async deleteSupplier(e) {
|
|
34
|
-
const r = a(), t = `${s.inventoryBackendUrl}/${r}/supplier`;
|
|
35
|
-
return await n.delete(t, e);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}), f = b("supplier", () => {
|
|
39
|
-
const s = l(new Array()), n = l(new Array()), a = v(() => [...s.value, ...n.value]);
|
|
40
|
-
return {
|
|
41
|
-
async readSuppliers() {
|
|
42
|
-
const e = p();
|
|
43
|
-
s.value = await e.readLocationSuppliers(), n.value = await e.readBusinessSuppliers();
|
|
44
|
-
},
|
|
45
|
-
async createSupplier(e) {
|
|
46
|
-
await p().createSupplier(e);
|
|
47
|
-
},
|
|
48
|
-
async updateSupplier(e) {
|
|
49
|
-
await p().updateSupplier(e);
|
|
50
|
-
},
|
|
51
|
-
async deleteSupplier(e) {
|
|
52
|
-
await p().deleteSupplier(e);
|
|
53
|
-
},
|
|
54
|
-
async init() {
|
|
55
|
-
const e = m();
|
|
56
|
-
try {
|
|
57
|
-
await this.readSuppliers();
|
|
58
|
-
} catch (r) {
|
|
59
|
-
throw r instanceof y || e.error("Error at reading suppliers"), r;
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
suppliers: a,
|
|
63
|
-
locationSuppliers: s,
|
|
64
|
-
businessSuppliers: n
|
|
65
|
-
};
|
|
66
|
-
});
|
|
67
|
-
export {
|
|
68
|
-
f as u
|
|
69
|
-
};
|
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { defineComponent as g, openBlock as f, createElementBlock as u, createElementVNode as x, toDisplayString as d, unref as w, Fragment as M, renderList as v } from "vue";
|
|
2
|
-
import { a as h, l as b } from "./app-Z9P39kGh.js";
|
|
3
|
-
import { useI18n as k } from "@feedmepos/mf-common";
|
|
4
|
-
import { u as y, w as S, r as $ } from "./xlsx-DrDljHnF.js";
|
|
5
|
-
const A = { class: "flex flex-col" }, B = { class: "flex flex-row fm-typo-en-body-md-600 bg-fm-color-neutral-gray-100 text-fm-color-typo-secondary h-48 items-center" }, E = { class: "flex-1 py-8 px-16" }, I = {
|
|
6
|
-
class: "flex-0 py-8 px-16",
|
|
7
|
-
style: { "flex-basis": "120px" }
|
|
8
|
-
}, N = { class: "flex-1 py-8 px-16" }, j = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "flex-0 py-8 px-16",
|
|
11
|
-
style: { "flex-basis": "120px" }
|
|
12
|
-
}, C = {
|
|
13
|
-
key: 1,
|
|
14
|
-
class: "flex-0 py-8 px-16",
|
|
15
|
-
style: { "flex-basis": "120px" }
|
|
16
|
-
}, X = /* @__PURE__ */ g({
|
|
17
|
-
__name: "IngredientBindedItem",
|
|
18
|
-
props: {
|
|
19
|
-
name: {},
|
|
20
|
-
bindings: {}
|
|
21
|
-
},
|
|
22
|
-
setup(o) {
|
|
23
|
-
const { t: n } = k();
|
|
24
|
-
function a(e, s) {
|
|
25
|
-
var t;
|
|
26
|
-
if (e.measurement) {
|
|
27
|
-
const c = b(e.amount, e.measurement.conversion);
|
|
28
|
-
return `${h(c, !1)} ${(t = e.measurement) == null ? void 0 : t.abbrev}`;
|
|
29
|
-
}
|
|
30
|
-
return `${h(e.amount, !1)} ${s.abbrev}`;
|
|
31
|
-
}
|
|
32
|
-
function r(e) {
|
|
33
|
-
return e.unit !== void 0;
|
|
34
|
-
}
|
|
35
|
-
return (e, s) => (f(), u("div", A, [
|
|
36
|
-
x("div", B, [
|
|
37
|
-
x("div", E, d(e.name), 1),
|
|
38
|
-
x("div", I, d(w(n)("inventory.ingredient.bindedItems.amount")), 1)
|
|
39
|
-
]),
|
|
40
|
-
(f(!0), u(M, null, v(e.bindings, (t) => (f(), u("div", {
|
|
41
|
-
key: t.id,
|
|
42
|
-
class: "flex flex-row fm-typo-en-body-md-400 h-48 items-center border-b border-b-fm-color-neutral-gray-100"
|
|
43
|
-
}, [
|
|
44
|
-
x("div", N, d(t.name), 1),
|
|
45
|
-
r(t) ? (f(), u("div", j, d(a(t, t.unit)), 1)) : (f(), u("div", C, d(w(h)(t.amount, !1)), 1))
|
|
46
|
-
]))), 128))
|
|
47
|
-
]));
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
function* F(o) {
|
|
51
|
-
const [n, a] = o.split(":"), r = /\d+/, e = r.exec(n), s = r.exec(a);
|
|
52
|
-
if (!e || !s)
|
|
53
|
-
throw new Error(`Cannot parse row range for range: ${o}`);
|
|
54
|
-
const t = Number(e[0]), c = Number(s[0]);
|
|
55
|
-
for (let l = t; l <= c; l++)
|
|
56
|
-
yield l;
|
|
57
|
-
}
|
|
58
|
-
function* L(o) {
|
|
59
|
-
const [n, a] = o.split(":"), r = /[^\d]+/, e = r.exec(n), s = r.exec(a);
|
|
60
|
-
if (!e || !s)
|
|
61
|
-
throw new Error(`Cannot parse row range for range: ${o}`);
|
|
62
|
-
let t = 0, c = "A";
|
|
63
|
-
for (yield c; c !== s[0]; ) {
|
|
64
|
-
t++;
|
|
65
|
-
const l = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
66
|
-
let i = t, m = !1, p = "";
|
|
67
|
-
do {
|
|
68
|
-
const _ = i % l.length;
|
|
69
|
-
i = Math.floor(i / l.length), p += l.charAt(_), m = i > 0, i -= 1;
|
|
70
|
-
} while (m);
|
|
71
|
-
c = p.split("").reverse().join(""), yield c;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
function U(o) {
|
|
75
|
-
var r;
|
|
76
|
-
const n = [], a = o["!ref"];
|
|
77
|
-
if (!a) return n;
|
|
78
|
-
for (const e of F(a)) {
|
|
79
|
-
const s = [];
|
|
80
|
-
for (const t of L(a))
|
|
81
|
-
s.push(((r = o[`${t}${e}`]) == null ? void 0 : r.w) ?? "");
|
|
82
|
-
n.push(s);
|
|
83
|
-
}
|
|
84
|
-
return n;
|
|
85
|
-
}
|
|
86
|
-
function V(o, n, a = "Sheet1") {
|
|
87
|
-
const r = y.aoa_to_sheet([n, ...o]), e = o.reduce((c, l) => Math.max(c, l.length), 0), s = Array.from({ length: e }).map((c, l) => {
|
|
88
|
-
const i = o.map((m) => `${m[l]}`).reduce((m, p) => Math.max(m, p.length + 3), 0);
|
|
89
|
-
return {
|
|
90
|
-
wch: Math.max(i, 5)
|
|
91
|
-
};
|
|
92
|
-
});
|
|
93
|
-
r["!cols"] = s;
|
|
94
|
-
const t = y.book_new();
|
|
95
|
-
return y.book_append_sheet(t, r, a), t;
|
|
96
|
-
}
|
|
97
|
-
function H(o, n) {
|
|
98
|
-
S(o, n, { compression: !0 });
|
|
99
|
-
}
|
|
100
|
-
async function J(o) {
|
|
101
|
-
return $(await o.arrayBuffer());
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
X as _,
|
|
105
|
-
H as d,
|
|
106
|
-
J as r,
|
|
107
|
-
U as s,
|
|
108
|
-
V as t
|
|
109
|
-
};
|