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