@feedmepos/mf-inventory-portal 0.0.17-dev.9 → 0.0.18-dev.2

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 (53) hide show
  1. package/dist/ApprovalView-DyazMoIY.js +118 -0
  2. package/dist/{BindingsDialog-Dw_DCOTY.js → BindingsDialog-D-p9eOMP.js} +2 -2
  3. package/dist/{BindingsPicker-BRLTF4Qs.js → BindingsPicker-C_kuxqQI.js} +2 -2
  4. package/dist/BindingsTable-jgL5-FZc.js +147 -0
  5. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DLc1nCIY.js +268 -0
  6. package/dist/{FmMultiselectDialog.vue_vue_type_script_setup_true_lang-YzVhmNJc.js → FmMultiselectDialog.vue_vue_type_script_setup_true_lang-D2Cg0s16.js} +2 -2
  7. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Dv01gy7k.js → FmUnitInput.vue_vue_type_script_setup_true_lang-FMI-Bp6y.js} +12 -12
  8. package/dist/IngredientsView-DnIHe3Gj.js +1672 -0
  9. package/dist/{IntegrationView-Xnl758CS.js → IntegrationView-CgYnK7JB.js} +260 -266
  10. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUj9Mnt6.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BObjqgU-.js} +6 -6
  11. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CW0h41FP.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DClJGGeY.js} +1 -1
  12. package/dist/{PurchaseOrderPrintPreview-DzimxkGt.js → PurchaseOrderPrintPreview-Vbmche3y.js} +1 -1
  13. package/dist/ReceiveRequestView-CpRdJQuN.js +1394 -0
  14. package/dist/{RecipeView-B9NcEw7x.js → RecipeView-Do3LgdfI.js} +182 -190
  15. package/dist/StockView-C16AHdmT.js +1862 -0
  16. package/dist/SupplierView-DGQXU4Ha.js +796 -0
  17. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BSwsz8Xt.js → TransferDetails.vue_vue_type_script_setup_true_lang-DK5gzjwS.js} +21 -20
  18. package/dist/{UnitView-BvbaRHxG.js → UnitView-AfEMV9Qr.js} +129 -133
  19. package/dist/{WarehouseView-Cf5Bmfhn.js → WarehouseView-Cph8wrcF.js} +260 -264
  20. package/dist/app-UpgZo4xX.js +66113 -0
  21. package/dist/app.js +1 -1
  22. package/dist/array-AvWd53LI.js +30 -0
  23. package/dist/components/FmInventoryTableToolbar.vue.d.ts +53 -0
  24. package/dist/date2-BfOl_Gio.js +95 -0
  25. package/dist/dayjs.min-r5rPIQFX.js +282 -0
  26. package/dist/{decimal-S-jYTEL5.js → decimal-CTa5OWKK.js} +1 -1
  27. package/dist/extensions/array.d.ts +1 -0
  28. package/dist/{fuzzy-DW00BX8H.js → fuzzy-0FMA9raY.js} +1 -1
  29. package/dist/{dayjs.min-M4PEyOKN.js → index-D9a9wXgJ.js} +3594 -3356
  30. package/dist/{layout-DACHKQ9G.js → layout-DxcK0DGS.js} +1 -1
  31. package/dist/number-BSqhQaRy.js +97 -0
  32. package/dist/{rules-ldw61cGA.js → rules-7WxBNkDE.js} +16 -15
  33. package/dist/stock-estimate-hfECAKZK.js +122 -0
  34. package/dist/{supplier-DjKC4TaM.js → supplier-Dg3f6Ybw.js} +1 -1
  35. package/dist/tsconfig.app.tsbuildinfo +1 -1
  36. package/dist/{use-inventory-binding-dialog-D1M09VoX.js → use-inventory-binding-dialog-NLy01qAo.js} +2 -2
  37. package/dist/views/ingredients/IngredientsView.vue.d.ts +1 -0
  38. package/dist/{xlsx-BcM9fWkc.js → xlsx-qSY56eID.js} +1 -1
  39. package/dist/{xlsx.util-BNXjhkYU.js → xlsx.util-DL8p0Kzi.js} +2 -2
  40. package/package.json +4 -4
  41. package/dist/ApprovalView-BJ_SGOrx.js +0 -134
  42. package/dist/BindingsTable-BMIkL0Bk.js +0 -121
  43. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-D9Qp3jke.js +0 -97
  44. package/dist/IngredientsView-DYFkUsHx.js +0 -1802
  45. package/dist/ReceiveRequestView-C_0jK6GY.js +0 -1435
  46. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-Dov3Uq2z.js +0 -64
  47. package/dist/StockView-JPw1K8aU.js +0 -1960
  48. package/dist/SupplierView-CiQLFWmQ.js +0 -804
  49. package/dist/app-BbXzmbBO.js +0 -42892
  50. package/dist/components/FmTableToolbar.vue.d.ts +0 -49
  51. package/dist/date2-DFqSdEvG.js +0 -189
  52. package/dist/init-date-range-B_ha80e0.js +0 -21
  53. package/dist/stock-estimate-DOP1qO5w.js +0 -145
@@ -1,6 +1,6 @@
1
1
  import { components as x, useBreakpoints as B } from "@feedmepos/ui-library";
2
2
  import { h as i, defineComponent as I, computed as M, resolveComponent as R, openBlock as u, createBlock as _, normalizeClass as V, withCtx as L, createElementVNode as d, renderSlot as z, normalizeProps as N, guardReactiveProps as P, createElementBlock as c, Fragment as h, renderList as D, createVNode as k, unref as b, createCommentVNode as w } from "vue";
3
- import { x as E } from "./app-BbXzmbBO.js";
3
+ import { x as E } from "./app-UpgZo4xX.js";
4
4
  const { FmMenu: S, FmButton: $, FmMenuItem: j } = x;
5
5
  function Q(o, n) {
6
6
  return i(
@@ -0,0 +1,97 @@
1
+ import { F as e } from "./index-D9a9wXgJ.js";
2
+ function p(n, t) {
3
+ return e.convertPrecision({
4
+ value: n,
5
+ precision: t
6
+ });
7
+ }
8
+ function d(n, t) {
9
+ return e.add([n, t]);
10
+ }
11
+ function b(n, t) {
12
+ return e.multiply([n, t]);
13
+ }
14
+ function h(n, t) {
15
+ const i = Math.floor(n.amount * t.amount), r = i === 0 ? 0 : n.precision + t.precision, o = u(i), s = Math.min(r, o);
16
+ return {
17
+ amount: i / Math.pow(10, s),
18
+ precision: r - s
19
+ };
20
+ }
21
+ function a(n, t) {
22
+ const i = +c(n), r = +c(t);
23
+ return i / r;
24
+ }
25
+ function g(n, t) {
26
+ const i = a(n, t);
27
+ return l(i);
28
+ }
29
+ function M(n, t) {
30
+ return n.precision >= t ? n : e.convertPrecision({ value: n, precision: t });
31
+ }
32
+ function v(n) {
33
+ const t = u(n.amount), i = n.precision - t;
34
+ return e.convertPrecision({ value: n, precision: Math.max(0, i) });
35
+ }
36
+ function c(n, t = !0) {
37
+ return t ? Number(n.amount / Math.pow(10, n.precision)).toFixed(n.precision) : Number(n.amount / Math.pow(10, n.precision)).toString();
38
+ }
39
+ function A(n, t = !1, i = 2) {
40
+ const r = Number(n.amount / Math.pow(10, n.precision)), o = r.toFixed(
41
+ Number.isInteger(r) ? 2 : Math.min(4, Math.max(2, i))
42
+ );
43
+ return t ? `${o} ${n.currency}` : n.currency === "MYR" ? `RM ${o}` : `${n.currency} ${o}`;
44
+ }
45
+ function j(n) {
46
+ return {
47
+ ...n,
48
+ amount: Math.abs(n.amount)
49
+ };
50
+ }
51
+ function m(n) {
52
+ if (!isFinite(n)) return 0;
53
+ let t = 1, i = 0;
54
+ for (; Math.round(n * t) / t !== n; )
55
+ t *= 10, i++;
56
+ return i;
57
+ }
58
+ function l(n) {
59
+ const t = m(n);
60
+ return {
61
+ precision: t,
62
+ amount: n * 10 ** t
63
+ };
64
+ }
65
+ function N(n, t = 0, i = !1) {
66
+ let r = 0;
67
+ return Number.isNaN(Number(n)) || (i || Number(n) >= 0) && (r = Number(n)), {
68
+ amount: Number((r * 10 ** t).toFixed(0)),
69
+ precision: t
70
+ };
71
+ }
72
+ function u(n) {
73
+ const t = `${n}`, i = t.replace(/0*$/g, "");
74
+ return t.length - i.length;
75
+ }
76
+ function y(n, t) {
77
+ if (!t)
78
+ return n.precision;
79
+ const i = u(t.conversion.amount);
80
+ return n.precision - t.conversion.precision + i;
81
+ }
82
+ export {
83
+ c as a,
84
+ h as b,
85
+ l as c,
86
+ m as d,
87
+ j as e,
88
+ b as f,
89
+ y as g,
90
+ d as h,
91
+ A as i,
92
+ p as j,
93
+ g as k,
94
+ v as l,
95
+ N as t,
96
+ M as u
97
+ };
@@ -1,5 +1,6 @@
1
- import { a as u, q as s, j as m, g as d, c as f } from "./date2-DFqSdEvG.js";
2
- function p() {
1
+ import { a as u, g as d, c as f } from "./number-BSqhQaRy.js";
2
+ import { c as s, a as m } from "./date2-BfOl_Gio.js";
3
+ function y() {
3
4
  return function(n) {
4
5
  return !!n || "Required";
5
6
  };
@@ -7,7 +8,7 @@ function p() {
7
8
  function b(t) {
8
9
  return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "amount") && Object.prototype.hasOwnProperty.call(t, "precision");
9
10
  }
10
- function y(t, n) {
11
+ function A(t, n) {
11
12
  const o = typeof t == "object" ? +u(t) : t;
12
13
  function i(e) {
13
14
  return Object.prototype.hasOwnProperty.call(e, "length");
@@ -16,7 +17,7 @@ function y(t, n) {
16
17
  return b(r) && (r = +u(r)), i(r) ? r.length >= o ? !0 : typeof n == "function" ? n(r.length) : n ?? `Must be at least ${o}` : typeof r == "number" ? r >= o ? !0 : typeof n == "function" ? n(r) : n ?? `Must be at least ${o}` : `Cannot validate at least ${o}`;
17
18
  };
18
19
  }
19
- function A(t) {
20
+ function M(t) {
20
21
  const n = typeof t == "object" ? +u(t) : t;
21
22
  function o(i) {
22
23
  return Object.prototype.hasOwnProperty.call(i, "length");
@@ -25,7 +26,7 @@ function A(t) {
25
26
  return b(e) && (e = +u(e)), o(e) ? e.length > n ? !0 : typeof r == "function" ? r(e.length) : r ?? `Must be more than ${n}` : typeof e == "number" ? e > n ? !0 : typeof r == "function" ? r(e) : r ?? `Must be more than ${n}` : `Cannot validate more than ${n}`;
26
27
  };
27
28
  }
28
- function M(t, n) {
29
+ function P(t, n) {
29
30
  return t instanceof Date && n instanceof Date ? function(i) {
30
31
  const e = new Date(i);
31
32
  return isNaN(e.getTime()) ? "Invalid date" : e.getTime() < t.getTime() ? `Date must be at least ${s(t)} ${m(t)}` : e.getTime() >= n.getTime() ? `Date must be less than ${s(n)} ${m(n)}` : !0;
@@ -44,7 +45,7 @@ function a() {
44
45
  return isFinite(n) || "Must be a number";
45
46
  };
46
47
  }
47
- function j(t, n) {
48
+ function $(t, n) {
48
49
  return typeof t == "number" ? function(i) {
49
50
  const e = a()(i);
50
51
  return typeof e == "string" ? e : f(+i).precision > t ? `Precision cannot be more than ${t} decimal point.` : !0;
@@ -56,7 +57,7 @@ function j(t, n) {
56
57
  return f(+i).precision > r ? `Precision cannot be more than ${r} decimal point.` : !0;
57
58
  };
58
59
  }
59
- function P(t, n) {
60
+ function j(t, n) {
60
61
  return function(i) {
61
62
  const e = a()(i);
62
63
  if (typeof e == "string")
@@ -65,7 +66,7 @@ function P(t, n) {
65
66
  return r.precision > t ? typeof n == "function" ? n(r.precision) : n ?? `Precision cannot be more than ${t}` : !0;
66
67
  };
67
68
  }
68
- function $(t, n, o) {
69
+ function g(t, n, o) {
69
70
  return function(e) {
70
71
  if (e === n) return !0;
71
72
  const r = t.find((c) => c.value === e);
@@ -73,12 +74,12 @@ function $(t, n, o) {
73
74
  };
74
75
  }
75
76
  export {
76
- y as A,
77
- M as B,
77
+ A,
78
+ P as B,
78
79
  a as I,
79
- j as M,
80
- p as R,
81
- $ as U,
82
- A as a,
83
- P as b
80
+ $ as M,
81
+ y as R,
82
+ g as U,
83
+ M as a,
84
+ j as b
84
85
  };
@@ -0,0 +1,122 @@
1
+ import { u as l, a as f } from "./xlsx-qSY56eID.js";
2
+ import { defineComponent as _, resolveComponent as d, openBlock as h, createElementBlock as y, renderSlot as F, createVNode as p, withCtx as v, createElementVNode as g, ref as k } from "vue";
3
+ import { h as x, f as I } from "./app-UpgZo4xX.js";
4
+ import { useCoreStore as w } from "@feedmepos/mf-common";
5
+ function S(e, t) {
6
+ return t.map((r) => typeof r.selector == "function" ? r.selector(e) : e[r.selector]);
7
+ }
8
+ function b(e, t) {
9
+ const r = t.map((s) => s.name), o = e.map((s) => S(s, t));
10
+ return l.aoa_to_sheet([r, ...o]);
11
+ }
12
+ async function P(e, t) {
13
+ const r = l.book_new();
14
+ for (const o of e) {
15
+ const s = b(
16
+ o.data,
17
+ o.columns.map((n) => typeof n == "string" ? {
18
+ name: n,
19
+ selector: n
20
+ } : n)
21
+ );
22
+ l.book_append_sheet(r, s, o.name);
23
+ }
24
+ await f(r, t);
25
+ }
26
+ const O = { class: "flex items-center gap-8" }, E = { class: "p-4 bg-fm-color-system-warning-100 fm-corner-radius-md flex items-center" }, B = "Experience stock lifespan estimates powered by REMY AI. Currently available as a preview, this will become a premium feature.", L = /* @__PURE__ */ _({
27
+ __name: "PremiumBadge",
28
+ props: {
29
+ zIndex: {}
30
+ },
31
+ setup(e) {
32
+ return (t, r) => {
33
+ const o = d("FmIcon"), s = d("FmTooltip");
34
+ return h(), y("div", O, [
35
+ F(t.$slots, "default"),
36
+ p(s, {
37
+ variant: "plain",
38
+ placement: "top",
39
+ content: B,
40
+ "z-index": t.zIndex
41
+ }, {
42
+ default: v(() => [
43
+ g("div", E, [
44
+ p(o, {
45
+ name: "hotel_class",
46
+ class: "text-fm-color-primary",
47
+ size: "sm"
48
+ })
49
+ ])
50
+ ]),
51
+ _: 1
52
+ }, 8, ["z-index"])
53
+ ]);
54
+ };
55
+ }
56
+ });
57
+ function T(e) {
58
+ let t = e.substring(e.indexOf("_") + 1);
59
+ return t.includes("_") && (t = t.substring(0, t.lastIndexOf("_"))), Number.isNaN(Date.parse(t)) ? null : new Date(t).toISOString();
60
+ }
61
+ const m = x((e, t) => {
62
+ const r = I(), o = w();
63
+ return {
64
+ async getInventoryForecast() {
65
+ var a;
66
+ const s = ((a = o.currentBusiness.value) == null ? void 0 : a._id) ?? "", n = r.currentLocationId ?? "", i = `${e.dataBackendUrl}/${s}/${n}/inventory-forecast`;
67
+ try {
68
+ return await t.get(i);
69
+ } catch {
70
+ return { skus: [] };
71
+ }
72
+ },
73
+ async getPurchaseOrderForecast(s) {
74
+ var u;
75
+ const n = ((u = o.currentBusiness.value) == null ? void 0 : u._id) ?? "", i = r.currentLocationId ?? "", a = `${e.dataBackendUrl}/${n}/${i}/purchase-order-forecast?days=${s}`;
76
+ try {
77
+ return await t.get(a);
78
+ } catch {
79
+ return { skus: [] };
80
+ }
81
+ }
82
+ };
83
+ });
84
+ function $() {
85
+ return {
86
+ inventoryForecast: { skus: [] },
87
+ purchaseOrderForecast: { skus: [] }
88
+ };
89
+ }
90
+ const c = k($());
91
+ function M() {
92
+ return {
93
+ // state
94
+ get inventoryForecast() {
95
+ return c.value.inventoryForecast;
96
+ },
97
+ set inventoryForecast(e) {
98
+ c.value.inventoryForecast = e;
99
+ },
100
+ get purchaseOrderForecast() {
101
+ return c.value.purchaseOrderForecast;
102
+ },
103
+ set purchaseOrderForecast(e) {
104
+ c.value.purchaseOrderForecast = e;
105
+ },
106
+ // actions
107
+ async readStockEstimateBalance() {
108
+ const e = m();
109
+ this.inventoryForecast = await e.getInventoryForecast();
110
+ },
111
+ async readPurchaseOrder(e) {
112
+ const t = m();
113
+ this.purchaseOrderForecast = await t.getPurchaseOrderForecast(e);
114
+ }
115
+ };
116
+ }
117
+ export {
118
+ L as _,
119
+ P as e,
120
+ T as i,
121
+ M as u
122
+ };
@@ -1,4 +1,4 @@
1
- import { h as u, f as o, k as c, l } from "./app-BbXzmbBO.js";
1
+ import { h as u, f as o, k as c, l } from "./app-UpgZo4xX.js";
2
2
  import { ref as d } from "vue";
3
3
  const n = u((e, r) => {
4
4
  const a = o();