@feedmepos/mf-inventory-portal 0.0.22-dev.41 → 0.0.22-dev.42

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.
Files changed (44) hide show
  1. package/dist/{ApprovalView-DKqwRFlF.js → ApprovalView-5YpqaJKy.js} +3 -3
  2. package/dist/{BindingsDialog-CtMSqEuE.js → BindingsDialog-lGoLNJyU.js} +1 -1
  3. package/dist/{BindingsPicker-DCLNF1PL.js → BindingsPicker-CdvkacXh.js} +1 -1
  4. package/dist/{BindingsTable-6ndQuHeA.js → BindingsTable-B8G9Ckdk.js} +1 -1
  5. package/dist/ClosingTemplateView-Dcy08dPm.js +1775 -0
  6. package/dist/FmDroppableField-DeW5xBTW.js +154 -0
  7. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BUGB0uk3.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DBpTwDEI.js} +3 -3
  8. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CM93v-jp.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-cSTp7zUx.js} +1 -1
  9. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-SNp8etCc.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DFHzlUVu.js} +1 -1
  10. package/dist/{IngredientsView-B1jGkWYN.js → IngredientsView-DKJjOK_4.js} +5 -5
  11. package/dist/IntegrationView-CgqU4EBV.js +1141 -0
  12. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-mZQlrYaY.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-gvpXGm1X.js} +1 -1
  13. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BEFmqnHk.js → PremiumBadge.vue_vue_type_script_setup_true_lang-B3JDjoOu.js} +2 -2
  14. package/dist/{PurchaseOrderPrintPreview-DTQViYuX.js → PurchaseOrderPrintPreview-olI-JfjI.js} +1 -1
  15. package/dist/{ReceiveRequestView-CNRixgQu.js → ReceiveRequestView-flhI8D2c.js} +10 -10
  16. package/dist/{RecipeView-HStPC5pE.js → RecipeView-CoMyQ92u.js} +4 -4
  17. package/dist/{StockView-JO3NtkX9.js → StockView-Dae47pLA.js} +5 -5
  18. package/dist/{SupplierView-gtaS4K3U.js → SupplierView-CxYZUHrc.js} +3 -3
  19. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-dPt3qbcX.js → TransferDetails.vue_vue_type_script_setup_true_lang-DoEEedkk.js} +5 -5
  20. package/dist/TransferTemplateView-DdB7z0b4.js +1302 -0
  21. package/dist/{UnitView-dbInWUk4.js → UnitView-B0E2nG3J.js} +4 -4
  22. package/dist/{WarehouseView-BlTBvLF0.js → WarehouseView-NQ2JwyWK.js} +2 -2
  23. package/dist/{app-TB3IWuaU.js → app-tiUQG6R0.js} +3917 -3873
  24. package/dist/app.d.ts +50 -3
  25. package/dist/app.js +1 -1
  26. package/dist/components/FmMultiselectDialog.vue.d.ts +3 -9
  27. package/dist/{decimal-BRAYgPnN.js → decimal-BOvNv58m.js} +1 -1
  28. package/dist/{defineDeepModel-DrEk5Fhq.js → defineDeepModel-CNgIKGt8.js} +1 -1
  29. package/dist/{format-time-from-id-kpVYfVQb.js → format-time-from-id-DWlH-AZV.js} +1 -1
  30. package/dist/format-unit-display-DIhXvTxN.js +1195 -0
  31. package/dist/stores/netsuite.d.ts +1 -1
  32. package/dist/style.css +1 -1
  33. package/dist/{supplier-CJcqHpaM.js → supplier-rpkSwf7L.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/{use-template-enabled-locations-2-DyD24laW.js → use-template-enabled-locations-2-BrK8SKvw.js} +1 -1
  36. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +7 -5
  37. package/dist/{xlsx-Dd5ckm6-.js → xlsx-DGqkxpZX.js} +1 -1
  38. package/dist/{xlsx.util-qlqvEcJz.js → xlsx.util-CvycJwUf.js} +1 -1
  39. package/package.json +1 -1
  40. package/dist/ClosingTemplateView-BPrDQ_8-.js +0 -1688
  41. package/dist/FmDroppableField-DQFPEiJn.js +0 -152
  42. package/dist/IntegrationView-Bu0waSjB.js +0 -1141
  43. package/dist/TransferTemplateView-C0pjLfbz.js +0 -2054
  44. package/dist/purchase-order-transaction-type-ZMNa__2l.js +0 -348
@@ -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
- };