@feedmepos/mf-inventory-portal 0.0.21-dev.7 → 0.0.22-dev.1

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 (50) hide show
  1. package/dist/{ApprovalView-BYJfdiYM.js → ApprovalView-CtH8I01g.js} +4 -4
  2. package/dist/{BindingsDialog-BryZK4Tg.js → BindingsDialog-DFrk_fyd.js} +1 -1
  3. package/dist/{BindingsPicker-IWAltg_U.js → BindingsPicker-400gISaV.js} +1 -1
  4. package/dist/{BindingsTable-DDwukKAy.js → BindingsTable-CnFKI6iP.js} +1 -1
  5. package/dist/ClosingTemplateView--8m8cua_.js +919 -0
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CLBgszfX.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-B9RU_arW.js} +1 -1
  7. package/dist/{IngredientsView-DgSzNCNX.js → IngredientsView-CRTAgKJz.js} +3 -3
  8. package/dist/{IntegrationView-BtXzjG3j.js → IntegrationView-CNFTKqjk.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-sPzZAvKH.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-VkiVLx1K.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DkZrgqyr.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-Ke1-hYgN.js → PurchaseOrderPrintPreview-CJli-_Vn.js} +1 -1
  12. package/dist/{ReceiveRequestView-CE9BFQn3.js → ReceiveRequestView-DV_GDzJG.js} +6 -6
  13. package/dist/{RecipeView-K3f9W_AV.js → RecipeView-CTm_7oNG.js} +3 -3
  14. package/dist/{StockView-BH3wK8AT.js → StockView-DtHT2ulM.js} +6 -6
  15. package/dist/{SupplierView-DwVN-3IQ.js → SupplierView-B9A5R2Vm.js} +3 -3
  16. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-B0Vdby5t.js → TransferDetails.vue_vue_type_script_setup_true_lang-mUNCQTNw.js} +40 -39
  17. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-DijNNVgt.js → TransferDialog.vue_vue_type_script_setup_true_lang-BwkUuXqj.js} +493 -501
  18. package/dist/{TransferTemplateView-ikRXcgOO.js → TransferTemplateView-DnyenkGu.js} +454 -498
  19. package/dist/{UnitView-yexlK1KM.js → UnitView-BL-jtVuZ.js} +4 -4
  20. package/dist/{WarehouseView-BjBJrjbZ.js → WarehouseView-BkUv1792.js} +2 -2
  21. package/dist/api/closing-template.d.ts +7 -0
  22. package/dist/{app-BD7MP1Oe.js → app-C-z1MfF6.js} +3992 -3929
  23. package/dist/app.d.ts +35 -0
  24. package/dist/app.js +1 -1
  25. package/dist/{decimal-Ct-e_mRV.js → decimal-DZz-_lgE.js} +1 -1
  26. package/dist/defineDeepModel-7VQajdPt.js +13 -0
  27. package/dist/format-time-from-id-9XFszs1J.js +15 -0
  28. package/dist/{id-to-date-Chhy1kB3.js → id-to-date-Bkue77uI.js} +1 -1
  29. package/dist/layout/layout-routes.d.ts +0 -1
  30. package/dist/{purchase-order-transaction-type-Bqu6bNsx.js → purchase-order-transaction-type-DHzMBgFs.js} +90 -101
  31. package/dist/router/name.d.ts +1 -0
  32. package/dist/style.css +1 -1
  33. package/dist/{supplier-DErisCtS.js → supplier-C6YWXF2Y.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/use-template-enabled-locations-CFCfbaOd.js +57 -0
  36. package/dist/views/closing-template/ClosingTemplateView.vue.d.ts +2 -0
  37. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetails.vue.d.ts +2 -0
  38. package/dist/views/closing-template/components/closing-template-details/ClosingTemplateDetailsProps.d.ts +8 -0
  39. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialog.vue.d.ts +22 -0
  40. package/dist/views/closing-template/components/closing-template-dialog/ClosingTemplateDialogProps.d.ts +10 -0
  41. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateForm.vue.d.ts +16 -0
  42. package/dist/views/closing-template/components/closing-template-form/ClosingTemplateFormProps.d.ts +7 -0
  43. package/dist/views/closing-template/components/closing-template-form/components/ClosingTemplateItem.vue.d.ts +18 -0
  44. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +79 -0
  45. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +2165 -0
  46. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +2084 -0
  47. package/dist/views/transfer-template/components/transfer-template-details/TransferTemplateDetails.vue.d.ts +1 -1
  48. package/dist/{xlsx-DyScN5Bf.js → xlsx-Dl6dAHFx.js} +1 -1
  49. package/dist/{xlsx.util-DEyeAnEa.js → xlsx.util-C1tUhDb8.js} +2 -2
  50. package/package.json +3 -3
@@ -1,23 +1,24 @@
1
- import { reactive as Ee, onMounted as Le, computed as P, h as E, getCurrentInstance as Oe, watch as $e, defineComponent as se, openBlock as I, createElementBlock as A, Fragment as ve, renderList as Pe, createElementVNode as d, toDisplayString as D, unref as e, resolveComponent as T, createVNode as k, withCtx as V, createCommentVNode as z, ref as L, createBlock as j, normalizeClass as Te, normalizeStyle as Ze, isRef as ie } from "vue";
2
- import { useBreakpoints as Ke, components as re, FmButtonVariant as Qe, useSnackbar as Ae, useDialog as Ge, useProxiedModel as Je } from "@feedmepos/ui-library";
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
3
  import { F as fe } from "./row-action.enum-PMKMRrZR.js";
4
- import { P as $, e as qe, d as Xe } from "./purchase-order-transaction-type-Bqu6bNsx.js";
5
- import { a as W, t as et, a8 as Fe, D as tt, b as Ne, R as Be, a2 as st, a3 as ot, r as nt, a4 as Ue, G as He, l as at, A as ke, M as lt, a9 as ze, c as rt, aa as it, O as De, P as je, ab as ut, j as Ve, ac as dt, u as Re, ad as ct, ae as pt, af as mt, E as ft, ag as yt, y as vt } from "./app-BD7MP1Oe.js";
6
- import { _ as We, u as bt } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BYX1ubPe.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";
7
7
  import { useI18n as de } from "@feedmepos/mf-common";
8
8
  import "vue-router";
9
- import { u as he } from "./supplier-DErisCtS.js";
10
- import { F as ue, _ as gt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
11
- import { _ as _t } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
12
- function te(s, m, r, n) {
9
+ import { u as he } from "./supplier-C6YWXF2Y.js";
10
+ import { d as yt } from "./defineDeepModel-7VQajdPt.js";
11
+ import { F as ue, _ as vt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
+ import { _ as bt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
+ function te(o, f, r, n) {
13
14
  var u, c, C;
14
15
  if (n != null && n.manualTotalCost)
15
16
  return n == null ? void 0 : n.manualTotalCost;
16
- const f = (C = (c = (u = n == null ? void 0 : n.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : c.find(
17
- (b) => b.skuId === s._id
18
- )) == null ? void 0 : C.defaultCost, t = s.defaultCost, a = f ?? t, x = a == null ? void 0 : a.costPerUnit, p = x ? a != null && a.measurement ? +W(x) / +W(a == null ? void 0 : a.measurement.conversion) : +W(x) : void 0, o = p ? r ? p * +W(r.conversion) : p : void 0, l = o ? +W(m) * o : void 0;
19
- return l ? {
20
- ...et(l ?? 0, 2),
17
+ const v = (C = (c = (u = n == null ? void 0 : n.supplier) == null ? void 0 : u.supplyItems) == null ? void 0 : c.find(
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;
20
+ return a ? {
21
+ ...Xe(a ?? 0, 2),
21
22
  currency: Fe()
22
23
  } : {
23
24
  amount: 0,
@@ -25,52 +26,52 @@ function te(s, m, r, n) {
25
26
  currency: Fe()
26
27
  };
27
28
  }
28
- var R = /* @__PURE__ */ ((s) => (s.Code = "Code", s.Name = "Name", s.Amount = "Amount", s.Cost = "Cost", s.Delete = "Delete", s))(R || {});
29
- const Ct = () => {
30
- const { t: s } = de();
29
+ var R = /* @__PURE__ */ ((o) => (o.Code = "Code", o.Name = "Name", o.Amount = "Amount", o.Cost = "Cost", o.Delete = "Delete", o))(R || {});
30
+ const _t = () => {
31
+ const { t: o } = de();
31
32
  return E(
32
- We,
33
+ ze,
33
34
  {
34
35
  zIndex: 50,
35
36
  class: "whitespace-nowrap"
36
37
  },
37
- s("inventory.transfer.form.items.table.Cost", [ze()])
38
+ o("inventory.transfer.form.items.table.Cost", [Ne()])
38
39
  );
39
40
  };
40
- function kt(s) {
41
- const { t: m } = de(), r = Ee({}), { breakpoints: n } = Ke(), f = Ne();
42
- Le(() => {
43
- for (const p of s.items) {
41
+ function gt(o) {
42
+ const { t: f } = de(), r = We({}), { breakpoints: n } = Ze(), v = Le();
43
+ Ue(() => {
44
+ for (const p of o.items) {
44
45
  if (!p.totalCost)
45
46
  continue;
46
- const o = te(p.sku, p.quantity, p.measurement, {
47
- supplier: s.supplier
48
- }), l = p.totalCost ?? tt.reset();
49
- o ? r[p.sku._id] = o.amount !== l.amount || o.precision !== l.precision : r[p.sku._id] = !0;
47
+ const s = te(p.sku, p.quantity, p.measurement, {
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;
50
51
  }
51
52
  });
52
53
  function t(p) {
53
- var l, v, u, c, C, b, h;
54
- return !!(((v = (l = p.defaultCost) == null ? void 0 : l.costPerUnit) == null ? void 0 : v.amount) ?? ((h = (b = (C = (c = (u = s.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));
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));
55
56
  }
56
- const a = [
57
+ const l = [
57
58
  {
58
59
  id: "Code",
59
- header: () => m("inventory.transfer.form.items.table.Code"),
60
+ header: () => f("inventory.transfer.form.items.table.Code"),
60
61
  accessorKey: "code",
61
62
  size: 96,
62
63
  cell(p) {
63
- const o = p.row.original;
64
+ const s = p.row.original;
64
65
  return E(re.FmTextField, {
65
- modelValue: o.code,
66
- "onUpdate:modelValue": (l) => {
67
- s.updateItem({
68
- ...o,
69
- code: l
66
+ modelValue: s.code,
67
+ "onUpdate:modelValue": (a) => {
68
+ o.updateItem({
69
+ ...s,
70
+ code: a
70
71
  });
71
72
  },
72
- key: o.sku._id,
73
- rules: [Be()],
73
+ key: s.sku._id,
74
+ rules: [Re()],
74
75
  labelMark: "required"
75
76
  });
76
77
  },
@@ -78,20 +79,20 @@ function kt(s) {
78
79
  },
79
80
  {
80
81
  id: "Name",
81
- header: () => m("inventory.transfer.form.items.table.Name"),
82
+ header: () => f("inventory.transfer.form.items.table.Name"),
82
83
  minSize: 300,
83
84
  cell(p) {
84
- const o = p.row.original;
85
+ const s = p.row.original;
85
86
  return E(re.FmTextField, {
86
- modelValue: o.name,
87
- "onUpdate:modelValue": (l) => {
88
- s.updateItem({
89
- ...o,
90
- name: l
87
+ modelValue: s.name,
88
+ "onUpdate:modelValue": (a) => {
89
+ o.updateItem({
90
+ ...s,
91
+ name: a
91
92
  });
92
93
  },
93
- key: o.sku._id,
94
- rules: [Be()],
94
+ key: s.sku._id,
95
+ rules: [Re()],
95
96
  labelMark: "required"
96
97
  });
97
98
  },
@@ -99,52 +100,52 @@ function kt(s) {
99
100
  },
100
101
  {
101
102
  id: "Amount",
102
- header: () => m("inventory.transfer.form.items.table.Amount"),
103
+ header: () => f("inventory.transfer.form.items.table.Amount"),
103
104
  minSize: 200,
104
105
  cell(p) {
105
- var v, u, c;
106
- const o = p.row.original, l = (c = (u = (v = s.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : u.items) == null ? void 0 : c.find(
107
- (C) => C.sku._id === o.sku._id
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(
108
+ (C) => C.sku._id === s.sku._id
108
109
  );
109
- return E(st, {
110
+ return E(tt, {
110
111
  style: {
111
112
  flex: "1 1 0%"
112
113
  },
113
114
  modelValue: {
114
- amount: o.quantity ?? { amount: 1, precision: 0 },
115
- measurement: o.measurement ?? null
115
+ amount: s.quantity ?? { amount: 1, precision: 0 },
116
+ measurement: s.measurement ?? null
116
117
  },
117
- key: o.sku._id,
118
- unit: o.sku.unit,
118
+ key: s.sku._id,
119
+ unit: s.sku.unit,
119
120
  "onUpdate:modelValue": (C) => {
120
121
  const b = {
121
- ...o,
122
+ ...s,
122
123
  quantity: C.amount,
123
124
  measurement: C.measurement
124
125
  };
125
- f.enableTotalCost && (b.totalCost = te(o.sku, o.quantity, o.measurement, {
126
- supplier: s.supplier,
126
+ v.enableTotalCost && (b.totalCost = te(s.sku, s.quantity, s.measurement, {
127
+ supplier: o.supplier,
127
128
  // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
128
129
  // will return the auto calculated default cost instead of the manual total cost
129
- manualTotalCost: r[o.sku._id] ? b.totalCost : void 0
130
- })), s.updateItem(b);
130
+ manualTotalCost: r[s.sku._id] ? b.totalCost : void 0
131
+ })), o.updateItem(b);
131
132
  },
132
- stepperOnly: !!(l != null && l.quantityStep),
133
- stepper: l == null ? void 0 : l.quantityStep,
134
- disableUnit: !!l,
135
- disabled: s.disabled,
133
+ stepperOnly: !!(a != null && a.quantityStep),
134
+ stepper: a == null ? void 0 : a.quantityStep,
135
+ disableUnit: !!a,
136
+ disabled: o.disabled,
136
137
  rules: [
137
- ot(
138
+ st(
138
139
  +W(
139
- (l == null ? void 0 : l.minimumQuantity) ?? {
140
+ (a == null ? void 0 : a.minimumQuantity) ?? {
140
141
  amount: 1,
141
- precision: nt(o.sku.unit, o.measurement)
142
+ precision: ot(s.sku.unit, s.measurement)
142
143
  }
143
144
  )
144
145
  ),
145
- l != null && l.maximumQuantity ? Ue(
146
- +W(l == null ? void 0 : l.maximumQuantity)
147
- ) : Ue(1 / 0)
146
+ a != null && a.maximumQuantity ? Oe(
147
+ +W(a == null ? void 0 : a.maximumQuantity)
148
+ ) : Oe(1 / 0)
148
149
  ],
149
150
  applyDefaultRules: !0
150
151
  });
@@ -153,31 +154,31 @@ function kt(s) {
153
154
  },
154
155
  {
155
156
  id: "Cost",
156
- header: Ct,
157
+ header: _t,
157
158
  size: 180,
158
159
  cell(p) {
159
- const o = p.row.original, l = t(o.sku), v = n.value.xs || n.value.sm;
160
- return !r[o.sku._id] && l ? E(
160
+ const s = p.row.original, a = t(s.sku), y = n.value.xs || n.value.sm;
161
+ return !r[s.sku._id] && a ? E(
161
162
  "div",
162
163
  {
163
164
  class: [
164
165
  "flex gap-4 fm-typo-en-body-md-400 items-center",
165
- s.disabled ? "text-fm-color-typo-disabled" : ""
166
+ o.disabled ? "text-fm-color-typo-disabled" : ""
166
167
  ],
167
- key: o.sku._id
168
+ key: s.sku._id
168
169
  },
169
170
  [
170
171
  E(re.FmButton, {
171
172
  prependIcon: "edit",
172
173
  variant: Qe.Tertiary,
173
- disabled: s.disabled,
174
+ disabled: o.disabled,
174
175
  onClick() {
175
- s.updateItem({
176
- ...o,
177
- totalCost: te(o.sku, o.quantity, o.measurement, {
178
- supplier: s.supplier
176
+ o.updateItem({
177
+ ...s,
178
+ totalCost: te(s.sku, s.quantity, s.measurement, {
179
+ supplier: o.supplier
179
180
  })
180
- }), r[o.sku._id] = !0;
181
+ }), r[s.sku._id] = !0;
181
182
  }
182
183
  }),
183
184
  E(
@@ -188,13 +189,13 @@ function kt(s) {
188
189
  [
189
190
  E(
190
191
  "span",
191
- v ? He(
192
- te(o.sku, o.quantity, o.measurement, {
193
- supplier: s.supplier
192
+ y ? qe(
193
+ te(s.sku, s.quantity, s.measurement, {
194
+ supplier: o.supplier
194
195
  })
195
196
  ) : W(
196
- te(o.sku, o.quantity, o.measurement, {
197
- supplier: s.supplier
197
+ te(s.sku, s.quantity, s.measurement, {
198
+ supplier: o.supplier
198
199
  })
199
200
  )
200
201
  ),
@@ -203,10 +204,10 @@ function kt(s) {
203
204
  {
204
205
  class: [
205
206
  "fm-typo-en-body-sm-400",
206
- s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
207
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
207
208
  ]
208
209
  },
209
- m("inventory.transfer.form.items.autoCalculated")
210
+ f("inventory.transfer.form.items.autoCalculated")
210
211
  )
211
212
  ]
212
213
  )
@@ -214,46 +215,46 @@ function kt(s) {
214
215
  ) : E(
215
216
  re.FmTextField,
216
217
  {
217
- modelValue: W(o.totalCost ?? { amount: 0, precision: 0 }),
218
- key: o.sku._id,
218
+ modelValue: W(s.totalCost ?? { amount: 0, precision: 0 }),
219
+ key: s.sku._id,
219
220
  "onUpdate:modelValue": (u) => {
220
- s.updateItem({
221
- ...o,
221
+ o.updateItem({
222
+ ...s,
222
223
  totalCost: {
223
- ...at(+u),
224
+ ...nt(+u),
224
225
  currency: Fe()
225
226
  }
226
227
  });
227
228
  },
228
- rules: [ke(0), lt(2)]
229
+ rules: [ke(0), at(2)]
229
230
  },
230
231
  {
231
232
  prepend() {
232
- return v ? E(
233
+ return y ? E(
233
234
  "div",
234
235
  {
235
236
  class: [
236
237
  "text-fm-typo-en-body-lg-400",
237
- s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
238
+ o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
238
239
  ]
239
240
  },
240
- ze()
241
+ Ne()
241
242
  ) : null;
242
243
  },
243
244
  append() {
244
- return l ? E(re.FmButton, {
245
+ return a ? E(re.FmButton, {
245
246
  prependIcon: "close",
246
247
  variant: "tertiary",
247
- disabled: s.disabled,
248
+ disabled: o.disabled,
248
249
  onClick() {
249
- s.updateItem({
250
- ...o,
250
+ o.updateItem({
251
+ ...s,
251
252
  // NOTE: different from PO template, if a default cost is reenabled,
252
253
  // the total cost will automatically assigned
253
- totalCost: te(o.sku, o.quantity, o.measurement, {
254
- supplier: s.supplier
254
+ totalCost: te(s.sku, s.quantity, s.measurement, {
255
+ supplier: o.supplier
255
256
  })
256
- }), r[o.sku._id] = !1;
257
+ }), r[s.sku._id] = !1;
257
258
  }
258
259
  }) : null;
259
260
  }
@@ -266,17 +267,17 @@ function kt(s) {
266
267
  id: "Delete",
267
268
  header: "",
268
269
  cell(p) {
269
- const o = p.row.original;
270
+ const s = p.row.original;
270
271
  return E(re.FmButton, {
271
- key: o.sku._id,
272
+ key: s.sku._id,
272
273
  class: "delete-button",
273
274
  type: "button",
274
275
  icon: "delete",
275
276
  variant: "tertiary",
276
277
  size: "md",
277
- disabled: s.disabled,
278
+ disabled: o.disabled,
278
279
  onClick: () => {
279
- s.deleteItem(o);
280
+ o.deleteItem(s);
280
281
  }
281
282
  });
282
283
  },
@@ -289,55 +290,47 @@ function kt(s) {
289
290
  }
290
291
  ];
291
292
  return {
292
- columnDefs: P(() => f.enableTotalCost && s.transferType === $.PURCHASE ? a : a.filter(
293
+ columnDefs: T(() => v.enableTotalCost && o.transferType === $.PURCHASE ? l : l.filter(
293
294
  (p) => p.id !== "Cost"
294
295
  /* Cost */
295
296
  ))
296
297
  };
297
298
  }
298
- function ht(s = "modelValue") {
299
- var t, a;
300
- const m = ((t = Oe()) == null ? void 0 : t.props) ?? {}, r = ((a = Oe()) == null ? void 0 : a.emit) ?? (() => {
301
- }), n = Ee(rt(m[s] ?? {})), f = `update:${it(s)}`;
302
- return $e(n, (x) => {
303
- r(f, x);
304
- }), n;
305
- }
306
- const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, xt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, St = { class: "w-[450px] xs:w-full flex" }, It = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Pt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ se({
299
+ const Ct = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, kt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, ht = { class: "w-[450px] xs:w-full flex" }, wt = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, xt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, je = /* @__PURE__ */ se({
307
300
  __name: "SupplierPriceHistory",
308
301
  props: {
309
302
  prices: {}
310
303
  },
311
- setup(s) {
312
- const m = he();
304
+ setup(o) {
305
+ const f = he();
313
306
  function r(n) {
314
- return m.suppliers.find((f) => f._id === n);
307
+ return f.suppliers.find((v) => v._id === n);
315
308
  }
316
- return (n, f) => (I(), A("div", wt, [
317
- (I(!0), A(ve, null, Pe(Object.keys(n.prices), (t) => {
318
- var a;
319
- return I(), A("div", {
309
+ return (n, v) => (P(), A("div", Ct, [
310
+ (P(!0), A(ve, null, Te(Object.keys(n.prices), (t) => {
311
+ var l;
312
+ return P(), A("div", {
320
313
  key: t,
321
314
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
322
315
  }, [
323
- d("div", xt, D((a = r(t)) == null ? void 0 : a.name), 1),
324
- d("div", St, [
325
- (I(!0), A(ve, null, Pe(n.prices[t].slice(0, 3), (x) => {
316
+ d("div", kt, D((l = r(t)) == null ? void 0 : l.name), 1),
317
+ d("div", ht, [
318
+ (P(!0), A(ve, null, Te(n.prices[t].slice(0, 3), (x) => {
326
319
  var p;
327
- return I(), A("div", {
320
+ return P(), A("div", {
328
321
  key: x.date,
329
322
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
330
323
  }, [
331
- d("div", It, [
332
- d("span", null, D(x.totalCost ? e(He)(x.totalCost) : "No data"), 1),
333
- f[0] || (f[0] = d("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
324
+ d("div", wt, [
325
+ d("span", null, D(x.totalCost ? e(qe)(x.totalCost) : "No data"), 1),
326
+ v[0] || (v[0] = d("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
334
327
  d("span", null, D(e(W)(x.totalUnit, !1)), 1),
335
328
  d("span", null, D(((p = x.measurement) == null ? void 0 : p.abbrev) ?? x.unit.abbrev), 1)
336
329
  ]),
337
- d("div", Pt, [
330
+ d("div", xt, [
338
331
  d("span", null, "(#" + D(x.seqNumber) + ")", 1),
339
- f[1] || (f[1] = d("span", null, D(" "), -1)),
340
- d("span", null, D(e(De)(new Date(x.date))), 1)
332
+ v[1] || (v[1] = d("span", null, D(" "), -1)),
333
+ d("span", null, D(e(Ae)(new Date(x.date))), 1)
341
334
  ])
342
335
  ]);
343
336
  }), 128))
@@ -346,10 +339,10 @@ const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
346
339
  }), 128))
347
340
  ]));
348
341
  }
349
- }), Tt = { class: "flex flex-col gap-8 py-16" }, Ft = { class: "flex items-center" }, $t = { class: "flex-1 flex gap-1 items-center" }, At = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Dt = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vt = { class: "flex gap-8 w-full" }, Rt = { class: "flex-1 flex flex-col gap-4" }, Ot = { class: "flex-1 flex flex-col gap-4" }, Bt = { class: "flex gap-8 w-full" }, Ut = { class: "flex-1 flex flex-col gap-4" }, Mt = {
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 = {
350
343
  key: 0,
351
344
  class: "flex-1 flex flex-col gap-4"
352
- }, Et = /* @__PURE__ */ se({
345
+ }, Bt = /* @__PURE__ */ se({
353
346
  __name: "TransferItem",
354
347
  props: {
355
348
  cellByColId: {},
@@ -357,38 +350,38 @@ const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
357
350
  showComparePrice: { type: Boolean },
358
351
  row: {}
359
352
  },
360
- setup(s) {
361
- const { t: m } = de();
353
+ setup(o) {
354
+ const { t: f } = de();
362
355
  return (r, n) => {
363
- var a, x, p, o, l, v, u, c, C, b, h, w, O, B, J, U, Y, Q, N, H, G, g, _, M, oe, Z, we;
364
- const f = T("FmLabel"), t = T("FmSpacer");
365
- return I(), A("div", Tt, [
366
- d("div", Ft, [
367
- d("div", $t, [
368
- d("span", At, " (" + D(r.row.original.sku.code) + ") ", 1),
369
- d("span", Dt, D(r.row.original.sku.name), 1)
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, [
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)
370
363
  ]),
371
364
  d("div", null, [
372
365
  k(e(ue), {
373
- render: (p = (x = (a = r.cellByColId.Delete) == null ? void 0 : a.column) == null ? void 0 : x.columnDef) == null ? void 0 : p.cell,
374
- props: (l = (o = r.cellByColId.Delete) == null ? void 0 : o.getContext) == null ? void 0 : l.call(o)
366
+ render: (p = (x = (l = r.cellByColId.Delete) == null ? void 0 : l.column) == null ? void 0 : x.columnDef) == null ? void 0 : p.cell,
367
+ props: (a = (s = r.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
375
368
  }, null, 8, ["render", "props"])
376
369
  ])
377
370
  ]),
378
- d("div", Vt, [
379
- d("div", Rt, [
380
- k(f, {
381
- label: e(m)(`inventory.transfer.form.items.table.${e(R).Code}`)
371
+ d("div", $t, [
372
+ d("div", At, [
373
+ k(v, {
374
+ label: e(f)(`inventory.transfer.form.items.table.${e(R).Code}`)
382
375
  }, null, 8, ["label"]),
383
376
  k(e(ue), {
384
- render: (c = (u = (v = r.cellByColId[e(R).Code]) == null ? void 0 : v.column) == null ? void 0 : u.columnDef) == null ? void 0 : c.cell,
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,
385
378
  props: (b = (C = r.cellByColId[e(R).Code]) == null ? void 0 : C.getContext) == null ? void 0 : b.call(C)
386
379
  }, null, 8, ["render", "props"]),
387
380
  n[0] || (n[0] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
388
381
  ]),
389
- d("div", Ot, [
390
- k(f, {
391
- label: e(m)(`inventory.transfer.form.items.table.${e(R).Name}`)
382
+ d("div", Dt, [
383
+ k(v, {
384
+ label: e(f)(`inventory.transfer.form.items.table.${e(R).Name}`)
392
385
  }, null, 8, ["label"]),
393
386
  k(e(ue), {
394
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,
@@ -397,36 +390,36 @@ const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
397
390
  n[1] || (n[1] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
398
391
  ])
399
392
  ]),
400
- d("div", Bt, [
401
- d("div", Ut, [
402
- k(f, {
403
- label: e(m)(`inventory.transfer.form.items.table.${e(R).Amount}`)
393
+ d("div", Vt, [
394
+ d("div", Rt, [
395
+ k(v, {
396
+ label: e(f)(`inventory.transfer.form.items.table.${e(R).Amount}`)
404
397
  }, null, 8, ["label"]),
405
398
  k(e(ue), {
406
- render: (Q = (Y = (U = r.cellByColId[e(R).Amount]) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : Q.cell,
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,
407
400
  props: (H = (N = r.cellByColId[e(R).Amount]) == null ? void 0 : N.getContext) == null ? void 0 : H.call(N)
408
401
  }, null, 8, ["render", "props"]),
409
402
  n[2] || (n[2] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
410
403
  ]),
411
- r.cellByColId[e(R).Cost] ? (I(), A("div", Mt, [
412
- k(We, { "z-index": 50 }, {
404
+ r.cellByColId[e(R).Cost] ? (P(), A("div", Ot, [
405
+ k(ze, { "z-index": 50 }, {
413
406
  default: V(() => [
414
- k(f, {
415
- label: e(m)(`inventory.transfer.form.items.table.${e(R).Cost}2`)
407
+ k(v, {
408
+ label: e(f)(`inventory.transfer.form.items.table.${e(R).Cost}2`)
416
409
  }, null, 8, ["label"])
417
410
  ]),
418
411
  _: 1
419
412
  }),
420
413
  k(e(ue), {
421
- render: (_ = (g = (G = r.cellByColId[e(R).Cost]) == null ? void 0 : G.column) == null ? void 0 : g.columnDef) == null ? void 0 : _.cell,
414
+ render: (g = (_ = (G = r.cellByColId[e(R).Cost]) == null ? void 0 : G.column) == null ? void 0 : _.columnDef) == null ? void 0 : g.cell,
422
415
  props: (oe = (M = r.cellByColId[e(R).Cost]) == null ? void 0 : M.getContext) == null ? void 0 : oe.call(M)
423
416
  }, null, 8, ["render", "props"]),
424
417
  n[3] || (n[3] = d("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
425
418
  ])) : z("", !0)
426
419
  ]),
427
- r.showComparePrice && Object.keys(r.comparePriceBySku[(Z = r.row.original.sku) == null ? void 0 : Z._id] ?? {}).length > 0 ? (I(), A(ve, { key: 0 }, [
420
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(Z = r.row.original.sku) == null ? void 0 : Z._id] ?? {}).length > 0 ? (P(), A(ve, { key: 0 }, [
428
421
  k(t, { class: "h-8" }),
429
- k(Ye, {
422
+ k(je, {
430
423
  prices: r.comparePriceBySku[(we = r.row.original.sku) == null ? void 0 : we._id]
431
424
  }, null, 8, ["prices"])
432
425
  ], 64)) : z("", !0)
@@ -434,64 +427,64 @@ const wt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
434
427
  };
435
428
  }
436
429
  });
437
- function ye(s) {
438
- return ut.parse(s);
430
+ function ye(o) {
431
+ return lt.parse(o);
439
432
  }
440
- function Ce(s) {
433
+ function Ce(o) {
441
434
  return {
442
- _id: s.doc._id,
443
- internal: s.type,
444
- contactName: s.doc.profile.name,
445
- name: s.doc.profile.name,
446
- email: s.doc.profile.email,
447
- phoneNumber: s.doc.profile.phoneNo,
448
- registrationNumber: s.doc.profile.regNo,
449
- address: s.doc.profile.address
435
+ _id: o.doc._id,
436
+ internal: o.type,
437
+ contactName: o.doc.profile.name,
438
+ name: o.doc.profile.name,
439
+ email: o.doc.profile.email,
440
+ phoneNumber: o.doc.profile.phoneNo,
441
+ registrationNumber: o.doc.profile.regNo,
442
+ address: o.doc.profile.address
450
443
  };
451
444
  }
452
- function Lt(s, m) {
453
- const r = he(), n = Ve(), f = P(() => !n.businessLevel);
445
+ function Ut(o, f) {
446
+ const r = he(), n = De(), v = T(() => !n.businessLevel);
454
447
  n.watchLocation(async () => {
455
448
  await r.readSuppliers();
456
- const u = s();
449
+ const u = o();
457
450
  if (u.supplier._id) return;
458
- const c = n.businessLevel ? r.businessSuppliers[0] : r.suppliers[0], b = (f.value ? n.locations.filter((h) => h.doc._id !== n.currentLocation.doc._id) : n.locations)[0];
459
- m({
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({
460
453
  ...u,
461
454
  supplier: c ? ye(c) : b ? Ce(b) : u.supplier
462
455
  });
463
456
  });
464
- const t = P(
457
+ const t = T(
465
458
  () => {
466
459
  var u, c;
467
- return typeof ((c = (u = s()) == null ? void 0 : u.supplier) == null ? void 0 : c.internal) == "string" ? $.TRANSFER : $.PURCHASE;
460
+ return typeof ((c = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : c.internal) == "string" ? $.TRANSFER : $.PURCHASE;
468
461
  }
469
- ), a = P({
462
+ ), l = T({
470
463
  get() {
471
464
  var u, c;
472
- return (c = (u = s()) == null ? void 0 : u.supplier) == null ? void 0 : c._id;
465
+ return (c = (u = o()) == null ? void 0 : u.supplier) == null ? void 0 : c._id;
473
466
  },
474
467
  set(u) {
475
- const c = s() ?? {};
468
+ const c = o() ?? {};
476
469
  if (t.value === $.PURCHASE) {
477
470
  const O = (n.businessLevel ? r.businessSuppliers : r.suppliers).find((B) => B._id === u);
478
- m({
471
+ f({
479
472
  ...c,
480
473
  supplier: O ? ye(O) : c.supplier
481
474
  });
482
475
  return;
483
476
  }
484
- const h = (f.value ? n.locations.filter((w) => w.doc._id !== n.currentLocation.doc._id) : n.locations).find((w) => w.doc._id === u);
485
- m({
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({
486
479
  ...c,
487
480
  supplier: h ? Ce(h) : c.supplier
488
481
  });
489
482
  }
490
- }), x = P(() => r.locationSuppliers.map(ye)), p = P(() => r.businessSuppliers.map(ye)), o = P(() => {
483
+ }), x = T(() => r.locationSuppliers.map(ye)), p = T(() => r.businessSuppliers.map(ye)), s = T(() => {
491
484
  var C;
492
- const u = ((C = n._currentLocation) == null ? void 0 : C.type) === je.warehouse;
493
- return (f.value ? n.locations.filter((b) => b.doc._id !== n.currentLocation.doc._id) : n.locations).filter((b) => u || b.acceptRequest).map(Ce);
494
- }), l = P(() => {
485
+ const u = ((C = n._currentLocation) == null ? void 0 : C.type) === He.warehouse;
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(() => {
495
488
  if (t.value === $.PURCHASE) {
496
489
  const c = x.value.map((b) => ({
497
490
  label: b.name,
@@ -503,14 +496,14 @@ function Lt(s, m) {
503
496
  }));
504
497
  return n.businessLevel ? C : [...c, ...C];
505
498
  }
506
- return o.value.map((c) => ({
499
+ return s.value.map((c) => ({
507
500
  label: c.name,
508
501
  sublabel: c.internal ? `${c.internal}` : void 0,
509
502
  value: c._id
510
503
  }));
511
- }), v = P(() => {
504
+ }), y = T(() => {
512
505
  var b, h;
513
- const u = (h = (b = s()) == null ? void 0 : b.supplier) == null ? void 0 : h._id;
506
+ const u = (h = (b = o()) == null ? void 0 : b.supplier) == null ? void 0 : h._id;
514
507
  if (t.value === $.PURCHASE) {
515
508
  const w = r.suppliers.find((O) => O._id === u);
516
509
  return w ? ye(w) : null;
@@ -519,58 +512,58 @@ function Lt(s, m) {
519
512
  return C ? Ce(C) : null;
520
513
  });
521
514
  return {
522
- transferLocationModel: a,
523
- transferLocationOptions: l,
515
+ transferLocationModel: l,
516
+ transferLocationOptions: a,
524
517
  locationOptionsTypePurchase: x,
525
- locationOptionsTypeTransfer: o,
526
- selectedLocation: v
518
+ locationOptionsTypeTransfer: s,
519
+ selectedLocation: y
527
520
  };
528
521
  }
529
- function qt(s) {
530
- const m = P({
522
+ function Mt(o) {
523
+ const f = T({
531
524
  get() {
532
- const t = s.getEffectiveAt();
525
+ const t = o.getEffectiveAt();
533
526
  return t ? new Date(t) : null;
534
527
  },
535
528
  set(t) {
536
- s.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
529
+ o.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
537
530
  }
538
- }), r = P({
531
+ }), r = T({
539
532
  get() {
540
- return !!m.value;
533
+ return !!f.value;
541
534
  },
542
535
  set(t) {
543
- t ? m.value = /* @__PURE__ */ new Date() : m.value = null;
536
+ t ? f.value = /* @__PURE__ */ new Date() : f.value = null;
544
537
  }
545
- }), n = P({
538
+ }), n = T({
546
539
  get() {
547
- return m.value === null ? "" : De(m.value);
540
+ return f.value === null ? "" : Ae(f.value);
548
541
  },
549
542
  set(t) {
550
- t ? m.value = /* @__PURE__ */ new Date(`${t} ${f.value}`) : m.value = null;
543
+ t ? f.value = /* @__PURE__ */ new Date(`${t} ${v.value}`) : f.value = null;
551
544
  }
552
- }), f = P({
545
+ }), v = T({
553
546
  get() {
554
- return m.value === null ? "" : dt(m.value);
547
+ return f.value === null ? "" : rt(f.value);
555
548
  },
556
549
  set(t) {
557
- t ? m.value = /* @__PURE__ */ new Date(`${n.value} ${t}`) : m.value = null;
550
+ t ? f.value = /* @__PURE__ */ new Date(`${n.value} ${t}`) : f.value = null;
558
551
  }
559
552
  });
560
553
  return {
561
- backdatePo: m,
554
+ backdatePo: f,
562
555
  backdateSwitch: r,
563
556
  backdateModel: n,
564
- backdateTimeModel: f
557
+ backdateTimeModel: v
565
558
  };
566
559
  }
567
- const Nt = {
560
+ const Et = {
568
561
  width: "24",
569
562
  height: "24",
570
563
  viewBox: "0 0 24 24",
571
564
  fill: "none",
572
565
  xmlns: "http://www.w3.org/2000/svg"
573
- }, Ht = ["fill"], zt = ["fill"], jt = ["stroke"], Wt = ["stroke"], Yt = /* @__PURE__ */ se({
566
+ }, Lt = ["fill"], qt = ["fill"], Nt = ["stroke"], Ht = ["stroke"], zt = /* @__PURE__ */ se({
574
567
  __name: "SparkIcon",
575
568
  props: {
576
569
  size: {
@@ -582,53 +575,53 @@ const Nt = {
582
575
  default: "#c7c7cc"
583
576
  }
584
577
  },
585
- setup(s) {
586
- return (m, r) => (I(), A("svg", Nt, [
578
+ setup(o) {
579
+ return (f, r) => (P(), A("svg", Et, [
587
580
  d("path", {
588
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",
589
- fill: s.color
590
- }, null, 8, Ht),
582
+ fill: o.color
583
+ }, null, 8, Lt),
591
584
  d("path", {
592
585
  d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
593
- fill: s.color
594
- }, null, 8, zt),
586
+ fill: o.color
587
+ }, null, 8, qt),
595
588
  d("path", {
596
589
  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",
597
- stroke: s.color,
590
+ stroke: o.color,
598
591
  "stroke-width": "1.5",
599
592
  "stroke-linecap": "round",
600
593
  "stroke-linejoin": "round"
601
- }, null, 8, jt),
594
+ }, null, 8, Nt),
602
595
  d("path", {
603
596
  d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
604
- stroke: s.color,
597
+ stroke: o.color,
605
598
  "stroke-width": "1.5",
606
599
  "stroke-linecap": "round",
607
600
  "stroke-linejoin": "round"
608
- }, null, 8, Wt)
601
+ }, null, 8, Ht)
609
602
  ]));
610
603
  }
611
- }), Zt = { class: "flex gap-8 items-center" }, Kt = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Qt = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Gt = { class: "flex items-center w-full" }, Jt = { class: "flex-1" }, Xt = { class: "fm-typo-en-title-sm-800" }, es = { class: "flex items-start gap-8" }, ts = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, ss = { class: "flex gap-1" }, Me = /* @__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" }, 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({
612
605
  __name: "ForecastStock",
613
606
  props: {
614
607
  disabled: { type: Boolean }
615
608
  },
616
609
  emits: ["update:poItems"],
617
- setup(s, { emit: m }) {
618
- const r = m, n = L(!1), f = L(7), t = bt(), a = Ae(), x = Re(), { t: p } = de();
619
- async function o() {
620
- if (f.value < 1)
610
+ setup(o, { emit: f }) {
611
+ const r = f, n = L(!1), v = L(7), t = ft(), l = $e(), x = Ve(), { t: p } = de();
612
+ async function s() {
613
+ if (v.value < 1)
621
614
  return;
622
- n.value = !1, await t.readPurchaseOrder(f.value);
623
- const l = [];
615
+ n.value = !1, await t.readPurchaseOrder(v.value);
616
+ const a = [];
624
617
  if (t.purchaseOrderForecast.skus.length <= 0) {
625
- a.open({
618
+ l.open({
626
619
  message: p("inventory.transfer.form.items.forecastStock.notAvailable"),
627
620
  type: "info"
628
621
  });
629
622
  return;
630
623
  }
631
- const v = t.purchaseOrderForecast.skus.reduce((u, c) => {
624
+ const y = t.purchaseOrderForecast.skus.reduce((u, c) => {
632
625
  const C = x.skus.find((w) => w._id === c.id);
633
626
  if (u.find((w) => w.sku._id === c.id) || !C)
634
627
  return u;
@@ -642,45 +635,45 @@ const Nt = {
642
635
  }
643
636
  };
644
637
  return u.push(h), u;
645
- }, l);
646
- r("update:poItems", v);
638
+ }, a);
639
+ r("update:poItems", y);
647
640
  }
648
- return (l, v) => {
649
- const u = T("FmButton"), c = T("FmIcon"), C = T("FmStepperField"), b = T("FmPopover");
650
- return I(), j(b, {
651
- disabled: l.disabled,
641
+ return (a, y) => {
642
+ const u = I("FmButton"), c = I("FmIcon"), C = I("FmStepperField"), b = I("FmPopover");
643
+ return P(), j(b, {
644
+ disabled: a.disabled,
652
645
  class: "flex",
653
646
  "show-popover": n.value,
654
- onPopoverChanged: v[3] || (v[3] = (h) => n.value = h)
647
+ onPopoverChanged: y[3] || (y[3] = (h) => n.value = h)
655
648
  }, {
656
649
  "popover-button": V(() => [
657
650
  k(u, {
658
651
  label: "unused",
659
652
  variant: "secondary",
660
- "text-color": l.disabled ? "disabled" : "primary",
653
+ "text-color": a.disabled ? "disabled" : "primary",
661
654
  "bg-color": "transparent",
662
- "border-color": l.disabled ? "disabled" : "primary",
663
- disabled: l.disabled
655
+ "border-color": a.disabled ? "disabled" : "primary",
656
+ disabled: a.disabled
664
657
  }, {
665
658
  default: V(() => [
666
- d("div", Zt, [
667
- k(Yt, {
659
+ d("div", jt, [
660
+ k(zt, {
668
661
  size: 24,
669
- color: l.disabled ? "#c7c7cc" : "#ff7823"
662
+ color: a.disabled ? "#c7c7cc" : "#ff7823"
670
663
  }, null, 8, ["color"]),
671
- d("div", Kt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
664
+ d("div", Wt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
672
665
  ])
673
666
  ]),
674
667
  _: 1
675
668
  }, 8, ["text-color", "border-color", "disabled"])
676
669
  ]),
677
670
  default: V(() => [
678
- d("div", Qt, [
679
- d("div", Gt, [
680
- d("div", Jt, [
681
- k(_t, { "z-index": 99 }, {
671
+ d("div", Yt, [
672
+ d("div", Zt, [
673
+ d("div", Qt, [
674
+ k(bt, { "z-index": 99 }, {
682
675
  default: V(() => [
683
- d("p", Xt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
676
+ d("p", Kt, D(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
684
677
  ]),
685
678
  _: 1
686
679
  })
@@ -689,37 +682,37 @@ const Nt = {
689
682
  icon: "close",
690
683
  size: "md",
691
684
  variant: "tertiary",
692
- onClick: v[0] || (v[0] = (h) => n.value = !1)
685
+ onClick: y[0] || (y[0] = (h) => n.value = !1)
693
686
  })
694
687
  ]),
695
688
  k(C, {
696
- modelValue: f.value,
697
- "onUpdate:modelValue": v[1] || (v[1] = (h) => f.value = h),
689
+ modelValue: v.value,
690
+ "onUpdate:modelValue": y[1] || (y[1] = (h) => v.value = h),
698
691
  label: e(p)("inventory.transfer.form.items.forecastStock.days"),
699
692
  rules: [e(ke)(1)]
700
693
  }, {
701
694
  "helper-text": V(() => [
702
- d("div", es, [
695
+ d("div", Gt, [
703
696
  k(c, {
704
697
  name: "warning",
705
698
  size: "sm",
706
699
  class: "text-fm-color-system-warning-300"
707
700
  }),
708
- d("div", ts, D(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
701
+ d("div", Jt, D(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
709
702
  ])
710
703
  ]),
711
704
  _: 1
712
705
  }, 8, ["modelValue", "label", "rules"]),
713
- d("div", ss, [
714
- v[4] || (v[4] = d("div", { class: "grow" }, null, -1)),
706
+ d("div", Xt, [
707
+ y[4] || (y[4] = d("div", { class: "grow" }, null, -1)),
715
708
  k(u, {
716
709
  label: e(p)("common.cancel"),
717
710
  variant: "tertiary",
718
- onClick: v[2] || (v[2] = (h) => n.value = !1)
711
+ onClick: y[2] || (y[2] = (h) => n.value = !1)
719
712
  }, null, 8, ["label"]),
720
713
  k(u, {
721
714
  label: e(p)("inventory.transfer.form.items.forecastStock.generate"),
722
- onClick: o
715
+ onClick: s
723
716
  }, null, 8, ["label"])
724
717
  ])
725
718
  ])
@@ -729,25 +722,25 @@ const Nt = {
729
722
  };
730
723
  }
731
724
  });
732
- function os() {
733
- const s = Ae(), m = qe(), r = L(!1);
734
- $e(r, (a) => {
735
- a && (f.value = !0, n().finally(() => {
736
- f.value = !1;
725
+ function es() {
726
+ const o = $e(), f = Ee(), r = L(!1);
727
+ Me(r, (l) => {
728
+ l && (v.value = !0, n().finally(() => {
729
+ v.value = !1;
737
730
  }));
738
731
  });
739
732
  async function n() {
740
733
  try {
741
- const { startDate: a, endDate: x } = ct(6), l = (await m.getPurchaseOrders({ start: a, end: x })).filter(
742
- (v) => {
734
+ const { startDate: l, endDate: x } = it(6), a = (await f.getPurchaseOrders({ start: l, end: x })).filter(
735
+ (y) => {
743
736
  var u, c;
744
- return v.status === pt.enum.COMPLETE && ((u = v.supplier) == null ? void 0 : u.internal) !== "warehouse" && ((c = v.supplier) == null ? void 0 : c.internal) !== "restaurant";
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";
745
738
  }
746
- ).reduce((v, u) => {
747
- const c = new Date(mt(u._id)), C = u.supplier._id;
739
+ ).reduce((y, u) => {
740
+ const c = new Date(dt(u._id)), C = u.supplier._id;
748
741
  for (const b of u.items) {
749
742
  if (!b.totalCost) continue;
750
- const h = v[b.sku._id] ?? {}, w = h[C] ?? [];
743
+ const h = y[b.sku._id] ?? {}, w = h[C] ?? [];
751
744
  w.push({
752
745
  date: c.toISOString(),
753
746
  totalUnit: b.quantity,
@@ -755,92 +748,92 @@ function os() {
755
748
  unit: b.sku.unit,
756
749
  measurement: b.measurement,
757
750
  seqNumber: u.seqNumber
758
- }), h[C] = w, v[b.sku._id] = h;
751
+ }), h[C] = w, y[b.sku._id] = h;
759
752
  }
760
- return v;
753
+ return y;
761
754
  }, {});
762
- t.value = l;
755
+ t.value = a;
763
756
  } catch {
764
- s.open({
757
+ o.open({
765
758
  title: "Something went wrong",
766
759
  message: "Cannot retrieve supplier purchase history. Please try again."
767
760
  }), r.value = !1;
768
761
  }
769
762
  }
770
- const f = L(!1), t = L({});
763
+ const v = L(!1), t = L({});
771
764
  return {
772
765
  comparePricesToggle: r,
773
- comparePriceFetching: f,
766
+ comparePriceFetching: v,
774
767
  comparePriceBySku: t
775
768
  };
776
769
  }
777
- const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }, ls = ["colspan"], rs = /* @__PURE__ */ se({
770
+ const ts = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ss = { key: 0 }, os = ["colspan"], ns = /* @__PURE__ */ se({
778
771
  __name: "TransferItemTable",
779
772
  props: {
780
773
  row: {},
781
774
  comparePriceBySku: {},
782
775
  showComparePrice: { type: Boolean }
783
776
  },
784
- setup(s) {
785
- function m(r) {
777
+ setup(o) {
778
+ function f(r) {
786
779
  return r.column.columnDef.meta;
787
780
  }
788
781
  return (r, n) => {
789
- var f, t;
790
- return I(), A(ve, null, [
782
+ var v, t;
783
+ return P(), A(ve, null, [
791
784
  d("tr", {
792
- class: Te(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
785
+ class: Ie(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
793
786
  "bg-fm-color-neutral-gray-100": r.row.getIsSelected()
794
787
  }])
795
788
  }, [
796
- (I(!0), A(ve, null, Pe(r.row.getVisibleCells(), (a) => {
797
- var x, p, o, l;
798
- return I(), A("td", {
799
- key: a.id,
800
- class: Te([
789
+ (P(!0), A(ve, null, Te(r.row.getVisibleCells(), (l) => {
790
+ var x, p, s, a;
791
+ return P(), A("td", {
792
+ key: l.id,
793
+ class: Ie([
801
794
  "h-[52px] px-16 text-fm-color-typo-primary",
802
- ((x = m(a)) == null ? void 0 : x.cellClass) ?? "px-16"
795
+ ((x = f(l)) == null ? void 0 : x.cellClass) ?? "px-16"
803
796
  ]),
804
- style: Ze({
805
- width: (p = m(a)) == null ? void 0 : p.width,
806
- maxWidth: (o = m(a)) == null ? void 0 : o.maxWidth,
807
- textAlign: ((l = m(a)) == null ? void 0 : l.textAlign) ?? "left"
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"
808
801
  })
809
802
  }, [
810
- d("span", ns, [
803
+ d("span", ts, [
811
804
  k(e(ue), {
812
- render: a.column.columnDef.cell,
813
- props: a.getContext()
805
+ render: l.column.columnDef.cell,
806
+ props: l.getContext()
814
807
  }, null, 8, ["render", "props"])
815
808
  ])
816
809
  ], 6);
817
810
  }), 128))
818
811
  ], 2),
819
- r.showComparePrice && Object.keys(r.comparePriceBySku[(f = r.row.original.sku) == null ? void 0 : f._id] ?? {}).length > 0 ? (I(), A("tr", as, [
812
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(v = r.row.original.sku) == null ? void 0 : v._id] ?? {}).length > 0 ? (P(), A("tr", ss, [
820
813
  d("td", {
821
814
  colspan: r.row.getVisibleCells().length
822
815
  }, [
823
- k(Ye, {
816
+ k(je, {
824
817
  prices: r.comparePriceBySku[(t = r.row.original.sku) == null ? void 0 : t._id]
825
818
  }, null, 8, ["prices"])
826
- ], 8, ls)
819
+ ], 8, os)
827
820
  ])) : z("", !0)
828
821
  ], 64);
829
822
  };
830
823
  }
831
- }), is = { class: "flex flex-col gap-4" }, us = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ds = { class: "flex flex-col gap-16" }, cs = { class: "flex flex-col gap-24" }, ps = {
824
+ }), as = { class: "flex flex-col gap-4" }, ls = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, rs = { class: "flex flex-col gap-16" }, is = { class: "flex flex-col gap-24" }, us = {
832
825
  key: 0,
833
826
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
834
- }, ms = { class: "flex xs:flex-col sm:flex-col" }, fs = {
827
+ }, ds = { class: "flex xs:flex-col sm:flex-col" }, cs = {
835
828
  key: 0,
836
829
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
837
- }, ys = { class: "flex-1" }, vs = { class: "flex-1" }, bs = {
830
+ }, ps = { class: "flex-1" }, ms = { class: "flex-1" }, fs = {
838
831
  key: 1,
839
832
  class: "flex items-center gap-4"
840
- }, gs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, _s = { class: "flex flex-col gap-16" }, Cs = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, ks = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, hs = { class: "flex gap-8" }, ws = {
833
+ }, ys = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, vs = { class: "flex flex-col gap-16" }, bs = { class: "flex sm:flex-col xs:flex-col gap-16 items-center xs:items-start sm:items-start" }, _s = { class: "flex-1 gap-8 fm-typo-en-title-sm-800" }, gs = { class: "flex gap-8" }, Cs = {
841
834
  key: 0,
842
835
  class: "xs:w-full"
843
- }, xs = /* @__PURE__ */ se({
836
+ }, ks = /* @__PURE__ */ se({
844
837
  __name: "TransferForm2",
845
838
  props: {
846
839
  modelValue: {},
@@ -850,82 +843,82 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
850
843
  lastClosingDate: {}
851
844
  },
852
845
  emits: ["validation-success", "form:ready"],
853
- setup(s, { expose: m, emit: r }) {
854
- const n = s, f = r, t = ht(), { t: a } = de(), x = Ve(), p = Re(), o = he(), l = Ne(), v = Xe(), u = P(
855
- () => v.templates.value.find((i) => i._id === t.template)
856
- ), c = P(() => t.status === "DRAFT" || !t._rev);
857
- Le(async () => {
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);
850
+ Ue(async () => {
858
851
  var i;
859
852
  try {
860
853
  if (!t.template) return;
861
- await v.loadTemplate(t.template), t.items.length || (t.items = ((i = u.value) == null ? void 0 : i.purchaseOrder.items) ?? []);
854
+ await y.loadTemplate(t.template), t.items.length || (t.items = ((i = u.value) == null ? void 0 : i.purchaseOrder.items) ?? []);
862
855
  } finally {
863
- f("form:ready");
856
+ v("form:ready");
864
857
  }
865
858
  });
866
- const C = P(
867
- () => x.currentLocation.type === je.restaurant
859
+ const C = T(
860
+ () => x.currentLocation.type === He.restaurant
868
861
  );
869
862
  x.watchLocation(async () => {
870
- location && (t.supplier || (t.supplier = o.suppliers.find((i) => i) ?? t.supplier));
863
+ location && (t.supplier || (t.supplier = s.suppliers.find((i) => i) ?? t.supplier));
871
864
  });
872
- const b = Ge(), h = Lt(
865
+ const b = Ke(), h = Ut(
873
866
  () => t,
874
867
  (i) => {
875
868
  Object.assign(t, i);
876
869
  }
877
- ), w = P({
870
+ ), w = T({
878
871
  get() {
879
872
  var i;
880
873
  return typeof ((i = t == null ? void 0 : t.supplier) == null ? void 0 : i.internal) == "string" ? $.TRANSFER : $.PURCHASE;
881
874
  },
882
875
  set(i) {
883
876
  var q;
884
- const y = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? $.TRANSFER : $.PURCHASE;
885
- i !== y && (t.supplier = i === $.PURCHASE ? h.locationOptionsTypePurchase.value[0] : h.locationOptionsTypeTransfer.value[0]);
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]);
886
879
  }
887
- }), O = P(() => h.transferLocationOptions.value), B = P({
880
+ }), O = T(() => h.transferLocationOptions.value), B = T({
888
881
  get() {
889
882
  return t.supplier._id;
890
883
  },
891
884
  set(i) {
892
885
  h.transferLocationModel.value = i;
893
886
  }
894
- }), J = P({
887
+ }), J = T({
895
888
  get() {
896
889
  return t.remark ?? void 0;
897
890
  },
898
891
  set(i) {
899
892
  t.remark = i;
900
893
  }
901
- }), { backdatePo: U, backdateSwitch: Y, backdateModel: Q, backdateTimeModel: N } = qt({
894
+ }), { backdatePo: U, backdateSwitch: Y, backdateModel: K, backdateTimeModel: N } = Mt({
902
895
  getEffectiveAt() {
903
896
  return t.effectiveAt;
904
897
  },
905
898
  setEffectiveAt(i) {
906
899
  t.effectiveAt = i;
907
900
  }
908
- }), { comparePricesToggle: H, comparePriceFetching: G, comparePriceBySku: g } = os(), _ = L();
909
- m({
901
+ }), { comparePricesToggle: H, comparePriceFetching: G, comparePriceBySku: _ } = es(), g = L();
902
+ f({
910
903
  validateInputs: () => {
911
- var i, y;
912
- (y = (i = _.value) == null ? void 0 : i.validateInputs) == null || y.call(i);
904
+ var i, m;
905
+ (m = (i = g.value) == null ? void 0 : i.validateInputs) == null || m.call(i);
913
906
  },
914
907
  resetInputsValidation: () => {
915
- var i, y;
916
- (y = (i = _.value) == null ? void 0 : i.resetInputsValidation) == null || y.call(i);
908
+ var i, m;
909
+ (m = (i = g.value) == null ? void 0 : i.resetInputsValidation) == null || m.call(i);
917
910
  },
918
911
  resetInputs: () => {
919
- var i, y;
920
- (y = (i = _.value) == null ? void 0 : i.resetInputs) == null || y.call(i);
912
+ var i, m;
913
+ (m = (i = g.value) == null ? void 0 : i.resetInputs) == null || m.call(i);
921
914
  }
922
915
  });
923
- const M = kt({
916
+ const M = gt({
924
917
  updateItem: (i) => {
925
- t.items = t.items.map((y) => y.sku._id !== i.sku._id ? y : i);
918
+ t.items = t.items.map((m) => m.sku._id !== i.sku._id ? m : i);
926
919
  },
927
920
  deleteItem: (i) => {
928
- t.items = t.items.filter((y) => y.sku._id !== i.sku._id);
921
+ t.items = t.items.filter((m) => m.sku._id !== i.sku._id);
929
922
  },
930
923
  get supplier() {
931
924
  return t.supplier;
@@ -942,26 +935,26 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
942
935
  get disabled() {
943
936
  return n.disabled;
944
937
  }
945
- }), oe = P(() => M.columnDefs.value);
938
+ }), oe = T(() => M.columnDefs.value);
946
939
  function Z() {
947
- var be, pe, ge;
940
+ var be, pe, _e;
948
941
  let i;
949
942
  ((F) => {
950
943
  F.IsInTemplate = "IsInTemplate", F.IsOutsideTemplate = "IsOutsideTemplate";
951
944
  })(i || (i = {}));
952
- const y = [
945
+ const m = [
953
946
  {
954
947
  id: "IsInTemplate",
955
- label: a("inventory.transfer.form.items.fromTemplate.title")
948
+ label: l("inventory.transfer.form.items.fromTemplate.title")
956
949
  },
957
950
  {
958
951
  id: "IsOutsideTemplate",
959
- label: a("inventory.transfer.form.items.other.title"),
952
+ label: l("inventory.transfer.form.items.other.title"),
960
953
  sublabel: "These options are not selectable, and the items are managed in template.",
961
954
  collapse: !0,
962
955
  disabled: !0
963
956
  }
964
- ], q = new Set((ge = (pe = (be = u.value) == null ? void 0 : be.purchaseOrder) == null ? void 0 : pe.items) == null ? void 0 : ge.map((F) => F.sku._id)), ce = p.skus.map(
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(
965
958
  (F) => ({
966
959
  label: F.name,
967
960
  sublabel: F.code,
@@ -975,35 +968,35 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
975
968
  return (X = t.items) == null ? void 0 : X.find((ne) => ne.sku._id === F.value._id);
976
969
  }).map((F) => F.value);
977
970
  b.open({
978
- title: a("inventory.transfer.form.items.selectItem"),
971
+ title: l("inventory.transfer.form.items.selectItem"),
979
972
  closeButton: !0,
980
- contentComponent: vt,
973
+ contentComponent: mt,
981
974
  contentComponentProps: {
982
975
  modelValue: xe,
983
976
  items: ce,
984
- groups: q.size ? y : void 0
977
+ groups: q.size ? m : void 0
985
978
  },
986
979
  primaryActions: {
987
- text: a("common.confirm"),
980
+ text: l("common.confirm"),
988
981
  close: !0
989
982
  },
990
983
  secondaryActions: {
991
- text: a("common.close"),
984
+ text: l("common.close"),
992
985
  close: !0,
993
986
  variant: "tertiary"
994
987
  }
995
988
  }).onPrimary((F) => {
996
- const X = t.items ?? [], ne = F.map((K) => {
997
- var _e, me;
998
- const ae = X.find((le) => le.sku._id === K._id);
989
+ const X = t.items ?? [], ne = F.map((Q) => {
990
+ var ge, me;
991
+ const ae = X.find((le) => le.sku._id === Q._id);
999
992
  if (ae)
1000
993
  return ae;
1001
- const ee = ((me = (_e = u.value) == null ? void 0 : _e.purchaseOrder.items) == null ? void 0 : me.find(
1002
- (le) => le.sku._id === K._id
994
+ const ee = ((me = (ge = u.value) == null ? void 0 : ge.purchaseOrder.items) == null ? void 0 : me.find(
995
+ (le) => le.sku._id === Q._id
1003
996
  )) ?? {
1004
- sku: K,
1005
- code: K.code,
1006
- name: K.name,
997
+ sku: Q,
998
+ code: Q.code,
999
+ name: Q.name,
1007
1000
  quantity: {
1008
1001
  amount: 1,
1009
1002
  precision: 0
@@ -1018,21 +1011,21 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1018
1011
  }
1019
1012
  )), ee;
1020
1013
  });
1021
- ne.sort((K, ae) => K.sku.code.localeCompare(ae.sku.code)), t.items = ne;
1014
+ ne.sort((Q, ae) => Q.sku.code.localeCompare(ae.sku.code)), t.items = ne;
1022
1015
  });
1023
1016
  }
1024
1017
  function we(i) {
1025
1018
  return i;
1026
1019
  }
1027
- return (i, y) => {
1020
+ return (i, m) => {
1028
1021
  var me, le;
1029
- const q = T("FmChip"), ce = T("FmSelect"), xe = T("FmTextField"), be = T("FmTextarea"), pe = T("FmSwitch"), ge = T("FmDatePicker"), F = T("FmTimePicker"), X = T("FmFormGroup"), ne = T("FmIcon"), K = T("FmButton"), ae = T("FmTooltip"), ee = T("FmTable"), _e = T("FmForm");
1030
- return I(), A("div", is, [
1031
- d("div", us, [
1032
- (me = n.modelValue) != null && me.template ? (I(), j(q, {
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, [
1024
+ d("div", ls, [
1025
+ (me = n.modelValue) != null && me.template ? (P(), j(q, {
1033
1026
  key: 0,
1034
1027
  variant: i.disabled ? "warning" : void 0,
1035
- label: `${e(a)("inventory.transfer.template.title")}: ${((le = u.value) == null ? void 0 : le.name) ?? e(a)("inventory.transfer.form.loading")}`,
1028
+ label: `${e(l)("inventory.transfer.template.title")}: ${((le = u.value) == null ? void 0 : le.name) ?? e(l)("inventory.transfer.form.loading")}`,
1036
1029
  icon: "summarize",
1037
1030
  compact: ""
1038
1031
  }, null, 8, ["variant", "label"])) : z("", !0),
@@ -1041,160 +1034,160 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1041
1034
  icon: "storefront",
1042
1035
  compact: ""
1043
1036
  }, null, 8, ["label"]),
1044
- i.lastClosingDate ? (I(), j(q, {
1037
+ i.lastClosingDate ? (P(), j(q, {
1045
1038
  key: 1,
1046
- label: `${e(a)("inventory.transfer.form.lastClosing")}: ${e(De)(i.lastClosingDate)} ${e(ft)(i.lastClosingDate)}`,
1039
+ label: `${e(l)("inventory.transfer.form.lastClosing")}: ${e(Ae)(i.lastClosingDate)} ${e(ct)(i.lastClosingDate)}`,
1047
1040
  icon: "calendar_month",
1048
1041
  compact: ""
1049
1042
  }, null, 8, ["label"])) : z("", !0)
1050
1043
  ]),
1051
- k(_e, {
1044
+ k(ge, {
1052
1045
  ref_key: "formRef",
1053
- ref: _,
1046
+ ref: g,
1054
1047
  class: "flex flex-col gap-32",
1055
1048
  disabled: i.disabled,
1056
1049
  onValidationFailed: console.log,
1057
- onValidationSuccess: y[12] || (y[12] = (Se) => f("validation-success"))
1050
+ onValidationSuccess: m[12] || (m[12] = (Se) => v("validation-success"))
1058
1051
  }, {
1059
1052
  default: V(() => {
1060
1053
  var Se;
1061
1054
  return [
1062
- d("div", ds, [
1063
- d("div", cs, [
1055
+ d("div", rs, [
1056
+ d("div", is, [
1064
1057
  k(ce, {
1065
- label: e(a)("inventory.transfer.form.type.title"),
1058
+ label: e(l)("inventory.transfer.form.type.title"),
1066
1059
  "model-value": w.value,
1067
- "onUpdate:modelValue": y[0] || (y[0] = (S) => w.value = S),
1060
+ "onUpdate:modelValue": m[0] || (m[0] = (S) => w.value = S),
1068
1061
  items: [
1069
1062
  {
1070
- label: e(a)("inventory.transfer.form.type.purchase"),
1063
+ label: e(l)("inventory.transfer.form.type.purchase"),
1071
1064
  value: e($).PURCHASE,
1072
1065
  disabled: !e(h).locationOptionsTypePurchase.value.length,
1073
- sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(a)("inventory.transfer.form.noSupplierAvailable")
1066
+ sublabel: e(h).locationOptionsTypePurchase.value.length ? void 0 : e(l)("inventory.transfer.form.noSupplierAvailable")
1074
1067
  },
1075
1068
  {
1076
- label: e(a)("inventory.transfer.form.type.transfer"),
1069
+ label: e(l)("inventory.transfer.form.type.transfer"),
1077
1070
  value: e($).TRANSFER,
1078
1071
  disabled: !e(h).locationOptionsTypeTransfer.value.length,
1079
- sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(a)("inventory.transfer.form.noLocationAvailable")
1072
+ sublabel: e(h).locationOptionsTypeTransfer.value.length ? void 0 : e(l)("inventory.transfer.form.noLocationAvailable")
1080
1073
  }
1081
1074
  ],
1082
1075
  rules: [e(ke)(1)(O.value)]
1083
1076
  }, null, 8, ["label", "model-value", "items", "rules"]),
1084
1077
  k(ce, {
1085
- label: w.value === e($).PURCHASE ? e(a)("inventory.transfer.form.purchaseFrom") : e(a)("inventory.transfer.form.transferFrom"),
1078
+ label: w.value === e($).PURCHASE ? e(l)("inventory.transfer.form.purchaseFrom") : e(l)("inventory.transfer.form.transferFrom"),
1086
1079
  modelValue: B.value,
1087
- "onUpdate:modelValue": y[1] || (y[1] = (S) => B.value = S),
1080
+ "onUpdate:modelValue": m[1] || (m[1] = (S) => B.value = S),
1088
1081
  items: O.value
1089
1082
  }, null, 8, ["label", "modelValue", "items"]),
1090
1083
  k(xe, {
1091
- label: e(a)("inventory.transfer.form.reference"),
1084
+ label: e(l)("inventory.transfer.form.reference"),
1092
1085
  "label-mark": "optional",
1093
1086
  modelValue: e(t).ref,
1094
- "onUpdate:modelValue": y[2] || (y[2] = (S) => e(t).ref = S)
1087
+ "onUpdate:modelValue": m[2] || (m[2] = (S) => e(t).ref = S)
1095
1088
  }, null, 8, ["label", "modelValue"]),
1096
1089
  k(be, {
1097
- label: e(a)("inventory.transfer.form.remark"),
1090
+ label: e(l)("inventory.transfer.form.remark"),
1098
1091
  "label-mark": "optional",
1099
1092
  "max-length": 240,
1100
1093
  modelValue: J.value,
1101
- "onUpdate:modelValue": y[3] || (y[3] = (S) => J.value = S),
1102
- class: Te([i.disabled ? "text-fm-color-typo-disabled " : ""])
1094
+ "onUpdate:modelValue": m[3] || (m[3] = (S) => J.value = S),
1095
+ class: Ie([i.disabled ? "text-fm-color-typo-disabled " : ""])
1103
1096
  }, null, 8, ["label", "modelValue", "class"]),
1104
- e(l).enableBackdatePo ? (I(), A("div", ps, [
1105
- d("div", ms, [
1097
+ e(a).enableBackdatePo ? (P(), A("div", us, [
1098
+ d("div", ds, [
1106
1099
  k(pe, {
1107
1100
  modelValue: e(Y),
1108
- "onUpdate:modelValue": y[4] || (y[4] = (S) => ie(Y) ? Y.value = S : null),
1109
- label: e(a)("inventory.transfer.form.backdate.title"),
1110
- sublabel: e(a)("inventory.transfer.form.backdate.subtitle"),
1101
+ "onUpdate:modelValue": m[4] || (m[4] = (S) => ie(Y) ? Y.value = S : null),
1102
+ label: e(l)("inventory.transfer.form.backdate.title"),
1103
+ sublabel: e(l)("inventory.transfer.form.backdate.subtitle"),
1111
1104
  "label-placement": "right",
1112
1105
  disabled: C.value && !i.lastClosingDate || i.disabled
1113
1106
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1114
- y[13] || (y[13] = d("div", { class: "xs:hidden sm:hidden h-48 lg:w-16 md:w-16" }, null, -1)),
1115
- e(Y) ? (I(), A("div", fs, [
1116
- d("div", ys, [
1117
- k(ge, {
1118
- modelValue: e(Q),
1119
- "onUpdate:modelValue": y[5] || (y[5] = (S) => ie(Q) ? Q.value = S : null)
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, [
1109
+ d("div", ps, [
1110
+ k(_e, {
1111
+ modelValue: e(K),
1112
+ "onUpdate:modelValue": m[5] || (m[5] = (S) => ie(K) ? K.value = S : null)
1120
1113
  }, null, 8, ["modelValue"])
1121
1114
  ]),
1122
- d("div", vs, [
1115
+ d("div", ms, [
1123
1116
  k(F, {
1124
1117
  modelValue: e(N),
1125
- "onUpdate:modelValue": y[6] || (y[6] = (S) => ie(N) ? N.value = S : null)
1118
+ "onUpdate:modelValue": m[6] || (m[6] = (S) => ie(N) ? N.value = S : null)
1126
1119
  }, null, 8, ["modelValue"])
1127
1120
  ])
1128
1121
  ])) : z("", !0)
1129
1122
  ]),
1130
- e(U) ? (I(), j(X, {
1123
+ e(U) ? (P(), j(X, {
1131
1124
  key: 0,
1132
1125
  modelValue: e(U),
1133
- "onUpdate:modelValue": y[7] || (y[7] = (S) => ie(U) ? U.value = S : null),
1134
- rules: [e(yt)(new Date(i.lastClosingDate), /* @__PURE__ */ new Date())]
1126
+ "onUpdate:modelValue": m[7] || (m[7] = (S) => ie(U) ? U.value = S : null),
1127
+ rules: [e(pt)(new Date(i.lastClosingDate), /* @__PURE__ */ new Date())]
1135
1128
  }, null, 8, ["modelValue", "rules"])) : z("", !0),
1136
- C.value && !i.lastClosingDate ? (I(), A("div", bs, [
1129
+ C.value && !i.lastClosingDate ? (P(), A("div", fs, [
1137
1130
  k(ne, {
1138
1131
  name: "error",
1139
1132
  size: "sm",
1140
1133
  class: "text-fm-color-typo-warning"
1141
1134
  }),
1142
- d("span", gs, D(e(a)("inventory.transfer.form.backdate.error")), 1)
1135
+ d("span", ys, D(e(l)("inventory.transfer.form.backdate.error")), 1)
1143
1136
  ])) : z("", !0)
1144
1137
  ])) : z("", !0)
1145
1138
  ])
1146
1139
  ]),
1147
- d("div", _s, [
1140
+ d("div", vs, [
1148
1141
  k(X, {
1149
1142
  "model-value": e(t).items,
1150
1143
  rules: [e(ke)(1)]
1151
1144
  }, null, 8, ["model-value", "rules"]),
1152
- d("div", Cs, [
1153
- d("div", ks, D(e(a)("inventory.transfer.form.items.title")), 1),
1154
- d("div", hs, [
1155
- k(K, {
1145
+ d("div", bs, [
1146
+ d("div", _s, D(e(l)("inventory.transfer.form.items.title")), 1),
1147
+ d("div", gs, [
1148
+ k(Q, {
1156
1149
  disabled: i.disabled,
1157
- label: e(a)("inventory.transfer.form.items.addItem"),
1150
+ label: e(l)("inventory.transfer.form.items.addItem"),
1158
1151
  "prepend-icon": "add",
1159
1152
  variant: "secondary",
1160
1153
  "text-color": "primary",
1161
1154
  "bg-color": "transparent",
1162
1155
  "border-color": "primary",
1163
- onClick: y[8] || (y[8] = (S) => Z()),
1156
+ onClick: m[8] || (m[8] = (S) => Z()),
1164
1157
  size: "md"
1165
1158
  }, null, 8, ["disabled", "label"]),
1166
- e(t).template ? (I(), j(ae, {
1159
+ e(t).template ? (P(), j(ae, {
1167
1160
  key: 0,
1168
1161
  "z-index": 50
1169
1162
  }, {
1170
1163
  content: V(() => [
1171
- d("div", null, D(e(a)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1164
+ d("div", null, D(e(l)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1172
1165
  ]),
1173
1166
  default: V(() => [
1174
- k(Me, {
1175
- "onUpdate:poItems": y[9] || (y[9] = (S) => e(t).items = S),
1167
+ k(Be, {
1168
+ "onUpdate:poItems": m[9] || (m[9] = (S) => e(t).items = S),
1176
1169
  disabled: ""
1177
1170
  })
1178
1171
  ]),
1179
1172
  _: 1
1180
- })) : (I(), j(Me, {
1173
+ })) : (P(), j(Be, {
1181
1174
  key: 1,
1182
- "onUpdate:poItems": y[10] || (y[10] = (S) => e(t).items = S),
1175
+ "onUpdate:poItems": m[10] || (m[10] = (S) => e(t).items = S),
1183
1176
  disabled: i.disabled || !!e(t).template
1184
1177
  }, null, 8, ["disabled"]))
1185
1178
  ])
1186
1179
  ]),
1187
- w.value === e($).PURCHASE && c.value && e(l).enableTotalCost && ((Se = i.modelValue) != null && Se.items.length) ? (I(), A("div", ws, [
1180
+ w.value === e($).PURCHASE && c.value && e(a).enableTotalCost && ((Se = i.modelValue) != null && Se.items.length) ? (P(), A("div", Cs, [
1188
1181
  k(pe, {
1189
- label: e(G) ? e(a)("inventory.transfer.form.items.fetchingData") : e(a)("inventory.transfer.form.items.comparePriceHistory"),
1182
+ label: e(G) ? e(l)("inventory.transfer.form.items.fetchingData") : e(l)("inventory.transfer.form.items.comparePriceHistory"),
1190
1183
  "prepend-icon": "compare_arrows",
1191
1184
  "label-placement": "right",
1192
1185
  "model-value": e(H),
1193
- "onUpdate:modelValue": y[11] || (y[11] = (S) => ie(H) ? H.value = S : null),
1186
+ "onUpdate:modelValue": m[11] || (m[11] = (S) => ie(H) ? H.value = S : null),
1194
1187
  disabled: e(G) || i.disabled
1195
1188
  }, null, 8, ["label", "model-value", "disabled"])
1196
1189
  ])) : z("", !0),
1197
- (I(), j(ee, {
1190
+ (P(), j(ee, {
1198
1191
  "column-defs": oe.value,
1199
1192
  "row-data": e(t).items,
1200
1193
  key: e(t).items.map((S) => S.sku._id).join("."),
@@ -1202,23 +1195,23 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1202
1195
  "page-size": e(t).items.length
1203
1196
  }, {
1204
1197
  "table-row": V((S) => [
1205
- k(rs, {
1206
- "compare-price-by-sku": e(g),
1198
+ k(ns, {
1199
+ "compare-price-by-sku": e(_),
1207
1200
  "show-compare-price": w.value === e($).PURCHASE && e(H),
1208
1201
  row: S
1209
1202
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1210
1203
  ]),
1211
1204
  "list-row": V((S) => [
1212
- (I(), j(gt, {
1205
+ (P(), j(vt, {
1213
1206
  row: S,
1214
- key: e(t).items.map((Ie) => Ie.sku._id).join(".")
1207
+ key: e(t).items.map((Pe) => Pe.sku._id).join(".")
1215
1208
  }, {
1216
- default: V((Ie) => [
1217
- k(Et, {
1218
- "compare-price-by-sku": e(g),
1209
+ default: V((Pe) => [
1210
+ k(Bt, {
1211
+ "compare-price-by-sku": e(_),
1219
1212
  "show-compare-price": w.value === e($).PURCHASE && e(H),
1220
1213
  row: S,
1221
- "cell-by-col-id": Ie
1214
+ "cell-by-col-id": Pe
1222
1215
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1223
1216
  ]),
1224
1217
  _: 2
@@ -1234,7 +1227,7 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1234
1227
  ]);
1235
1228
  };
1236
1229
  }
1237
- }), Ss = { class: "flex items-center" }, Is = { class: "fm-typo-en-title-md-800" }, Ps = { class: "flex gap-4" }, Es = /* @__PURE__ */ se({
1230
+ }), hs = { class: "flex items-center" }, ws = { class: "fm-typo-en-title-md-800" }, xs = { class: "flex gap-4" }, Us = /* @__PURE__ */ se({
1238
1231
  __name: "TransferDialog",
1239
1232
  props: {
1240
1233
  mode: {},
@@ -1244,24 +1237,24 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1244
1237
  lastClosingDate: {}
1245
1238
  },
1246
1239
  emits: ["update:show", "submitted"],
1247
- setup(s, { expose: m, emit: r }) {
1240
+ setup(o, { expose: f, emit: r }) {
1248
1241
  var G;
1249
- const n = s, f = r, t = qe(), a = Ae(), x = he(), p = Re(), o = Ve(), { t: l } = de(), v = L(!1), u = L(!1), c = L(!1);
1250
- async function C(g) {
1251
- if (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);
1243
+ async function C(_) {
1244
+ if (_) {
1252
1245
  u.value = !1;
1253
1246
  try {
1254
1247
  await x.readSuppliers(), u.value = !0;
1255
1248
  } catch {
1256
- a.open({
1257
- title: l("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1258
- message: l("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1249
+ l.open({
1250
+ title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1251
+ message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1259
1252
  type: "error"
1260
1253
  });
1261
1254
  }
1262
1255
  }
1263
1256
  }
1264
- o.watchLocation(C);
1257
+ s.watchLocation(C);
1265
1258
  function b() {
1266
1259
  return {
1267
1260
  remark: void 0,
@@ -1295,75 +1288,75 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1295
1288
  template: n.templateId
1296
1289
  };
1297
1290
  }
1298
- const h = Je(n, "show"), w = L(n.modelValue ?? b()), O = L(((G = n.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
1299
- $e(
1291
+ const h = Ge(n, "show"), w = L(n.modelValue ?? b()), O = L(((G = n.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
1292
+ Me(
1300
1293
  () => n.show,
1301
- (g) => {
1302
- var _;
1303
- g && (c.value = !1, w.value = n.modelValue ?? b(), O.value = ((_ = n.modelValue) == null ? void 0 : _._id) ?? `${Math.random()}`);
1294
+ (_) => {
1295
+ var g;
1296
+ _ && (c.value = !1, w.value = n.modelValue ?? b(), O.value = ((g = n.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1304
1297
  }
1305
1298
  );
1306
- const B = P(() => !u.value || !c.value), J = P(() => {
1299
+ const B = T(() => !u.value || !c.value), J = T(() => {
1307
1300
  switch (n.mode) {
1308
1301
  case fe.READ:
1309
1302
  return "View transfer";
1310
1303
  case fe.CREATE:
1311
- return l("inventory.transfer.receiveRequest.create.title");
1304
+ return a("inventory.transfer.receiveRequest.create.title");
1312
1305
  case fe.UPDATE:
1313
- return l("inventory.transfer.receiveRequest.update.title");
1306
+ return a("inventory.transfer.receiveRequest.update.title");
1314
1307
  }
1315
1308
  return "";
1316
1309
  }), U = L();
1317
- m({
1310
+ f({
1318
1311
  validateInputs: () => {
1319
- var g, _;
1320
- (_ = (g = U.value) == null ? void 0 : g.validateInputs) == null || _.call(g);
1312
+ var _, g;
1313
+ (g = (_ = U.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
1321
1314
  },
1322
1315
  resetInputsValidation: () => {
1323
- var g, _;
1324
- (_ = (g = U.value) == null ? void 0 : g.resetInputsValidation) == null || _.call(g);
1316
+ var _, g;
1317
+ (g = (_ = U.value) == null ? void 0 : _.resetInputsValidation) == null || g.call(_);
1325
1318
  },
1326
1319
  resetInputs: () => {
1327
- var g, _;
1328
- (_ = (g = U.value) == null ? void 0 : g.resetInputs) == null || _.call(g);
1320
+ var _, g;
1321
+ (g = (_ = U.value) == null ? void 0 : _.resetInputs) == null || g.call(_);
1329
1322
  }
1330
1323
  });
1331
1324
  async function Y() {
1332
- const g = w.value;
1333
- v.value = !0, (g.supplier.internal === "warehouse" || g.supplier.internal === "restaurant") && (g.items = g.items.map(({ totalCost: _, ...M }) => M));
1325
+ const _ = w.value;
1326
+ y.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1334
1327
  try {
1335
- await t.createPurchaseOrder(g), await new Promise((_) => setTimeout(_, 1e3)), a.open({
1336
- title: l("inventory.transfer.receiveRequest.create.success"),
1337
- message: l("inventory.transfer.receiveRequest.create.successMessage"),
1328
+ await t.createPurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), l.open({
1329
+ title: a("inventory.transfer.receiveRequest.create.success"),
1330
+ message: a("inventory.transfer.receiveRequest.create.successMessage"),
1338
1331
  type: "success"
1339
- }), f("update:show", !1), f("submitted");
1340
- } catch (_) {
1341
- a.open({
1342
- title: l("inventory.transfer.receiveRequest.create.error.title"),
1343
- message: l("inventory.transfer.receiveRequest.create.error.message"),
1332
+ }), v("update:show", !1), v("submitted");
1333
+ } catch (g) {
1334
+ l.open({
1335
+ title: a("inventory.transfer.receiveRequest.create.error.title"),
1336
+ message: a("inventory.transfer.receiveRequest.create.error.message"),
1344
1337
  type: "error"
1345
- }), console.error("Error in creating purchase order", _);
1338
+ }), console.error("Error in creating purchase order", g);
1346
1339
  } finally {
1347
- v.value = !1;
1340
+ y.value = !1;
1348
1341
  }
1349
1342
  }
1350
- async function Q() {
1351
- const g = w.value;
1352
- v.value = !0, (g.supplier.internal === "warehouse" || g.supplier.internal === "restaurant") && (g.items = g.items.map(({ totalCost: _, ...M }) => M));
1343
+ async function K() {
1344
+ const _ = w.value;
1345
+ y.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1353
1346
  try {
1354
- await t.updatePurchaseOrder(g), await new Promise((_) => setTimeout(_, 1e3)), a.open({
1355
- title: l("inventory.transfer.receiveRequest.update.success"),
1356
- message: l("inventory.transfer.receiveRequest.update.successMessage"),
1347
+ await t.updatePurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), l.open({
1348
+ title: a("inventory.transfer.receiveRequest.update.success"),
1349
+ message: a("inventory.transfer.receiveRequest.update.successMessage"),
1357
1350
  type: "success"
1358
- }), f("update:show", !1), f("submitted");
1359
- } catch (_) {
1360
- a.open({
1361
- title: l("inventory.transfer.receiveRequest.update.error.title"),
1362
- message: l("inventory.transfer.receiveRequest.update.error.message"),
1351
+ }), v("update:show", !1), v("submitted");
1352
+ } catch (g) {
1353
+ l.open({
1354
+ title: a("inventory.transfer.receiveRequest.update.error.title"),
1355
+ message: a("inventory.transfer.receiveRequest.update.error.message"),
1363
1356
  type: "error"
1364
- }), console.error("Error in updating purchase order", _);
1357
+ }), console.error("Error in updating purchase order", g);
1365
1358
  } finally {
1366
- v.value = !1;
1359
+ y.value = !1;
1367
1360
  }
1368
1361
  }
1369
1362
  function N() {
@@ -1371,56 +1364,56 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1371
1364
  case fe.CREATE:
1372
1365
  return Y();
1373
1366
  case fe.UPDATE:
1374
- return Q();
1367
+ return K();
1375
1368
  }
1376
1369
  }
1377
1370
  function H() {
1378
- var g, _;
1379
- (_ = (g = U.value) == null ? void 0 : g.validateInputs) == null || _.call(g);
1371
+ var _, g;
1372
+ (g = (_ = U.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
1380
1373
  }
1381
- return (g, _) => {
1382
- const M = T("FmButton"), oe = T("FmSideSheet");
1383
- return I(), j(oe, {
1374
+ return (_, g) => {
1375
+ const M = I("FmButton"), oe = I("FmSideSheet");
1376
+ return P(), j(oe, {
1384
1377
  modelValue: e(h),
1385
- "onUpdate:modelValue": _[3] || (_[3] = (Z) => ie(h) ? h.value = Z : null),
1378
+ "onUpdate:modelValue": g[3] || (g[3] = (Z) => ie(h) ? h.value = Z : null),
1386
1379
  "dismiss-away": "",
1387
1380
  "close-button": "",
1388
1381
  "max-width": 900
1389
1382
  }, {
1390
1383
  "side-sheet-header": V(() => [
1391
- d("div", Ss, [
1392
- d("div", Is, D(J.value), 1)
1384
+ d("div", hs, [
1385
+ d("div", ws, D(J.value), 1)
1393
1386
  ])
1394
1387
  ]),
1395
1388
  default: V(() => [
1396
- (I(), j(xs, {
1389
+ (P(), j(ks, {
1397
1390
  class: "w-full",
1398
1391
  ref_key: "formRef",
1399
1392
  ref: U,
1400
- "onForm:ready": _[0] || (_[0] = () => c.value = !0),
1393
+ "onForm:ready": g[0] || (g[0] = () => c.value = !0),
1401
1394
  onValidationSuccess: N,
1402
1395
  modelValue: w.value,
1403
- "onUpdate:modelValue": _[1] || (_[1] = (Z) => w.value = Z),
1404
- disabled: v.value || B.value,
1396
+ "onUpdate:modelValue": g[1] || (g[1] = (Z) => w.value = Z),
1397
+ disabled: y.value || B.value,
1405
1398
  suppliers: e(x).suppliers,
1406
1399
  skus: e(p).skus,
1407
1400
  key: O.value,
1408
- "last-closing-date": g.lastClosingDate
1401
+ "last-closing-date": _.lastClosingDate
1409
1402
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1410
1403
  ]),
1411
1404
  "side-sheet-footer": V(() => [
1412
- d("div", Ps, [
1405
+ d("div", xs, [
1413
1406
  k(M, {
1414
- loading: v.value,
1407
+ loading: y.value,
1415
1408
  disabled: B.value,
1416
- label: e(l)("common.save"),
1409
+ label: e(a)("common.save"),
1417
1410
  onClick: H
1418
1411
  }, null, 8, ["loading", "disabled", "label"]),
1419
1412
  k(M, {
1420
1413
  disabled: B.value,
1421
1414
  variant: "tertiary",
1422
- label: e(l)("common.close"),
1423
- onClick: _[2] || (_[2] = (Z) => f("update:show", !1))
1415
+ label: e(a)("common.close"),
1416
+ onClick: g[2] || (g[2] = (Z) => v("update:show", !1))
1424
1417
  }, null, 8, ["disabled", "label"])
1425
1418
  ])
1426
1419
  ]),
@@ -1430,7 +1423,6 @@ const ns = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, as = { key: 0 }
1430
1423
  }
1431
1424
  });
1432
1425
  export {
1433
- Es as _,
1434
- te as c,
1435
- ht as d
1426
+ Us as _,
1427
+ te as c
1436
1428
  };