@feedmepos/mf-inventory-portal 1.2.41-dev.1 → 1.2.41-dev.3

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 (70) hide show
  1. package/dist/{App-DpBuphD5.js → App-YVKka88t.js} +3 -3
  2. package/dist/{ApprovalView-D_Mz00V5.js → ApprovalView-vgaXX9Kr.js} +5 -5
  3. package/dist/{BindingsDialog-B9TA9ZZY.js → BindingsDialog-Clx4SlRb.js} +2 -2
  4. package/dist/{BindingsPicker-CR9Uxjc9.js → BindingsPicker-CP8NeoGg.js} +2 -2
  5. package/dist/{BindingsTable-dbDs2NwO.js → BindingsTable-ByX0HMim.js} +3 -3
  6. package/dist/{ClosingDraftView-DVVYxTKB.js → ClosingDraftView-DU4kNjaY.js} +8 -8
  7. package/dist/{ClosingHistoryView-CHYpDDFT.js → ClosingHistoryView-BYXkqTGX.js} +3 -3
  8. package/dist/{ClosingTemplateView-DaNlh-41.js → ClosingTemplateView-zTvBlixa.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-yCn1OD3o.js → DeliveryOrderPrintPreview-CoF4Ny60.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CtVesHcX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRRw8t26.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C8bS92lj.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C0iK41yT.js} +2 -2
  12. package/dist/{FmMultiselectDialog-CtjcyINM.js → FmMultiselectDialog-YG4narqp.js} +1 -1
  13. package/dist/{FmMultiselectDialog-CMc30F6I.js → FmMultiselectDialog-s3gG_Btp.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BUSPNpYk.js → FmUnitInput.vue_vue_type_script_setup_true_lang-C-vkq5h3.js} +3 -3
  15. package/dist/{ImportView-BX_xch8X.js → ImportView-B9uKqYTz.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-q_olC3jj.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-C4W0fDvb.js} +1 -1
  17. package/dist/{IngredientGroupView-AJdvDlFJ.js → IngredientGroupView-D5FilJjn.js} +5 -5
  18. package/dist/{IngredientsView-DRROD_sO.js → IngredientsView-BIDo5K8J.js} +14 -14
  19. package/dist/{IntegrationView-CiTRD2au.js → IntegrationView--y27cJZQ.js} +448 -446
  20. package/dist/{InventoryBindingForm-Dms85LZH.js → InventoryBindingForm-DHzFBWiC.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-lEFUQ2_w.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CQuOQBpb.js} +4 -4
  22. package/dist/{InventoryBindingSummary-BfZX5_8W.js → InventoryBindingSummary-CSEC8LTb.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BomlP6Zj.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-zm48233g.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D7RBtyzX.js → PremiumBadge.vue_vue_type_script_setup_true_lang-WK1WZop-.js} +2 -2
  25. package/dist/{PublishView-DbF3PA9M.js → PublishView-DSF4nZep.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-BU6R8JGC.js → PurchaseOrderPrintPreview-Bs0XQVY8.js} +1 -1
  27. package/dist/{ReceiveRequestView-vfmaiya2.js → ReceiveRequestView-BZQPJGt7.js} +723 -712
  28. package/dist/{RecipeView-DVzW6zmd.js → RecipeView-rtnePutr.js} +8 -8
  29. package/dist/{StockView-BEzn-FSm.js → StockView-Dt-P33zN.js} +15 -15
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BQRS3udz.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-D4OGMZoq.js} +1 -1
  31. package/dist/{SupplierView-BReSShn1.js → SupplierView-BdvwHbo6.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-1zS3tzCs.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-CMdswBVK.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Cemn-Ug7.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-DyfwzEzh.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-C0tj6lli.js → TransferDetails.vue_vue_type_script_setup_true_lang-Dv8McExZ.js} +14 -14
  35. package/dist/{TransferTemplateView-BDG3sK6k.js → TransferTemplateView-CnyXs3rL.js} +15 -15
  36. package/dist/{UnitView-DJTFfgjL.js → UnitView-Cl3keYP3.js} +6 -6
  37. package/dist/{WarehouseView-DubFaS2f.js → WarehouseView-COrKJLVH.js} +5 -5
  38. package/dist/{WastageTemplateView-DiSMEc_v.js → WastageTemplateView-DeQZ--jn.js} +14 -14
  39. package/dist/{app-CUlBhkxz.js → app-BaIqupQH.js} +7 -7
  40. package/dist/app.js +1 -1
  41. package/dist/{closing-template-BWeg3cTL.js → closing-template-BHB2A37w.js} +1 -1
  42. package/dist/{date2-DN8HBPbX.js → date2-B4Ndupnt.js} +1 -1
  43. package/dist/{dayjs.min-DHDLxEZW.js → dayjs.min-T6tsoBtV.js} +1 -1
  44. package/dist/{decimal-X9ish62l.js → decimal-BzLurfxB.js} +2 -2
  45. package/dist/{defineDeepModel-Dn4y4CxX.js → defineDeepModel-DHduNX9z.js} +1 -1
  46. package/dist/{duplicate-template-B983w6th.js → duplicate-template-DA7ODndg.js} +1 -1
  47. package/dist/{feature-DWuObhYe.js → feature-CViFtCgh.js} +477 -465
  48. package/dist/{format-time-from-id-CDhd-ckL.js → format-time-from-id-0Rmx6arm.js} +1 -1
  49. package/dist/{format-unit-display-DnNolGa4.js → format-unit-display-BW8gT760.js} +10 -10
  50. package/dist/{import-export.helper-QIjnplqi.js → import-export.helper-CYJoKyAG.js} +5 -5
  51. package/dist/{index-B1t4VoE7.js → index-Ba4sac_0.js} +1 -1
  52. package/dist/{index-Bn2eD2Uz.js → index-DpM3J998.js} +1 -1
  53. package/dist/{index-CTPXOs5C.js → index-l3-bldO3.js} +3 -3
  54. package/dist/{lodash-DqIHoo57.js → lodash-DWQT0eeY.js} +1 -1
  55. package/dist/{netsuite-B2mPfmMi.js → netsuite-BMEH5Su0.js} +5 -4
  56. package/dist/{purchase-order-template-dibdUdwo.js → purchase-order-template-3P2fj7pq.js} +1 -1
  57. package/dist/{rules-BTvX30Wt.js → rules-DSrHqxx-.js} +3 -3
  58. package/dist/{stock-CXHSIeqr.js → stock-BBWN-82G.js} +1 -1
  59. package/dist/{stock-JJC2cioJ.js → stock-Ddsn4xuh.js} +3 -3
  60. package/dist/{supplier-ChOjxalb.js → supplier-BvIS2GVG.js} +2 -2
  61. package/dist/{use-ingredient-select-dialog-BPlCWbt9.js → use-ingredient-select-dialog-CtbIPUL2.js} +2 -2
  62. package/dist/{use-inventory-binding-dialog-n6m07Y2O.js → use-inventory-binding-dialog-BuECH2Za.js} +2 -2
  63. package/dist/{use-template-enabled-locations-2-D49x4b9_.js → use-template-enabled-locations-2-C9LbpaS-.js} +2 -2
  64. package/dist/views/integration/components/netsuite/business/NetSuiteLocationField.vue.d.ts +6 -0
  65. package/dist/views/receive-request/components/transfer-form/NetSuiteField.vue.d.ts +2 -0
  66. package/dist/views/receive-request/components/transfer-form/composables/use-purchase-order-form-controller.d.ts +2 -2
  67. package/dist/{vue-i18n-lgz-Dtpa.js → vue-i18n-Cqc_5cq4.js} +221 -221
  68. package/dist/{xlsx-Bk05m86l.js → xlsx-C6sw1JFf.js} +1 -1
  69. package/dist/{xlsx.util-VJnrD8a7.js → xlsx.util-A9QOdbmD.js} +1 -1
  70. package/package.json +3 -3
@@ -1,33 +1,33 @@
1
- import { reactive as Tt, onMounted as st, watch as fe, computed as N, h as j, defineComponent as de, openBlock as x, createElementBlock as T, Fragment as le, renderList as he, createElementVNode as l, toDisplayString as E, unref as t, resolveComponent as V, createVNode as f, withCtx as O, createCommentVNode as Q, ref as M, createBlock as se, normalizeClass as K, normalizeStyle as Vt, createTextVNode as Ae, toRaw as Mt, shallowRef as Nt, onUnmounted as Ut, mergeProps as ut, isRef as we, createSlots as zt, Teleport as Bt, normalizeProps as Lt, guardReactiveProps as Ht } from "vue";
2
- import { s as dt, t as me, I as jt, f as Pt, L as Qt, A as Yt, u as ot, a as at, M as Kt, O as Xt, v as Zt, m as et } from "./app-CUlBhkxz.js";
3
- import { i as Ct, _ as Wt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C8bS92lj.js";
4
- import { u as Gt, P as it, a as Jt, _ as es, g as ts } from "./TransferDetails.vue_vue_type_script_setup_true_lang-C0tj6lli.js";
5
- import { R as Be, a as Se, e as tt, d as ss, A as Le, M as os, B as as } from "./rules-BTvX30Wt.js";
6
- import { _ as Rt, u as ns, i as ls, e as rs } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-D7RBtyzX.js";
7
- import { d as wt } from "./dayjs.min-DHDLxEZW.js";
1
+ import { reactive as Tt, onMounted as st, watch as pe, computed as N, h as j, defineComponent as de, openBlock as x, createElementBlock as T, Fragment as le, renderList as he, createElementVNode as l, toDisplayString as E, unref as t, resolveComponent as V, createVNode as p, withCtx as A, createCommentVNode as Q, ref as q, createBlock as se, normalizeClass as K, normalizeStyle as Vt, createTextVNode as Oe, toRaw as qt, shallowRef as Nt, onUnmounted as Ut, mergeProps as ut, isRef as we, createSlots as zt, Teleport as Bt, normalizeProps as Lt, guardReactiveProps as Ht } from "vue";
2
+ import { s as dt, t as me, I as jt, f as Pt, L as Qt, A as Yt, u as ot, a as at, M as Kt, O as Xt, v as Zt, m as et } from "./app-BaIqupQH.js";
3
+ import { i as Ct, _ as Wt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-C0iK41yT.js";
4
+ import { u as Gt, P as it, a as Jt, _ as es, g as ts } from "./TransferDetails.vue_vue_type_script_setup_true_lang-Dv8McExZ.js";
5
+ import { R as Be, a as Se, e as tt, d as ss, A as Le, M as os, B as as } from "./rules-DSrHqxx-.js";
6
+ import { _ as Rt, u as ns, i as ls, e as rs } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-WK1WZop-.js";
7
+ import { d as wt } from "./dayjs.min-T6tsoBtV.js";
8
8
  import { u as is } from "./useTabStorage-BkIVScW_.js";
9
9
  import { u as us, _ as ds } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
10
- import { useBreakpoints as ct, components as ye, FmButtonVariant as cs, useSnackbar as Oe, useDialog as ms, useProxiedModel as At } from "@feedmepos/ui-library";
10
+ import { useBreakpoints as ct, components as ye, FmButtonVariant as cs, useSnackbar as Ae, useDialog as ms, useProxiedModel as Ot } from "@feedmepos/ui-library";
11
11
  import { F as ze } from "./form-mode.enum-BKiNVH6A.js";
12
- import { d as St } from "./index-B1t4VoE7.js";
13
- import { _ as ps, a as fs, b as vs, F as ys } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BUSPNpYk.js";
14
- import { u as nt, c as bs, P as gs } from "./feature-DWuObhYe.js";
15
- import { u as He } from "./netsuite-B2mPfmMi.js";
16
- import { c as Pe, u as _s, _ as hs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CtVesHcX.js";
12
+ import { d as St } from "./index-Ba4sac_0.js";
13
+ import { _ as ps, a as fs, b as vs, F as ys } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-C-vkq5h3.js";
14
+ import { u as nt, c as bs, P as gs } from "./feature-CViFtCgh.js";
15
+ import { u as He } from "./netsuite-BMEH5Su0.js";
16
+ import { c as Pe, u as _s, _ as hs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DRRw8t26.js";
17
17
  import { useI18n as be } from "@feedmepos/mf-common";
18
- import { a as ks } from "./FmMultiselectDialog-CMc30F6I.js";
19
- import { F as pe, _ as Ot } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
20
- import { u as mt } from "./supplier-ChOjxalb.js";
21
- import { d as pt, e as xs, g as Cs, b as ws } from "./date2-DN8HBPbX.js";
18
+ import { a as ks } from "./FmMultiselectDialog-s3gG_Btp.js";
19
+ import { F as fe, _ as At } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DlNJ6kRg.js";
20
+ import { u as mt } from "./supplier-BvIS2GVG.js";
21
+ import { d as pt, e as xs, g as Cs, b as ws } from "./date2-B4Ndupnt.js";
22
22
  import { _ as Ss } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
23
- import { a as Et } from "./format-unit-display-DnNolGa4.js";
24
- import { u as ft } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-1zS3tzCs.js";
25
- import { u as Fs } from "./vue-i18n-lgz-Dtpa.js";
26
- import { s as Is, r as $s } from "./xlsx.util-VJnrD8a7.js";
23
+ import { a as Et } from "./format-unit-display-BW8gT760.js";
24
+ import { u as ft } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-CMdswBVK.js";
25
+ import { u as Fs } from "./vue-i18n-Cqc_5cq4.js";
26
+ import { s as Is, r as $s } from "./xlsx.util-A9QOdbmD.js";
27
27
  import { F as Ds } from "./FmDroppableField-J0xUsOTV.js";
28
- import { d as Ts } from "./defineDeepModel-Dn4y4CxX.js";
28
+ import { d as Ts } from "./defineDeepModel-DHduNX9z.js";
29
29
  import { N as Vs, H as Ps } from "./app-uBuHtW8m.js";
30
- var te = /* @__PURE__ */ ((d) => (d.Code = "Code", d.Name = "Name", d.TemplateName = "TemplateName", d.Amount = "Amount", d.Cost = "Cost", d.TotalCost = "TotalCost", d.Delete = "Delete", d))(te || {});
30
+ var te = /* @__PURE__ */ ((c) => (c.Code = "Code", c.Name = "Name", c.TemplateName = "TemplateName", c.Amount = "Amount", c.Cost = "Cost", c.TotalCost = "TotalCost", c.Delete = "Delete", c))(te || {});
31
31
  const Rs = () => (be(), j(
32
32
  Rt,
33
33
  {
@@ -36,47 +36,47 @@ const Rs = () => (be(), j(
36
36
  },
37
37
  `Total (${Pt()})`
38
38
  ));
39
- function As(d) {
39
+ function Os(c) {
40
40
  const { t: v } = be(), n = Tt({}), { breakpoints: u } = ct(), g = nt(), a = He();
41
41
  st(() => {
42
- for (const p of d.items) {
43
- if (!p.totalCost)
42
+ for (const m of c.items) {
43
+ if (!m.totalCost)
44
44
  continue;
45
45
  const { cost: e } = Pe(
46
- p.sku,
47
- p.quantity,
48
- p.measurement,
46
+ m.sku,
47
+ m.quantity,
48
+ m.measurement,
49
49
  {
50
- supplier: d.supplier
50
+ supplier: c.supplier
51
51
  }
52
- ), i = p.totalCost ?? dt.reset();
53
- e ? n[p.sku._id] = e.amount !== i.amount || e.precision !== i.precision : n[p.sku._id] = !0;
52
+ ), r = m.totalCost ?? dt.reset();
53
+ e ? n[m.sku._id] = e.amount !== r.amount || e.precision !== r.precision : n[m.sku._id] = !0;
54
54
  }
55
- }), fe(
55
+ }), pe(
56
56
  () => {
57
- var p;
58
- return (p = d.supplier) == null ? void 0 : p._id;
57
+ var m;
58
+ return (m = c.supplier) == null ? void 0 : m._id;
59
59
  },
60
60
  () => {
61
- const p = d.supplier;
62
- for (const e of d.items) {
61
+ const m = c.supplier;
62
+ for (const e of c.items) {
63
63
  if (!e.totalCost || n[e.sku._id] || !k(e.sku))
64
64
  continue;
65
- const { cost: i } = Pe(
65
+ const { cost: r } = Pe(
66
66
  e.sku,
67
67
  e.quantity,
68
68
  e.measurement,
69
69
  {
70
- supplier: p
70
+ supplier: m
71
71
  }
72
72
  );
73
- d.updateItem({ ...e, totalCost: i });
73
+ c.updateItem({ ...e, totalCost: r });
74
74
  }
75
75
  }
76
76
  );
77
- function k(p) {
78
- var i, b, o, r, m, _, S;
79
- return !!(((b = (i = p.defaultCost) == null ? void 0 : i.costPerUnit) == null ? void 0 : b.amount) ?? ((S = (_ = (m = (r = (o = d.supplier) == null ? void 0 : o.supplyItems) == null ? void 0 : r.find((c) => c.skuId === p._id)) == null ? void 0 : m.defaultCost) == null ? void 0 : _.costPerUnit) == null ? void 0 : S.amount));
77
+ function k(m) {
78
+ var r, y, o, i, d, _, w;
79
+ return !!(((y = (r = m.defaultCost) == null ? void 0 : r.costPerUnit) == null ? void 0 : y.amount) ?? ((w = (_ = (d = (i = (o = c.supplier) == null ? void 0 : o.supplyItems) == null ? void 0 : i.find((f) => f.skuId === m._id)) == null ? void 0 : d.defaultCost) == null ? void 0 : _.costPerUnit) == null ? void 0 : w.amount));
80
80
  }
81
81
  const C = [
82
82
  {
@@ -84,8 +84,8 @@ function As(d) {
84
84
  header: () => v("inventory.transfer.form.items.table.Code"),
85
85
  accessorKey: "code",
86
86
  size: 200,
87
- cell(p) {
88
- const e = p.row.original;
87
+ cell(m) {
88
+ const e = m.row.original;
89
89
  return a.isEnabled ? j(
90
90
  ye.FmTooltip,
91
91
  {
@@ -103,10 +103,10 @@ function As(d) {
103
103
  )
104
104
  ) : j(ye.FmTextField, {
105
105
  modelValue: e.code,
106
- "onUpdate:modelValue": (i) => {
107
- d.updateItem({
106
+ "onUpdate:modelValue": (r) => {
107
+ c.updateItem({
108
108
  ...e,
109
- code: i
109
+ code: r
110
110
  });
111
111
  },
112
112
  key: e.sku._id,
@@ -120,8 +120,8 @@ function As(d) {
120
120
  id: "Name",
121
121
  header: () => v("inventory.transfer.form.items.table.Name"),
122
122
  minSize: 300,
123
- cell(p) {
124
- const e = p.row.original;
123
+ cell(m) {
124
+ const e = m.row.original;
125
125
  return a.isEnabled ? j(
126
126
  ye.FmTooltip,
127
127
  {
@@ -139,10 +139,10 @@ function As(d) {
139
139
  )
140
140
  ) : j(ye.FmTextField, {
141
141
  modelValue: e.name,
142
- "onUpdate:modelValue": (i) => {
143
- d.updateItem({
142
+ "onUpdate:modelValue": (r) => {
143
+ c.updateItem({
144
144
  ...e,
145
- name: i
145
+ name: r
146
146
  });
147
147
  },
148
148
  key: e.sku._id,
@@ -157,8 +157,8 @@ function As(d) {
157
157
  header: () => v("inventory.transfer.form.items.table.Name"),
158
158
  minSize: 300,
159
159
  enableSorting: !1,
160
- cell(p) {
161
- const e = p.row.original, i = e.code, b = e.name;
160
+ cell(m) {
161
+ const e = m.row.original, r = e.code, y = e.name;
162
162
  return j(
163
163
  ye.FmTooltip,
164
164
  { zIndex: 50 },
@@ -168,19 +168,19 @@ function As(d) {
168
168
  j(
169
169
  "div",
170
170
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
171
- b
171
+ y
172
172
  ),
173
173
  j(
174
174
  "div",
175
175
  {
176
176
  class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
177
177
  },
178
- i
178
+ r
179
179
  )
180
180
  ]);
181
181
  },
182
182
  content() {
183
- return b;
183
+ return y;
184
184
  }
185
185
  }
186
186
  );
@@ -190,10 +190,10 @@ function As(d) {
190
190
  id: "Amount",
191
191
  header: () => v("inventory.transfer.form.items.table.Amount"),
192
192
  minSize: 200,
193
- cell(p) {
194
- var r, m, _, S, c;
195
- const e = p.row.original, i = (r = d.forecastAmounts) == null ? void 0 : r.find((y) => y.skuId === e.sku._id), b = i ? i.helperState === "error" ? `Predicted: ${i.amount} (out of range)` : `Predicted: ${i.amount}` : void 0, o = (S = (_ = (m = d.template) == null ? void 0 : m.purchaseOrder) == null ? void 0 : _.items) == null ? void 0 : S.find(
196
- (y) => y.sku._id === e.sku._id
193
+ cell(m) {
194
+ var i, d, _, w, f;
195
+ const e = m.row.original, r = (i = c.forecastAmounts) == null ? void 0 : i.find((b) => b.skuId === e.sku._id), y = r ? r.helperState === "error" ? `Predicted: ${r.amount} (out of range)` : `Predicted: ${r.amount}` : void 0, o = (w = (_ = (d = c.template) == null ? void 0 : d.purchaseOrder) == null ? void 0 : _.items) == null ? void 0 : w.find(
196
+ (b) => b.sku._id === e.sku._id
197
197
  );
198
198
  return j(ps, {
199
199
  style: {
@@ -205,14 +205,14 @@ function As(d) {
205
205
  },
206
206
  key: e.sku._id,
207
207
  unit: e.sku.unit,
208
- helperText: b,
209
- helperState: i == null ? void 0 : i.helperState,
210
- "onUpdate:modelValue": (y) => {
211
- if (!y) return;
208
+ helperText: y,
209
+ helperState: r == null ? void 0 : r.helperState,
210
+ "onUpdate:modelValue": (b) => {
211
+ if (!b) return;
212
212
  const I = {
213
213
  ...e,
214
- quantity: y.amount,
215
- measurement: y.measurement
214
+ quantity: b.amount,
215
+ measurement: b.measurement
216
216
  };
217
217
  if (g.enableTotalCost) {
218
218
  const { cost: z } = Pe(
@@ -220,7 +220,7 @@ function As(d) {
220
220
  I.quantity,
221
221
  I.measurement,
222
222
  {
223
- supplier: d.supplier,
223
+ supplier: c.supplier,
224
224
  // NOTE: set undefined here if `manualTotalCost[updatedRow.sku._id] = false`, so that the function
225
225
  // will return the auto calculated default cost instead of the manual total cost
226
226
  manualTotalCost: n[I.sku._id] ? I.totalCost : void 0
@@ -228,15 +228,15 @@ function As(d) {
228
228
  );
229
229
  I.totalCost = z;
230
230
  }
231
- d.updateItem(I);
231
+ c.updateItem(I);
232
232
  },
233
233
  stepper: o == null ? void 0 : o.quantityStep,
234
234
  disableUnit: !!o,
235
- disabled: d.disabled,
235
+ disabled: c.disabled,
236
236
  rules: [
237
237
  fs(
238
238
  +Se(
239
- ((c = e.quantity) == null ? void 0 : c.amount) === 0 ? { amount: 0, precision: 0 } : (o == null ? void 0 : o.minimumQuantity) ?? { amount: 0, precision: 0 }
239
+ ((f = e.quantity) == null ? void 0 : f.amount) === 0 ? { amount: 0, precision: 0 } : (o == null ? void 0 : o.minimumQuantity) ?? { amount: 0, precision: 0 }
240
240
  )
241
241
  ),
242
242
  vs(
@@ -253,15 +253,15 @@ function As(d) {
253
253
  id: "Cost",
254
254
  header: Rs,
255
255
  size: 180,
256
- cell(p) {
257
- const e = p.row.original, i = k(e.sku), b = u.value.xs || u.value.sm;
258
- if (!n[e.sku._id] && i) {
259
- const { cost: o, supplierOverrideCost: r } = Pe(
256
+ cell(m) {
257
+ const e = m.row.original, r = k(e.sku), y = u.value.xs || u.value.sm;
258
+ if (!n[e.sku._id] && r) {
259
+ const { cost: o, supplierOverrideCost: i } = Pe(
260
260
  e.sku,
261
261
  e.quantity,
262
262
  e.measurement,
263
263
  {
264
- supplier: d.supplier
264
+ supplier: c.supplier
265
265
  }
266
266
  );
267
267
  return j(
@@ -269,7 +269,7 @@ function As(d) {
269
269
  {
270
270
  class: [
271
271
  "flex gap-4 fm-typo-en-body-md-400 items-center",
272
- d.disabled ? "text-fm-color-typo-disabled" : ""
272
+ c.disabled ? "text-fm-color-typo-disabled" : ""
273
273
  ],
274
274
  key: e.sku._id
275
275
  },
@@ -277,9 +277,9 @@ function As(d) {
277
277
  j(ye.FmButton, {
278
278
  prependIcon: "edit",
279
279
  variant: cs.Tertiary,
280
- disabled: d.disabled,
280
+ disabled: c.disabled,
281
281
  onClick() {
282
- d.updateItem({
282
+ c.updateItem({
283
283
  ...e,
284
284
  totalCost: o
285
285
  }), n[e.sku._id] = !0;
@@ -293,33 +293,33 @@ function As(d) {
293
293
  [
294
294
  j(
295
295
  "span",
296
- b ? tt(o) : Se(o)
296
+ y ? tt(o) : Se(o)
297
297
  ),
298
298
  j(
299
299
  "span",
300
300
  {
301
301
  class: [
302
302
  "fm-typo-en-body-sm-400",
303
- d.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
303
+ c.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
304
304
  ]
305
305
  },
306
306
  v("inventory.transfer.form.items.autoCalculated")
307
307
  ),
308
- r ? j(
308
+ i ? j(
309
309
  "span",
310
310
  {
311
311
  class: [
312
312
  "fm-typo-en-body-sm-400",
313
- d.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
313
+ c.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-neutral-gray-400"
314
314
  ]
315
315
  },
316
316
  [
317
- tt(r.costPerUnit),
317
+ tt(i.costPerUnit),
318
318
  "/",
319
- r.measurement ? j(
319
+ i.measurement ? j(
320
320
  "span",
321
321
  { class: "text-blue-500 font-semibold" },
322
- r.measurement.abbrev
322
+ i.measurement.abbrev
323
323
  ) : j("span", { class: "text-green-500 font-bold" }, e.sku.unit.abbrev)
324
324
  // base unit style
325
325
  ]
@@ -335,7 +335,7 @@ function As(d) {
335
335
  modelValue: Se(e.totalCost ?? { amount: 0, precision: 0 }),
336
336
  key: e.sku._id,
337
337
  "onUpdate:modelValue": (o) => {
338
- d.updateItem({
338
+ c.updateItem({
339
339
  ...e,
340
340
  totalCost: {
341
341
  ...ss(+o),
@@ -347,32 +347,32 @@ function As(d) {
347
347
  },
348
348
  {
349
349
  prepend() {
350
- return b ? j(
350
+ return y ? j(
351
351
  "div",
352
352
  {
353
353
  class: [
354
354
  "text-fm-typo-en-body-lg-400",
355
- d.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
355
+ c.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
356
356
  ]
357
357
  },
358
358
  Pt()
359
359
  ) : null;
360
360
  },
361
361
  append() {
362
- return i ? j(ye.FmButton, {
362
+ return r ? j(ye.FmButton, {
363
363
  prependIcon: "close",
364
364
  variant: "tertiary",
365
- disabled: d.disabled,
365
+ disabled: c.disabled,
366
366
  onClick() {
367
367
  const { cost: o } = Pe(
368
368
  e.sku,
369
369
  e.quantity,
370
370
  e.measurement,
371
371
  {
372
- supplier: d.supplier
372
+ supplier: c.supplier
373
373
  }
374
374
  );
375
- d.updateItem({
375
+ c.updateItem({
376
376
  ...e,
377
377
  // NOTE: different from PO template, if a default cost is reenabled,
378
378
  // the total cost will automatically assigned
@@ -389,8 +389,8 @@ function As(d) {
389
389
  {
390
390
  id: "Delete",
391
391
  header: "",
392
- cell(p) {
393
- const e = p.row.original;
392
+ cell(m) {
393
+ const e = m.row.original;
394
394
  return j("div", { class: "flex justify-end" }, [
395
395
  j(ye.FmButton, {
396
396
  key: e.sku._id,
@@ -399,9 +399,9 @@ function As(d) {
399
399
  icon: "delete",
400
400
  variant: "tertiary",
401
401
  size: "md",
402
- disabled: d.disabled,
402
+ disabled: c.disabled,
403
403
  onClick: () => {
404
- d.deleteItem(e);
404
+ c.deleteItem(e);
405
405
  }
406
406
  })
407
407
  ]);
@@ -415,23 +415,23 @@ function As(d) {
415
415
  }
416
416
  ];
417
417
  return {
418
- columnDefs: N(() => g.enableTotalCost && d.transferType === me.enum.purchase ? C : C.filter(
419
- (p) => p.id !== "Cost"
418
+ columnDefs: N(() => g.enableTotalCost && c.transferType === me.enum.purchase ? C : C.filter(
419
+ (m) => m.id !== "Cost"
420
420
  /* Cost */
421
421
  ))
422
422
  };
423
423
  }
424
- const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Es = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, qs = { class: "w-[450px] xs:w-full flex" }, Ms = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Ns = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qt = /* @__PURE__ */ de({
424
+ const As = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Es = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Ms = { class: "w-[450px] xs:w-full flex" }, qs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Ns = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Mt = /* @__PURE__ */ de({
425
425
  __name: "SupplierPriceHistory",
426
426
  props: {
427
427
  prices: {}
428
428
  },
429
- setup(d) {
429
+ setup(c) {
430
430
  const v = mt();
431
431
  function n(u) {
432
432
  return v.suppliers.find((g) => g._id === u);
433
433
  }
434
- return (u, g) => (x(), T("div", Os, [
434
+ return (u, g) => (x(), T("div", As, [
435
435
  (x(!0), T(le, null, he(Object.keys(u.prices), (a) => {
436
436
  var k;
437
437
  return x(), T("div", {
@@ -439,14 +439,14 @@ const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
439
439
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
440
440
  }, [
441
441
  l("div", Es, E((k = n(a)) == null ? void 0 : k.name), 1),
442
- l("div", qs, [
442
+ l("div", Ms, [
443
443
  (x(!0), T(le, null, he(u.prices[a].slice(0, 3), (C) => {
444
444
  var $;
445
445
  return x(), T("div", {
446
446
  key: C.date,
447
447
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
448
448
  }, [
449
- l("div", Ms, [
449
+ l("div", qs, [
450
450
  l("span", null, E(C.totalCost ? t(tt)(C.totalCost) : "No data"), 1),
451
451
  g[0] || (g[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
452
452
  l("span", null, E(t(Se)(C.totalUnit, !1)), 1),
@@ -475,10 +475,10 @@ const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
475
475
  showComparePrice: { type: Boolean },
476
476
  row: {}
477
477
  },
478
- setup(d) {
478
+ setup(c) {
479
479
  const { t: v } = be();
480
480
  return (n, u) => {
481
- var k, C, $, p, e, i, b, o, r, m, _, S, c, y, I, z, B, X, oe, U, P, R, D, q, L, Z, w;
481
+ var k, C, $, m, e, r, y, o, i, d, _, w, f, b, I, z, B, X, oe, U, P, R, D, M, L, Z, S;
482
482
  const g = V("FmLabel"), a = V("FmSpacer");
483
483
  return x(), T("div", Us, [
484
484
  l("div", zs, [
@@ -487,79 +487,79 @@ const Os = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
487
487
  l("span", Hs, E(n.row.original.sku.name), 1)
488
488
  ]),
489
489
  l("div", null, [
490
- f(t(pe), {
490
+ p(t(fe), {
491
491
  render: ($ = (C = (k = n.cellByColId.Delete) == null ? void 0 : k.column) == null ? void 0 : C.columnDef) == null ? void 0 : $.cell,
492
- props: (e = (p = n.cellByColId.Delete) == null ? void 0 : p.getContext) == null ? void 0 : e.call(p)
492
+ props: (e = (m = n.cellByColId.Delete) == null ? void 0 : m.getContext) == null ? void 0 : e.call(m)
493
493
  }, null, 8, ["render", "props"])
494
494
  ])
495
495
  ]),
496
496
  l("div", js, [
497
497
  l("div", Qs, [
498
- f(g, {
498
+ p(g, {
499
499
  label: t(v)(`inventory.transfer.form.items.table.${t(te).Code}`)
500
500
  }, null, 8, ["label"]),
501
- f(t(pe), {
502
- render: (o = (b = (i = n.cellByColId[t(te).Code]) == null ? void 0 : i.column) == null ? void 0 : b.columnDef) == null ? void 0 : o.cell,
503
- props: (m = (r = n.cellByColId[t(te).Code]) == null ? void 0 : r.getContext) == null ? void 0 : m.call(r)
501
+ p(t(fe), {
502
+ render: (o = (y = (r = n.cellByColId[t(te).Code]) == null ? void 0 : r.column) == null ? void 0 : y.columnDef) == null ? void 0 : o.cell,
503
+ props: (d = (i = n.cellByColId[t(te).Code]) == null ? void 0 : i.getContext) == null ? void 0 : d.call(i)
504
504
  }, null, 8, ["render", "props"]),
505
505
  u[0] || (u[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
506
506
  ]),
507
507
  l("div", Ys, [
508
- f(g, {
508
+ p(g, {
509
509
  label: t(v)(`inventory.transfer.form.items.table.${t(te).Name}`)
510
510
  }, null, 8, ["label"]),
511
- f(t(pe), {
512
- render: (c = (S = (_ = n.cellByColId[t(te).Name]) == null ? void 0 : _.column) == null ? void 0 : S.columnDef) == null ? void 0 : c.cell,
513
- props: (I = (y = n.cellByColId[t(te).Name]) == null ? void 0 : y.getContext) == null ? void 0 : I.call(y)
511
+ p(t(fe), {
512
+ render: (f = (w = (_ = n.cellByColId[t(te).Name]) == null ? void 0 : _.column) == null ? void 0 : w.columnDef) == null ? void 0 : f.cell,
513
+ props: (I = (b = n.cellByColId[t(te).Name]) == null ? void 0 : b.getContext) == null ? void 0 : I.call(b)
514
514
  }, null, 8, ["render", "props"]),
515
515
  u[1] || (u[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
516
516
  ])
517
517
  ]),
518
518
  l("div", Ks, [
519
519
  l("div", Xs, [
520
- f(g, {
520
+ p(g, {
521
521
  label: t(v)(`inventory.transfer.form.items.table.${t(te).Amount}`)
522
522
  }, null, 8, ["label"]),
523
- f(t(pe), {
523
+ p(t(fe), {
524
524
  render: (X = (B = (z = n.cellByColId[t(te).Amount]) == null ? void 0 : z.column) == null ? void 0 : B.columnDef) == null ? void 0 : X.cell,
525
525
  props: (U = (oe = n.cellByColId[t(te).Amount]) == null ? void 0 : oe.getContext) == null ? void 0 : U.call(oe)
526
526
  }, null, 8, ["render", "props"]),
527
527
  u[2] || (u[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
528
528
  ]),
529
529
  n.cellByColId[t(te).Cost] ? (x(), T("div", Zs, [
530
- f(Rt, { "z-index": 50 }, {
531
- default: O(() => [
532
- f(g, {
530
+ p(Rt, { "z-index": 50 }, {
531
+ default: A(() => [
532
+ p(g, {
533
533
  label: t(v)(`inventory.transfer.form.items.table.${t(te).Cost}2`)
534
534
  }, null, 8, ["label"])
535
535
  ]),
536
536
  _: 1
537
537
  }),
538
- f(t(pe), {
538
+ p(t(fe), {
539
539
  render: (D = (R = (P = n.cellByColId[t(te).Cost]) == null ? void 0 : P.column) == null ? void 0 : R.columnDef) == null ? void 0 : D.cell,
540
- props: (L = (q = n.cellByColId[t(te).Cost]) == null ? void 0 : q.getContext) == null ? void 0 : L.call(q)
540
+ props: (L = (M = n.cellByColId[t(te).Cost]) == null ? void 0 : M.getContext) == null ? void 0 : L.call(M)
541
541
  }, null, 8, ["render", "props"]),
542
542
  u[3] || (u[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
543
543
  ])) : Q("", !0)
544
544
  ]),
545
545
  n.showComparePrice && Object.keys(n.comparePriceBySku[(Z = n.row.original.sku) == null ? void 0 : Z._id] ?? {}).length > 0 ? (x(), T(le, { key: 0 }, [
546
- f(a, { class: "h-8" }),
547
- f(qt, {
548
- prices: n.comparePriceBySku[(w = n.row.original.sku) == null ? void 0 : w._id]
546
+ p(a, { class: "h-8" }),
547
+ p(Mt, {
548
+ prices: n.comparePriceBySku[(S = n.row.original.sku) == null ? void 0 : S._id]
549
549
  }, null, 8, ["prices"])
550
550
  ], 64)) : Q("", !0)
551
551
  ]);
552
552
  };
553
553
  }
554
554
  });
555
- function Gs(d) {
555
+ function Gs(c) {
556
556
  const v = N({
557
557
  get() {
558
- const a = d.getEffectiveAt();
558
+ const a = c.getEffectiveAt();
559
559
  return a ? new Date(a) : null;
560
560
  },
561
561
  set(a) {
562
- d.setEffectiveAt((a == null ? void 0 : a.toISOString()) ?? null);
562
+ c.setEffectiveAt((a == null ? void 0 : a.toISOString()) ?? null);
563
563
  }
564
564
  }), n = N({
565
565
  get() {
@@ -608,26 +608,26 @@ const Js = {
608
608
  default: "#c7c7cc"
609
609
  }
610
610
  },
611
- setup(d) {
611
+ setup(c) {
612
612
  return (v, n) => (x(), T("svg", Js, [
613
613
  l("path", {
614
614
  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",
615
- fill: d.color
615
+ fill: c.color
616
616
  }, null, 8, eo),
617
617
  l("path", {
618
618
  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",
619
- fill: d.color
619
+ fill: c.color
620
620
  }, null, 8, to),
621
621
  l("path", {
622
622
  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",
623
- stroke: d.color,
623
+ stroke: c.color,
624
624
  "stroke-width": "1.5",
625
625
  "stroke-linecap": "round",
626
626
  "stroke-linejoin": "round"
627
627
  }, null, 8, so),
628
628
  l("path", {
629
629
  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",
630
- stroke: d.color,
630
+ stroke: c.color,
631
631
  "stroke-width": "1.5",
632
632
  "stroke-linecap": "round",
633
633
  "stroke-linejoin": "round"
@@ -643,46 +643,46 @@ const Js = {
643
643
  templateItems: {}
644
644
  },
645
645
  emits: ["update:poItems", "update:forecastAmounts"],
646
- setup(d, { emit: v }) {
647
- const n = d, u = v, g = M(!1), a = M(7), k = ns(), C = Oe(), { t: $ } = be();
648
- function p(o, r, m) {
649
- return r != null && o < r && (o = r), m != null && o > m && (o = m), o;
646
+ setup(c, { emit: v }) {
647
+ const n = c, u = v, g = q(!1), a = q(7), k = ns(), C = Ae(), { t: $ } = be();
648
+ function m(o, i, d) {
649
+ return i != null && o < i && (o = i), d != null && o > d && (o = d), o;
650
650
  }
651
651
  function e(o) {
652
652
  if (!((o == null ? void 0 : o.amount) == null || (o == null ? void 0 : o.precision) == null))
653
653
  return o.amount / Math.pow(10, o.precision);
654
654
  }
655
- function i({
655
+ function r({
656
656
  sku: o,
657
- code: r,
658
- name: m,
657
+ code: i,
658
+ name: d,
659
659
  baseAmount: _,
660
- measurement: S,
661
- min: c,
662
- max: y
660
+ measurement: w,
661
+ min: f,
662
+ max: b
663
663
  }) {
664
- if (S) {
665
- const I = S.conversion.amount;
664
+ if (w) {
665
+ const I = w.conversion.amount;
666
666
  let z = Math.ceil(_ / I);
667
- return z = p(z, c, y), {
667
+ return z = m(z, f, b), {
668
668
  sku: o,
669
- code: r,
670
- name: m,
669
+ code: i,
670
+ name: d,
671
671
  quantity: { amount: z, precision: 0 },
672
- measurement: S
672
+ measurement: w
673
673
  };
674
674
  } else {
675
- const I = Math.ceil(p(_, c, y));
675
+ const I = Math.ceil(m(_, f, b));
676
676
  return {
677
677
  sku: o,
678
- code: r,
679
- name: m,
678
+ code: i,
679
+ name: d,
680
680
  quantity: { amount: I, precision: 0 },
681
681
  measurement: null
682
682
  };
683
683
  }
684
684
  }
685
- async function b() {
685
+ async function y() {
686
686
  if (a.value < 1) return;
687
687
  g.value = !1, await k.readPurchaseOrder(a.value, n.templateId);
688
688
  const o = k.purchaseOrderForecast.skus;
@@ -693,47 +693,47 @@ const Js = {
693
693
  });
694
694
  return;
695
695
  }
696
- const r = n.templateItems.reduce((_, S) => {
696
+ const i = n.templateItems.reduce((_, w) => {
697
697
  var z;
698
- const c = (z = n.poItems) == null ? void 0 : z.find((B) => B.sku._id === S.sku._id), y = o.find((B) => B.id === S.sku._id);
699
- if (!y)
700
- return c && _.push(c), _;
701
- if (!n.templateId && y.amount <= 0) return _;
702
- const I = y.amount ?? e(c == null ? void 0 : c.quantity) ?? 0;
698
+ const f = (z = n.poItems) == null ? void 0 : z.find((B) => B.sku._id === w.sku._id), b = o.find((B) => B.id === w.sku._id);
699
+ if (!b)
700
+ return f && _.push(f), _;
701
+ if (!n.templateId && b.amount <= 0) return _;
702
+ const I = b.amount ?? e(f == null ? void 0 : f.quantity) ?? 0;
703
703
  return _.push(
704
- i({
705
- sku: S.sku,
706
- code: S.code,
707
- name: S.name,
704
+ r({
705
+ sku: w.sku,
706
+ code: w.code,
707
+ name: w.name,
708
708
  baseAmount: I,
709
- measurement: S.measurement || null,
710
- min: e(S.minimumQuantity),
711
- max: e(S.maximumQuantity)
709
+ measurement: w.measurement || null,
710
+ min: e(w.minimumQuantity),
711
+ max: e(w.maximumQuantity)
712
712
  })
713
713
  ), _;
714
- }, []), m = o.map((_) => {
715
- const S = n.templateItems.find((X) => X.sku._id === _.id);
716
- let c = _.amount, y = 0;
717
- if (S != null && S.measurement) {
718
- const X = e(S.measurement.conversion) ?? 1;
719
- c = Math.ceil(_.amount / X);
714
+ }, []), d = o.map((_) => {
715
+ const w = n.templateItems.find((X) => X.sku._id === _.id);
716
+ let f = _.amount, b = 0;
717
+ if (w != null && w.measurement) {
718
+ const X = e(w.measurement.conversion) ?? 1;
719
+ f = Math.ceil(_.amount / X);
720
720
  } else
721
- c = Math.ceil(_.amount);
722
- const I = e(S == null ? void 0 : S.minimumQuantity) ?? 0, z = e(S == null ? void 0 : S.maximumQuantity) ?? 1 / 0, B = c < I || c > z ? "error" : "success";
723
- return { skuId: _.id, amount: c, precision: y, helperState: B };
721
+ f = Math.ceil(_.amount);
722
+ const I = e(w == null ? void 0 : w.minimumQuantity) ?? 0, z = e(w == null ? void 0 : w.maximumQuantity) ?? 1 / 0, B = f < I || f > z ? "error" : "success";
723
+ return { skuId: _.id, amount: f, precision: b, helperState: B };
724
724
  });
725
- u("update:poItems", r), u("update:forecastAmounts", m);
725
+ u("update:poItems", i), u("update:forecastAmounts", d);
726
726
  }
727
- return (o, r) => {
728
- const m = V("FmButton"), _ = V("FmIcon"), S = V("FmStepperField"), c = V("FmPopover");
729
- return x(), se(c, {
727
+ return (o, i) => {
728
+ const d = V("FmButton"), _ = V("FmIcon"), w = V("FmStepperField"), f = V("FmPopover");
729
+ return x(), se(f, {
730
730
  disabled: o.disabled,
731
731
  class: "flex",
732
732
  "show-popover": g.value,
733
- onPopoverChanged: r[3] || (r[3] = (y) => g.value = y)
733
+ onPopoverChanged: i[3] || (i[3] = (b) => g.value = b)
734
734
  }, {
735
- "popover-button": O(() => [
736
- f(m, {
735
+ "popover-button": A(() => [
736
+ p(d, {
737
737
  label: "unused",
738
738
  variant: "secondary",
739
739
  "text-color": o.disabled ? "disabled" : "primary",
@@ -741,9 +741,9 @@ const Js = {
741
741
  "border-color": o.disabled ? "disabled" : "primary",
742
742
  disabled: o.disabled
743
743
  }, {
744
- default: O(() => [
744
+ default: A(() => [
745
745
  l("div", no, [
746
- f(ao, {
746
+ p(ao, {
747
747
  size: 24,
748
748
  color: o.disabled ? "#c7c7cc" : "#ff7823"
749
749
  }, null, 8, ["color"]),
@@ -753,33 +753,33 @@ const Js = {
753
753
  _: 1
754
754
  }, 8, ["text-color", "border-color", "disabled"])
755
755
  ]),
756
- default: O(() => [
756
+ default: A(() => [
757
757
  l("div", ro, [
758
758
  l("div", io, [
759
759
  l("div", uo, [
760
- f(Ss, { "z-index": 99 }, {
761
- default: O(() => [
760
+ p(Ss, { "z-index": 99 }, {
761
+ default: A(() => [
762
762
  l("p", co, E(t($)("inventory.transfer.form.items.forecastStock.title")), 1)
763
763
  ]),
764
764
  _: 1
765
765
  })
766
766
  ]),
767
- f(m, {
767
+ p(d, {
768
768
  icon: "close",
769
769
  size: "md",
770
770
  variant: "tertiary",
771
- onClick: r[0] || (r[0] = (y) => g.value = !1)
771
+ onClick: i[0] || (i[0] = (b) => g.value = !1)
772
772
  })
773
773
  ]),
774
- f(S, {
774
+ p(w, {
775
775
  modelValue: a.value,
776
- "onUpdate:modelValue": r[1] || (r[1] = (y) => a.value = y),
776
+ "onUpdate:modelValue": i[1] || (i[1] = (b) => a.value = b),
777
777
  label: t($)("inventory.transfer.form.items.forecastStock.days"),
778
778
  rules: [t(Le)(1)]
779
779
  }, {
780
- "helper-text": O(() => [
780
+ "helper-text": A(() => [
781
781
  l("div", mo, [
782
- f(_, {
782
+ p(_, {
783
783
  name: "warning",
784
784
  size: "sm",
785
785
  class: "text-fm-color-system-warning-300"
@@ -790,15 +790,15 @@ const Js = {
790
790
  _: 1
791
791
  }, 8, ["modelValue", "label", "rules"]),
792
792
  l("div", fo, [
793
- r[4] || (r[4] = l("div", { class: "grow" }, null, -1)),
794
- f(m, {
793
+ i[4] || (i[4] = l("div", { class: "grow" }, null, -1)),
794
+ p(d, {
795
795
  label: t($)("common.cancel"),
796
796
  variant: "tertiary",
797
- onClick: r[2] || (r[2] = (y) => g.value = !1)
797
+ onClick: i[2] || (i[2] = (b) => g.value = !1)
798
798
  }, null, 8, ["label"]),
799
- f(m, {
799
+ p(d, {
800
800
  label: t($)("inventory.transfer.form.items.forecastStock.generate"),
801
- onClick: b
801
+ onClick: y
802
802
  }, null, 8, ["label"])
803
803
  ])
804
804
  ])
@@ -809,8 +809,8 @@ const Js = {
809
809
  }
810
810
  });
811
811
  function yo() {
812
- const d = Oe(), v = ft(), n = M(!1);
813
- fe(n, (k) => {
812
+ const c = Ae(), v = ft(), n = q(!1);
813
+ pe(n, (k) => {
814
814
  k && (g.value = !0, u().finally(() => {
815
815
  g.value = !1;
816
816
  }));
@@ -818,35 +818,35 @@ function yo() {
818
818
  async function u() {
819
819
  try {
820
820
  const { startDate: k, endDate: C } = Cs(6), e = (await v.getPurchaseOrders({ start: k, end: C })).filter(
821
- (i) => {
822
- var b, o;
823
- return i.status === Qt.enum.COMPLETE && ((b = i.supplier) == null ? void 0 : b.internal) !== "warehouse" && ((o = i.supplier) == null ? void 0 : o.internal) !== "restaurant";
821
+ (r) => {
822
+ var y, o;
823
+ return r.status === Qt.enum.COMPLETE && ((y = r.supplier) == null ? void 0 : y.internal) !== "warehouse" && ((o = r.supplier) == null ? void 0 : o.internal) !== "restaurant";
824
824
  }
825
- ).reduce((i, b) => {
826
- const o = new Date(Yt(b._id)), r = b.supplier._id;
827
- for (const m of b.items) {
828
- if (!m.totalCost) continue;
829
- const _ = i[m.sku._id] ?? {}, S = _[r] ?? [];
830
- S.push({
825
+ ).reduce((r, y) => {
826
+ const o = new Date(Yt(y._id)), i = y.supplier._id;
827
+ for (const d of y.items) {
828
+ if (!d.totalCost) continue;
829
+ const _ = r[d.sku._id] ?? {}, w = _[i] ?? [];
830
+ w.push({
831
831
  date: o.toISOString(),
832
- totalUnit: m.quantity,
833
- totalCost: m.totalCost,
834
- unit: m.sku.unit,
835
- measurement: m.measurement,
836
- seqNumber: b.seqNumber
837
- }), _[r] = S, i[m.sku._id] = _;
832
+ totalUnit: d.quantity,
833
+ totalCost: d.totalCost,
834
+ unit: d.sku.unit,
835
+ measurement: d.measurement,
836
+ seqNumber: y.seqNumber
837
+ }), _[i] = w, r[d.sku._id] = _;
838
838
  }
839
- return i;
839
+ return r;
840
840
  }, {});
841
841
  a.value = e;
842
842
  } catch {
843
- d.open({
843
+ c.open({
844
844
  title: "Something went wrong",
845
845
  message: "Cannot retrieve supplier purchase history. Please try again."
846
846
  }), n.value = !1;
847
847
  }
848
848
  }
849
- const g = M(!1), a = M({});
849
+ const g = q(!1), a = q({});
850
850
  return {
851
851
  comparePricesToggle: n,
852
852
  comparePriceFetching: g,
@@ -863,7 +863,7 @@ const bo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, go = { key: 0 }
863
863
  disabled: { type: Boolean }
864
864
  },
865
865
  emits: ["update:item"],
866
- setup(d) {
866
+ setup(c) {
867
867
  function v(n) {
868
868
  return n.column.columnDef.meta;
869
869
  }
@@ -876,18 +876,18 @@ const bo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, go = { key: 0 }
876
876
  }])
877
877
  }, [
878
878
  (x(!0), T(le, null, he(n.row.getVisibleCells(), (k) => {
879
- var C, $, p, e;
879
+ var C, $, m, e;
880
880
  return x(), T("td", {
881
881
  key: k.id,
882
882
  class: K(["h-[56px] text-fm-color-typo-primary", ((C = v(k)) == null ? void 0 : C.cellClass) ?? "px-16"]),
883
883
  style: Vt({
884
884
  width: ($ = v(k)) == null ? void 0 : $.width,
885
- maxWidth: (p = v(k)) == null ? void 0 : p.maxWidth,
885
+ maxWidth: (m = v(k)) == null ? void 0 : m.maxWidth,
886
886
  textAlign: ((e = v(k)) == null ? void 0 : e.textAlign) ?? "left"
887
887
  })
888
888
  }, [
889
889
  l("span", bo, [
890
- f(t(pe), {
890
+ p(t(fe), {
891
891
  render: k.column.columnDef.cell,
892
892
  props: k.getContext()
893
893
  }, null, 8, ["render", "props"])
@@ -899,7 +899,7 @@ const bo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, go = { key: 0 }
899
899
  l("td", {
900
900
  colspan: n.row.getVisibleCells().length
901
901
  }, [
902
- f(qt, {
902
+ p(Mt, {
903
903
  prices: n.comparePriceBySku[(a = n.row.original.sku) == null ? void 0 : a._id]
904
904
  }, null, 8, ["prices"])
905
905
  ], 8, _o)
@@ -918,98 +918,109 @@ const bo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, go = { key: 0 }
918
918
  props: {
919
919
  required: { type: Boolean },
920
920
  disabled: { type: Boolean },
921
+ subsidiaryOptional: { type: Boolean },
921
922
  supplier: {},
922
923
  setting: {},
923
924
  items: {},
924
925
  onChange: { type: Function }
925
926
  },
926
927
  emits: ["netsuite:ready"],
927
- setup(d, { emit: v }) {
928
- const n = He(), u = d, g = v, { t: a } = Fs(), k = M(!1), C = M();
929
- st(() => {
930
- var i, b, o, r;
931
- let e = {
928
+ setup(c, { emit: v }) {
929
+ const n = He(), u = c, g = v, { t: a } = Fs(), k = q(!1), C = q();
930
+ function $() {
931
+ var o, i, d, _;
932
+ if (!u.supplier) return;
933
+ u.supplier.internal ? C.value = n.getNetSuiteLocation(
934
+ `${u.supplier.internal}_${u.supplier._id}`
935
+ ) : C.value = n.getNetSuiteVendor(u.supplier._id);
936
+ const r = u.supplier.internal ? n.getLocationSubsidiary((o = C.value) == null ? void 0 : o.netSuiteId).id : (i = C.value) == null ? void 0 : i.subsidiaryId, y = u.supplier.internal ? (d = n.currentLocationSubsidiary()) == null ? void 0 : d.id : (_ = n.currentVendorSubsidiary(u.supplier._id)) == null ? void 0 : _.id;
937
+ k.value = !(!n.isEnabled || r && n.isEnabled && r == y);
938
+ }
939
+ pe(
940
+ () => u.supplier,
941
+ () => {
942
+ u.subsidiaryOptional && $();
943
+ },
944
+ { deep: !0 }
945
+ ), st(() => {
946
+ let r = {
932
947
  id: "",
933
948
  subsidiary: { id: "", name: "" },
934
949
  errors: []
935
950
  };
936
951
  if (!n.isEnabled || !u.required) {
937
- g("netsuite:ready", e);
952
+ g("netsuite:ready", r);
938
953
  return;
939
954
  }
940
955
  try {
941
- const m = n.currentLocationSubsidiary();
942
- u.setting ? e = {
956
+ const y = n.currentLocationSubsidiary();
957
+ u.setting ? r = {
943
958
  ...u.setting,
944
959
  subsidiary: {
945
- id: m.id || "",
946
- name: m.name
960
+ id: y.id || "",
961
+ name: y.name
947
962
  }
948
- } : e = {
949
- ...e,
963
+ } : r = {
964
+ ...r,
950
965
  subsidiary: {
951
- id: m.id || "",
952
- name: m.name
966
+ id: y.id || "",
967
+ name: y.name
953
968
  }
954
969
  };
955
- const _ = n.getAvailableItems(m.id), S = u.items.filter((c) => {
956
- if (c.measurement != null) {
957
- const y = n.getAvailableMeasurements(
958
- c.sku._id,
959
- m.id
970
+ const o = n.getAvailableItems(y.id), i = u.items.filter((d) => {
971
+ if (d.measurement != null) {
972
+ const _ = n.getAvailableMeasurements(
973
+ d.sku._id,
974
+ y.id
960
975
  );
961
- return _.includes(c.sku._id) && y.includes(c.measurement.id);
976
+ return o.includes(d.sku._id) && _.includes(d.measurement.id);
962
977
  }
963
- return _.includes(c.sku._id);
964
- }).map((c) => c.sku._id);
978
+ return o.includes(d.sku._id);
979
+ }).map((d) => d.sku._id);
965
980
  u.onChange(
966
- u.items.filter((c) => S.includes(c.sku._id)),
967
- e
981
+ u.items.filter((d) => i.includes(d.sku._id)),
982
+ r
968
983
  );
969
984
  } finally {
970
- u.supplier.internal ? C.value = n.getNetSuiteLocation(
971
- `${u.supplier.internal}_${u.supplier._id}`
972
- ) : C.value = n.getNetSuiteVendor(u.supplier._id);
973
- const m = u.supplier.internal ? n.getLocationSubsidiary((i = C.value) == null ? void 0 : i.netSuiteId).id : (b = C.value) == null ? void 0 : b.subsidiaryId, _ = u.supplier.internal ? (o = n.currentLocationSubsidiary()) == null ? void 0 : o.id : (r = n.currentVendorSubsidiary(u.supplier._id)) == null ? void 0 : r.id;
974
- !n.isEnabled || m && n.isEnabled && m == _ ? g("netsuite:ready", e) : k.value = !0;
985
+ $(), k.value ? u.subsidiaryOptional && g("netsuite:ready", r) : g("netsuite:ready", r);
975
986
  }
976
987
  });
977
- const $ = N(
988
+ const m = N(
978
989
  () => u.supplier.internal ? n.currentLocationSubsidiary() : n.currentVendorSubsidiary(u.supplier._id)
979
- ), p = N(() => {
980
- var e, i;
990
+ ), e = N(() => {
991
+ var r, y;
981
992
  return C.value == null ? `Cannot find the NetSuite location for "${u.supplier.name}"` : `The subsidiary of the request
982
- location is ${(i = n.getLocationSubsidiary((e = C.value) == null ? void 0 : e.netSuiteId)) == null ? void 0 : i.fullName}`;
993
+ location is ${(y = n.getLocationSubsidiary((r = C.value) == null ? void 0 : r.netSuiteId)) == null ? void 0 : y.fullName}`;
983
994
  });
984
- return (e, i) => {
985
- const b = V("FmLabel"), o = V("FmIcon"), r = V("FmField"), m = V("FmTooltip");
995
+ return (r, y) => {
996
+ const o = V("FmLabel"), i = V("FmIcon"), d = V("FmField"), _ = V("FmTooltip");
986
997
  return t(n).isEnabled && u.required ? (x(), T("div", ko, [
987
- f(b, {
998
+ p(o, {
988
999
  label: `NetSuite ${t(a)("inventory.transfer.form.netsuite.subsidiary")}`
989
1000
  }, null, 8, ["label"]),
990
1001
  l("div", xo, [
991
- f(m, {
1002
+ p(_, {
992
1003
  "z-index": 51,
993
1004
  placement: "left",
994
- disabled: e.disabled
1005
+ disabled: r.disabled
995
1006
  }, {
996
- content: O(() => i[0] || (i[0] = [
997
- Ae("This field is locked and based on the location of the request.")
1007
+ content: A(() => y[0] || (y[0] = [
1008
+ Oe("This field is locked and based on the location of the request.")
998
1009
  ])),
999
- default: O(() => [
1000
- f(r, null, {
1001
- default: O(() => {
1002
- var _;
1010
+ default: A(() => [
1011
+ p(d, null, {
1012
+ default: A(() => {
1013
+ var w;
1003
1014
  return [
1004
1015
  l("div", Co, [
1005
- f(o, {
1016
+ p(i, {
1006
1017
  name: "lock_outline",
1007
1018
  size: "sm",
1008
- color: e.disabled ? "neutral-gray-200" : "neutral-gray-400"
1019
+ color: r.disabled ? "neutral-gray-200" : "neutral-gray-400"
1009
1020
  }, null, 8, ["color"]),
1010
1021
  l("div", {
1011
- class: K([e.disabled ? "text-fm-color-typo-disabled" : ""])
1012
- }, E((_ = $.value) == null ? void 0 : _.fullName), 3)
1022
+ class: K([r.disabled ? "text-fm-color-typo-disabled" : ""])
1023
+ }, E((w = m.value) == null ? void 0 : w.fullName), 3)
1013
1024
  ])
1014
1025
  ];
1015
1026
  }),
@@ -1018,14 +1029,14 @@ const bo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, go = { key: 0 }
1018
1029
  ]),
1019
1030
  _: 1
1020
1031
  }, 8, ["disabled"]),
1021
- k.value ? (x(), T("div", wo, E(p.value), 1)) : Q("", !0)
1032
+ k.value ? (x(), T("div", wo, E(e.value), 1)) : Q("", !0)
1022
1033
  ])
1023
1034
  ])) : Q("", !0);
1024
1035
  };
1025
1036
  }
1026
1037
  });
1027
- function Re(d) {
1028
- const v = Mt(d);
1038
+ function Re(c) {
1039
+ const v = qt(c);
1029
1040
  if (Array.isArray(v))
1030
1041
  return v.map(Re);
1031
1042
  if (v !== null && typeof v == "object") {
@@ -1036,17 +1047,17 @@ function Re(d) {
1036
1047
  }
1037
1048
  return v;
1038
1049
  }
1039
- function Ft(d) {
1050
+ function Ft(c) {
1040
1051
  return {
1041
- dbName: d.dbName,
1042
- type: d.type,
1043
- name: d.name,
1044
- acceptRequest: d.acceptRequest ?? !1,
1045
- doc: d.doc
1052
+ dbName: c.dbName,
1053
+ type: c.type,
1054
+ name: c.name,
1055
+ acceptRequest: c.acceptRequest ?? !1,
1056
+ doc: c.doc
1046
1057
  };
1047
1058
  }
1048
- function It(d, v, n) {
1049
- const u = Re(d.suppliers ?? []), g = Re(v.allLocations ?? []).map(Ft), a = v._currentLocation ? Ft(Re(v._currentLocation)) : null, k = n.inventory ? [Re(n.inventory)] : [];
1059
+ function It(c, v, n) {
1060
+ const u = Re(c.suppliers ?? []), g = Re(v.allLocations ?? []).map(Ft), a = v._currentLocation ? Ft(Re(v._currentLocation)) : null, k = n.inventory ? [Re(n.inventory)] : [];
1050
1061
  return {
1051
1062
  suppliers: u,
1052
1063
  locations: g,
@@ -1054,16 +1065,16 @@ function It(d, v, n) {
1054
1065
  inventoryDoc: k
1055
1066
  };
1056
1067
  }
1057
- function Fo(d) {
1058
- const v = mt(), n = ot(), u = at(), g = It(v, n, u), a = Nt(bs({ env: g })), k = M(a.value.state()), C = (e) => {
1059
- k.value = e, d != null && d.onStateChange && d.onStateChange(Io(a.value.toPurchaseOrder()));
1068
+ function Fo(c) {
1069
+ const v = mt(), n = ot(), u = at(), g = It(v, n, u), a = Nt(bs({ env: g })), k = q(a.value.state()), C = (e) => {
1070
+ k.value = e, c != null && c.onStateChange && c.onStateChange(Io(a.value.toPurchaseOrder()));
1060
1071
  };
1061
1072
  a.value.addListener(C);
1062
1073
  function $() {
1063
1074
  const e = It(v, n, u);
1064
1075
  a.value.updateFullEnv(e), k.value = a.value.state();
1065
1076
  }
1066
- fe(
1077
+ pe(
1067
1078
  [
1068
1079
  () => v.suppliers,
1069
1080
  () => n.allLocations,
@@ -1077,23 +1088,23 @@ function Fo(d) {
1077
1088
  ), Ut(() => {
1078
1089
  a.value.removeListener(C);
1079
1090
  });
1080
- function p(e) {
1081
- var i;
1082
- nt().mustUsePoTemplate || a.value.init(), e != null && e.template && ((i = e.templateDoc) != null && i.purchaseOrder) ? (e.items = e.templateDoc.purchaseOrder.items, a.value.initFromTemplate(e)) : a.value.initOutletToOutlet();
1091
+ function m(e) {
1092
+ var r;
1093
+ nt().mustUsePoTemplate || a.value.init(), e != null && e.template && ((r = e.templateDoc) != null && r.purchaseOrder) ? (e.items = e.templateDoc.purchaseOrder.items, a.value.initFromTemplate(e)) : a.value.initOutletToOutlet();
1083
1094
  }
1084
1095
  return {
1085
1096
  controller: a,
1086
1097
  state: k,
1087
- init: p
1098
+ init: m
1088
1099
  };
1089
1100
  }
1090
- function Io(d) {
1101
+ function Io(c) {
1091
1102
  const v = {};
1092
- for (const n in d)
1093
- d[n] !== null && d[n] !== void 0 && (v[n] = d[n]);
1103
+ for (const n in c)
1104
+ c[n] !== null && c[n] !== void 0 && (v[n] = c[n]);
1094
1105
  return v;
1095
1106
  }
1096
- const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, To = { class: "flex flex-col gap-16" }, Vo = { class: "flex flex-col gap-24" }, Po = { class: "flex flex-col gap-8" }, Ro = { class: "flex flex-col gap-4" }, Ao = { class: "flex items-center gap-4" }, Oo = { class: "flex flex-col gap-8" }, Eo = { class: "flex flex-col gap-4" }, qo = { class: "flex items-center gap-4" }, Mo = {
1107
+ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, To = { class: "flex flex-col gap-16" }, Vo = { class: "flex flex-col gap-24" }, Po = { class: "flex flex-col gap-8" }, Ro = { class: "flex flex-col gap-4" }, Oo = { class: "flex items-center gap-4" }, Ao = { class: "flex flex-col gap-8" }, Eo = { class: "flex flex-col gap-4" }, Mo = { class: "flex items-center gap-4" }, qo = {
1097
1108
  key: 3,
1098
1109
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
1099
1110
  }, No = {
@@ -1113,14 +1124,14 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1113
1124
  lastClosingDate: {}
1114
1125
  },
1115
1126
  emits: ["validation-success", "form:ready", "update:modelValue"],
1116
- setup(d, { expose: v, emit: n }) {
1117
- const u = d, g = n, { t: a } = be(), k = ot(), C = at(), $ = He(), p = nt(), e = Et(), { breakpoints: i } = ct(), b = N(() => i.value.xs || i.value.sm), o = Fo({
1127
+ setup(c, { expose: v, emit: n }) {
1128
+ const u = c, g = n, { t: a } = be(), k = ot(), C = at(), $ = He(), m = nt(), e = Et(), { breakpoints: r } = ct(), y = N(() => r.value.xs || r.value.sm), o = Fo({
1118
1129
  onStateChange: (s) => g("update:modelValue", s)
1119
1130
  });
1120
1131
  o.init(u.modelValue);
1121
- const { controller: r, state: m } = o, _ = Tt({
1132
+ const { controller: i, state: d } = o, _ = Tt({
1122
1133
  value: !1
1123
- }), S = M(!1), c = M(0), y = M([]), I = N(
1134
+ }), w = q(!1), f = q(0), b = q([]), I = N(
1124
1135
  () => {
1125
1136
  var s;
1126
1137
  return ((s = u.modelValue) == null ? void 0 : s.templateDoc) ?? e.templates.find((h) => {
@@ -1128,88 +1139,88 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1128
1139
  return h._id === ((G = u.modelValue) == null ? void 0 : G.template);
1129
1140
  });
1130
1141
  }
1131
- ), z = N(() => m.value.status === "DRAFT" || !m.value.rev), B = N(
1142
+ ), z = N(() => d.value.status === "DRAFT" || !d.value.rev), B = N(
1132
1143
  () => {
1133
1144
  var s;
1134
- return ((s = m.value.items) == null ? void 0 : s.map((h) => h.item)) || [];
1145
+ return ((s = d.value.items) == null ? void 0 : s.map((h) => h.item)) || [];
1135
1146
  }
1136
1147
  );
1137
1148
  st(() => {
1138
- S.value = !0;
1139
- }), fe([S, _], ([s, h], [G, De]) => {
1149
+ w.value = !0;
1150
+ }), pe([w, _], ([s, h], [G, De]) => {
1140
1151
  h.value && De.value && g("form:ready");
1141
1152
  });
1142
1153
  const X = N(
1143
1154
  () => k.currentLocation.type === Kt.restaurant
1144
1155
  ), oe = ms(), U = _s(
1145
- () => m.value,
1156
+ () => d.value,
1146
1157
  (s) => {
1147
- r.value.setSupplier(s.supplier);
1158
+ i.value.setSupplier(s.supplier);
1148
1159
  },
1149
1160
  !0,
1150
1161
  !0
1151
1162
  ), P = N({
1152
1163
  get() {
1153
1164
  var s;
1154
- return typeof ((s = m.value.supplier) == null ? void 0 : s.internal) == "string" ? me.enum.transfer : me.enum.purchase;
1165
+ return typeof ((s = d.value.supplier) == null ? void 0 : s.internal) == "string" ? me.enum.transfer : me.enum.purchase;
1155
1166
  },
1156
1167
  set(s) {
1157
- r.value.selectType(s);
1168
+ i.value.selectType(s);
1158
1169
  }
1159
1170
  }), R = N(() => {
1160
1171
  let s = U.transferLocationOptions.value;
1161
- return p.mustUsePoTemplate && !m.value.template && (s = s.filter((h) => {
1172
+ return m.mustUsePoTemplate && !d.value.template && (s = s.filter((h) => {
1162
1173
  var G;
1163
1174
  return (G = h.sublabel) == null ? void 0 : G.startsWith("restaurant");
1164
1175
  })), s;
1165
1176
  }), D = N({
1166
1177
  get() {
1167
1178
  var s;
1168
- return (s = m.value.supplier) == null ? void 0 : s._id;
1179
+ return (s = d.value.supplier) == null ? void 0 : s._id;
1169
1180
  },
1170
1181
  set(s) {
1171
1182
  U.transferLocationModel.value = s;
1172
1183
  }
1173
- }), q = M(m.value.remark ?? ""), L = M(m.value.ref ?? ""), Z = St((s) => {
1174
- r.value.addRemark(s);
1175
- }, 300), w = St((s) => {
1176
- r.value.addReference(s);
1184
+ }), M = q(d.value.remark ?? ""), L = q(d.value.ref ?? ""), Z = St((s) => {
1185
+ i.value.addRemark(s);
1186
+ }, 300), S = St((s) => {
1187
+ i.value.addReference(s);
1177
1188
  }, 300), F = N({
1178
1189
  get() {
1179
- return q.value;
1190
+ return M.value;
1180
1191
  },
1181
1192
  set(s) {
1182
- q.value = s ?? "", Z(s ?? "");
1193
+ M.value = s ?? "", Z(s ?? "");
1183
1194
  }
1184
1195
  }), Y = N({
1185
1196
  get() {
1186
1197
  return L.value;
1187
1198
  },
1188
1199
  set(s) {
1189
- L.value = s ?? "", w(s ?? "");
1200
+ L.value = s ?? "", S(s ?? "");
1190
1201
  }
1191
1202
  });
1192
- fe(
1193
- () => m.value.remark,
1203
+ pe(
1204
+ () => d.value.remark,
1194
1205
  (s) => {
1195
- s !== q.value && (q.value = s ?? "");
1206
+ s !== M.value && (M.value = s ?? "");
1196
1207
  }
1197
- ), fe(
1198
- () => m.value.ref,
1208
+ ), pe(
1209
+ () => d.value.ref,
1199
1210
  (s) => {
1200
1211
  s !== L.value && (L.value = s ?? "");
1201
1212
  }
1202
1213
  );
1203
1214
  const { backdatePo: J, backdateSwitch: re, backdateModel: W, backdateTimeModel: Fe } = Gs({
1204
1215
  getEffectiveAt() {
1205
- return m.value.effectiveAt;
1216
+ return d.value.effectiveAt;
1206
1217
  },
1207
1218
  setEffectiveAt(s) {
1208
- r.value.setEffectiveAt(s);
1219
+ i.value.setEffectiveAt(s);
1209
1220
  }
1210
- }), { comparePricesToggle: ge, comparePriceFetching: ke, comparePriceBySku: Ee } = yo(), xe = M();
1221
+ }), { comparePricesToggle: ge, comparePriceFetching: ke, comparePriceBySku: Ee } = yo(), xe = q();
1211
1222
  function je() {
1212
- Z.flush(), w.flush();
1223
+ Z.flush(), S.flush();
1213
1224
  }
1214
1225
  v({
1215
1226
  validateInputs: () => {
@@ -1227,17 +1238,17 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1227
1238
  });
1228
1239
  const Ie = N(() => ({
1229
1240
  updateItem: (s) => {
1230
- const h = Xt.parse(s), G = r.value.toFdtoPOItem(h);
1231
- r.value.updateSkuInfo(G);
1241
+ const h = Xt.parse(s), G = i.value.toFdtoPOItem(h);
1242
+ i.value.updateSkuInfo(G);
1232
1243
  },
1233
1244
  deleteItem: (s) => {
1234
- r.value.removeSku(s.sku);
1245
+ i.value.removeSku(s.sku);
1235
1246
  }
1236
- })), $e = As({
1247
+ })), $e = Os({
1237
1248
  updateItem: (s) => Ie.value.updateItem(s),
1238
1249
  deleteItem: (s) => Ie.value.deleteItem(s),
1239
1250
  get supplier() {
1240
- return m.value.supplier;
1251
+ return d.value.supplier;
1241
1252
  },
1242
1253
  get items() {
1243
1254
  return B.value;
@@ -1252,12 +1263,12 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1252
1263
  return u.disabled;
1253
1264
  },
1254
1265
  get forecastAmounts() {
1255
- return y.value;
1266
+ return b.value;
1256
1267
  }
1257
1268
  }), Qe = N(() => $e.columnDefs.value);
1258
1269
  function Ye() {
1259
- var Me, We, Ge, Ne, Je;
1260
- const s = (Ge = (We = (Me = I.value) == null ? void 0 : Me.purchaseOrder) == null ? void 0 : We.items) == null ? void 0 : Ge.groupBy((H) => H.sku._id), h = $.isEnabled ? $.getAvailableItems((Je = (Ne = m.value.netSuite) == null ? void 0 : Ne.subsidiary) == null ? void 0 : Je.id) : [], G = s != null && s.size ? C.skus.filter((H) => s.has(H._id)) : C.skus, De = $.isEnabled ? G.filter((H) => {
1270
+ var qe, We, Ge, Ne, Je;
1271
+ const s = (Ge = (We = (qe = I.value) == null ? void 0 : qe.purchaseOrder) == null ? void 0 : We.items) == null ? void 0 : Ge.groupBy((H) => H.sku._id), h = $.isEnabled ? $.getAvailableItems((Je = (Ne = d.value.netSuite) == null ? void 0 : Ne.subsidiary) == null ? void 0 : Je.id) : [], G = s != null && s.size ? C.skus.filter((H) => s.has(H._id)) : C.skus, De = $.isEnabled ? G.filter((H) => {
1261
1272
  var ie, ae, ue, ce;
1262
1273
  const ee = (ae = (ie = I.value) == null ? void 0 : ie.purchaseOrder) == null ? void 0 : ae.items.find(
1263
1274
  (ve) => ve.sku._id === H._id
@@ -1265,7 +1276,7 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1265
1276
  if (ee != null && ee.measurement != null) {
1266
1277
  const ve = $.getAvailableMeasurements(
1267
1278
  ee.sku._id,
1268
- (ce = (ue = m.value.netSuite) == null ? void 0 : ue.subsidiary) == null ? void 0 : ce.id
1279
+ (ce = (ue = d.value.netSuite) == null ? void 0 : ue.subsidiary) == null ? void 0 : ce.id
1269
1280
  );
1270
1281
  return h.includes(ee.sku._id) && ve.includes(ee.measurement.id);
1271
1282
  }
@@ -1334,14 +1345,14 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1334
1345
  ce.quantity,
1335
1346
  ce.measurement,
1336
1347
  {
1337
- supplier: m.value.supplier
1348
+ supplier: d.value.supplier
1338
1349
  }
1339
1350
  );
1340
1351
  ce.totalCost = _e;
1341
1352
  }
1342
1353
  return ce;
1343
1354
  });
1344
- ie.sort((ae, ue) => ae.sku.code.localeCompare(ue.sku.code)), r.value.updateItems(ie);
1355
+ ie.sort((ae, ue) => ae.sku.code.localeCompare(ue.sku.code)), i.value.updateItems(ie);
1345
1356
  });
1346
1357
  }
1347
1358
  function lt(s) {
@@ -1365,20 +1376,20 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1365
1376
  }));
1366
1377
  }), Ce = N(() => {
1367
1378
  const s = [];
1368
- return (!p.mustUsePoTemplate || p.mustUsePoTemplate && m.value.template) && s.push({
1379
+ return (!m.mustUsePoTemplate || m.mustUsePoTemplate && d.value.template) && s.push({
1369
1380
  label: a("inventory.transfer.form.type.purchase"),
1370
1381
  value: me.enum.purchase
1371
1382
  }), s.push({
1372
1383
  label: a("inventory.transfer.form.type.transfer"),
1373
1384
  value: me.enum.transfer
1374
1385
  }), s;
1375
- }), qe = N(() => {
1386
+ }), Me = N(() => {
1376
1387
  var s;
1377
1388
  return (s = u.modelValue) == null ? void 0 : s.items.every((h) => h.quantity.amount <= 0);
1378
1389
  });
1379
1390
  return (s, h) => {
1380
1391
  var ce, ve;
1381
- const G = V("FmChip"), De = V("FmLabel"), Te = V("FmIcon"), Xe = V("FmField"), Ze = V("FmTooltip"), Me = V("FmSelect"), We = V("FmTextField"), Ge = V("FmTextarea"), Ne = V("FmSwitch"), Je = V("FmDatePicker"), H = V("FmTimePicker"), ee = V("FmFormGroup"), ie = V("FmButton"), ae = V("FmTable"), ue = V("FmForm");
1392
+ const G = V("FmChip"), De = V("FmLabel"), Te = V("FmIcon"), Xe = V("FmField"), Ze = V("FmTooltip"), qe = V("FmSelect"), We = V("FmTextField"), Ge = V("FmTextarea"), Ne = V("FmSwitch"), Je = V("FmDatePicker"), H = V("FmTimePicker"), ee = V("FmFormGroup"), ie = V("FmButton"), ae = V("FmTable"), ue = V("FmForm");
1382
1393
  return x(), T("div", $o, [
1383
1394
  l("div", Do, [
1384
1395
  (ce = u.modelValue) != null && ce.template ? (x(), se(G, {
@@ -1388,7 +1399,7 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1388
1399
  icon: "summarize",
1389
1400
  compact: ""
1390
1401
  }, null, 8, ["variant", "label"])) : Q("", !0),
1391
- f(G, {
1402
+ p(G, {
1392
1403
  label: t(k).currentLocation.name,
1393
1404
  icon: "storefront",
1394
1405
  compact: ""
@@ -1400,7 +1411,7 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1400
1411
  compact: ""
1401
1412
  }, null, 8, ["label"])) : Q("", !0)
1402
1413
  ]),
1403
- f(ue, {
1414
+ p(ue, {
1404
1415
  ref_key: "formRef",
1405
1416
  ref: xe,
1406
1417
  class: "flex flex-col gap-32",
@@ -1408,30 +1419,30 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1408
1419
  onValidationFailed: console.log,
1409
1420
  onValidationSuccess: h[14] || (h[14] = (Ve) => g("validation-success"))
1410
1421
  }, {
1411
- default: O(() => {
1422
+ default: A(() => {
1412
1423
  var Ve, _e, vt, yt, bt, gt, _t, ht;
1413
1424
  return [
1414
1425
  l("div", To, [
1415
1426
  l("div", Vo, [
1416
1427
  (Ve = u.modelValue) != null && Ve.template ? (x(), T(le, { key: 0 }, [
1417
1428
  l("div", Po, [
1418
- f(De, {
1429
+ p(De, {
1419
1430
  label: t(a)("inventory.transfer.form.type.title")
1420
1431
  }, null, 8, ["label"]),
1421
1432
  l("div", Ro, [
1422
- f(Ze, {
1433
+ p(Ze, {
1423
1434
  "z-index": 51,
1424
1435
  placement: "left",
1425
1436
  disabled: s.disabled
1426
1437
  }, {
1427
- content: O(() => h[15] || (h[15] = [
1428
- Ae("This field is locked from template.")
1438
+ content: A(() => h[15] || (h[15] = [
1439
+ Oe("This field is locked from template.")
1429
1440
  ])),
1430
- default: O(() => [
1431
- f(Xe, null, {
1432
- default: O(() => [
1433
- l("div", Ao, [
1434
- f(Te, {
1441
+ default: A(() => [
1442
+ p(Xe, null, {
1443
+ default: A(() => [
1444
+ l("div", Oo, [
1445
+ p(Te, {
1435
1446
  name: "lock_outline",
1436
1447
  size: "sm",
1437
1448
  color: s.disabled ? "neutral-gray-200" : "neutral-gray-400"
@@ -1454,33 +1465,33 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1454
1465
  }, null, 2)
1455
1466
  ])
1456
1467
  ]),
1457
- l("div", Oo, [
1458
- f(De, {
1468
+ l("div", Ao, [
1469
+ p(De, {
1459
1470
  label: P.value === t(me).enum.purchase ? t(a)("inventory.transfer.form.purchaseFrom") : t(a)("inventory.transfer.form.transferFrom")
1460
1471
  }, null, 8, ["label"]),
1461
1472
  l("div", Eo, [
1462
- f(Ze, {
1473
+ p(Ze, {
1463
1474
  "z-index": 51,
1464
1475
  placement: "left",
1465
1476
  disabled: s.disabled
1466
1477
  }, {
1467
- content: O(() => h[16] || (h[16] = [
1468
- Ae("This field is locked from template.")
1478
+ content: A(() => h[16] || (h[16] = [
1479
+ Oe("This field is locked from template.")
1469
1480
  ])),
1470
- default: O(() => [
1471
- f(Xe, null, {
1472
- default: O(() => {
1473
- var A;
1481
+ default: A(() => [
1482
+ p(Xe, null, {
1483
+ default: A(() => {
1484
+ var O;
1474
1485
  return [
1475
- l("div", qo, [
1476
- f(Te, {
1486
+ l("div", Mo, [
1487
+ p(Te, {
1477
1488
  name: "lock_outline",
1478
1489
  size: "sm",
1479
1490
  color: s.disabled ? "neutral-gray-200" : "neutral-gray-400"
1480
1491
  }, null, 8, ["color"]),
1481
1492
  l("div", {
1482
1493
  class: K({ "text-fm-color-typo-disabled": s.disabled })
1483
- }, E((A = R.value.find((ne) => ne.value === D.value)) == null ? void 0 : A.label), 3)
1494
+ }, E((O = R.value.find((ne) => ne.value === D.value)) == null ? void 0 : O.label), 3)
1484
1495
  ])
1485
1496
  ];
1486
1497
  }),
@@ -1492,15 +1503,15 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1492
1503
  ])
1493
1504
  ])
1494
1505
  ], 64)) : (x(), T(le, { key: 1 }, [
1495
- f(Me, {
1506
+ p(qe, {
1496
1507
  label: t(a)("inventory.transfer.form.type.title"),
1497
1508
  "label-mark": "required",
1498
1509
  modelValue: P.value,
1499
- "onUpdate:modelValue": h[0] || (h[0] = (A) => P.value = A),
1510
+ "onUpdate:modelValue": h[0] || (h[0] = (O) => P.value = O),
1500
1511
  items: Ce.value,
1501
1512
  rules: [t(Le)(1)(Ce.value)]
1502
1513
  }, {
1503
- default: O(() => [
1514
+ default: A(() => [
1504
1515
  l("span", {
1505
1516
  class: K([
1506
1517
  "line-clamp-1 fm-typo-en-body-lg-400",
@@ -1510,96 +1521,96 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1510
1521
  ]),
1511
1522
  _: 1
1512
1523
  }, 8, ["label", "modelValue", "items", "rules"]),
1513
- f(Me, {
1524
+ p(qe, {
1514
1525
  label: P.value === t(me).enum.purchase ? t(a)("inventory.transfer.form.purchaseFrom") : t(a)("inventory.transfer.form.transferFrom"),
1515
1526
  "label-mark": "required",
1516
1527
  modelValue: D.value,
1517
- "onUpdate:modelValue": h[1] || (h[1] = (A) => D.value = A),
1528
+ "onUpdate:modelValue": h[1] || (h[1] = (O) => D.value = O),
1518
1529
  items: R.value,
1519
1530
  rules: [t(Le)(1)(R.value)]
1520
1531
  }, {
1521
- "menu-wrapper": O((A) => {
1532
+ "menu-wrapper": A((O) => {
1522
1533
  var ne, Ue;
1523
1534
  return [
1524
- f(hs, ut(A, {
1535
+ p(hs, ut(O, {
1525
1536
  items: R.value,
1526
1537
  "model-value": (Ue = (ne = s.modelValue) == null ? void 0 : ne.supplier) == null ? void 0 : Ue._id
1527
1538
  }), null, 16, ["items", "model-value"])
1528
1539
  ];
1529
1540
  }),
1530
- default: O(() => {
1531
- var A;
1541
+ default: A(() => {
1542
+ var O;
1532
1543
  return [
1533
1544
  l("span", {
1534
1545
  class: K([
1535
1546
  "line-clamp-1 fm-typo-en-body-lg-400",
1536
1547
  s.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1537
1548
  ])
1538
- }, E((A = R.value.find((ne) => ne.value === D.value)) == null ? void 0 : A.label), 3)
1549
+ }, E((O = R.value.find((ne) => ne.value === D.value)) == null ? void 0 : O.label), 3)
1539
1550
  ];
1540
1551
  }),
1541
1552
  _: 1
1542
1553
  }, 8, ["label", "modelValue", "items", "rules"])
1543
1554
  ], 64)),
1544
- f(We, {
1555
+ p(We, {
1545
1556
  label: t(a)("inventory.transfer.form.reference"),
1546
1557
  "label-mark": "optional",
1547
1558
  modelValue: Y.value,
1548
- "onUpdate:modelValue": h[2] || (h[2] = (A) => Y.value = A)
1559
+ "onUpdate:modelValue": h[2] || (h[2] = (O) => Y.value = O)
1549
1560
  }, null, 8, ["label", "modelValue"]),
1550
- f(Ge, {
1561
+ p(Ge, {
1551
1562
  label: t(a)("inventory.transfer.form.remark"),
1552
1563
  "label-mark": "optional",
1553
1564
  "max-length": 240,
1554
1565
  modelValue: F.value,
1555
- "onUpdate:modelValue": h[3] || (h[3] = (A) => F.value = A),
1566
+ "onUpdate:modelValue": h[3] || (h[3] = (O) => F.value = O),
1556
1567
  class: K([s.disabled ? "text-fm-color-typo-disabled " : ""])
1557
1568
  }, null, 8, ["label", "modelValue", "class"]),
1558
- S.value ? (x(), se(So, {
1569
+ w.value ? (x(), se(So, {
1559
1570
  key: 2,
1560
- required: t(m).template != null,
1571
+ required: t(d).template != null,
1561
1572
  disabled: s.disabled,
1562
- supplier: t(m).supplier,
1563
- setting: t(m).netSuite,
1573
+ supplier: t(d).supplier,
1574
+ setting: t(d).netSuite,
1564
1575
  items: B.value,
1565
- onChange: (A, ne) => {
1566
- t(r).updateItems(A), t(r).setNetSuiteSetting(ne);
1576
+ onChange: (O, ne) => {
1577
+ t(i).updateItems(O), t(i).setNetSuiteSetting(ne);
1567
1578
  },
1568
- "onNetsuite:ready": h[4] || (h[4] = (A) => {
1579
+ "onNetsuite:ready": h[4] || (h[4] = (O) => {
1569
1580
  _.value = !0;
1570
1581
  })
1571
1582
  }, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : Q("", !0),
1572
- t(p).enableBackdatePo ? (x(), T("div", Mo, [
1583
+ t(m).enableBackdatePo ? (x(), T("div", qo, [
1573
1584
  l("div", {
1574
1585
  class: K([
1575
1586
  "flex",
1576
1587
  {
1577
- "flex-col": b.value
1588
+ "flex-col": y.value
1578
1589
  }
1579
1590
  ])
1580
1591
  }, [
1581
- f(Ne, {
1592
+ p(Ne, {
1582
1593
  modelValue: t(re),
1583
- "onUpdate:modelValue": h[5] || (h[5] = (A) => we(re) ? re.value = A : null),
1594
+ "onUpdate:modelValue": h[5] || (h[5] = (O) => we(re) ? re.value = O : null),
1584
1595
  label: t(a)("inventory.transfer.form.backdate.title"),
1585
1596
  sublabel: t(a)("inventory.transfer.form.backdate.subtitle"),
1586
1597
  "label-placement": "right",
1587
1598
  disabled: X.value && !s.lastClosingDate || s.disabled
1588
1599
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1589
1600
  l("div", {
1590
- class: K({ hidden: b.value, "w-16": !b.value })
1601
+ class: K({ hidden: y.value, "w-16": !y.value })
1591
1602
  }, null, 2),
1592
1603
  t(re) ? (x(), T("div", No, [
1593
1604
  l("div", Uo, [
1594
- f(Je, {
1605
+ p(Je, {
1595
1606
  modelValue: t(W),
1596
- "onUpdate:modelValue": h[6] || (h[6] = (A) => we(W) ? W.value = A : null)
1607
+ "onUpdate:modelValue": h[6] || (h[6] = (O) => we(W) ? W.value = O : null)
1597
1608
  }, null, 8, ["modelValue"])
1598
1609
  ]),
1599
1610
  l("div", zo, [
1600
- f(H, {
1611
+ p(H, {
1601
1612
  modelValue: t(Fe),
1602
- "onUpdate:modelValue": h[7] || (h[7] = (A) => we(Fe) ? Fe.value = A : null)
1613
+ "onUpdate:modelValue": h[7] || (h[7] = (O) => we(Fe) ? Fe.value = O : null)
1603
1614
  }, null, 8, ["modelValue"])
1604
1615
  ])
1605
1616
  ])) : Q("", !0)
@@ -1607,11 +1618,11 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1607
1618
  t(J) ? (x(), se(ee, {
1608
1619
  key: 0,
1609
1620
  modelValue: t(J),
1610
- "onUpdate:modelValue": h[8] || (h[8] = (A) => we(J) ? J.value = A : null),
1621
+ "onUpdate:modelValue": h[8] || (h[8] = (O) => we(J) ? J.value = O : null),
1611
1622
  rules: [t(as)(new Date(s.lastClosingDate), /* @__PURE__ */ new Date())]
1612
1623
  }, null, 8, ["modelValue", "rules"])) : Q("", !0),
1613
1624
  X.value && !s.lastClosingDate ? (x(), T("div", Bo, [
1614
- f(Te, {
1625
+ p(Te, {
1615
1626
  name: "error",
1616
1627
  size: "sm",
1617
1628
  class: "text-fm-color-typo-warning"
@@ -1622,7 +1633,7 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1622
1633
  ])
1623
1634
  ]),
1624
1635
  l("div", Ho, [
1625
- f(ee, {
1636
+ p(ee, {
1626
1637
  "model-value": B.value,
1627
1638
  rules: [t(Le)(1)]
1628
1639
  }, null, 8, ["model-value", "rules"]),
@@ -1630,14 +1641,14 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1630
1641
  class: K([
1631
1642
  "flex gap-16",
1632
1643
  {
1633
- "flex-col items-start": b.value,
1634
- "items-center": !b.value
1644
+ "flex-col items-start": y.value,
1645
+ "items-center": !y.value
1635
1646
  }
1636
1647
  ])
1637
1648
  }, [
1638
1649
  l("div", jo, E(t(a)("inventory.transfer.form.items.title")), 1),
1639
1650
  l("div", Qo, [
1640
- f(ie, {
1651
+ p(ie, {
1641
1652
  disabled: s.disabled,
1642
1653
  label: t(a)("inventory.transfer.form.items.addItem"),
1643
1654
  "prepend-icon": "add",
@@ -1645,35 +1656,35 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1645
1656
  "text-color": "primary",
1646
1657
  "bg-color": "transparent",
1647
1658
  "border-color": "primary",
1648
- onClick: h[9] || (h[9] = (A) => Ye()),
1659
+ onClick: h[9] || (h[9] = (O) => Ye()),
1649
1660
  size: "md"
1650
1661
  }, null, 8, ["disabled", "label"]),
1651
- f(vo, {
1652
- "template-id": t(m).template || void 0,
1662
+ p(vo, {
1663
+ "template-id": t(d).template || void 0,
1653
1664
  "template-items": Ke.value,
1654
1665
  "po-items": B.value,
1655
- "onUpdate:forecastAmounts": h[10] || (h[10] = (A) => {
1656
- y.value = A;
1666
+ "onUpdate:forecastAmounts": h[10] || (h[10] = (O) => {
1667
+ b.value = O;
1657
1668
  }),
1658
- "onUpdate:poItems": h[11] || (h[11] = (A) => {
1659
- t(r).updateItems(A), c.value++;
1669
+ "onUpdate:poItems": h[11] || (h[11] = (O) => {
1670
+ t(i).updateItems(O), f.value++;
1660
1671
  })
1661
1672
  }, null, 8, ["template-id", "template-items", "po-items"])
1662
1673
  ])
1663
1674
  ], 2),
1664
- P.value === t(me).enum.purchase && z.value && t(p).enableTotalCost && ((_e = s.modelValue) != null && _e.items.length) ? (x(), T("div", Yo, [
1665
- f(Ne, {
1675
+ P.value === t(me).enum.purchase && z.value && t(m).enableTotalCost && ((_e = s.modelValue) != null && _e.items.length) ? (x(), T("div", Yo, [
1676
+ p(Ne, {
1666
1677
  label: t(ke) ? t(a)("inventory.transfer.form.items.fetchingData") : t(a)("inventory.transfer.form.items.comparePriceHistory"),
1667
1678
  "prepend-icon": "compare_arrows",
1668
1679
  "label-placement": "right",
1669
1680
  "model-value": t(ge),
1670
- "onUpdate:modelValue": h[12] || (h[12] = (A) => we(ge) ? ge.value = A : null),
1681
+ "onUpdate:modelValue": h[12] || (h[12] = (O) => we(ge) ? ge.value = O : null),
1671
1682
  disabled: t(ke) || s.disabled
1672
1683
  }, null, 8, ["label", "model-value", "disabled"])
1673
1684
  ])) : Q("", !0),
1674
- f(ee, {
1675
- "model-value": qe.value,
1676
- rules: [() => qe.value ? "Must have at least one non-zero item" : !0]
1685
+ p(ee, {
1686
+ "model-value": Me.value,
1687
+ rules: [() => Me.value ? "Must have at least one non-zero item" : !0]
1677
1688
  }, null, 8, ["model-value", "rules"]),
1678
1689
  (x(), se(ae, {
1679
1690
  "column-defs": Qe.value,
@@ -1683,35 +1694,35 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1683
1694
  [t(te).TemplateName]: !!(((_t = s.modelValue) == null ? void 0 : _t.template) ?? ((ht = s.modelValue) == null ? void 0 : ht.templateDoc))
1684
1695
  },
1685
1696
  "row-data": B.value,
1686
- key: c.value,
1697
+ key: f.value,
1687
1698
  "hide-footer": "",
1688
1699
  "page-size": B.value.length
1689
1700
  }, {
1690
- "table-row": O((A) => {
1701
+ "table-row": A((O) => {
1691
1702
  var ne, Ue, kt, xt;
1692
1703
  return [
1693
- f(ho, {
1704
+ p(ho, {
1694
1705
  "compare-price-by-sku": t(Ee),
1695
1706
  "show-compare-price": P.value === t(me).enum.purchase && t(ge),
1696
- row: A,
1707
+ row: O,
1697
1708
  "template-item": (xt = (kt = (Ue = (ne = s.modelValue) == null ? void 0 : ne.templateDoc) == null ? void 0 : Ue.purchaseOrder) == null ? void 0 : kt.items) == null ? void 0 : xt.find(
1698
- (rt) => rt.sku._id === A.original.sku._id
1709
+ (rt) => rt.sku._id === O.original.sku._id
1699
1710
  ),
1700
1711
  "onUpdate:item": h[13] || (h[13] = (rt) => Ie.value.updateItem(rt)),
1701
1712
  disabled: s.disabled
1702
1713
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "template-item", "disabled"])
1703
1714
  ];
1704
1715
  }),
1705
- "list-row": O((A) => [
1706
- (x(), se(Ot, {
1707
- row: A,
1716
+ "list-row": A((O) => [
1717
+ (x(), se(At, {
1718
+ row: O,
1708
1719
  key: B.value.map((ne) => ne.sku._id).join(".")
1709
1720
  }, {
1710
- default: O((ne) => [
1711
- f(Ws, {
1721
+ default: A((ne) => [
1722
+ p(Ws, {
1712
1723
  "compare-price-by-sku": t(Ee),
1713
1724
  "show-compare-price": P.value === t(me).enum.purchase && t(ge),
1714
- row: A,
1725
+ row: O,
1715
1726
  "cell-by-col-id": ne
1716
1727
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1717
1728
  ]),
@@ -1738,28 +1749,28 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1738
1749
  lastClosingDate: {}
1739
1750
  },
1740
1751
  emits: ["update:show", "submitted"],
1741
- setup(d, { expose: v, emit: n }) {
1752
+ setup(c, { expose: v, emit: n }) {
1742
1753
  var Z;
1743
- const u = d, g = n, a = ft(), k = Et(), C = Oe(), $ = mt(), p = at(), e = ot(), { t: i } = be(), b = M(!1), o = M(!1), r = M(!1), m = M(!1), _ = N(() => {
1744
- var w;
1745
- return ((w = I.value.items) == null ? void 0 : w.filter((F) => F.quantity.amount === 0)) ?? [];
1754
+ const u = c, g = n, a = ft(), k = Et(), C = Ae(), $ = mt(), m = at(), e = ot(), { t: r } = be(), y = q(!1), o = q(!1), i = q(!1), d = q(!1), _ = N(() => {
1755
+ var S;
1756
+ return ((S = I.value.items) == null ? void 0 : S.filter((F) => F.quantity.amount === 0)) ?? [];
1746
1757
  });
1747
- async function S(w) {
1748
- if (w) {
1758
+ async function w(S) {
1759
+ if (S) {
1749
1760
  o.value = !1;
1750
1761
  try {
1751
1762
  await $.readSuppliers(), o.value = !0;
1752
1763
  } catch {
1753
1764
  C.open({
1754
- title: i("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1755
- message: i("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1765
+ title: r("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1766
+ message: r("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1756
1767
  type: "error"
1757
1768
  });
1758
1769
  }
1759
1770
  }
1760
1771
  }
1761
- e.watchLocation(S);
1762
- function c() {
1772
+ e.watchLocation(w);
1773
+ function f() {
1763
1774
  return {
1764
1775
  remark: void 0,
1765
1776
  ref: void 0,
@@ -1793,42 +1804,42 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1793
1804
  templateDoc: k.templates.find((F) => F._id === u.templateId)
1794
1805
  };
1795
1806
  }
1796
- const y = At(u, "show"), I = M(u.modelValue ?? c()), z = M(((Z = u.modelValue) == null ? void 0 : Z._id) ?? `${Math.random()}`);
1797
- fe(
1807
+ const b = Ot(u, "show"), I = q(u.modelValue ?? f()), z = q(((Z = u.modelValue) == null ? void 0 : Z._id) ?? `${Math.random()}`);
1808
+ pe(
1798
1809
  () => u.show,
1799
- (w) => {
1810
+ (S) => {
1800
1811
  var F;
1801
- w && (r.value = !1, I.value = u.modelValue ?? c(), z.value = ((F = u.modelValue) == null ? void 0 : F._id) ?? `${Math.random()}`);
1812
+ S && (i.value = !1, I.value = u.modelValue ?? f(), z.value = ((F = u.modelValue) == null ? void 0 : F._id) ?? `${Math.random()}`);
1802
1813
  }
1803
1814
  );
1804
- const B = N(() => !o.value || !r.value), X = N(() => {
1815
+ const B = N(() => !o.value || !i.value), X = N(() => {
1805
1816
  switch (u.mode) {
1806
1817
  case ze.READ:
1807
1818
  return "View transfer";
1808
1819
  case ze.CREATE:
1809
- return i("inventory.transfer.receiveRequest.create.title");
1820
+ return r("inventory.transfer.receiveRequest.create.title");
1810
1821
  case ze.UPDATE:
1811
- return i("inventory.transfer.receiveRequest.update.title");
1822
+ return r("inventory.transfer.receiveRequest.update.title");
1812
1823
  }
1813
1824
  return "";
1814
- }), oe = M();
1825
+ }), oe = q();
1815
1826
  v({
1816
1827
  validateInputs: () => {
1817
- var w, F;
1818
- (F = (w = oe.value) == null ? void 0 : w.validateInputs) == null || F.call(w);
1828
+ var S, F;
1829
+ (F = (S = oe.value) == null ? void 0 : S.validateInputs) == null || F.call(S);
1819
1830
  },
1820
1831
  resetInputsValidation: () => {
1821
- var w, F;
1822
- (F = (w = oe.value) == null ? void 0 : w.resetInputsValidation) == null || F.call(w);
1832
+ var S, F;
1833
+ (F = (S = oe.value) == null ? void 0 : S.resetInputsValidation) == null || F.call(S);
1823
1834
  },
1824
1835
  resetInputs: () => {
1825
- var w, F;
1826
- (F = (w = oe.value) == null ? void 0 : w.resetInputs) == null || F.call(w);
1836
+ var S, F;
1837
+ (F = (S = oe.value) == null ? void 0 : S.resetInputs) == null || F.call(S);
1827
1838
  }
1828
1839
  });
1829
1840
  async function U() {
1830
- const w = I.value;
1831
- if (b.value = !0, w.items = w.items.filter((F) => F.quantity.amount > 0), !w.items.length) {
1841
+ const S = I.value;
1842
+ if (y.value = !0, S.items = S.items.filter((F) => F.quantity.amount > 0), !S.items.length) {
1832
1843
  C.open({
1833
1844
  title: "Cannot create order",
1834
1845
  message: "There are no items with non-zero amount in your request.",
@@ -1836,26 +1847,26 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1836
1847
  });
1837
1848
  return;
1838
1849
  }
1839
- (w.supplier.internal === "warehouse" || w.supplier.internal === "restaurant") && (w.items = w.items.map(({ totalCost: F, ...Y }) => Y));
1850
+ (S.supplier.internal === "warehouse" || S.supplier.internal === "restaurant") && (S.items = S.items.map(({ totalCost: F, ...Y }) => Y));
1840
1851
  try {
1841
- await a.createPurchaseOrder(w), await new Promise((F) => setTimeout(F, 1e3)), C.open({
1842
- title: i("inventory.transfer.receiveRequest.create.success"),
1843
- message: i("inventory.transfer.receiveRequest.create.successMessage"),
1852
+ await a.createPurchaseOrder(S), await new Promise((F) => setTimeout(F, 1e3)), C.open({
1853
+ title: r("inventory.transfer.receiveRequest.create.success"),
1854
+ message: r("inventory.transfer.receiveRequest.create.successMessage"),
1844
1855
  type: "success"
1845
1856
  }), g("update:show", !1), g("submitted");
1846
1857
  } catch (F) {
1847
1858
  C.open({
1848
- title: i("inventory.transfer.receiveRequest.create.error.title"),
1849
- message: i("inventory.transfer.receiveRequest.create.error.message"),
1859
+ title: r("inventory.transfer.receiveRequest.create.error.title"),
1860
+ message: r("inventory.transfer.receiveRequest.create.error.message"),
1850
1861
  type: "error"
1851
1862
  }), console.error("Error in creating purchase order", F);
1852
1863
  } finally {
1853
- b.value = !1;
1864
+ y.value = !1;
1854
1865
  }
1855
1866
  }
1856
1867
  async function P() {
1857
- const w = I.value;
1858
- if (b.value = !0, w.items = w.items.filter((F) => F.quantity.amount > 0), !w.items.length) {
1868
+ const S = I.value;
1869
+ if (y.value = !0, S.items = S.items.filter((F) => F.quantity.amount > 0), !S.items.length) {
1859
1870
  C.open({
1860
1871
  title: "Cannot create order",
1861
1872
  message: "There are no items with non-zero amount in your request.",
@@ -1863,21 +1874,21 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1863
1874
  });
1864
1875
  return;
1865
1876
  }
1866
- (w.supplier.internal === "warehouse" || w.supplier.internal === "restaurant") && (w.items = w.items.map(({ totalCost: F, ...Y }) => Y));
1877
+ (S.supplier.internal === "warehouse" || S.supplier.internal === "restaurant") && (S.items = S.items.map(({ totalCost: F, ...Y }) => Y));
1867
1878
  try {
1868
- await a.updatePurchaseOrder(w), await new Promise((F) => setTimeout(F, 1e3)), C.open({
1869
- title: i("inventory.transfer.receiveRequest.update.success"),
1870
- message: i("inventory.transfer.receiveRequest.update.successMessage"),
1879
+ await a.updatePurchaseOrder(S), await new Promise((F) => setTimeout(F, 1e3)), C.open({
1880
+ title: r("inventory.transfer.receiveRequest.update.success"),
1881
+ message: r("inventory.transfer.receiveRequest.update.successMessage"),
1871
1882
  type: "success"
1872
1883
  }), g("update:show", !1), g("submitted");
1873
1884
  } catch (F) {
1874
1885
  C.open({
1875
- title: i("inventory.transfer.receiveRequest.update.error.title"),
1876
- message: i("inventory.transfer.receiveRequest.update.error.message"),
1886
+ title: r("inventory.transfer.receiveRequest.update.error.title"),
1887
+ message: r("inventory.transfer.receiveRequest.update.error.message"),
1877
1888
  type: "error"
1878
1889
  }), console.error("Error in updating purchase order", F);
1879
1890
  } finally {
1880
- b.value = !1;
1891
+ y.value = !1;
1881
1892
  }
1882
1893
  }
1883
1894
  function R() {
@@ -1889,15 +1900,15 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1889
1900
  }
1890
1901
  }
1891
1902
  function D() {
1892
- var w;
1893
- I.value.items = ((w = I.value.items) == null ? void 0 : w.filter((F) => F.quantity.amount > 0)) ?? [], m.value = !1, q();
1903
+ var S;
1904
+ I.value.items = ((S = I.value.items) == null ? void 0 : S.filter((F) => F.quantity.amount > 0)) ?? [], d.value = !1, M();
1894
1905
  }
1895
- function q() {
1906
+ function M() {
1896
1907
  var Y, J;
1897
- const w = gs.validatePurchaseOrderItems({
1898
- skusById: p.skuById ?? {},
1908
+ const S = gs.validatePurchaseOrderItems({
1909
+ skusById: m.skuById ?? {},
1899
1910
  items: I.value.items ?? []
1900
- }), F = Object.values(w).flat();
1911
+ }), F = Object.values(S).flat();
1901
1912
  if (F.length > 0) {
1902
1913
  const re = F[0];
1903
1914
  C.open({
@@ -1911,86 +1922,86 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1911
1922
  }
1912
1923
  function L() {
1913
1924
  if (_.value.length > 0) {
1914
- m.value = !0;
1925
+ d.value = !0;
1915
1926
  return;
1916
1927
  }
1917
- q();
1928
+ M();
1918
1929
  }
1919
- return (w, F) => {
1930
+ return (S, F) => {
1920
1931
  const Y = V("FmButton"), J = V("FmSideSheet"), re = V("FmDialog");
1921
1932
  return x(), T(le, null, [
1922
- f(J, {
1923
- modelValue: t(y),
1924
- "onUpdate:modelValue": F[3] || (F[3] = (W) => we(y) ? y.value = W : null),
1933
+ p(J, {
1934
+ modelValue: t(b),
1935
+ "onUpdate:modelValue": F[3] || (F[3] = (W) => we(b) ? b.value = W : null),
1925
1936
  "dismiss-away": "",
1926
1937
  "close-button": "",
1927
1938
  "max-width": 900
1928
1939
  }, {
1929
- "side-sheet-header": O(() => [
1940
+ "side-sheet-header": A(() => [
1930
1941
  l("div", Xo, [
1931
1942
  l("div", Zo, E(X.value), 1)
1932
1943
  ])
1933
1944
  ]),
1934
- default: O(() => [
1945
+ default: A(() => [
1935
1946
  (x(), se(Ko, {
1936
1947
  class: "w-full",
1937
1948
  ref_key: "formRef",
1938
1949
  ref: oe,
1939
- "onForm:ready": F[0] || (F[0] = () => r.value = !0),
1950
+ "onForm:ready": F[0] || (F[0] = () => i.value = !0),
1940
1951
  onValidationSuccess: R,
1941
1952
  modelValue: I.value,
1942
1953
  "onUpdate:modelValue": F[1] || (F[1] = (W) => I.value = W),
1943
- disabled: b.value || B.value,
1954
+ disabled: y.value || B.value,
1944
1955
  suppliers: t($).suppliers,
1945
- skus: t(p).skus,
1956
+ skus: t(m).skus,
1946
1957
  key: z.value,
1947
- "last-closing-date": w.lastClosingDate
1958
+ "last-closing-date": S.lastClosingDate
1948
1959
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1949
1960
  ]),
1950
- "side-sheet-footer": O(() => [
1961
+ "side-sheet-footer": A(() => [
1951
1962
  l("div", Wo, [
1952
- f(Y, {
1953
- loading: b.value,
1963
+ p(Y, {
1964
+ loading: y.value,
1954
1965
  disabled: B.value,
1955
- label: t(i)("common.save"),
1966
+ label: t(r)("common.save"),
1956
1967
  onClick: L
1957
1968
  }, null, 8, ["loading", "disabled", "label"]),
1958
- f(Y, {
1969
+ p(Y, {
1959
1970
  disabled: B.value,
1960
1971
  variant: "tertiary",
1961
- label: t(i)("common.close"),
1972
+ label: t(r)("common.close"),
1962
1973
  onClick: F[2] || (F[2] = (W) => g("update:show", !1))
1963
1974
  }, null, 8, ["disabled", "label"])
1964
1975
  ])
1965
1976
  ]),
1966
1977
  _: 1
1967
1978
  }, 8, ["modelValue"]),
1968
- f(re, {
1969
- modelValue: m.value,
1970
- "onUpdate:modelValue": F[5] || (F[5] = (W) => m.value = W),
1979
+ p(re, {
1980
+ modelValue: d.value,
1981
+ "onUpdate:modelValue": F[5] || (F[5] = (W) => d.value = W),
1971
1982
  overlay: !0
1972
1983
  }, {
1973
- "dialog-header": O(() => [
1974
- l("div", Go, E(t(i)("inventory.transfer.template.zeroQuantity.title")), 1)
1984
+ "dialog-header": A(() => [
1985
+ l("div", Go, E(t(r)("inventory.transfer.template.zeroQuantity.title")), 1)
1975
1986
  ]),
1976
- "dialog-footer": O(() => [
1987
+ "dialog-footer": A(() => [
1977
1988
  l("div", aa, [
1978
- f(Y, {
1979
- label: t(i)("common.cancel"),
1989
+ p(Y, {
1990
+ label: t(r)("common.cancel"),
1980
1991
  variant: "tertiary",
1981
- onClick: F[4] || (F[4] = (W) => m.value = !1)
1992
+ onClick: F[4] || (F[4] = (W) => d.value = !1)
1982
1993
  }, null, 8, ["label"]),
1983
- f(Y, {
1984
- label: t(i)("inventory.transfer.template.zeroQuantity.removeAll"),
1994
+ p(Y, {
1995
+ label: t(r)("inventory.transfer.template.zeroQuantity.removeAll"),
1985
1996
  variant: "primary",
1986
1997
  "prepend-icon": "delete",
1987
1998
  onClick: D
1988
1999
  }, null, 8, ["label"])
1989
2000
  ])
1990
2001
  ]),
1991
- default: O(() => [
2002
+ default: A(() => [
1992
2003
  l("div", Jo, [
1993
- l("div", ea, E(t(i)("inventory.transfer.template.zeroQuantity.message", { count: _.value.length })), 1),
2004
+ l("div", ea, E(t(r)("inventory.transfer.template.zeroQuantity.message", { count: _.value.length })), 1),
1994
2005
  l("div", ta, [
1995
2006
  l("ul", sa, [
1996
2007
  (x(!0), T(le, null, he(_.value, (W) => (x(), T("li", {
@@ -1999,7 +2010,7 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
1999
2010
  }, E(W.sku.name) + " (" + E(W.sku.code) + ") ", 1))), 128))
2000
2011
  ])
2001
2012
  ]),
2002
- l("div", oa, E(t(i)("inventory.transfer.template.zeroQuantity.prompt")), 1)
2013
+ l("div", oa, E(t(r)("inventory.transfer.template.zeroQuantity.prompt")), 1)
2003
2014
  ])
2004
2015
  ]),
2005
2016
  _: 1
@@ -2008,58 +2019,58 @@ const $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center ga
2008
2019
  };
2009
2020
  }
2010
2021
  });
2011
- function la(d) {
2012
- const [v, n, u, ...g] = Is(d), a = u.map((p) => p.toLowerCase().trim().replace(/ /g, "_")), C = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((p) => !a.includes(p));
2022
+ function la(c) {
2023
+ const [v, n, u, ...g] = Is(c), a = u.map((m) => m.toLowerCase().trim().replace(/ /g, "_")), C = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((m) => !a.includes(m));
2013
2024
  if (C.length)
2014
2025
  throw new Error(
2015
2026
  `Missing headers (${C.join()}). Excel file does not come from the template.`
2016
2027
  );
2017
- return g.map((p, e) => {
2018
- const i = {};
2019
- for (const b in a) {
2020
- const o = a[b];
2021
- Object.assign(i, { [o]: p[b] });
2028
+ return g.map((m, e) => {
2029
+ const r = {};
2030
+ for (const y in a) {
2031
+ const o = a[y];
2032
+ Object.assign(r, { [o]: m[y] });
2022
2033
  }
2023
2034
  return {
2024
2035
  index: e,
2025
- data: i
2036
+ data: r
2026
2037
  };
2027
2038
  });
2028
2039
  }
2029
- function ra(d) {
2030
- const v = d.SheetNames;
2040
+ function ra(c) {
2041
+ const v = c.SheetNames;
2031
2042
  try {
2032
2043
  return v.reduce(
2033
2044
  (u, g) => {
2034
- const a = new Array(), k = d.Sheets[g], C = at(), $ = la(k), p = [];
2035
- for (const { index: i, data: b } of $) {
2036
- b.scanned_code === "" && a.push(`Row ${i + 1}: Scanned code is empty`), b.item_name === "" && a.push(`Row ${i + 1}: Item name is empty`), b.uom === "" && a.push(`Row ${i + 1}: UOM is empty`), b["transfer_quantity(uom)"] === "" && a.push(`Row ${i + 1}: Transfer quantity is empty`);
2037
- const o = C.skus.find((_) => _.code === b.scanned_code);
2045
+ const a = new Array(), k = c.Sheets[g], C = at(), $ = la(k), m = [];
2046
+ for (const { index: r, data: y } of $) {
2047
+ y.scanned_code === "" && a.push(`Row ${r + 1}: Scanned code is empty`), y.item_name === "" && a.push(`Row ${r + 1}: Item name is empty`), y.uom === "" && a.push(`Row ${r + 1}: UOM is empty`), y["transfer_quantity(uom)"] === "" && a.push(`Row ${r + 1}: Transfer quantity is empty`);
2048
+ const o = C.skus.find((_) => _.code === y.scanned_code);
2038
2049
  if (!o) {
2039
- a.push(`Row ${i + 1}: SKU not found`);
2050
+ a.push(`Row ${r + 1}: SKU not found`);
2040
2051
  continue;
2041
2052
  }
2042
- const r = o.unit.abbrev === b.uom;
2043
- let m = null;
2044
- if (!r) {
2045
- const _ = o.unit.measurements.find((S) => S.abbrev === b.uom);
2053
+ const i = o.unit.abbrev === y.uom;
2054
+ let d = null;
2055
+ if (!i) {
2056
+ const _ = o.unit.measurements.find((w) => w.abbrev === y.uom);
2046
2057
  if (!_) {
2047
- a.push(`Row ${i + 1}: Measurement not found`);
2058
+ a.push(`Row ${r + 1}: Measurement not found`);
2048
2059
  continue;
2049
2060
  }
2050
- m = _;
2061
+ d = _;
2051
2062
  }
2052
- p.push({
2063
+ m.push({
2053
2064
  sku: o,
2054
- code: b.scanned_code,
2055
- name: b.item_name,
2056
- quantity: dt.fromNumber(Number(b["transfer_quantity(uom)"])),
2057
- measurement: m
2065
+ code: y.scanned_code,
2066
+ name: y.item_name,
2067
+ quantity: dt.fromNumber(Number(y["transfer_quantity(uom)"])),
2068
+ measurement: d
2058
2069
  });
2059
2070
  }
2060
2071
  const e = {
2061
2072
  type: "create",
2062
- poItems: p,
2073
+ poItems: m,
2063
2074
  excelSheetName: g,
2064
2075
  errors: a
2065
2076
  };
@@ -2091,12 +2102,12 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2091
2102
  items: {},
2092
2103
  errors: {}
2093
2104
  },
2094
- setup(d) {
2095
- const v = d, { t: n } = be(), u = M(!1), g = () => {
2105
+ setup(c) {
2106
+ const v = c, { t: n } = be(), u = q(!1), g = () => {
2096
2107
  v.errors.length && (u.value = !u.value);
2097
2108
  };
2098
2109
  return (a, k) => {
2099
- var p;
2110
+ var m;
2100
2111
  const C = V("FmIcon"), $ = V("FmTooltip");
2101
2112
  return x(), T("div", ia, [
2102
2113
  l("div", {
@@ -2112,11 +2123,11 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2112
2123
  "text-fm-color-system-error-300": a.errors.length
2113
2124
  })
2114
2125
  }, [
2115
- Ae(E(a.name) + " ", 1),
2126
+ Oe(E(a.name) + " ", 1),
2116
2127
  a.type === "create" ? (x(), T("span", ca, "(" + E(t(n)("inventory.closing.template.import.new")) + ")", 1)) : Q("", !0)
2117
2128
  ], 2),
2118
2129
  a.errors.length ? (x(), T("div", ma, [
2119
- f(C, {
2130
+ p(C, {
2120
2131
  name: "error",
2121
2132
  size: "sm",
2122
2133
  color: "system-error-300"
@@ -2125,27 +2136,27 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2125
2136
  ]),
2126
2137
  k[0] || (k[0] = l("hr", { class: "my-2" }, null, -1)),
2127
2138
  l("div", pa, [
2128
- (p = a.items) != null && p.length ? (x(!0), T(le, { key: 0 }, he(a.items, (e, i) => (x(), T("div", {
2129
- key: i,
2139
+ (m = a.items) != null && m.length ? (x(!0), T(le, { key: 0 }, he(a.items, (e, r) => (x(), T("div", {
2140
+ key: r,
2130
2141
  class: "flex gap-4 mt-2 items-center"
2131
2142
  }, [
2132
2143
  l("div", fa, [
2133
- f($, {
2144
+ p($, {
2134
2145
  content: e.code,
2135
2146
  placement: "top",
2136
2147
  "z-index": 51
2137
2148
  }, {
2138
- default: O(() => [
2149
+ default: A(() => [
2139
2150
  l("span", va, E(e.code), 1)
2140
2151
  ]),
2141
2152
  _: 2
2142
2153
  }, 1032, ["content"]),
2143
- f($, {
2154
+ p($, {
2144
2155
  content: e.name,
2145
2156
  placement: "top",
2146
2157
  "z-index": 51
2147
2158
  }, {
2148
- default: O(() => [
2159
+ default: A(() => [
2149
2160
  l("span", ya, E(e.name), 1)
2150
2161
  ]),
2151
2162
  _: 2
@@ -2155,7 +2166,7 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2155
2166
  l("span", ba, E(t(dt).toFormatString({
2156
2167
  value: e.quantity
2157
2168
  })), 1),
2158
- Ae(" " + E(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
2169
+ Oe(" " + E(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
2159
2170
  ])
2160
2171
  ]))), 128)) : Q("", !0)
2161
2172
  ])
@@ -2177,7 +2188,7 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2177
2188
  }, [
2178
2189
  a.errors.length ? (x(), T("div", _a, [
2179
2190
  l("ol", null, [
2180
- (x(!0), T(le, null, he(a.errors, (e, i) => (x(), T("li", { key: i }, E(e), 1))), 128))
2191
+ (x(!0), T(le, null, he(a.errors, (e, r) => (x(), T("li", { key: r }, E(e), 1))), 128))
2181
2192
  ])
2182
2193
  ])) : Q("", !0)
2183
2194
  ], 2)) : Q("", !0)
@@ -2198,17 +2209,17 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2198
2209
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
2199
2210
  }, Ta = { class: "fm-typo-en-body-lg-600" }, $t = "Transfer note", Va = /* @__PURE__ */ de({
2200
2211
  __name: "XilnexImportForm",
2201
- setup(d, { expose: v }) {
2202
- const n = M(null), u = Oe(), g = M(!1), a = M(!1), k = Ts(), C = M(!1), $ = He();
2203
- M([]);
2204
- const p = N({
2212
+ setup(c, { expose: v }) {
2213
+ const n = q(null), u = Ae(), g = q(!1), a = q(!1), k = Ts(), C = q(!1), $ = He();
2214
+ q([]);
2215
+ const m = N({
2205
2216
  get() {
2206
- var c;
2207
- return ((c = k.supplier) == null ? void 0 : c.name) ?? "";
2217
+ var f;
2218
+ return ((f = k.supplier) == null ? void 0 : f.name) ?? "";
2208
2219
  },
2209
- set(c) {
2210
- c && (k.supplier = {
2211
- name: c,
2220
+ set(f) {
2221
+ f && (k.supplier = {
2222
+ name: f,
2212
2223
  registrationNumber: "",
2213
2224
  _id: "xilnex",
2214
2225
  internal: "restaurant",
@@ -2224,93 +2235,93 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2224
2235
  }
2225
2236
  });
2226
2237
  st(async () => {
2227
- const c = await $.getNetSuiteLocations();
2228
- console.log(c), C.value = !0;
2238
+ const f = await $.getNetSuiteLocations();
2239
+ console.log(f), C.value = !0;
2229
2240
  });
2230
2241
  const e = N({
2231
2242
  get() {
2232
2243
  return "";
2233
2244
  },
2234
- set(c) {
2235
- if (c) {
2236
- const y = k.effectiveAt ? new Date(k.effectiveAt) : /* @__PURE__ */ new Date(), [I, z, B] = c.split("-");
2237
- y.setFullYear(parseInt(I)), y.setMonth(parseInt(z) - 1), y.setDate(parseInt(B)), k.effectiveAt = y.toISOString();
2245
+ set(f) {
2246
+ if (f) {
2247
+ const b = k.effectiveAt ? new Date(k.effectiveAt) : /* @__PURE__ */ new Date(), [I, z, B] = f.split("-");
2248
+ b.setFullYear(parseInt(I)), b.setMonth(parseInt(z) - 1), b.setDate(parseInt(B)), k.effectiveAt = b.toISOString();
2238
2249
  }
2239
2250
  }
2240
- }), i = N({
2251
+ }), r = N({
2241
2252
  get() {
2242
2253
  return null;
2243
2254
  },
2244
- set(c) {
2245
- if (c) {
2246
- const y = k.effectiveAt ? new Date(k.effectiveAt) : /* @__PURE__ */ new Date(), [I, z] = c.split(":");
2247
- y.setMinutes(parseInt(I)), y.setSeconds(parseInt(z)), k.effectiveAt = y.toISOString();
2255
+ set(f) {
2256
+ if (f) {
2257
+ const b = k.effectiveAt ? new Date(k.effectiveAt) : /* @__PURE__ */ new Date(), [I, z] = f.split(":");
2258
+ b.setMinutes(parseInt(I)), b.setSeconds(parseInt(z)), k.effectiveAt = b.toISOString();
2248
2259
  }
2249
2260
  }
2250
- }), b = M(new Array()), o = M([]), r = N(
2251
- () => !!b.value.length || o.value.some((c) => c.errors.length)
2252
- ), m = M();
2261
+ }), y = q(new Array()), o = q([]), i = N(
2262
+ () => !!y.value.length || o.value.some((f) => f.errors.length)
2263
+ ), d = q();
2253
2264
  v({
2254
2265
  validateInputs: () => {
2255
- var c, y;
2256
- (y = (c = m.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
2266
+ var f, b;
2267
+ (b = (f = d.value) == null ? void 0 : f.validateInputs) == null || b.call(f);
2257
2268
  },
2258
2269
  resetInputsValidation: () => {
2259
- var c, y;
2260
- (y = (c = m.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
2270
+ var f, b;
2271
+ (b = (f = d.value) == null ? void 0 : f.resetInputsValidation) == null || b.call(f);
2261
2272
  },
2262
2273
  resetInputs: () => {
2263
- var c, y;
2264
- (y = (c = m.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
2274
+ var f, b;
2275
+ (b = (f = d.value) == null ? void 0 : f.resetInputs) == null || b.call(f);
2265
2276
  }
2266
2277
  });
2267
2278
  const { t: _ } = be();
2268
- async function S(c) {
2269
- b.value = [], o.value = [];
2279
+ async function w(f) {
2280
+ y.value = [], o.value = [];
2270
2281
  try {
2271
2282
  g.value = !0;
2272
- const [y] = await Promise.all([
2273
- $s(c),
2283
+ const [b] = await Promise.all([
2284
+ $s(f),
2274
2285
  // fake buffer
2275
2286
  new Promise((z) => setTimeout(z, 1e3))
2276
- ]), I = ra(y);
2287
+ ]), I = ra(b);
2277
2288
  if (I.invalidExcel) {
2278
- b.value.push(
2289
+ y.value.push(
2279
2290
  I.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel")
2280
2291
  );
2281
2292
  return;
2282
2293
  }
2283
2294
  if (o.value = I.importCreateResult, !o.value.length) {
2284
- b.value.push(_("inventory.ingredient.import.fileError.noData"));
2295
+ y.value.push(_("inventory.ingredient.import.fileError.noData"));
2285
2296
  return;
2286
2297
  }
2287
2298
  k.items = o.value.map((z) => z.poItems).flat();
2288
- } catch (y) {
2299
+ } catch (b) {
2289
2300
  u.open({
2290
2301
  title: _("inventory.ingredient.import.fileError.unableToRead"),
2291
- message: y == null ? void 0 : y.message,
2302
+ message: b == null ? void 0 : b.message,
2292
2303
  type: "error"
2293
- }), console.error("Error in reading file", y);
2304
+ }), console.error("Error in reading file", b);
2294
2305
  } finally {
2295
- b.value.length && u.open({
2306
+ y.value.length && u.open({
2296
2307
  title: _("inventory.ingredient.import.fileError.invalidExcel"),
2297
2308
  type: "error"
2298
2309
  }), g.value = !1;
2299
2310
  }
2300
2311
  }
2301
- return fe(n, (c) => {
2302
- c && S(c);
2303
- }), (c, y) => {
2312
+ return pe(n, (f) => {
2313
+ f && w(f);
2314
+ }), (f, b) => {
2304
2315
  const I = V("FmSelect"), z = V("FmDatePicker"), B = V("FmTimePicker"), X = V("FmCircularProgress"), oe = V("FmLabel"), U = V("FmIcon"), P = V("FmButton"), R = V("FmForm");
2305
2316
  return x(), se(R, {
2306
2317
  ref_key: "formRef",
2307
- ref: m
2318
+ ref: d
2308
2319
  }, {
2309
- default: O(() => [
2320
+ default: A(() => [
2310
2321
  l("div", ka, [
2311
- f(I, {
2312
- modelValue: p.value,
2313
- "onUpdate:modelValue": y[0] || (y[0] = (D) => p.value = D),
2322
+ p(I, {
2323
+ modelValue: m.value,
2324
+ "onUpdate:modelValue": b[0] || (b[0] = (D) => m.value = D),
2314
2325
  label: "Transfer from",
2315
2326
  searchable: "",
2316
2327
  searchTarget: "label",
@@ -2325,28 +2336,28 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2325
2336
  "helper-text": "Helper",
2326
2337
  rules: [t(Be)()]
2327
2338
  }, null, 8, ["modelValue", "rules"]),
2328
- f(z, {
2339
+ p(z, {
2329
2340
  modelValue: e.value,
2330
- "onUpdate:modelValue": y[1] || (y[1] = (D) => e.value = D),
2341
+ "onUpdate:modelValue": b[1] || (b[1] = (D) => e.value = D),
2331
2342
  label: "Transfer date",
2332
2343
  rules: [t(Be)()]
2333
2344
  }, null, 8, ["modelValue", "rules"]),
2334
- f(B, {
2335
- modelValue: i.value,
2336
- "onUpdate:modelValue": y[2] || (y[2] = (D) => i.value = D),
2345
+ p(B, {
2346
+ modelValue: r.value,
2347
+ "onUpdate:modelValue": b[2] || (b[2] = (D) => r.value = D),
2337
2348
  label: "Transfer time",
2338
2349
  rules: [t(Be)()]
2339
2350
  }, null, 8, ["modelValue", "rules"]),
2340
2351
  a.value ? (x(), T("div", xa, [
2341
2352
  l("div", null, [
2342
- f(X, {
2353
+ p(X, {
2343
2354
  size: "md",
2344
2355
  color: "neutral-gray-200"
2345
2356
  })
2346
2357
  ]),
2347
2358
  l("div", Ca, E(t(_)("inventory.formField.loading")), 1)
2348
2359
  ])) : (x(), T(le, { key: 1 }, [
2349
- f(Ds, {
2360
+ p(Ds, {
2350
2361
  "max-file-size": 5,
2351
2362
  class: K({
2352
2363
  "w-full": !0,
@@ -2354,15 +2365,15 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2354
2365
  }),
2355
2366
  accept: ".xlsx,.xls",
2356
2367
  label: $t,
2357
- onFileUpload: y[3] || (y[3] = (D) => n.value = D),
2368
+ onFileUpload: b[3] || (b[3] = (D) => n.value = D),
2358
2369
  "button-label": t(_)("inventory.ingredient.import.selectFile")
2359
2370
  }, zt({ _: 2 }, [
2360
2371
  n.value ? {
2361
2372
  name: "default",
2362
- fn: O(({ openFileDialog: D }) => [
2363
- f(oe, null, {
2364
- default: O(() => [
2365
- Ae(E($t))
2373
+ fn: A(({ openFileDialog: D }) => [
2374
+ p(oe, null, {
2375
+ default: A(() => [
2376
+ Oe(E($t))
2366
2377
  ]),
2367
2378
  _: 1
2368
2379
  }),
@@ -2372,8 +2383,8 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2372
2383
  "fm-corner-radius-md p-16 flex items-center gap-16",
2373
2384
  {
2374
2385
  "border border-fm-color-neutral-gray-100": g.value,
2375
- "border border-fm-color-neutral-gray-200": !g.value && !r.value,
2376
- "border border-fm-color-system-error-200": r.value
2386
+ "border border-fm-color-neutral-gray-200": !g.value && !i.value,
2387
+ "border border-fm-color-system-error-200": i.value
2377
2388
  }
2378
2389
  ])
2379
2390
  }, [
@@ -2383,9 +2394,9 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2383
2394
  color: "neutral-gray-200"
2384
2395
  })) : (x(), se(U, {
2385
2396
  key: 1,
2386
- name: r.value ? "error" : "attach_file",
2397
+ name: i.value ? "error" : "attach_file",
2387
2398
  outline: "",
2388
- color: r.value ? "system-error-300" : void 0
2399
+ color: i.value ? "system-error-300" : void 0
2389
2400
  }, null, 8, ["name", "color"])),
2390
2401
  l("div", {
2391
2402
  class: K([
@@ -2399,25 +2410,25 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2399
2410
  l("div", Sa, E(n.value.name), 1)
2400
2411
  ], 2),
2401
2412
  g.value ? Q("", !0) : (x(), T("div", Fa, [
2402
- f(P, {
2413
+ p(P, {
2403
2414
  label: t(_)("inventory.ingredient.import.replaceFile"),
2404
- variant: r.value ? "destructive" : "secondary",
2405
- "prepend-icon": r.value ? void 0 : "autorenew",
2415
+ variant: i.value ? "destructive" : "secondary",
2416
+ "prepend-icon": i.value ? void 0 : "autorenew",
2406
2417
  onClick: D
2407
2418
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
2408
2419
  ]))
2409
2420
  ], 2),
2410
- b.value.length ? (x(), T("div", Ia, [
2411
- (x(!0), T(le, null, he(b.value, (q, L) => (x(), T("div", {
2421
+ y.value.length ? (x(), T("div", Ia, [
2422
+ (x(!0), T(le, null, he(y.value, (M, L) => (x(), T("div", {
2412
2423
  key: L,
2413
2424
  class: "flex gap-8 items-center"
2414
2425
  }, [
2415
- f(U, {
2426
+ p(U, {
2416
2427
  name: "error",
2417
2428
  size: "sm",
2418
2429
  color: "system-error-300"
2419
2430
  }),
2420
- l("div", $a, E(q), 1)
2431
+ l("div", $a, E(M), 1)
2421
2432
  ]))), 128))
2422
2433
  ])) : Q("", !0)
2423
2434
  ])
@@ -2427,9 +2438,9 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2427
2438
  ]), 1032, ["class", "button-label"]),
2428
2439
  n.value ? (x(), T("div", Da, [
2429
2440
  l("div", Ta, E(t(_)("inventory.ingredient.import.summary")), 1),
2430
- (x(!0), T(le, null, he(o.value, (D, q) => (x(), se(ha, {
2431
- key: q,
2432
- name: `Transfer Note ${q + 1}`,
2441
+ (x(!0), T(le, null, he(o.value, (D, M) => (x(), se(ha, {
2442
+ key: M,
2443
+ name: `Transfer Note ${M + 1}`,
2433
2444
  items: D.poItems,
2434
2445
  errors: D.errors,
2435
2446
  type: "create"
@@ -2448,29 +2459,29 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2448
2459
  show: { type: Boolean }
2449
2460
  },
2450
2461
  emits: ["update:show", "submitted"],
2451
- setup(d, { expose: v, emit: n }) {
2452
- const u = n, a = At(d, "show"), k = Oe(), C = ft(), $ = M(!1), p = M(), e = M();
2462
+ setup(c, { expose: v, emit: n }) {
2463
+ const u = n, a = Ot(c, "show"), k = Ae(), C = ft(), $ = q(!1), m = q(), e = q();
2453
2464
  v({
2454
2465
  validateInputs: () => {
2455
- var o, r;
2456
- (r = (o = p.value) == null ? void 0 : o.validateInputs) == null || r.call(o);
2466
+ var o, i;
2467
+ (i = (o = m.value) == null ? void 0 : o.validateInputs) == null || i.call(o);
2457
2468
  },
2458
2469
  resetInputsValidation: () => {
2459
- var o, r;
2460
- (r = (o = p.value) == null ? void 0 : o.resetInputsValidation) == null || r.call(o);
2470
+ var o, i;
2471
+ (i = (o = m.value) == null ? void 0 : o.resetInputsValidation) == null || i.call(o);
2461
2472
  },
2462
2473
  resetInputs: () => {
2463
- var o, r;
2464
- (r = (o = p.value) == null ? void 0 : o.resetInputs) == null || r.call(o);
2474
+ var o, i;
2475
+ (i = (o = m.value) == null ? void 0 : o.resetInputs) == null || i.call(o);
2465
2476
  }
2466
2477
  });
2467
- function i() {
2468
- var o, r;
2469
- (r = (o = p.value) == null ? void 0 : o.validateInputs) == null || r.call(o);
2478
+ function r() {
2479
+ var o, i;
2480
+ (i = (o = m.value) == null ? void 0 : o.validateInputs) == null || i.call(o);
2470
2481
  }
2471
- async function b() {
2472
- var r, m, _, S, c;
2473
- if (!((m = (r = e.value) == null ? void 0 : r.supplier) != null && m.name)) {
2482
+ async function y() {
2483
+ var i, d, _, w, f;
2484
+ if (!((d = (i = e.value) == null ? void 0 : i.supplier) != null && d.name)) {
2474
2485
  k.open({
2475
2486
  title: "Upload failed",
2476
2487
  message: "Location is required",
@@ -2478,7 +2489,7 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2478
2489
  });
2479
2490
  return;
2480
2491
  }
2481
- if (!((_ = e.value) != null && _.items) || ((c = (S = e.value) == null ? void 0 : S.items) == null ? void 0 : c.length) === 0) {
2492
+ if (!((_ = e.value) != null && _.items) || ((f = (w = e.value) == null ? void 0 : w.items) == null ? void 0 : f.length) === 0) {
2482
2493
  k.open({
2483
2494
  title: "Upload failed",
2484
2495
  message: "No data to upload",
@@ -2506,55 +2517,55 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2506
2517
  $.value = !0;
2507
2518
  try {
2508
2519
  await C.importFromXilnex(e.value), u("update:show", !1);
2509
- } catch (y) {
2520
+ } catch (b) {
2510
2521
  await new Promise((I) => setTimeout(I, 1e3)), k.open({
2511
2522
  title: "Upload failed",
2512
- message: y == null ? void 0 : y.message,
2523
+ message: b == null ? void 0 : b.message,
2513
2524
  type: "error"
2514
2525
  });
2515
2526
  } finally {
2516
2527
  $.value = !1;
2517
2528
  }
2518
2529
  }
2519
- return (o, r) => {
2520
- const m = V("FmSpacer"), _ = V("FmButton"), S = V("FmDialog");
2521
- return x(), se(S, {
2530
+ return (o, i) => {
2531
+ const d = V("FmSpacer"), _ = V("FmButton"), w = V("FmDialog");
2532
+ return x(), se(w, {
2522
2533
  modelValue: t(a),
2523
- "onUpdate:modelValue": r[2] || (r[2] = (c) => we(a) ? a.value = c : null),
2534
+ "onUpdate:modelValue": i[2] || (i[2] = (f) => we(a) ? a.value = f : null),
2524
2535
  overlay: !0,
2525
2536
  "close-button": !1
2526
2537
  }, {
2527
- "dialog-header": O(() => r[3] || (r[3] = [
2538
+ "dialog-header": A(() => i[3] || (i[3] = [
2528
2539
  l("div", null, "Xilnex transfer order", -1)
2529
2540
  ])),
2530
- "dialog-footer": O(() => [
2531
- f(m, { class: "sm:hidden xs:hidden" }),
2532
- f(_, {
2541
+ "dialog-footer": A(() => [
2542
+ p(d, { class: "sm:hidden xs:hidden" }),
2543
+ p(_, {
2533
2544
  disabled: $.value,
2534
2545
  class: "sm:w-full xs:w-full",
2535
2546
  label: "Cancel",
2536
2547
  size: "md",
2537
2548
  variant: "tertiary",
2538
- onClick: r[1] || (r[1] = (c) => u("update:show", !1))
2549
+ onClick: i[1] || (i[1] = (f) => u("update:show", !1))
2539
2550
  }, null, 8, ["disabled"]),
2540
- f(_, {
2551
+ p(_, {
2541
2552
  disabled: $.value,
2542
2553
  loading: $.value,
2543
2554
  class: "sm:w-full xs:w-full",
2544
2555
  label: "Upload",
2545
2556
  size: "md",
2546
2557
  variant: "primary",
2547
- onClick: i
2558
+ onClick: r
2548
2559
  }, null, 8, ["disabled", "loading"])
2549
2560
  ]),
2550
- default: O(() => [
2561
+ default: A(() => [
2551
2562
  l("div", Pa, [
2552
- f(Va, {
2563
+ p(Va, {
2553
2564
  ref_key: "formRef",
2554
- ref: p,
2555
- onValidationSuccess: b,
2565
+ ref: m,
2566
+ onValidationSuccess: y,
2556
2567
  modelValue: e.value,
2557
- "onUpdate:modelValue": r[0] || (r[0] = (c) => e.value = c)
2568
+ "onUpdate:modelValue": i[0] || (i[0] = (f) => e.value = f)
2558
2569
  }, null, 8, ["modelValue"])
2559
2570
  ])
2560
2571
  ]),
@@ -2562,20 +2573,20 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2562
2573
  }, 8, ["modelValue"]);
2563
2574
  };
2564
2575
  }
2565
- }), Aa = { class: "flex flex-col py-8" }, Oa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ea = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, qa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Ma = {
2576
+ }), Oa = { class: "flex flex-col py-8" }, Aa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ea = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, qa = {
2566
2577
  key: 0,
2567
2578
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2568
2579
  }, Na = { class: "pt-8" }, Dt = "ReceiveRequestViewSearchCriteria", yn = /* @__PURE__ */ de({
2569
2580
  __name: "ReceiveRequestView",
2570
- setup(d) {
2571
- const { t: v } = be(), n = Oe();
2581
+ setup(c) {
2582
+ const { t: v } = be(), n = Ae();
2572
2583
  et.object({
2573
2584
  name: et.string().optional().nullable(),
2574
2585
  startDate: et.string().optional().nullable(),
2575
2586
  endDate: et.string().optional().nullable()
2576
2587
  });
2577
2588
  const u = N(
2578
- () => !b._currentLocation || e.loading.value
2589
+ () => !y._currentLocation || e.loading.value
2579
2590
  ), g = is(), a = nt(), k = He();
2580
2591
  function C() {
2581
2592
  const U = {
@@ -2591,35 +2602,35 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2591
2602
  }
2592
2603
  }
2593
2604
  function $() {
2594
- g.setItem(Dt, JSON.stringify(p.value));
2605
+ g.setItem(Dt, JSON.stringify(m.value));
2595
2606
  }
2596
- const p = M(C()), e = Gt(
2607
+ const m = q(C()), e = Gt(
2597
2608
  it.RECEIVE_REQUEST,
2598
- p.value
2599
- ), { columnDefs: i } = Jt(
2609
+ m.value
2610
+ ), { columnDefs: r } = Jt(
2600
2611
  it.RECEIVE_REQUEST,
2601
2612
  e,
2602
2613
  e.shipments
2603
- ), b = ot();
2614
+ ), y = ot();
2604
2615
  async function o() {
2605
- const U = `inventory-record_${wt(p.value.startDate).format("DD-MM-YYYY_HH-mm")}-${wt(p.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, P = e.purchaseOrders.value.flatMap(
2606
- (D) => D.items.map((q) => {
2616
+ const U = `inventory-record_${wt(m.value.startDate).format("DD-MM-YYYY_HH-mm")}-${wt(m.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, P = e.purchaseOrders.value.flatMap(
2617
+ (D) => D.items.map((M) => {
2607
2618
  var J;
2608
- const L = new Date(ls(D._id) ?? ""), Z = D.effectiveAt ? new Date(D.effectiveAt) : void 0, w = Se(
2609
- ts(q.sku, D.deliveryOrder || [])
2610
- ), F = Se(q.quantity), Y = ((J = q == null ? void 0 : q.measurement) == null ? void 0 : J.abbrev) || q.sku.unit.abbrev;
2619
+ const L = new Date(ls(D._id) ?? ""), Z = D.effectiveAt ? new Date(D.effectiveAt) : void 0, S = Se(
2620
+ ts(M.sku, D.deliveryOrder || [])
2621
+ ), F = Se(M.quantity), Y = ((J = M == null ? void 0 : M.measurement) == null ? void 0 : J.abbrev) || M.sku.unit.abbrev;
2611
2622
  return {
2612
- "SKU code": q.code,
2613
- "SKU name": q.name,
2623
+ "SKU code": M.code,
2624
+ "SKU name": M.name,
2614
2625
  "PO #": D.seqNumber,
2615
2626
  "Effective at": Z,
2616
2627
  Date: L,
2617
2628
  Status: D.status,
2618
2629
  Reference: D.ref ?? "",
2619
- "Received quantity": w,
2630
+ "Received quantity": S,
2620
2631
  "Ordered quantity": F,
2621
2632
  Unit: Y,
2622
- "Total cost": q.totalCost ? tt(q.totalCost) : null
2633
+ "Total cost": M.totalCost ? tt(M.totalCost) : null
2623
2634
  };
2624
2635
  })
2625
2636
  ), R = [
@@ -2648,13 +2659,13 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2648
2659
  type: "success"
2649
2660
  });
2650
2661
  }
2651
- const r = M(Ct()), m = M("");
2652
- fe([() => r.value], ([U]) => {
2653
- !U.startDate || !U.endDate || (p.value.startDate = U.startDate, p.value.endDate = U.endDate, e.updateDateRange(
2654
- p.value.startDate,
2655
- p.value.endDate
2662
+ const i = q(Ct()), d = q("");
2663
+ pe([() => i.value], ([U]) => {
2664
+ !U.startDate || !U.endDate || (m.value.startDate = U.startDate, m.value.endDate = U.endDate, e.updateDateRange(
2665
+ m.value.startDate,
2666
+ m.value.endDate
2656
2667
  ), $());
2657
- }), fe([() => m.value], () => {
2668
+ }), pe([() => d.value], () => {
2658
2669
  $();
2659
2670
  });
2660
2671
  function _(U) {
@@ -2676,7 +2687,7 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2676
2687
  if (U === "export")
2677
2688
  return o();
2678
2689
  }
2679
- const { breakpoints: S } = ct(), c = N(() => S.value.xs || S.value.sm), y = N(() => c.value ? 10 : 20), I = us(), z = N(() => [
2690
+ const { breakpoints: w } = ct(), f = N(() => w.value.xs || w.value.sm), b = N(() => f.value ? 10 : 20), I = us(), z = N(() => [
2680
2691
  {
2681
2692
  label: v("inventory.transfer.receiveRequest.actions.create"),
2682
2693
  value: "create",
@@ -2713,8 +2724,8 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2713
2724
  key: "netsuiteTransactionNumber",
2714
2725
  entity: "purchaseOrder",
2715
2726
  values: e.purchaseOrders.value.map((R) => {
2716
- var D, q;
2717
- return (q = (D = R.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber;
2727
+ var D, M;
2728
+ return (M = (D = R.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : M.transactionnumber;
2718
2729
  }).filter((R) => R != null)
2719
2730
  },
2720
2731
  {
@@ -2737,16 +2748,16 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2737
2748
  }
2738
2749
  ];
2739
2750
  return [...U, ...k.isEnabled ? P : []];
2740
- }), X = M(null), oe = N(() => {
2751
+ }), X = q(null), oe = N(() => {
2741
2752
  if (!X.value)
2742
2753
  return e.purchaseOrders.value;
2743
2754
  const U = Vs.build(X.value);
2744
2755
  return e.purchaseOrders.value.filter((P) => {
2745
- var R, D, q, L;
2756
+ var R, D, M, L;
2746
2757
  return Ps(
2747
2758
  {
2748
2759
  netsuiteTransactionNumber: (D = (R = P.netSuite) == null ? void 0 : R.additionalInfo) == null ? void 0 : D.transactionnumber,
2749
- netsuiteOrderNo: (q = P.netSuite) == null ? void 0 : q.refNo,
2760
+ netsuiteOrderNo: (M = P.netSuite) == null ? void 0 : M.refNo,
2750
2761
  netsuiteOrderId: (L = P.netSuite) == null ? void 0 : L.id,
2751
2762
  status: P.status
2752
2763
  },
@@ -2761,26 +2772,26 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2761
2772
  actions: z.value,
2762
2773
  "onClick:action": _
2763
2774
  }, {
2764
- default: O(() => {
2765
- var D, q;
2775
+ default: A(() => {
2776
+ var D, M;
2766
2777
  return [
2767
2778
  l("div", {
2768
2779
  class: K([
2769
2780
  "flex flex-col gap-8 max-h-full",
2770
2781
  {
2771
- "p-0": c.value,
2772
- "px-24 ": !c.value
2782
+ "p-0": f.value,
2783
+ "px-24 ": !f.value
2773
2784
  }
2774
2785
  ])
2775
2786
  }, [
2776
- f(Wt, {
2787
+ p(Wt, {
2777
2788
  "date-range-query": "",
2778
- "date-range": r.value,
2779
- "onUpdate:dateRange": P[0] || (P[0] = (L) => r.value = L),
2789
+ "date-range": i.value,
2790
+ "onUpdate:dateRange": P[0] || (P[0] = (L) => i.value = L),
2780
2791
  searchable: "",
2781
2792
  "change-location": "",
2782
- search: m.value,
2783
- "onUpdate:search": P[1] || (P[1] = (L) => m.value = L),
2793
+ search: d.value,
2794
+ "onUpdate:search": P[1] || (P[1] = (L) => d.value = L),
2784
2795
  filterable: "",
2785
2796
  "filter-attributes": B.value,
2786
2797
  filter: X.value,
@@ -2788,46 +2799,46 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2788
2799
  }, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
2789
2800
  (x(), se(R, {
2790
2801
  style: Vt(t(I).tableHeight),
2791
- "column-defs": t(i),
2802
+ "column-defs": t(r),
2792
2803
  "row-data": oe.value,
2793
- "search-value": m.value,
2804
+ "search-value": d.value,
2794
2805
  loading: u.value,
2795
2806
  onRowClick: P[3] || (P[3] = (L) => t(e).promptShowTransferDetails(L.original)),
2796
- key: (D = t(b)._currentLocation) == null ? void 0 : D.dbName,
2797
- "page-size": y.value
2807
+ key: (D = t(y)._currentLocation) == null ? void 0 : D.dbName,
2808
+ "page-size": b.value
2798
2809
  }, {
2799
- "list-row": O((L) => [
2800
- f(Ot, {
2810
+ "list-row": A((L) => [
2811
+ p(At, {
2801
2812
  row: L,
2802
2813
  onRowClick: t(e).promptShowTransferDetails
2803
2814
  }, {
2804
- default: O((Z) => {
2805
- var w, F, Y, J, re, W, Fe, ge, ke, Ee, xe, je, Ie, $e, Qe, Ye, lt, Ke, Ce, qe;
2815
+ default: A((Z) => {
2816
+ var S, F, Y, J, re, W, Fe, ge, ke, Ee, xe, je, Ie, $e, Qe, Ye, lt, Ke, Ce, Me;
2806
2817
  return [
2807
- l("div", Aa, [
2808
- l("div", Oa, [
2809
- f(t(pe), {
2810
- render: (Y = (F = (w = Z._id) == null ? void 0 : w.column) == null ? void 0 : F.columnDef) == null ? void 0 : Y.cell,
2818
+ l("div", Oa, [
2819
+ l("div", Aa, [
2820
+ p(t(fe), {
2821
+ render: (Y = (F = (S = Z._id) == null ? void 0 : S.column) == null ? void 0 : F.columnDef) == null ? void 0 : Y.cell,
2811
2822
  props: (re = (J = Z._id) == null ? void 0 : J.getContext) == null ? void 0 : re.call(J)
2812
2823
  }, null, 8, ["render", "props"])
2813
2824
  ]),
2814
2825
  l("div", Ea, [
2815
- f(t(pe), {
2826
+ p(t(fe), {
2816
2827
  render: (ge = (Fe = (W = Z.supplier_name) == null ? void 0 : W.column) == null ? void 0 : Fe.columnDef) == null ? void 0 : ge.cell,
2817
2828
  props: (Ee = (ke = Z.supplier_name) == null ? void 0 : ke.getContext) == null ? void 0 : Ee.call(ke)
2818
2829
  }, null, 8, ["render", "props"])
2819
2830
  ]),
2820
- l("div", qa, E(L.original.items.map((s) => `${s.name}`).join(", ")), 1),
2821
- L.original.ref ? (x(), T("div", Ma, [
2822
- f(t(pe), {
2831
+ l("div", Ma, E(L.original.items.map((s) => `${s.name}`).join(", ")), 1),
2832
+ L.original.ref ? (x(), T("div", qa, [
2833
+ p(t(fe), {
2823
2834
  render: (Ie = (je = (xe = Z.ref) == null ? void 0 : xe.column) == null ? void 0 : je.columnDef) == null ? void 0 : Ie.cell,
2824
2835
  props: (Qe = ($e = Z.ref) == null ? void 0 : $e.getContext) == null ? void 0 : Qe.call($e)
2825
2836
  }, null, 8, ["render", "props"])
2826
2837
  ])) : Q("", !0),
2827
2838
  l("div", Na, [
2828
- f(t(pe), {
2839
+ p(t(fe), {
2829
2840
  render: (Ke = (lt = (Ye = Z.status) == null ? void 0 : Ye.column) == null ? void 0 : lt.columnDef) == null ? void 0 : Ke.cell,
2830
- props: (qe = (Ce = Z.status) == null ? void 0 : Ce.getContext) == null ? void 0 : qe.call(Ce)
2841
+ props: (Me = (Ce = Z.status) == null ? void 0 : Ce.getContext) == null ? void 0 : Me.call(Ce)
2831
2842
  }, null, 8, ["render", "props"])
2832
2843
  ])
2833
2844
  ])
@@ -2840,19 +2851,19 @@ const ia = { class: "flex flex-col flex-1" }, ua = { class: "flex flex-col" }, d
2840
2851
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2841
2852
  ], 2),
2842
2853
  (x(), se(Bt, { to: "body" }, [
2843
- f(na, ut(t(e).transferDialogProps.value, {
2854
+ p(na, ut(t(e).transferDialogProps.value, {
2844
2855
  onSubmitted: t(e).fetchData
2845
2856
  }), null, 16, ["onSubmitted"]),
2846
- f(es, ut({
2857
+ p(es, ut({
2847
2858
  scope: t(it).RECEIVE_REQUEST
2848
2859
  }, {
2849
2860
  ...t(e).transferDetailsProps.value,
2850
- receivedMap: ((q = t(e).transferDetailsProps.value) == null ? void 0 : q.receivedMap) ?? {},
2861
+ receivedMap: ((M = t(e).transferDetailsProps.value) == null ? void 0 : M.receivedMap) ?? {},
2851
2862
  shipments: t(e).shipments.value ?? []
2852
2863
  }, {
2853
2864
  onSubmitted: t(e).fetchData
2854
2865
  }), null, 16, ["scope", "onSubmitted"]),
2855
- f(Ra, Lt(Ht(t(e).xilnexImportDialogProps.value)), null, 16)
2866
+ p(Ra, Lt(Ht(t(e).xilnexImportDialogProps.value)), null, 16)
2856
2867
  ]))
2857
2868
  ];
2858
2869
  }),