@feedmepos/mf-inventory-portal 0.0.18-dev.3 → 0.0.19-dev.10

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 (114) hide show
  1. package/dist/ApprovalView-BgTTFiOw.js +121 -0
  2. package/dist/{BindingsDialog-CVeD1mOn.js → BindingsDialog-BROnpXEI.js} +9 -10
  3. package/dist/{BindingsPicker-K04aOoGr.js → BindingsPicker-aQHfS_vY.js} +7 -8
  4. package/dist/{BindingsTable-65aYkpX7.js → BindingsTable-DvtIQMFk.js} +4 -6
  5. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DR9YAhaJ.js +272 -0
  6. package/dist/IngredientsView-BgAQCCD-.js +1751 -0
  7. package/dist/IntegrationView-DEBb_X5K.js +1172 -0
  8. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-kidodonU.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VF3PDSzP.js} +1 -1
  9. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-BIRzNfFN.js +88 -0
  10. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js +29 -0
  11. package/dist/{PurchaseOrderPrintPreview-B4uzudnC.js → PurchaseOrderPrintPreview-D2zNGZhx.js} +4 -4
  12. package/dist/ReceiveRequestView-Dc5JlUMC.js +208 -0
  13. package/dist/RecipeView-C1DBn8pW.js +573 -0
  14. package/dist/StockForecast.vue_vue_type_style_index_0_lang-KLXSWvo5.js +59 -0
  15. package/dist/StockView-6wi6BEOE.js +1877 -0
  16. package/dist/SupplierView-CS7YdL5Q.js +801 -0
  17. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CBbbXOhl.js +745 -0
  18. package/dist/TransferDialog.vue_vue_type_script_setup_true_lang-CWEypKBc.js +1662 -0
  19. package/dist/TransferTemplateView-C1hmdeKM.js +933 -0
  20. package/dist/UnitView-BUdKTKch.js +638 -0
  21. package/dist/WarehouseView-BbreEn79.js +1050 -0
  22. package/dist/api/bill.d.ts +2 -2
  23. package/dist/api/purchase-order-template.d.ts +7 -0
  24. package/dist/app-B3oV5Muh.js +67059 -0
  25. package/dist/app.d.ts +1111 -0
  26. package/dist/app.js +7 -3
  27. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  28. package/dist/components/FmMultiselectDialogProps.d.ts +7 -0
  29. package/dist/components/FmUnitInputProps.d.ts +2 -0
  30. package/dist/components/FmUnitInputRules.d.ts +1 -0
  31. package/dist/components/row-action.enum.d.ts +2 -0
  32. package/dist/composable/defineDeepModel.d.ts +2 -0
  33. package/dist/{decimal-ziY3648r.js → decimal-DzjRPmPY.js} +1 -1
  34. package/dist/helper/country.d.ts +2 -0
  35. package/dist/id-to-date-CG1QobkF.js +30 -0
  36. package/dist/layout-qEWDq5Vs.js +147 -0
  37. package/dist/purchase-order-transaction-type-D-GMrgDp.js +294 -0
  38. package/dist/router/name.d.ts +2 -1
  39. package/dist/row-action.enum-7jVyol1k.js +36 -0
  40. package/dist/stores/supplier.d.ts +90 -7
  41. package/dist/style.css +1 -1
  42. package/dist/supplier-BE_AQA4h.js +54 -0
  43. package/dist/tsconfig.app.tsbuildinfo +1 -1
  44. package/dist/views/dev/components/FmMultiselectDialogGrouped.vue.d.ts +2 -0
  45. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +2 -0
  46. package/dist/views/ingredients/components/inventory-binding/InventoryBindingSummary.vue.d.ts +26 -0
  47. package/dist/views/ingredients/composables/use-ingredient-form.d.ts +14 -2
  48. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -2
  49. package/dist/views/ingredients/helper/calculate-default-cost.d.ts +9 -0
  50. package/dist/views/receive-request/components/transfer-dialog/TransferDialogProps.d.ts +1 -0
  51. package/dist/views/receive-request/components/transfer-form/SparkIcon.vue.d.ts +1 -1
  52. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +4 -0
  53. package/dist/views/receive-request/components/transfer-form/TransferForm2.vue.d.ts +22 -0
  54. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +2 -1
  55. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +187 -0
  56. package/dist/views/receive-request/components/transfer-form/components/TransferItem.vue.d.ts +23 -0
  57. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +21 -0
  58. package/dist/views/receive-request/components/transfer-form/composables/use-backdate-po.d.ts +9 -0
  59. package/dist/views/receive-request/components/transfer-form/composables/use-compare-price.d.ts +6 -0
  60. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +112 -0
  61. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +3 -1
  62. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +18 -12
  63. package/dist/views/receive-request/helper/get-transfer-type.d.ts +2 -0
  64. package/dist/views/recipe/composables/use-recipe-form.d.ts +14 -2
  65. package/dist/views/recipe/composables/use-recipe-table.d.ts +1 -2
  66. package/dist/views/stock/components/StockRecordCard.vue.d.ts +1 -1
  67. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -2
  68. package/dist/views/stock/composables/use-stock-action.d.ts +26 -0
  69. package/dist/views/stock/composables/use-stock-table.d.ts +1 -8
  70. package/dist/views/stock/helper/compute-summary-total.d.ts +2 -2
  71. package/dist/views/transfer-template/TransferTemplateView.vue.d.ts +2 -0
  72. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +22 -0
  73. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialogProps.d.ts +10 -0
  74. package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateForm.vue.d.ts +16 -0
  75. package/dist/views/transfer-template/components/transfer-template-form/TransferTemplateFormProps.d.ts +7 -0
  76. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItem.vue.d.ts +18 -0
  77. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +116 -0
  78. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +112 -0
  79. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +470 -0
  80. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +290 -0
  81. package/dist/views/unit/composables/use-unit-form.d.ts +14 -2
  82. package/dist/views/unit/composables/use-unit-table.d.ts +1 -2
  83. package/dist/{xlsx-BG4CsaGF.js → xlsx-BGXLmGtO.js} +1 -1
  84. package/dist/xlsx.util-DxU-P-ww.js +109 -0
  85. package/package.json +6 -5
  86. package/dist/ApprovalView-G-u9nPxH.js +0 -118
  87. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-DgHp7KgJ.js +0 -268
  88. package/dist/FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C5WBLEy3.js +0 -143
  89. package/dist/FmUnitInput.vue_vue_type_script_setup_true_lang-QKFZeZKM.js +0 -236
  90. package/dist/IngredientsView-6Q2UWsu-.js +0 -1776
  91. package/dist/IntegrationView-ZMPPIopU.js +0 -1166
  92. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-C8YTZoBw.js +0 -276
  93. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-BvadeWUz.js +0 -35
  94. package/dist/ReceiveRequestView-DuHtLwZN.js +0 -1394
  95. package/dist/RecipeView-CRj0pC9N.js +0 -573
  96. package/dist/StockForecast.vue_vue_type_style_index_0_lang-B5EK101t.js +0 -58
  97. package/dist/StockView-CQbeZ5pU.js +0 -1862
  98. package/dist/SupplierView-CrfQATQf.js +0 -796
  99. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-CLUo-Tve.js +0 -1028
  100. package/dist/UnitView-D1acjiRV.js +0 -635
  101. package/dist/WarehouseView-DID1G1qK.js +0 -1043
  102. package/dist/app-D1teOEQX.js +0 -66113
  103. package/dist/date2-6Vt_hnAG.js +0 -95
  104. package/dist/dayjs.min-Co7-8-Mb.js +0 -282
  105. package/dist/fuzzy-gvHXFsh0.js +0 -41
  106. package/dist/index-Do1KDD1S.js +0 -21515
  107. package/dist/layout-BxDEsp4a.js +0 -151
  108. package/dist/number-Dvvpk3SV.js +0 -97
  109. package/dist/row-action.enum-BwQbURNh.js +0 -28
  110. package/dist/rules-CQu9yXsg.js +0 -85
  111. package/dist/stock-estimate-Wysv30cx.js +0 -122
  112. package/dist/supplier-BFdAYn3E.js +0 -65
  113. package/dist/use-inventory-binding-dialog-CuyOzZ5r.js +0 -93
  114. package/dist/xlsx.util-BkVYceD0.js +0 -107
@@ -1,151 +0,0 @@
1
- import { components as x, useBreakpoints as B } from "@feedmepos/ui-library";
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-D1teOEQX.js";
4
- const { FmMenu: S, FmButton: $, FmMenuItem: j } = x;
5
- function Q(o, n) {
6
- return i(
7
- S,
8
- {
9
- trigger: "click",
10
- stopClickPropagation: !0
11
- },
12
- {
13
- "menu-button": () => i($, {
14
- type: "button",
15
- variant: "tertiary",
16
- icon: "more_vert",
17
- iconColor: "#000000",
18
- size: "md"
19
- }),
20
- default: () => i(
21
- "div",
22
- {
23
- style: {
24
- backgroundColor: "white",
25
- padding: "4px",
26
- width: "160px"
27
- }
28
- },
29
- o.map(({ label: t, color: e, value: r }) => i(
30
- j,
31
- {
32
- onClick() {
33
- n(r ?? t);
34
- }
35
- },
36
- {
37
- label: () => i(
38
- "span",
39
- {
40
- class: e
41
- },
42
- t
43
- )
44
- }
45
- ))
46
- )
47
- }
48
- );
49
- }
50
- /**
51
- * vue-table
52
- *
53
- * Copyright (c) TanStack
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */
60
- const y = I({
61
- props: ["render", "props"],
62
- setup: (o) => () => typeof o.render == "function" || typeof o.render == "object" ? i(o.render, o.props) : o.render
63
- }), A = { class: "flex gap-4 w-full" }, H = { class: "flex-1" }, T = { class: "flex flex-col" }, q = { key: 0 }, G = { key: 0 }, U = /* @__PURE__ */ I({
64
- __name: "TableActionableRow",
65
- props: {
66
- row: {},
67
- onRowClick: {},
68
- actionColumnId: { default: "action" }
69
- },
70
- setup(o) {
71
- const n = o, t = M(
72
- () => n.row.getVisibleCells().reduce(
73
- (e, r) => (e[r.column.id] = r, e),
74
- {}
75
- )
76
- );
77
- return (e, r) => {
78
- const F = R("FmListItem");
79
- return u(), _(F, {
80
- class: V([
81
- "px-12 py-16 w-full border-b border-fm-color-neutral-gray-100",
82
- {
83
- "bg-fm-color-neutral-gray-100": e.row.getIsSelected(),
84
- "cursor-pointer": typeof e.onRowClick == "function"
85
- }
86
- ]),
87
- tag: "label",
88
- onClick: r[0] || (r[0] = (m) => {
89
- var s;
90
- return (s = e.onRowClick) == null ? void 0 : s.call(e, e.row.original);
91
- })
92
- }, {
93
- default: L(() => {
94
- var m, s, p, a, f;
95
- return [
96
- d("div", A, [
97
- d("div", H, [
98
- z(e.$slots, "default", N(P(t.value)), () => [
99
- d("div", T, [
100
- (u(!0), c(h, null, D(n.row.getVisibleCells(), (l) => {
101
- var C, g, v;
102
- return u(), c(h, {
103
- key: l.id
104
- }, [
105
- l.column.id !== e.actionColumnId ? (u(), c("div", q, [
106
- k(b(y), {
107
- render: (g = (C = l.column) == null ? void 0 : C.columnDef) == null ? void 0 : g.cell,
108
- props: (v = l.getContext) == null ? void 0 : v.call(l)
109
- }, null, 8, ["render", "props"])
110
- ])) : w("", !0)
111
- ], 64);
112
- }), 128))
113
- ])
114
- ])
115
- ]),
116
- t.value[e.actionColumnId ?? ""] ? (u(), c("div", G, [
117
- d("div", null, [
118
- k(b(y), {
119
- render: (p = (s = (m = t.value[e.actionColumnId ?? ""]) == null ? void 0 : m.column) == null ? void 0 : s.columnDef) == null ? void 0 : p.cell,
120
- props: (f = (a = t.value[e.actionColumnId ?? ""]) == null ? void 0 : a.getContext) == null ? void 0 : f.call(a)
121
- }, null, 8, ["render", "props"])
122
- ])
123
- ])) : w("", !0)
124
- ])
125
- ];
126
- }),
127
- _: 3
128
- }, 8, ["class"]);
129
- };
130
- }
131
- });
132
- function W() {
133
- return {
134
- get tableHeight() {
135
- const o = E(), { breakpoints: n } = B();
136
- return o.isIframeMode ? n.value.xs || n.value.sm ? {
137
- height: "calc(100dvh - 180px)"
138
- } : {
139
- height: "calc(100dvh - 124px)"
140
- } : {
141
- height: "calc(100dvh - 180px)"
142
- };
143
- }
144
- };
145
- }
146
- export {
147
- y as F,
148
- U as _,
149
- Q as c,
150
- W as u
151
- };
@@ -1,97 +0,0 @@
1
- import { F as e } from "./index-Do1KDD1S.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,28 +0,0 @@
1
- var e = /* @__PURE__ */ ((t) => (t.READ = "READ", t.UPDATE = "UPDATE", t.CREATE = "CREATE", t))(e || {}), r = /* @__PURE__ */ ((t) => (t.Print = "Print", t.Update = "Update", t.Details = "Details", t.Edit = "Edit", t.Delete = "Delete", t))(r || {});
2
- const l = {
3
- Update: {
4
- label: "Update",
5
- color: "text-fm-color-typo-primary"
6
- },
7
- Details: {
8
- label: "Details",
9
- color: "text-fm-color-typo-primary"
10
- },
11
- Print: {
12
- label: "Print",
13
- color: "text-fm-color-typo-primary"
14
- },
15
- Edit: {
16
- label: "Edit",
17
- color: "text-fm-color-typo-primary"
18
- },
19
- Delete: {
20
- label: "Delete",
21
- color: "text-fm-color-typo-error"
22
- }
23
- };
24
- export {
25
- l as D,
26
- e as F,
27
- r as R
28
- };
@@ -1,85 +0,0 @@
1
- import { a as u, g as d, c as f } from "./number-Dvvpk3SV.js";
2
- import { c as s, a as m } from "./date2-6Vt_hnAG.js";
3
- function y() {
4
- return function(n) {
5
- return !!n || "Required";
6
- };
7
- }
8
- function b(t) {
9
- return t && typeof t == "object" && Object.prototype.hasOwnProperty.call(t, "amount") && Object.prototype.hasOwnProperty.call(t, "precision");
10
- }
11
- function A(t, n) {
12
- const o = typeof t == "object" ? +u(t) : t;
13
- function i(e) {
14
- return Object.prototype.hasOwnProperty.call(e, "length");
15
- }
16
- return function(r) {
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}`;
18
- };
19
- }
20
- function M(t) {
21
- const n = typeof t == "object" ? +u(t) : t;
22
- function o(i) {
23
- return Object.prototype.hasOwnProperty.call(i, "length");
24
- }
25
- return function(e, r) {
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}`;
27
- };
28
- }
29
- function P(t, n) {
30
- return t instanceof Date && n instanceof Date ? function(i) {
31
- const e = new Date(i);
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;
33
- } : typeof t == "number" && typeof n == "number" ? function(i) {
34
- const e = +i;
35
- return isNaN(e) ? "Invalid number" : e < t ? `Value must be at least ${t}` : e >= n ? `Value must be less than ${n}` : !0;
36
- } : function() {
37
- return "Progamming error: invalid range parameter.";
38
- };
39
- }
40
- function a() {
41
- return function(t) {
42
- if (t = String(t), t.length === 0)
43
- return !0;
44
- const n = +t;
45
- return isFinite(n) || "Must be a number";
46
- };
47
- }
48
- function $(t, n) {
49
- return typeof t == "number" ? function(i) {
50
- const e = a()(i);
51
- return typeof e == "string" ? e : f(+i).precision > t ? `Precision cannot be more than ${t} decimal point.` : !0;
52
- } : function(i) {
53
- const e = a()(i);
54
- if (typeof e == "string")
55
- return e;
56
- const r = d(t, n);
57
- return f(+i).precision > r ? `Precision cannot be more than ${r} decimal point.` : !0;
58
- };
59
- }
60
- function j(t, n) {
61
- return function(i) {
62
- const e = a()(i);
63
- if (typeof e == "string")
64
- return e;
65
- const r = f(+i);
66
- return r.precision > t ? typeof n == "function" ? n(r.precision) : n ?? `Precision cannot be more than ${t}` : !0;
67
- };
68
- }
69
- function g(t, n, o) {
70
- return function(e) {
71
- if (e === n) return !0;
72
- const r = t.find((c) => c.value === e);
73
- return r ? o ? o(r) : `Already used in ${r.label}` : !0;
74
- };
75
- }
76
- export {
77
- A,
78
- P as B,
79
- a as I,
80
- $ as M,
81
- y as R,
82
- g as U,
83
- M as a,
84
- j as b
85
- };
@@ -1,122 +0,0 @@
1
- import { u as l, a as f } from "./xlsx-BG4CsaGF.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-D1teOEQX.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,65 +0,0 @@
1
- import { h as u, f as o, k as c, l } from "./app-D1teOEQX.js";
2
- import { ref as d } from "vue";
3
- const n = u((e, r) => {
4
- const a = o();
5
- return {
6
- async readSuppliers() {
7
- const t = a.currentLocation.dbName, p = `${e.inventoryBackendUrl}/${t}/supplier`;
8
- return await r.get(p);
9
- },
10
- async createSupplier(t) {
11
- const p = a.currentLocation.dbName, i = `${e.inventoryBackendUrl}/${p}/supplier`;
12
- return await r.post(i, t);
13
- },
14
- async updateSupplier(t) {
15
- const p = a.currentLocation.dbName, i = `${e.inventoryBackendUrl}/${p}/supplier`;
16
- return await r.put(i, t);
17
- },
18
- async deleteSupplier(t) {
19
- const p = a.currentLocation.dbName, i = `${e.inventoryBackendUrl}/${p}/supplier`;
20
- return await r.delete(i, t);
21
- }
22
- };
23
- });
24
- function S() {
25
- return {
26
- suppliers: []
27
- };
28
- }
29
- const s = d(S());
30
- function f() {
31
- return {
32
- // state
33
- get suppliers() {
34
- return s.value.suppliers;
35
- },
36
- set suppliers(e) {
37
- s.value.suppliers = e;
38
- },
39
- // action
40
- async readSuppliers() {
41
- const e = n();
42
- this.suppliers = await e.readSuppliers();
43
- },
44
- async createSupplier(e) {
45
- await n().createSupplier(e);
46
- },
47
- async updateSupplier(e) {
48
- await n().updateSupplier(e);
49
- },
50
- async deleteSupplier(e) {
51
- await n().deleteSupplier(e);
52
- },
53
- async init() {
54
- const e = c();
55
- try {
56
- await this.readSuppliers();
57
- } catch (r) {
58
- throw r instanceof l || e.error("Error at reading suppliers"), r;
59
- }
60
- }
61
- };
62
- }
63
- export {
64
- f as u
65
- };
@@ -1,93 +0,0 @@
1
- import { _ as y } from "./FmMultiselectDialog.vue_vue_type_script_setup_true_lang-C5WBLEy3.js";
2
- import { u as v } from "./app-D1teOEQX.js";
3
- import { useDialog as g } from "@feedmepos/ui-library";
4
- function E() {
5
- const d = v(), f = g();
6
- async function b(e, c, r, p = []) {
7
- const m = e.filter((t) => t.type === "SKU"), l = e.filter((t) => t.type === "RECIPE"), i = (r ? d.skus.filter(
8
- (t) => {
9
- var n, o;
10
- return !p.some((s) => s === t._id) && t._id !== r && !((o = (n = t.convert) == null ? void 0 : n.inventoryBindings) != null && o.some((s) => s.id === r));
11
- }
12
- ) : d.skus).map((t) => ({
13
- label: t.name,
14
- sublabel: t.code,
15
- value: t
16
- })), a = i.filter((t) => m.find((n) => n.id === t.value._id)).map((t) => t.value);
17
- f.open({
18
- title: "Select Ingredients",
19
- contentComponent: y,
20
- contentComponentProps: {
21
- items: i,
22
- modelValue: a
23
- },
24
- primaryActions: {
25
- text: "Confirm",
26
- close: !0
27
- },
28
- secondaryActions: {
29
- text: "Close",
30
- close: !0,
31
- variant: "tertiary"
32
- }
33
- }).onPrimary((t) => {
34
- const n = [
35
- ...l,
36
- ...e.filter((o) => t.find((s) => s._id === o.id)),
37
- ...t.filter((o) => !e.find((s) => s.id === o._id)).map((o) => ({
38
- type: "SKU",
39
- id: o._id,
40
- amount: {
41
- amount: 1,
42
- precision: 0
43
- }
44
- }))
45
- ];
46
- c(n);
47
- });
48
- }
49
- async function _(e, c, r = []) {
50
- const p = e.filter((i) => i.type === "SKU"), m = e.filter((i) => i.type === "RECIPE"), l = d.recipes.filter((i) => !r.includes(i._id)).map((i) => ({
51
- label: i.name,
52
- value: i
53
- })), u = l.filter((i) => m.find((a) => a.id === i.value._id)).map((i) => i.value);
54
- f.open({
55
- title: "Select Recipes",
56
- contentComponent: y,
57
- contentComponentProps: {
58
- items: l,
59
- modelValue: u
60
- },
61
- primaryActions: {
62
- text: "Confirm",
63
- close: !0
64
- },
65
- secondaryActions: {
66
- text: "Close",
67
- close: !0,
68
- variant: "tertiary"
69
- }
70
- }).onPrimary((i) => {
71
- const a = [
72
- ...e.filter((t) => i.find((n) => n._id === t.id)),
73
- ...i.filter((t) => !e.find((n) => n.id === t._id)).map((t) => ({
74
- type: "RECIPE",
75
- id: t._id,
76
- amount: {
77
- amount: 1,
78
- precision: 0
79
- }
80
- })),
81
- ...p
82
- ];
83
- c(a);
84
- });
85
- }
86
- return {
87
- promptIngredientsBinding: b,
88
- promptRecipesBinding: _
89
- };
90
- }
91
- export {
92
- E as u
93
- };