@feedmepos/mf-inventory-portal 0.0.22-dev.1 → 0.0.22-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 (38) hide show
  1. package/dist/{ApprovalView-CtH8I01g.js → ApprovalView-D7WEr35k.js} +4 -4
  2. package/dist/{BindingsDialog-DFrk_fyd.js → BindingsDialog-C-3uO6pD.js} +1 -1
  3. package/dist/{BindingsPicker-400gISaV.js → BindingsPicker-B3tGisCE.js} +1 -1
  4. package/dist/{BindingsTable-CnFKI6iP.js → BindingsTable-CPtiH3vj.js} +1 -1
  5. package/dist/ClosingTemplateView-Df0lgpjS.js +928 -0
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-ohHZLOuR.js} +1 -1
  7. package/dist/{IngredientsView-CRTAgKJz.js → IngredientsView-D-EKGLq9.js} +3 -3
  8. package/dist/{IntegrationView-CNFTKqjk.js → IntegrationView-BVAO_vch.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VkiVLx1K.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CJYmB7Ct.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BxkM-SOw.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-CJli-_Vn.js → PurchaseOrderPrintPreview-CP-mK62z.js} +1 -1
  12. package/dist/{ReceiveRequestView-DV_GDzJG.js → ReceiveRequestView-x8WTvuDk.js} +6 -6
  13. package/dist/{RecipeView-CTm_7oNG.js → RecipeView-BysIWI1W.js} +3 -3
  14. package/dist/{StockView-DtHT2ulM.js → StockView-SyWxT4Ee.js} +6 -6
  15. package/dist/{SupplierView-B9A5R2Vm.js → SupplierView-a0HAZJau.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-mUNCQTNw.js → TransferDetails.vue_vue_type_script_setup_true_lang-ckp8gcT_.js} +4 -4
  17. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js → TransferDialog.vue_vue_type_script_setup_true_lang-BSvpuWY9.js} +328 -347
  18. package/dist/{TransferTemplateView-DnyenkGu.js → TransferTemplateView-BGi6zd6d.js} +11 -10
  19. package/dist/{UnitView-BL-jtVuZ.js → UnitView-B3c7W5lw.js} +4 -4
  20. package/dist/WarehouseView-DDV-yslF.js +1017 -0
  21. package/dist/{app-C-z1MfF6.js → app-DURkcZal.js} +11970 -11832
  22. package/dist/app.js +1 -1
  23. package/dist/components/FmMultiselectDialogProps.d.ts +1 -0
  24. package/dist/components/VirtualScroll.vue.d.ts +47 -0
  25. package/dist/{decimal-DZz-_lgE.js → decimal-BGJlFDm8.js} +1 -1
  26. package/dist/{defineDeepModel-7VQajdPt.js → defineDeepModel-pATZSiCT.js} +1 -1
  27. package/dist/{format-time-from-id-9XFszs1J.js → format-time-from-id-BCAuJEq2.js} +1 -1
  28. package/dist/{id-to-date-Bkue77uI.js → id-to-date-CVHmTOJk.js} +1 -1
  29. package/dist/{purchase-order-transaction-type-DHzMBgFs.js → purchase-order-transaction-type-DvSpCSXr.js} +3 -3
  30. package/dist/style.css +1 -1
  31. package/dist/{supplier-C6YWXF2Y.js → supplier-DmBbGAwf.js} +1 -1
  32. package/dist/tsconfig.app.tsbuildinfo +1 -1
  33. package/dist/{use-template-enabled-locations-CFCfbaOd.js → use-template-enabled-locations-BiuOdu1M.js} +1 -1
  34. package/dist/{xlsx-Dl6dAHFx.js → xlsx-1DLm6bBD.js} +1 -1
  35. package/dist/{xlsx.util-C1tUhDb8.js → xlsx.util-DLtch7r5.js} +2 -2
  36. package/package.json +1 -1
  37. package/dist/ClosingTemplateView--8m8cua_.js +0 -919
  38. package/dist/WarehouseView-BkUv1792.js +0 -1056
@@ -1,29 +1,29 @@
1
- import { reactive as We, onMounted as Ue, computed as T, h as E, defineComponent as se, openBlock as P, createElementBlock as A, Fragment as ve, renderList as Te, createElementVNode as d, toDisplayString as D, unref as e, resolveComponent as I, createVNode as k, withCtx as V, createCommentVNode as z, ref as L, createBlock as j, watch as Me, normalizeClass as Ie, normalizeStyle as Ye, isRef as ie } from "vue";
2
- import { useBreakpoints as Ze, components as re, FmButtonVariant as Qe, useSnackbar as $e, useDialog as Ke, useProxiedModel as Ge } from "@feedmepos/ui-library";
3
- import { F as fe } from "./row-action.enum-PMKMRrZR.js";
4
- import { P as $, d as Ee, c as Je } from "./purchase-order-transaction-type-DHzMBgFs.js";
5
- import { a as W, t as Xe, a8 as Fe, D as et, b as Le, R as Re, a2 as tt, a3 as st, r as ot, a4 as Oe, G as qe, l as nt, A as ke, M as at, a9 as Ne, O as Ae, P as He, aa as lt, j as De, ab as rt, u as Ve, ac as it, ad as ut, ae as dt, E as ct, af as pt, y as mt } from "./app-C-z1MfF6.js";
6
- import { _ as ze, u as ft } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js";
1
+ import { reactive as We, onMounted as Ue, computed as F, h as E, defineComponent as se, openBlock as P, createElementBlock as $, Fragment as fe, renderList as Pe, createElementVNode as d, toDisplayString as A, unref as e, resolveComponent as T, createVNode as k, withCtx as V, createCommentVNode as H, ref as L, createBlock as z, watch as Me, normalizeClass as Fe, normalizeStyle as Ye, isRef as ie } from "vue";
2
+ import { useBreakpoints as Ze, components as re, FmButtonVariant as Qe, useSnackbar as Ie, useDialog as Ke, useProxiedModel as Je } from "@feedmepos/ui-library";
3
+ import { F as pe } from "./row-action.enum-PMKMRrZR.js";
4
+ import { P as I, d as Ee, c as Xe } from "./purchase-order-transaction-type-DvSpCSXr.js";
5
+ import { a as j, t as Ge, a8 as Te, D as et, b as Le, R as Re, a2 as tt, a3 as st, r as ot, a4 as Oe, G as qe, l as nt, A as ke, M as at, a9 as Ne, O as $e, P as He, aa as lt, j as Ae, ab as rt, u as De, ac as it, ad as ut, ae as dt, E as ct, af as pt, y as mt } from "./app-DURkcZal.js";
6
+ import { _ as ze, u as ft } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BxkM-SOw.js";
7
7
  import { useI18n as de } from "@feedmepos/mf-common";
8
8
  import "vue-router";
9
- import { u as he } from "./supplier-C6YWXF2Y.js";
10
- import { d as yt } from "./defineDeepModel-7VQajdPt.js";
9
+ import { u as he } from "./supplier-DmBbGAwf.js";
10
+ import { d as yt } from "./defineDeepModel-pATZSiCT.js";
11
11
  import { F as ue, _ as vt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
12
  import { _ as bt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
- function te(o, f, r, n) {
14
- var u, c, C;
13
+ function te(o, m, r, n) {
14
+ var u, p, C;
15
15
  if (n != null && n.manualTotalCost)
16
16
  return n == null ? void 0 : n.manualTotalCost;
17
- const v = (C = (c = (u = n == null ? void 0 : n.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : c.find(
17
+ const v = (C = (p = (u = n == null ? void 0 : n.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : p.find(
18
18
  (b) => b.skuId === o._id
19
- )) == null ? void 0 : C.defaultCost, t = o.defaultCost, l = v ?? t, x = l == null ? void 0 : l.costPerUnit, p = x ? l != null && l.measurement ? +W(x) / +W(l == null ? void 0 : l.measurement.conversion) : +W(x) : void 0, s = p ? r ? p * +W(r.conversion) : p : void 0, a = s ? +W(f) * s : void 0;
19
+ )) == null ? void 0 : C.defaultCost, t = o.defaultCost, l = v ?? t, x = l == null ? void 0 : l.costPerUnit, c = x ? l != null && l.measurement ? +j(x) / +j(l == null ? void 0 : l.measurement.conversion) : +j(x) : void 0, s = c ? r ? c * +j(r.conversion) : c : void 0, a = s ? +j(m) * s : void 0;
20
20
  return a ? {
21
- ...Xe(a ?? 0, 2),
22
- currency: Fe()
21
+ ...Ge(a ?? 0, 2),
22
+ currency: Te()
23
23
  } : {
24
24
  amount: 0,
25
25
  precision: 0,
26
- currency: Fe()
26
+ currency: Te()
27
27
  };
28
28
  }
29
29
  var R = /* @__PURE__ */ ((o) => (o.Code = "Code", o.Name = "Name", o.Amount = "Amount", o.Cost = "Cost", o.Delete = "Delete", o))(R || {});
@@ -39,29 +39,29 @@ const _t = () => {
39
39
  );
40
40
  };
41
41
  function gt(o) {
42
- const { t: f } = de(), r = We({}), { breakpoints: n } = Ze(), v = Le();
42
+ const { t: m } = de(), r = We({}), { breakpoints: n } = Ze(), v = Le();
43
43
  Ue(() => {
44
- for (const p of o.items) {
45
- if (!p.totalCost)
44
+ for (const c of o.items) {
45
+ if (!c.totalCost)
46
46
  continue;
47
- const s = te(p.sku, p.quantity, p.measurement, {
47
+ const s = te(c.sku, c.quantity, c.measurement, {
48
48
  supplier: o.supplier
49
- }), a = p.totalCost ?? et.reset();
50
- s ? r[p.sku._id] = s.amount !== a.amount || s.precision !== a.precision : r[p.sku._id] = !0;
49
+ }), a = c.totalCost ?? et.reset();
50
+ s ? r[c.sku._id] = s.amount !== a.amount || s.precision !== a.precision : r[c.sku._id] = !0;
51
51
  }
52
52
  });
53
- function t(p) {
54
- var a, y, u, c, C, b, h;
55
- return !!(((y = (a = p.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : y.amount) ?? ((h = (b = (C = (c = (u = o.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : c.find((w) => w.skuId === p._id)) == null ? void 0 : C.defaultCost) == null ? void 0 : b.costPerUnit) == null ? void 0 : h.amount));
53
+ function t(c) {
54
+ var a, f, u, p, C, b, h;
55
+ return !!(((f = (a = c.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : f.amount) ?? ((h = (b = (C = (p = (u = o.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : p.find((w) => w.skuId === c._id)) == null ? void 0 : C.defaultCost) == null ? void 0 : b.costPerUnit) == null ? void 0 : h.amount));
56
56
  }
57
57
  const l = [
58
58
  {
59
59
  id: "Code",
60
- header: () => f("inventory.transfer.form.items.table.Code"),
60
+ header: () => m("inventory.transfer.form.items.table.Code"),
61
61
  accessorKey: "code",
62
62
  size: 96,
63
- cell(p) {
64
- const s = p.row.original;
63
+ cell(c) {
64
+ const s = c.row.original;
65
65
  return E(re.FmTextField, {
66
66
  modelValue: s.code,
67
67
  "onUpdate:modelValue": (a) => {
@@ -79,10 +79,10 @@ function gt(o) {
79
79
  },
80
80
  {
81
81
  id: "Name",
82
- header: () => f("inventory.transfer.form.items.table.Name"),
82
+ header: () => m("inventory.transfer.form.items.table.Name"),
83
83
  minSize: 300,
84
- cell(p) {
85
- const s = p.row.original;
84
+ cell(c) {
85
+ const s = c.row.original;
86
86
  return E(re.FmTextField, {
87
87
  modelValue: s.name,
88
88
  "onUpdate:modelValue": (a) => {
@@ -100,11 +100,11 @@ function gt(o) {
100
100
  },
101
101
  {
102
102
  id: "Amount",
103
- header: () => f("inventory.transfer.form.items.table.Amount"),
103
+ header: () => m("inventory.transfer.form.items.table.Amount"),
104
104
  minSize: 200,
105
- cell(p) {
106
- var y, u, c;
107
- const s = p.row.original, a = (c = (u = (y = o.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : u.items) == null ? void 0 : c.find(
105
+ cell(c) {
106
+ var f, u, p;
107
+ const s = c.row.original, a = (p = (u = (f = o.template) == null ? void 0 : f.purchaseOrder) == null ? void 0 : u.items) == null ? void 0 : p.find(
108
108
  (C) => C.sku._id === s.sku._id
109
109
  );
110
110
  return E(tt, {
@@ -136,7 +136,7 @@ function gt(o) {
136
136
  disabled: o.disabled,
137
137
  rules: [
138
138
  st(
139
- +W(
139
+ +j(
140
140
  (a == null ? void 0 : a.minimumQuantity) ?? {
141
141
  amount: 1,
142
142
  precision: ot(s.sku.unit, s.measurement)
@@ -144,7 +144,7 @@ function gt(o) {
144
144
  )
145
145
  ),
146
146
  a != null && a.maximumQuantity ? Oe(
147
- +W(a == null ? void 0 : a.maximumQuantity)
147
+ +j(a == null ? void 0 : a.maximumQuantity)
148
148
  ) : Oe(1 / 0)
149
149
  ],
150
150
  applyDefaultRules: !0
@@ -156,8 +156,8 @@ function gt(o) {
156
156
  id: "Cost",
157
157
  header: _t,
158
158
  size: 180,
159
- cell(p) {
160
- const s = p.row.original, a = t(s.sku), y = n.value.xs || n.value.sm;
159
+ cell(c) {
160
+ const s = c.row.original, a = t(s.sku), f = n.value.xs || n.value.sm;
161
161
  return !r[s.sku._id] && a ? E(
162
162
  "div",
163
163
  {
@@ -189,11 +189,11 @@ function gt(o) {
189
189
  [
190
190
  E(
191
191
  "span",
192
- y ? qe(
192
+ f ? qe(
193
193
  te(s.sku, s.quantity, s.measurement, {
194
194
  supplier: o.supplier
195
195
  })
196
- ) : W(
196
+ ) : j(
197
197
  te(s.sku, s.quantity, s.measurement, {
198
198
  supplier: o.supplier
199
199
  })
@@ -207,7 +207,7 @@ function gt(o) {
207
207
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
208
208
  ]
209
209
  },
210
- f("inventory.transfer.form.items.autoCalculated")
210
+ m("inventory.transfer.form.items.autoCalculated")
211
211
  )
212
212
  ]
213
213
  )
@@ -215,14 +215,14 @@ function gt(o) {
215
215
  ) : E(
216
216
  re.FmTextField,
217
217
  {
218
- modelValue: W(s.totalCost ?? { amount: 0, precision: 0 }),
218
+ modelValue: j(s.totalCost ?? { amount: 0, precision: 0 }),
219
219
  key: s.sku._id,
220
220
  "onUpdate:modelValue": (u) => {
221
221
  o.updateItem({
222
222
  ...s,
223
223
  totalCost: {
224
224
  ...nt(+u),
225
- currency: Fe()
225
+ currency: Te()
226
226
  }
227
227
  });
228
228
  },
@@ -230,7 +230,7 @@ function gt(o) {
230
230
  },
231
231
  {
232
232
  prepend() {
233
- return y ? E(
233
+ return f ? E(
234
234
  "div",
235
235
  {
236
236
  class: [
@@ -266,8 +266,8 @@ function gt(o) {
266
266
  {
267
267
  id: "Delete",
268
268
  header: "",
269
- cell(p) {
270
- const s = p.row.original;
269
+ cell(c) {
270
+ const s = c.row.original;
271
271
  return E(re.FmButton, {
272
272
  key: s.sku._id,
273
273
  class: "delete-button",
@@ -290,8 +290,8 @@ function gt(o) {
290
290
  }
291
291
  ];
292
292
  return {
293
- columnDefs: T(() => v.enableTotalCost && o.transferType === $.PURCHASE ? l : l.filter(
294
- (p) => p.id !== "Cost"
293
+ columnDefs: F(() => v.enableTotalCost && o.transferType === I.PURCHASE ? l : l.filter(
294
+ (c) => c.id !== "Cost"
295
295
  /* Cost */
296
296
  ))
297
297
  };
@@ -302,35 +302,35 @@ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
302
302
  prices: {}
303
303
  },
304
304
  setup(o) {
305
- const f = he();
305
+ const m = he();
306
306
  function r(n) {
307
- return f.suppliers.find((v) => v._id === n);
307
+ return m.suppliers.find((v) => v._id === n);
308
308
  }
309
- return (n, v) => (P(), A("div", Ct, [
310
- (P(!0), A(ve, null, Te(Object.keys(n.prices), (t) => {
309
+ return (n, v) => (P(), $("div", Ct, [
310
+ (P(!0), $(fe, null, Pe(Object.keys(n.prices), (t) => {
311
311
  var l;
312
- return P(), A("div", {
312
+ return P(), $("div", {
313
313
  key: t,
314
314
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
315
315
  }, [
316
- d("div", kt, D((l = r(t)) == null ? void 0 : l.name), 1),
316
+ d("div", kt, A((l = r(t)) == null ? void 0 : l.name), 1),
317
317
  d("div", ht, [
318
- (P(!0), A(ve, null, Te(n.prices[t].slice(0, 3), (x) => {
319
- var p;
320
- return P(), A("div", {
318
+ (P(!0), $(fe, null, Pe(n.prices[t].slice(0, 3), (x) => {
319
+ var c;
320
+ return P(), $("div", {
321
321
  key: x.date,
322
322
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
323
323
  }, [
324
324
  d("div", wt, [
325
- d("span", null, D(x.totalCost ? e(qe)(x.totalCost) : "No data"), 1),
325
+ d("span", null, A(x.totalCost ? e(qe)(x.totalCost) : "No data"), 1),
326
326
  v[0] || (v[0] = d("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
327
- d("span", null, D(e(W)(x.totalUnit, !1)), 1),
328
- d("span", null, D(((p = x.measurement) == null ? void 0 : p.abbrev) ?? x.unit.abbrev), 1)
327
+ d("span", null, A(e(j)(x.totalUnit, !1)), 1),
328
+ d("span", null, A(((c = x.measurement) == null ? void 0 : c.abbrev) ?? x.unit.abbrev), 1)
329
329
  ]),
330
330
  d("div", xt, [
331
- d("span", null, "(#" + D(x.seqNumber) + ")", 1),
332
- v[1] || (v[1] = d("span", null, D(" "), -1)),
333
- d("span", null, D(e(Ae)(new Date(x.date))), 1)
331
+ d("span", null, "(#" + A(x.seqNumber) + ")", 1),
332
+ v[1] || (v[1] = d("span", null, A(" "), -1)),
333
+ d("span", null, A(e($e)(new Date(x.date))), 1)
334
334
  ])
335
335
  ]);
336
336
  }), 128))
@@ -339,7 +339,7 @@ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
339
339
  }), 128))
340
340
  ]));
341
341
  }
342
- }), St = { class: "flex flex-col gap-8 py-16" }, Pt = { class: "flex items-center" }, Tt = { class: "flex-1 flex gap-1 items-center" }, It = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ft = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, $t = { class: "flex gap-8 w-full" }, At = { class: "flex-1 flex flex-col gap-4" }, Dt = { class: "flex-1 flex flex-col gap-4" }, Vt = { class: "flex gap-8 w-full" }, Rt = { class: "flex-1 flex flex-col gap-4" }, Ot = {
342
+ }), St = { class: "flex flex-col gap-8 py-16" }, Pt = { class: "flex items-center" }, Ft = { class: "flex-1 flex gap-1 items-center" }, Tt = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, It = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, $t = { class: "flex gap-8 w-full" }, At = { class: "flex-1 flex flex-col gap-4" }, Dt = { class: "flex-1 flex flex-col gap-4" }, Vt = { class: "flex gap-8 w-full" }, Rt = { class: "flex-1 flex flex-col gap-4" }, Ot = {
343
343
  key: 0,
344
344
  class: "flex-1 flex flex-col gap-4"
345
345
  }, Bt = /* @__PURE__ */ se({
@@ -351,19 +351,19 @@ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
351
351
  row: {}
352
352
  },
353
353
  setup(o) {
354
- const { t: f } = de();
354
+ const { t: m } = de();
355
355
  return (r, n) => {
356
- var l, x, p, s, a, y, u, c, C, b, h, w, O, B, J, U, Y, K, N, H, G, _, g, M, oe, Z, we;
357
- const v = I("FmLabel"), t = I("FmSpacer");
358
- return P(), A("div", St, [
356
+ var l, x, c, s, a, f, u, p, C, b, h, w, O, B, X, U, W, K, q, N, J, _, g, M, oe, Y, we;
357
+ const v = T("FmLabel"), t = T("FmSpacer");
358
+ return P(), $("div", St, [
359
359
  d("div", Pt, [
360
- d("div", Tt, [
361
- d("span", It, " (" + D(r.row.original.sku.code) + ") ", 1),
362
- d("span", Ft, D(r.row.original.sku.name), 1)
360
+ d("div", Ft, [
361
+ d("span", Tt, " (" + A(r.row.original.sku.code) + ") ", 1),
362
+ d("span", It, A(r.row.original.sku.name), 1)
363
363
  ]),
364
364
  d("div", null, [
365
365
  k(e(ue), {
366
- render: (p = (x = (l = r.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : x.columnDef) == null ? void 0 : p.cell,
366
+ render: (c = (x = (l = r.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : x.columnDef) == null ? void 0 : c.cell,
367
367
  props: (a = (s = r.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
368
368
  }, null, 8, ["render", "props"])
369
369
  ])
@@ -371,21 +371,21 @@ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
371
371
  d("div", $t, [
372
372
  d("div", At, [
373
373
  k(v, {
374
- label: e(f)(`inventory.transfer.form.items.table.${e(R).Code}`)
374
+ label: e(m)(`inventory.transfer.form.items.table.${e(R).Code}`)
375
375
  }, null, 8, ["label"]),
376
376
  k(e(ue), {
377
- render: (c = (u = (y = r.cellByColId[e(R).Code]) == null ? void 0 : y.column) == null ? void 0 : u.columnDef) == null ? void 0 : c.cell,
377
+ render: (p = (u = (f = r.cellByColId[e(R).Code]) == null ? void 0 : f.column) == null ? void 0 : u.columnDef) == null ? void 0 : p.cell,
378
378
  props: (b = (C = r.cellByColId[e(R).Code]) == null ? void 0 : C.getContext) == null ? void 0 : b.call(C)
379
379
  }, null, 8, ["render", "props"]),
380
380
  n[0] || (n[0] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
381
381
  ]),
382
382
  d("div", Dt, [
383
383
  k(v, {
384
- label: e(f)(`inventory.transfer.form.items.table.${e(R).Name}`)
384
+ label: e(m)(`inventory.transfer.form.items.table.${e(R).Name}`)
385
385
  }, null, 8, ["label"]),
386
386
  k(e(ue), {
387
387
  render: (O = (w = (h = r.cellByColId[e(R).Name]) == null ? void 0 : h.column) == null ? void 0 : w.columnDef) == null ? void 0 : O.cell,
388
- props: (J = (B = r.cellByColId[e(R).Name]) == null ? void 0 : B.getContext) == null ? void 0 : J.call(B)
388
+ props: (X = (B = r.cellByColId[e(R).Name]) == null ? void 0 : B.getContext) == null ? void 0 : X.call(B)
389
389
  }, null, 8, ["render", "props"]),
390
390
  n[1] || (n[1] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
391
391
  ])
@@ -393,41 +393,41 @@ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
393
393
  d("div", Vt, [
394
394
  d("div", Rt, [
395
395
  k(v, {
396
- label: e(f)(`inventory.transfer.form.items.table.${e(R).Amount}`)
396
+ label: e(m)(`inventory.transfer.form.items.table.${e(R).Amount}`)
397
397
  }, null, 8, ["label"]),
398
398
  k(e(ue), {
399
- render: (K = (Y = (U = r.cellByColId[e(R).Amount]) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : K.cell,
400
- props: (H = (N = r.cellByColId[e(R).Amount]) == null ? void 0 : N.getContext) == null ? void 0 : H.call(N)
399
+ render: (K = (W = (U = r.cellByColId[e(R).Amount]) == null ? void 0 : U.column) == null ? void 0 : W.columnDef) == null ? void 0 : K.cell,
400
+ props: (N = (q = r.cellByColId[e(R).Amount]) == null ? void 0 : q.getContext) == null ? void 0 : N.call(q)
401
401
  }, null, 8, ["render", "props"]),
402
402
  n[2] || (n[2] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
403
403
  ]),
404
- r.cellByColId[e(R).Cost] ? (P(), A("div", Ot, [
404
+ r.cellByColId[e(R).Cost] ? (P(), $("div", Ot, [
405
405
  k(ze, { "z-index": 50 }, {
406
406
  default: V(() => [
407
407
  k(v, {
408
- label: e(f)(`inventory.transfer.form.items.table.${e(R).Cost}2`)
408
+ label: e(m)(`inventory.transfer.form.items.table.${e(R).Cost}2`)
409
409
  }, null, 8, ["label"])
410
410
  ]),
411
411
  _: 1
412
412
  }),
413
413
  k(e(ue), {
414
- render: (g = (_ = (G = r.cellByColId[e(R).Cost]) == null ? void 0 : G.column) == null ? void 0 : _.columnDef) == null ? void 0 : g.cell,
414
+ render: (g = (_ = (J = r.cellByColId[e(R).Cost]) == null ? void 0 : J.column) == null ? void 0 : _.columnDef) == null ? void 0 : g.cell,
415
415
  props: (oe = (M = r.cellByColId[e(R).Cost]) == null ? void 0 : M.getContext) == null ? void 0 : oe.call(M)
416
416
  }, null, 8, ["render", "props"]),
417
417
  n[3] || (n[3] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
418
- ])) : z("", !0)
418
+ ])) : H("", !0)
419
419
  ]),
420
- r.showComparePrice && Object.keys(r.comparePriceBySku[(Z = r.row.original.sku) == null ? void 0 : Z._id] ?? {}).length > 0 ? (P(), A(ve, { key: 0 }, [
420
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(Y = r.row.original.sku) == null ? void 0 : Y._id] ?? {}).length > 0 ? (P(), $(fe, { key: 0 }, [
421
421
  k(t, { class: "h-8" }),
422
422
  k(je, {
423
423
  prices: r.comparePriceBySku[(we = r.row.original.sku) == null ? void 0 : we._id]
424
424
  }, null, 8, ["prices"])
425
- ], 64)) : z("", !0)
425
+ ], 64)) : H("", !0)
426
426
  ]);
427
427
  };
428
428
  }
429
429
  });
430
- function ye(o) {
430
+ function me(o) {
431
431
  return lt.parse(o);
432
432
  }
433
433
  function Ce(o) {
@@ -442,71 +442,71 @@ function Ce(o) {
442
442
  address: o.doc.profile.address
443
443
  };
444
444
  }
445
- function Ut(o, f) {
446
- const r = he(), n = De(), v = T(() => !n.businessLevel);
445
+ function Ut(o, m) {
446
+ const r = he(), n = Ae(), v = F(() => !n.businessLevel);
447
447
  n.watchLocation(async () => {
448
448
  await r.readSuppliers();
449
449
  const u = o();
450
450
  if (u.supplier._id) return;
451
- const c = n.businessLevel ? r.businessSuppliers[0] : r.suppliers[0], b = (v.value ? n.locations.filter((h) => h.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
452
- f({
451
+ const p = n.businessLevel ? r.businessSuppliers[0] : r.suppliers[0], b = (v.value ? n.locations.filter((h) => h.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
452
+ m({
453
453
  ...u,
454
- supplier: c ? ye(c) : b ? Ce(b) : u.supplier
454
+ supplier: p ? me(p) : b ? Ce(b) : u.supplier
455
455
  });
456
456
  });
457
- const t = T(
457
+ const t = F(
458
458
  () => {
459
- var u, c;
460
- return typeof ((c = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : c.internal) == "string" ? $.TRANSFER : $.PURCHASE;
459
+ var u, p;
460
+ return typeof ((p = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : p.internal) == "string" ? I.TRANSFER : I.PURCHASE;
461
461
  }
462
- ), l = T({
462
+ ), l = F({
463
463
  get() {
464
- var u, c;
465
- return (c = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : c._id;
464
+ var u, p;
465
+ return (p = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : p._id;
466
466
  },
467
467
  set(u) {
468
- const c = o() ?? {};
469
- if (t.value === $.PURCHASE) {
468
+ const p = o() ?? {};
469
+ if (t.value === I.PURCHASE) {
470
470
  const O = (n.businessLevel ? r.businessSuppliers : r.suppliers).find((B) => B._id === u);
471
- f({
472
- ...c,
473
- supplier: O ? ye(O) : c.supplier
471
+ m({
472
+ ...p,
473
+ supplier: O ? me(O) : p.supplier
474
474
  });
475
475
  return;
476
476
  }
477
477
  const h = (v.value ? n.locations.filter((w) => w.doc._id !== n.currentLocation.doc._id) : n.locations).find((w) => w.doc._id === u);
478
- f({
479
- ...c,
480
- supplier: h ? Ce(h) : c.supplier
478
+ m({
479
+ ...p,
480
+ supplier: h ? Ce(h) : p.supplier
481
481
  });
482
482
  }
483
- }), x = T(() => r.locationSuppliers.map(ye)), p = T(() => r.businessSuppliers.map(ye)), s = T(() => {
483
+ }), x = F(() => r.locationSuppliers.map(me)), c = F(() => r.businessSuppliers.map(me)), s = F(() => {
484
484
  var C;
485
485
  const u = ((C = n._currentLocation) == null ? void 0 : C.type) === He.warehouse;
486
486
  return (v.value ? n.locations.filter((b) => b.doc._id !== n.currentLocation.doc._id) : n.locations).filter((b) => u || b.acceptRequest).map(Ce);
487
- }), a = T(() => {
488
- if (t.value === $.PURCHASE) {
489
- const c = x.value.map((b) => ({
487
+ }), a = F(() => {
488
+ if (t.value === I.PURCHASE) {
489
+ const p = x.value.map((b) => ({
490
490
  label: b.name,
491
491
  value: b._id
492
- })), C = p.value.map((b) => ({
492
+ })), C = c.value.map((b) => ({
493
493
  label: b.name,
494
494
  sublabel: "Business supplier",
495
495
  value: b._id
496
496
  }));
497
- return n.businessLevel ? C : [...c, ...C];
497
+ return n.businessLevel ? C : [...p, ...C];
498
498
  }
499
- return s.value.map((c) => ({
500
- label: c.name,
501
- sublabel: c.internal ? `${c.internal}` : void 0,
502
- value: c._id
499
+ return s.value.map((p) => ({
500
+ label: p.name,
501
+ sublabel: p.internal ? `${p.internal}` : void 0,
502
+ value: p._id
503
503
  }));
504
- }), y = T(() => {
504
+ }), f = F(() => {
505
505
  var b, h;
506
506
  const u = (h = (b = o()) == null ? void 0 : b.supplier) == null ? void 0 : h._id;
507
- if (t.value === $.PURCHASE) {
507
+ if (t.value === I.PURCHASE) {
508
508
  const w = r.suppliers.find((O) => O._id === u);
509
- return w ? ye(w) : null;
509
+ return w ? me(w) : null;
510
510
  }
511
511
  const C = n.locations.find((w) => w.doc._id);
512
512
  return C ? Ce(C) : null;
@@ -516,11 +516,11 @@ function Ut(o, f) {
516
516
  transferLocationOptions: a,
517
517
  locationOptionsTypePurchase: x,
518
518
  locationOptionsTypeTransfer: s,
519
- selectedLocation: y
519
+ selectedLocation: f
520
520
  };
521
521
  }
522
522
  function Mt(o) {
523
- const f = T({
523
+ const m = F({
524
524
  get() {
525
525
  const t = o.getEffectiveAt();
526
526
  return t ? new Date(t) : null;
@@ -528,30 +528,30 @@ function Mt(o) {
528
528
  set(t) {
529
529
  o.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
530
530
  }
531
- }), r = T({
531
+ }), r = F({
532
532
  get() {
533
- return !!f.value;
533
+ return !!m.value;
534
534
  },
535
535
  set(t) {
536
- t ? f.value = /* @__PURE__ */ new Date() : f.value = null;
536
+ t ? m.value = /* @__PURE__ */ new Date() : m.value = null;
537
537
  }
538
- }), n = T({
538
+ }), n = F({
539
539
  get() {
540
- return f.value === null ? "" : Ae(f.value);
540
+ return m.value === null ? "" : $e(m.value);
541
541
  },
542
542
  set(t) {
543
- t ? f.value = /* @__PURE__ */ new Date(`${t} ${v.value}`) : f.value = null;
543
+ t ? m.value = /* @__PURE__ */ new Date(`${t} ${v.value}`) : m.value = null;
544
544
  }
545
- }), v = T({
545
+ }), v = F({
546
546
  get() {
547
- return f.value === null ? "" : rt(f.value);
547
+ return m.value === null ? "" : rt(m.value);
548
548
  },
549
549
  set(t) {
550
- t ? f.value = /* @__PURE__ */ new Date(`${n.value} ${t}`) : f.value = null;
550
+ t ? m.value = /* @__PURE__ */ new Date(`${n.value} ${t}`) : m.value = null;
551
551
  }
552
552
  });
553
553
  return {
554
- backdatePo: f,
554
+ backdatePo: m,
555
555
  backdateSwitch: r,
556
556
  backdateModel: n,
557
557
  backdateTimeModel: v
@@ -576,7 +576,7 @@ const Et = {
576
576
  }
577
577
  },
578
578
  setup(o) {
579
- return (f, r) => (P(), A("svg", Et, [
579
+ return (m, r) => (P(), $("svg", Et, [
580
580
  d("path", {
581
581
  d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
582
582
  fill: o.color
@@ -601,14 +601,14 @@ const Et = {
601
601
  }, null, 8, Ht)
602
602
  ]));
603
603
  }
604
- }), jt = { class: "flex gap-8 items-center" }, Wt = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Yt = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Zt = { class: "flex items-center w-full" }, Qt = { class: "flex-1" }, Kt = { class: "fm-typo-en-title-sm-800" }, Gt = { class: "flex items-start gap-8" }, Jt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Xt = { class: "flex gap-1" }, Be = /* @__PURE__ */ se({
604
+ }), jt = { class: "flex gap-8 items-center" }, Wt = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Yt = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Zt = { class: "flex items-center w-full" }, Qt = { class: "flex-1" }, Kt = { class: "fm-typo-en-title-sm-800" }, Jt = { class: "flex items-start gap-8" }, Xt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gt = { class: "flex gap-1" }, Be = /* @__PURE__ */ se({
605
605
  __name: "ForecastStock",
606
606
  props: {
607
607
  disabled: { type: Boolean }
608
608
  },
609
609
  emits: ["update:poItems"],
610
- setup(o, { emit: f }) {
611
- const r = f, n = L(!1), v = L(7), t = ft(), l = $e(), x = Ve(), { t: p } = de();
610
+ setup(o, { emit: m }) {
611
+ const r = m, n = L(!1), v = L(7), t = ft(), l = Ie(), x = De(), { t: c } = de();
612
612
  async function s() {
613
613
  if (v.value < 1)
614
614
  return;
@@ -616,35 +616,35 @@ const Et = {
616
616
  const a = [];
617
617
  if (t.purchaseOrderForecast.skus.length <= 0) {
618
618
  l.open({
619
- message: p("inventory.transfer.form.items.forecastStock.notAvailable"),
619
+ message: c("inventory.transfer.form.items.forecastStock.notAvailable"),
620
620
  type: "info"
621
621
  });
622
622
  return;
623
623
  }
624
- const y = t.purchaseOrderForecast.skus.reduce((u, c) => {
625
- const C = x.skus.find((w) => w._id === c.id);
626
- if (u.find((w) => w.sku._id === c.id) || !C)
624
+ const f = t.purchaseOrderForecast.skus.reduce((u, p) => {
625
+ const C = x.skus.find((w) => w._id === p.id);
626
+ if (u.find((w) => w.sku._id === p.id) || !C)
627
627
  return u;
628
628
  const h = {
629
629
  sku: C,
630
630
  code: C.code,
631
631
  name: C.name,
632
632
  quantity: {
633
- amount: c.amount,
633
+ amount: p.amount,
634
634
  precision: 0
635
635
  }
636
636
  };
637
637
  return u.push(h), u;
638
638
  }, a);
639
- r("update:poItems", y);
639
+ r("update:poItems", f);
640
640
  }
641
- return (a, y) => {
642
- const u = I("FmButton"), c = I("FmIcon"), C = I("FmStepperField"), b = I("FmPopover");
643
- return P(), j(b, {
641
+ return (a, f) => {
642
+ const u = T("FmButton"), p = T("FmIcon"), C = T("FmStepperField"), b = T("FmPopover");
643
+ return P(), z(b, {
644
644
  disabled: a.disabled,
645
645
  class: "flex",
646
646
  "show-popover": n.value,
647
- onPopoverChanged: y[3] || (y[3] = (h) => n.value = h)
647
+ onPopoverChanged: f[3] || (f[3] = (h) => n.value = h)
648
648
  }, {
649
649
  "popover-button": V(() => [
650
650
  k(u, {
@@ -661,7 +661,7 @@ const Et = {
661
661
  size: 24,
662
662
  color: a.disabled ? "#c7c7cc" : "#ff7823"
663
663
  }, null, 8, ["color"]),
664
- d("div", Wt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
664
+ d("div", Wt, A(e(c)("inventory.transfer.form.items.forecastStock.title")), 1)
665
665
  ])
666
666
  ]),
667
667
  _: 1
@@ -673,7 +673,7 @@ const Et = {
673
673
  d("div", Qt, [
674
674
  k(bt, { "z-index": 99 }, {
675
675
  default: V(() => [
676
- d("p", Kt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
676
+ d("p", Kt, A(e(c)("inventory.transfer.form.items.forecastStock.title")), 1)
677
677
  ]),
678
678
  _: 1
679
679
  })
@@ -682,36 +682,36 @@ const Et = {
682
682
  icon: "close",
683
683
  size: "md",
684
684
  variant: "tertiary",
685
- onClick: y[0] || (y[0] = (h) => n.value = !1)
685
+ onClick: f[0] || (f[0] = (h) => n.value = !1)
686
686
  })
687
687
  ]),
688
688
  k(C, {
689
689
  modelValue: v.value,
690
- "onUpdate:modelValue": y[1] || (y[1] = (h) => v.value = h),
691
- label: e(p)("inventory.transfer.form.items.forecastStock.days"),
690
+ "onUpdate:modelValue": f[1] || (f[1] = (h) => v.value = h),
691
+ label: e(c)("inventory.transfer.form.items.forecastStock.days"),
692
692
  rules: [e(ke)(1)]
693
693
  }, {
694
694
  "helper-text": V(() => [
695
- d("div", Gt, [
696
- k(c, {
695
+ d("div", Jt, [
696
+ k(p, {
697
697
  name: "warning",
698
698
  size: "sm",
699
699
  class: "text-fm-color-system-warning-300"
700
700
  }),
701
- d("div", Jt, D(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
701
+ d("div", Xt, A(e(c)("inventory.transfer.form.items.forecastStock.replace")), 1)
702
702
  ])
703
703
  ]),
704
704
  _: 1
705
705
  }, 8, ["modelValue", "label", "rules"]),
706
- d("div", Xt, [
707
- y[4] || (y[4] = d("div", { class: "grow" }, null, -1)),
706
+ d("div", Gt, [
707
+ f[4] || (f[4] = d("div", { class: "grow" }, null, -1)),
708
708
  k(u, {
709
- label: e(p)("common.cancel"),
709
+ label: e(c)("common.cancel"),
710
710
  variant: "tertiary",
711
- onClick: y[2] || (y[2] = (h) => n.value = !1)
711
+ onClick: f[2] || (f[2] = (h) => n.value = !1)
712
712
  }, null, 8, ["label"]),
713
713
  k(u, {
714
- label: e(p)("inventory.transfer.form.items.forecastStock.generate"),
714
+ label: e(c)("inventory.transfer.form.items.forecastStock.generate"),
715
715
  onClick: s
716
716
  }, null, 8, ["label"])
717
717
  ])
@@ -723,7 +723,7 @@ const Et = {
723
723
  }
724
724
  });
725
725
  function es() {
726
- const o = $e(), f = Ee(), r = L(!1);
726
+ const o = Ie(), m = Ee(), r = L(!1);
727
727
  Me(r, (l) => {
728
728
  l && (v.value = !0, n().finally(() => {
729
729
  v.value = !1;
@@ -731,26 +731,26 @@ function es() {
731
731
  });
732
732
  async function n() {
733
733
  try {
734
- const { startDate: l, endDate: x } = it(6), a = (await f.getPurchaseOrders({ start: l, end: x })).filter(
735
- (y) => {
736
- var u, c;
737
- return y.status === ut.enum.COMPLETE && ((u = y.supplier) == null ? void 0 : u.internal) !== "warehouse" && ((c = y.supplier) == null ? void 0 : c.internal) !== "restaurant";
734
+ const { startDate: l, endDate: x } = it(6), a = (await m.getPurchaseOrders({ start: l, end: x })).filter(
735
+ (f) => {
736
+ var u, p;
737
+ return f.status === ut.enum.COMPLETE && ((u = f.supplier) == null ? void 0 : u.internal) !== "warehouse" && ((p = f.supplier) == null ? void 0 : p.internal) !== "restaurant";
738
738
  }
739
- ).reduce((y, u) => {
740
- const c = new Date(dt(u._id)), C = u.supplier._id;
739
+ ).reduce((f, u) => {
740
+ const p = new Date(dt(u._id)), C = u.supplier._id;
741
741
  for (const b of u.items) {
742
742
  if (!b.totalCost) continue;
743
- const h = y[b.sku._id] ?? {}, w = h[C] ?? [];
743
+ const h = f[b.sku._id] ?? {}, w = h[C] ?? [];
744
744
  w.push({
745
- date: c.toISOString(),
745
+ date: p.toISOString(),
746
746
  totalUnit: b.quantity,
747
747
  totalCost: b.totalCost,
748
748
  unit: b.sku.unit,
749
749
  measurement: b.measurement,
750
750
  seqNumber: u.seqNumber
751
- }), h[C] = w, y[b.sku._id] = h;
751
+ }), h[C] = w, f[b.sku._id] = h;
752
752
  }
753
- return y;
753
+ return f;
754
754
  }, {});
755
755
  t.value = a;
756
756
  } catch {
@@ -775,29 +775,29 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
775
775
  showComparePrice: { type: Boolean }
776
776
  },
777
777
  setup(o) {
778
- function f(r) {
778
+ function m(r) {
779
779
  return r.column.columnDef.meta;
780
780
  }
781
781
  return (r, n) => {
782
782
  var v, t;
783
- return P(), A(ve, null, [
783
+ return P(), $(fe, null, [
784
784
  d("tr", {
785
- class: Ie(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
785
+ class: Fe(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
786
786
  "bg-fm-color-neutral-gray-100": r.row.getIsSelected()
787
787
  }])
788
788
  }, [
789
- (P(!0), A(ve, null, Te(r.row.getVisibleCells(), (l) => {
790
- var x, p, s, a;
791
- return P(), A("td", {
789
+ (P(!0), $(fe, null, Pe(r.row.getVisibleCells(), (l) => {
790
+ var x, c, s, a;
791
+ return P(), $("td", {
792
792
  key: l.id,
793
- class: Ie([
793
+ class: Fe([
794
794
  "h-[52px] px-16 text-fm-color-typo-primary",
795
- ((x = f(l)) == null ? void 0 : x.cellClass) ?? "px-16"
795
+ ((x = m(l)) == null ? void 0 : x.cellClass) ?? "px-16"
796
796
  ]),
797
797
  style: Ye({
798
- width: (p = f(l)) == null ? void 0 : p.width,
799
- maxWidth: (s = f(l)) == null ? void 0 : s.maxWidth,
800
- textAlign: ((a = f(l)) == null ? void 0 : a.textAlign) ?? "left"
798
+ width: (c = m(l)) == null ? void 0 : c.width,
799
+ maxWidth: (s = m(l)) == null ? void 0 : s.maxWidth,
800
+ textAlign: ((a = m(l)) == null ? void 0 : a.textAlign) ?? "left"
801
801
  })
802
802
  }, [
803
803
  d("span", ts, [
@@ -809,7 +809,7 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
809
809
  ], 6);
810
810
  }), 128))
811
811
  ], 2),
812
- r.showComparePrice && Object.keys(r.comparePriceBySku[(v = r.row.original.sku) == null ? void 0 : v._id] ?? {}).length > 0 ? (P(), A("tr", ss, [
812
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(v = r.row.original.sku) == null ? void 0 : v._id] ?? {}).length > 0 ? (P(), $("tr", ss, [
813
813
  d("td", {
814
814
  colspan: r.row.getVisibleCells().length
815
815
  }, [
@@ -817,7 +817,7 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
817
817
  prices: r.comparePriceBySku[(t = r.row.original.sku) == null ? void 0 : t._id]
818
818
  }, null, 8, ["prices"])
819
819
  ], 8, os)
820
- ])) : z("", !0)
820
+ ])) : H("", !0)
821
821
  ], 64);
822
822
  };
823
823
  }
@@ -843,20 +843,20 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
843
843
  lastClosingDate: {}
844
844
  },
845
845
  emits: ["validation-success", "form:ready"],
846
- setup(o, { expose: f, emit: r }) {
847
- const n = o, v = r, t = yt(), { t: l } = de(), x = De(), p = Ve(), s = he(), a = Le(), y = Je(), u = T(
848
- () => y.templates.value.find((i) => i._id === t.template)
849
- ), c = T(() => t.status === "DRAFT" || !t._rev);
846
+ setup(o, { expose: m, emit: r }) {
847
+ const n = o, v = r, t = yt(), { t: l } = de(), x = Ae(), c = De(), s = he(), a = Le(), f = Xe(), u = F(
848
+ () => f.templates.value.find((i) => i._id === t.template)
849
+ ), p = F(() => t.status === "DRAFT" || !t._rev);
850
850
  Ue(async () => {
851
851
  var i;
852
852
  try {
853
853
  if (!t.template) return;
854
- await y.loadTemplate(t.template), t.items.length || (t.items = ((i = u.value) == null ? void 0 : i.purchaseOrder.items) ?? []);
854
+ await f.loadTemplate(t.template), t.items.length || (t.items = ((i = u.value) == null ? void 0 : i.purchaseOrder.items) ?? []);
855
855
  } finally {
856
856
  v("form:ready");
857
857
  }
858
858
  });
859
- const C = T(
859
+ const C = F(
860
860
  () => x.currentLocation.type === He.restaurant
861
861
  );
862
862
  x.watchLocation(async () => {
@@ -867,58 +867,58 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
867
867
  (i) => {
868
868
  Object.assign(t, i);
869
869
  }
870
- ), w = T({
870
+ ), w = F({
871
871
  get() {
872
872
  var i;
873
- return typeof ((i = t == null ? void 0 : t.supplier) == null ? void 0 : i.internal) == "string" ? $.TRANSFER : $.PURCHASE;
873
+ return typeof ((i = t == null ? void 0 : t.supplier) == null ? void 0 : i.internal) == "string" ? I.TRANSFER : I.PURCHASE;
874
874
  },
875
875
  set(i) {
876
- var q;
877
- const m = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? $.TRANSFER : $.PURCHASE;
878
- i !== m && (t.supplier = i === $.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
876
+ var Z;
877
+ const y = typeof ((Z = t == null ? void 0 : t.supplier) == null ? void 0 : Z.internal) == "string" ? I.TRANSFER : I.PURCHASE;
878
+ i !== y && (t.supplier = i === I.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
879
879
  }
880
- }), O = T(() => h.transferLocationOptions.value), B = T({
880
+ }), O = F(() => h.transferLocationOptions.value), B = F({
881
881
  get() {
882
882
  return t.supplier._id;
883
883
  },
884
884
  set(i) {
885
885
  h.transferLocationModel.value = i;
886
886
  }
887
- }), J = T({
887
+ }), X = F({
888
888
  get() {
889
889
  return t.remark ?? void 0;
890
890
  },
891
891
  set(i) {
892
892
  t.remark = i;
893
893
  }
894
- }), { backdatePo: U, backdateSwitch: Y, backdateModel: K, backdateTimeModel: N } = Mt({
894
+ }), { backdatePo: U, backdateSwitch: W, backdateModel: K, backdateTimeModel: q } = Mt({
895
895
  getEffectiveAt() {
896
896
  return t.effectiveAt;
897
897
  },
898
898
  setEffectiveAt(i) {
899
899
  t.effectiveAt = i;
900
900
  }
901
- }), { comparePricesToggle: H, comparePriceFetching: G, comparePriceBySku: _ } = es(), g = L();
902
- f({
901
+ }), { comparePricesToggle: N, comparePriceFetching: J, comparePriceBySku: _ } = es(), g = L();
902
+ m({
903
903
  validateInputs: () => {
904
- var i, m;
905
- (m = (i = g.value) == null ? void 0 : i.validateInputs) == null || m.call(i);
904
+ var i, y;
905
+ (y = (i = g.value) == null ? void 0 : i.validateInputs) == null || y.call(i);
906
906
  },
907
907
  resetInputsValidation: () => {
908
- var i, m;
909
- (m = (i = g.value) == null ? void 0 : i.resetInputsValidation) == null || m.call(i);
908
+ var i, y;
909
+ (y = (i = g.value) == null ? void 0 : i.resetInputsValidation) == null || y.call(i);
910
910
  },
911
911
  resetInputs: () => {
912
- var i, m;
913
- (m = (i = g.value) == null ? void 0 : i.resetInputs) == null || m.call(i);
912
+ var i, y;
913
+ (y = (i = g.value) == null ? void 0 : i.resetInputs) == null || y.call(i);
914
914
  }
915
915
  });
916
916
  const M = gt({
917
917
  updateItem: (i) => {
918
- t.items = t.items.map((m) => m.sku._id !== i.sku._id ? m : i);
918
+ t.items = t.items.map((y) => y.sku._id !== i.sku._id ? y : i);
919
919
  },
920
920
  deleteItem: (i) => {
921
- t.items = t.items.filter((m) => m.sku._id !== i.sku._id);
921
+ t.items = t.items.filter((y) => y.sku._id !== i.sku._id);
922
922
  },
923
923
  get supplier() {
924
924
  return t.supplier;
@@ -935,46 +935,27 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
935
935
  get disabled() {
936
936
  return n.disabled;
937
937
  }
938
- }), oe = T(() => M.columnDefs.value);
939
- function Z() {
940
- var be, pe, _e;
941
- let i;
942
- ((F) => {
943
- F.IsInTemplate = "IsInTemplate", F.IsOutsideTemplate = "IsOutsideTemplate";
944
- })(i || (i = {}));
945
- const m = [
946
- {
947
- id: "IsInTemplate",
948
- label: l("inventory.transfer.form.items.fromTemplate.title")
949
- },
950
- {
951
- id: "IsOutsideTemplate",
952
- label: l("inventory.transfer.form.items.other.title"),
953
- sublabel: "These options are not selectable, and the items are managed in template.",
954
- collapse: !0,
955
- disabled: !0
956
- }
957
- ], q = new Set((_e = (pe = (be = u.value) == null ? void 0 : be.purchaseOrder) == null ? void 0 : pe.items) == null ? void 0 : _e.map((F) => F.sku._id)), ce = p.skus.map(
958
- (F) => ({
959
- label: F.name,
960
- sublabel: F.code,
961
- value: F,
962
- disabled: !!(q.size && !q.has(F._id)),
963
- groupId: q.has(F._id) ? "IsInTemplate" : "IsOutsideTemplate"
964
- /* IsOutsideTemplate */
938
+ }), oe = F(() => M.columnDefs.value);
939
+ function Y() {
940
+ var ve, be, ce;
941
+ const i = new Set((ce = (be = (ve = u.value) == null ? void 0 : ve.purchaseOrder) == null ? void 0 : be.items) == null ? void 0 : ce.map((D) => D.sku._id)), Z = (i.size ? c.skus.filter((D) => i.has(D._id)) : c.skus).map(
942
+ (D) => ({
943
+ label: D.name,
944
+ sublabel: D.code,
945
+ value: D
965
946
  })
966
- ), xe = ce.filter((F) => {
967
- var X;
968
- return (X = t.items) == null ? void 0 : X.find((ne) => ne.sku._id === F.value._id);
969
- }).map((F) => F.value);
947
+ ), ye = Z.filter((D) => {
948
+ var ne;
949
+ return (ne = t.items) == null ? void 0 : ne.find((G) => G.sku._id === D.value._id);
950
+ }).map((D) => D.value);
970
951
  b.open({
971
952
  title: l("inventory.transfer.form.items.selectItem"),
972
953
  closeButton: !0,
973
954
  contentComponent: mt,
974
955
  contentComponentProps: {
975
- modelValue: xe,
976
- items: ce,
977
- groups: q.size ? m : void 0
956
+ modelValue: ye,
957
+ items: Z,
958
+ virtualScroll: !0
978
959
  },
979
960
  primaryActions: {
980
961
  text: l("common.confirm"),
@@ -985,13 +966,13 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
985
966
  close: !0,
986
967
  variant: "tertiary"
987
968
  }
988
- }).onPrimary((F) => {
989
- const X = t.items ?? [], ne = F.map((Q) => {
990
- var ge, me;
991
- const ae = X.find((le) => le.sku._id === Q._id);
969
+ }).onPrimary((D) => {
970
+ const ne = t.items ?? [], G = D.map((Q) => {
971
+ var _e, ge;
972
+ const ae = ne.find((le) => le.sku._id === Q._id);
992
973
  if (ae)
993
974
  return ae;
994
- const ee = ((me = (ge = u.value) == null ? void 0 : ge.purchaseOrder.items) == null ? void 0 : me.find(
975
+ const ee = ((ge = (_e = u.value) == null ? void 0 : _e.purchaseOrder.items) == null ? void 0 : ge.find(
995
976
  (le) => le.sku._id === Q._id
996
977
  )) ?? {
997
978
  sku: Q,
@@ -1002,7 +983,7 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1002
983
  precision: 0
1003
984
  }
1004
985
  };
1005
- return w.value == $.PURCHASE && (ee.totalCost = te(
986
+ return w.value == I.PURCHASE && (ee.totalCost = te(
1006
987
  ee.sku,
1007
988
  ee.quantity,
1008
989
  ee.measurement,
@@ -1011,35 +992,35 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1011
992
  }
1012
993
  )), ee;
1013
994
  });
1014
- ne.sort((Q, ae) => Q.sku.code.localeCompare(ae.sku.code)), t.items = ne;
995
+ G.sort((Q, ae) => Q.sku.code.localeCompare(ae.sku.code)), t.items = G;
1015
996
  });
1016
997
  }
1017
998
  function we(i) {
1018
999
  return i;
1019
1000
  }
1020
- return (i, m) => {
1021
- var me, le;
1022
- const q = I("FmChip"), ce = I("FmSelect"), xe = I("FmTextField"), be = I("FmTextarea"), pe = I("FmSwitch"), _e = I("FmDatePicker"), F = I("FmTimePicker"), X = I("FmFormGroup"), ne = I("FmIcon"), Q = I("FmButton"), ae = I("FmTooltip"), ee = I("FmTable"), ge = I("FmForm");
1023
- return P(), A("div", as, [
1001
+ return (i, y) => {
1002
+ var le, Ve;
1003
+ const Z = T("FmChip"), ye = T("FmSelect"), ve = T("FmTextField"), be = T("FmTextarea"), ce = T("FmSwitch"), D = T("FmDatePicker"), ne = T("FmTimePicker"), G = T("FmFormGroup"), Q = T("FmIcon"), ae = T("FmButton"), ee = T("FmTooltip"), _e = T("FmTable"), ge = T("FmForm");
1004
+ return P(), $("div", as, [
1024
1005
  d("div", ls, [
1025
- (me = n.modelValue) != null && me.template ? (P(), j(q, {
1006
+ (le = n.modelValue) != null && le.template ? (P(), z(Z, {
1026
1007
  key: 0,
1027
1008
  variant: i.disabled ? "warning" : void 0,
1028
- label: `${e(l)("inventory.transfer.template.title")}: ${((le = u.value) == null ? void 0 : le.name) ?? e(l)("inventory.transfer.form.loading")}`,
1009
+ label: `${e(l)("inventory.transfer.template.title")}: ${((Ve = u.value) == null ? void 0 : Ve.name) ?? e(l)("inventory.transfer.form.loading")}`,
1029
1010
  icon: "summarize",
1030
1011
  compact: ""
1031
- }, null, 8, ["variant", "label"])) : z("", !0),
1032
- k(q, {
1012
+ }, null, 8, ["variant", "label"])) : H("", !0),
1013
+ k(Z, {
1033
1014
  label: e(x).currentLocation.name,
1034
1015
  icon: "storefront",
1035
1016
  compact: ""
1036
1017
  }, null, 8, ["label"]),
1037
- i.lastClosingDate ? (P(), j(q, {
1018
+ i.lastClosingDate ? (P(), z(Z, {
1038
1019
  key: 1,
1039
- label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Ae)(i.lastClosingDate)} ${e(ct)(i.lastClosingDate)}`,
1020
+ label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e($e)(i.lastClosingDate)} ${e(ct)(i.lastClosingDate)}`,
1040
1021
  icon: "calendar_month",
1041
1022
  compact: ""
1042
- }, null, 8, ["label"])) : z("", !0)
1023
+ }, null, 8, ["label"])) : H("", !0)
1043
1024
  ]),
1044
1025
  k(ge, {
1045
1026
  ref_key: "formRef",
@@ -1047,105 +1028,105 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1047
1028
  class: "flex flex-col gap-32",
1048
1029
  disabled: i.disabled,
1049
1030
  onValidationFailed: console.log,
1050
- onValidationSuccess: m[12] || (m[12] = (Se) => v("validation-success"))
1031
+ onValidationSuccess: y[12] || (y[12] = (xe) => v("validation-success"))
1051
1032
  }, {
1052
1033
  default: V(() => {
1053
- var Se;
1034
+ var xe;
1054
1035
  return [
1055
1036
  d("div", rs, [
1056
1037
  d("div", is, [
1057
- k(ce, {
1038
+ k(ye, {
1058
1039
  label: e(l)("inventory.transfer.form.type.title"),
1059
1040
  "model-value": w.value,
1060
- "onUpdate:modelValue": m[0] || (m[0] = (S) => w.value = S),
1041
+ "onUpdate:modelValue": y[0] || (y[0] = (S) => w.value = S),
1061
1042
  items: [
1062
1043
  {
1063
1044
  label: e(l)("inventory.transfer.form.type.purchase"),
1064
- value: e($).PURCHASE,
1045
+ value: e(I).PURCHASE,
1065
1046
  disabled: !e(h).locationOptionsTypePurchase.value.length,
1066
1047
  sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
1067
1048
  },
1068
1049
  {
1069
1050
  label: e(l)("inventory.transfer.form.type.transfer"),
1070
- value: e($).TRANSFER,
1051
+ value: e(I).TRANSFER,
1071
1052
  disabled: !e(h).locationOptionsTypeTransfer.value.length,
1072
1053
  sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
1073
1054
  }
1074
1055
  ],
1075
1056
  rules: [e(ke)(1)(O.value)]
1076
1057
  }, null, 8, ["label", "model-value", "items", "rules"]),
1077
- k(ce, {
1078
- label: w.value === e($).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
1058
+ k(ye, {
1059
+ label: w.value === e(I).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
1079
1060
  modelValue: B.value,
1080
- "onUpdate:modelValue": m[1] || (m[1] = (S) => B.value = S),
1061
+ "onUpdate:modelValue": y[1] || (y[1] = (S) => B.value = S),
1081
1062
  items: O.value
1082
1063
  }, null, 8, ["label", "modelValue", "items"]),
1083
- k(xe, {
1064
+ k(ve, {
1084
1065
  label: e(l)("inventory.transfer.form.reference"),
1085
1066
  "label-mark": "optional",
1086
1067
  modelValue: e(t).ref,
1087
- "onUpdate:modelValue": m[2] || (m[2] = (S) => e(t).ref = S)
1068
+ "onUpdate:modelValue": y[2] || (y[2] = (S) => e(t).ref = S)
1088
1069
  }, null, 8, ["label", "modelValue"]),
1089
1070
  k(be, {
1090
1071
  label: e(l)("inventory.transfer.form.remark"),
1091
1072
  "label-mark": "optional",
1092
1073
  "max-length": 240,
1093
- modelValue: J.value,
1094
- "onUpdate:modelValue": m[3] || (m[3] = (S) => J.value = S),
1095
- class: Ie([i.disabled ? "text-fm-color-typo-disabled " : ""])
1074
+ modelValue: X.value,
1075
+ "onUpdate:modelValue": y[3] || (y[3] = (S) => X.value = S),
1076
+ class: Fe([i.disabled ? "text-fm-color-typo-disabled " : ""])
1096
1077
  }, null, 8, ["label", "modelValue", "class"]),
1097
- e(a).enableBackdatePo ? (P(), A("div", us, [
1078
+ e(a).enableBackdatePo ? (P(), $("div", us, [
1098
1079
  d("div", ds, [
1099
- k(pe, {
1100
- modelValue: e(Y),
1101
- "onUpdate:modelValue": m[4] || (m[4] = (S) => ie(Y) ? Y.value = S : null),
1080
+ k(ce, {
1081
+ modelValue: e(W),
1082
+ "onUpdate:modelValue": y[4] || (y[4] = (S) => ie(W) ? W.value = S : null),
1102
1083
  label: e(l)("inventory.transfer.form.backdate.title"),
1103
1084
  sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
1104
1085
  "label-placement": "right",
1105
1086
  disabled: C.value && !i.lastClosingDate || i.disabled
1106
1087
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1107
- m[13] || (m[13] = d("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1)),
1108
- e(Y) ? (P(), A("div", cs, [
1088
+ y[13] || (y[13] = d("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1)),
1089
+ e(W) ? (P(), $("div", cs, [
1109
1090
  d("div", ps, [
1110
- k(_e, {
1091
+ k(D, {
1111
1092
  modelValue: e(K),
1112
- "onUpdate:modelValue": m[5] || (m[5] = (S) => ie(K) ? K.value = S : null)
1093
+ "onUpdate:modelValue": y[5] || (y[5] = (S) => ie(K) ? K.value = S : null)
1113
1094
  }, null, 8, ["modelValue"])
1114
1095
  ]),
1115
1096
  d("div", ms, [
1116
- k(F, {
1117
- modelValue: e(N),
1118
- "onUpdate:modelValue": m[6] || (m[6] = (S) => ie(N) ? N.value = S : null)
1097
+ k(ne, {
1098
+ modelValue: e(q),
1099
+ "onUpdate:modelValue": y[6] || (y[6] = (S) => ie(q) ? q.value = S : null)
1119
1100
  }, null, 8, ["modelValue"])
1120
1101
  ])
1121
- ])) : z("", !0)
1102
+ ])) : H("", !0)
1122
1103
  ]),
1123
- e(U) ? (P(), j(X, {
1104
+ e(U) ? (P(), z(G, {
1124
1105
  key: 0,
1125
1106
  modelValue: e(U),
1126
- "onUpdate:modelValue": m[7] || (m[7] = (S) => ie(U) ? U.value = S : null),
1107
+ "onUpdate:modelValue": y[7] || (y[7] = (S) => ie(U) ? U.value = S : null),
1127
1108
  rules: [e(pt)(new Date(i.lastClosingDate), /* @__PURE__ */ new Date())]
1128
- }, null, 8, ["modelValue", "rules"])) : z("", !0),
1129
- C.value && !i.lastClosingDate ? (P(), A("div", fs, [
1130
- k(ne, {
1109
+ }, null, 8, ["modelValue", "rules"])) : H("", !0),
1110
+ C.value && !i.lastClosingDate ? (P(), $("div", fs, [
1111
+ k(Q, {
1131
1112
  name: "error",
1132
1113
  size: "sm",
1133
1114
  class: "text-fm-color-typo-warning"
1134
1115
  }),
1135
- d("span", ys, D(e(l)("inventory.transfer.form.backdate.error")), 1)
1136
- ])) : z("", !0)
1137
- ])) : z("", !0)
1116
+ d("span", ys, A(e(l)("inventory.transfer.form.backdate.error")), 1)
1117
+ ])) : H("", !0)
1118
+ ])) : H("", !0)
1138
1119
  ])
1139
1120
  ]),
1140
1121
  d("div", vs, [
1141
- k(X, {
1122
+ k(G, {
1142
1123
  "model-value": e(t).items,
1143
1124
  rules: [e(ke)(1)]
1144
1125
  }, null, 8, ["model-value", "rules"]),
1145
1126
  d("div", bs, [
1146
- d("div", _s, D(e(l)("inventory.transfer.form.items.title")), 1),
1127
+ d("div", _s, A(e(l)("inventory.transfer.form.items.title")), 1),
1147
1128
  d("div", gs, [
1148
- k(Q, {
1129
+ k(ae, {
1149
1130
  disabled: i.disabled,
1150
1131
  label: e(l)("inventory.transfer.form.items.addItem"),
1151
1132
  "prepend-icon": "add",
@@ -1153,41 +1134,41 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1153
1134
  "text-color": "primary",
1154
1135
  "bg-color": "transparent",
1155
1136
  "border-color": "primary",
1156
- onClick: m[8] || (m[8] = (S) => Z()),
1137
+ onClick: y[8] || (y[8] = (S) => Y()),
1157
1138
  size: "md"
1158
1139
  }, null, 8, ["disabled", "label"]),
1159
- e(t).template ? (P(), j(ae, {
1140
+ e(t).template ? (P(), z(ee, {
1160
1141
  key: 0,
1161
1142
  "z-index": 50
1162
1143
  }, {
1163
1144
  content: V(() => [
1164
- d("div", null, D(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1145
+ d("div", null, A(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1165
1146
  ]),
1166
1147
  default: V(() => [
1167
1148
  k(Be, {
1168
- "onUpdate:poItems": m[9] || (m[9] = (S) => e(t).items = S),
1149
+ "onUpdate:poItems": y[9] || (y[9] = (S) => e(t).items = S),
1169
1150
  disabled: ""
1170
1151
  })
1171
1152
  ]),
1172
1153
  _: 1
1173
- })) : (P(), j(Be, {
1154
+ })) : (P(), z(Be, {
1174
1155
  key: 1,
1175
- "onUpdate:poItems": m[10] || (m[10] = (S) => e(t).items = S),
1156
+ "onUpdate:poItems": y[10] || (y[10] = (S) => e(t).items = S),
1176
1157
  disabled: i.disabled || !!e(t).template
1177
1158
  }, null, 8, ["disabled"]))
1178
1159
  ])
1179
1160
  ]),
1180
- w.value === e($).PURCHASE && c.value && e(a).enableTotalCost && ((Se = i.modelValue) != null && Se.items.length) ? (P(), A("div", Cs, [
1181
- k(pe, {
1182
- label: e(G) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
1161
+ w.value === e(I).PURCHASE && p.value && e(a).enableTotalCost && ((xe = i.modelValue) != null && xe.items.length) ? (P(), $("div", Cs, [
1162
+ k(ce, {
1163
+ label: e(J) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
1183
1164
  "prepend-icon": "compare_arrows",
1184
1165
  "label-placement": "right",
1185
- "model-value": e(H),
1186
- "onUpdate:modelValue": m[11] || (m[11] = (S) => ie(H) ? H.value = S : null),
1187
- disabled: e(G) || i.disabled
1166
+ "model-value": e(N),
1167
+ "onUpdate:modelValue": y[11] || (y[11] = (S) => ie(N) ? N.value = S : null),
1168
+ disabled: e(J) || i.disabled
1188
1169
  }, null, 8, ["label", "model-value", "disabled"])
1189
- ])) : z("", !0),
1190
- (P(), j(ee, {
1170
+ ])) : H("", !0),
1171
+ (P(), z(_e, {
1191
1172
  "column-defs": oe.value,
1192
1173
  "row-data": e(t).items,
1193
1174
  key: e(t).items.map((S) => S.sku._id).join("."),
@@ -1197,21 +1178,21 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1197
1178
  "table-row": V((S) => [
1198
1179
  k(ns, {
1199
1180
  "compare-price-by-sku": e(_),
1200
- "show-compare-price": w.value === e($).PURCHASE && e(H),
1181
+ "show-compare-price": w.value === e(I).PURCHASE && e(N),
1201
1182
  row: S
1202
1183
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1203
1184
  ]),
1204
1185
  "list-row": V((S) => [
1205
- (P(), j(vt, {
1186
+ (P(), z(vt, {
1206
1187
  row: S,
1207
- key: e(t).items.map((Pe) => Pe.sku._id).join(".")
1188
+ key: e(t).items.map((Se) => Se.sku._id).join(".")
1208
1189
  }, {
1209
- default: V((Pe) => [
1190
+ default: V((Se) => [
1210
1191
  k(Bt, {
1211
1192
  "compare-price-by-sku": e(_),
1212
- "show-compare-price": w.value === e($).PURCHASE && e(H),
1193
+ "show-compare-price": w.value === e(I).PURCHASE && e(N),
1213
1194
  row: S,
1214
- "cell-by-col-id": Pe
1195
+ "cell-by-col-id": Se
1215
1196
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1216
1197
  ]),
1217
1198
  _: 2
@@ -1237,9 +1218,9 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1237
1218
  lastClosingDate: {}
1238
1219
  },
1239
1220
  emits: ["update:show", "submitted"],
1240
- setup(o, { expose: f, emit: r }) {
1241
- var G;
1242
- const n = o, v = r, t = Ee(), l = $e(), x = he(), p = Ve(), s = De(), { t: a } = de(), y = L(!1), u = L(!1), c = L(!1);
1221
+ setup(o, { expose: m, emit: r }) {
1222
+ var J;
1223
+ const n = o, v = r, t = Ee(), l = Ie(), x = he(), c = De(), s = Ae(), { t: a } = de(), f = L(!1), u = L(!1), p = L(!1);
1243
1224
  async function C(_) {
1244
1225
  if (_) {
1245
1226
  u.value = !1;
@@ -1288,26 +1269,26 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1288
1269
  template: n.templateId
1289
1270
  };
1290
1271
  }
1291
- const h = Ge(n, "show"), w = L(n.modelValue ?? b()), O = L(((G = n.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
1272
+ const h = Je(n, "show"), w = L(n.modelValue ?? b()), O = L(((J = n.modelValue) == null ? void 0 : J._id) ?? `${Math.random()}`);
1292
1273
  Me(
1293
1274
  () => n.show,
1294
1275
  (_) => {
1295
1276
  var g;
1296
- _ && (c.value = !1, w.value = n.modelValue ?? b(), O.value = ((g = n.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1277
+ _ && (p.value = !1, w.value = n.modelValue ?? b(), O.value = ((g = n.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1297
1278
  }
1298
1279
  );
1299
- const B = T(() => !u.value || !c.value), J = T(() => {
1280
+ const B = F(() => !u.value || !p.value), X = F(() => {
1300
1281
  switch (n.mode) {
1301
- case fe.READ:
1282
+ case pe.READ:
1302
1283
  return "View transfer";
1303
- case fe.CREATE:
1284
+ case pe.CREATE:
1304
1285
  return a("inventory.transfer.receiveRequest.create.title");
1305
- case fe.UPDATE:
1286
+ case pe.UPDATE:
1306
1287
  return a("inventory.transfer.receiveRequest.update.title");
1307
1288
  }
1308
1289
  return "";
1309
1290
  }), U = L();
1310
- f({
1291
+ m({
1311
1292
  validateInputs: () => {
1312
1293
  var _, g;
1313
1294
  (g = (_ = U.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
@@ -1321,9 +1302,9 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1321
1302
  (g = (_ = U.value) == null ? void 0 : _.resetInputs) == null || g.call(_);
1322
1303
  }
1323
1304
  });
1324
- async function Y() {
1305
+ async function W() {
1325
1306
  const _ = w.value;
1326
- y.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1307
+ f.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1327
1308
  try {
1328
1309
  await t.createPurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), l.open({
1329
1310
  title: a("inventory.transfer.receiveRequest.create.success"),
@@ -1337,12 +1318,12 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1337
1318
  type: "error"
1338
1319
  }), console.error("Error in creating purchase order", g);
1339
1320
  } finally {
1340
- y.value = !1;
1321
+ f.value = !1;
1341
1322
  }
1342
1323
  }
1343
1324
  async function K() {
1344
1325
  const _ = w.value;
1345
- y.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1326
+ f.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1346
1327
  try {
1347
1328
  await t.updatePurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), l.open({
1348
1329
  title: a("inventory.transfer.receiveRequest.update.success"),
@@ -1356,47 +1337,47 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1356
1337
  type: "error"
1357
1338
  }), console.error("Error in updating purchase order", g);
1358
1339
  } finally {
1359
- y.value = !1;
1340
+ f.value = !1;
1360
1341
  }
1361
1342
  }
1362
- function N() {
1343
+ function q() {
1363
1344
  switch (n.mode) {
1364
- case fe.CREATE:
1365
- return Y();
1366
- case fe.UPDATE:
1345
+ case pe.CREATE:
1346
+ return W();
1347
+ case pe.UPDATE:
1367
1348
  return K();
1368
1349
  }
1369
1350
  }
1370
- function H() {
1351
+ function N() {
1371
1352
  var _, g;
1372
1353
  (g = (_ = U.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
1373
1354
  }
1374
1355
  return (_, g) => {
1375
- const M = I("FmButton"), oe = I("FmSideSheet");
1376
- return P(), j(oe, {
1356
+ const M = T("FmButton"), oe = T("FmSideSheet");
1357
+ return P(), z(oe, {
1377
1358
  modelValue: e(h),
1378
- "onUpdate:modelValue": g[3] || (g[3] = (Z) => ie(h) ? h.value = Z : null),
1359
+ "onUpdate:modelValue": g[3] || (g[3] = (Y) => ie(h) ? h.value = Y : null),
1379
1360
  "dismiss-away": "",
1380
1361
  "close-button": "",
1381
1362
  "max-width": 900
1382
1363
  }, {
1383
1364
  "side-sheet-header": V(() => [
1384
1365
  d("div", hs, [
1385
- d("div", ws, D(J.value), 1)
1366
+ d("div", ws, A(X.value), 1)
1386
1367
  ])
1387
1368
  ]),
1388
1369
  default: V(() => [
1389
- (P(), j(ks, {
1370
+ (P(), z(ks, {
1390
1371
  class: "w-full",
1391
1372
  ref_key: "formRef",
1392
1373
  ref: U,
1393
- "onForm:ready": g[0] || (g[0] = () => c.value = !0),
1394
- onValidationSuccess: N,
1374
+ "onForm:ready": g[0] || (g[0] = () => p.value = !0),
1375
+ onValidationSuccess: q,
1395
1376
  modelValue: w.value,
1396
- "onUpdate:modelValue": g[1] || (g[1] = (Z) => w.value = Z),
1397
- disabled: y.value || B.value,
1377
+ "onUpdate:modelValue": g[1] || (g[1] = (Y) => w.value = Y),
1378
+ disabled: f.value || B.value,
1398
1379
  suppliers: e(x).suppliers,
1399
- skus: e(p).skus,
1380
+ skus: e(c).skus,
1400
1381
  key: O.value,
1401
1382
  "last-closing-date": _.lastClosingDate
1402
1383
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
@@ -1404,16 +1385,16 @@ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }
1404
1385
  "side-sheet-footer": V(() => [
1405
1386
  d("div", xs, [
1406
1387
  k(M, {
1407
- loading: y.value,
1388
+ loading: f.value,
1408
1389
  disabled: B.value,
1409
1390
  label: e(a)("common.save"),
1410
- onClick: H
1391
+ onClick: N
1411
1392
  }, null, 8, ["loading", "disabled", "label"]),
1412
1393
  k(M, {
1413
1394
  disabled: B.value,
1414
1395
  variant: "tertiary",
1415
1396
  label: e(a)("common.close"),
1416
- onClick: g[2] || (g[2] = (Z) => v("update:show", !1))
1397
+ onClick: g[2] || (g[2] = (Y) => v("update:show", !1))
1417
1398
  }, null, 8, ["disabled", "label"])
1418
1399
  ])
1419
1400
  ]),