@feedmepos/mf-inventory-portal 0.0.22-dev.12 → 0.0.22-dev.15

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 (45) hide show
  1. package/dist/{ApprovalView-Cjeqabxg.js → ApprovalView-BOP6b_Yd.js} +4 -4
  2. package/dist/{BindingsDialog-DYf9izzO.js → BindingsDialog-BLyRf9wO.js} +1 -1
  3. package/dist/{BindingsPicker--GhOF5Zy.js → BindingsPicker-CNbfKeSB.js} +8 -8
  4. package/dist/{BindingsTable-DFGX1bO_.js → BindingsTable-CH73rDTZ.js} +1 -1
  5. package/dist/{ClosingTemplateView-D0ZehXOT.js → ClosingTemplateView-c572PM5W.js} +5 -5
  6. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CzXWOCCv.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CpmzTuAj.js} +1 -1
  7. package/dist/{IngredientsView-D-M4VjtX.js → IngredientsView-CdE3WOqJ.js} +3 -3
  8. package/dist/{IntegrationView-D29NyKuw.js → IntegrationView-B29NSwpf.js} +2 -2
  9. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DMzUk8cN.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CZsQjzBa.js} +1 -1
  10. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CrYQR5oS.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BwKpNPDY.js} +1 -1
  11. package/dist/{PurchaseOrderPrintPreview-BmzWBQYf.js → PurchaseOrderPrintPreview-mHevDWzN.js} +1 -1
  12. package/dist/{ReceiveRequestView-D5uhgByr.js → ReceiveRequestView-Bl4SuM6j.js} +6 -6
  13. package/dist/{RecipeView-CREeE1nK.js → RecipeView-BHBJlY-_.js} +3 -3
  14. package/dist/Standalone.vue.d.ts +2 -0
  15. package/dist/{StockView-jAGaTT7q.js → StockView-C4z9Qi7T.js} +6 -6
  16. package/dist/{SupplierView-BjkhByNr.js → SupplierView-CXyWhB9D.js} +3 -3
  17. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CInXmMf_.js → TransferDetails.vue_vue_type_script_setup_true_lang-C_cTUji8.js} +178 -177
  18. package/dist/{TransferDialog.vue_vue_type_script_setup_true_lang-CLiLhIMS.js → TransferDialog.vue_vue_type_script_setup_true_lang-DV59BWff.js} +440 -437
  19. package/dist/TransferTemplateView-Dpxk9Zwt.js +1209 -0
  20. package/dist/{UnitView-BrlpQn3T.js → UnitView-BQlwparN.js} +4 -4
  21. package/dist/{WarehouseView-CbTTIdv9.js → WarehouseView-Cu7pKilf.js} +2 -2
  22. package/dist/{app-BDzV3RNp.js → app-CFkNddzq.js} +3414 -3396
  23. package/dist/app.js +1 -1
  24. package/dist/components/FmMinMaxInputRules.d.ts +2 -0
  25. package/dist/components/FmUnitInputRules.d.ts +2 -0
  26. package/dist/{decimal-CRTw2PGO.js → decimal-D0W3dojG.js} +1 -1
  27. package/dist/{defineDeepModel-BoSSw2c6.js → defineDeepModel-DWffbsZh.js} +1 -1
  28. package/dist/{format-time-from-id-CxoHtJa5.js → format-time-from-id-BZAepMJZ.js} +1 -1
  29. package/dist/helper/rules.d.ts +7 -1
  30. package/dist/helper/rules.spec.d.ts +1 -0
  31. package/dist/{id-to-date-CJbxtIFh.js → id-to-date-BJEGh6zQ.js} +1 -1
  32. package/dist/{purchase-order-transaction-type-0nZnCUE7.js → purchase-order-transaction-type-CAJDFGQP.js} +28 -27
  33. package/dist/{supplier-BA6jJGNv.js → supplier-ChSqlZUK.js} +1 -1
  34. package/dist/tsconfig.app.tsbuildinfo +1 -1
  35. package/dist/{use-template-enabled-locations-2-Di0NHn-g.js → use-template-enabled-locations-2-B4M8z0b7.js} +1 -1
  36. package/dist/views/receive-request/components/transfer-details/TransferDetailsProps.d.ts +1 -0
  37. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +522 -0
  38. package/dist/views/receive-request/components/transfer-form/TransferFormProps.d.ts +1 -0
  39. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +21 -0
  40. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +21 -0
  41. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +1 -1
  42. package/dist/{xlsx-BEDKASqP.js → xlsx-BH3xrhEk.js} +1 -1
  43. package/dist/{xlsx.util-MTUBPx67.js → xlsx.util-DlY5MITI.js} +2 -2
  44. package/package.json +1 -1
  45. package/dist/TransferTemplateView-CUqEsRJ6.js +0 -1262
@@ -1,24 +1,24 @@
1
1
  import { reactive as Ge, onMounted as Ee, computed as P, h as M, defineComponent as re, openBlock as F, createElementBlock as I, Fragment as ae, renderList as Pe, createElementVNode as r, toDisplayString as V, unref as e, resolveComponent as T, createVNode as k, withCtx as O, createCommentVNode as H, ref as N, createBlock as z, watch as Le, normalizeClass as Y, normalizeStyle as et, isRef as ce } from "vue";
2
2
  import { useBreakpoints as qe, components as de, FmButtonVariant as tt, useSnackbar as $e, useDialog as st, useProxiedModel as ot } from "@feedmepos/ui-library";
3
3
  import { F as be } from "./row-action.enum-PMKMRrZR.js";
4
- import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-0nZnCUE7.js";
5
- import { a as Z, t as lt, aa as Te, E as at, b as He, R as Ie, a4 as rt, a5 as it, s as ut, a6 as Be, H as ze, l as dt, A as Se, M as ct, ab as je, P as Ae, Q as Qe, ac as pt, j as Ve, ad as mt, u as De, ae as ft, af as yt, ag as vt, G as bt, ah as _t, ai as gt, z as kt } from "./app-BDzV3RNp.js";
6
- import { _ as We, u as Ct } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-CrYQR5oS.js";
4
+ import { P as A, d as Ne, c as nt } from "./purchase-order-transaction-type-CAJDFGQP.js";
5
+ import { a as Z, t as lt, ab as Te, E as at, b as He, R as Ie, a5 as rt, a7 as it, s as ut, a8 as Be, a6 as dt, H as ze, l as ct, A as Se, M as pt, ac as je, P as Ae, Q as Qe, ad as mt, j as Ve, ae as ft, u as De, af as yt, ag as vt, ah as bt, G as _t, ai as gt, aj as kt, z as Ct } from "./app-CFkNddzq.js";
6
+ import { _ as We, u as ht } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BwKpNPDY.js";
7
7
  import { useI18n as me } from "@feedmepos/mf-common";
8
8
  import "vue-router";
9
- import { u as xe } from "./supplier-BA6jJGNv.js";
10
- import { d as ht } from "./defineDeepModel-BoSSw2c6.js";
11
- import { F as pe, _ as wt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
- import { _ as St } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
- function le(o, y, u, l) {
14
- var d, c, g;
15
- if (l != null && l.manualTotalCost)
16
- return l == null ? void 0 : l.manualTotalCost;
17
- const _ = (g = (c = (d = l == null ? void 0 : l.supplier) == null ? void 0 : d.supplyItems) == null ? void 0 : c.find(
18
- (m) => m.skuId === o._id
19
- )) == null ? void 0 : g.defaultCost, t = o.defaultCost, n = _ ?? t, w = n == null ? void 0 : n.costPerUnit, p = w ? n != null && n.measurement ? +Z(w) / +Z(n == null ? void 0 : n.measurement.conversion) : +Z(w) : void 0, s = p ? u ? p * +Z(u.conversion) : p : void 0, i = s ? +Z(y) * s : void 0;
20
- return i ? {
21
- ...lt(i ?? 0, 2),
9
+ import { u as xe } from "./supplier-ChSqlZUK.js";
10
+ import { d as wt } from "./defineDeepModel-DWffbsZh.js";
11
+ import { F as pe, _ as St } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
12
+ import { _ as xt } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
13
+ function le(o, v, u, i) {
14
+ var c, p, g;
15
+ if (i != null && i.manualTotalCost)
16
+ return i == null ? void 0 : i.manualTotalCost;
17
+ const d = (g = (p = (c = i == null ? void 0 : i.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find(
18
+ (f) => f.skuId === o._id
19
+ )) == null ? void 0 : g.defaultCost, t = o.defaultCost, n = d ?? t, w = n == null ? void 0 : n.costPerUnit, m = w ? n != null && n.measurement ? +Z(w) / +Z(n == null ? void 0 : n.measurement.conversion) : +Z(w) : void 0, s = m ? u ? m * +Z(u.conversion) : m : void 0, a = s ? +Z(v) * s : void 0;
20
+ return a ? {
21
+ ...lt(a ?? 0, 2),
22
22
  currency: Te()
23
23
  } : {
24
24
  amount: 0,
@@ -27,7 +27,7 @@ function le(o, y, u, l) {
27
27
  };
28
28
  }
29
29
  var B = /* @__PURE__ */ ((o) => (o.Code = "Code", o.Name = "Name", o.Amount = "Amount", o.Cost = "Cost", o.Delete = "Delete", o))(B || {});
30
- const xt = () => {
30
+ const Ft = () => {
31
31
  const { t: o } = me();
32
32
  return M(
33
33
  We,
@@ -38,36 +38,36 @@ const xt = () => {
38
38
  o("inventory.transfer.form.items.table.Cost", [je()])
39
39
  );
40
40
  };
41
- function Ft(o) {
42
- const { t: y } = me(), u = Ge({}), { breakpoints: l } = qe(), _ = He();
41
+ function Pt(o) {
42
+ const { t: v } = me(), u = Ge({}), { breakpoints: i } = qe(), d = He();
43
43
  Ee(() => {
44
- for (const p of o.items) {
45
- if (!p.totalCost)
44
+ for (const m of o.items) {
45
+ if (!m.totalCost)
46
46
  continue;
47
- const s = le(p.sku, p.quantity, p.measurement, {
47
+ const s = le(m.sku, m.quantity, m.measurement, {
48
48
  supplier: o.supplier
49
- }), i = p.totalCost ?? at.reset();
50
- s ? u[p.sku._id] = s.amount !== i.amount || s.precision !== i.precision : u[p.sku._id] = !0;
49
+ }), a = m.totalCost ?? at.reset();
50
+ s ? u[m.sku._id] = s.amount !== a.amount || s.precision !== a.precision : u[m.sku._id] = !0;
51
51
  }
52
52
  });
53
- function t(p) {
54
- var i, v, d, c, g, m, S;
55
- return !!(((v = (i = p.defaultCost) == null ? void 0 : i.costPerUnit) == null ? void 0 : v.amount) ?? ((S = (m = (g = (c = (d = o.supplier) == null ? void 0 : d.supplyItems) == null ? void 0 : c.find((x) => x.skuId === p._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : m.costPerUnit) == null ? void 0 : S.amount));
53
+ function t(m) {
54
+ var a, b, c, p, g, f, S;
55
+ return !!(((b = (a = m.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (f = (g = (p = (c = o.supplier) == null ? void 0 : c.supplyItems) == null ? void 0 : p.find((x) => x.skuId === m._id)) == null ? void 0 : g.defaultCost) == null ? void 0 : f.costPerUnit) == null ? void 0 : S.amount));
56
56
  }
57
57
  const n = [
58
58
  {
59
59
  id: "Code",
60
- header: () => y("inventory.transfer.form.items.table.Code"),
60
+ header: () => v("inventory.transfer.form.items.table.Code"),
61
61
  accessorKey: "code",
62
62
  size: 96,
63
- cell(p) {
64
- const s = p.row.original;
63
+ cell(m) {
64
+ const s = m.row.original;
65
65
  return M(de.FmTextField, {
66
66
  modelValue: s.code,
67
- "onUpdate:modelValue": (i) => {
67
+ "onUpdate:modelValue": (a) => {
68
68
  o.updateItem({
69
69
  ...s,
70
- code: i
70
+ code: a
71
71
  });
72
72
  },
73
73
  key: s.sku._id,
@@ -79,16 +79,16 @@ function Ft(o) {
79
79
  },
80
80
  {
81
81
  id: "Name",
82
- header: () => y("inventory.transfer.form.items.table.Name"),
82
+ header: () => v("inventory.transfer.form.items.table.Name"),
83
83
  minSize: 300,
84
- cell(p) {
85
- const s = p.row.original;
84
+ cell(m) {
85
+ const s = m.row.original;
86
86
  return M(de.FmTextField, {
87
87
  modelValue: s.name,
88
- "onUpdate:modelValue": (i) => {
88
+ "onUpdate:modelValue": (a) => {
89
89
  o.updateItem({
90
90
  ...s,
91
- name: i
91
+ name: a
92
92
  });
93
93
  },
94
94
  key: s.sku._id,
@@ -100,11 +100,11 @@ function Ft(o) {
100
100
  },
101
101
  {
102
102
  id: "Amount",
103
- header: () => y("inventory.transfer.form.items.table.Amount"),
103
+ header: () => v("inventory.transfer.form.items.table.Amount"),
104
104
  minSize: 200,
105
- cell(p) {
106
- var v, d, c;
107
- const s = p.row.original, i = (c = (d = (v = o.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : d.items) == null ? void 0 : c.find(
105
+ cell(m) {
106
+ var b, c, p;
107
+ const s = m.row.original, a = (p = (c = (b = o.template) == null ? void 0 : b.purchaseOrder) == null ? void 0 : c.items) == null ? void 0 : p.find(
108
108
  (g) => g.sku._id === s.sku._id
109
109
  );
110
110
  return M(rt, {
@@ -118,33 +118,34 @@ function Ft(o) {
118
118
  key: s.sku._id,
119
119
  unit: s.sku.unit,
120
120
  "onUpdate:modelValue": (g) => {
121
- const m = {
121
+ const f = {
122
122
  ...s,
123
123
  quantity: g.amount,
124
124
  measurement: g.measurement
125
125
  };
126
- _.enableTotalCost && (m.totalCost = le(s.sku, s.quantity, s.measurement, {
126
+ d.enableTotalCost && (f.totalCost = le(s.sku, s.quantity, s.measurement, {
127
127
  supplier: o.supplier,
128
128
  // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
129
129
  // will return the auto calculated default cost instead of the manual total cost
130
- manualTotalCost: u[s.sku._id] ? m.totalCost : void 0
131
- })), o.updateItem(m);
130
+ manualTotalCost: u[s.sku._id] ? f.totalCost : void 0
131
+ })), o.updateItem(f);
132
132
  },
133
- stepper: i == null ? void 0 : i.quantityStep,
134
- disableUnit: !!i,
133
+ stepper: a == null ? void 0 : a.quantityStep,
134
+ disableUnit: !!a,
135
135
  disabled: o.disabled,
136
136
  rules: [
137
137
  it(
138
138
  +Z(
139
- (i == null ? void 0 : i.minimumQuantity) ?? {
139
+ (a == null ? void 0 : a.minimumQuantity) ?? {
140
140
  amount: 1,
141
141
  precision: ut(s.sku.unit, s.measurement)
142
142
  }
143
143
  )
144
144
  ),
145
- i != null && i.maximumQuantity ? Be(
146
- +Z(i == null ? void 0 : i.maximumQuantity)
147
- ) : Be(1 / 0)
145
+ a != null && a.maximumQuantity ? Be(
146
+ +Z(a == null ? void 0 : a.maximumQuantity)
147
+ ) : Be(1 / 0),
148
+ ...a != null && a.quantityStep ? [dt(a.quantityStep)] : []
148
149
  ],
149
150
  applyDefaultRules: !0
150
151
  });
@@ -153,11 +154,11 @@ function Ft(o) {
153
154
  },
154
155
  {
155
156
  id: "Cost",
156
- header: xt,
157
+ header: Ft,
157
158
  size: 180,
158
- cell(p) {
159
- const s = p.row.original, i = t(s.sku), v = l.value.xs || l.value.sm;
160
- return !u[s.sku._id] && i ? M(
159
+ cell(m) {
160
+ const s = m.row.original, a = t(s.sku), b = i.value.xs || i.value.sm;
161
+ return !u[s.sku._id] && a ? M(
161
162
  "div",
162
163
  {
163
164
  class: [
@@ -188,7 +189,7 @@ function Ft(o) {
188
189
  [
189
190
  M(
190
191
  "span",
191
- v ? ze(
192
+ b ? ze(
192
193
  le(s.sku, s.quantity, s.measurement, {
193
194
  supplier: o.supplier
194
195
  })
@@ -206,7 +207,7 @@ function Ft(o) {
206
207
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
207
208
  ]
208
209
  },
209
- y("inventory.transfer.form.items.autoCalculated")
210
+ v("inventory.transfer.form.items.autoCalculated")
210
211
  )
211
212
  ]
212
213
  )
@@ -216,20 +217,20 @@ function Ft(o) {
216
217
  {
217
218
  modelValue: Z(s.totalCost ?? { amount: 0, precision: 0 }),
218
219
  key: s.sku._id,
219
- "onUpdate:modelValue": (d) => {
220
+ "onUpdate:modelValue": (c) => {
220
221
  o.updateItem({
221
222
  ...s,
222
223
  totalCost: {
223
- ...dt(+d),
224
+ ...ct(+c),
224
225
  currency: Te()
225
226
  }
226
227
  });
227
228
  },
228
- rules: [Se(0), ct(2)]
229
+ rules: [Se(0), pt(2)]
229
230
  },
230
231
  {
231
232
  prepend() {
232
- return v ? M(
233
+ return b ? M(
233
234
  "div",
234
235
  {
235
236
  class: [
@@ -241,7 +242,7 @@ function Ft(o) {
241
242
  ) : null;
242
243
  },
243
244
  append() {
244
- return i ? M(de.FmButton, {
245
+ return a ? M(de.FmButton, {
245
246
  prependIcon: "close",
246
247
  variant: "tertiary",
247
248
  disabled: o.disabled,
@@ -265,8 +266,8 @@ function Ft(o) {
265
266
  {
266
267
  id: "Delete",
267
268
  header: "",
268
- cell(p) {
269
- const s = p.row.original;
269
+ cell(m) {
270
+ const s = m.row.original;
270
271
  return M(de.FmButton, {
271
272
  key: s.sku._id,
272
273
  class: "delete-button",
@@ -289,46 +290,46 @@ function Ft(o) {
289
290
  }
290
291
  ];
291
292
  return {
292
- columnDefs: P(() => _.enableTotalCost && o.transferType === A.PURCHASE ? n : n.filter(
293
- (p) => p.id !== "Cost"
293
+ columnDefs: P(() => d.enableTotalCost && o.transferType === A.PURCHASE ? n : n.filter(
294
+ (m) => m.id !== "Cost"
294
295
  /* Cost */
295
296
  ))
296
297
  };
297
298
  }
298
- const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Tt = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, It = { class: "w-[450px] xs:w-full flex" }, $t = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, At = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ re({
299
+ const Tt = { 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" }, $t = { class: "w-[450px] xs:w-full flex" }, At = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Vt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ye = /* @__PURE__ */ re({
299
300
  __name: "SupplierPriceHistory",
300
301
  props: {
301
302
  prices: {}
302
303
  },
303
304
  setup(o) {
304
- const y = xe();
305
- function u(l) {
306
- return y.suppliers.find((_) => _._id === l);
305
+ const v = xe();
306
+ function u(i) {
307
+ return v.suppliers.find((d) => d._id === i);
307
308
  }
308
- return (l, _) => (F(), I("div", Pt, [
309
- (F(!0), I(ae, null, Pe(Object.keys(l.prices), (t) => {
309
+ return (i, d) => (F(), I("div", Tt, [
310
+ (F(!0), I(ae, null, Pe(Object.keys(i.prices), (t) => {
310
311
  var n;
311
312
  return F(), I("div", {
312
313
  key: t,
313
314
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
314
315
  }, [
315
- r("div", Tt, V((n = u(t)) == null ? void 0 : n.name), 1),
316
- r("div", It, [
317
- (F(!0), I(ae, null, Pe(l.prices[t].slice(0, 3), (w) => {
318
- var p;
316
+ r("div", It, V((n = u(t)) == null ? void 0 : n.name), 1),
317
+ r("div", $t, [
318
+ (F(!0), I(ae, null, Pe(i.prices[t].slice(0, 3), (w) => {
319
+ var m;
319
320
  return F(), I("div", {
320
321
  key: w.date,
321
322
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
322
323
  }, [
323
- r("div", $t, [
324
+ r("div", At, [
324
325
  r("span", null, V(w.totalCost ? e(ze)(w.totalCost) : "No data"), 1),
325
- _[0] || (_[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
326
+ d[0] || (d[0] = r("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
326
327
  r("span", null, V(e(Z)(w.totalUnit, !1)), 1),
327
- r("span", null, V(((p = w.measurement) == null ? void 0 : p.abbrev) ?? w.unit.abbrev), 1)
328
+ r("span", null, V(((m = w.measurement) == null ? void 0 : m.abbrev) ?? w.unit.abbrev), 1)
328
329
  ]),
329
- r("div", At, [
330
+ r("div", Vt, [
330
331
  r("span", null, "(#" + V(w.seqNumber) + ")", 1),
331
- _[1] || (_[1] = r("span", null, V(" "), -1)),
332
+ d[1] || (d[1] = r("span", null, V(" "), -1)),
332
333
  r("span", null, V(e(Ae)(new Date(w.date))), 1)
333
334
  ])
334
335
  ]);
@@ -338,10 +339,10 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
338
339
  }), 128))
339
340
  ]));
340
341
  }
341
- }), Vt = { 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" }, Ut = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Bt = { 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 = {
342
+ }), Dt = { class: "flex flex-col gap-8 py-16" }, Rt = { class: "flex items-center" }, Ot = { class: "flex-1 flex gap-1 items-center" }, Ut = { 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" }, Mt = { class: "flex gap-8 w-full" }, Et = { class: "flex-1 flex flex-col gap-4" }, Lt = { class: "flex-1 flex flex-col gap-4" }, qt = { class: "flex gap-8 w-full" }, Nt = { class: "flex-1 flex flex-col gap-4" }, Ht = {
342
343
  key: 0,
343
344
  class: "flex-1 flex flex-col gap-4"
344
- }, Ht = /* @__PURE__ */ re({
345
+ }, zt = /* @__PURE__ */ re({
345
346
  __name: "TransferItem",
346
347
  props: {
347
348
  cellByColId: {},
@@ -350,70 +351,70 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
350
351
  row: {}
351
352
  },
352
353
  setup(o) {
353
- const { t: y } = me();
354
- return (u, l) => {
355
- var n, w, p, s, i, v, d, c, g, m, S, x, E, $, U, L, G, ee, K, J, j, b, C, D, te, Q, se;
356
- const _ = T("FmLabel"), t = T("FmSpacer");
357
- return F(), I("div", Vt, [
358
- r("div", Dt, [
359
- r("div", Rt, [
360
- r("span", Ot, " (" + V(u.row.original.sku.code) + ") ", 1),
361
- r("span", Ut, V(u.row.original.sku.name), 1)
354
+ const { t: v } = me();
355
+ return (u, i) => {
356
+ var n, w, m, s, a, b, c, p, g, f, S, x, E, $, U, L, G, ee, K, J, j, _, C, D, te, Q, se;
357
+ const d = T("FmLabel"), t = T("FmSpacer");
358
+ return F(), I("div", Dt, [
359
+ r("div", Rt, [
360
+ r("div", Ot, [
361
+ r("span", Ut, " (" + V(u.row.original.sku.code) + ") ", 1),
362
+ r("span", Bt, V(u.row.original.sku.name), 1)
362
363
  ]),
363
364
  r("div", null, [
364
365
  k(e(pe), {
365
- render: (p = (w = (n = u.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : w.columnDef) == null ? void 0 : p.cell,
366
- props: (i = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : i.call(s)
366
+ render: (m = (w = (n = u.cellByColId.Delete) == null ? void 0 : n.column) == null ? void 0 : w.columnDef) == null ? void 0 : m.cell,
367
+ props: (a = (s = u.cellByColId.Delete) == null ? void 0 : s.getContext) == null ? void 0 : a.call(s)
367
368
  }, null, 8, ["render", "props"])
368
369
  ])
369
370
  ]),
370
- r("div", Bt, [
371
- r("div", Mt, [
372
- k(_, {
373
- label: e(y)(`inventory.transfer.form.items.table.${e(B).Code}`)
371
+ r("div", Mt, [
372
+ r("div", Et, [
373
+ k(d, {
374
+ label: e(v)(`inventory.transfer.form.items.table.${e(B).Code}`)
374
375
  }, null, 8, ["label"]),
375
376
  k(e(pe), {
376
- render: (c = (d = (v = u.cellByColId[e(B).Code]) == null ? void 0 : v.column) == null ? void 0 : d.columnDef) == null ? void 0 : c.cell,
377
- props: (m = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : m.call(g)
377
+ render: (p = (c = (b = u.cellByColId[e(B).Code]) == null ? void 0 : b.column) == null ? void 0 : c.columnDef) == null ? void 0 : p.cell,
378
+ props: (f = (g = u.cellByColId[e(B).Code]) == null ? void 0 : g.getContext) == null ? void 0 : f.call(g)
378
379
  }, null, 8, ["render", "props"]),
379
- l[0] || (l[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
380
+ i[0] || (i[0] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
380
381
  ]),
381
- r("div", Et, [
382
- k(_, {
383
- label: e(y)(`inventory.transfer.form.items.table.${e(B).Name}`)
382
+ r("div", Lt, [
383
+ k(d, {
384
+ label: e(v)(`inventory.transfer.form.items.table.${e(B).Name}`)
384
385
  }, null, 8, ["label"]),
385
386
  k(e(pe), {
386
387
  render: (E = (x = (S = u.cellByColId[e(B).Name]) == null ? void 0 : S.column) == null ? void 0 : x.columnDef) == null ? void 0 : E.cell,
387
388
  props: (U = ($ = u.cellByColId[e(B).Name]) == null ? void 0 : $.getContext) == null ? void 0 : U.call($)
388
389
  }, null, 8, ["render", "props"]),
389
- l[1] || (l[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
390
+ i[1] || (i[1] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
390
391
  ])
391
392
  ]),
392
- r("div", Lt, [
393
- r("div", qt, [
394
- k(_, {
395
- label: e(y)(`inventory.transfer.form.items.table.${e(B).Amount}`)
393
+ r("div", qt, [
394
+ r("div", Nt, [
395
+ k(d, {
396
+ label: e(v)(`inventory.transfer.form.items.table.${e(B).Amount}`)
396
397
  }, null, 8, ["label"]),
397
398
  k(e(pe), {
398
399
  render: (ee = (G = (L = u.cellByColId[e(B).Amount]) == null ? void 0 : L.column) == null ? void 0 : G.columnDef) == null ? void 0 : ee.cell,
399
400
  props: (J = (K = u.cellByColId[e(B).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : J.call(K)
400
401
  }, null, 8, ["render", "props"]),
401
- l[2] || (l[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
402
+ i[2] || (i[2] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
402
403
  ]),
403
- u.cellByColId[e(B).Cost] ? (F(), I("div", Nt, [
404
+ u.cellByColId[e(B).Cost] ? (F(), I("div", Ht, [
404
405
  k(We, { "z-index": 50 }, {
405
406
  default: O(() => [
406
- k(_, {
407
- label: e(y)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
407
+ k(d, {
408
+ label: e(v)(`inventory.transfer.form.items.table.${e(B).Cost}2`)
408
409
  }, null, 8, ["label"])
409
410
  ]),
410
411
  _: 1
411
412
  }),
412
413
  k(e(pe), {
413
- render: (C = (b = (j = u.cellByColId[e(B).Cost]) == null ? void 0 : j.column) == null ? void 0 : b.columnDef) == null ? void 0 : C.cell,
414
+ render: (C = (_ = (j = u.cellByColId[e(B).Cost]) == null ? void 0 : j.column) == null ? void 0 : _.columnDef) == null ? void 0 : C.cell,
414
415
  props: (te = (D = u.cellByColId[e(B).Cost]) == null ? void 0 : D.getContext) == null ? void 0 : te.call(D)
415
416
  }, null, 8, ["render", "props"]),
416
- l[3] || (l[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
417
+ i[3] || (i[3] = r("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
417
418
  ])) : H("", !0)
418
419
  ]),
419
420
  u.showComparePrice && Object.keys(u.comparePriceBySku[(Q = u.row.original.sku) == null ? void 0 : Q._id] ?? {}).length > 0 ? (F(), I(ae, { key: 0 }, [
@@ -427,7 +428,7 @@ const Pt = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
427
428
  }
428
429
  });
429
430
  function _e(o) {
430
- return pt.parse(o);
431
+ return mt.parse(o);
431
432
  }
432
433
  function we(o) {
433
434
  return {
@@ -441,86 +442,86 @@ function we(o) {
441
442
  address: o.doc.profile.address
442
443
  };
443
444
  }
444
- function zt(o, y) {
445
- const u = xe(), l = Ve(), _ = P(() => !l.businessLevel);
446
- l.watchLocation(async () => {
445
+ function jt(o, v, u = !1) {
446
+ const i = xe(), d = Ve();
447
+ d.watchLocation(async () => {
447
448
  var S;
448
- await u.readSuppliers();
449
- const d = o();
450
- if ((S = d.supplier) != null && S._id) return;
451
- const c = l.businessLevel ? u.businessSuppliers[0] : u.suppliers[0], m = (_.value ? l.locations.filter((x) => x.doc._id !== l.currentLocation.doc._id) : l.locations)[0];
452
- y({
453
- ...d,
454
- supplier: c ? _e(c) : m ? we(m) : d.supplier
449
+ await i.readSuppliers();
450
+ const c = o();
451
+ if ((S = c.supplier) != null && S._id) return;
452
+ const p = d.businessLevel ? i.businessSuppliers[0] : i.suppliers[0], f = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations)[0];
453
+ v({
454
+ ...c,
455
+ supplier: p ? _e(p) : f ? we(f) : c.supplier
455
456
  });
456
457
  });
457
458
  const t = P(
458
459
  () => {
459
- var d, c;
460
- return typeof ((c = (d = o()) == null ? void 0 : d.supplier) == null ? void 0 : c.internal) == "string" ? A.TRANSFER : A.PURCHASE;
460
+ var c, p;
461
+ return typeof ((p = (c = o()) == null ? void 0 : c.supplier) == null ? void 0 : p.internal) == "string" ? A.TRANSFER : A.PURCHASE;
461
462
  }
462
463
  ), n = P({
463
464
  get() {
464
- var d, c;
465
- return (c = (d = o()) == null ? void 0 : d.supplier) == null ? void 0 : c._id;
465
+ var c, p;
466
+ return (p = (c = o()) == null ? void 0 : c.supplier) == null ? void 0 : p._id;
466
467
  },
467
- set(d) {
468
- const c = o() ?? {};
468
+ set(c) {
469
+ const p = o() ?? {};
469
470
  if (t.value === A.PURCHASE) {
470
- const E = (l.businessLevel ? u.businessSuppliers : u.suppliers).find(($) => $._id === d);
471
- y({
472
- ...c,
473
- supplier: E ? _e(E) : c.supplier
471
+ const E = (d.businessLevel ? i.businessSuppliers : i.suppliers).find(($) => $._id === c);
472
+ v({
473
+ ...p,
474
+ supplier: E ? _e(E) : p.supplier
474
475
  });
475
476
  return;
476
477
  }
477
- const S = (_.value ? l.locations.filter((x) => x.doc._id !== l.currentLocation.doc._id) : l.locations).find((x) => x.doc._id === d);
478
- y({
479
- ...c,
480
- supplier: S ? we(S) : c.supplier
478
+ const S = (u ? d.locations.filter((x) => x.doc._id !== d.currentLocation.doc._id) : d.locations).find((x) => x.doc._id === c);
479
+ v({
480
+ ...p,
481
+ supplier: S ? we(S) : p.supplier
481
482
  });
482
483
  }
483
- }), w = P(() => u.locationSuppliers.map(_e)), p = P(() => u.businessSuppliers.map(_e)), s = P(() => {
484
+ }), w = P(() => i.locationSuppliers.map(_e)), m = P(() => i.businessSuppliers.map(_e)), s = P(() => {
484
485
  var g;
485
- const d = ((g = l._currentLocation) == null ? void 0 : g.type) === Qe.warehouse;
486
- return (_.value ? l.locations.filter((m) => m.doc._id !== l.currentLocation.doc._id) : l.locations).filter((m) => d || m.acceptRequest).map(we);
487
- }), i = P(() => {
486
+ const c = ((g = d._currentLocation) == null ? void 0 : g.type) === Qe.warehouse;
487
+ return (u ? d.locations.filter((f) => f.doc._id !== d.currentLocation.doc._id) : d.locations).filter((f) => c || f.acceptRequest).map(we);
488
+ }), a = P(() => {
488
489
  if (t.value === A.PURCHASE) {
489
- const c = w.value.map((m) => ({
490
- label: m.name,
491
- value: m._id
492
- })), g = p.value.map((m) => ({
493
- label: m.name,
490
+ const p = w.value.map((f) => ({
491
+ label: f.name,
492
+ value: f._id
493
+ })), g = m.value.map((f) => ({
494
+ label: f.name,
494
495
  sublabel: "Business supplier",
495
- value: m._id
496
+ value: f._id
496
497
  }));
497
- return l.businessLevel ? g : [...c, ...g];
498
+ return d.businessLevel ? g : [...p, ...g];
498
499
  }
499
- return s.value.map((c) => ({
500
- label: c.name,
501
- sublabel: c.internal ? `${c.internal}` : void 0,
502
- value: c._id
500
+ return s.value.map((p) => ({
501
+ label: p.name,
502
+ sublabel: p.internal ? `${p.internal}` : void 0,
503
+ value: p._id
503
504
  }));
504
- }), v = P(() => {
505
- var m, S;
506
- const d = (S = (m = o()) == null ? void 0 : m.supplier) == null ? void 0 : S._id;
505
+ }), b = P(() => {
506
+ var f, S;
507
+ const c = (S = (f = o()) == null ? void 0 : f.supplier) == null ? void 0 : S._id;
507
508
  if (t.value === A.PURCHASE) {
508
- const x = u.suppliers.find((E) => E._id === d);
509
+ const x = i.suppliers.find((E) => E._id === c);
509
510
  return x ? _e(x) : null;
510
511
  }
511
- const g = l.locations.find((x) => x.doc._id);
512
+ const g = d.locations.find((x) => x.doc._id);
512
513
  return g ? we(g) : null;
513
514
  });
514
515
  return {
515
516
  transferLocationModel: n,
516
- transferLocationOptions: i,
517
+ transferLocationOptions: a,
517
518
  locationOptionsTypePurchase: w,
518
519
  locationOptionsTypeTransfer: s,
519
- selectedLocation: v
520
+ selectedLocation: b
520
521
  };
521
522
  }
522
- function jt(o) {
523
- const y = P({
523
+ function Qt(o) {
524
+ const v = P({
524
525
  get() {
525
526
  const t = o.getEffectiveAt();
526
527
  return t ? new Date(t) : null;
@@ -530,40 +531,40 @@ function jt(o) {
530
531
  }
531
532
  }), u = P({
532
533
  get() {
533
- return !!y.value;
534
+ return !!v.value;
534
535
  },
535
536
  set(t) {
536
- t ? y.value = /* @__PURE__ */ new Date() : y.value = null;
537
+ t ? v.value = /* @__PURE__ */ new Date() : v.value = null;
537
538
  }
538
- }), l = P({
539
+ }), i = P({
539
540
  get() {
540
- return y.value === null ? "" : Ae(y.value);
541
+ return v.value === null ? "" : Ae(v.value);
541
542
  },
542
543
  set(t) {
543
- t ? y.value = /* @__PURE__ */ new Date(`${t} ${_.value}`) : y.value = null;
544
+ t ? v.value = /* @__PURE__ */ new Date(`${t} ${d.value}`) : v.value = null;
544
545
  }
545
- }), _ = P({
546
+ }), d = P({
546
547
  get() {
547
- return y.value === null ? "" : mt(y.value);
548
+ return v.value === null ? "" : ft(v.value);
548
549
  },
549
550
  set(t) {
550
- t ? y.value = /* @__PURE__ */ new Date(`${l.value} ${t}`) : y.value = null;
551
+ t ? v.value = /* @__PURE__ */ new Date(`${i.value} ${t}`) : v.value = null;
551
552
  }
552
553
  });
553
554
  return {
554
- backdatePo: y,
555
+ backdatePo: v,
555
556
  backdateSwitch: u,
556
- backdateModel: l,
557
- backdateTimeModel: _
557
+ backdateModel: i,
558
+ backdateTimeModel: d
558
559
  };
559
560
  }
560
- const Qt = {
561
+ const Wt = {
561
562
  width: "24",
562
563
  height: "24",
563
564
  viewBox: "0 0 24 24",
564
565
  fill: "none",
565
566
  xmlns: "http://www.w3.org/2000/svg"
566
- }, Wt = ["fill"], Yt = ["fill"], Zt = ["stroke"], Kt = ["stroke"], Jt = /* @__PURE__ */ re({
567
+ }, Yt = ["fill"], Zt = ["fill"], Kt = ["stroke"], Jt = ["stroke"], Xt = /* @__PURE__ */ re({
567
568
  __name: "SparkIcon",
568
569
  props: {
569
570
  size: {
@@ -576,142 +577,142 @@ const Qt = {
576
577
  }
577
578
  },
578
579
  setup(o) {
579
- return (y, u) => (F(), I("svg", Qt, [
580
+ return (v, u) => (F(), I("svg", Wt, [
580
581
  r("path", {
581
582
  d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
582
583
  fill: o.color
583
- }, null, 8, Wt),
584
+ }, null, 8, Yt),
584
585
  r("path", {
585
586
  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",
586
587
  fill: o.color
587
- }, null, 8, Yt),
588
+ }, null, 8, Zt),
588
589
  r("path", {
589
590
  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",
590
591
  stroke: o.color,
591
592
  "stroke-width": "1.5",
592
593
  "stroke-linecap": "round",
593
594
  "stroke-linejoin": "round"
594
- }, null, 8, Zt),
595
+ }, null, 8, Kt),
595
596
  r("path", {
596
597
  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",
597
598
  stroke: o.color,
598
599
  "stroke-width": "1.5",
599
600
  "stroke-linecap": "round",
600
601
  "stroke-linejoin": "round"
601
- }, null, 8, Kt)
602
+ }, null, 8, Jt)
602
603
  ]));
603
604
  }
604
- }), Xt = { class: "flex gap-8 items-center" }, Gt = { 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" }, ls = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, as = { class: "flex gap-1" }, Me = /* @__PURE__ */ re({
605
+ }), Gt = { class: "flex gap-8 items-center" }, es = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, ts = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, ss = { class: "flex items-center w-full" }, os = { class: "flex-1" }, ns = { class: "fm-typo-en-title-sm-800" }, ls = { class: "flex items-start gap-8" }, as = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, Me = /* @__PURE__ */ re({
605
606
  __name: "ForecastStock",
606
607
  props: {
607
608
  disabled: { type: Boolean }
608
609
  },
609
610
  emits: ["update:poItems"],
610
- setup(o, { emit: y }) {
611
- const u = y, l = N(!1), _ = N(7), t = Ct(), n = $e(), w = De(), { t: p } = me();
611
+ setup(o, { emit: v }) {
612
+ const u = v, i = N(!1), d = N(7), t = ht(), n = $e(), w = De(), { t: m } = me();
612
613
  async function s() {
613
- if (_.value < 1)
614
+ if (d.value < 1)
614
615
  return;
615
- l.value = !1, await t.readPurchaseOrder(_.value);
616
- const i = [];
616
+ i.value = !1, await t.readPurchaseOrder(d.value);
617
+ const a = [];
617
618
  if (t.purchaseOrderForecast.skus.length <= 0) {
618
619
  n.open({
619
- message: p("inventory.transfer.form.items.forecastStock.notAvailable"),
620
+ message: m("inventory.transfer.form.items.forecastStock.notAvailable"),
620
621
  type: "info"
621
622
  });
622
623
  return;
623
624
  }
624
- const v = t.purchaseOrderForecast.skus.reduce((d, c) => {
625
- const g = w.skus.find((x) => x._id === c.id);
626
- if (d.find((x) => x.sku._id === c.id) || !g)
627
- return d;
625
+ const b = t.purchaseOrderForecast.skus.reduce((c, p) => {
626
+ const g = w.skus.find((x) => x._id === p.id);
627
+ if (c.find((x) => x.sku._id === p.id) || !g)
628
+ return c;
628
629
  const S = {
629
630
  sku: g,
630
631
  code: g.code,
631
632
  name: g.name,
632
633
  quantity: {
633
- amount: c.amount,
634
+ amount: p.amount,
634
635
  precision: 0
635
636
  }
636
637
  };
637
- return d.push(S), d;
638
- }, i);
639
- u("update:poItems", v);
638
+ return c.push(S), c;
639
+ }, a);
640
+ u("update:poItems", b);
640
641
  }
641
- return (i, v) => {
642
- const d = T("FmButton"), c = T("FmIcon"), g = T("FmStepperField"), m = T("FmPopover");
643
- return F(), z(m, {
644
- disabled: i.disabled,
642
+ return (a, b) => {
643
+ const c = T("FmButton"), p = T("FmIcon"), g = T("FmStepperField"), f = T("FmPopover");
644
+ return F(), z(f, {
645
+ disabled: a.disabled,
645
646
  class: "flex",
646
- "show-popover": l.value,
647
- onPopoverChanged: v[3] || (v[3] = (S) => l.value = S)
647
+ "show-popover": i.value,
648
+ onPopoverChanged: b[3] || (b[3] = (S) => i.value = S)
648
649
  }, {
649
650
  "popover-button": O(() => [
650
- k(d, {
651
+ k(c, {
651
652
  label: "unused",
652
653
  variant: "secondary",
653
- "text-color": i.disabled ? "disabled" : "primary",
654
+ "text-color": a.disabled ? "disabled" : "primary",
654
655
  "bg-color": "transparent",
655
- "border-color": i.disabled ? "disabled" : "primary",
656
- disabled: i.disabled
656
+ "border-color": a.disabled ? "disabled" : "primary",
657
+ disabled: a.disabled
657
658
  }, {
658
659
  default: O(() => [
659
- r("div", Xt, [
660
- k(Jt, {
660
+ r("div", Gt, [
661
+ k(Xt, {
661
662
  size: 24,
662
- color: i.disabled ? "#c7c7cc" : "#ff7823"
663
+ color: a.disabled ? "#c7c7cc" : "#ff7823"
663
664
  }, null, 8, ["color"]),
664
- r("div", Gt, V(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
665
+ r("div", es, V(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
665
666
  ])
666
667
  ]),
667
668
  _: 1
668
669
  }, 8, ["text-color", "border-color", "disabled"])
669
670
  ]),
670
671
  default: O(() => [
671
- r("div", es, [
672
- r("div", ts, [
673
- r("div", ss, [
674
- k(St, { "z-index": 99 }, {
672
+ r("div", ts, [
673
+ r("div", ss, [
674
+ r("div", os, [
675
+ k(xt, { "z-index": 99 }, {
675
676
  default: O(() => [
676
- r("p", os, V(e(p)("inventory.transfer.form.items.forecastStock.title")), 1)
677
+ r("p", ns, V(e(m)("inventory.transfer.form.items.forecastStock.title")), 1)
677
678
  ]),
678
679
  _: 1
679
680
  })
680
681
  ]),
681
- k(d, {
682
+ k(c, {
682
683
  icon: "close",
683
684
  size: "md",
684
685
  variant: "tertiary",
685
- onClick: v[0] || (v[0] = (S) => l.value = !1)
686
+ onClick: b[0] || (b[0] = (S) => i.value = !1)
686
687
  })
687
688
  ]),
688
689
  k(g, {
689
- modelValue: _.value,
690
- "onUpdate:modelValue": v[1] || (v[1] = (S) => _.value = S),
691
- label: e(p)("inventory.transfer.form.items.forecastStock.days"),
690
+ modelValue: d.value,
691
+ "onUpdate:modelValue": b[1] || (b[1] = (S) => d.value = S),
692
+ label: e(m)("inventory.transfer.form.items.forecastStock.days"),
692
693
  rules: [e(Se)(1)]
693
694
  }, {
694
695
  "helper-text": O(() => [
695
- r("div", ns, [
696
- k(c, {
696
+ r("div", ls, [
697
+ k(p, {
697
698
  name: "warning",
698
699
  size: "sm",
699
700
  class: "text-fm-color-system-warning-300"
700
701
  }),
701
- r("div", ls, V(e(p)("inventory.transfer.form.items.forecastStock.replace")), 1)
702
+ r("div", as, V(e(m)("inventory.transfer.form.items.forecastStock.replace")), 1)
702
703
  ])
703
704
  ]),
704
705
  _: 1
705
706
  }, 8, ["modelValue", "label", "rules"]),
706
- r("div", as, [
707
- v[4] || (v[4] = r("div", { class: "grow" }, null, -1)),
708
- k(d, {
709
- label: e(p)("common.cancel"),
707
+ r("div", rs, [
708
+ b[4] || (b[4] = r("div", { class: "grow" }, null, -1)),
709
+ k(c, {
710
+ label: e(m)("common.cancel"),
710
711
  variant: "tertiary",
711
- onClick: v[2] || (v[2] = (S) => l.value = !1)
712
+ onClick: b[2] || (b[2] = (S) => i.value = !1)
712
713
  }, null, 8, ["label"]),
713
- k(d, {
714
- label: e(p)("inventory.transfer.form.items.forecastStock.generate"),
714
+ k(c, {
715
+ label: e(m)("inventory.transfer.form.items.forecastStock.generate"),
715
716
  onClick: s
716
717
  }, null, 8, ["label"])
717
718
  ])
@@ -722,37 +723,37 @@ const Qt = {
722
723
  };
723
724
  }
724
725
  });
725
- function rs() {
726
- const o = $e(), y = Ne(), u = N(!1);
726
+ function is() {
727
+ const o = $e(), v = Ne(), u = N(!1);
727
728
  Le(u, (n) => {
728
- n && (_.value = !0, l().finally(() => {
729
- _.value = !1;
729
+ n && (d.value = !0, i().finally(() => {
730
+ d.value = !1;
730
731
  }));
731
732
  });
732
- async function l() {
733
+ async function i() {
733
734
  try {
734
- const { startDate: n, endDate: w } = ft(6), i = (await y.getPurchaseOrders({ start: n, end: w })).filter(
735
- (v) => {
736
- var d, c;
737
- return v.status === yt.enum.COMPLETE && ((d = v.supplier) == null ? void 0 : d.internal) !== "warehouse" && ((c = v.supplier) == null ? void 0 : c.internal) !== "restaurant";
735
+ const { startDate: n, endDate: w } = yt(6), a = (await v.getPurchaseOrders({ start: n, end: w })).filter(
736
+ (b) => {
737
+ var c, p;
738
+ return b.status === vt.enum.COMPLETE && ((c = b.supplier) == null ? void 0 : c.internal) !== "warehouse" && ((p = b.supplier) == null ? void 0 : p.internal) !== "restaurant";
738
739
  }
739
- ).reduce((v, d) => {
740
- const c = new Date(vt(d._id)), g = d.supplier._id;
741
- for (const m of d.items) {
742
- if (!m.totalCost) continue;
743
- const S = v[m.sku._id] ?? {}, x = S[g] ?? [];
740
+ ).reduce((b, c) => {
741
+ const p = new Date(bt(c._id)), g = c.supplier._id;
742
+ for (const f of c.items) {
743
+ if (!f.totalCost) continue;
744
+ const S = b[f.sku._id] ?? {}, x = S[g] ?? [];
744
745
  x.push({
745
- date: c.toISOString(),
746
- totalUnit: m.quantity,
747
- totalCost: m.totalCost,
748
- unit: m.sku.unit,
749
- measurement: m.measurement,
750
- seqNumber: d.seqNumber
751
- }), S[g] = x, v[m.sku._id] = S;
746
+ date: p.toISOString(),
747
+ totalUnit: f.quantity,
748
+ totalCost: f.totalCost,
749
+ unit: f.sku.unit,
750
+ measurement: f.measurement,
751
+ seqNumber: c.seqNumber
752
+ }), S[g] = x, b[f.sku._id] = S;
752
753
  }
753
- return v;
754
+ return b;
754
755
  }, {});
755
- t.value = i;
756
+ t.value = a;
756
757
  } catch {
757
758
  o.open({
758
759
  title: "Something went wrong",
@@ -760,14 +761,14 @@ function rs() {
760
761
  }), u.value = !1;
761
762
  }
762
763
  }
763
- const _ = N(!1), t = N({});
764
+ const d = N(!1), t = N({});
764
765
  return {
765
766
  comparePricesToggle: u,
766
- comparePriceFetching: _,
767
+ comparePriceFetching: d,
767
768
  comparePriceBySku: t
768
769
  };
769
770
  }
770
- const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }, ds = ["colspan"], cs = /* @__PURE__ */ re({
771
+ const us = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, ds = { key: 0 }, cs = ["colspan"], ps = /* @__PURE__ */ re({
771
772
  __name: "TransferItemTable",
772
773
  props: {
773
774
  row: {},
@@ -775,11 +776,11 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
775
776
  showComparePrice: { type: Boolean }
776
777
  },
777
778
  setup(o) {
778
- function y(u) {
779
+ function v(u) {
779
780
  return u.column.columnDef.meta;
780
781
  }
781
- return (u, l) => {
782
- var _, t;
782
+ return (u, i) => {
783
+ var d, t;
783
784
  return F(), I(ae, null, [
784
785
  r("tr", {
785
786
  class: Y(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
@@ -787,20 +788,20 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
787
788
  }])
788
789
  }, [
789
790
  (F(!0), I(ae, null, Pe(u.row.getVisibleCells(), (n) => {
790
- var w, p, s, i;
791
+ var w, m, s, a;
791
792
  return F(), I("td", {
792
793
  key: n.id,
793
794
  class: Y([
794
795
  "h-[52px] px-16 text-fm-color-typo-primary",
795
- ((w = y(n)) == null ? void 0 : w.cellClass) ?? "px-16"
796
+ ((w = v(n)) == null ? void 0 : w.cellClass) ?? "px-16"
796
797
  ]),
797
798
  style: et({
798
- width: (p = y(n)) == null ? void 0 : p.width,
799
- maxWidth: (s = y(n)) == null ? void 0 : s.maxWidth,
800
- textAlign: ((i = y(n)) == null ? void 0 : i.textAlign) ?? "left"
799
+ width: (m = v(n)) == null ? void 0 : m.width,
800
+ maxWidth: (s = v(n)) == null ? void 0 : s.maxWidth,
801
+ textAlign: ((a = v(n)) == null ? void 0 : a.textAlign) ?? "left"
801
802
  })
802
803
  }, [
803
- r("span", is, [
804
+ r("span", us, [
804
805
  k(e(pe), {
805
806
  render: n.column.columnDef.cell,
806
807
  props: n.getContext()
@@ -809,134 +810,136 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
809
810
  ], 6);
810
811
  }), 128))
811
812
  ], 2),
812
- u.showComparePrice && Object.keys(u.comparePriceBySku[(_ = u.row.original.sku) == null ? void 0 : _._id] ?? {}).length > 0 ? (F(), I("tr", us, [
813
+ u.showComparePrice && Object.keys(u.comparePriceBySku[(d = u.row.original.sku) == null ? void 0 : d._id] ?? {}).length > 0 ? (F(), I("tr", ds, [
813
814
  r("td", {
814
815
  colspan: u.row.getVisibleCells().length
815
816
  }, [
816
817
  k(Ye, {
817
818
  prices: u.comparePriceBySku[(t = u.row.original.sku) == null ? void 0 : t._id]
818
819
  }, null, 8, ["prices"])
819
- ], 8, ds)
820
+ ], 8, cs)
820
821
  ])) : H("", !0)
821
822
  ], 64);
822
823
  };
823
824
  }
824
- }), 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 = { class: "flex flex-col gap-8" }, bs = { class: "flex flex-col gap-4" }, _s = { class: "flex flex-col gap-8" }, gs = { class: "flex flex-col gap-4" }, ks = {
825
+ }), ms = { class: "flex flex-col gap-4" }, fs = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, ys = { class: "flex flex-col gap-16" }, vs = { class: "flex flex-col gap-24" }, bs = { class: "flex flex-col gap-8" }, _s = { class: "flex flex-col gap-4" }, gs = { class: "flex flex-col gap-8" }, ks = { class: "flex flex-col gap-4" }, Cs = {
825
826
  key: 3,
826
827
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
827
- }, Cs = {
828
+ }, hs = {
828
829
  key: 0,
829
830
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
830
- }, hs = { class: "flex-1" }, ws = { class: "flex-1" }, Ss = {
831
+ }, ws = { class: "flex-1" }, Ss = { class: "flex-1" }, xs = {
831
832
  key: 1,
832
833
  class: "flex items-center gap-4"
833
- }, xs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Fs = { class: "flex flex-col gap-16" }, Ps = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Ts = { class: "flex gap-8" }, Is = { key: 0 }, $s = /* @__PURE__ */ re({
834
+ }, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Ps = { class: "flex flex-col gap-16" }, Ts = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Is = { class: "flex gap-8" }, $s = { key: 0 }, As = /* @__PURE__ */ re({
834
835
  __name: "TransferForm2",
835
836
  props: {
836
837
  modelValue: {},
838
+ request: {},
837
839
  disabled: { type: Boolean },
838
840
  suppliers: {},
839
841
  skus: {},
840
842
  lastClosingDate: {}
841
843
  },
842
844
  emits: ["validation-success", "form:ready"],
843
- setup(o, { expose: y, emit: u }) {
844
- const l = o, _ = u, t = ht(), { t: n } = me(), w = Ve(), p = De(), s = gt(), i = xe(), v = He(), d = nt(), { breakpoints: c } = qe(), g = P(() => c.value.xs || c.value.sm), m = P(
845
- () => d.templates.value.find((a) => a._id === t.template)
845
+ setup(o, { expose: v, emit: u }) {
846
+ const i = o, d = u, t = wt(), { t: n } = me(), w = Ve(), m = De(), s = kt(), a = xe(), b = He(), c = nt(), { breakpoints: p } = qe(), g = P(() => p.value.xs || p.value.sm), f = P(
847
+ () => c.templates.value.find((l) => l._id === t.template)
846
848
  ), S = P(() => t.status === "DRAFT" || !t._rev);
847
849
  Ee(async () => {
848
- var a;
850
+ var l;
849
851
  try {
850
852
  if (!t.template) return;
851
- await d.loadTemplate(t.template), t.items.length || (t.items = ((a = m.value) == null ? void 0 : a.purchaseOrder.items) ?? []);
853
+ await c.loadTemplate(t.template), t.items.length || (t.items = ((l = f.value) == null ? void 0 : l.purchaseOrder.items) ?? []);
852
854
  } finally {
853
- _("form:ready");
855
+ d("form:ready");
854
856
  }
855
857
  });
856
858
  const x = P(
857
859
  () => w.currentLocation.type === Qe.restaurant
858
860
  );
859
861
  w.watchLocation(async () => {
860
- location && (t.supplier || (t.supplier = i.suppliers.find((a) => a) ?? t.supplier));
862
+ location && (t.supplier || (t.supplier = a.suppliers.find((l) => l) ?? t.supplier));
861
863
  });
862
- const E = st(), $ = zt(
864
+ const E = st(), $ = jt(
863
865
  () => t,
864
- (a) => {
865
- Object.assign(t, a);
866
- }
866
+ (l) => {
867
+ Object.assign(t, l);
868
+ },
869
+ !0
867
870
  ), U = P({
868
871
  get() {
869
- var a;
870
- return typeof ((a = t == null ? void 0 : t.supplier) == null ? void 0 : a.internal) == "string" ? A.TRANSFER : A.PURCHASE;
872
+ var l;
873
+ return typeof ((l = t == null ? void 0 : t.supplier) == null ? void 0 : l.internal) == "string" ? A.TRANSFER : A.PURCHASE;
871
874
  },
872
- set(a) {
875
+ set(l) {
873
876
  var q;
874
- const f = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? A.TRANSFER : A.PURCHASE;
875
- a !== f && (t.supplier = a === A.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
877
+ const y = typeof ((q = t == null ? void 0 : t.supplier) == null ? void 0 : q.internal) == "string" ? A.TRANSFER : A.PURCHASE;
878
+ l !== y && (t.supplier = l === A.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
876
879
  }
877
880
  }), L = P(() => $.transferLocationOptions.value), G = P({
878
881
  get() {
879
882
  return t.supplier._id;
880
883
  },
881
- set(a) {
882
- $.transferLocationModel.value = a;
884
+ set(l) {
885
+ $.transferLocationModel.value = l;
883
886
  }
884
887
  }), ee = P({
885
888
  get() {
886
889
  return t.remark ?? void 0;
887
890
  },
888
- set(a) {
889
- t.remark = a;
891
+ set(l) {
892
+ t.remark = l;
890
893
  }
891
894
  }), K = P({
892
895
  get() {
893
- var a;
894
- return ((a = t.netSuite) == null ? void 0 : a.subsidiary) || {
896
+ var l;
897
+ return ((l = t.netSuite) == null ? void 0 : l.subsidiary) || {
895
898
  subsidiary: {
896
899
  id: "",
897
900
  name: ""
898
901
  }
899
902
  };
900
903
  },
901
- set(a) {
904
+ set(l) {
902
905
  t.netSuite = {
903
906
  ...t.netSuite,
904
- subsidiary: a
907
+ subsidiary: l
905
908
  }, t.items = t.items.filter(
906
- (f) => {
909
+ (y) => {
907
910
  var q;
908
- return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(f.sku._id);
911
+ return !s.getAvailableItems((q = t.netSuite) == null ? void 0 : q.subsidiary.id).includes(y.sku._id);
909
912
  }
910
913
  );
911
914
  }
912
- }), { backdatePo: J, backdateSwitch: j, backdateModel: b, backdateTimeModel: C } = jt({
915
+ }), { backdatePo: J, backdateSwitch: j, backdateModel: _, backdateTimeModel: C } = Qt({
913
916
  getEffectiveAt() {
914
917
  return t.effectiveAt;
915
918
  },
916
- setEffectiveAt(a) {
917
- t.effectiveAt = a;
919
+ setEffectiveAt(l) {
920
+ t.effectiveAt = l;
918
921
  }
919
- }), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } = rs(), se = N();
920
- y({
922
+ }), { comparePricesToggle: D, comparePriceFetching: te, comparePriceBySku: Q } = is(), se = N();
923
+ v({
921
924
  validateInputs: () => {
922
- var a, f;
923
- (f = (a = se.value) == null ? void 0 : a.validateInputs) == null || f.call(a);
925
+ var l, y;
926
+ (y = (l = se.value) == null ? void 0 : l.validateInputs) == null || y.call(l);
924
927
  },
925
928
  resetInputsValidation: () => {
926
- var a, f;
927
- (f = (a = se.value) == null ? void 0 : a.resetInputsValidation) == null || f.call(a);
929
+ var l, y;
930
+ (y = (l = se.value) == null ? void 0 : l.resetInputsValidation) == null || y.call(l);
928
931
  },
929
932
  resetInputs: () => {
930
- var a, f;
931
- (f = (a = se.value) == null ? void 0 : a.resetInputs) == null || f.call(a);
933
+ var l, y;
934
+ (y = (l = se.value) == null ? void 0 : l.resetInputs) == null || y.call(l);
932
935
  }
933
936
  });
934
- const Ze = Ft({
935
- updateItem: (a) => {
936
- t.items = t.items.map((f) => f.sku._id !== a.sku._id ? f : a);
937
+ const Ze = Pt({
938
+ updateItem: (l) => {
939
+ t.items = t.items.map((y) => y.sku._id !== l.sku._id ? y : l);
937
940
  },
938
- deleteItem: (a) => {
939
- t.items = t.items.filter((f) => f.sku._id !== a.sku._id);
941
+ deleteItem: (l) => {
942
+ t.items = t.items.filter((y) => y.sku._id !== l.sku._id);
940
943
  },
941
944
  get supplier() {
942
945
  return t.supplier;
@@ -948,15 +951,15 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
948
951
  return U.value;
949
952
  },
950
953
  get template() {
951
- return m.value;
954
+ return f.value;
952
955
  },
953
956
  get disabled() {
954
- return l.disabled;
957
+ return i.disabled;
955
958
  }
956
959
  }), Ke = P(() => Ze.columnDefs.value);
957
960
  function Je() {
958
961
  var fe, ie, ke;
959
- const a = new Set((ke = (ie = (fe = m.value) == null ? void 0 : fe.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ke.map((R) => R.sku._id)), q = (a.size ? p.skus.filter((R) => a.has(R._id)) : p.skus).filter((R) => {
962
+ const l = new Set((ke = (ie = (fe = f.value) == null ? void 0 : fe.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ke.map((R) => R.sku._id)), q = (l.size ? m.skus.filter((R) => l.has(R._id)) : m.skus).filter((R) => {
960
963
  var W;
961
964
  return !s.getAvailableItems((W = t.netSuite) == null ? void 0 : W.subsidiary.id).includes(R._id);
962
965
  }).map(
@@ -972,7 +975,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
972
975
  E.open({
973
976
  title: n("inventory.transfer.form.items.selectItem"),
974
977
  closeButton: !0,
975
- contentComponent: kt,
978
+ contentComponent: Ct,
976
979
  contentComponentProps: {
977
980
  modelValue: ge,
978
981
  items: q,
@@ -993,7 +996,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
993
996
  const oe = W.find((ye) => ye.sku._id === X._id);
994
997
  if (oe)
995
998
  return oe;
996
- const ne = ((he = (Ce = m.value) == null ? void 0 : Ce.purchaseOrder.items) == null ? void 0 : he.find(
999
+ const ne = ((he = (Ce = f.value) == null ? void 0 : Ce.purchaseOrder.items) == null ? void 0 : he.find(
997
1000
  (ye) => ye.sku._id === X._id
998
1001
  )) ?? {
999
1002
  sku: X,
@@ -1016,18 +1019,18 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1016
1019
  ue.sort((X, oe) => X.sku.code.localeCompare(oe.sku.code)), t.items = ue;
1017
1020
  });
1018
1021
  }
1019
- function Rs(a) {
1020
- return a;
1022
+ function Os(l) {
1023
+ return l;
1021
1024
  }
1022
- return (a, f) => {
1025
+ return (l, y) => {
1023
1026
  var Re, Oe;
1024
1027
  const q = T("FmChip"), ge = T("FmLabel"), fe = T("FmField"), ie = T("FmSelect"), ke = T("FmTextField"), R = T("FmTextarea"), W = T("FmSwitch"), ue = T("FmDatePicker"), X = T("FmTimePicker"), oe = T("FmFormGroup"), ne = T("FmIcon"), Ce = T("FmButton"), he = T("FmTooltip"), ye = T("FmTable"), Xe = T("FmForm");
1025
- return F(), I("div", ps, [
1026
- r("div", ms, [
1027
- (Re = l.modelValue) != null && Re.template ? (F(), z(q, {
1028
+ return F(), I("div", ms, [
1029
+ r("div", fs, [
1030
+ (Re = i.modelValue) != null && Re.template ? (F(), z(q, {
1028
1031
  key: 0,
1029
- variant: a.disabled ? "warning" : void 0,
1030
- label: `${e(n)("inventory.transfer.template.title")}: ${((Oe = m.value) == null ? void 0 : Oe.name) ?? e(n)("inventory.transfer.form.loading")}`,
1032
+ variant: l.disabled ? "warning" : void 0,
1033
+ label: `${e(n)("inventory.transfer.template.title")}: ${((Oe = f.value) == null ? void 0 : Oe.name) ?? e(n)("inventory.transfer.form.loading")}`,
1031
1034
  icon: "summarize",
1032
1035
  compact: ""
1033
1036
  }, null, 8, ["variant", "label"])) : H("", !0),
@@ -1036,9 +1039,9 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1036
1039
  icon: "storefront",
1037
1040
  compact: ""
1038
1041
  }, null, 8, ["label"]),
1039
- a.lastClosingDate ? (F(), z(q, {
1042
+ l.lastClosingDate ? (F(), z(q, {
1040
1043
  key: 1,
1041
- label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ae)(a.lastClosingDate)} ${e(bt)(a.lastClosingDate)}`,
1044
+ label: `${e(n)("inventory.transfer.form.lastClosing")}: ${e(Ae)(l.lastClosingDate)} ${e(_t)(l.lastClosingDate)}`,
1042
1045
  icon: "calendar_month",
1043
1046
  compact: ""
1044
1047
  }, null, 8, ["label"])) : H("", !0)
@@ -1047,25 +1050,25 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1047
1050
  ref_key: "formRef",
1048
1051
  ref: se,
1049
1052
  class: "flex flex-col gap-32",
1050
- disabled: a.disabled,
1053
+ disabled: l.disabled,
1051
1054
  onValidationFailed: console.log,
1052
- onValidationSuccess: f[13] || (f[13] = (Fe) => _("validation-success"))
1055
+ onValidationSuccess: y[13] || (y[13] = (Fe) => d("validation-success"))
1053
1056
  }, {
1054
1057
  default: O(() => {
1055
1058
  var Fe, Ue;
1056
1059
  return [
1057
- r("div", fs, [
1058
- r("div", ys, [
1059
- (Fe = l.modelValue) != null && Fe.template ? (F(), I(ae, { key: 0 }, [
1060
- r("div", vs, [
1060
+ r("div", ys, [
1061
+ r("div", vs, [
1062
+ (Fe = i.modelValue) != null && Fe.template ? (F(), I(ae, { key: 0 }, [
1063
+ r("div", bs, [
1061
1064
  k(ge, {
1062
1065
  label: e(n)("inventory.transfer.form.type.title")
1063
1066
  }, null, 8, ["label"]),
1064
- r("div", bs, [
1067
+ r("div", _s, [
1065
1068
  k(fe, null, {
1066
1069
  default: O(() => [
1067
1070
  r("span", {
1068
- class: Y({ "text-fm-color-typo-disabled": a.disabled })
1071
+ class: Y({ "text-fm-color-typo-disabled": l.disabled })
1069
1072
  }, V(e(n)(`inventory.transfer.form.type.${U.value.toLocaleLowerCase("en-us")}`)), 3)
1070
1073
  ]),
1071
1074
  _: 1
@@ -1073,22 +1076,22 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1073
1076
  r("div", {
1074
1077
  class: Y([
1075
1078
  "fm-typo-en-body-sm-400",
1076
- a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1079
+ l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1077
1080
  ])
1078
1081
  }, " This field is locked from template. ", 2)
1079
1082
  ])
1080
1083
  ]),
1081
- r("div", _s, [
1084
+ r("div", gs, [
1082
1085
  k(ge, {
1083
1086
  label: U.value === e(A).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom")
1084
1087
  }, null, 8, ["label"]),
1085
- r("div", gs, [
1088
+ r("div", ks, [
1086
1089
  k(fe, null, {
1087
1090
  default: O(() => {
1088
1091
  var h;
1089
1092
  return [
1090
1093
  r("span", {
1091
- class: Y({ "text-fm-color-typo-disabled": a.disabled })
1094
+ class: Y({ "text-fm-color-typo-disabled": l.disabled })
1092
1095
  }, V((h = L.value.find((ve) => ve.value === G.value)) == null ? void 0 : h.label), 3)
1093
1096
  ];
1094
1097
  }),
@@ -1097,7 +1100,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1097
1100
  r("div", {
1098
1101
  class: Y([
1099
1102
  "fm-typo-en-body-sm-400",
1100
- a.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1103
+ l.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1101
1104
  ])
1102
1105
  }, " This field is locked from template. ", 2)
1103
1106
  ])
@@ -1106,7 +1109,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1106
1109
  k(ie, {
1107
1110
  label: e(n)("inventory.transfer.form.type.title"),
1108
1111
  "model-value": U.value,
1109
- "onUpdate:modelValue": f[0] || (f[0] = (h) => U.value = h),
1112
+ "onUpdate:modelValue": y[0] || (y[0] = (h) => U.value = h),
1110
1113
  items: [
1111
1114
  {
1112
1115
  label: e(n)("inventory.transfer.form.type.purchase"),
@@ -1126,7 +1129,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1126
1129
  k(ie, {
1127
1130
  label: U.value === e(A).PURCHASE ? e(n)("inventory.transfer.form.purchaseFrom") : e(n)("inventory.transfer.form.transferFrom"),
1128
1131
  modelValue: G.value,
1129
- "onUpdate:modelValue": f[1] || (f[1] = (h) => G.value = h),
1132
+ "onUpdate:modelValue": y[1] || (y[1] = (h) => G.value = h),
1130
1133
  items: L.value
1131
1134
  }, null, 8, ["label", "modelValue", "items"])
1132
1135
  ], 64)),
@@ -1134,26 +1137,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1134
1137
  label: e(n)("inventory.transfer.form.reference"),
1135
1138
  "label-mark": "optional",
1136
1139
  modelValue: e(t).ref,
1137
- "onUpdate:modelValue": f[2] || (f[2] = (h) => e(t).ref = h)
1140
+ "onUpdate:modelValue": y[2] || (y[2] = (h) => e(t).ref = h)
1138
1141
  }, null, 8, ["label", "modelValue"]),
1139
1142
  k(R, {
1140
1143
  label: e(n)("inventory.transfer.form.remark"),
1141
1144
  "label-mark": "optional",
1142
1145
  "max-length": 240,
1143
1146
  modelValue: ee.value,
1144
- "onUpdate:modelValue": f[3] || (f[3] = (h) => ee.value = h),
1145
- class: Y([a.disabled ? "text-fm-color-typo-disabled " : ""])
1147
+ "onUpdate:modelValue": y[3] || (y[3] = (h) => ee.value = h),
1148
+ class: Y([l.disabled ? "text-fm-color-typo-disabled " : ""])
1146
1149
  }, null, 8, ["label", "modelValue", "class"]),
1147
1150
  e(s).isEnabled ? (F(), z(ie, {
1148
1151
  key: 2,
1149
1152
  modelValue: K.value,
1150
- "onUpdate:modelValue": f[4] || (f[4] = (h) => K.value = h),
1153
+ "onUpdate:modelValue": y[4] || (y[4] = (h) => K.value = h),
1151
1154
  label: `NetSuite ${e(n)("inventory.transfer.form.netsuite.subsidiary")}`,
1152
1155
  items: e(s).subsidiaryOptions,
1153
1156
  "label-mark": "required",
1154
1157
  rules: [e(Ie)()]
1155
1158
  }, null, 8, ["modelValue", "label", "items", "rules"])) : H("", !0),
1156
- e(v).enableBackdatePo ? (F(), I("div", ks, [
1159
+ e(b).enableBackdatePo ? (F(), I("div", Cs, [
1157
1160
  r("div", {
1158
1161
  class: Y([
1159
1162
  "flex",
@@ -1164,26 +1167,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1164
1167
  }, [
1165
1168
  k(W, {
1166
1169
  modelValue: e(j),
1167
- "onUpdate:modelValue": f[5] || (f[5] = (h) => ce(j) ? j.value = h : null),
1170
+ "onUpdate:modelValue": y[5] || (y[5] = (h) => ce(j) ? j.value = h : null),
1168
1171
  label: e(n)("inventory.transfer.form.backdate.title"),
1169
1172
  sublabel: e(n)("inventory.transfer.form.backdate.subtitle"),
1170
1173
  "label-placement": "right",
1171
- disabled: x.value && !a.lastClosingDate || a.disabled
1174
+ disabled: x.value && !l.lastClosingDate || l.disabled
1172
1175
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1173
1176
  r("div", {
1174
1177
  class: Y({ hidden: g.value, "w-16": !g.value })
1175
1178
  }, null, 2),
1176
- e(j) ? (F(), I("div", Cs, [
1177
- r("div", hs, [
1179
+ e(j) ? (F(), I("div", hs, [
1180
+ r("div", ws, [
1178
1181
  k(ue, {
1179
- modelValue: e(b),
1180
- "onUpdate:modelValue": f[6] || (f[6] = (h) => ce(b) ? b.value = h : null)
1182
+ modelValue: e(_),
1183
+ "onUpdate:modelValue": y[6] || (y[6] = (h) => ce(_) ? _.value = h : null)
1181
1184
  }, null, 8, ["modelValue"])
1182
1185
  ]),
1183
- r("div", ws, [
1186
+ r("div", Ss, [
1184
1187
  k(X, {
1185
1188
  modelValue: e(C),
1186
- "onUpdate:modelValue": f[7] || (f[7] = (h) => ce(C) ? C.value = h : null)
1189
+ "onUpdate:modelValue": y[7] || (y[7] = (h) => ce(C) ? C.value = h : null)
1187
1190
  }, null, 8, ["modelValue"])
1188
1191
  ])
1189
1192
  ])) : H("", !0)
@@ -1191,21 +1194,21 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1191
1194
  e(J) ? (F(), z(oe, {
1192
1195
  key: 0,
1193
1196
  modelValue: e(J),
1194
- "onUpdate:modelValue": f[8] || (f[8] = (h) => ce(J) ? J.value = h : null),
1195
- rules: [e(_t)(new Date(a.lastClosingDate), /* @__PURE__ */ new Date())]
1197
+ "onUpdate:modelValue": y[8] || (y[8] = (h) => ce(J) ? J.value = h : null),
1198
+ rules: [e(gt)(new Date(l.lastClosingDate), /* @__PURE__ */ new Date())]
1196
1199
  }, null, 8, ["modelValue", "rules"])) : H("", !0),
1197
- x.value && !a.lastClosingDate ? (F(), I("div", Ss, [
1200
+ x.value && !l.lastClosingDate ? (F(), I("div", xs, [
1198
1201
  k(ne, {
1199
1202
  name: "error",
1200
1203
  size: "sm",
1201
1204
  class: "text-fm-color-typo-warning"
1202
1205
  }),
1203
- r("span", xs, V(e(n)("inventory.transfer.form.backdate.error")), 1)
1206
+ r("span", Fs, V(e(n)("inventory.transfer.form.backdate.error")), 1)
1204
1207
  ])) : H("", !0)
1205
1208
  ])) : H("", !0)
1206
1209
  ])
1207
1210
  ]),
1208
- r("div", Fs, [
1211
+ r("div", Ps, [
1209
1212
  k(oe, {
1210
1213
  "model-value": e(t).items,
1211
1214
  rules: [e(Se)(1)]
@@ -1219,17 +1222,17 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1219
1222
  }
1220
1223
  ])
1221
1224
  }, [
1222
- r("div", Ps, V(e(n)("inventory.transfer.form.items.title")), 1),
1223
- r("div", Ts, [
1225
+ r("div", Ts, V(e(n)("inventory.transfer.form.items.title")), 1),
1226
+ r("div", Is, [
1224
1227
  k(Ce, {
1225
- disabled: a.disabled,
1228
+ disabled: l.disabled,
1226
1229
  label: e(n)("inventory.transfer.form.items.addItem"),
1227
1230
  "prepend-icon": "add",
1228
1231
  variant: "secondary",
1229
1232
  "text-color": "primary",
1230
1233
  "bg-color": "transparent",
1231
1234
  "border-color": "primary",
1232
- onClick: f[9] || (f[9] = (h) => Je()),
1235
+ onClick: y[9] || (y[9] = (h) => Je()),
1233
1236
  size: "md"
1234
1237
  }, null, 8, ["disabled", "label"]),
1235
1238
  e(t).template ? (F(), z(he, {
@@ -1241,26 +1244,26 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1241
1244
  ]),
1242
1245
  default: O(() => [
1243
1246
  k(Me, {
1244
- "onUpdate:poItems": f[10] || (f[10] = (h) => e(t).items = h),
1247
+ "onUpdate:poItems": y[10] || (y[10] = (h) => e(t).items = h),
1245
1248
  disabled: ""
1246
1249
  })
1247
1250
  ]),
1248
1251
  _: 1
1249
1252
  })) : (F(), z(Me, {
1250
1253
  key: 1,
1251
- "onUpdate:poItems": f[11] || (f[11] = (h) => e(t).items = h),
1252
- disabled: a.disabled || !!e(t).template
1254
+ "onUpdate:poItems": y[11] || (y[11] = (h) => e(t).items = h),
1255
+ disabled: l.disabled || !!e(t).template
1253
1256
  }, null, 8, ["disabled"]))
1254
1257
  ])
1255
1258
  ], 2),
1256
- U.value === e(A).PURCHASE && S.value && e(v).enableTotalCost && ((Ue = a.modelValue) != null && Ue.items.length) ? (F(), I("div", Is, [
1259
+ U.value === e(A).PURCHASE && S.value && e(b).enableTotalCost && ((Ue = l.modelValue) != null && Ue.items.length) ? (F(), I("div", $s, [
1257
1260
  k(W, {
1258
1261
  label: e(te) ? e(n)("inventory.transfer.form.items.fetchingData") : e(n)("inventory.transfer.form.items.comparePriceHistory"),
1259
1262
  "prepend-icon": "compare_arrows",
1260
1263
  "label-placement": "right",
1261
1264
  "model-value": e(D),
1262
- "onUpdate:modelValue": f[12] || (f[12] = (h) => ce(D) ? D.value = h : null),
1263
- disabled: e(te) || a.disabled
1265
+ "onUpdate:modelValue": y[12] || (y[12] = (h) => ce(D) ? D.value = h : null),
1266
+ disabled: e(te) || l.disabled
1264
1267
  }, null, 8, ["label", "model-value", "disabled"])
1265
1268
  ])) : H("", !0),
1266
1269
  (F(), z(ye, {
@@ -1271,19 +1274,19 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1271
1274
  "page-size": e(t).items.length
1272
1275
  }, {
1273
1276
  "table-row": O((h) => [
1274
- k(cs, {
1277
+ k(ps, {
1275
1278
  "compare-price-by-sku": e(Q),
1276
1279
  "show-compare-price": U.value === e(A).PURCHASE && e(D),
1277
1280
  row: h
1278
1281
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row"])
1279
1282
  ]),
1280
1283
  "list-row": O((h) => [
1281
- (F(), z(wt, {
1284
+ (F(), z(St, {
1282
1285
  row: h,
1283
1286
  key: e(t).items.map((ve) => ve.sku._id).join(".")
1284
1287
  }, {
1285
1288
  default: O((ve) => [
1286
- k(Ht, {
1289
+ k(zt, {
1287
1290
  "compare-price-by-sku": e(Q),
1288
1291
  "show-compare-price": U.value === e(A).PURCHASE && e(D),
1289
1292
  row: h,
@@ -1303,7 +1306,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1303
1306
  ]);
1304
1307
  };
1305
1308
  }
1306
- }), As = { class: "flex items-center" }, Vs = { class: "fm-typo-en-title-md-800" }, Ds = { class: "flex gap-4" }, Ws = /* @__PURE__ */ re({
1309
+ }), Vs = { class: "flex items-center" }, Ds = { class: "fm-typo-en-title-md-800" }, Rs = { class: "flex gap-4" }, Ys = /* @__PURE__ */ re({
1307
1310
  __name: "TransferDialog",
1308
1311
  props: {
1309
1312
  mode: {},
@@ -1313,25 +1316,25 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1313
1316
  lastClosingDate: {}
1314
1317
  },
1315
1318
  emits: ["update:show", "submitted"],
1316
- setup(o, { expose: y, emit: u }) {
1319
+ setup(o, { expose: v, emit: u }) {
1317
1320
  var j;
1318
- const l = o, _ = u, t = Ne(), n = $e(), w = xe(), p = De(), s = Ve(), { t: i } = me(), v = N(!1), d = N(!1), c = N(!1);
1319
- async function g(b) {
1320
- if (b) {
1321
- d.value = !1;
1321
+ const i = o, d = u, t = Ne(), n = $e(), w = xe(), m = De(), s = Ve(), { t: a } = me(), b = N(!1), c = N(!1), p = N(!1);
1322
+ async function g(_) {
1323
+ if (_) {
1324
+ c.value = !1;
1322
1325
  try {
1323
- await w.readSuppliers(), d.value = !0;
1326
+ await w.readSuppliers(), c.value = !0;
1324
1327
  } catch {
1325
1328
  n.open({
1326
- title: i("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1327
- message: i("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1329
+ title: a("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1330
+ message: a("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1328
1331
  type: "error"
1329
1332
  });
1330
1333
  }
1331
1334
  }
1332
1335
  }
1333
1336
  s.watchLocation(g);
1334
- function m() {
1337
+ function f() {
1335
1338
  return {
1336
1339
  remark: void 0,
1337
1340
  ref: void 0,
@@ -1361,82 +1364,82 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1361
1364
  _id: "",
1362
1365
  seqNumber: 0,
1363
1366
  deliveryOrder: [],
1364
- template: l.templateId
1367
+ template: i.templateId
1365
1368
  };
1366
1369
  }
1367
- const S = ot(l, "show"), x = N(l.modelValue ?? m()), E = N(((j = l.modelValue) == null ? void 0 : j._id) ?? `${Math.random()}`);
1370
+ const S = ot(i, "show"), x = N(i.modelValue ?? f()), E = N(((j = i.modelValue) == null ? void 0 : j._id) ?? `${Math.random()}`);
1368
1371
  Le(
1369
- () => l.show,
1370
- (b) => {
1372
+ () => i.show,
1373
+ (_) => {
1371
1374
  var C;
1372
- b && (c.value = !1, x.value = l.modelValue ?? m(), E.value = ((C = l.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
1375
+ _ && (p.value = !1, x.value = i.modelValue ?? f(), E.value = ((C = i.modelValue) == null ? void 0 : C._id) ?? `${Math.random()}`);
1373
1376
  }
1374
1377
  );
1375
- const $ = P(() => !d.value || !c.value), U = P(() => {
1376
- switch (l.mode) {
1378
+ const $ = P(() => !c.value || !p.value), U = P(() => {
1379
+ switch (i.mode) {
1377
1380
  case be.READ:
1378
1381
  return "View transfer";
1379
1382
  case be.CREATE:
1380
- return i("inventory.transfer.receiveRequest.create.title");
1383
+ return a("inventory.transfer.receiveRequest.create.title");
1381
1384
  case be.UPDATE:
1382
- return i("inventory.transfer.receiveRequest.update.title");
1385
+ return a("inventory.transfer.receiveRequest.update.title");
1383
1386
  }
1384
1387
  return "";
1385
1388
  }), L = N();
1386
- y({
1389
+ v({
1387
1390
  validateInputs: () => {
1388
- var b, C;
1389
- (C = (b = L.value) == null ? void 0 : b.validateInputs) == null || C.call(b);
1391
+ var _, C;
1392
+ (C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
1390
1393
  },
1391
1394
  resetInputsValidation: () => {
1392
- var b, C;
1393
- (C = (b = L.value) == null ? void 0 : b.resetInputsValidation) == null || C.call(b);
1395
+ var _, C;
1396
+ (C = (_ = L.value) == null ? void 0 : _.resetInputsValidation) == null || C.call(_);
1394
1397
  },
1395
1398
  resetInputs: () => {
1396
- var b, C;
1397
- (C = (b = L.value) == null ? void 0 : b.resetInputs) == null || C.call(b);
1399
+ var _, C;
1400
+ (C = (_ = L.value) == null ? void 0 : _.resetInputs) == null || C.call(_);
1398
1401
  }
1399
1402
  });
1400
1403
  async function G() {
1401
- const b = x.value;
1402
- v.value = !0, (b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: C, ...D }) => D));
1404
+ const _ = x.value;
1405
+ b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
1403
1406
  try {
1404
- await t.createPurchaseOrder(b), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1405
- title: i("inventory.transfer.receiveRequest.create.success"),
1406
- message: i("inventory.transfer.receiveRequest.create.successMessage"),
1407
+ await t.createPurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1408
+ title: a("inventory.transfer.receiveRequest.create.success"),
1409
+ message: a("inventory.transfer.receiveRequest.create.successMessage"),
1407
1410
  type: "success"
1408
- }), _("update:show", !1), _("submitted");
1411
+ }), d("update:show", !1), d("submitted");
1409
1412
  } catch (C) {
1410
1413
  n.open({
1411
- title: i("inventory.transfer.receiveRequest.create.error.title"),
1412
- message: i("inventory.transfer.receiveRequest.create.error.message"),
1414
+ title: a("inventory.transfer.receiveRequest.create.error.title"),
1415
+ message: a("inventory.transfer.receiveRequest.create.error.message"),
1413
1416
  type: "error"
1414
1417
  }), console.error("Error in creating purchase order", C);
1415
1418
  } finally {
1416
- v.value = !1;
1419
+ b.value = !1;
1417
1420
  }
1418
1421
  }
1419
1422
  async function ee() {
1420
- const b = x.value;
1421
- v.value = !0, (b.supplier.internal === "warehouse" || b.supplier.internal === "restaurant") && (b.items = b.items.map(({ totalCost: C, ...D }) => D));
1423
+ const _ = x.value;
1424
+ b.value = !0, (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: C, ...D }) => D));
1422
1425
  try {
1423
- await t.updatePurchaseOrder(b), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1424
- title: i("inventory.transfer.receiveRequest.update.success"),
1425
- message: i("inventory.transfer.receiveRequest.update.successMessage"),
1426
+ await t.updatePurchaseOrder(_), await new Promise((C) => setTimeout(C, 1e3)), n.open({
1427
+ title: a("inventory.transfer.receiveRequest.update.success"),
1428
+ message: a("inventory.transfer.receiveRequest.update.successMessage"),
1426
1429
  type: "success"
1427
- }), _("update:show", !1), _("submitted");
1430
+ }), d("update:show", !1), d("submitted");
1428
1431
  } catch (C) {
1429
1432
  n.open({
1430
- title: i("inventory.transfer.receiveRequest.update.error.title"),
1431
- message: i("inventory.transfer.receiveRequest.update.error.message"),
1433
+ title: a("inventory.transfer.receiveRequest.update.error.title"),
1434
+ message: a("inventory.transfer.receiveRequest.update.error.message"),
1432
1435
  type: "error"
1433
1436
  }), console.error("Error in updating purchase order", C);
1434
1437
  } finally {
1435
- v.value = !1;
1438
+ b.value = !1;
1436
1439
  }
1437
1440
  }
1438
1441
  function K() {
1439
- switch (l.mode) {
1442
+ switch (i.mode) {
1440
1443
  case be.CREATE:
1441
1444
  return G();
1442
1445
  case be.UPDATE:
@@ -1444,10 +1447,10 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1444
1447
  }
1445
1448
  }
1446
1449
  function J() {
1447
- var b, C;
1448
- (C = (b = L.value) == null ? void 0 : b.validateInputs) == null || C.call(b);
1450
+ var _, C;
1451
+ (C = (_ = L.value) == null ? void 0 : _.validateInputs) == null || C.call(_);
1449
1452
  }
1450
- return (b, C) => {
1453
+ return (_, C) => {
1451
1454
  const D = T("FmButton"), te = T("FmSideSheet");
1452
1455
  return F(), z(te, {
1453
1456
  modelValue: e(S),
@@ -1457,39 +1460,39 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1457
1460
  "max-width": 900
1458
1461
  }, {
1459
1462
  "side-sheet-header": O(() => [
1460
- r("div", As, [
1461
- r("div", Vs, V(U.value), 1)
1463
+ r("div", Vs, [
1464
+ r("div", Ds, V(U.value), 1)
1462
1465
  ])
1463
1466
  ]),
1464
1467
  default: O(() => [
1465
- (F(), z($s, {
1468
+ (F(), z(As, {
1466
1469
  class: "w-full",
1467
1470
  ref_key: "formRef",
1468
1471
  ref: L,
1469
- "onForm:ready": C[0] || (C[0] = () => c.value = !0),
1472
+ "onForm:ready": C[0] || (C[0] = () => p.value = !0),
1470
1473
  onValidationSuccess: K,
1471
1474
  modelValue: x.value,
1472
1475
  "onUpdate:modelValue": C[1] || (C[1] = (Q) => x.value = Q),
1473
- disabled: v.value || $.value,
1476
+ disabled: b.value || $.value,
1474
1477
  suppliers: e(w).suppliers,
1475
- skus: e(p).skus,
1478
+ skus: e(m).skus,
1476
1479
  key: E.value,
1477
- "last-closing-date": b.lastClosingDate
1480
+ "last-closing-date": _.lastClosingDate
1478
1481
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1479
1482
  ]),
1480
1483
  "side-sheet-footer": O(() => [
1481
- r("div", Ds, [
1484
+ r("div", Rs, [
1482
1485
  k(D, {
1483
- loading: v.value,
1486
+ loading: b.value,
1484
1487
  disabled: $.value,
1485
- label: e(i)("common.save"),
1488
+ label: e(a)("common.save"),
1486
1489
  onClick: J
1487
1490
  }, null, 8, ["loading", "disabled", "label"]),
1488
1491
  k(D, {
1489
1492
  disabled: $.value,
1490
1493
  variant: "tertiary",
1491
- label: e(i)("common.close"),
1492
- onClick: C[2] || (C[2] = (Q) => _("update:show", !1))
1494
+ label: e(a)("common.close"),
1495
+ onClick: C[2] || (C[2] = (Q) => d("update:show", !1))
1493
1496
  }, null, 8, ["disabled", "label"])
1494
1497
  ])
1495
1498
  ]),
@@ -1499,7 +1502,7 @@ const is = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, us = { key: 0 }
1499
1502
  }
1500
1503
  });
1501
1504
  export {
1502
- Ws as _,
1505
+ Ys as _,
1503
1506
  le as c,
1504
- zt as u
1507
+ jt as u
1505
1508
  };