@feedmepos/mf-inventory-portal 1.2.30-dev.1 → 1.2.30

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 (84) hide show
  1. package/dist/{App-kX4bqoEe.js → App-CZJre5y8.js} +57 -55
  2. package/dist/{ApprovalView-DCNKqVE2.js → ApprovalView-CnxHxojY.js} +34 -28
  3. package/dist/{BindingsDialog-d7f1f8gf.js → BindingsDialog-C6lCOPNs.js} +2 -2
  4. package/dist/{BindingsPicker-2HJOx0QW.js → BindingsPicker-DZtFKLQ5.js} +6 -5
  5. package/dist/{BindingsTable-CPAjxOZG.js → BindingsTable-BmQGLuJ4.js} +28 -24
  6. package/dist/{ClosingDraftView-CUng41eo.js → ClosingDraftView-KLtlh31f.js} +183 -175
  7. package/dist/{ClosingHistoryView-CcGc2NwU.js → ClosingHistoryView-Rf1yMhMj.js} +43 -41
  8. package/dist/ClosingTemplateView-C_IiKnGx.js +2019 -0
  9. package/dist/{DeliveryOrderPrintPreview-BsM-CCc5.js → DeliveryOrderPrintPreview-UF7V005U.js} +15 -14
  10. package/dist/FmDroppableField-J0xUsOTV.js +154 -0
  11. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-cuggJ5Xd.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BcMvEdc0.js} +74 -72
  12. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CqAeF0wL.js +279 -0
  13. package/dist/{FmMultiselectDialog-BGbrqXUF.js → FmMultiselectDialog-B0aKuf2o.js} +1 -1
  14. package/dist/FmMultiselectDialog-BasrjBFA.js +597 -0
  15. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-isogcN1O.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CaYJJkXz.js} +51 -49
  16. package/dist/{ImportView-wAVrMEwL.js → ImportView-DRSoz0uM.js} +81 -74
  17. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DVUF4I2Q.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DA8SlWPy.js} +5 -5
  18. package/dist/{IngredientGroupView-BZczeXdL.js → IngredientGroupView-D5Laak2-.js} +73 -65
  19. package/dist/{IngredientsView-D5N5Y1ZY.js → IngredientsView-TG3fPQhR.js} +358 -345
  20. package/dist/{IntegrationView-Hrslmuc1.js → IntegrationView-CElpjyo7.js} +219 -209
  21. package/dist/{InventoryBindingForm-DH6wgxOG.js → InventoryBindingForm-CBgxRYBd.js} +1 -1
  22. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Drr5vD6f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-Ys5GBHoQ.js} +41 -40
  23. package/dist/{InventoryBindingSummary-BU1ehpQZ.js → InventoryBindingSummary-OK3vNWhi.js} +1 -1
  24. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-1ueC4GfZ.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9QRntUlk.js} +5 -5
  25. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-FHcU1zZt.js → PremiumBadge.vue_vue_type_script_setup_true_lang-Bc01NoOn.js} +22 -21
  26. package/dist/{PublishView-CQtj0f31.js → PublishView-CLMfiLjP.js} +26 -23
  27. package/dist/{PurchaseOrderPrintPreview-BQyXtHST.js → PurchaseOrderPrintPreview-Dy77yWDC.js} +10 -9
  28. package/dist/{ReceiveRequestView-Dm-h_SrY.js → ReceiveRequestView-BhD-NaHE.js} +478 -462
  29. package/dist/{RecipeView-DNNRvr1w.js → RecipeView-RWaO94w_.js} +73 -64
  30. package/dist/SingleColumnLayout.vue_vue_type_script_setup_true_lang-DY7TaxPK.js +251 -0
  31. package/dist/{StockView-CaOm5BCx.js → StockView-D5t8OxaG.js} +292 -282
  32. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Z91XRszD.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-3Asf1TGd.js} +1 -1
  33. package/dist/{SupplierView-JSII9qwL.js → SupplierView-DiospFKq.js} +92 -80
  34. package/dist/SystemTrailDialog.vue_vue_type_script_setup_true_lang-DfCHteOF.js +177 -0
  35. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js +135 -0
  36. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CNtvx-LA.js +123 -0
  37. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Mehd4lGs.js → TransferDetails.vue_vue_type_script_setup_true_lang-p959Op4k.js} +318 -305
  38. package/dist/{TransferTemplateView-DyCpNKJd.js → TransferTemplateView-ePZFdZ0p.js} +228 -216
  39. package/dist/{UnitView-CqN7mlJ2.js → UnitView-Banlxw7y.js} +70 -63
  40. package/dist/{WarehouseView-gFWD-m8e.js → WarehouseView-BL-p5hbi.js} +123 -114
  41. package/dist/WastageTemplateView-B1pmSuW0.js +2288 -0
  42. package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
  43. package/dist/app-EpEEb8EO.js +64040 -0
  44. package/dist/app-rgirz_52.js +8024 -0
  45. package/dist/app.d.ts +0 -21
  46. package/dist/app.js +6 -6
  47. package/dist/closing-template-zIjwO1_E.js +117 -0
  48. package/dist/date2-Dnc8Y81g.js +116 -0
  49. package/dist/dayjs.min-TdUgzmww.js +282 -0
  50. package/dist/{decimal-DfF_g5rc.js → decimal-C6s3GvGb.js} +4 -3
  51. package/dist/defineDeepModel-BSaaXVBF.js +19 -0
  52. package/dist/duplicate-template-Bw0H416G.js +34 -0
  53. package/dist/feature-C95Hao53.js +20162 -0
  54. package/dist/form-mode.enum-BKiNVH6A.js +4 -0
  55. package/dist/format-time-from-id-DlbHo6kY.js +15 -0
  56. package/dist/{format-unit-display-ivAljvlo.js → format-unit-display-QBS54q0R.js} +308 -297
  57. package/dist/{import-export.helper-B2MWv9v7.js → import-export.helper-CUKCKtP7.js} +56 -52
  58. package/dist/index-CFn_9RMm.js +45 -0
  59. package/dist/{index-DZaT0ZaL.js → index-S9Ak__QC.js} +1 -1
  60. package/dist/{index-BbhuWHyh.js → index-goD-WGVb.js} +16 -14
  61. package/dist/lodash-gq8IrP4j.js +3678 -0
  62. package/dist/netsuite-CnhAKyAO.js +4316 -0
  63. package/dist/{purchase-order-template-DdybMC_P.js → purchase-order-template-CBIpWdEW.js} +1 -1
  64. package/dist/router/shared.spec.d.ts +1 -0
  65. package/dist/row-action.enum-BcW_L_nE.js +67 -0
  66. package/dist/rules-DKklsaS1.js +201 -0
  67. package/dist/{stock-BYagIdsj.js → stock-3K93Mif9.js} +1 -1
  68. package/dist/{stock-V4ciPiBe.js → stock-BW8fen3H.js} +11 -10
  69. package/dist/style.css +1 -1
  70. package/dist/{supplier-CgtB1I9I.js → supplier-CObCSfot.js} +27 -26
  71. package/dist/tsconfig.app.tsbuildinfo +1 -1
  72. package/dist/{use-ingredient-select-dialog-BIQovyZX.js → use-ingredient-select-dialog-DwvQiaVW.js} +4 -3
  73. package/dist/{use-inventory-binding-dialog-DyjicXgc.js → use-inventory-binding-dialog-CuLEHLDM.js} +4 -3
  74. package/dist/use-template-enabled-locations-2-DkUJeppb.js +111 -0
  75. package/dist/views/adjustment-template/wastage-template/table.d.ts +1 -1
  76. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +0 -1
  77. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -13
  78. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +0 -12
  79. package/dist/vue-i18n-CUznvVzc.js +2365 -0
  80. package/dist/xlsx-bT1p3YVR.js +24004 -0
  81. package/dist/xlsx.util-Cr9DpDFb.js +78 -0
  82. package/package.json +5 -5
  83. package/dist/ClosingTemplateView-D8IAdhDb.js +0 -2041
  84. package/dist/app-CnQ49Lyb.js +0 -131483
@@ -1,10 +1,11 @@
1
- import { defineComponent as x, computed as f, ref as h, onMounted as g, openBlock as u, createElementBlock as i, createElementVNode as t, createTextVNode as n, toDisplayString as e, createCommentVNode as d, Fragment as o, renderList as p, normalizeClass as _ } from "vue";
1
+ import { defineComponent as x, computed as f, ref as h, onMounted as _, openBlock as u, createElementBlock as i, createElementVNode as t, createTextVNode as n, toDisplayString as e, createCommentVNode as d, Fragment as o, renderList as p, normalizeClass as g } from "vue";
2
2
  import { useRoute as k } from "vue-router";
3
- import { aL as y, aw as w } from "./app-CnQ49Lyb.js";
3
+ import { J as y } from "./app-EpEEb8EO.js";
4
+ import { _ as w } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
5
  const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub-header" }, O = ["src"], P = { style: { "padding-left": "10px" } }, C = { class: "address" }, D = { class: "text-right" }, R = {
5
6
  key: 0,
6
7
  class: "subtitle"
7
- }, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" }, L = { class: "purchase-body" }, U = { class: "text-left" }, B = { class: "text-left" }, H = { class: "text-left" }, M = { class: "text-left" }, V = { class: "text-left" }, J = { class: "text-right" }, j = { key: 0 }, z = {
8
+ }, S = { class: "sub-header" }, E = { class: "caption" }, T = { class: "address" }, q = { class: "text-right" }, F = { class: "sub-header" }, I = { class: "address" }, U = { class: "purchase-body" }, B = { class: "text-left" }, H = { class: "text-left" }, J = { class: "text-left" }, L = { class: "text-left" }, M = { class: "text-left" }, V = { class: "text-right" }, j = { key: 0 }, z = {
8
9
  key: 1,
9
10
  style: { "padding-top": "30px" }
10
11
  }, G = { valign: "bottom" }, Q = { class: "header" }, K = { class: "caption" }, W = {
@@ -30,7 +31,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
30
31
  }
31
32
  });
32
33
  const b = k(), s = h(JSON.parse(b.query.data));
33
- return g(() => {
34
+ return _(() => {
34
35
  setTimeout(() => window.print(), 500);
35
36
  }), (lt, l) => (u(), i("div", c, [
36
37
  t("table", null, [
@@ -106,7 +107,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
106
107
  ])
107
108
  ])
108
109
  ]),
109
- t("div", L, [
110
+ t("div", U, [
110
111
  t("table", null, [
111
112
  l[19] || (l[19] = t("thead", { class: "item-header" }, [
112
113
  t("tr", null, [
@@ -126,9 +127,9 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
126
127
  ], -1)),
127
128
  t("tbody", null, [
128
129
  t("tr", null, [
129
- t("td", U, e(s.value.orderNumber), 1),
130
- t("td", B, e(s.value.ref), 1),
131
- t("td", H, e(s.value.supplier.phoneNumber), 1)
130
+ t("td", B, e(s.value.orderNumber), 1),
131
+ t("td", H, e(s.value.ref), 1),
132
+ t("td", J, e(s.value.supplier.phoneNumber), 1)
132
133
  ])
133
134
  ])
134
135
  ]),
@@ -152,16 +153,16 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
152
153
  ], -1)),
153
154
  t("tbody", null, [
154
155
  (u(!0), i(o, null, p(s.value.items, (r, a) => (u(), i("tr", { key: a }, [
155
- t("td", M, e(a + 1), 1),
156
- t("td", V, e(r.description), 1),
156
+ t("td", L, e(a + 1), 1),
157
+ t("td", M, e(r.description), 1),
157
158
  t("td", {
158
- class: _(["text-right", {
159
+ class: g(["text-right", {
159
160
  "text-green-5": r.received == r.quantity,
160
161
  "text-danger": !r.received,
161
162
  "text-warning": r.received != r.quantity
162
163
  }])
163
164
  }, e(r.received + "/" + r.quantity), 3),
164
- t("td", J, e(r.unit), 1)
165
+ t("td", V, e(r.unit), 1)
165
166
  ]))), 128))
166
167
  ])
167
168
  ])
@@ -200,7 +201,7 @@ const c = { class: "purchase-box" }, A = { valign: "bottom" }, N = { class: "sub
200
201
  ])) : d("", !0)
201
202
  ]));
202
203
  }
203
- }), nt = /* @__PURE__ */ w($, [["__scopeId", "data-v-805a706a"]]);
204
+ }), ut = /* @__PURE__ */ w($, [["__scopeId", "data-v-805a706a"]]);
204
205
  export {
205
- nt as default
206
+ ut as default
206
207
  };
@@ -0,0 +1,154 @@
1
+ import { defineComponent as U, ref as d, computed as y, resolveComponent as k, openBlock as s, createElementBlock as c, createElementVNode as p, createCommentVNode as S, renderSlot as u, createBlock as C, normalizeClass as f, toDisplayString as F, unref as B } from "vue";
2
+ import { useI18n as W } from "@feedmepos/mf-common";
3
+ import { _ as q } from "./_plugin-vue_export-helper-CHgC5LLL.js";
4
+ const G = {
5
+ key: 0,
6
+ class: "relative"
7
+ }, H = ["accept", "disabled"], J = { class: "flex flex-col gap-8" }, K = ["accept", "disabled"], M = /* @__PURE__ */ U({
8
+ __name: "FmDroppableField",
9
+ props: {
10
+ buttonLabel: {},
11
+ label: { default: "" },
12
+ disabled: { type: Boolean, default: !1 },
13
+ accept: { default: "" },
14
+ maxFileSize: { default: 8e6 },
15
+ contentClass: {}
16
+ },
17
+ emits: ["file-upload", "file-rejected"],
18
+ setup(T, { emit: V }) {
19
+ const l = T, g = V, { t: r } = W(), t = d(!1), i = d(null), n = d(null), m = d(), R = (e) => {
20
+ l.disabled || (e.stopPropagation(), e.preventDefault());
21
+ }, $ = (e) => {
22
+ l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !0);
23
+ }, j = (e) => {
24
+ l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !1);
25
+ }, E = (e) => {
26
+ var a;
27
+ l.disabled || (e.stopPropagation(), e.preventDefault(), t.value = !1, h((a = e.dataTransfer) == null ? void 0 : a.files));
28
+ };
29
+ function h(e) {
30
+ if (e)
31
+ if (m.value = e, i.value = I(e[0]), n.value = P(e[0]), i.value && n.value)
32
+ g("file-upload", e[0]);
33
+ else {
34
+ const a = L();
35
+ g("file-rejected", [
36
+ {
37
+ file: e[0],
38
+ reason: a
39
+ }
40
+ ]);
41
+ }
42
+ }
43
+ const L = () => {
44
+ const e = new Array();
45
+ return i.value || e.push("invalid-type"), n.value || e.push("invalid-size"), e;
46
+ }, I = (e) => {
47
+ if (!l.accept) return !0;
48
+ const a = l.accept.split(",").map((o) => o.trim());
49
+ for (const o of a)
50
+ if (w(o)) {
51
+ if (D(o) === D(e.type)) return !0;
52
+ } else if (A(e) === o || e.type === o) return !0;
53
+ return !1;
54
+ }, P = (e) => e.size <= l.maxFileSize * 1024 * 1024, w = (e) => e.indexOf("*") !== -1, A = (e) => "." + e.name.split(".").pop(), D = (e) => e.substring(0, e.indexOf("/")), O = y(() => {
55
+ if (t.value) return r("inventory.formField.dropField.dropToUpload");
56
+ if (i.value) {
57
+ if (!n.value)
58
+ return r("inventory.formField.dropField.fileSizeExceeded", { size: l.maxFileSize });
59
+ } else return r("inventory.formField.dropField.invalidFileType");
60
+ return "";
61
+ }), v = y(() => m.value ? !i.value || !n.value : !1), _ = (e) => {
62
+ const a = e.target;
63
+ h(a.files);
64
+ }, N = y(() => {
65
+ var e;
66
+ return (e = m.value) == null ? void 0 : e.item(0);
67
+ }), b = d();
68
+ return (e, a) => {
69
+ const o = k("FmLabel"), x = k("FmButton");
70
+ return s(), c("label", {
71
+ class: "fm-droppable-field",
72
+ ref_key: "fmButtonRef",
73
+ ref: b
74
+ }, [
75
+ e.$slots.default ? (s(), c("div", G, [
76
+ p("input", {
77
+ accept: e.accept,
78
+ disabled: e.disabled,
79
+ class: "fm-droppable-field__input",
80
+ type: "file",
81
+ onChange: _
82
+ }, null, 40, H)
83
+ ])) : S("", !0),
84
+ u(e.$slots, "default", {
85
+ isDragging: t.value,
86
+ isValidFileType: i.value,
87
+ isValidFileSize: n.value,
88
+ singleValidFile: N.value,
89
+ openFileDialog: () => {
90
+ var z;
91
+ return console.log("click", b.value), (z = b.value) == null ? void 0 : z.click();
92
+ }
93
+ }, () => [
94
+ p("div", J, [
95
+ e.$slots.label ? u(e.$slots, "label", { key: 0 }, void 0, !0) : (s(), C(o, {
96
+ key: 1,
97
+ label: e.label
98
+ }, null, 8, ["label"]))
99
+ ]),
100
+ p("div", {
101
+ class: f([[
102
+ e.contentClass ? e.contentClass : "w-full h-full",
103
+ {
104
+ "fm-droppable-field__container--dragging": t.value,
105
+ "fm-droppable-field__container--invalid": v.value && !e.disabled,
106
+ "fm-droppable-field__container--disabled": e.disabled
107
+ }
108
+ ], "fm-droppable-field__container"]),
109
+ onDragenter: R,
110
+ onDragleave: j,
111
+ onDragover: $,
112
+ onDrop: E
113
+ }, [
114
+ (t.value || v.value) && !e.disabled ? (s(), c("div", {
115
+ key: 0,
116
+ class: f({
117
+ "fm-typo-en-body-lg-600": !0,
118
+ "text-fm-color-primary": t.value,
119
+ "text-fm-color-typo-error": v.value
120
+ })
121
+ }, F(O.value), 3)) : (s(), C(x, {
122
+ key: 1,
123
+ disabled: e.disabled,
124
+ label: e.buttonLabel ?? "Add files",
125
+ size: "md",
126
+ variant: "secondary"
127
+ }, null, 8, ["disabled", "label"])),
128
+ u(e.$slots, "accept-text", {}, () => [
129
+ l.accept ? (s(), c("div", {
130
+ key: 0,
131
+ class: f([[e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"], "fm-typo-en-body-md-400"])
132
+ }, F(B(r)("inventory.formField.dropField.accepts", { fileTypes: e.accept })), 3)) : S("", !0)
133
+ ], !0),
134
+ p("input", {
135
+ accept: e.accept,
136
+ disabled: e.disabled,
137
+ class: "fm-droppable-field__input",
138
+ type: "file",
139
+ onChange: _
140
+ }, null, 40, K)
141
+ ], 34),
142
+ u(e.$slots, "helper-text", {}, () => [
143
+ p("div", {
144
+ class: f([[e.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"], "fm-typo-en-body-sm-400"])
145
+ }, F(B(r)("inventory.formField.dropField.maxSize", { size: e.maxFileSize })), 3)
146
+ ], !0)
147
+ ], !0)
148
+ ], 512);
149
+ };
150
+ }
151
+ }), Z = /* @__PURE__ */ q(M, [["__scopeId", "data-v-2937afd0"]]);
152
+ export {
153
+ Z as F
154
+ };
@@ -1,54 +1,56 @@
1
- import { n as C, t as B, aB as M, u as E, aN as R, aX as D, p as H, aY as U } from "./app-CnQ49Lyb.js";
2
- import { u as z } from "./supplier-CgtB1I9I.js";
3
- import { P as T } from "./format-unit-display-ivAljvlo.js";
4
- import { computed as f, defineComponent as j, mergeModels as q, useModel as x, ref as W, resolveComponent as w, openBlock as L, createElementBlock as O, normalizeStyle as $, createElementVNode as N, createVNode as X, withCtx as Y, createBlock as V, createCommentVNode as I, Fragment as J, renderList as K, unref as g } from "vue";
5
- function Q(e, a, r) {
1
+ import { G as g, u as E, K as R, M as B, x as U } from "./app-EpEEb8EO.js";
2
+ import { a as C, t as D } from "./rules-DKklsaS1.js";
3
+ import { u as H } from "./supplier-CObCSfot.js";
4
+ import { P as T } from "./format-unit-display-QBS54q0R.js";
5
+ import { computed as f, defineComponent as z, mergeModels as x, useModel as j, ref as q, resolveComponent as w, openBlock as L, createElementBlock as O, normalizeStyle as W, createElementVNode as I, createVNode as $, withCtx as K, createBlock as M, createCommentVNode as N, Fragment as J, renderList as Q, unref as V } from "vue";
6
+ import { F as X } from "./FmMultiselectDialog-BasrjBFA.js";
7
+ function Y(e, r, a) {
6
8
  var o;
7
- if (!!a.measurement === !!r && ((o = a.measurement) == null ? void 0 : o.id) === r)
8
- return a;
9
- if (!r)
9
+ if (!!r.measurement === !!a && ((o = r.measurement) == null ? void 0 : o.id) === a)
10
+ return r;
11
+ if (!a)
10
12
  return {
11
- costPerUnit: a.costPerUnit
13
+ costPerUnit: r.costPerUnit
12
14
  };
13
- const n = e.measurements.find((p) => p.id === r);
15
+ const n = e.measurements.find((p) => p.id === a);
14
16
  return n ? {
15
- costPerUnit: a.costPerUnit,
17
+ costPerUnit: r.costPerUnit,
16
18
  measurement: n
17
19
  } : {
18
- costPerUnit: a.costPerUnit
20
+ costPerUnit: r.costPerUnit
19
21
  };
20
22
  }
21
- function oe(e, a, r, u) {
23
+ function re(e, r, a, u) {
22
24
  var P, _, s;
23
- const l = (s = (_ = (P = u == null ? void 0 : u.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : _.find(
25
+ const i = (s = (_ = (P = u == null ? void 0 : u.supplier) == null ? void 0 : P.supplyItems) == null ? void 0 : _.find(
24
26
  (t) => t.skuId === e._id
25
27
  )) == null ? void 0 : s.defaultCost;
26
28
  if (u != null && u.manualTotalCost)
27
29
  return {
28
30
  cost: u.manualTotalCost,
29
31
  skuDefaultCost: e.defaultCost ?? void 0,
30
- supplierOverrideCost: l ?? void 0
32
+ supplierOverrideCost: i ?? void 0
31
33
  };
32
- const n = e.defaultCost ? Q(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, o = l ?? n, p = o == null ? void 0 : o.costPerUnit, v = p ? o != null && o.measurement ? +C(p) / +C(o == null ? void 0 : o.measurement.conversion) : +C(p) : void 0, b = v ? r ? v * +C(r.conversion) : v : void 0, h = b ? +C(a) * b : void 0;
34
+ const n = e.defaultCost ? Y(e.unit, e.defaultCost, e.trackingMeasurement) : void 0, o = i ?? n, p = o == null ? void 0 : o.costPerUnit, v = p ? o != null && o.measurement ? +C(p) / +C(o == null ? void 0 : o.measurement.conversion) : +C(p) : void 0, b = v ? a ? v * +C(a.conversion) : v : void 0, h = b ? +C(r) * b : void 0;
33
35
  return {
34
36
  cost: h ? {
35
- ...B(h ?? 0, 2),
36
- currency: M()
37
+ ...D(h ?? 0, 2),
38
+ currency: g()
37
39
  } : {
38
40
  amount: 0,
39
41
  precision: 0,
40
- currency: M()
42
+ currency: g()
41
43
  },
42
44
  skuDefaultCost: e.defaultCost ?? void 0,
43
- supplierOverrideCost: l ?? void 0
45
+ supplierOverrideCost: i ?? void 0
44
46
  };
45
47
  }
46
48
  function k(e) {
47
- const a = D.safeParse(e);
48
- if (a.success) return a.data;
49
+ const r = B.safeParse(e);
50
+ if (r.success) return r.data;
49
51
  throw new Error("Invalid supplier data");
50
52
  }
51
- function F(e) {
53
+ function S(e) {
52
54
  return {
53
55
  _id: e.doc._id,
54
56
  internal: e.type,
@@ -67,17 +69,17 @@ function F(e) {
67
69
  preparationTime: e.preparationTime
68
70
  };
69
71
  }
70
- function ne(e, a, r = !1, u = !1) {
71
- const l = z(), n = E();
72
+ function ae(e, r, a = !1, u = !1) {
73
+ const i = H(), n = E();
72
74
  n.watchLocation(async () => {
73
75
  var y;
74
- await l.readSuppliers();
76
+ await i.readSuppliers();
75
77
  const s = e();
76
78
  if ((y = s.supplier) != null && y._id) return;
77
- const t = u ? l.suppliers[0] : l.businessSuppliers[0], i = (r ? n.locations.filter((d) => d.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
78
- a({
79
+ const t = u ? i.suppliers[0] : i.businessSuppliers[0], l = (a ? n.locations.filter((d) => d.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
80
+ r({
79
81
  ...s,
80
- supplier: t ? k(t) : i ? F(i) : s.supplier
82
+ supplier: t ? k(t) : l ? S(l) : s.supplier
81
83
  });
82
84
  });
83
85
  const o = f(
@@ -93,39 +95,39 @@ function ne(e, a, r = !1, u = !1) {
93
95
  set(s) {
94
96
  const t = e() ?? {};
95
97
  if (o.value === T.PURCHASE) {
96
- const S = (u ? l.suppliers : l.businessSuppliers).find((A) => A._id === s);
97
- a({
98
+ const F = (u ? i.suppliers : i.businessSuppliers).find((A) => A._id === s);
99
+ r({
98
100
  ...t,
99
- supplier: S ? k(S) : t.supplier
101
+ supplier: F ? k(F) : t.supplier
100
102
  });
101
103
  return;
102
104
  }
103
- const y = (r ? n.allLocations.filter(
105
+ const y = (a ? n.allLocations.filter(
104
106
  (d) => d.doc._id !== n.currentLocation.doc._id
105
107
  ) : n.allLocations).find((d) => d.doc._id === s);
106
- a({
108
+ r({
107
109
  ...t,
108
- supplier: y ? F(y) : t.supplier
110
+ supplier: y ? S(y) : t.supplier
109
111
  });
110
112
  }
111
- }), v = f(() => l.locationSuppliers.map(k)), b = f(() => l.businessSuppliers.map(k)), h = f(() => {
113
+ }), v = f(() => i.locationSuppliers.map(k)), b = f(() => i.businessSuppliers.map(k)), h = f(() => {
112
114
  const s = [...v.value], t = [...b.value];
113
115
  return u ? [...t, ...s] : t;
114
116
  }), c = f(() => {
115
117
  var m;
116
118
  const s = ((m = n._currentLocation) == null ? void 0 : m.type) === R.warehouse;
117
- return (r ? n.allLocations.filter(
118
- (i) => i.doc._id !== n.currentLocation.doc._id
119
- ) : n.allLocations).filter((i) => s || i.acceptRequest).map(F);
119
+ return (a ? n.allLocations.filter(
120
+ (l) => l.doc._id !== n.currentLocation.doc._id
121
+ ) : n.allLocations).filter((l) => s || l.acceptRequest).map(S);
120
122
  }), P = f(() => {
121
123
  if (o.value === T.PURCHASE) {
122
- const t = v.value.map((i) => ({
123
- label: i.name,
124
- value: i._id
125
- })), m = b.value.map((i) => ({
126
- label: i.name,
124
+ const t = v.value.map((l) => ({
125
+ label: l.name,
126
+ value: l._id
127
+ })), m = b.value.map((l) => ({
128
+ label: l.name,
127
129
  sublabel: "Business supplier",
128
- value: i._id
130
+ value: l._id
129
131
  }));
130
132
  return u ? [...t, ...m] : m;
131
133
  }
@@ -135,14 +137,14 @@ function ne(e, a, r = !1, u = !1) {
135
137
  value: t._id
136
138
  }));
137
139
  }), _ = f(() => {
138
- var i, y;
139
- const s = (y = (i = e()) == null ? void 0 : i.supplier) == null ? void 0 : y._id;
140
+ var l, y;
141
+ const s = (y = (l = e()) == null ? void 0 : l.supplier) == null ? void 0 : y._id;
140
142
  if (o.value === T.PURCHASE) {
141
- const d = l.suppliers.find((S) => S._id === s);
143
+ const d = i.suppliers.find((F) => F._id === s);
142
144
  return d ? k(d) : null;
143
145
  }
144
146
  const m = n.allLocations.find((d) => d.doc._id);
145
- return m ? F(m) : null;
147
+ return m ? S(m) : null;
146
148
  });
147
149
  return {
148
150
  transferLocationModel: p,
@@ -153,9 +155,9 @@ function ne(e, a, r = !1, u = !1) {
153
155
  selectedLocation: _
154
156
  };
155
157
  }
156
- const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
158
+ const Z = { class: "overflow-y-auto h-full pb-8" }, ie = /* @__PURE__ */ z({
157
159
  __name: "FmFilterableMenuOptions",
158
- props: /* @__PURE__ */ q({
160
+ props: /* @__PURE__ */ x({
159
161
  modelValue: {},
160
162
  maxHeight: {},
161
163
  width: {},
@@ -168,52 +170,52 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
168
170
  }),
169
171
  emits: ["update:search"],
170
172
  setup(e) {
171
- const a = e, r = x(e, "search"), u = f(
172
- () => new H(a.items, ["label", "sublabel"], {
173
+ const r = e, a = j(e, "search"), u = f(
174
+ () => new X(r.items, ["label", "sublabel"], {
173
175
  caseSensitive: !1,
174
176
  sort: !0
175
177
  })
176
- ), l = f(() => u.value.search(r.value)), n = W();
178
+ ), i = f(() => u.value.search(a.value)), n = q();
177
179
  return console.log({ stickyRef: n }), (o, p) => {
178
180
  const v = w("FmButton"), b = w("FmTextField"), h = w("FmMenuItem");
179
181
  return L(), O("div", {
180
182
  class: "relative",
181
- style: $({ width: o.width })
183
+ style: W({ width: o.width })
182
184
  }, [
183
- N("div", {
185
+ I("div", {
184
186
  class: "sticky top-0 bg-white mb-8",
185
187
  ref_key: "stickyRef",
186
188
  ref: n
187
189
  }, [
188
- X(b, {
189
- modelValue: r.value,
190
- "onUpdate:modelValue": p[1] || (p[1] = (c) => r.value = c),
190
+ $(b, {
191
+ modelValue: a.value,
192
+ "onUpdate:modelValue": p[1] || (p[1] = (c) => a.value = c),
191
193
  placeholder: "Filter options"
192
194
  }, {
193
- append: Y(() => [
194
- r.value ? (L(), V(v, {
195
+ append: K(() => [
196
+ a.value ? (L(), M(v, {
195
197
  key: 0,
196
198
  variant: "tertiary",
197
199
  "prepend-icon": "close",
198
- onClick: p[0] || (p[0] = (c) => r.value = "")
199
- })) : I("", !0)
200
+ onClick: p[0] || (p[0] = (c) => a.value = "")
201
+ })) : N("", !0)
200
202
  ]),
201
203
  _: 1
202
204
  }, 8, ["modelValue"])
203
205
  ], 512),
204
- N("div", Z, [
205
- (L(!0), O(J, null, K(l.value, (c, P) => (L(), V(h, {
206
+ I("div", Z, [
207
+ (L(!0), O(J, null, Q(i.value, (c, P) => (L(), M(h, {
206
208
  key: P,
207
209
  label: c.label,
208
210
  sublabel: c.sublabel,
209
- "model-value": g(U)(o.modelValue, c.value),
210
- onClick: () => o.handleItemChange(g(U)(o.modelValue, c.value), c),
211
+ "model-value": V(U)(o.modelValue, c.value),
212
+ onClick: () => o.handleItemChange(V(U)(o.modelValue, c.value), c),
211
213
  onVnodeMounted: (_) => {
212
214
  var s, t;
213
- return g(U)(o.modelValue, c.value) && ((s = _.el) == null || s.scrollIntoView({ behavior: "instant", block: "end" }), (t = _.el) == null || t.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
215
+ return V(U)(o.modelValue, c.value) && ((s = _.el) == null || s.scrollIntoView({ behavior: "instant", block: "end" }), (t = _.el) == null || t.scrollIntoView({ behavior: "smooth", block: "center" })), void 0;
214
216
  }
215
217
  }, null, 8, ["label", "sublabel", "model-value", "onClick", "onVnodeMounted"]))), 128)),
216
- l.value.length ? I("", !0) : (L(), V(h, {
218
+ i.value.length ? N("", !0) : (L(), M(h, {
217
219
  key: 0,
218
220
  disabled: "",
219
221
  label: "No options available"
@@ -224,7 +226,7 @@ const Z = { class: "overflow-y-auto h-full pb-8" }, ae = /* @__PURE__ */ j({
224
226
  }
225
227
  });
226
228
  export {
227
- ae as _,
228
- oe as c,
229
- ne as u
229
+ ie as _,
230
+ re as c,
231
+ ae as u
230
232
  };