@feedmepos/mf-inventory-portal 0.0.22-dev.41 → 0.0.22-dev.43
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-DKqwRFlF.js → ApprovalView-1ZKaZJ2Z.js} +3 -3
- package/dist/{BindingsDialog-CtMSqEuE.js → BindingsDialog-CKjAs5mJ.js} +1 -1
- package/dist/{BindingsPicker-DCLNF1PL.js → BindingsPicker-BAVZ-3dF.js} +1 -1
- package/dist/{BindingsTable-6ndQuHeA.js → BindingsTable-qq8M9fzG.js} +1 -1
- package/dist/ClosingTemplateView-DOLuHmy8.js +1775 -0
- package/dist/FmDroppableField-BBpVEZs4.js +154 -0
- package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BUGB0uk3.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-ChRPq-Ok.js} +3 -3
- package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CM93v-jp.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BSxhRfE4.js} +1 -1
- package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-SNp8etCc.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DrL5a2Pn.js} +1 -1
- package/dist/{IngredientsView-B1jGkWYN.js → IngredientsView-m5K8MlM2.js} +5 -5
- package/dist/IntegrationView-BE5P68EJ.js +1141 -0
- package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mZQlrYaY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-B8cCv--C.js} +1 -1
- package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BEFmqnHk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CcM04Veu.js} +2 -2
- package/dist/{PurchaseOrderPrintPreview-DTQViYuX.js → PurchaseOrderPrintPreview-D40E9qZt.js} +1 -1
- package/dist/{ReceiveRequestView-CNRixgQu.js → ReceiveRequestView-Ci7FgSjU.js} +10 -10
- package/dist/{RecipeView-HStPC5pE.js → RecipeView-Bp7iBiy7.js} +4 -4
- package/dist/{StockView-JO3NtkX9.js → StockView-BzowFcFA.js} +5 -5
- package/dist/SupplierView-CbRnAb8G.js +3037 -0
- package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-dPt3qbcX.js → TransferDetails.vue_vue_type_script_setup_true_lang-BMikyrhA.js} +5 -5
- package/dist/TransferTemplateView-BwamiSyk.js +1302 -0
- package/dist/{UnitView-dbInWUk4.js → UnitView-B-058oRk.js} +4 -4
- package/dist/{WarehouseView-BlTBvLF0.js → WarehouseView-RtU3sWKx.js} +2 -2
- package/dist/api/supplier.d.ts +1 -0
- package/dist/{app-TB3IWuaU.js → app-By3PLx0q.js} +3918 -3854
- package/dist/app.d.ts +70 -3
- package/dist/app.js +1 -1
- package/dist/components/FmMultiselectDialog.vue.d.ts +3 -9
- package/dist/{decimal-BRAYgPnN.js → decimal-CtriZ1S6.js} +1 -1
- package/dist/{defineDeepModel-DrEk5Fhq.js → defineDeepModel-ClK3S9xx.js} +1 -1
- package/dist/{format-time-from-id-kpVYfVQb.js → format-time-from-id-CGLKzJJO.js} +1 -1
- package/dist/format-unit-display-COeZSqdS.js +1195 -0
- package/dist/stores/netsuite.d.ts +1 -1
- package/dist/stores/supplier.d.ts +4 -1
- package/dist/style.css +1 -1
- package/dist/supplier-BxBMThPQ.js +77 -0
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{use-template-enabled-locations-2-DyD24laW.js → use-template-enabled-locations-2-BIgPnzRW.js} +1 -1
- package/dist/views/supplier/components/supplier-import/SupplierImport.vue.d.ts +2 -0
- package/dist/views/supplier/components/supplier-import/SupplierImportItem.vue.d.ts +12 -0
- package/dist/views/supplier/components/supplier-import/SupplierImportItemProps.d.ts +6 -0
- package/dist/views/supplier/composables/use-supplier-actions.d.ts +10 -0
- package/dist/views/supplier/helpers/import-export.helper.d.ts +50 -0
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +7 -5
- package/dist/{xlsx-Dd5ckm6-.js → xlsx-X_0qJPDg.js} +1 -1
- package/dist/{xlsx.util-qlqvEcJz.js → xlsx.util-BOPzVbUa.js} +1 -1
- package/package.json +2 -1
- package/dist/ClosingTemplateView-BPrDQ_8-.js +0 -1688
- package/dist/FmDroppableField-DQFPEiJn.js +0 -152
- package/dist/IntegrationView-Bu0waSjB.js +0 -1141
- package/dist/SupplierView-gtaS4K3U.js +0 -827
- package/dist/TransferTemplateView-C0pjLfbz.js +0 -2054
- package/dist/purchase-order-transaction-type-ZMNa__2l.js +0 -348
- package/dist/supplier-CJcqHpaM.js +0 -70
|
@@ -1,348 +0,0 @@
|
|
|
1
|
-
import { F as C, D as A, 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 { n as x, u as D, i as B, c as $, as as P, y as M, a as L } from "./app-TB3IWuaU.js";
|
|
4
|
-
import { f as K } from "./format-time-from-id-kpVYfVQb.js";
|
|
5
|
-
import { useCoreStore as z, useI18n as V } from "@feedmepos/mf-common";
|
|
6
|
-
import { useDialog as j, useSnackbar as H, FmButtonVariant as U, components as R } from "@feedmepos/ui-library";
|
|
7
|
-
import { defineStore as N } from "pinia";
|
|
8
|
-
import { ref as g, h as S } from "vue";
|
|
9
|
-
import { useRouter as q } from "vue-router";
|
|
10
|
-
const F = x((r, o) => {
|
|
11
|
-
function a() {
|
|
12
|
-
var n;
|
|
13
|
-
return `business_${((n = z().currentBusiness.value) == null ? void 0 : n._id) ?? ""}`;
|
|
14
|
-
}
|
|
15
|
-
return {
|
|
16
|
-
async getTemplate(t) {
|
|
17
|
-
const s = a(), n = `${r.inventoryBackendUrl}/${s}/purchase-order-template/${t}`;
|
|
18
|
-
return o.get(n);
|
|
19
|
-
},
|
|
20
|
-
async readTemplates() {
|
|
21
|
-
const t = a(), s = `${r.inventoryBackendUrl}/${t}/purchase-order-template`;
|
|
22
|
-
return o.get(s);
|
|
23
|
-
},
|
|
24
|
-
async createTemplate(t) {
|
|
25
|
-
const s = a(), n = `${r.inventoryBackendUrl}/${s}/purchase-order-template`;
|
|
26
|
-
return o.post(n, t);
|
|
27
|
-
},
|
|
28
|
-
async updateTemplate(t) {
|
|
29
|
-
const s = a(), n = `${r.inventoryBackendUrl}/${s}/purchase-order-template`;
|
|
30
|
-
return o.put(n, t);
|
|
31
|
-
},
|
|
32
|
-
async deleteTemplate(t) {
|
|
33
|
-
const s = a(), n = `${r.inventoryBackendUrl}/${s}/purchase-order-template`;
|
|
34
|
-
return o.delete(n, { _id: t._id, _rev: t._rev });
|
|
35
|
-
},
|
|
36
|
-
async importTemplates(t) {
|
|
37
|
-
const s = a(), n = `${r.inventoryBackendUrl}/${s}/purchase-order-template/import`;
|
|
38
|
-
return o.post(n, t);
|
|
39
|
-
}
|
|
40
|
-
};
|
|
41
|
-
});
|
|
42
|
-
function I(r) {
|
|
43
|
-
const o = D(), a = r.sku, t = o.skuById[a._id];
|
|
44
|
-
if (t.unit._id !== a.unit._id) return !0;
|
|
45
|
-
const s = r.measurement;
|
|
46
|
-
return s ? !o.unitById[t.unit._id].measurements.find((p) => p.id === s.id) : !1;
|
|
47
|
-
}
|
|
48
|
-
const G = N("transferTemplateActions", () => {
|
|
49
|
-
const r = j(), o = H(), a = B(), t = J(), s = F(), n = q(), u = g({});
|
|
50
|
-
function p() {
|
|
51
|
-
u.value = {
|
|
52
|
-
mode: C.CREATE,
|
|
53
|
-
show: !0,
|
|
54
|
-
"onUpdate:show"(e) {
|
|
55
|
-
u.value.show = e;
|
|
56
|
-
}
|
|
57
|
-
};
|
|
58
|
-
}
|
|
59
|
-
function y(e) {
|
|
60
|
-
u.value = {
|
|
61
|
-
mode: C.UPDATE,
|
|
62
|
-
modelValue: e,
|
|
63
|
-
show: !0,
|
|
64
|
-
"onUpdate:show"(l) {
|
|
65
|
-
u.value.show = l;
|
|
66
|
-
}
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
function T(e, l, m) {
|
|
70
|
-
r.open({
|
|
71
|
-
title: `Confirm deleting template ${e.name}?`,
|
|
72
|
-
message: "Deleted template can no longer be retrieved",
|
|
73
|
-
primaryActions: {
|
|
74
|
-
text: "Delete",
|
|
75
|
-
variant: U.Destructive,
|
|
76
|
-
close: !0
|
|
77
|
-
},
|
|
78
|
-
secondaryActions: {
|
|
79
|
-
text: "Cancel",
|
|
80
|
-
variant: U.Plain,
|
|
81
|
-
close: !0
|
|
82
|
-
}
|
|
83
|
-
}).onPrimary(async () => {
|
|
84
|
-
o.open({
|
|
85
|
-
title: `Deleting ${e.name}`,
|
|
86
|
-
type: "info"
|
|
87
|
-
});
|
|
88
|
-
try {
|
|
89
|
-
l.value = !0;
|
|
90
|
-
const [d] = await Promise.allSettled([
|
|
91
|
-
s.deleteTemplate(e),
|
|
92
|
-
new Promise((w) => setTimeout(w, 1e3))
|
|
93
|
-
]);
|
|
94
|
-
if (d.status === "rejected") throw d.reason;
|
|
95
|
-
o.open({
|
|
96
|
-
title: `Deleted ${e.name}`,
|
|
97
|
-
type: "success"
|
|
98
|
-
});
|
|
99
|
-
} catch (d) {
|
|
100
|
-
o.open({
|
|
101
|
-
title: `Unable to delete ${e.name}`,
|
|
102
|
-
message: `See error from server: ${d}`,
|
|
103
|
-
type: "error"
|
|
104
|
-
}), console.error("error on deleting purchase order template", d);
|
|
105
|
-
} finally {
|
|
106
|
-
l.value = !1, m();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
const f = g({});
|
|
111
|
-
function b(e) {
|
|
112
|
-
f.value = {
|
|
113
|
-
template: e,
|
|
114
|
-
show: !0,
|
|
115
|
-
"onUpdate:show"(l) {
|
|
116
|
-
f.value.show = l;
|
|
117
|
-
},
|
|
118
|
-
"onAction:edit"() {
|
|
119
|
-
f.value.show = !1, y($(e));
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
}
|
|
123
|
-
function _() {
|
|
124
|
-
const { promise: e, resolve: l } = Promise.withResolvers(), m = (c) => {
|
|
125
|
-
l(c);
|
|
126
|
-
}, d = t.templates.filter(
|
|
127
|
-
(c) => {
|
|
128
|
-
var v;
|
|
129
|
-
return (!c.locations || c.locations.find((E) => E.doc._id === a.currentLocation.doc._id)) && ((v = c.purchaseOrder.supplier) == null ? void 0 : v._id) !== a.currentLocation.doc._id;
|
|
130
|
-
}
|
|
131
|
-
);
|
|
132
|
-
if (!d.length)
|
|
133
|
-
return r.open({
|
|
134
|
-
title: "Select one template",
|
|
135
|
-
message: "There is no available template in your business. Configure a new template?",
|
|
136
|
-
primaryActions: {
|
|
137
|
-
text: "Close",
|
|
138
|
-
close: !0
|
|
139
|
-
},
|
|
140
|
-
secondaryActions: {
|
|
141
|
-
text: "Close",
|
|
142
|
-
close: !0
|
|
143
|
-
}
|
|
144
|
-
}).onPrimary(() => {
|
|
145
|
-
n.push({ name: P.TRANSFER_TEMPLATE }), m(void 0);
|
|
146
|
-
}).onSecondary(() => m(void 0)).onClose(() => m(void 0)), e;
|
|
147
|
-
const w = d.map((c) => {
|
|
148
|
-
const v = !c.purchaseOrder.items.length || c.purchaseOrder.items.some(I);
|
|
149
|
-
return {
|
|
150
|
-
label: c.name,
|
|
151
|
-
value: c._id,
|
|
152
|
-
disabled: v,
|
|
153
|
-
sublabel: v ? "This template is invalid. Update this template." : void 0
|
|
154
|
-
};
|
|
155
|
-
});
|
|
156
|
-
return r.open({
|
|
157
|
-
title: "Select one template",
|
|
158
|
-
contentComponent: M,
|
|
159
|
-
contentComponentProps: {
|
|
160
|
-
items: w,
|
|
161
|
-
singleSelect: !0
|
|
162
|
-
},
|
|
163
|
-
primaryActions: {
|
|
164
|
-
text: "Confirm",
|
|
165
|
-
close: !0
|
|
166
|
-
},
|
|
167
|
-
secondaryActions: {
|
|
168
|
-
text: "Close",
|
|
169
|
-
close: !0
|
|
170
|
-
},
|
|
171
|
-
tertiaryActions: {
|
|
172
|
-
text: "Templates",
|
|
173
|
-
close: !0
|
|
174
|
-
}
|
|
175
|
-
}).onPrimary((c) => Array.isArray(c) ? m(c[0]) : null).onSecondary(() => m(void 0)).onTertiary(() => {
|
|
176
|
-
n.push({ name: P.TRANSFER_TEMPLATE }), m(void 0);
|
|
177
|
-
}).onClose(() => m(void 0)), e;
|
|
178
|
-
}
|
|
179
|
-
async function i(e) {
|
|
180
|
-
await s.importTemplates(e);
|
|
181
|
-
}
|
|
182
|
-
return {
|
|
183
|
-
createTemplate: p,
|
|
184
|
-
viewTemplate: b,
|
|
185
|
-
updateTemplate: y,
|
|
186
|
-
deleteTemplate: T,
|
|
187
|
-
getTemplateId: _,
|
|
188
|
-
importTemplates: i,
|
|
189
|
-
templateDialogProps: u,
|
|
190
|
-
templateDetailsProps: f
|
|
191
|
-
};
|
|
192
|
-
});
|
|
193
|
-
function k(r) {
|
|
194
|
-
const { skuById: o } = D(), a = $(r);
|
|
195
|
-
return a.purchaseOrder.items = r.purchaseOrder.items.filter((t) => o[t.sku._id]), a;
|
|
196
|
-
}
|
|
197
|
-
const J = N(
|
|
198
|
-
"transferTemplateTable",
|
|
199
|
-
function() {
|
|
200
|
-
const { t: o } = V(), { viewTemplate: a, updateTemplate: t, deleteTemplate: s } = G(), n = g(!1), u = g(new Array()), p = F(), y = D();
|
|
201
|
-
async function T() {
|
|
202
|
-
u.value = [], n.value = !0;
|
|
203
|
-
try {
|
|
204
|
-
const [i] = await Promise.all([
|
|
205
|
-
p.readTemplates(),
|
|
206
|
-
y.readInventory()
|
|
207
|
-
]).delayed(1e3);
|
|
208
|
-
u.value = i.map(k);
|
|
209
|
-
} catch (i) {
|
|
210
|
-
console.log("Something went wrong when fetching templates:", i);
|
|
211
|
-
} finally {
|
|
212
|
-
n.value = !1;
|
|
213
|
-
}
|
|
214
|
-
}
|
|
215
|
-
async function f(i) {
|
|
216
|
-
if (!u.value.find((e) => e._id)) {
|
|
217
|
-
n.value = !0;
|
|
218
|
-
try {
|
|
219
|
-
u.value = [
|
|
220
|
-
await p.getTemplate(i).then(k).delayed(1e3)
|
|
221
|
-
];
|
|
222
|
-
} catch (e) {
|
|
223
|
-
console.log("Something went wrong when fetching templates:", e);
|
|
224
|
-
} finally {
|
|
225
|
-
n.value = !1;
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
function b(i, e) {
|
|
230
|
-
switch (e = $(e), i) {
|
|
231
|
-
case h.Details:
|
|
232
|
-
return a(e);
|
|
233
|
-
case h.Edit:
|
|
234
|
-
return t(e);
|
|
235
|
-
case h.Delete:
|
|
236
|
-
return s(e, n, T);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
return {
|
|
240
|
-
columnDefs: [
|
|
241
|
-
{
|
|
242
|
-
id: "_id",
|
|
243
|
-
accessorKey: "_id",
|
|
244
|
-
header: () => o("inventory.transfer.table.createdAt"),
|
|
245
|
-
cell(i) {
|
|
246
|
-
return K(`${i.getValue()}`);
|
|
247
|
-
},
|
|
248
|
-
enableSorting: !0
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
id: "name",
|
|
252
|
-
accessorKey: "name",
|
|
253
|
-
header: () => o("inventory.transfer.table.name"),
|
|
254
|
-
enableSorting: !0,
|
|
255
|
-
size: 200
|
|
256
|
-
},
|
|
257
|
-
{
|
|
258
|
-
id: "noOfItems",
|
|
259
|
-
accessorKey: "purchaseOrder.items.length",
|
|
260
|
-
header: () => o("inventory.transfer.table.noOfItems"),
|
|
261
|
-
enableSorting: !1,
|
|
262
|
-
meta: {
|
|
263
|
-
width: "10rem",
|
|
264
|
-
textAlign: "right"
|
|
265
|
-
},
|
|
266
|
-
cell(i) {
|
|
267
|
-
const e = Number(i.getValue()) || 0, l = i.row.original.purchaseOrder.items.some(I);
|
|
268
|
-
return e === 0 || l ? S("div", { class: "flex justify-end gap-4 items-center" }, [
|
|
269
|
-
S(
|
|
270
|
-
R.FmTooltip,
|
|
271
|
-
{},
|
|
272
|
-
{
|
|
273
|
-
content() {
|
|
274
|
-
return l ? "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.";
|
|
275
|
-
},
|
|
276
|
-
default() {
|
|
277
|
-
return S(R.FmIcon, {
|
|
278
|
-
name: "error",
|
|
279
|
-
color: "system-error-300",
|
|
280
|
-
size: "sm"
|
|
281
|
-
});
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
),
|
|
285
|
-
e
|
|
286
|
-
]) : e;
|
|
287
|
-
}
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
id: "enabledLocations",
|
|
291
|
-
accessorKey: "purchaseOrder.locations.length",
|
|
292
|
-
header: () => "Enabled outlets",
|
|
293
|
-
cell(i) {
|
|
294
|
-
var l;
|
|
295
|
-
const e = (l = i.row.original.locations) == null ? void 0 : l.length;
|
|
296
|
-
return e ? `${e}` : "All";
|
|
297
|
-
},
|
|
298
|
-
enableSorting: !1,
|
|
299
|
-
meta: {
|
|
300
|
-
width: "10rem",
|
|
301
|
-
textAlign: "right"
|
|
302
|
-
}
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
id: "ref",
|
|
306
|
-
accessorKey: "purchaseOrder.ref",
|
|
307
|
-
header: () => o("inventory.transfer.table.reference"),
|
|
308
|
-
enableSorting: !1,
|
|
309
|
-
size: "auto"
|
|
310
|
-
},
|
|
311
|
-
{
|
|
312
|
-
id: "action",
|
|
313
|
-
cell(i) {
|
|
314
|
-
const e = i.row.original, l = [
|
|
315
|
-
A[h.Details],
|
|
316
|
-
A[h.Edit],
|
|
317
|
-
A[h.Delete]
|
|
318
|
-
];
|
|
319
|
-
return O(l, (m) => b(m, e));
|
|
320
|
-
},
|
|
321
|
-
enableSorting: !1,
|
|
322
|
-
size: 40,
|
|
323
|
-
meta: {
|
|
324
|
-
cellClass: "",
|
|
325
|
-
headerClass: ""
|
|
326
|
-
}
|
|
327
|
-
}
|
|
328
|
-
],
|
|
329
|
-
templates: u,
|
|
330
|
-
loading: n,
|
|
331
|
-
fetchTemplates: T,
|
|
332
|
-
loadTemplate: f
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
);
|
|
336
|
-
function ae(r, o, a) {
|
|
337
|
-
const t = (a == null ? void 0 : a.abbrev) ?? o.abbrev;
|
|
338
|
-
return `${L(r, !1)} ${t}`;
|
|
339
|
-
}
|
|
340
|
-
var Q = /* @__PURE__ */ ((r) => (r.PURCHASE = "PURCHASE", r.TRANSFER = "TRANSFER", r))(Q || {});
|
|
341
|
-
export {
|
|
342
|
-
Q as P,
|
|
343
|
-
F as a,
|
|
344
|
-
G as b,
|
|
345
|
-
ae as f,
|
|
346
|
-
I as t,
|
|
347
|
-
J as u
|
|
348
|
-
};
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { n as y, i as u, h as m, Z as b, $ as v } from "./app-TB3IWuaU.js";
|
|
2
|
-
import { useCoreStore as c } from "@feedmepos/mf-common";
|
|
3
|
-
import { defineStore as w } from "pinia";
|
|
4
|
-
import { ref as l, computed as d } from "vue";
|
|
5
|
-
const p = y((t, a) => {
|
|
6
|
-
function n() {
|
|
7
|
-
var o;
|
|
8
|
-
const s = c(), e = u(), r = e.businessLevel, i = `business_${((o = s.currentBusiness.value) == null ? void 0 : o._id) ?? ""}`, S = e.currentLocation.dbName;
|
|
9
|
-
return r ? i : S;
|
|
10
|
-
}
|
|
11
|
-
return {
|
|
12
|
-
async readSuppliers() {
|
|
13
|
-
const s = n(), e = `${t.inventoryBackendUrl}/${s}/supplier`;
|
|
14
|
-
return await a.get(e);
|
|
15
|
-
},
|
|
16
|
-
async readLocationSuppliers() {
|
|
17
|
-
const e = u().currentLocation.dbName, r = `${t.inventoryBackendUrl}/${e}/supplier`;
|
|
18
|
-
return await a.get(r);
|
|
19
|
-
},
|
|
20
|
-
async readBusinessSuppliers() {
|
|
21
|
-
var i;
|
|
22
|
-
const e = `business_${((i = c().currentBusiness.value) == null ? void 0 : i._id) ?? ""}`, r = `${t.inventoryBackendUrl}/${e}/supplier`;
|
|
23
|
-
return await a.get(r);
|
|
24
|
-
},
|
|
25
|
-
async createSupplier(s) {
|
|
26
|
-
const e = n(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
|
|
27
|
-
return await a.post(r, s);
|
|
28
|
-
},
|
|
29
|
-
async updateSupplier(s) {
|
|
30
|
-
const e = n(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
|
|
31
|
-
return await a.put(r, s);
|
|
32
|
-
},
|
|
33
|
-
async deleteSupplier(s) {
|
|
34
|
-
const e = n(), r = `${t.inventoryBackendUrl}/${e}/supplier`;
|
|
35
|
-
return await a.delete(r, s);
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
}), f = w("supplier", () => {
|
|
39
|
-
const t = l(new Array()), a = l(new Array()), n = d(() => [...t.value, ...a.value]), s = d(() => m(n.value, "_id"));
|
|
40
|
-
return {
|
|
41
|
-
async readSuppliers() {
|
|
42
|
-
const e = p();
|
|
43
|
-
t.value = await e.readLocationSuppliers(), a.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 = b();
|
|
56
|
-
try {
|
|
57
|
-
await this.readSuppliers();
|
|
58
|
-
} catch (r) {
|
|
59
|
-
throw r instanceof v || e.error("Error at reading suppliers"), r;
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
suppliers: n,
|
|
63
|
-
locationSuppliers: t,
|
|
64
|
-
businessSuppliers: a,
|
|
65
|
-
supplierById: s
|
|
66
|
-
};
|
|
67
|
-
});
|
|
68
|
-
export {
|
|
69
|
-
f as u
|
|
70
|
-
};
|