@feedmepos/mf-inventory-portal 0.0.25-dev.25 → 0.0.25-dev.28

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{App-HeVEh7Ep.js → App-DSmyUe9i.js} +2 -2
  2. package/dist/{ApprovalView-DeSqFweb.js → ApprovalView-BEFFaX86.js} +2 -2
  3. package/dist/{BindingsDialog-CY1ik2CL.js → BindingsDialog-D-8BvojK.js} +2 -2
  4. package/dist/{BindingsPicker-OVu70GxT.js → BindingsPicker-Cy1yg1bG.js} +1 -1
  5. package/dist/{BindingsTable-DOaxNXxz.js → BindingsTable-Dhz8ONJT.js} +1 -1
  6. package/dist/ClosingDraftView-BAe-mbpn.js +1340 -0
  7. package/dist/{ClosingTemplateView-DpGmKrFQ.js → ClosingTemplateView-DzNurLwH.js} +2 -2
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D-BMsC_F.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DlyahP5t.js} +3 -3
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Cln7TklQ.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CLOyc7cd.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DIr84vbq.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-CPphZwgW.js} +1 -1
  11. package/dist/{IngredientGroupView-BbLrghMh.js → IngredientGroupView-B3VDBCV0.js} +1 -1
  12. package/dist/{IngredientsView-BKM9qEIF.js → IngredientsView-fH4XMnpj.js} +4 -4
  13. package/dist/{IntegrationView-pOKL4-cR.js → IntegrationView-BzDRH4Bb.js} +1 -1
  14. package/dist/{InventoryBindingForm-B4dvCfrN.js → InventoryBindingForm-UHqEY-qM.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUs-QqLE.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CA5CZZLs.js} +3 -3
  16. package/dist/{InventoryBindingSummary-CumZse8_.js → InventoryBindingSummary-BEG0ALdu.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CyaByq34.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D42I0B0D.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-Gi_l3b1b.js → PremiumBadge.vue_vue_type_script_setup_true_lang-G3lrGACK.js} +1 -1
  19. package/dist/{PublishView-BgG9ZgIk.js → PublishView-M59-kjB0.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-DpfzZA_2.js → PurchaseOrderPrintPreview-DqmHchcj.js} +1 -1
  21. package/dist/{ReceiveRequestView-D4AGH_9X.js → ReceiveRequestView-B0UIDOcH.js} +1029 -1016
  22. package/dist/{RecipeView-b7_VWiF5.js → RecipeView-BilboVDa.js} +3 -3
  23. package/dist/{StockView-CpmdtdaM.js → StockView-Cfn5imH5.js} +7 -7
  24. package/dist/{SupplierView-kP-VHXxg.js → SupplierView-CNGj0VUZ.js} +4 -4
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D7tCWaWG.js → TransferDetails.vue_vue_type_script_setup_true_lang-B19fXcww.js} +4 -4
  26. package/dist/{TransferTemplateView-6VYptKLp.js → TransferTemplateView-DzGNHKGY.js} +7 -7
  27. package/dist/{UnitView-0dwGJtEa.js → UnitView-Bf-w3APZ.js} +3 -3
  28. package/dist/{WarehouseView-B_gJu93_.js → WarehouseView-XorSVXc0.js} +1 -1
  29. package/dist/api/netsuite.d.ts +16 -0
  30. package/dist/{app-B7LBcQjr.js → app-fx2FK22w.js} +8239 -8220
  31. package/dist/app.js +1 -1
  32. package/dist/{decimal-BHxWezZv.js → decimal-BFVy6_IW.js} +1 -1
  33. package/dist/{feature-CXTyyrJi.js → feature-C2loTRTd.js} +139 -131
  34. package/dist/{format-unit-display-DS7raCkE.js → format-unit-display-BLRFNu3V.js} +2 -2
  35. package/dist/{index-53e38Cw1.js → index-Koid_wNd.js} +2 -2
  36. package/dist/{stock-DWv8TBvu.js → stock-Dx-ZW-_n.js} +1 -1
  37. package/dist/stores/feature.d.ts +4 -1
  38. package/dist/stores/integration/netsuite.d.ts +16 -0
  39. package/dist/{supplier-CXCmtqBP.js → supplier-DUp4Kl5Y.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-CthF_SeI.js → use-ingredient-select-dialog-DXFC8qWH.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-KvvkwQAC.js → use-inventory-binding-dialog-BXPkFjVT.js} +1 -1
  43. package/dist/views/closing-draft/helpers/export-draft.helper.d.ts +2 -2
  44. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +2 -0
  45. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -0
  46. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -0
  47. package/dist/views/receive-request/import/export.d.ts +2 -4
  48. package/dist/{vue-i18n-CmPwC7G-.js → vue-i18n-C6MVnEFi.js} +209 -209
  49. package/package.json +1 -1
  50. package/dist/ClosingDraftView-DOtFF2qU.js +0 -1308
@@ -1,36 +1,36 @@
1
- import { defineComponent as ae, onMounted as ze, onUnmounted as Et, renderSlot as qt, h as U, reactive as ht, computed as O, openBlock as k, createElementBlock as F, Fragment as ne, renderList as he, createElementVNode as l, toDisplayString as V, unref as s, resolveComponent as D, createVNode as b, withCtx as R, createCommentVNode as N, ref as q, createBlock as Q, watch as _e, normalizeClass as Z, createTextVNode as Ie, normalizeStyle as kt, nextTick as At, mergeProps as Xe, isRef as Ce, createSlots as Mt, Teleport as Ut, normalizeProps as Ot, guardReactiveProps as Nt } from "vue";
2
- import { H as Ze, J as Bt, Y as zt, Z as we, b as Le, l as Ve, i as ue, O as He, a0 as We, K as xt, as as Lt, A as Be, M as Ht, m as St, ab as et, E as ce, at as jt, a as tt, au as Qt, av as Yt, aw as Kt, G as st, u as je, ax as Xt, $ as Zt, T as Gt, ay as Jt, B as Ct, d as Re, v as Wt, w as es, x as ts, az as Ne, a5 as vt, y as ss, _ as os, z as ns, N as yt } from "./app-B7LBcQjr.js";
3
- import { u as ot, a as as, P as Ke, b as ls, _ as rs, g as is } from "./TransferDetails.vue_vue_type_script_setup_true_lang-D7tCWaWG.js";
4
- import { _ as wt, u as us, i as ms, e as ds } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-Gi_l3b1b.js";
5
- import { u as cs } from "./useTabStorage-BkIVScW_.js";
6
- import { useDialog as It, useBreakpoints as nt, components as de, FmButtonVariant as ps, useSnackbar as De, useProxiedModel as Ft } from "@feedmepos/ui-library";
7
- import { P as oe, u as $t } from "./format-unit-display-DS7raCkE.js";
8
- import { _ as Dt, F as Tt, a as Ge, b as Pt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Cln7TklQ.js";
9
- import { u as at } from "./feature-CXTyyrJi.js";
10
- import { c as ge, u as fs, _ as vs, l as ys } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D-BMsC_F.js";
11
- import { useI18n as pe } from "@feedmepos/mf-common";
12
- import { defineStore as bs } from "pinia";
13
- import { u as lt } from "./supplier-CXCmtqBP.js";
14
- import { _ as gs } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
15
- import { u as _s } from "./vue-i18n-CmPwC7G-.js";
1
+ import { defineComponent as ae, onMounted as Le, onUnmounted as At, renderSlot as Et, h as U, reactive as ht, computed as O, openBlock as S, createElementBlock as F, Fragment as ne, renderList as ge, createElementVNode as a, toDisplayString as q, unref as s, resolveComponent as D, createVNode as b, withCtx as R, createCommentVNode as N, ref as A, createBlock as Q, watch as be, normalizeClass as X, createTextVNode as Ie, normalizeStyle as kt, nextTick as Mt, mergeProps as Xe, isRef as Ce, createSlots as Ut, Teleport as Ot, normalizeProps as Nt, guardReactiveProps as Bt } from "vue";
2
+ import { H as Ze, J as zt, Y as Lt, Z as we, b as He, l as qe, i as me, a0 as Je, K as xt, as as Ht, A as ze, M as jt, m as St, ab as We, E as pe, at as Qt, a as et, au as Yt, av as Kt, aw as Xt, G as tt, O as st, u as je, ax as Zt, $ as Gt, T as Jt, ay as Wt, B as Ct, d as Re, v as es, w as ts, x as ss, az as Be, a5 as vt, y as os, _ as ns, z as as, N as yt } from "./app-fx2FK22w.js";
3
+ import { u as ot, a as ls, P as Ke, b as rs, _ as is, g as us } from "./TransferDetails.vue_vue_type_script_setup_true_lang-B19fXcww.js";
4
+ import { _ as wt, u as ms, i as ds, e as cs } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-G3lrGACK.js";
5
+ import { u as ps } from "./useTabStorage-BkIVScW_.js";
6
+ import { useDialog as It, useBreakpoints as nt, components as ce, FmButtonVariant as fs, useSnackbar as De, useProxiedModel as Ft } from "@feedmepos/ui-library";
7
+ import { P as oe, u as $t } from "./format-unit-display-BLRFNu3V.js";
8
+ import { _ as Dt, F as Tt, a as Vt, b as Pt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CLOyc7cd.js";
9
+ import { u as at } from "./feature-C2loTRTd.js";
10
+ import { c as ye, u as vs, _ as ys, l as bs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DlyahP5t.js";
11
+ import { useI18n as fe } from "@feedmepos/mf-common";
12
+ import { defineStore as gs } from "pinia";
13
+ import { u as lt } from "./supplier-DUp4Kl5Y.js";
14
+ import { _ as _s } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
15
+ import { u as hs } from "./vue-i18n-C6MVnEFi.js";
16
16
  import "./array-hChJVZLE.js";
17
- const hs = /* @__PURE__ */ ae({
17
+ const ks = /* @__PURE__ */ ae({
18
18
  __name: "MountListener",
19
19
  emits: ["mounted", "unmounted"],
20
20
  setup(f, { emit: x }) {
21
21
  const r = x;
22
- return ze(() => r("mounted")), Et(() => r("unmounted")), (i, S) => qt(i.$slots, "default");
22
+ return Le(() => r("mounted")), At(() => r("unmounted")), (l, C) => Et(l.$slots, "default");
23
23
  }
24
- }), Rt = bs("inventoryMultiSelectDialog", () => {
25
- const f = It(), { t: x } = pe();
26
- return { multiSelect: async (t, d, p) => {
27
- const u = p ?? ((e) => e), { promise: g, resolve: o } = Promise.withResolvers();
24
+ }), Rt = gs("inventoryMultiSelectDialog", () => {
25
+ const f = It(), { t: x } = fe();
26
+ return { multiSelect: async (t, m, d) => {
27
+ const u = d ?? ((e) => e), { promise: h, resolve: o } = Promise.withResolvers();
28
28
  return f.open({
29
29
  title: "Select items",
30
30
  closeButton: !0,
31
31
  contentComponent: Ze,
32
32
  contentComponentProps: {
33
- modelValue: d ?? [],
33
+ modelValue: m ?? [],
34
34
  items: t,
35
35
  virtualScroll: !0,
36
36
  onClose: () => o(null)
@@ -45,17 +45,17 @@ const hs = /* @__PURE__ */ ae({
45
45
  variant: "tertiary"
46
46
  }
47
47
  }).onPrimary((e) => {
48
- const a = e.map((m) => u(m));
49
- o(a);
50
- }), g;
51
- }, singleSelect: async (t, d, p) => {
52
- const u = p ?? ((e) => e), { promise: g, resolve: o } = Promise.withResolvers();
48
+ const i = e.map((c) => u(c));
49
+ o(i);
50
+ }), h;
51
+ }, singleSelect: async (t, m, d) => {
52
+ const u = d ?? ((e) => e), { promise: h, resolve: o } = Promise.withResolvers();
53
53
  return f.open({
54
54
  title: "Select items",
55
55
  closeButton: !0,
56
56
  contentComponent: Ze,
57
57
  contentComponentProps: {
58
- modelValue: d ? [d] : [],
58
+ modelValue: m ? [m] : [],
59
59
  items: t,
60
60
  virtualScroll: !0,
61
61
  onClose: () => o(void 0),
@@ -73,25 +73,25 @@ const hs = /* @__PURE__ */ ae({
73
73
  }).onPrimary((e) => {
74
74
  if (!e.length)
75
75
  return o(null);
76
- const a = u(e[0]);
77
- o(a);
78
- }), g;
79
- }, confirmation: async (t, d, p, u, g) => {
76
+ const i = u(e[0]);
77
+ o(i);
78
+ }), h;
79
+ }, confirmation: async (t, m, d, u, h) => {
80
80
  const { promise: o, resolve: e } = Promise.withResolvers();
81
81
  return f.open({
82
82
  title: t,
83
- message: typeof d == "string" ? d : void 0,
83
+ message: typeof m == "string" ? m : void 0,
84
84
  contentComponent: U(
85
- hs,
85
+ ks,
86
86
  {
87
87
  onUnmounted: () => {
88
88
  e(null);
89
89
  }
90
90
  },
91
- d
91
+ m
92
92
  ),
93
93
  contentComponentProps: {},
94
- primaryActions: p ?? {
94
+ primaryActions: d ?? {
95
95
  text: x("common.confirm"),
96
96
  close: !0
97
97
  },
@@ -100,26 +100,26 @@ const hs = /* @__PURE__ */ ae({
100
100
  close: !0,
101
101
  variant: "tertiary"
102
102
  },
103
- tertiaryActions: g,
103
+ tertiaryActions: h,
104
104
  closeButton: !0,
105
105
  dismissAway: !0
106
106
  }).onPrimary(() => {
107
- e((p == null ? void 0 : p.value) ?? !0);
107
+ e((d == null ? void 0 : d.value) ?? !0);
108
108
  }).onSecondary(() => {
109
109
  e((u == null ? void 0 : u.value) ?? !1);
110
110
  }).onTertiary(() => {
111
- e((g == null ? void 0 : g.value) ?? void 0);
111
+ e((h == null ? void 0 : h.value) ?? void 0);
112
112
  }), o;
113
113
  } };
114
114
  });
115
- function Je(f) {
115
+ function Ge(f) {
116
116
  return f.reduce((x, r) => {
117
- const i = r.measurement ? Bt(r.quantity, r.measurement.conversion) : r.quantity;
118
- return zt(x, i);
117
+ const l = r.measurement ? zt(r.quantity, r.measurement.conversion) : r.quantity;
118
+ return Lt(x, l);
119
119
  }, we.reset());
120
120
  }
121
- var X = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.TemplateName = "TemplateName", f.Amount = "Amount", f.Cost = "Cost", f.Delete = "Delete", f))(X || {});
122
- const ks = () => (pe(), U(
121
+ var K = /* @__PURE__ */ ((f) => (f.Code = "Code", f.Name = "Name", f.TemplateName = "TemplateName", f.Amount = "Amount", f.Cost = "Cost", f.Delete = "Delete", f))(K || {});
122
+ const xs = () => (fe(), U(
123
123
  wt,
124
124
  {
125
125
  zIndex: 50,
@@ -127,21 +127,21 @@ const ks = () => (pe(), U(
127
127
  },
128
128
  `Total (${St()})`
129
129
  ));
130
- function xs(f) {
131
- const { t: x } = pe(), r = ht({}), { breakpoints: i } = nt(), S = at(), t = Le(), d = Rt();
132
- ze(() => {
130
+ function Ss(f) {
131
+ const { t: x } = fe(), r = ht({}), { breakpoints: l } = nt(), C = at(), t = He(), m = Rt();
132
+ Le(() => {
133
133
  for (const o of f.items) {
134
134
  if (!o.totalCost)
135
135
  continue;
136
- const e = ge(o.sku, o.quantity, o.measurement, {
136
+ const e = ye(o.sku, o.quantity, o.measurement, {
137
137
  supplier: f.supplier
138
- }), a = o.totalCost ?? we.reset();
139
- e ? r[o.sku._id] = e.amount !== a.amount || e.precision !== a.precision : r[o.sku._id] = !0;
138
+ }), i = o.totalCost ?? we.reset();
139
+ e ? r[o.sku._id] = e.amount !== i.amount || e.precision !== i.precision : r[o.sku._id] = !0;
140
140
  }
141
141
  });
142
- function p(o) {
143
- var a, m, v, h, I, c, y;
144
- return !!(((m = (a = o.defaultCost) == null ? void 0 : a.costPerUnit) == null ? void 0 : m.amount) ?? ((y = (c = (I = (h = (v = f.supplier) == null ? void 0 : v.supplyItems) == null ? void 0 : h.find((E) => E.skuId === o._id)) == null ? void 0 : I.defaultCost) == null ? void 0 : c.costPerUnit) == null ? void 0 : y.amount));
142
+ function d(o) {
143
+ var i, c, y, k, I, v, p;
144
+ return !!(((c = (i = o.defaultCost) == null ? void 0 : i.costPerUnit) == null ? void 0 : c.amount) ?? ((p = (v = (I = (k = (y = f.supplier) == null ? void 0 : y.supplyItems) == null ? void 0 : k.find((V) => V.skuId === o._id)) == null ? void 0 : I.defaultCost) == null ? void 0 : v.costPerUnit) == null ? void 0 : p.amount));
145
145
  }
146
146
  const u = [
147
147
  {
@@ -150,14 +150,14 @@ function xs(f) {
150
150
  accessorKey: "code",
151
151
  size: 200,
152
152
  cell(o) {
153
- var a;
153
+ var i;
154
154
  const e = o.row.original;
155
- return (a = e.subItems) != null && a.length ? U(
155
+ return (i = e.subItems) != null && i.length ? U(
156
156
  "span",
157
157
  { class: "text-fm-color-typo-primary fm-typo-en-body-md-600 line-clamp-1" },
158
158
  e.sku.code
159
159
  ) : t.isEnabled ? U(
160
- de.FmTooltip,
160
+ ce.FmTooltip,
161
161
  {
162
162
  content: e.code,
163
163
  placement: "top",
@@ -171,16 +171,16 @@ function xs(f) {
171
171
  },
172
172
  e.code
173
173
  )
174
- ) : U(de.FmTextField, {
174
+ ) : U(ce.FmTextField, {
175
175
  modelValue: e.code,
176
- "onUpdate:modelValue": (m) => {
176
+ "onUpdate:modelValue": (c) => {
177
177
  f.updateItem({
178
178
  ...e,
179
- code: m
179
+ code: c
180
180
  });
181
181
  },
182
182
  key: e.sku._id,
183
- rules: [Ve()],
183
+ rules: [qe()],
184
184
  labelMark: "required"
185
185
  });
186
186
  },
@@ -191,14 +191,14 @@ function xs(f) {
191
191
  header: () => x("inventory.transfer.form.items.table.Name"),
192
192
  minSize: 300,
193
193
  cell(o) {
194
- var a;
194
+ var i;
195
195
  const e = o.row.original;
196
- return (a = e.subItems) != null && a.length ? U(
196
+ return (i = e.subItems) != null && i.length ? U(
197
197
  "span",
198
198
  { class: "text-fm-color-typo-primary fm-typo-en-body-md-600 line-clamp-1" },
199
199
  e.sku.name
200
200
  ) : t.isEnabled ? U(
201
- de.FmTooltip,
201
+ ce.FmTooltip,
202
202
  {
203
203
  content: e.name,
204
204
  placement: "top",
@@ -212,16 +212,16 @@ function xs(f) {
212
212
  },
213
213
  e.name
214
214
  )
215
- ) : U(de.FmTextField, {
215
+ ) : U(ce.FmTextField, {
216
216
  modelValue: e.name,
217
- "onUpdate:modelValue": (m) => {
217
+ "onUpdate:modelValue": (c) => {
218
218
  f.updateItem({
219
219
  ...e,
220
- name: m
220
+ name: c
221
221
  });
222
222
  },
223
223
  key: e.sku._id,
224
- rules: [Ve()],
224
+ rules: [qe()],
225
225
  labelMark: "required"
226
226
  });
227
227
  },
@@ -233,10 +233,10 @@ function xs(f) {
233
233
  minSize: 300,
234
234
  enableSorting: !1,
235
235
  cell(o) {
236
- var v, h;
237
- const e = o.row.original, a = (v = e.subItems) != null && v.length ? e.sku.code : e.code, m = (h = e.subItems) != null && h.length ? e.sku.name : e.name;
236
+ var y, k;
237
+ const e = o.row.original, i = (y = e.subItems) != null && y.length ? e.sku.code : e.code, c = (k = e.subItems) != null && k.length ? e.sku.name : e.name;
238
238
  return U(
239
- de.FmTooltip,
239
+ ce.FmTooltip,
240
240
  { zIndex: 50 },
241
241
  {
242
242
  default() {
@@ -244,19 +244,19 @@ function xs(f) {
244
244
  U(
245
245
  "div",
246
246
  { class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-primary" },
247
- m
247
+ c
248
248
  ),
249
249
  U(
250
250
  "div",
251
251
  {
252
252
  class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
253
253
  },
254
- a
254
+ i
255
255
  )
256
256
  ]);
257
257
  },
258
258
  content() {
259
- return m;
259
+ return c;
260
260
  }
261
261
  }
262
262
  );
@@ -267,10 +267,10 @@ function xs(f) {
267
267
  header: () => x("inventory.transfer.form.items.table.Amount"),
268
268
  minSize: 200,
269
269
  cell(o) {
270
- var m, v, h, I;
270
+ var c, y, k, I, v;
271
271
  const e = o.row.original;
272
- if ((m = e.subItems) != null && m.length) {
273
- const c = Je(e.subItems);
272
+ if ((c = e.subItems) != null && c.length) {
273
+ const p = Ge(e.subItems);
274
274
  return U(
275
275
  "span",
276
276
  {
@@ -281,13 +281,13 @@ function xs(f) {
281
281
  U(
282
282
  "span",
283
283
  { class: " fm-typo-en-body-md-600" },
284
- `${ue(c)} ${e.sku.unit.abbrev}`
284
+ `${me(p)} ${e.sku.unit.abbrev}`
285
285
  )
286
286
  ]
287
287
  );
288
288
  }
289
- const a = (I = (h = (v = f.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : h.items) == null ? void 0 : I.find(
290
- (c) => c.sku._id === e.sku._id
289
+ const i = (I = (k = (y = f.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : I.find(
290
+ (p) => p.sku._id === e.sku._id
291
291
  );
292
292
  return U(Dt, {
293
293
  style: {
@@ -299,35 +299,32 @@ function xs(f) {
299
299
  },
300
300
  key: e.sku._id,
301
301
  unit: e.sku.unit,
302
- "onUpdate:modelValue": (c) => {
303
- const y = {
302
+ "onUpdate:modelValue": (p) => {
303
+ const V = {
304
304
  ...e,
305
- quantity: c.amount,
306
- measurement: c.measurement
305
+ quantity: p.amount,
306
+ measurement: p.measurement
307
307
  };
308
- S.enableTotalCost && (y.totalCost = ge(e.sku, e.quantity, e.measurement, {
308
+ C.enableTotalCost && (V.totalCost = ye(e.sku, e.quantity, e.measurement, {
309
309
  supplier: f.supplier,
310
310
  // NOTE: set undefined here if `manualTotalCost[row.sku._id] = false`, so that the function
311
311
  // will return the auto calculated default cost instead of the manual total cost
312
- manualTotalCost: r[e.sku._id] ? y.totalCost : void 0
313
- })), f.updateItem(y);
312
+ manualTotalCost: r[e.sku._id] ? V.totalCost : void 0
313
+ })), f.updateItem(V);
314
314
  },
315
- stepper: a == null ? void 0 : a.quantityStep,
316
- disableUnit: !!a,
315
+ stepper: i == null ? void 0 : i.quantityStep,
316
+ disableUnit: !!i,
317
317
  disabled: f.disabled,
318
318
  rules: [
319
319
  Tt(
320
- +ue(
321
- (a != null && a.minimumQuantity && (a == null ? void 0 : a.minimumQuantity.amount) > 0 ? a == null ? void 0 : a.minimumQuantity : void 0) ?? {
322
- amount: 1,
323
- precision: He(e.sku.unit, e.measurement)
324
- }
320
+ +me(
321
+ ((v = e.quantity) == null ? void 0 : v.amount) === 0 ? { amount: 0, precision: 0 } : (i == null ? void 0 : i.minimumQuantity) ?? { amount: 0, precision: 0 }
325
322
  )
326
323
  ),
327
- a != null && a.maximumQuantity ? Ge(
328
- +ue(a == null ? void 0 : a.maximumQuantity)
329
- ) : Ge(1 / 0),
330
- ...a != null && a.quantityStep ? [Pt(a.quantityStep)] : []
324
+ Vt(
325
+ i != null && i.maximumQuantity ? +me(i == null ? void 0 : i.maximumQuantity) : 1 / 0
326
+ ),
327
+ ...i != null && i.quantityStep ? [Pt(i.quantityStep)] : []
331
328
  ],
332
329
  applyDefaultRules: !0
333
330
  });
@@ -336,11 +333,11 @@ function xs(f) {
336
333
  },
337
334
  {
338
335
  id: "Cost",
339
- header: ks,
336
+ header: xs,
340
337
  size: 180,
341
338
  cell(o) {
342
- const e = o.row.original, a = p(e.sku), m = i.value.xs || i.value.sm;
343
- return !r[e.sku._id] && a ? U(
339
+ const e = o.row.original, i = d(e.sku), c = l.value.xs || l.value.sm;
340
+ return !r[e.sku._id] && i ? U(
344
341
  "div",
345
342
  {
346
343
  class: [
@@ -350,14 +347,14 @@ function xs(f) {
350
347
  key: e.sku._id
351
348
  },
352
349
  [
353
- U(de.FmButton, {
350
+ U(ce.FmButton, {
354
351
  prependIcon: "edit",
355
- variant: ps.Tertiary,
352
+ variant: fs.Tertiary,
356
353
  disabled: f.disabled,
357
354
  onClick() {
358
355
  f.updateItem({
359
356
  ...e,
360
- totalCost: ge(e.sku, e.quantity, e.measurement, {
357
+ totalCost: ye(e.sku, e.quantity, e.measurement, {
361
358
  supplier: f.supplier
362
359
  })
363
360
  }), r[e.sku._id] = !0;
@@ -371,12 +368,12 @@ function xs(f) {
371
368
  [
372
369
  U(
373
370
  "span",
374
- m ? We(
375
- ge(e.sku, e.quantity, e.measurement, {
371
+ c ? Je(
372
+ ye(e.sku, e.quantity, e.measurement, {
376
373
  supplier: f.supplier
377
374
  })
378
- ) : ue(
379
- ge(e.sku, e.quantity, e.measurement, {
375
+ ) : me(
376
+ ye(e.sku, e.quantity, e.measurement, {
380
377
  supplier: f.supplier
381
378
  })
382
379
  )
@@ -395,24 +392,24 @@ function xs(f) {
395
392
  )
396
393
  ]
397
394
  ) : U(
398
- de.FmTextField,
395
+ ce.FmTextField,
399
396
  {
400
- modelValue: ue(e.totalCost ?? { amount: 0, precision: 0 }),
397
+ modelValue: me(e.totalCost ?? { amount: 0, precision: 0 }),
401
398
  key: e.sku._id,
402
- "onUpdate:modelValue": (v) => {
399
+ "onUpdate:modelValue": (y) => {
403
400
  f.updateItem({
404
401
  ...e,
405
402
  totalCost: {
406
- ...xt(+v),
407
- currency: Lt()
403
+ ...xt(+y),
404
+ currency: Ht()
408
405
  }
409
406
  });
410
407
  },
411
- rules: [Be(0), Ht(2)]
408
+ rules: [ze(0), jt(2)]
412
409
  },
413
410
  {
414
411
  prepend() {
415
- return m ? U(
412
+ return c ? U(
416
413
  "div",
417
414
  {
418
415
  class: [
@@ -424,7 +421,7 @@ function xs(f) {
424
421
  ) : null;
425
422
  },
426
423
  append() {
427
- return a ? U(de.FmButton, {
424
+ return i ? U(ce.FmButton, {
428
425
  prependIcon: "close",
429
426
  variant: "tertiary",
430
427
  disabled: f.disabled,
@@ -433,7 +430,7 @@ function xs(f) {
433
430
  ...e,
434
431
  // NOTE: different from PO template, if a default cost is reenabled,
435
432
  // the total cost will automatically assigned
436
- totalCost: ge(e.sku, e.quantity, e.measurement, {
433
+ totalCost: ye(e.sku, e.quantity, e.measurement, {
437
434
  supplier: f.supplier
438
435
  })
439
436
  }), r[e.sku._id] = !1;
@@ -449,13 +446,13 @@ function xs(f) {
449
446
  id: "Delete",
450
447
  header: "",
451
448
  cell(o) {
452
- var v, h, I;
453
- const e = o.row.original, a = (I = (h = (v = f.template) == null ? void 0 : v.purchaseOrder) == null ? void 0 : h.items) == null ? void 0 : I.find(
454
- (c) => c.sku._id === e.sku._id
455
- ), m = (a == null ? void 0 : a.subItems) ?? [];
449
+ var y, k, I;
450
+ const e = o.row.original, i = (I = (k = (y = f.template) == null ? void 0 : y.purchaseOrder) == null ? void 0 : k.items) == null ? void 0 : I.find(
451
+ (v) => v.sku._id === e.sku._id
452
+ ), c = (i == null ? void 0 : i.subItems) ?? [];
456
453
  return U("div", { class: "flex justify-end" }, [
457
- ...m.length ? [
458
- U(de.FmButton, {
454
+ ...c.length ? [
455
+ U(ce.FmButton, {
459
456
  key: e.sku._id,
460
457
  type: "button",
461
458
  icon: "add_circle",
@@ -464,24 +461,24 @@ function xs(f) {
464
461
  disabled: f.disabled,
465
462
  onClick: async () => {
466
463
  var L;
467
- const c = ((L = e.subItems) == null ? void 0 : L.map(($) => $.id)) ?? [], y = m.map(
464
+ const v = ((L = e.subItems) == null ? void 0 : L.map(($) => $.id)) ?? [], p = c.map(
468
465
  ($) => ({
469
466
  label: $.name,
470
467
  sublabel: $.code,
471
468
  value: $.id
472
469
  })
473
- ), E = await d.multiSelect(y, c, ($) => {
470
+ ), V = await m.multiSelect(p, v, ($) => {
474
471
  var T;
475
- return ((T = e.subItems) == null ? void 0 : T.find((Y) => Y.id === $)) ?? m.find((Y) => Y.id === $);
472
+ return ((T = e.subItems) == null ? void 0 : T.find((Y) => Y.id === $)) ?? c.find((Y) => Y.id === $);
476
473
  }).then(($) => $ == null ? void 0 : $.filter((T) => T).map((T) => T));
477
- E && f.updateItem({
474
+ V && f.updateItem({
478
475
  ...e,
479
- subItems: E.length ? E : null
476
+ subItems: V.length ? V : null
480
477
  });
481
478
  }
482
479
  })
483
480
  ] : [],
484
- U(de.FmButton, {
481
+ U(ce.FmButton, {
485
482
  key: e.sku._id,
486
483
  class: "delete-button",
487
484
  type: "button",
@@ -504,47 +501,47 @@ function xs(f) {
504
501
  }
505
502
  ];
506
503
  return {
507
- columnDefs: O(() => S.enableTotalCost && f.transferType === oe.PURCHASE ? u : u.filter(
504
+ columnDefs: O(() => C.enableTotalCost && f.transferType === oe.PURCHASE ? u : u.filter(
508
505
  (o) => o.id !== "Cost"
509
506
  /* Cost */
510
507
  ))
511
508
  };
512
509
  }
513
- const Ss = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, Cs = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, ws = { class: "w-[450px] xs:w-full flex" }, Is = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Fs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Vt = /* @__PURE__ */ ae({
510
+ const Cs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, ws = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, Is = { class: "w-[450px] xs:w-full flex" }, Fs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, $s = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qt = /* @__PURE__ */ ae({
514
511
  __name: "SupplierPriceHistory",
515
512
  props: {
516
513
  prices: {}
517
514
  },
518
515
  setup(f) {
519
516
  const x = lt();
520
- function r(i) {
521
- return x.suppliers.find((S) => S._id === i);
517
+ function r(l) {
518
+ return x.suppliers.find((C) => C._id === l);
522
519
  }
523
- return (i, S) => (k(), F("div", Ss, [
524
- (k(!0), F(ne, null, he(Object.keys(i.prices), (t) => {
525
- var d;
526
- return k(), F("div", {
520
+ return (l, C) => (S(), F("div", Cs, [
521
+ (S(!0), F(ne, null, ge(Object.keys(l.prices), (t) => {
522
+ var m;
523
+ return S(), F("div", {
527
524
  key: t,
528
525
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
529
526
  }, [
530
- l("div", Cs, V((d = r(t)) == null ? void 0 : d.name), 1),
531
- l("div", ws, [
532
- (k(!0), F(ne, null, he(i.prices[t].slice(0, 3), (p) => {
527
+ a("div", ws, q((m = r(t)) == null ? void 0 : m.name), 1),
528
+ a("div", Is, [
529
+ (S(!0), F(ne, null, ge(l.prices[t].slice(0, 3), (d) => {
533
530
  var u;
534
- return k(), F("div", {
535
- key: p.date,
531
+ return S(), F("div", {
532
+ key: d.date,
536
533
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
537
534
  }, [
538
- l("div", Is, [
539
- l("span", null, V(p.totalCost ? s(We)(p.totalCost) : "No data"), 1),
540
- S[0] || (S[0] = l("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
541
- l("span", null, V(s(ue)(p.totalUnit, !1)), 1),
542
- l("span", null, V(((u = p.measurement) == null ? void 0 : u.abbrev) ?? p.unit.abbrev), 1)
535
+ a("div", Fs, [
536
+ a("span", null, q(d.totalCost ? s(Je)(d.totalCost) : "No data"), 1),
537
+ C[0] || (C[0] = a("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
538
+ a("span", null, q(s(me)(d.totalUnit, !1)), 1),
539
+ a("span", null, q(((u = d.measurement) == null ? void 0 : u.abbrev) ?? d.unit.abbrev), 1)
543
540
  ]),
544
- l("div", Fs, [
545
- l("span", null, "(#" + V(p.seqNumber) + ")", 1),
546
- S[1] || (S[1] = l("span", null, V(" "), -1)),
547
- l("span", null, V(s(et)(new Date(p.date))), 1)
541
+ a("div", $s, [
542
+ a("span", null, "(#" + q(d.seqNumber) + ")", 1),
543
+ C[1] || (C[1] = a("span", null, q(" "), -1)),
544
+ a("span", null, q(s(We)(new Date(d.date))), 1)
548
545
  ])
549
546
  ]);
550
547
  }), 128))
@@ -553,10 +550,10 @@ const Ss = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
553
550
  }), 128))
554
551
  ]));
555
552
  }
556
- }), $s = { class: "flex flex-col gap-8 py-16" }, Ds = { class: "flex items-center" }, Ts = { class: "flex-1 flex gap-1 items-center" }, Ps = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Vs = { class: "flex gap-8 w-full" }, Es = { class: "flex-1 flex flex-col gap-4" }, qs = { class: "flex-1 flex flex-col gap-4" }, As = { class: "flex gap-8 w-full" }, Ms = { class: "flex-1 flex flex-col gap-4" }, Us = {
553
+ }), Ds = { class: "flex flex-col gap-8 py-16" }, Ts = { class: "flex items-center" }, Vs = { class: "flex-1 flex gap-1 items-center" }, Ps = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Rs = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, qs = { class: "flex gap-8 w-full" }, As = { class: "flex-1 flex flex-col gap-4" }, Es = { class: "flex-1 flex flex-col gap-4" }, Ms = { class: "flex gap-8 w-full" }, Us = { class: "flex-1 flex flex-col gap-4" }, Os = {
557
554
  key: 0,
558
555
  class: "flex-1 flex flex-col gap-4"
559
- }, Os = /* @__PURE__ */ ae({
556
+ }, Ns = /* @__PURE__ */ ae({
560
557
  __name: "TransferItem",
561
558
  props: {
562
559
  cellByColId: {},
@@ -565,75 +562,75 @@ const Ss = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
565
562
  row: {}
566
563
  },
567
564
  setup(f) {
568
- const { t: x } = pe();
569
- return (r, i) => {
570
- var d, p, u, g, o, e, a, m, v, h, I, c, y, E, L, $, T, Y, z, A, j, B, G, C, _, M, J;
571
- const S = D("FmLabel"), t = D("FmSpacer");
572
- return k(), F("div", $s, [
573
- l("div", Ds, [
574
- l("div", Ts, [
575
- l("span", Ps, " (" + V(r.row.original.sku.code) + ") ", 1),
576
- l("span", Rs, V(r.row.original.sku.name), 1)
565
+ const { t: x } = fe();
566
+ return (r, l) => {
567
+ var m, d, u, h, o, e, i, c, y, k, I, v, p, V, L, $, T, Y, z, E, j, B, G, _, g, M, J;
568
+ const C = D("FmLabel"), t = D("FmSpacer");
569
+ return S(), F("div", Ds, [
570
+ a("div", Ts, [
571
+ a("div", Vs, [
572
+ a("span", Ps, " (" + q(r.row.original.sku.code) + ") ", 1),
573
+ a("span", Rs, q(r.row.original.sku.name), 1)
577
574
  ]),
578
- l("div", null, [
579
- b(s(ce), {
580
- render: (u = (p = (d = r.cellByColId.Delete) == null ? void 0 : d.column) == null ? void 0 : p.columnDef) == null ? void 0 : u.cell,
581
- props: (o = (g = r.cellByColId.Delete) == null ? void 0 : g.getContext) == null ? void 0 : o.call(g)
575
+ a("div", null, [
576
+ b(s(pe), {
577
+ render: (u = (d = (m = r.cellByColId.Delete) == null ? void 0 : m.column) == null ? void 0 : d.columnDef) == null ? void 0 : u.cell,
578
+ props: (o = (h = r.cellByColId.Delete) == null ? void 0 : h.getContext) == null ? void 0 : o.call(h)
582
579
  }, null, 8, ["render", "props"])
583
580
  ])
584
581
  ]),
585
- l("div", Vs, [
586
- l("div", Es, [
587
- b(S, {
588
- label: s(x)(`inventory.transfer.form.items.table.${s(X).Code}`)
582
+ a("div", qs, [
583
+ a("div", As, [
584
+ b(C, {
585
+ label: s(x)(`inventory.transfer.form.items.table.${s(K).Code}`)
589
586
  }, null, 8, ["label"]),
590
- b(s(ce), {
591
- render: (m = (a = (e = r.cellByColId[s(X).Code]) == null ? void 0 : e.column) == null ? void 0 : a.columnDef) == null ? void 0 : m.cell,
592
- props: (h = (v = r.cellByColId[s(X).Code]) == null ? void 0 : v.getContext) == null ? void 0 : h.call(v)
587
+ b(s(pe), {
588
+ render: (c = (i = (e = r.cellByColId[s(K).Code]) == null ? void 0 : e.column) == null ? void 0 : i.columnDef) == null ? void 0 : c.cell,
589
+ props: (k = (y = r.cellByColId[s(K).Code]) == null ? void 0 : y.getContext) == null ? void 0 : k.call(y)
593
590
  }, null, 8, ["render", "props"]),
594
- i[0] || (i[0] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
591
+ l[0] || (l[0] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
595
592
  ]),
596
- l("div", qs, [
597
- b(S, {
598
- label: s(x)(`inventory.transfer.form.items.table.${s(X).Name}`)
593
+ a("div", Es, [
594
+ b(C, {
595
+ label: s(x)(`inventory.transfer.form.items.table.${s(K).Name}`)
599
596
  }, null, 8, ["label"]),
600
- b(s(ce), {
601
- render: (y = (c = (I = r.cellByColId[s(X).Name]) == null ? void 0 : I.column) == null ? void 0 : c.columnDef) == null ? void 0 : y.cell,
602
- props: (L = (E = r.cellByColId[s(X).Name]) == null ? void 0 : E.getContext) == null ? void 0 : L.call(E)
597
+ b(s(pe), {
598
+ render: (p = (v = (I = r.cellByColId[s(K).Name]) == null ? void 0 : I.column) == null ? void 0 : v.columnDef) == null ? void 0 : p.cell,
599
+ props: (L = (V = r.cellByColId[s(K).Name]) == null ? void 0 : V.getContext) == null ? void 0 : L.call(V)
603
600
  }, null, 8, ["render", "props"]),
604
- i[1] || (i[1] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
601
+ l[1] || (l[1] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
605
602
  ])
606
603
  ]),
607
- l("div", As, [
608
- l("div", Ms, [
609
- b(S, {
610
- label: s(x)(`inventory.transfer.form.items.table.${s(X).Amount}`)
604
+ a("div", Ms, [
605
+ a("div", Us, [
606
+ b(C, {
607
+ label: s(x)(`inventory.transfer.form.items.table.${s(K).Amount}`)
611
608
  }, null, 8, ["label"]),
612
- b(s(ce), {
613
- render: (Y = (T = ($ = r.cellByColId[s(X).Amount]) == null ? void 0 : $.column) == null ? void 0 : T.columnDef) == null ? void 0 : Y.cell,
614
- props: (A = (z = r.cellByColId[s(X).Amount]) == null ? void 0 : z.getContext) == null ? void 0 : A.call(z)
609
+ b(s(pe), {
610
+ render: (Y = (T = ($ = r.cellByColId[s(K).Amount]) == null ? void 0 : $.column) == null ? void 0 : T.columnDef) == null ? void 0 : Y.cell,
611
+ props: (E = (z = r.cellByColId[s(K).Amount]) == null ? void 0 : z.getContext) == null ? void 0 : E.call(z)
615
612
  }, null, 8, ["render", "props"]),
616
- i[2] || (i[2] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
613
+ l[2] || (l[2] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
617
614
  ]),
618
- r.cellByColId[s(X).Cost] ? (k(), F("div", Us, [
615
+ r.cellByColId[s(K).Cost] ? (S(), F("div", Os, [
619
616
  b(wt, { "z-index": 50 }, {
620
617
  default: R(() => [
621
- b(S, {
622
- label: s(x)(`inventory.transfer.form.items.table.${s(X).Cost}2`)
618
+ b(C, {
619
+ label: s(x)(`inventory.transfer.form.items.table.${s(K).Cost}2`)
623
620
  }, null, 8, ["label"])
624
621
  ]),
625
622
  _: 1
626
623
  }),
627
- b(s(ce), {
628
- render: (G = (B = (j = r.cellByColId[s(X).Cost]) == null ? void 0 : j.column) == null ? void 0 : B.columnDef) == null ? void 0 : G.cell,
629
- props: (_ = (C = r.cellByColId[s(X).Cost]) == null ? void 0 : C.getContext) == null ? void 0 : _.call(C)
624
+ b(s(pe), {
625
+ render: (G = (B = (j = r.cellByColId[s(K).Cost]) == null ? void 0 : j.column) == null ? void 0 : B.columnDef) == null ? void 0 : G.cell,
626
+ props: (g = (_ = r.cellByColId[s(K).Cost]) == null ? void 0 : _.getContext) == null ? void 0 : g.call(_)
630
627
  }, null, 8, ["render", "props"]),
631
- i[3] || (i[3] = l("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
628
+ l[3] || (l[3] = a("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
632
629
  ])) : N("", !0)
633
630
  ]),
634
- r.showComparePrice && Object.keys(r.comparePriceBySku[(M = r.row.original.sku) == null ? void 0 : M._id] ?? {}).length > 0 ? (k(), F(ne, { key: 0 }, [
631
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(M = r.row.original.sku) == null ? void 0 : M._id] ?? {}).length > 0 ? (S(), F(ne, { key: 0 }, [
635
632
  b(t, { class: "h-8" }),
636
- b(Vt, {
633
+ b(qt, {
637
634
  prices: r.comparePriceBySku[(J = r.row.original.sku) == null ? void 0 : J._id]
638
635
  }, null, 8, ["prices"])
639
636
  ], 64)) : N("", !0)
@@ -641,7 +638,7 @@ const Ss = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
641
638
  };
642
639
  }
643
640
  });
644
- function Ns(f) {
641
+ function Bs(f) {
645
642
  const x = O({
646
643
  get() {
647
644
  const t = f.getEffectiveAt();
@@ -657,35 +654,35 @@ function Ns(f) {
657
654
  set(t) {
658
655
  t ? x.value = /* @__PURE__ */ new Date() : x.value = null;
659
656
  }
660
- }), i = O({
657
+ }), l = O({
661
658
  get() {
662
- return x.value === null ? "" : et(x.value);
659
+ return x.value === null ? "" : We(x.value);
663
660
  },
664
661
  set(t) {
665
- t ? x.value = /* @__PURE__ */ new Date(`${t} ${S.value}`) : x.value = null;
662
+ t ? x.value = /* @__PURE__ */ new Date(`${t} ${C.value}`) : x.value = null;
666
663
  }
667
- }), S = O({
664
+ }), C = O({
668
665
  get() {
669
- return x.value === null ? "" : jt(x.value);
666
+ return x.value === null ? "" : Qt(x.value);
670
667
  },
671
668
  set(t) {
672
- t ? x.value = /* @__PURE__ */ new Date(`${i.value} ${t}`) : x.value = null;
669
+ t ? x.value = /* @__PURE__ */ new Date(`${l.value} ${t}`) : x.value = null;
673
670
  }
674
671
  });
675
672
  return {
676
673
  backdatePo: x,
677
674
  backdateSwitch: r,
678
- backdateModel: i,
679
- backdateTimeModel: S
675
+ backdateModel: l,
676
+ backdateTimeModel: C
680
677
  };
681
678
  }
682
- const Bs = {
679
+ const zs = {
683
680
  width: "24",
684
681
  height: "24",
685
682
  viewBox: "0 0 24 24",
686
683
  fill: "none",
687
684
  xmlns: "http://www.w3.org/2000/svg"
688
- }, zs = ["fill"], Ls = ["fill"], Hs = ["stroke"], js = ["stroke"], Qs = /* @__PURE__ */ ae({
685
+ }, Ls = ["fill"], Hs = ["fill"], js = ["stroke"], Qs = ["stroke"], Ys = /* @__PURE__ */ ae({
689
686
  __name: "SparkIcon",
690
687
  props: {
691
688
  size: {
@@ -698,78 +695,78 @@ const Bs = {
698
695
  }
699
696
  },
700
697
  setup(f) {
701
- return (x, r) => (k(), F("svg", Bs, [
702
- l("path", {
698
+ return (x, r) => (S(), F("svg", zs, [
699
+ a("path", {
703
700
  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",
704
701
  fill: f.color
705
- }, null, 8, zs),
706
- l("path", {
702
+ }, null, 8, Ls),
703
+ a("path", {
707
704
  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",
708
705
  fill: f.color
709
- }, null, 8, Ls),
710
- l("path", {
706
+ }, null, 8, Hs),
707
+ a("path", {
711
708
  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",
712
709
  stroke: f.color,
713
710
  "stroke-width": "1.5",
714
711
  "stroke-linecap": "round",
715
712
  "stroke-linejoin": "round"
716
- }, null, 8, Hs),
717
- l("path", {
713
+ }, null, 8, js),
714
+ a("path", {
718
715
  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",
719
716
  stroke: f.color,
720
717
  "stroke-width": "1.5",
721
718
  "stroke-linecap": "round",
722
719
  "stroke-linejoin": "round"
723
- }, null, 8, js)
720
+ }, null, 8, Qs)
724
721
  ]));
725
722
  }
726
- }), Ys = { class: "flex gap-8 items-center" }, Ks = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Xs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Zs = { class: "flex items-center w-full" }, Gs = { class: "flex-1" }, Js = { class: "fm-typo-en-title-sm-800" }, Ws = { class: "flex items-start gap-8" }, eo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, to = { class: "flex gap-1" }, bt = /* @__PURE__ */ ae({
723
+ }), Ks = { class: "flex gap-8 items-center" }, Xs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Zs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Gs = { class: "flex items-center w-full" }, Js = { class: "flex-1" }, Ws = { class: "fm-typo-en-title-sm-800" }, eo = { class: "flex items-start gap-8" }, to = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, so = { class: "flex gap-1" }, bt = /* @__PURE__ */ ae({
727
724
  __name: "ForecastStock",
728
725
  props: {
729
726
  disabled: { type: Boolean }
730
727
  },
731
728
  emits: ["update:poItems"],
732
729
  setup(f, { emit: x }) {
733
- const r = x, i = q(!1), S = q(7), t = us(), d = De(), p = tt(), { t: u } = pe();
734
- async function g() {
735
- if (S.value < 1)
730
+ const r = x, l = A(!1), C = A(7), t = ms(), m = De(), d = et(), { t: u } = fe();
731
+ async function h() {
732
+ if (C.value < 1)
736
733
  return;
737
- i.value = !1, await t.readPurchaseOrder(S.value);
734
+ l.value = !1, await t.readPurchaseOrder(C.value);
738
735
  const o = [];
739
736
  if (t.purchaseOrderForecast.skus.length <= 0) {
740
- d.open({
737
+ m.open({
741
738
  message: u("inventory.transfer.form.items.forecastStock.notAvailable"),
742
739
  type: "info"
743
740
  });
744
741
  return;
745
742
  }
746
- const e = t.purchaseOrderForecast.skus.reduce((a, m) => {
747
- const v = p.skus.find((c) => c._id === m.id);
748
- if (a.find((c) => c.sku._id === m.id) || !v)
749
- return a;
743
+ const e = t.purchaseOrderForecast.skus.reduce((i, c) => {
744
+ const y = d.skus.find((v) => v._id === c.id);
745
+ if (i.find((v) => v.sku._id === c.id) || !y)
746
+ return i;
750
747
  const I = {
751
- sku: v,
752
- code: v.code,
753
- name: v.name,
748
+ sku: y,
749
+ code: y.code,
750
+ name: y.name,
754
751
  quantity: {
755
- amount: m.amount,
752
+ amount: c.amount,
756
753
  precision: 0
757
754
  }
758
755
  };
759
- return a.push(I), a;
756
+ return i.push(I), i;
760
757
  }, o);
761
758
  r("update:poItems", e);
762
759
  }
763
760
  return (o, e) => {
764
- const a = D("FmButton"), m = D("FmIcon"), v = D("FmStepperField"), h = D("FmPopover");
765
- return k(), Q(h, {
761
+ const i = D("FmButton"), c = D("FmIcon"), y = D("FmStepperField"), k = D("FmPopover");
762
+ return S(), Q(k, {
766
763
  disabled: o.disabled,
767
764
  class: "flex",
768
- "show-popover": i.value,
769
- onPopoverChanged: e[3] || (e[3] = (I) => i.value = I)
765
+ "show-popover": l.value,
766
+ onPopoverChanged: e[3] || (e[3] = (I) => l.value = I)
770
767
  }, {
771
768
  "popover-button": R(() => [
772
- b(a, {
769
+ b(i, {
773
770
  label: "unused",
774
771
  variant: "secondary",
775
772
  "text-color": o.disabled ? "disabled" : "primary",
@@ -778,63 +775,63 @@ const Bs = {
778
775
  disabled: o.disabled
779
776
  }, {
780
777
  default: R(() => [
781
- l("div", Ys, [
782
- b(Qs, {
778
+ a("div", Ks, [
779
+ b(Ys, {
783
780
  size: 24,
784
781
  color: o.disabled ? "#c7c7cc" : "#ff7823"
785
782
  }, null, 8, ["color"]),
786
- l("div", Ks, V(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
783
+ a("div", Xs, q(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
787
784
  ])
788
785
  ]),
789
786
  _: 1
790
787
  }, 8, ["text-color", "border-color", "disabled"])
791
788
  ]),
792
789
  default: R(() => [
793
- l("div", Xs, [
794
- l("div", Zs, [
795
- l("div", Gs, [
796
- b(gs, { "z-index": 99 }, {
790
+ a("div", Zs, [
791
+ a("div", Gs, [
792
+ a("div", Js, [
793
+ b(_s, { "z-index": 99 }, {
797
794
  default: R(() => [
798
- l("p", Js, V(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
795
+ a("p", Ws, q(s(u)("inventory.transfer.form.items.forecastStock.title")), 1)
799
796
  ]),
800
797
  _: 1
801
798
  })
802
799
  ]),
803
- b(a, {
800
+ b(i, {
804
801
  icon: "close",
805
802
  size: "md",
806
803
  variant: "tertiary",
807
- onClick: e[0] || (e[0] = (I) => i.value = !1)
804
+ onClick: e[0] || (e[0] = (I) => l.value = !1)
808
805
  })
809
806
  ]),
810
- b(v, {
811
- modelValue: S.value,
812
- "onUpdate:modelValue": e[1] || (e[1] = (I) => S.value = I),
807
+ b(y, {
808
+ modelValue: C.value,
809
+ "onUpdate:modelValue": e[1] || (e[1] = (I) => C.value = I),
813
810
  label: s(u)("inventory.transfer.form.items.forecastStock.days"),
814
- rules: [s(Be)(1)]
811
+ rules: [s(ze)(1)]
815
812
  }, {
816
813
  "helper-text": R(() => [
817
- l("div", Ws, [
818
- b(m, {
814
+ a("div", eo, [
815
+ b(c, {
819
816
  name: "warning",
820
817
  size: "sm",
821
818
  class: "text-fm-color-system-warning-300"
822
819
  }),
823
- l("div", eo, V(s(u)("inventory.transfer.form.items.forecastStock.replace")), 1)
820
+ a("div", to, q(s(u)("inventory.transfer.form.items.forecastStock.replace")), 1)
824
821
  ])
825
822
  ]),
826
823
  _: 1
827
824
  }, 8, ["modelValue", "label", "rules"]),
828
- l("div", to, [
829
- e[4] || (e[4] = l("div", { class: "grow" }, null, -1)),
830
- b(a, {
825
+ a("div", so, [
826
+ e[4] || (e[4] = a("div", { class: "grow" }, null, -1)),
827
+ b(i, {
831
828
  label: s(u)("common.cancel"),
832
829
  variant: "tertiary",
833
- onClick: e[2] || (e[2] = (I) => i.value = !1)
830
+ onClick: e[2] || (e[2] = (I) => l.value = !1)
834
831
  }, null, 8, ["label"]),
835
- b(a, {
832
+ b(i, {
836
833
  label: s(u)("inventory.transfer.form.items.forecastStock.generate"),
837
- onClick: g
834
+ onClick: h
838
835
  }, null, 8, ["label"])
839
836
  ])
840
837
  ])
@@ -844,33 +841,33 @@ const Bs = {
844
841
  };
845
842
  }
846
843
  });
847
- function so() {
848
- const f = De(), x = ot(), r = q(!1);
849
- _e(r, (d) => {
850
- d && (S.value = !0, i().finally(() => {
851
- S.value = !1;
844
+ function oo() {
845
+ const f = De(), x = ot(), r = A(!1);
846
+ be(r, (m) => {
847
+ m && (C.value = !0, l().finally(() => {
848
+ C.value = !1;
852
849
  }));
853
850
  });
854
- async function i() {
851
+ async function l() {
855
852
  try {
856
- const { startDate: d, endDate: p } = Qt(6), o = (await x.getPurchaseOrders({ start: d, end: p })).filter(
853
+ const { startDate: m, endDate: d } = Yt(6), o = (await x.getPurchaseOrders({ start: m, end: d })).filter(
857
854
  (e) => {
858
- var a, m;
859
- return e.status === Yt.enum.COMPLETE && ((a = e.supplier) == null ? void 0 : a.internal) !== "warehouse" && ((m = e.supplier) == null ? void 0 : m.internal) !== "restaurant";
855
+ var i, c;
856
+ return e.status === Kt.enum.COMPLETE && ((i = e.supplier) == null ? void 0 : i.internal) !== "warehouse" && ((c = e.supplier) == null ? void 0 : c.internal) !== "restaurant";
860
857
  }
861
- ).reduce((e, a) => {
862
- const m = new Date(Kt(a._id)), v = a.supplier._id;
863
- for (const h of a.items) {
864
- if (!h.totalCost) continue;
865
- const I = e[h.sku._id] ?? {}, c = I[v] ?? [];
866
- c.push({
867
- date: m.toISOString(),
868
- totalUnit: h.quantity,
869
- totalCost: h.totalCost,
870
- unit: h.sku.unit,
871
- measurement: h.measurement,
872
- seqNumber: a.seqNumber
873
- }), I[v] = c, e[h.sku._id] = I;
858
+ ).reduce((e, i) => {
859
+ const c = new Date(Xt(i._id)), y = i.supplier._id;
860
+ for (const k of i.items) {
861
+ if (!k.totalCost) continue;
862
+ const I = e[k.sku._id] ?? {}, v = I[y] ?? [];
863
+ v.push({
864
+ date: c.toISOString(),
865
+ totalUnit: k.quantity,
866
+ totalCost: k.totalCost,
867
+ unit: k.sku.unit,
868
+ measurement: k.measurement,
869
+ seqNumber: i.seqNumber
870
+ }), I[y] = v, e[k.sku._id] = I;
874
871
  }
875
872
  return e;
876
873
  }, {});
@@ -882,23 +879,23 @@ function so() {
882
879
  }), r.value = !1;
883
880
  }
884
881
  }
885
- const S = q(!1), t = q({});
882
+ const C = A(!1), t = A({});
886
883
  return {
887
884
  comparePricesToggle: r,
888
- comparePriceFetching: S,
885
+ comparePriceFetching: C,
889
886
  comparePriceBySku: t
890
887
  };
891
888
  }
892
- const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-center" }, ao = {
889
+ const no = { class: "hover:bg-fm-color-opacity-sm" }, ao = { class: "flex items-center" }, lo = {
893
890
  key: 0,
894
891
  class: "flex h-full w-24"
895
- }, lo = { class: "flex flex-col flex-1 line-clamp-1" }, ro = { class: "text-fm-color-typo-primary fm-typo-en-body-md-400" }, io = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, uo = {
892
+ }, ro = { class: "flex flex-col flex-1 line-clamp-1" }, io = { class: "text-fm-color-typo-primary fm-typo-en-body-md-400" }, uo = { class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400" }, mo = {
896
893
  key: 2,
897
894
  class: "flex-1"
898
- }, mo = {
895
+ }, co = {
899
896
  key: 3,
900
897
  class: "flex w-full justify-end"
901
- }, co = /* @__PURE__ */ ae({
898
+ }, po = /* @__PURE__ */ ae({
902
899
  __name: "TransferSubItemTable",
903
900
  props: {
904
901
  templateSubItem: {},
@@ -909,59 +906,59 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
909
906
  },
910
907
  emits: ["delete:model-value"],
911
908
  setup(f, { emit: x }) {
912
- const r = st(), i = x, S = q(ue(r.quantity));
913
- return _e(S, (t) => {
909
+ const r = tt(), l = x, C = A(me(r.quantity));
910
+ return be(C, (t) => {
914
911
  if (!`${t}`) return;
915
- const d = +t;
916
- Number.isNaN(d) || (r.quantity = xt(d));
917
- }), (t, d) => {
918
- const p = D("FmIcon"), u = D("FmTooltip"), g = D("FmButton");
919
- return k(), F("tr", oo, [
920
- (k(!0), F(ne, null, he(t.row.getVisibleCells(), (o, e) => (k(), F("td", {
912
+ const m = +t;
913
+ Number.isNaN(m) || (r.quantity = xt(m));
914
+ }), (t, m) => {
915
+ const d = D("FmIcon"), u = D("FmTooltip"), h = D("FmButton");
916
+ return S(), F("tr", no, [
917
+ (S(!0), F(ne, null, ge(t.row.getVisibleCells(), (o, e) => (S(), F("td", {
921
918
  key: o.id,
922
- class: Z([e === 0 ? "px-16" : o.column.id === s(X).Delete ? "" : "px-16"])
919
+ class: X([e === 0 ? "px-16" : o.column.id === s(K).Delete ? "" : "px-16"])
923
920
  }, [
924
- l("div", no, [
925
- e === 0 ? (k(), F("div", ao, [
926
- t.subItemIndex === 0 ? (k(), Q(p, {
921
+ a("div", ao, [
922
+ e === 0 ? (S(), F("div", lo, [
923
+ t.subItemIndex === 0 ? (S(), Q(d, {
927
924
  key: 0,
928
925
  name: "subdirectory_arrow_right",
929
926
  size: "sm"
930
927
  })) : N("", !0)
931
928
  ])) : N("", !0),
932
- o.column.id === s(X).TemplateName ? (k(), Q(u, {
929
+ o.column.id === s(K).TemplateName ? (S(), Q(u, {
933
930
  key: 1,
934
931
  "z-index": 50
935
932
  }, {
936
933
  content: R(() => [
937
- Ie(V(s(r).name), 1)
934
+ Ie(q(s(r).name), 1)
938
935
  ]),
939
936
  default: R(() => [
940
- l("div", lo, [
941
- l("div", ro, V(s(r).name), 1),
942
- l("div", io, V(s(r).code), 1)
937
+ a("div", ro, [
938
+ a("div", io, q(s(r).name), 1),
939
+ a("div", uo, q(s(r).code), 1)
943
940
  ])
944
941
  ]),
945
942
  _: 1
946
- })) : o.column.id === s(X).Amount ? (k(), F("div", uo, [
943
+ })) : o.column.id === s(K).Amount ? (S(), F("div", mo, [
947
944
  b(Dt, {
948
945
  "model-value": {
949
946
  amount: s(r).quantity,
950
947
  measurement: s(r).measurement
951
948
  },
952
- "onUpdate:modelValue": d[0] || (d[0] = (a) => s(r).quantity = a.amount),
949
+ "onUpdate:modelValue": m[0] || (m[0] = (i) => s(r).quantity = i.amount),
953
950
  unit: t.row.original.sku.unit,
954
951
  rules: [
955
952
  s(Tt)(
956
- +s(ue)(
953
+ +s(me)(
957
954
  t.templateSubItem.minimumQuantity ?? {
958
955
  amount: 1,
959
- precision: s(He)(t.row.original.sku.unit, s(r).measurement)
956
+ precision: s(st)(t.row.original.sku.unit, s(r).measurement)
960
957
  }
961
958
  )
962
959
  ),
963
- s(Ge)(
964
- t.templateSubItem.maximumQuantity ? +s(ue)(t.templateSubItem.maximumQuantity) : 1 / 0
960
+ s(Vt)(
961
+ t.templateSubItem.maximumQuantity ? +s(me)(t.templateSubItem.maximumQuantity) : 1 / 0
965
962
  ),
966
963
  s(Pt)(t.templateSubItem.quantityStep)
967
964
  ],
@@ -969,14 +966,14 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
969
966
  disabled: t.disabled,
970
967
  "disable-unit": ""
971
968
  }, null, 8, ["model-value", "unit", "rules", "stepper", "disabled"])
972
- ])) : o.column.id === s(X).Delete ? (k(), F("div", mo, [
973
- b(g, {
969
+ ])) : o.column.id === s(K).Delete ? (S(), F("div", co, [
970
+ b(h, {
974
971
  key: "row.sku._id",
975
972
  type: "button",
976
973
  icon: "delete",
977
974
  variant: "tertiary",
978
975
  size: "md",
979
- onClick: d[1] || (d[1] = (a) => i("delete:model-value", t.modelValue)),
976
+ onClick: m[1] || (m[1] = (i) => l("delete:model-value", t.modelValue)),
980
977
  disabled: t.disabled
981
978
  }, null, 8, ["disabled"])
982
979
  ])) : N("", !0)
@@ -985,7 +982,7 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
985
982
  ]);
986
983
  };
987
984
  }
988
- }), po = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, fo = { key: 1 }, vo = ["colspan"], yo = /* @__PURE__ */ ae({
985
+ }), fo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, vo = { key: 1 }, yo = ["colspan"], bo = /* @__PURE__ */ ae({
989
986
  __name: "TransferItemTable",
990
987
  props: {
991
988
  templateItem: {},
@@ -996,94 +993,94 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
996
993
  },
997
994
  emits: ["update:item"],
998
995
  setup(f, { emit: x }) {
999
- const r = f, i = x;
1000
- function S(u) {
996
+ const r = f, l = x;
997
+ function C(u) {
1001
998
  return u.column.columnDef.meta;
1002
999
  }
1003
1000
  function t(u) {
1004
- var g, o;
1005
- return ((o = (g = r.templateItem) == null ? void 0 : g.subItems) == null ? void 0 : o.find((e) => e.id === u.id)) ?? {
1001
+ var h, o;
1002
+ return ((o = (h = r.templateItem) == null ? void 0 : h.subItems) == null ? void 0 : o.find((e) => e.id === u.id)) ?? {
1006
1003
  id: u.id,
1007
1004
  code: u.code,
1008
1005
  name: u.name,
1009
1006
  quantity: u.quantity,
1010
1007
  quantityStep: {
1011
1008
  amount: 1,
1012
- precision: He(r.row.original.sku.unit, u.measurement)
1009
+ precision: st(r.row.original.sku.unit, u.measurement)
1013
1010
  }
1014
1011
  };
1015
1012
  }
1016
- function d(u) {
1013
+ function m(u) {
1017
1014
  const o = (r.row.original.subItems ?? []).map((e) => e.id !== u.id ? e : u);
1018
- i("update:item", {
1015
+ l("update:item", {
1019
1016
  ...r.row.original,
1020
1017
  subItems: o
1021
1018
  });
1022
1019
  }
1023
- function p(u) {
1020
+ function d(u) {
1024
1021
  const o = (r.row.original.subItems ?? []).filter((e) => e.id !== u.id);
1025
- i("update:item", {
1022
+ l("update:item", {
1026
1023
  ...r.row.original,
1027
1024
  subItems: o.length ? o : null
1028
1025
  });
1029
1026
  }
1030
- return (u, g) => {
1031
- var o, e, a, m, v;
1032
- return k(), F(ne, null, [
1033
- l("tr", {
1034
- class: Z(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
1027
+ return (u, h) => {
1028
+ var o, e, i, c, y;
1029
+ return S(), F(ne, null, [
1030
+ a("tr", {
1031
+ class: X(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
1035
1032
  "bg-fm-color-neutral-gray-100": u.row.getIsSelected()
1036
1033
  }])
1037
1034
  }, [
1038
- (k(!0), F(ne, null, he(u.row.getVisibleCells(), (h) => {
1039
- var I, c, y, E;
1040
- return k(), F("td", {
1041
- key: h.id,
1042
- class: Z(["h-[56px] text-fm-color-typo-primary", ((I = S(h)) == null ? void 0 : I.cellClass) ?? "px-16"]),
1035
+ (S(!0), F(ne, null, ge(u.row.getVisibleCells(), (k) => {
1036
+ var I, v, p, V;
1037
+ return S(), F("td", {
1038
+ key: k.id,
1039
+ class: X(["h-[56px] text-fm-color-typo-primary", ((I = C(k)) == null ? void 0 : I.cellClass) ?? "px-16"]),
1043
1040
  style: kt({
1044
- width: (c = S(h)) == null ? void 0 : c.width,
1045
- maxWidth: (y = S(h)) == null ? void 0 : y.maxWidth,
1046
- textAlign: ((E = S(h)) == null ? void 0 : E.textAlign) ?? "left"
1041
+ width: (v = C(k)) == null ? void 0 : v.width,
1042
+ maxWidth: (p = C(k)) == null ? void 0 : p.maxWidth,
1043
+ textAlign: ((V = C(k)) == null ? void 0 : V.textAlign) ?? "left"
1047
1044
  })
1048
1045
  }, [
1049
- l("span", po, [
1050
- b(s(ce), {
1051
- render: h.column.columnDef.cell,
1052
- props: h.getContext()
1046
+ a("span", fo, [
1047
+ b(s(pe), {
1048
+ render: k.column.columnDef.cell,
1049
+ props: k.getContext()
1053
1050
  }, null, 8, ["render", "props"])
1054
1051
  ])
1055
1052
  ], 6);
1056
1053
  }), 128))
1057
1054
  ], 2),
1058
- (e = (o = u.row.original) == null ? void 0 : o.subItems) != null && e.length ? (k(!0), F(ne, { key: 0 }, he((a = u.row.original) == null ? void 0 : a.subItems, (h, I) => (k(), Q(co, {
1059
- key: h.id,
1055
+ (e = (o = u.row.original) == null ? void 0 : o.subItems) != null && e.length ? (S(!0), F(ne, { key: 0 }, ge((i = u.row.original) == null ? void 0 : i.subItems, (k, I) => (S(), Q(po, {
1056
+ key: k.id,
1060
1057
  row: u.row,
1061
- "model-value": h,
1062
- "onUpdate:modelValue": d,
1063
- "onDelete:modelValue": p,
1064
- "template-sub-item": t(h),
1058
+ "model-value": k,
1059
+ "onUpdate:modelValue": m,
1060
+ "onDelete:modelValue": d,
1061
+ "template-sub-item": t(k),
1065
1062
  "sub-item-index": I,
1066
1063
  disabled: u.disabled
1067
1064
  }, null, 8, ["row", "model-value", "template-sub-item", "sub-item-index", "disabled"]))), 128)) : N("", !0),
1068
- u.showComparePrice && Object.keys(u.comparePriceBySku[(m = u.row.original.sku) == null ? void 0 : m._id] ?? {}).length > 0 ? (k(), F("tr", fo, [
1069
- l("td", {
1065
+ u.showComparePrice && Object.keys(u.comparePriceBySku[(c = u.row.original.sku) == null ? void 0 : c._id] ?? {}).length > 0 ? (S(), F("tr", vo, [
1066
+ a("td", {
1070
1067
  colspan: u.row.getVisibleCells().length
1071
1068
  }, [
1072
- b(Vt, {
1073
- prices: u.comparePriceBySku[(v = u.row.original.sku) == null ? void 0 : v._id]
1069
+ b(qt, {
1070
+ prices: u.comparePriceBySku[(y = u.row.original.sku) == null ? void 0 : y._id]
1074
1071
  }, null, 8, ["prices"])
1075
- ], 8, vo)
1072
+ ], 8, yo)
1076
1073
  ])) : N("", !0)
1077
1074
  ], 64);
1078
1075
  };
1079
1076
  }
1080
- }), bo = {
1077
+ }), go = {
1081
1078
  key: 0,
1082
1079
  class: "flex flex-col gap-8"
1083
- }, go = { class: "flex flex-col gap-4" }, _o = { class: "flex items-center gap-4" }, ho = {
1080
+ }, _o = { class: "flex flex-col gap-4" }, ho = { class: "flex items-center gap-4" }, ko = {
1084
1081
  key: 0,
1085
1082
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
1086
- }, ko = /* @__PURE__ */ ae({
1083
+ }, xo = /* @__PURE__ */ ae({
1087
1084
  __name: "NetSuiteField",
1088
1085
  props: {
1089
1086
  required: { type: Boolean },
@@ -1095,70 +1092,70 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1095
1092
  },
1096
1093
  emits: ["netsuite:ready"],
1097
1094
  setup(f, { emit: x }) {
1098
- const r = Le(), i = f, S = x, { t } = _s(), d = q(!1), p = q();
1099
- ze(() => {
1100
- var e, a, m, v;
1095
+ const r = He(), l = f, C = x, { t } = hs(), m = A(!1), d = A();
1096
+ Le(() => {
1097
+ var e, i, c, y;
1101
1098
  let o = {
1102
1099
  id: "",
1103
1100
  subsidiary: { id: "", name: "" },
1104
1101
  errors: []
1105
1102
  };
1106
- if (!r.isEnabled || !i.required) {
1107
- S("netsuite:ready", o);
1103
+ if (!r.isEnabled || !l.required) {
1104
+ C("netsuite:ready", o);
1108
1105
  return;
1109
1106
  }
1110
1107
  try {
1111
- const h = r.currentLocationSubsidiary();
1112
- i.setting ? o = {
1113
- ...i.setting,
1108
+ const k = r.currentLocationSubsidiary();
1109
+ l.setting ? o = {
1110
+ ...l.setting,
1114
1111
  subsidiary: {
1115
- id: h.id || "",
1116
- name: h.name
1112
+ id: k.id || "",
1113
+ name: k.name
1117
1114
  }
1118
1115
  } : o = {
1119
1116
  ...o,
1120
1117
  subsidiary: {
1121
- id: h.id || "",
1122
- name: h.name
1118
+ id: k.id || "",
1119
+ name: k.name
1123
1120
  }
1124
1121
  };
1125
- const I = r.getAvailableItems(h.id), c = i.items.filter((y) => {
1126
- if (y.measurement != null) {
1127
- const E = r.getAvailableMeasurements(
1128
- y.sku._id,
1129
- h.id
1122
+ const I = r.getAvailableItems(k.id), v = l.items.filter((p) => {
1123
+ if (p.measurement != null) {
1124
+ const V = r.getAvailableMeasurements(
1125
+ p.sku._id,
1126
+ k.id
1130
1127
  );
1131
- return I.includes(y.sku._id) && E.includes(y.measurement.id);
1128
+ return I.includes(p.sku._id) && V.includes(p.measurement.id);
1132
1129
  }
1133
- return I.includes(y.sku._id);
1134
- }).map((y) => y.sku._id);
1135
- i.onChange(
1136
- i.items.filter((y) => c.includes(y.sku._id)),
1130
+ return I.includes(p.sku._id);
1131
+ }).map((p) => p.sku._id);
1132
+ l.onChange(
1133
+ l.items.filter((p) => v.includes(p.sku._id)),
1137
1134
  o
1138
1135
  );
1139
1136
  } finally {
1140
- i.supplier.internal ? p.value = r.getNetSuiteLocation(
1141
- `${i.supplier.internal}_${i.supplier._id}`
1142
- ) : p.value = r.getNetSuiteVendor(i.supplier._id);
1143
- const h = i.supplier.internal ? r.getLocationSubsidiary((e = p.value) == null ? void 0 : e.netSuiteId).id : (a = p.value) == null ? void 0 : a.subsidiaryId, I = i.supplier.internal ? (m = r.currentLocationSubsidiary()) == null ? void 0 : m.id : (v = r.currentVendorSubsidiary(i.supplier._id)) == null ? void 0 : v.id;
1144
- !r.isEnabled || h && r.isEnabled && h == I ? S("netsuite:ready", o) : d.value = !0;
1137
+ l.supplier.internal ? d.value = r.getNetSuiteLocation(
1138
+ `${l.supplier.internal}_${l.supplier._id}`
1139
+ ) : d.value = r.getNetSuiteVendor(l.supplier._id);
1140
+ const k = l.supplier.internal ? r.getLocationSubsidiary((e = d.value) == null ? void 0 : e.netSuiteId).id : (i = d.value) == null ? void 0 : i.subsidiaryId, I = l.supplier.internal ? (c = r.currentLocationSubsidiary()) == null ? void 0 : c.id : (y = r.currentVendorSubsidiary(l.supplier._id)) == null ? void 0 : y.id;
1141
+ !r.isEnabled || k && r.isEnabled && k == I ? C("netsuite:ready", o) : m.value = !0;
1145
1142
  }
1146
1143
  });
1147
1144
  const u = O(
1148
- () => i.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(i.supplier._id)
1149
- ), g = O(() => {
1145
+ () => l.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(l.supplier._id)
1146
+ ), h = O(() => {
1150
1147
  var o, e;
1151
- return p.value == null ? `Cannot find the NetSuite location for "${i.supplier.name}"` : `The subsidiary of the request
1152
- location is ${(e = r.getLocationSubsidiary((o = p.value) == null ? void 0 : o.netSuiteId)) == null ? void 0 : e.fullName}`;
1148
+ return d.value == null ? `Cannot find the NetSuite location for "${l.supplier.name}"` : `The subsidiary of the request
1149
+ location is ${(e = r.getLocationSubsidiary((o = d.value) == null ? void 0 : o.netSuiteId)) == null ? void 0 : e.fullName}`;
1153
1150
  });
1154
1151
  return (o, e) => {
1155
- const a = D("FmLabel"), m = D("FmIcon"), v = D("FmField"), h = D("FmTooltip");
1156
- return s(r).isEnabled && i.required ? (k(), F("div", bo, [
1157
- b(a, {
1152
+ const i = D("FmLabel"), c = D("FmIcon"), y = D("FmField"), k = D("FmTooltip");
1153
+ return s(r).isEnabled && l.required ? (S(), F("div", go, [
1154
+ b(i, {
1158
1155
  label: `NetSuite ${s(t)("inventory.transfer.form.netsuite.subsidiary")}`
1159
1156
  }, null, 8, ["label"]),
1160
- l("div", go, [
1161
- b(h, {
1157
+ a("div", _o, [
1158
+ b(k, {
1162
1159
  "z-index": 51,
1163
1160
  placement: "left",
1164
1161
  disabled: o.disabled
@@ -1167,19 +1164,19 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1167
1164
  Ie("This field is locked and based on the location of the request.")
1168
1165
  ])),
1169
1166
  default: R(() => [
1170
- b(v, null, {
1167
+ b(y, null, {
1171
1168
  default: R(() => {
1172
1169
  var I;
1173
1170
  return [
1174
- l("div", _o, [
1175
- b(m, {
1171
+ a("div", ho, [
1172
+ b(c, {
1176
1173
  name: "lock_outline",
1177
1174
  size: "sm",
1178
1175
  color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
1179
1176
  }, null, 8, ["color"]),
1180
- l("div", {
1181
- class: Z([o.disabled ? "text-fm-color-typo-disabled" : ""])
1182
- }, V((I = u.value) == null ? void 0 : I.fullName), 3)
1177
+ a("div", {
1178
+ class: X([o.disabled ? "text-fm-color-typo-disabled" : ""])
1179
+ }, q((I = u.value) == null ? void 0 : I.fullName), 3)
1183
1180
  ])
1184
1181
  ];
1185
1182
  }),
@@ -1188,21 +1185,21 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1188
1185
  ]),
1189
1186
  _: 1
1190
1187
  }, 8, ["disabled"]),
1191
- d.value ? (k(), F("div", ho, V(g.value), 1)) : N("", !0)
1188
+ m.value ? (S(), F("div", ko, q(h.value), 1)) : N("", !0)
1192
1189
  ])
1193
1190
  ])) : N("", !0);
1194
1191
  };
1195
1192
  }
1196
- }), xo = { class: "flex flex-col gap-4" }, So = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, Co = { class: "flex flex-col gap-16" }, wo = { class: "flex flex-col gap-24" }, Io = { class: "flex flex-col gap-8" }, Fo = { class: "flex flex-col gap-4" }, $o = { class: "flex items-center gap-4" }, Do = { class: "flex flex-col gap-8" }, To = { class: "flex flex-col gap-4" }, Po = { class: "flex items-center gap-4" }, Ro = {
1193
+ }), So = { class: "flex flex-col gap-4" }, Co = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, wo = { class: "flex flex-col gap-16" }, Io = { class: "flex flex-col gap-24" }, Fo = { class: "flex flex-col gap-8" }, $o = { class: "flex flex-col gap-4" }, Do = { class: "flex items-center gap-4" }, To = { class: "flex flex-col gap-8" }, Vo = { class: "flex flex-col gap-4" }, Po = { class: "flex items-center gap-4" }, Ro = {
1197
1194
  key: 3,
1198
1195
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
1199
- }, Vo = {
1196
+ }, qo = {
1200
1197
  key: 0,
1201
1198
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
1202
- }, Eo = { class: "flex-1" }, qo = { class: "flex-1" }, Ao = {
1199
+ }, Ao = { class: "flex-1" }, Eo = { class: "flex-1" }, Mo = {
1203
1200
  key: 1,
1204
1201
  class: "flex items-center gap-4"
1205
- }, Mo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Uo = { class: "flex flex-col gap-16" }, Oo = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, No = { class: "flex gap-8" }, Bo = { key: 0 }, zo = /* @__PURE__ */ ae({
1202
+ }, Uo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Oo = { class: "flex flex-col gap-16" }, No = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, Bo = { class: "flex gap-8" }, zo = { key: 0 }, Lo = /* @__PURE__ */ ae({
1206
1203
  __name: "TransferForm2",
1207
1204
  props: {
1208
1205
  modelValue: {},
@@ -1213,40 +1210,34 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1213
1210
  },
1214
1211
  emits: ["validation-success", "form:ready"],
1215
1212
  setup(f, { expose: x, emit: r }) {
1216
- const i = f, S = r, t = st(), { t: d } = pe(), p = je(), u = tt(), g = Le(), o = lt(), e = at(), a = $t(), { breakpoints: m } = nt(), v = O(() => m.value.xs || m.value.sm), h = ht({
1213
+ const l = f, C = r, t = tt(), { t: m } = fe(), d = je(), u = et(), h = He(), o = lt(), e = at(), i = $t(), { breakpoints: c } = nt(), y = O(() => c.value.xs || c.value.sm), k = ht({
1217
1214
  value: !1
1218
- }), I = q(!1), c = O(
1215
+ }), I = A(!1), v = O(
1219
1216
  () => {
1220
1217
  var n;
1221
- return ((n = i.modelValue) == null ? void 0 : n.templateDoc) ?? a.templates.find((w) => w._id === t.template);
1218
+ return ((n = l.modelValue) == null ? void 0 : n.templateDoc) ?? i.templates.find((w) => w._id === t.template);
1222
1219
  }
1223
- ), y = O(() => t.status === "DRAFT" || !t._rev);
1224
- _e(c, (n) => {
1225
- n && y.value && (t.supplier = (n == null ? void 0 : n.purchaseOrder.supplier) ?? t.supplier);
1226
- }), ze(() => {
1220
+ ), p = O(() => t.status === "DRAFT" || !t._rev);
1221
+ be(v, (n) => {
1222
+ n && p.value && (t.supplier = (n == null ? void 0 : n.purchaseOrder.supplier) ?? t.supplier);
1223
+ }), Le(() => {
1227
1224
  var n;
1228
1225
  try {
1229
1226
  if (!t.templateDoc) return;
1230
- if (!t.items.length) {
1231
- let w = [];
1232
- (n = c.value) != null && n.purchaseOrder.items && (w = c.value.purchaseOrder.items.filter((K) => {
1233
- var se;
1234
- return ((se = K.quantity) == null ? void 0 : se.amount) != 0;
1235
- })), t.items = w;
1236
- }
1227
+ t.items.length || (t.items = ((n = v.value) == null ? void 0 : n.purchaseOrder.items) ?? []);
1237
1228
  } finally {
1238
1229
  I.value = !0;
1239
1230
  }
1240
- }), _e([I, h], ([n, w], [K, se]) => {
1241
- w.value && se.value && S("form:ready");
1231
+ }), be([I, k], ([n, w], [Z, ie]) => {
1232
+ w.value && ie.value && C("form:ready");
1242
1233
  });
1243
- const E = O(
1244
- () => p.currentLocation.type === Xt.enum.restaurant
1234
+ const V = O(
1235
+ () => d.currentLocation.type === Zt.enum.restaurant
1245
1236
  );
1246
- p.watchLocation(async () => {
1237
+ d.watchLocation(async () => {
1247
1238
  location && (t.supplier || (t.supplier = o.suppliers.find((n) => n) ?? t.supplier));
1248
1239
  });
1249
- const L = It(), $ = fs(
1240
+ const L = It(), $ = vs(
1250
1241
  () => t,
1251
1242
  (n) => {
1252
1243
  Object.assign(t, n);
@@ -1259,22 +1250,22 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1259
1250
  return typeof ((n = t == null ? void 0 : t.supplier) == null ? void 0 : n.internal) == "string" ? oe.TRANSFER : oe.PURCHASE;
1260
1251
  },
1261
1252
  set(n) {
1262
- var K;
1263
- const w = typeof ((K = t == null ? void 0 : t.supplier) == null ? void 0 : K.internal) == "string" ? oe.TRANSFER : oe.PURCHASE;
1253
+ var Z;
1254
+ const w = typeof ((Z = t == null ? void 0 : t.supplier) == null ? void 0 : Z.internal) == "string" ? oe.TRANSFER : oe.PURCHASE;
1264
1255
  n !== w && (t.supplier = n === oe.PURCHASE ? $.locationOptionsTypePurchase.value[0] : $.locationOptionsTypeTransfer.value[0]);
1265
1256
  }
1266
1257
  });
1267
- _e(
1258
+ be(
1268
1259
  () => {
1269
1260
  var n;
1270
- return (n = i.modelValue) == null ? void 0 : n.template;
1261
+ return (n = l.modelValue) == null ? void 0 : n.template;
1271
1262
  },
1272
1263
  (n) => {
1273
- e.mustUsePoTemplate && !n && At(() => {
1274
- var w, K;
1275
- t.supplier = ((K = (w = $.locationOptionsTypeTransfer.value) == null ? void 0 : w.filter(
1276
- (se) => se.internal === "restaurant"
1277
- )) == null ? void 0 : K[0]) ?? t.supplier;
1264
+ e.mustUsePoTemplate && !n && Mt(() => {
1265
+ var w, Z;
1266
+ t.supplier = ((Z = (w = $.locationOptionsTypeTransfer.value) == null ? void 0 : w.filter(
1267
+ (ie) => ie.internal === "restaurant"
1268
+ )) == null ? void 0 : Z[0]) ?? t.supplier;
1278
1269
  });
1279
1270
  },
1280
1271
  { immediate: !0 }
@@ -1282,8 +1273,8 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1282
1273
  const Y = O(() => {
1283
1274
  let n = $.transferLocationOptions.value;
1284
1275
  return e.mustUsePoTemplate && !t.templateDoc && (n = n.filter((w) => {
1285
- var K;
1286
- return (K = w.sublabel) == null ? void 0 : K.startsWith("restaurant");
1276
+ var Z;
1277
+ return (Z = w.sublabel) == null ? void 0 : Z.startsWith("restaurant");
1287
1278
  })), n;
1288
1279
  }), z = O({
1289
1280
  get() {
@@ -1292,33 +1283,33 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1292
1283
  set(n) {
1293
1284
  $.transferLocationModel.value = n;
1294
1285
  }
1295
- }), A = O({
1286
+ }), E = O({
1296
1287
  get() {
1297
1288
  return t.remark ?? void 0;
1298
1289
  },
1299
1290
  set(n) {
1300
1291
  t.remark = n;
1301
1292
  }
1302
- }), { backdatePo: j, backdateSwitch: B, backdateModel: G, backdateTimeModel: C } = Ns({
1293
+ }), { backdatePo: j, backdateSwitch: B, backdateModel: G, backdateTimeModel: _ } = Bs({
1303
1294
  getEffectiveAt() {
1304
1295
  return t.effectiveAt;
1305
1296
  },
1306
1297
  setEffectiveAt(n) {
1307
1298
  t.effectiveAt = n;
1308
1299
  }
1309
- }), { comparePricesToggle: _, comparePriceFetching: M, comparePriceBySku: J } = so(), re = q();
1300
+ }), { comparePricesToggle: g, comparePriceFetching: M, comparePriceBySku: J } = oo(), le = A();
1310
1301
  x({
1311
1302
  validateInputs: () => {
1312
1303
  var n, w;
1313
- (w = (n = re.value) == null ? void 0 : n.validateInputs) == null || w.call(n);
1304
+ (w = (n = le.value) == null ? void 0 : n.validateInputs) == null || w.call(n);
1314
1305
  },
1315
1306
  resetInputsValidation: () => {
1316
1307
  var n, w;
1317
- (w = (n = re.value) == null ? void 0 : n.resetInputsValidation) == null || w.call(n);
1308
+ (w = (n = le.value) == null ? void 0 : n.resetInputsValidation) == null || w.call(n);
1318
1309
  },
1319
1310
  resetInputs: () => {
1320
1311
  var n, w;
1321
- (w = (n = re.value) == null ? void 0 : n.resetInputs) == null || w.call(n);
1312
+ (w = (n = le.value) == null ? void 0 : n.resetInputs) == null || w.call(n);
1322
1313
  }
1323
1314
  });
1324
1315
  const Fe = O(() => ({
@@ -1328,7 +1319,7 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1328
1319
  deleteItem: (n) => {
1329
1320
  t.items = t.items.filter((w) => w.sku._id !== n.sku._id);
1330
1321
  }
1331
- })), $e = xs({
1322
+ })), $e = Ss({
1332
1323
  updateItem: (n) => Fe.value.updateItem(n),
1333
1324
  deleteItem: (n) => Fe.value.deleteItem(n),
1334
1325
  get supplier() {
@@ -1341,66 +1332,66 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1341
1332
  return T.value;
1342
1333
  },
1343
1334
  get template() {
1344
- return c.value;
1335
+ return v.value;
1345
1336
  },
1346
1337
  get disabled() {
1347
- return i.disabled;
1338
+ return l.disabled;
1348
1339
  }
1349
- }), Ee = O(() => $e.columnDefs.value);
1350
- function qe() {
1351
- var ye, xe, Me, Ue, Te;
1352
- const n = (Me = (xe = (ye = c.value) == null ? void 0 : ye.purchaseOrder) == null ? void 0 : xe.items) == null ? void 0 : Me.groupBy((H) => H.sku._id), w = g.isEnabled ? g.getAvailableItems((Te = (Ue = t.netSuite) == null ? void 0 : Ue.subsidiary) == null ? void 0 : Te.id) : [], K = n != null && n.size ? u.skus.filter((H) => n.has(H._id)) : u.skus, se = g.isEnabled ? K.filter((H) => {
1353
- var le, te, ie, me;
1354
- const ee = (te = (le = c.value) == null ? void 0 : le.purchaseOrder) == null ? void 0 : te.items.find(
1355
- (be) => be.sku._id === H._id
1340
+ }), Ae = O(() => $e.columnDefs.value);
1341
+ function Ee() {
1342
+ var _e, Te, Ue, Oe, Ve;
1343
+ const n = (Ue = (Te = (_e = v.value) == null ? void 0 : _e.purchaseOrder) == null ? void 0 : Te.items) == null ? void 0 : Ue.groupBy((H) => H.sku._id), w = h.isEnabled ? h.getAvailableItems((Ve = (Oe = t.netSuite) == null ? void 0 : Oe.subsidiary) == null ? void 0 : Ve.id) : [], Z = n != null && n.size ? u.skus.filter((H) => n.has(H._id)) : u.skus, ie = h.isEnabled ? Z.filter((H) => {
1344
+ var se, te, re, de;
1345
+ const ee = (te = (se = v.value) == null ? void 0 : se.purchaseOrder) == null ? void 0 : te.items.find(
1346
+ (ve) => ve.sku._id === H._id
1356
1347
  );
1357
1348
  if (ee != null && ee.measurement != null) {
1358
- const be = g.getAvailableMeasurements(
1349
+ const ve = h.getAvailableMeasurements(
1359
1350
  ee.sku._id,
1360
- (me = (ie = t.netSuite) == null ? void 0 : ie.subsidiary) == null ? void 0 : me.id
1351
+ (de = (re = t.netSuite) == null ? void 0 : re.subsidiary) == null ? void 0 : de.id
1361
1352
  );
1362
- return w.includes(ee.sku._id) && be.includes(ee.measurement.id);
1353
+ return w.includes(ee.sku._id) && ve.includes(ee.measurement.id);
1363
1354
  }
1364
1355
  return w.includes(H._id);
1365
- }).map((H) => H._id) : K.map((H) => H._id), fe = K.map(
1356
+ }).map((H) => H._id) : Z.map((H) => H._id), ue = Z.map(
1366
1357
  (H) => {
1367
- var ee, le, te, ie;
1358
+ var ee, se, te, re;
1368
1359
  return {
1369
- label: ((le = (ee = n == null ? void 0 : n.get(H._id)) == null ? void 0 : ee[0]) == null ? void 0 : le.name) ?? H.name,
1370
- sublabel: ((ie = (te = n == null ? void 0 : n.get(H._id)) == null ? void 0 : te[0]) == null ? void 0 : ie.code) ?? H.code,
1360
+ label: ((se = (ee = n == null ? void 0 : n.get(H._id)) == null ? void 0 : ee[0]) == null ? void 0 : se.name) ?? H.name,
1361
+ sublabel: ((re = (te = n == null ? void 0 : n.get(H._id)) == null ? void 0 : te[0]) == null ? void 0 : re.code) ?? H.code,
1371
1362
  value: H,
1372
- disabled: !se.includes(H._id)
1363
+ disabled: !ie.includes(H._id)
1373
1364
  };
1374
1365
  }
1375
- ), ve = fe.filter((H) => {
1366
+ ), xe = ue.filter((H) => {
1376
1367
  var ee;
1377
- return (ee = t.items) == null ? void 0 : ee.find((le) => le.sku._id === H.value._id);
1368
+ return (ee = t.items) == null ? void 0 : ee.find((se) => se.sku._id === H.value._id);
1378
1369
  }).map((H) => H.value);
1379
1370
  L.open({
1380
- title: d("inventory.transfer.form.items.selectItem"),
1371
+ title: m("inventory.transfer.form.items.selectItem"),
1381
1372
  closeButton: !0,
1382
1373
  contentComponent: Ze,
1383
1374
  contentComponentProps: {
1384
- modelValue: ve,
1385
- items: fe,
1375
+ modelValue: xe,
1376
+ items: ue,
1386
1377
  virtualScroll: !0
1387
1378
  },
1388
1379
  primaryActions: {
1389
- text: d("common.confirm"),
1380
+ text: m("common.confirm"),
1390
1381
  close: !0
1391
1382
  },
1392
1383
  secondaryActions: {
1393
- text: d("common.close"),
1384
+ text: m("common.close"),
1394
1385
  close: !0,
1395
1386
  variant: "tertiary"
1396
1387
  }
1397
1388
  }).onPrimary((H) => {
1398
- const ee = t.items ?? [], le = H.map((te) => {
1399
- var be, Pe;
1400
- const ie = ee.find((Se) => Se.sku._id === te._id);
1401
- if (ie)
1402
- return ie;
1403
- const me = ((Pe = (be = c.value) == null ? void 0 : be.purchaseOrder.items) == null ? void 0 : Pe.find(
1389
+ const ee = t.items ?? [], se = H.map((te) => {
1390
+ var ve, Pe;
1391
+ const re = ee.find((Se) => Se.sku._id === te._id);
1392
+ if (re)
1393
+ return re;
1394
+ const de = ((Pe = (ve = v.value) == null ? void 0 : ve.purchaseOrder.items) == null ? void 0 : Pe.find(
1404
1395
  (Se) => Se.sku._id === te._id
1405
1396
  )) ?? {
1406
1397
  sku: te,
@@ -1411,76 +1402,79 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1411
1402
  precision: 0
1412
1403
  }
1413
1404
  };
1414
- return T.value == oe.PURCHASE && (me.totalCost = ge(
1415
- me.sku,
1416
- me.quantity,
1417
- me.measurement,
1405
+ return T.value == oe.PURCHASE && (de.totalCost = ye(
1406
+ de.sku,
1407
+ de.quantity,
1408
+ de.measurement,
1418
1409
  {
1419
1410
  supplier: t.supplier
1420
1411
  }
1421
- )), me;
1412
+ )), de;
1422
1413
  });
1423
- le.sort((te, ie) => te.sku.code.localeCompare(ie.sku.code)), t.items = le;
1414
+ se.sort((te, re) => te.sku.code.localeCompare(re.sku.code)), t.items = se;
1424
1415
  });
1425
1416
  }
1426
1417
  function Qe(n) {
1427
1418
  return n;
1428
1419
  }
1429
- const Ae = O(() => {
1420
+ const Me = O(() => {
1430
1421
  const n = [];
1431
1422
  return (!e.mustUsePoTemplate || e.mustUsePoTemplate && t.templateDoc) && n.push({
1432
- label: d("inventory.transfer.form.type.purchase"),
1423
+ label: m("inventory.transfer.form.type.purchase"),
1433
1424
  value: oe.PURCHASE
1434
1425
  }), n.push({
1435
- label: d("inventory.transfer.form.type.transfer"),
1426
+ label: m("inventory.transfer.form.type.transfer"),
1436
1427
  value: oe.TRANSFER
1437
1428
  }), n;
1429
+ }), ke = O(() => {
1430
+ var n;
1431
+ return (n = l.modelValue) == null ? void 0 : n.items.every((w) => w.quantity.amount <= 0);
1438
1432
  });
1439
1433
  return (n, w) => {
1440
- var be, Pe;
1441
- const K = D("FmChip"), se = D("FmLabel"), fe = D("FmIcon"), ve = D("FmField"), ye = D("FmTooltip"), xe = D("FmSelect"), Me = D("FmTextField"), Ue = D("FmTextarea"), Te = D("FmSwitch"), H = D("FmDatePicker"), ee = D("FmTimePicker"), le = D("FmFormGroup"), te = D("FmButton"), ie = D("FmTable"), me = D("FmForm");
1442
- return k(), F("div", xo, [
1443
- l("div", So, [
1444
- (be = i.modelValue) != null && be.template ? (k(), Q(K, {
1434
+ var ve, Pe;
1435
+ const Z = D("FmChip"), ie = D("FmLabel"), ue = D("FmIcon"), xe = D("FmField"), _e = D("FmTooltip"), Te = D("FmSelect"), Ue = D("FmTextField"), Oe = D("FmTextarea"), Ve = D("FmSwitch"), H = D("FmDatePicker"), ee = D("FmTimePicker"), se = D("FmFormGroup"), te = D("FmButton"), re = D("FmTable"), de = D("FmForm");
1436
+ return S(), F("div", So, [
1437
+ a("div", Co, [
1438
+ (ve = l.modelValue) != null && ve.template ? (S(), Q(Z, {
1445
1439
  key: 0,
1446
1440
  variant: n.disabled ? "warning" : void 0,
1447
- label: `${s(d)("inventory.transfer.template.title")}: ${((Pe = c.value) == null ? void 0 : Pe.name) ?? s(d)("inventory.transfer.form.loading")}`,
1441
+ label: `${s(m)("inventory.transfer.template.title")}: ${((Pe = v.value) == null ? void 0 : Pe.name) ?? s(m)("inventory.transfer.form.loading")}`,
1448
1442
  icon: "summarize",
1449
1443
  compact: ""
1450
1444
  }, null, 8, ["variant", "label"])) : N("", !0),
1451
- n.returnFrom ? N("", !0) : (k(), Q(K, {
1445
+ n.returnFrom ? N("", !0) : (S(), Q(Z, {
1452
1446
  key: 1,
1453
- label: s(p).currentLocation.name,
1447
+ label: s(d).currentLocation.name,
1454
1448
  icon: "storefront",
1455
1449
  compact: ""
1456
1450
  }, null, 8, ["label"])),
1457
- n.lastClosingDate ? (k(), Q(K, {
1451
+ n.lastClosingDate ? (S(), Q(Z, {
1458
1452
  key: 2,
1459
- label: `${s(d)("inventory.transfer.form.lastClosing")}: ${s(et)(n.lastClosingDate)} ${s(Zt)(n.lastClosingDate)}`,
1453
+ label: `${s(m)("inventory.transfer.form.lastClosing")}: ${s(We)(n.lastClosingDate)} ${s(Gt)(n.lastClosingDate)}`,
1460
1454
  icon: "calendar_month",
1461
1455
  compact: ""
1462
1456
  }, null, 8, ["label"])) : N("", !0)
1463
1457
  ]),
1464
- b(me, {
1458
+ b(de, {
1465
1459
  ref_key: "formRef",
1466
- ref: re,
1460
+ ref: le,
1467
1461
  class: "flex flex-col gap-32",
1468
1462
  disabled: n.disabled,
1469
1463
  onValidationFailed: console.log,
1470
- onValidationSuccess: w[14] || (w[14] = (Se) => S("validation-success"))
1464
+ onValidationSuccess: w[14] || (w[14] = (Se) => C("validation-success"))
1471
1465
  }, {
1472
1466
  default: R(() => {
1473
1467
  var Se, rt, it, ut, mt, dt, ct, pt;
1474
1468
  return [
1475
- l("div", Co, [
1476
- l("div", wo, [
1477
- (Se = i.modelValue) != null && Se.template ? (k(), F(ne, { key: 0 }, [
1478
- l("div", Io, [
1479
- b(se, {
1480
- label: s(d)("inventory.transfer.form.type.title")
1469
+ a("div", wo, [
1470
+ a("div", Io, [
1471
+ (Se = l.modelValue) != null && Se.template ? (S(), F(ne, { key: 0 }, [
1472
+ a("div", Fo, [
1473
+ b(ie, {
1474
+ label: s(m)("inventory.transfer.form.type.title")
1481
1475
  }, null, 8, ["label"]),
1482
- l("div", Fo, [
1483
- b(ye, {
1476
+ a("div", $o, [
1477
+ b(_e, {
1484
1478
  "z-index": 51,
1485
1479
  placement: "left",
1486
1480
  disabled: n.disabled
@@ -1489,17 +1483,17 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1489
1483
  Ie("This field is locked from template.")
1490
1484
  ])),
1491
1485
  default: R(() => [
1492
- b(ve, null, {
1486
+ b(xe, null, {
1493
1487
  default: R(() => [
1494
- l("div", $o, [
1495
- b(fe, {
1488
+ a("div", Do, [
1489
+ b(ue, {
1496
1490
  name: "lock_outline",
1497
1491
  size: "sm",
1498
1492
  color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
1499
1493
  }, null, 8, ["color"]),
1500
- l("div", {
1501
- class: Z({ "text-fm-color-typo-disabled": n.disabled })
1502
- }, V(s(d)(`inventory.transfer.form.type.${T.value.toLocaleLowerCase("en-us")}`)), 3)
1494
+ a("div", {
1495
+ class: X({ "text-fm-color-typo-disabled": n.disabled })
1496
+ }, q(s(m)(`inventory.transfer.form.type.${T.value.toLocaleLowerCase("en-us")}`)), 3)
1503
1497
  ])
1504
1498
  ]),
1505
1499
  _: 1
@@ -1507,20 +1501,20 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1507
1501
  ]),
1508
1502
  _: 1
1509
1503
  }, 8, ["disabled"]),
1510
- l("div", {
1511
- class: Z([
1504
+ a("div", {
1505
+ class: X([
1512
1506
  "fm-typo-en-body-sm-400",
1513
1507
  n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1514
1508
  ])
1515
1509
  }, null, 2)
1516
1510
  ])
1517
1511
  ]),
1518
- l("div", Do, [
1519
- b(se, {
1520
- label: n.returnFrom ? "Return to" : T.value === s(oe).PURCHASE ? s(d)("inventory.transfer.form.purchaseFrom") : s(d)("inventory.transfer.form.transferFrom")
1512
+ a("div", To, [
1513
+ b(ie, {
1514
+ label: n.returnFrom ? "Return to" : T.value === s(oe).PURCHASE ? s(m)("inventory.transfer.form.purchaseFrom") : s(m)("inventory.transfer.form.transferFrom")
1521
1515
  }, null, 8, ["label"]),
1522
- l("div", To, [
1523
- b(ye, {
1516
+ a("div", Vo, [
1517
+ b(_e, {
1524
1518
  "z-index": 51,
1525
1519
  placement: "left",
1526
1520
  disabled: n.disabled
@@ -1529,19 +1523,19 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1529
1523
  Ie("This field is locked from template.")
1530
1524
  ])),
1531
1525
  default: R(() => [
1532
- b(ve, null, {
1526
+ b(xe, null, {
1533
1527
  default: R(() => {
1534
- var P, W, ke;
1528
+ var P, W, he;
1535
1529
  return [
1536
- l("div", Po, [
1537
- b(fe, {
1530
+ a("div", Po, [
1531
+ b(ue, {
1538
1532
  name: "lock_outline",
1539
1533
  size: "sm",
1540
1534
  color: n.disabled ? "neutral-gray-200" : "neutral-gray-400"
1541
1535
  }, null, 8, ["color"]),
1542
- l("div", {
1543
- class: Z({ "text-fm-color-typo-disabled": n.disabled })
1544
- }, V(((W = (P = n.returnFrom) == null ? void 0 : P.supplier) == null ? void 0 : W.name) ?? ((ke = Y.value.find((Oe) => Oe.value === z.value)) == null ? void 0 : ke.label)), 3)
1536
+ a("div", {
1537
+ class: X({ "text-fm-color-typo-disabled": n.disabled })
1538
+ }, q(((W = (P = n.returnFrom) == null ? void 0 : P.supplier) == null ? void 0 : W.name) ?? ((he = Y.value.find((Ne) => Ne.value === z.value)) == null ? void 0 : he.label)), 3)
1545
1539
  ])
1546
1540
  ];
1547
1541
  }),
@@ -1552,70 +1546,70 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1552
1546
  }, 8, ["disabled"])
1553
1547
  ])
1554
1548
  ])
1555
- ], 64)) : (k(), F(ne, { key: 1 }, [
1556
- b(xe, {
1557
- label: s(d)("inventory.transfer.form.type.title"),
1549
+ ], 64)) : (S(), F(ne, { key: 1 }, [
1550
+ b(Te, {
1551
+ label: s(m)("inventory.transfer.form.type.title"),
1558
1552
  "label-mark": "required",
1559
1553
  modelValue: T.value,
1560
1554
  "onUpdate:modelValue": w[0] || (w[0] = (P) => T.value = P),
1561
- items: Ae.value,
1562
- rules: [s(Be)(1)(Y.value)]
1555
+ items: Me.value,
1556
+ rules: [s(ze)(1)(Y.value)]
1563
1557
  }, {
1564
1558
  default: R(() => [
1565
- l("span", {
1566
- class: Z([
1559
+ a("span", {
1560
+ class: X([
1567
1561
  "line-clamp-1 fm-typo-en-body-lg-400",
1568
1562
  n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1569
1563
  ])
1570
- }, V(s(Gt)(T.value)), 3)
1564
+ }, q(s(Jt)(T.value)), 3)
1571
1565
  ]),
1572
1566
  _: 1
1573
1567
  }, 8, ["label", "modelValue", "items", "rules"]),
1574
- b(xe, {
1575
- label: T.value === s(oe).PURCHASE ? s(d)("inventory.transfer.form.purchaseFrom") : s(d)("inventory.transfer.form.transferFrom"),
1568
+ b(Te, {
1569
+ label: T.value === s(oe).PURCHASE ? s(m)("inventory.transfer.form.purchaseFrom") : s(m)("inventory.transfer.form.transferFrom"),
1576
1570
  "label-mark": "required",
1577
1571
  modelValue: z.value,
1578
1572
  "onUpdate:modelValue": w[1] || (w[1] = (P) => z.value = P),
1579
1573
  items: Y.value
1580
1574
  }, {
1581
1575
  "menu-wrapper": R((P) => {
1582
- var W, ke;
1576
+ var W, he;
1583
1577
  return [
1584
- b(vs, Xe(P, {
1578
+ b(ys, Xe(P, {
1585
1579
  items: Y.value,
1586
- "model-value": (ke = (W = n.modelValue) == null ? void 0 : W.supplier) == null ? void 0 : ke._id
1580
+ "model-value": (he = (W = n.modelValue) == null ? void 0 : W.supplier) == null ? void 0 : he._id
1587
1581
  }), null, 16, ["items", "model-value"])
1588
1582
  ];
1589
1583
  }),
1590
1584
  default: R(() => {
1591
1585
  var P;
1592
1586
  return [
1593
- l("span", {
1594
- class: Z([
1587
+ a("span", {
1588
+ class: X([
1595
1589
  "line-clamp-1 fm-typo-en-body-lg-400",
1596
1590
  n.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1597
1591
  ])
1598
- }, V((P = Y.value.find((W) => W.value === z.value)) == null ? void 0 : P.label), 3)
1592
+ }, q((P = Y.value.find((W) => W.value === z.value)) == null ? void 0 : P.label), 3)
1599
1593
  ];
1600
1594
  }),
1601
1595
  _: 1
1602
1596
  }, 8, ["label", "modelValue", "items"])
1603
1597
  ], 64)),
1604
- b(Me, {
1605
- label: s(d)("inventory.transfer.form.reference"),
1598
+ b(Ue, {
1599
+ label: s(m)("inventory.transfer.form.reference"),
1606
1600
  "label-mark": "optional",
1607
1601
  modelValue: s(t).ref,
1608
1602
  "onUpdate:modelValue": w[2] || (w[2] = (P) => s(t).ref = P)
1609
1603
  }, null, 8, ["label", "modelValue"]),
1610
- b(Ue, {
1611
- label: s(d)("inventory.transfer.form.remark"),
1604
+ b(Oe, {
1605
+ label: s(m)("inventory.transfer.form.remark"),
1612
1606
  "label-mark": "optional",
1613
1607
  "max-length": 240,
1614
- modelValue: A.value,
1615
- "onUpdate:modelValue": w[3] || (w[3] = (P) => A.value = P),
1616
- class: Z([n.disabled ? "text-fm-color-typo-disabled " : ""])
1608
+ modelValue: E.value,
1609
+ "onUpdate:modelValue": w[3] || (w[3] = (P) => E.value = P),
1610
+ class: X([n.disabled ? "text-fm-color-typo-disabled " : ""])
1617
1611
  }, null, 8, ["label", "modelValue", "class"]),
1618
- I.value ? (k(), Q(ko, {
1612
+ I.value ? (S(), Q(xo, {
1619
1613
  key: 2,
1620
1614
  required: s(t).templateDoc != null,
1621
1615
  disabled: n.disabled,
@@ -1626,94 +1620,94 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1626
1620
  s(t).items = P, s(t).netSuite = W;
1627
1621
  },
1628
1622
  "onNetsuite:ready": w[4] || (w[4] = (P) => {
1629
- h.value = !0;
1623
+ k.value = !0;
1630
1624
  })
1631
1625
  }, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : N("", !0),
1632
- s(e).enableBackdatePo ? (k(), F("div", Ro, [
1633
- l("div", {
1634
- class: Z([
1626
+ s(e).enableBackdatePo ? (S(), F("div", Ro, [
1627
+ a("div", {
1628
+ class: X([
1635
1629
  "flex",
1636
1630
  {
1637
- "flex-col": v.value
1631
+ "flex-col": y.value
1638
1632
  }
1639
1633
  ])
1640
1634
  }, [
1641
- b(Te, {
1635
+ b(Ve, {
1642
1636
  modelValue: s(B),
1643
1637
  "onUpdate:modelValue": w[5] || (w[5] = (P) => Ce(B) ? B.value = P : null),
1644
- label: s(d)("inventory.transfer.form.backdate.title"),
1645
- sublabel: s(d)("inventory.transfer.form.backdate.subtitle"),
1638
+ label: s(m)("inventory.transfer.form.backdate.title"),
1639
+ sublabel: s(m)("inventory.transfer.form.backdate.subtitle"),
1646
1640
  "label-placement": "right",
1647
- disabled: E.value && !n.lastClosingDate || n.disabled
1641
+ disabled: V.value && !n.lastClosingDate || n.disabled
1648
1642
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1649
- l("div", {
1650
- class: Z({ hidden: v.value, "w-16": !v.value })
1643
+ a("div", {
1644
+ class: X({ hidden: y.value, "w-16": !y.value })
1651
1645
  }, null, 2),
1652
- s(B) ? (k(), F("div", Vo, [
1653
- l("div", Eo, [
1646
+ s(B) ? (S(), F("div", qo, [
1647
+ a("div", Ao, [
1654
1648
  b(H, {
1655
1649
  modelValue: s(G),
1656
1650
  "onUpdate:modelValue": w[6] || (w[6] = (P) => Ce(G) ? G.value = P : null)
1657
1651
  }, null, 8, ["modelValue"])
1658
1652
  ]),
1659
- l("div", qo, [
1653
+ a("div", Eo, [
1660
1654
  b(ee, {
1661
- modelValue: s(C),
1662
- "onUpdate:modelValue": w[7] || (w[7] = (P) => Ce(C) ? C.value = P : null)
1655
+ modelValue: s(_),
1656
+ "onUpdate:modelValue": w[7] || (w[7] = (P) => Ce(_) ? _.value = P : null)
1663
1657
  }, null, 8, ["modelValue"])
1664
1658
  ])
1665
1659
  ])) : N("", !0)
1666
1660
  ], 2),
1667
- s(j) ? (k(), Q(le, {
1661
+ s(j) ? (S(), Q(se, {
1668
1662
  key: 0,
1669
1663
  modelValue: s(j),
1670
1664
  "onUpdate:modelValue": w[8] || (w[8] = (P) => Ce(j) ? j.value = P : null),
1671
- rules: [s(Jt)(new Date(n.lastClosingDate), /* @__PURE__ */ new Date())]
1665
+ rules: [s(Wt)(new Date(n.lastClosingDate), /* @__PURE__ */ new Date())]
1672
1666
  }, null, 8, ["modelValue", "rules"])) : N("", !0),
1673
- E.value && !n.lastClosingDate ? (k(), F("div", Ao, [
1674
- b(fe, {
1667
+ V.value && !n.lastClosingDate ? (S(), F("div", Mo, [
1668
+ b(ue, {
1675
1669
  name: "error",
1676
1670
  size: "sm",
1677
1671
  class: "text-fm-color-typo-warning"
1678
1672
  }),
1679
- l("span", Mo, V(s(d)("inventory.transfer.form.backdate.error")), 1)
1673
+ a("span", Uo, q(s(m)("inventory.transfer.form.backdate.error")), 1)
1680
1674
  ])) : N("", !0)
1681
1675
  ])) : N("", !0)
1682
1676
  ])
1683
1677
  ]),
1684
- l("div", Uo, [
1685
- b(le, {
1678
+ a("div", Oo, [
1679
+ b(se, {
1686
1680
  "model-value": s(t).items,
1687
- rules: [s(Be)(1)]
1681
+ rules: [s(ze)(1)]
1688
1682
  }, null, 8, ["model-value", "rules"]),
1689
- l("div", {
1690
- class: Z([
1683
+ a("div", {
1684
+ class: X([
1691
1685
  "flex gap-16",
1692
1686
  {
1693
- "flex-col items-start": v.value,
1694
- "items-center": !v.value
1687
+ "flex-col items-start": y.value,
1688
+ "items-center": !y.value
1695
1689
  }
1696
1690
  ])
1697
1691
  }, [
1698
- l("div", Oo, V(s(d)("inventory.transfer.form.items.title")), 1),
1699
- l("div", No, [
1692
+ a("div", No, q(s(m)("inventory.transfer.form.items.title")), 1),
1693
+ a("div", Bo, [
1700
1694
  b(te, {
1701
1695
  disabled: n.disabled,
1702
- label: s(d)("inventory.transfer.form.items.addItem"),
1696
+ label: s(m)("inventory.transfer.form.items.addItem"),
1703
1697
  "prepend-icon": "add",
1704
1698
  variant: "secondary",
1705
1699
  "text-color": "primary",
1706
1700
  "bg-color": "transparent",
1707
1701
  "border-color": "primary",
1708
- onClick: w[9] || (w[9] = (P) => qe()),
1702
+ onClick: w[9] || (w[9] = (P) => Ee()),
1709
1703
  size: "md"
1710
1704
  }, null, 8, ["disabled", "label"]),
1711
- s(t).templateDoc ? (k(), Q(ye, {
1705
+ s(t).templateDoc ? (S(), Q(_e, {
1712
1706
  key: 0,
1713
1707
  "z-index": 50
1714
1708
  }, {
1715
1709
  content: R(() => [
1716
- l("div", null, V(s(d)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1710
+ a("div", null, q(s(m)("inventory.transfer.form.items.forecastStock.notAvailable")), 1)
1717
1711
  ]),
1718
1712
  default: R(() => [
1719
1713
  b(bt, {
@@ -1722,29 +1716,33 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1722
1716
  })
1723
1717
  ]),
1724
1718
  _: 1
1725
- })) : (k(), Q(bt, {
1719
+ })) : (S(), Q(bt, {
1726
1720
  key: 1,
1727
1721
  "onUpdate:poItems": w[11] || (w[11] = (P) => s(t).items = P),
1728
1722
  disabled: n.disabled || !!s(t).templateDoc
1729
1723
  }, null, 8, ["disabled"]))
1730
1724
  ])
1731
1725
  ], 2),
1732
- T.value === s(oe).PURCHASE && y.value && s(e).enableTotalCost && ((rt = n.modelValue) != null && rt.items.length) ? (k(), F("div", Bo, [
1733
- b(Te, {
1734
- label: s(M) ? s(d)("inventory.transfer.form.items.fetchingData") : s(d)("inventory.transfer.form.items.comparePriceHistory"),
1726
+ T.value === s(oe).PURCHASE && p.value && s(e).enableTotalCost && ((rt = n.modelValue) != null && rt.items.length) ? (S(), F("div", zo, [
1727
+ b(Ve, {
1728
+ label: s(M) ? s(m)("inventory.transfer.form.items.fetchingData") : s(m)("inventory.transfer.form.items.comparePriceHistory"),
1735
1729
  "prepend-icon": "compare_arrows",
1736
1730
  "label-placement": "right",
1737
- "model-value": s(_),
1738
- "onUpdate:modelValue": w[12] || (w[12] = (P) => Ce(_) ? _.value = P : null),
1731
+ "model-value": s(g),
1732
+ "onUpdate:modelValue": w[12] || (w[12] = (P) => Ce(g) ? g.value = P : null),
1739
1733
  disabled: s(M) || n.disabled
1740
1734
  }, null, 8, ["label", "model-value", "disabled"])
1741
1735
  ])) : N("", !0),
1742
- (k(), Q(ie, {
1743
- "column-defs": Ee.value,
1736
+ b(se, {
1737
+ "model-value": ke.value,
1738
+ rules: [() => ke.value ? "Must have at least one non-zero item" : !0]
1739
+ }, null, 8, ["model-value", "rules"]),
1740
+ (S(), Q(re, {
1741
+ "column-defs": Ae.value,
1744
1742
  "column-visibility": {
1745
- [s(X).Code]: !(((it = n.modelValue) == null ? void 0 : it.template) ?? ((ut = n.modelValue) == null ? void 0 : ut.templateDoc)),
1746
- [s(X).Name]: !(((mt = n.modelValue) == null ? void 0 : mt.template) ?? ((dt = n.modelValue) == null ? void 0 : dt.templateDoc)),
1747
- [s(X).TemplateName]: !!(((ct = n.modelValue) == null ? void 0 : ct.template) ?? ((pt = n.modelValue) == null ? void 0 : pt.templateDoc))
1743
+ [s(K).Code]: !(((it = n.modelValue) == null ? void 0 : it.template) ?? ((ut = n.modelValue) == null ? void 0 : ut.templateDoc)),
1744
+ [s(K).Name]: !(((mt = n.modelValue) == null ? void 0 : mt.template) ?? ((dt = n.modelValue) == null ? void 0 : dt.templateDoc)),
1745
+ [s(K).TemplateName]: !!(((ct = n.modelValue) == null ? void 0 : ct.template) ?? ((pt = n.modelValue) == null ? void 0 : pt.templateDoc))
1748
1746
  },
1749
1747
  "row-data": s(t).items,
1750
1748
  key: s(t).items.map((P) => P.sku._id).join("."),
@@ -1752,13 +1750,13 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1752
1750
  "page-size": s(t).items.length
1753
1751
  }, {
1754
1752
  "table-row": R((P) => {
1755
- var W, ke, Oe, ft;
1753
+ var W, he, Ne, ft;
1756
1754
  return [
1757
- b(yo, {
1755
+ b(bo, {
1758
1756
  "compare-price-by-sku": s(J),
1759
- "show-compare-price": T.value === s(oe).PURCHASE && s(_),
1757
+ "show-compare-price": T.value === s(oe).PURCHASE && s(g),
1760
1758
  row: P,
1761
- "template-item": (ft = (Oe = (ke = (W = n.modelValue) == null ? void 0 : W.templateDoc) == null ? void 0 : ke.purchaseOrder) == null ? void 0 : Oe.items) == null ? void 0 : ft.find(
1759
+ "template-item": (ft = (Ne = (he = (W = n.modelValue) == null ? void 0 : W.templateDoc) == null ? void 0 : he.purchaseOrder) == null ? void 0 : Ne.items) == null ? void 0 : ft.find(
1762
1760
  (Ye) => Ye.sku._id === P.original.sku._id
1763
1761
  ),
1764
1762
  "onUpdate:item": w[13] || (w[13] = (Ye) => Fe.value.updateItem(Ye)),
@@ -1767,14 +1765,14 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1767
1765
  ];
1768
1766
  }),
1769
1767
  "list-row": R((P) => [
1770
- (k(), Q(Ct, {
1768
+ (S(), Q(Ct, {
1771
1769
  row: P,
1772
1770
  key: s(t).items.map((W) => W.sku._id).join(".")
1773
1771
  }, {
1774
1772
  default: R((W) => [
1775
- b(Os, {
1773
+ b(Ns, {
1776
1774
  "compare-price-by-sku": s(J),
1777
- "show-compare-price": T.value === s(oe).PURCHASE && s(_),
1775
+ "show-compare-price": T.value === s(oe).PURCHASE && s(g),
1778
1776
  row: P,
1779
1777
  "cell-by-col-id": W
1780
1778
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
@@ -1793,45 +1791,45 @@ const oo = { class: "hover:bg-fm-color-opacity-sm" }, no = { class: "flex items-
1793
1791
  };
1794
1792
  }
1795
1793
  });
1796
- function Lo(f, x) {
1794
+ function Ho(f, x) {
1797
1795
  x ?? (x = `Return to ${f.supplier.name}`);
1798
- const i = je().currentLocation, S = ys(i), t = {};
1799
- for (const p of f.items) {
1800
- const u = p.sku._id;
1796
+ const l = je().currentLocation, C = bs(l), t = {};
1797
+ for (const d of f.items) {
1798
+ const u = d.sku._id;
1801
1799
  t[u] = we.reset();
1802
1800
  }
1803
- const d = f.deliveryOrder.flatMap((p) => p.received);
1804
- for (const p of d) {
1805
- const u = p.sku._id;
1801
+ const m = f.deliveryOrder.flatMap((d) => d.received);
1802
+ for (const d of m) {
1803
+ const u = d.sku._id;
1806
1804
  if (!t[u]) continue;
1807
- const g = p.measurement ? we.multiply([p.measurement.conversion, p.amount]) : p.amount;
1808
- t[u] = we.add([t[u], g]);
1805
+ const h = d.measurement ? we.multiply([d.measurement.conversion, d.amount]) : d.amount;
1806
+ t[u] = we.add([t[u], h]);
1809
1807
  }
1810
1808
  return {
1811
1809
  _id: f._id,
1812
1810
  name: x,
1813
1811
  purchaseOrder: {
1814
- supplier: S,
1812
+ supplier: C,
1815
1813
  ref: f.ref,
1816
1814
  remark: f.remark,
1817
- items: f.items.map((p) => {
1818
- const u = p.measurement ? we.divide([t[p.sku._id], p.measurement.conversion]) : t[p.sku._id];
1815
+ items: f.items.map((d) => {
1816
+ const u = d.measurement ? we.divide([t[d.sku._id], d.measurement.conversion]) : t[d.sku._id];
1819
1817
  return {
1820
- sku: p.sku,
1821
- code: p.code,
1822
- name: p.name,
1818
+ sku: d.sku,
1819
+ code: d.code,
1820
+ name: d.name,
1823
1821
  quantityStep: {
1824
1822
  amount: 1,
1825
- precision: He(p.sku.unit, p.measurement)
1823
+ precision: st(d.sku.unit, d.measurement)
1826
1824
  },
1827
1825
  quantity: u,
1828
1826
  maximumQuantity: u
1829
1827
  };
1830
- }).filter((p) => p.maximumQuantity.amount > 0)
1828
+ }).filter((d) => d.maximumQuantity.amount > 0)
1831
1829
  }
1832
1830
  };
1833
1831
  }
1834
- const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-800" }, Qo = { class: "flex gap-4" }, Yo = /* @__PURE__ */ ae({
1832
+ const jo = { class: "flex items-center" }, Qo = { class: "fm-typo-en-title-md-800" }, Yo = { class: "flex gap-4" }, Ko = /* @__PURE__ */ ae({
1835
1833
  __name: "TransferDialog",
1836
1834
  props: {
1837
1835
  mode: {},
@@ -1845,14 +1843,14 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
1845
1843
  emits: ["update:show", "submitted"],
1846
1844
  setup(f, { expose: x, emit: r }) {
1847
1845
  var G;
1848
- const i = f, S = r, t = ot(), d = $t(), p = De(), u = lt(), g = je(), { t: o } = pe(), e = q(!1), a = q(!1), m = q(!1), v = Rt();
1849
- async function h(C) {
1850
- if (C) {
1851
- a.value = !1;
1846
+ const l = f, C = r, t = ot(), m = $t(), d = De(), u = lt(), h = je(), { t: o } = fe(), e = A(!1), i = A(!1), c = A(!1), y = Rt();
1847
+ async function k(_) {
1848
+ if (_) {
1849
+ i.value = !1;
1852
1850
  try {
1853
- await u.readSuppliers(), a.value = !0;
1851
+ await u.readSuppliers(), i.value = !0;
1854
1852
  } catch {
1855
- p.open({
1853
+ d.open({
1856
1854
  title: o("inventory.transfer.form.unableToFetchListOfSuppliers.title"),
1857
1855
  message: o("inventory.transfer.form.unableToFetchListOfSuppliers.message"),
1858
1856
  type: "error"
@@ -1860,9 +1858,9 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
1860
1858
  }
1861
1859
  }
1862
1860
  }
1863
- g.watchLocation(h);
1861
+ h.watchLocation(k);
1864
1862
  function I() {
1865
- const C = {
1863
+ const _ = {
1866
1864
  remark: void 0,
1867
1865
  ref: void 0,
1868
1866
  stockSnapshotId: void 0,
@@ -1891,27 +1889,27 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
1891
1889
  _id: "",
1892
1890
  seqNumber: 0,
1893
1891
  deliveryOrder: [],
1894
- template: i.templateId,
1895
- templateDoc: d.templates.find((_) => _._id === i.templateId)
1892
+ template: l.templateId,
1893
+ templateDoc: m.templates.find((g) => g._id === l.templateId)
1896
1894
  };
1897
- if (i.returnFrom) {
1898
- const _ = Lo(i.returnFrom);
1899
- C.templateDoc = _, C.template = _._id, C.supplier = _.purchaseOrder.supplier ?? C.supplier, C.items = _.purchaseOrder.items ?? [], C.isReturnPo = !0;
1895
+ if (l.returnFrom) {
1896
+ const g = Ho(l.returnFrom);
1897
+ _.templateDoc = g, _.template = g._id, _.supplier = g.purchaseOrder.supplier ?? _.supplier, _.items = g.purchaseOrder.items ?? [], _.isReturnPo = !0;
1900
1898
  }
1901
- return C;
1899
+ return _;
1902
1900
  }
1903
- const c = Ft(i, "show"), y = q(i.modelValue ?? I()), E = q(((G = i.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
1904
- _e(
1905
- () => i.show,
1906
- (C) => {
1907
- var _;
1908
- C && (m.value = !1, y.value = i.modelValue ?? I(), E.value = ((_ = i.modelValue) == null ? void 0 : _._id) ?? `${Math.random()}`);
1901
+ const v = Ft(l, "show"), p = A(l.modelValue ?? I()), V = A(((G = l.modelValue) == null ? void 0 : G._id) ?? `${Math.random()}`);
1902
+ be(
1903
+ () => l.show,
1904
+ (_) => {
1905
+ var g;
1906
+ _ && (c.value = !1, p.value = l.modelValue ?? I(), V.value = ((g = l.modelValue) == null ? void 0 : g._id) ?? `${Math.random()}`);
1909
1907
  }
1910
1908
  );
1911
- const L = O(() => !a.value || !m.value), $ = O(() => {
1912
- if (i.returnFrom)
1909
+ const L = O(() => !i.value || !c.value), $ = O(() => {
1910
+ if (l.returnFrom)
1913
1911
  return "Return transfer";
1914
- switch (i.mode) {
1912
+ switch (l.mode) {
1915
1913
  case Re.READ:
1916
1914
  return "View transfer";
1917
1915
  case Re.CREATE:
@@ -1920,150 +1918,166 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
1920
1918
  return o("inventory.transfer.receiveRequest.update.title");
1921
1919
  }
1922
1920
  return "";
1923
- }), T = q();
1921
+ }), T = A();
1924
1922
  x({
1925
1923
  validateInputs: () => {
1926
- var C, _;
1927
- (_ = (C = T.value) == null ? void 0 : C.validateInputs) == null || _.call(C);
1924
+ var _, g;
1925
+ (g = (_ = T.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
1928
1926
  },
1929
1927
  resetInputsValidation: () => {
1930
- var C, _;
1931
- (_ = (C = T.value) == null ? void 0 : C.resetInputsValidation) == null || _.call(C);
1928
+ var _, g;
1929
+ (g = (_ = T.value) == null ? void 0 : _.resetInputsValidation) == null || g.call(_);
1932
1930
  },
1933
1931
  resetInputs: () => {
1934
- var C, _;
1935
- (_ = (C = T.value) == null ? void 0 : C.resetInputs) == null || _.call(C);
1932
+ var _, g;
1933
+ (g = (_ = T.value) == null ? void 0 : _.resetInputs) == null || g.call(_);
1936
1934
  }
1937
1935
  });
1938
1936
  async function Y() {
1939
- var _;
1940
- if (!(!await v.confirmation(
1937
+ var g;
1938
+ if (!(!await y.confirmation(
1941
1939
  "Submit return stock request?",
1942
1940
  "Stock will be deducted upon confirmation."
1943
- ) || !y.value || !i.returnFrom)) {
1941
+ ) || !p.value || !l.returnFrom)) {
1944
1942
  e.value = !0;
1945
1943
  try {
1946
- await ((_ = i["onSubmit:returnStock"]) == null ? void 0 : _.call(i, y.value, i.returnFrom));
1944
+ await ((g = l["onSubmit:returnStock"]) == null ? void 0 : g.call(l, p.value, l.returnFrom));
1947
1945
  } catch (M) {
1948
- p.open({
1946
+ d.open({
1949
1947
  title: o("inventory.transfer.receiveRequest.create.error.title"),
1950
1948
  message: o("inventory.transfer.receiveRequest.create.error.message"),
1951
1949
  type: "error"
1952
1950
  }), console.error("Error in creating purchase order", M);
1953
1951
  } finally {
1954
- e.value = !1, S("update:show", !1);
1952
+ e.value = !1, C("update:show", !1);
1955
1953
  }
1956
1954
  }
1957
1955
  }
1958
1956
  async function z() {
1959
- const C = y.value;
1960
- e.value = !0, C.items.some((_) => {
1957
+ const _ = p.value;
1958
+ if (e.value = !0, _.items.some((g) => {
1961
1959
  var M;
1962
- return (M = _.subItems) == null ? void 0 : M.length;
1963
- }) && (C.items = C.items.map((_) => {
1960
+ return (M = g.subItems) == null ? void 0 : M.length;
1961
+ }) && (_.items = _.items.map((g) => {
1964
1962
  var J;
1965
- if (!((J = _.subItems) != null && J.length)) return _;
1966
- const M = Je(_.subItems);
1963
+ if (!((J = g.subItems) != null && J.length)) return g;
1964
+ const M = Ge(g.subItems);
1967
1965
  return {
1968
- ..._,
1966
+ ...g,
1969
1967
  quantity: M,
1970
1968
  // note: no measurement, total is calculate in base unit
1971
1969
  measurement: null,
1972
- totalCost: ge(_.sku, M)
1970
+ totalCost: ye(g.sku, M)
1973
1971
  };
1974
- })), (C.supplier.internal === "warehouse" || C.supplier.internal === "restaurant") && (C.items = C.items.map(({ totalCost: _, ...M }) => M));
1972
+ })), _.items = _.items.filter((g) => g.quantity.amount <= 0), !_.items.length) {
1973
+ d.open({
1974
+ title: "Cannot create order",
1975
+ message: "There are no items with non-zero amount in your request.",
1976
+ type: "error"
1977
+ });
1978
+ return;
1979
+ }
1980
+ (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
1975
1981
  try {
1976
- await t.createPurchaseOrder(C), await new Promise((_) => setTimeout(_, 1e3)), p.open({
1982
+ await t.createPurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), d.open({
1977
1983
  title: o("inventory.transfer.receiveRequest.create.success"),
1978
1984
  message: o("inventory.transfer.receiveRequest.create.successMessage"),
1979
1985
  type: "success"
1980
- }), S("update:show", !1), S("submitted");
1981
- } catch (_) {
1982
- p.open({
1986
+ }), C("update:show", !1), C("submitted");
1987
+ } catch (g) {
1988
+ d.open({
1983
1989
  title: o("inventory.transfer.receiveRequest.create.error.title"),
1984
1990
  message: o("inventory.transfer.receiveRequest.create.error.message"),
1985
1991
  type: "error"
1986
- }), console.error("Error in creating purchase order", _);
1992
+ }), console.error("Error in creating purchase order", g);
1987
1993
  } finally {
1988
1994
  e.value = !1;
1989
1995
  }
1990
1996
  }
1991
- async function A() {
1992
- const C = y.value;
1993
- e.value = !0, C.items.some((_) => {
1997
+ async function E() {
1998
+ const _ = p.value;
1999
+ if (e.value = !0, _.items.some((g) => {
1994
2000
  var M;
1995
- return (M = _.subItems) == null ? void 0 : M.length;
1996
- }) && (C.items = C.items.map((_) => {
2001
+ return (M = g.subItems) == null ? void 0 : M.length;
2002
+ }) && (_.items = _.items.map((g) => {
1997
2003
  var J;
1998
- if (!((J = _.subItems) != null && J.length)) return _;
1999
- const M = Je(_.subItems);
2004
+ if (!((J = g.subItems) != null && J.length)) return g;
2005
+ const M = Ge(g.subItems);
2000
2006
  return {
2001
- ..._,
2007
+ ...g,
2002
2008
  quantity: M,
2003
2009
  // note: no measurement, total is calculate in base unit
2004
2010
  measurement: null,
2005
- totalCost: ge(_.sku, M)
2011
+ totalCost: ye(g.sku, M)
2006
2012
  };
2007
- })), (C.supplier.internal === "warehouse" || C.supplier.internal === "restaurant") && (C.items = C.items.map(({ totalCost: _, ...M }) => M));
2013
+ })), _.items = _.items.filter((g) => g.quantity.amount <= 0), !_.items.length) {
2014
+ d.open({
2015
+ title: "Cannot create order",
2016
+ message: "There are no items with non-zero amount in your request.",
2017
+ type: "error"
2018
+ });
2019
+ return;
2020
+ }
2021
+ (_.supplier.internal === "warehouse" || _.supplier.internal === "restaurant") && (_.items = _.items.map(({ totalCost: g, ...M }) => M));
2008
2022
  try {
2009
- await t.updatePurchaseOrder(C), await new Promise((_) => setTimeout(_, 1e3)), p.open({
2023
+ await t.updatePurchaseOrder(_), await new Promise((g) => setTimeout(g, 1e3)), d.open({
2010
2024
  title: o("inventory.transfer.receiveRequest.update.success"),
2011
2025
  message: o("inventory.transfer.receiveRequest.update.successMessage"),
2012
2026
  type: "success"
2013
- }), S("update:show", !1), S("submitted");
2014
- } catch (_) {
2015
- p.open({
2027
+ }), C("update:show", !1), C("submitted");
2028
+ } catch (g) {
2029
+ d.open({
2016
2030
  title: o("inventory.transfer.receiveRequest.update.error.title"),
2017
2031
  message: o("inventory.transfer.receiveRequest.update.error.message"),
2018
2032
  type: "error"
2019
- }), console.error("Error in updating purchase order", _);
2033
+ }), console.error("Error in updating purchase order", g);
2020
2034
  } finally {
2021
2035
  e.value = !1;
2022
2036
  }
2023
2037
  }
2024
2038
  function j() {
2025
- switch (i.mode) {
2039
+ switch (l.mode) {
2026
2040
  case Re.CREATE:
2027
- return i.returnFrom ? Y() : z();
2041
+ return l.returnFrom ? Y() : z();
2028
2042
  case Re.UPDATE:
2029
- return A();
2043
+ return E();
2030
2044
  }
2031
2045
  }
2032
2046
  function B() {
2033
- var C, _;
2034
- (_ = (C = T.value) == null ? void 0 : C.validateInputs) == null || _.call(C);
2047
+ var _, g;
2048
+ (g = (_ = T.value) == null ? void 0 : _.validateInputs) == null || g.call(_);
2035
2049
  }
2036
- return (C, _) => {
2050
+ return (_, g) => {
2037
2051
  const M = D("FmButton"), J = D("FmSideSheet");
2038
- return k(), Q(J, {
2039
- modelValue: s(c),
2040
- "onUpdate:modelValue": _[3] || (_[3] = (re) => Ce(c) ? c.value = re : null),
2052
+ return S(), Q(J, {
2053
+ modelValue: s(v),
2054
+ "onUpdate:modelValue": g[3] || (g[3] = (le) => Ce(v) ? v.value = le : null),
2041
2055
  "dismiss-away": "",
2042
2056
  "close-button": "",
2043
2057
  "max-width": 900
2044
2058
  }, {
2045
2059
  "side-sheet-header": R(() => [
2046
- l("div", Ho, [
2047
- l("div", jo, V($.value), 1)
2060
+ a("div", jo, [
2061
+ a("div", Qo, q($.value), 1)
2048
2062
  ])
2049
2063
  ]),
2050
2064
  default: R(() => [
2051
- (k(), Q(zo, {
2065
+ (S(), Q(Lo, {
2052
2066
  class: "w-full",
2053
2067
  ref_key: "formRef",
2054
2068
  ref: T,
2055
- "onForm:ready": _[0] || (_[0] = () => m.value = !0),
2069
+ "onForm:ready": g[0] || (g[0] = () => c.value = !0),
2056
2070
  onValidationSuccess: j,
2057
- modelValue: y.value,
2058
- "onUpdate:modelValue": _[1] || (_[1] = (re) => y.value = re),
2071
+ modelValue: p.value,
2072
+ "onUpdate:modelValue": g[1] || (g[1] = (le) => p.value = le),
2059
2073
  disabled: e.value || L.value,
2060
- "return-from": C.returnFrom,
2061
- key: E.value,
2062
- "last-closing-date": C.lastClosingDate
2074
+ "return-from": _.returnFrom,
2075
+ key: V.value,
2076
+ "last-closing-date": _.lastClosingDate
2063
2077
  }, null, 8, ["modelValue", "disabled", "return-from", "last-closing-date"]))
2064
2078
  ]),
2065
2079
  "side-sheet-footer": R(() => [
2066
- l("div", Qo, [
2080
+ a("div", Yo, [
2067
2081
  b(M, {
2068
2082
  loading: e.value,
2069
2083
  disabled: L.value,
@@ -2074,7 +2088,7 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
2074
2088
  disabled: L.value,
2075
2089
  variant: "tertiary",
2076
2090
  label: s(o)("common.close"),
2077
- onClick: _[2] || (_[2] = (re) => S("update:show", !1))
2091
+ onClick: g[2] || (g[2] = (le) => C("update:show", !1))
2078
2092
  }, null, 8, ["disabled", "label"])
2079
2093
  ])
2080
2094
  ]),
@@ -2083,62 +2097,52 @@ const Ho = { class: "flex items-center" }, jo = { class: "fm-typo-en-title-md-80
2083
2097
  };
2084
2098
  }
2085
2099
  });
2086
- function Ko(f) {
2087
- const [x, r, i, ...S] = Wt(f), t = i.map((g) => g.toLowerCase().trim().replace(/ /g, "_")), p = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((g) => !t.includes(g));
2088
- if (p.length)
2100
+ function Xo(f) {
2101
+ const [x, ...r] = es(f), l = x.map((d) => d.toLowerCase().trim().replace(/ /g, "_")), t = ["item_code", "quantity"].filter((d) => !l.includes(d));
2102
+ if (t.length)
2089
2103
  throw new Error(
2090
- `Missing headers (${p.join()}). Excel file does not come from the template.`
2104
+ `Missing headers (${t.join()}). Excel file does not come from the template.`
2091
2105
  );
2092
- return S.map((g, o) => {
2093
- const e = {};
2094
- for (const a in t) {
2095
- const m = t[a];
2096
- Object.assign(e, { [m]: g[a] });
2106
+ return r.map((d, u) => {
2107
+ const h = {};
2108
+ for (const o in l) {
2109
+ const e = l[o];
2110
+ Object.assign(h, { [e]: d[o] });
2097
2111
  }
2098
2112
  return {
2099
- index: o,
2100
- data: e
2113
+ index: u,
2114
+ data: h
2101
2115
  };
2102
2116
  });
2103
2117
  }
2104
- function Xo(f) {
2118
+ function Zo(f) {
2105
2119
  const x = f.SheetNames;
2106
2120
  try {
2107
2121
  return x.reduce(
2108
- (i, S) => {
2109
- const t = new Array(), d = f.Sheets[S], p = tt(), u = Ko(d), g = [];
2110
- for (const { index: e, data: a } of u) {
2111
- a.scanned_code === "" && t.push(`Row ${e + 1}: Scanned code is empty`), a.item_name === "" && t.push(`Row ${e + 1}: Item name is empty`), a.uom === "" && t.push(`Row ${e + 1}: UOM is empty`), a["transfer_quantity(uom)"] === "" && t.push(`Row ${e + 1}: Transfer quantity is empty`);
2112
- const m = p.skus.find((I) => I.code === a.scanned_code);
2113
- if (!m) {
2122
+ (l, C) => {
2123
+ const t = new Array(), m = f.Sheets[C], d = et(), u = Xo(m), h = [];
2124
+ for (const { index: e, data: i } of u) {
2125
+ i.item_code === "" && t.push(`Row ${e + 1}: Item code is empty`), i.quantity === "" && t.push(`Row ${e + 1}: Quantity is empty`);
2126
+ const c = d.skus.find((k) => k.code === i.item_code);
2127
+ if (!c) {
2114
2128
  t.push(`Row ${e + 1}: SKU not found`);
2115
2129
  continue;
2116
2130
  }
2117
- const v = m.unit.abbrev === a.uom;
2118
- let h = null;
2119
- if (!v) {
2120
- const I = m.unit.measurements.find((c) => c.abbrev === a.uom);
2121
- if (!I) {
2122
- t.push(`Row ${e + 1}: Measurement not found`);
2123
- continue;
2124
- }
2125
- h = I;
2126
- }
2127
- g.push({
2128
- sku: m,
2129
- code: a.scanned_code,
2130
- name: a.item_name,
2131
- quantity: we.fromNumber(Number(a["transfer_quantity(uom)"])),
2132
- measurement: h
2131
+ h.push({
2132
+ sku: c,
2133
+ code: i.item_code,
2134
+ name: c.name,
2135
+ quantity: we.fromNumber(Number(i.quantity)),
2136
+ measurement: null
2133
2137
  });
2134
2138
  }
2135
2139
  const o = {
2136
2140
  type: "create",
2137
- poItems: g,
2138
- excelSheetName: S,
2141
+ poItems: h,
2142
+ excelSheetName: C,
2139
2143
  errors: t
2140
2144
  };
2141
- return i.importCreateResult.push(o), i;
2145
+ return l.importCreateResult.push(o), l;
2142
2146
  },
2143
2147
  {
2144
2148
  invalidExcel: !1,
@@ -2153,12 +2157,12 @@ function Xo(f) {
2153
2157
  };
2154
2158
  }
2155
2159
  }
2156
- const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = { class: "flex flex-col" }, Wo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, en = {
2160
+ const Go = exports.FfCalculator, Jo = { class: "flex flex-col flex-1" }, Wo = { class: "flex flex-col" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, tn = {
2157
2161
  key: 0,
2158
2162
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
2159
- }, tn = { key: 0 }, sn = {
2160
- class: /* @__PURE__ */ Z(["fm-typo-en-body-lg-600"])
2161
- }, on = { class: "flex-1" }, nn = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, an = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, ln = { class: "text-fm-color-typo-primary" }, rn = { class: "ml-auto" }, un = { key: 0 }, mn = /* @__PURE__ */ ae({
2163
+ }, sn = { key: 0 }, on = {
2164
+ class: /* @__PURE__ */ X(["fm-typo-en-body-lg-600"])
2165
+ }, nn = { class: "flex-1" }, an = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, ln = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, rn = { class: "text-fm-color-typo-primary" }, un = { class: "ml-auto" }, mn = { key: 0 }, dn = /* @__PURE__ */ ae({
2162
2166
  __name: "XilnexResult",
2163
2167
  props: {
2164
2168
  type: {},
@@ -2167,51 +2171,51 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2167
2171
  errors: {}
2168
2172
  },
2169
2173
  setup(f) {
2170
- const x = f, { t: r } = pe(), i = q(!1), S = () => {
2171
- x.errors.length && (i.value = !i.value);
2174
+ const x = f, { t: r } = fe(), l = A(!1), C = () => {
2175
+ x.errors.length && (l.value = !l.value);
2172
2176
  };
2173
- return (t, d) => {
2174
- var g;
2175
- const p = D("FmIcon"), u = D("FmTooltip");
2176
- return k(), F("div", Go, [
2177
- l("div", {
2178
- onClick: S,
2179
- class: Z({
2177
+ return (t, m) => {
2178
+ var h;
2179
+ const d = D("FmIcon"), u = D("FmTooltip");
2180
+ return S(), F("div", Jo, [
2181
+ a("div", {
2182
+ onClick: C,
2183
+ class: X({
2180
2184
  "cursor-pointer": t.errors.length
2181
2185
  })
2182
2186
  }, [
2183
- l("div", Jo, [
2184
- l("div", Wo, [
2185
- l("div", {
2186
- class: Z({
2187
+ a("div", Wo, [
2188
+ a("div", en, [
2189
+ a("div", {
2190
+ class: X({
2187
2191
  "text-fm-color-system-error-300": t.errors.length
2188
2192
  })
2189
2193
  }, [
2190
- Ie(V(t.name) + " ", 1),
2191
- t.type === "create" ? (k(), F("span", en, "(" + V(s(r)("inventory.closing.template.import.new")) + ")", 1)) : N("", !0)
2194
+ Ie(q(t.name) + " ", 1),
2195
+ t.type === "create" ? (S(), F("span", tn, "(" + q(s(r)("inventory.closing.template.import.new")) + ")", 1)) : N("", !0)
2192
2196
  ], 2),
2193
- t.errors.length ? (k(), F("div", tn, [
2194
- b(p, {
2197
+ t.errors.length ? (S(), F("div", sn, [
2198
+ b(d, {
2195
2199
  name: "error",
2196
2200
  size: "sm",
2197
2201
  color: "system-error-300"
2198
2202
  })
2199
2203
  ])) : N("", !0)
2200
2204
  ]),
2201
- d[0] || (d[0] = l("hr", { class: "my-2" }, null, -1)),
2202
- l("div", sn, [
2203
- (g = t.items) != null && g.length ? (k(!0), F(ne, { key: 0 }, he(t.items, (o, e) => (k(), F("div", {
2205
+ m[0] || (m[0] = a("hr", { class: "my-2" }, null, -1)),
2206
+ a("div", on, [
2207
+ (h = t.items) != null && h.length ? (S(!0), F(ne, { key: 0 }, ge(t.items, (o, e) => (S(), F("div", {
2204
2208
  key: e,
2205
2209
  class: "flex gap-4 mt-2 items-center"
2206
2210
  }, [
2207
- l("div", on, [
2211
+ a("div", nn, [
2208
2212
  b(u, {
2209
2213
  content: o.code,
2210
2214
  placement: "top",
2211
2215
  "z-index": 51
2212
2216
  }, {
2213
2217
  default: R(() => [
2214
- l("span", nn, V(o.code), 1)
2218
+ a("span", an, q(o.code), 1)
2215
2219
  ]),
2216
2220
  _: 2
2217
2221
  }, 1032, ["content"]),
@@ -2221,62 +2225,62 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2221
2225
  "z-index": 51
2222
2226
  }, {
2223
2227
  default: R(() => [
2224
- l("span", an, V(o.name), 1)
2228
+ a("span", ln, q(o.name), 1)
2225
2229
  ]),
2226
2230
  _: 2
2227
2231
  }, 1032, ["content"])
2228
2232
  ]),
2229
- l("div", null, [
2230
- l("span", ln, V(s(Zo).toFormatString({
2233
+ a("div", null, [
2234
+ a("span", rn, q(s(Go).toFormatString({
2231
2235
  value: o.quantity
2232
2236
  })), 1),
2233
- Ie(" " + V(o.measurement ? o.measurement.abbrev : o.sku.unit.abbrev), 1)
2237
+ Ie(" " + q(o.measurement ? o.measurement.abbrev : o.sku.unit.abbrev), 1)
2234
2238
  ])
2235
2239
  ]))), 128)) : N("", !0)
2236
2240
  ])
2237
2241
  ]),
2238
- l("div", rn, [
2239
- t.errors.length ? (k(), Q(p, {
2242
+ a("div", un, [
2243
+ t.errors.length ? (S(), Q(d, {
2240
2244
  key: 0,
2241
- name: i.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
2245
+ name: l.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
2242
2246
  size: "md"
2243
2247
  }, null, 8, ["name"])) : N("", !0)
2244
2248
  ])
2245
2249
  ], 2),
2246
- i.value ? (k(), F("div", {
2250
+ l.value ? (S(), F("div", {
2247
2251
  key: 0,
2248
- class: Z(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
2252
+ class: X(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
2249
2253
  "text-fm-color-typo-secondary": !t.errors.length,
2250
2254
  "text-fm-color-system-error-300": t.errors.length
2251
2255
  }])
2252
2256
  }, [
2253
- t.errors.length ? (k(), F("div", un, [
2254
- l("ol", null, [
2255
- (k(!0), F(ne, null, he(t.errors, (o, e) => (k(), F("li", { key: e }, V(o), 1))), 128))
2257
+ t.errors.length ? (S(), F("div", mn, [
2258
+ a("ol", null, [
2259
+ (S(!0), F(ne, null, ge(t.errors, (o, e) => (S(), F("li", { key: e }, q(o), 1))), 128))
2256
2260
  ])
2257
2261
  ])) : N("", !0)
2258
2262
  ], 2)) : N("", !0)
2259
2263
  ]);
2260
2264
  };
2261
2265
  }
2262
- }), dn = { class: "flex flex-col gap-24" }, cn = {
2266
+ }), cn = { class: "flex flex-col gap-24" }, pn = {
2263
2267
  key: 0,
2264
2268
  class: "flex items-center gap-8"
2265
- }, pn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, fn = { class: "flex flex-col gap-8" }, vn = { class: "line-clamp-2 text-ellipsis break-all" }, yn = {
2269
+ }, fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vn = { class: "flex flex-col gap-8" }, yn = { class: "line-clamp-2 text-ellipsis break-all" }, bn = {
2266
2270
  key: 2,
2267
2271
  class: "shrink-0"
2268
- }, bn = {
2272
+ }, gn = {
2269
2273
  key: 0,
2270
2274
  class: "flex flex-col"
2271
- }, gn = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, _n = {
2275
+ }, _n = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, hn = {
2272
2276
  key: 0,
2273
2277
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
2274
- }, hn = { class: "fm-typo-en-body-lg-600" }, gt = "Transfer note", kn = /* @__PURE__ */ ae({
2278
+ }, kn = { class: "fm-typo-en-body-lg-600" }, gt = "Transfer note", xn = /* @__PURE__ */ ae({
2275
2279
  __name: "XilnexImportForm",
2276
2280
  setup(f, { expose: x }) {
2277
- const r = q(null), i = De(), S = q(!1), t = q(!1), d = st();
2278
- q(!1), Le();
2279
- const p = q([
2281
+ const r = A(null), l = De(), C = A(!1), t = A(!1), m = tt();
2282
+ A(!1), He();
2283
+ const d = A([
2280
2284
  {
2281
2285
  label: "LMSL389 MSU Medical Centre",
2282
2286
  value: {
@@ -2290,17 +2294,24 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2290
2294
  netsuiteId: "1463",
2291
2295
  name: "LMSL540 Central I-City"
2292
2296
  }
2297
+ },
2298
+ {
2299
+ label: "LMSL572 Giant Shah Alam Stadium",
2300
+ value: {
2301
+ netsuiteId: "1521",
2302
+ name: "LMSL572 Giant Shah Alam Stadium"
2303
+ }
2293
2304
  }
2294
2305
  ]), u = O({
2295
2306
  get() {
2296
- var c;
2297
- return ((c = d.supplier) == null ? void 0 : c.name) ?? "";
2307
+ var v;
2308
+ return ((v = m.supplier) == null ? void 0 : v.name) ?? "";
2298
2309
  },
2299
- set(c) {
2300
- c && (d.supplier = {
2301
- name: c.name,
2310
+ set(v) {
2311
+ v && (m.supplier = {
2312
+ name: v.name,
2302
2313
  registrationNumber: "",
2303
- _id: c.netsuiteId,
2314
+ _id: v.netsuiteId,
2304
2315
  internal: "restaurant",
2305
2316
  address: {
2306
2317
  line1: "",
@@ -2312,181 +2323,181 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2312
2323
  }
2313
2324
  });
2314
2325
  }
2315
- }), g = O({
2326
+ }), h = O({
2316
2327
  get() {
2317
2328
  return "";
2318
2329
  },
2319
- set(c) {
2320
- if (c) {
2321
- const y = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [E, L, $] = c.split("-");
2322
- y.setFullYear(parseInt(E)), y.setMonth(parseInt(L) - 1), y.setDate(parseInt($)), d.effectiveAt = y.toISOString();
2330
+ set(v) {
2331
+ if (v) {
2332
+ const p = m.effectiveAt ? new Date(m.effectiveAt) : /* @__PURE__ */ new Date(), [V, L, $] = v.split("-");
2333
+ p.setFullYear(parseInt(V)), p.setMonth(parseInt(L) - 1), p.setDate(parseInt($)), m.effectiveAt = p.toISOString();
2323
2334
  }
2324
2335
  }
2325
2336
  }), o = O({
2326
2337
  get() {
2327
2338
  return null;
2328
2339
  },
2329
- set(c) {
2330
- if (c) {
2331
- const y = d.effectiveAt ? new Date(d.effectiveAt) : /* @__PURE__ */ new Date(), [E, L] = c.split(":");
2332
- y.setMinutes(parseInt(E)), y.setSeconds(parseInt(L)), d.effectiveAt = y.toISOString();
2340
+ set(v) {
2341
+ if (v) {
2342
+ const p = m.effectiveAt ? new Date(m.effectiveAt) : /* @__PURE__ */ new Date(), [V, L] = v.split(":");
2343
+ p.setHours(parseInt(V)), p.setMinutes(parseInt(L)), p.setSeconds(0), p.setMilliseconds(0), m.effectiveAt = p.toISOString();
2333
2344
  }
2334
2345
  }
2335
- }), e = q(new Array()), a = q([]), m = O(
2336
- () => !!e.value.length || a.value.some((c) => c.errors.length)
2337
- ), v = q();
2346
+ }), e = A(new Array()), i = A([]), c = O(
2347
+ () => !!e.value.length || i.value.some((v) => v.errors.length)
2348
+ ), y = A();
2338
2349
  x({
2339
2350
  validateInputs: () => {
2340
- var c, y;
2341
- (y = (c = v.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
2351
+ var v, p;
2352
+ (p = (v = y.value) == null ? void 0 : v.validateInputs) == null || p.call(v);
2342
2353
  },
2343
2354
  resetInputsValidation: () => {
2344
- var c, y;
2345
- (y = (c = v.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
2355
+ var v, p;
2356
+ (p = (v = y.value) == null ? void 0 : v.resetInputsValidation) == null || p.call(v);
2346
2357
  },
2347
2358
  resetInputs: () => {
2348
- var c, y;
2349
- (y = (c = v.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
2359
+ var v, p;
2360
+ (p = (v = y.value) == null ? void 0 : v.resetInputs) == null || p.call(v);
2350
2361
  }
2351
2362
  });
2352
- const { t: h } = pe();
2353
- async function I(c) {
2354
- e.value = [], a.value = [];
2363
+ const { t: k } = fe();
2364
+ async function I(v) {
2365
+ e.value = [], i.value = [];
2355
2366
  try {
2356
- S.value = !0;
2357
- const [y] = await Promise.all([
2358
- ts(c),
2367
+ C.value = !0;
2368
+ const [p] = await Promise.all([
2369
+ ss(v),
2359
2370
  // fake buffer
2360
2371
  new Promise((L) => setTimeout(L, 1e3))
2361
- ]), E = Xo(y);
2362
- if (E.invalidExcel) {
2372
+ ]), V = Zo(p);
2373
+ if (V.invalidExcel) {
2363
2374
  e.value.push(
2364
- E.invalidExcelMessage ?? h("inventory.ingredient.import.fileError.invalidExcel")
2375
+ V.invalidExcelMessage ?? k("inventory.ingredient.import.fileError.invalidExcel")
2365
2376
  );
2366
2377
  return;
2367
2378
  }
2368
- if (a.value = E.importCreateResult, !a.value.length) {
2369
- e.value.push(h("inventory.ingredient.import.fileError.noData"));
2379
+ if (i.value = V.importCreateResult, !i.value.length) {
2380
+ e.value.push(k("inventory.ingredient.import.fileError.noData"));
2370
2381
  return;
2371
2382
  }
2372
- d.items = a.value.map((L) => L.poItems).flat();
2373
- } catch (y) {
2374
- i.open({
2375
- title: h("inventory.ingredient.import.fileError.unableToRead"),
2376
- message: y == null ? void 0 : y.message,
2383
+ m.items = i.value.map((L) => L.poItems).flat();
2384
+ } catch (p) {
2385
+ l.open({
2386
+ title: k("inventory.ingredient.import.fileError.unableToRead"),
2387
+ message: p == null ? void 0 : p.message,
2377
2388
  type: "error"
2378
- }), console.error("Error in reading file", y);
2389
+ }), console.error("Error in reading file", p);
2379
2390
  } finally {
2380
- e.value.length && i.open({
2381
- title: h("inventory.ingredient.import.fileError.invalidExcel"),
2391
+ e.value.length && l.open({
2392
+ title: k("inventory.ingredient.import.fileError.invalidExcel"),
2382
2393
  type: "error"
2383
- }), S.value = !1;
2394
+ }), C.value = !1;
2384
2395
  }
2385
2396
  }
2386
- return _e(r, (c) => {
2387
- c && I(c);
2388
- }), (c, y) => {
2389
- const E = D("FmSelect"), L = D("FmDatePicker"), $ = D("FmTimePicker"), T = D("FmCircularProgress"), Y = D("FmLabel"), z = D("FmIcon"), A = D("FmButton"), j = D("FmForm");
2390
- return k(), Q(j, {
2397
+ return be(r, (v) => {
2398
+ v && I(v);
2399
+ }), (v, p) => {
2400
+ const V = D("FmSelect"), L = D("FmDatePicker"), $ = D("FmTimePicker"), T = D("FmCircularProgress"), Y = D("FmLabel"), z = D("FmIcon"), E = D("FmButton"), j = D("FmForm");
2401
+ return S(), Q(j, {
2391
2402
  ref_key: "formRef",
2392
- ref: v
2403
+ ref: y
2393
2404
  }, {
2394
2405
  default: R(() => [
2395
- l("div", dn, [
2396
- b(E, {
2406
+ a("div", cn, [
2407
+ b(V, {
2397
2408
  modelValue: u.value,
2398
- "onUpdate:modelValue": y[0] || (y[0] = (B) => u.value = B),
2409
+ "onUpdate:modelValue": p[0] || (p[0] = (B) => u.value = B),
2399
2410
  label: "Transfer from",
2400
2411
  searchable: "",
2401
2412
  searchTarget: "label",
2402
- items: p.value,
2403
- rules: [s(Ve)()]
2413
+ items: d.value,
2414
+ rules: [s(qe)()]
2404
2415
  }, null, 8, ["modelValue", "items", "rules"]),
2405
2416
  b(L, {
2406
- modelValue: g.value,
2407
- "onUpdate:modelValue": y[1] || (y[1] = (B) => g.value = B),
2417
+ modelValue: h.value,
2418
+ "onUpdate:modelValue": p[1] || (p[1] = (B) => h.value = B),
2408
2419
  label: "Transfer date",
2409
- rules: [s(Ve)()]
2420
+ rules: [s(qe)()]
2410
2421
  }, null, 8, ["modelValue", "rules"]),
2411
2422
  b($, {
2412
2423
  modelValue: o.value,
2413
- "onUpdate:modelValue": y[2] || (y[2] = (B) => o.value = B),
2424
+ "onUpdate:modelValue": p[2] || (p[2] = (B) => o.value = B),
2414
2425
  label: "Transfer time",
2415
- rules: [s(Ve)()]
2426
+ rules: [s(qe)()]
2416
2427
  }, null, 8, ["modelValue", "rules"]),
2417
- t.value ? (k(), F("div", cn, [
2418
- l("div", null, [
2428
+ t.value ? (S(), F("div", pn, [
2429
+ a("div", null, [
2419
2430
  b(T, {
2420
2431
  size: "md",
2421
2432
  color: "neutral-gray-200"
2422
2433
  })
2423
2434
  ]),
2424
- l("div", pn, V(s(h)("inventory.formField.loading")), 1)
2425
- ])) : (k(), F(ne, { key: 1 }, [
2426
- b(es, {
2435
+ a("div", fn, q(s(k)("inventory.formField.loading")), 1)
2436
+ ])) : (S(), F(ne, { key: 1 }, [
2437
+ b(ts, {
2427
2438
  "max-file-size": 5,
2428
- class: Z({
2439
+ class: X({
2429
2440
  "w-full": !0,
2430
2441
  "h-[200px]": !r.value
2431
2442
  }),
2432
- accept: ".xlsx,.xls",
2443
+ accept: ".xlsx,.xls,.csv",
2433
2444
  label: gt,
2434
- onFileUpload: y[3] || (y[3] = (B) => r.value = B),
2435
- "button-label": s(h)("inventory.ingredient.import.selectFile")
2436
- }, Mt({ _: 2 }, [
2445
+ onFileUpload: p[3] || (p[3] = (B) => r.value = B),
2446
+ "button-label": s(k)("inventory.ingredient.import.selectFile")
2447
+ }, Ut({ _: 2 }, [
2437
2448
  r.value ? {
2438
2449
  name: "default",
2439
2450
  fn: R(({ openFileDialog: B }) => [
2440
2451
  b(Y, null, {
2441
2452
  default: R(() => [
2442
- Ie(V(gt))
2453
+ Ie(q(gt))
2443
2454
  ]),
2444
2455
  _: 1
2445
2456
  }),
2446
- l("div", fn, [
2447
- l("div", {
2448
- class: Z([
2457
+ a("div", vn, [
2458
+ a("div", {
2459
+ class: X([
2449
2460
  "fm-corner-radius-md p-16 flex items-center gap-16",
2450
2461
  {
2451
- "border border-fm-color-neutral-gray-100": S.value,
2452
- "border border-fm-color-neutral-gray-200": !S.value && !m.value,
2453
- "border border-fm-color-system-error-200": m.value
2462
+ "border border-fm-color-neutral-gray-100": C.value,
2463
+ "border border-fm-color-neutral-gray-200": !C.value && !c.value,
2464
+ "border border-fm-color-system-error-200": c.value
2454
2465
  }
2455
2466
  ])
2456
2467
  }, [
2457
- S.value ? (k(), Q(T, {
2468
+ C.value ? (S(), Q(T, {
2458
2469
  key: 0,
2459
2470
  size: "md",
2460
2471
  color: "neutral-gray-200"
2461
- })) : (k(), Q(z, {
2472
+ })) : (S(), Q(z, {
2462
2473
  key: 1,
2463
- name: m.value ? "error" : "attach_file",
2474
+ name: c.value ? "error" : "attach_file",
2464
2475
  outline: "",
2465
- color: m.value ? "system-error-300" : void 0
2476
+ color: c.value ? "system-error-300" : void 0
2466
2477
  }, null, 8, ["name", "color"])),
2467
- l("div", {
2468
- class: Z([
2478
+ a("div", {
2479
+ class: X([
2469
2480
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
2470
2481
  {
2471
- "text-fm-color-typo-disabled": S.value,
2472
- "text-fm-color-typo-primary": !S.value
2482
+ "text-fm-color-typo-disabled": C.value,
2483
+ "text-fm-color-typo-primary": !C.value
2473
2484
  }
2474
2485
  ])
2475
2486
  }, [
2476
- l("div", vn, V(r.value.name), 1)
2487
+ a("div", yn, q(r.value.name), 1)
2477
2488
  ], 2),
2478
- S.value ? N("", !0) : (k(), F("div", yn, [
2479
- b(A, {
2480
- label: s(h)("inventory.ingredient.import.replaceFile"),
2481
- variant: m.value ? "destructive" : "secondary",
2482
- "prepend-icon": m.value ? void 0 : "autorenew",
2489
+ C.value ? N("", !0) : (S(), F("div", bn, [
2490
+ b(E, {
2491
+ label: s(k)("inventory.ingredient.import.replaceFile"),
2492
+ variant: c.value ? "destructive" : "secondary",
2493
+ "prepend-icon": c.value ? void 0 : "autorenew",
2483
2494
  onClick: B
2484
2495
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
2485
2496
  ]))
2486
2497
  ], 2),
2487
- e.value.length ? (k(), F("div", bn, [
2488
- (k(!0), F(ne, null, he(e.value, (G, C) => (k(), F("div", {
2489
- key: C,
2498
+ e.value.length ? (S(), F("div", gn, [
2499
+ (S(!0), F(ne, null, ge(e.value, (G, _) => (S(), F("div", {
2500
+ key: _,
2490
2501
  class: "flex gap-8 items-center"
2491
2502
  }, [
2492
2503
  b(z, {
@@ -2494,7 +2505,7 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2494
2505
  size: "sm",
2495
2506
  color: "system-error-300"
2496
2507
  }),
2497
- l("div", gn, V(G), 1)
2508
+ a("div", _n, q(G), 1)
2498
2509
  ]))), 128))
2499
2510
  ])) : N("", !0)
2500
2511
  ])
@@ -2502,9 +2513,9 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2502
2513
  key: "0"
2503
2514
  } : void 0
2504
2515
  ]), 1032, ["class", "button-label"]),
2505
- r.value ? (k(), F("div", _n, [
2506
- l("div", hn, V(s(h)("inventory.ingredient.import.summary")), 1),
2507
- (k(!0), F(ne, null, he(a.value, (B, G) => (k(), Q(mn, {
2516
+ r.value ? (S(), F("div", hn, [
2517
+ a("div", kn, q(s(k)("inventory.ingredient.import.summary")), 1),
2518
+ (S(!0), F(ne, null, ge(i.value, (B, G) => (S(), Q(dn, {
2508
2519
  key: G,
2509
2520
  name: `Transfer Note ${G + 1}`,
2510
2521
  items: B.poItems,
@@ -2519,61 +2530,61 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2519
2530
  }, 512);
2520
2531
  };
2521
2532
  }
2522
- }), xn = { class: "w-[480px]" }, Sn = /* @__PURE__ */ ae({
2533
+ }), Sn = { class: "w-[480px]" }, Cn = /* @__PURE__ */ ae({
2523
2534
  __name: "XilnexImportDialog",
2524
2535
  props: {
2525
2536
  show: { type: Boolean }
2526
2537
  },
2527
2538
  emits: ["update:show", "submitted"],
2528
2539
  setup(f, { expose: x, emit: r }) {
2529
- const i = r, t = Ft(f, "show"), d = De(), p = ot(), u = q(!1), g = q(), o = q();
2540
+ const l = r, t = Ft(f, "show"), m = De(), d = ot(), u = A(!1), h = A(), o = A();
2530
2541
  x({
2531
2542
  validateInputs: () => {
2532
- var m, v;
2533
- (v = (m = g.value) == null ? void 0 : m.validateInputs) == null || v.call(m);
2543
+ var c, y;
2544
+ (y = (c = h.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
2534
2545
  },
2535
2546
  resetInputsValidation: () => {
2536
- var m, v;
2537
- (v = (m = g.value) == null ? void 0 : m.resetInputsValidation) == null || v.call(m);
2547
+ var c, y;
2548
+ (y = (c = h.value) == null ? void 0 : c.resetInputsValidation) == null || y.call(c);
2538
2549
  },
2539
2550
  resetInputs: () => {
2540
- var m, v;
2541
- (v = (m = g.value) == null ? void 0 : m.resetInputs) == null || v.call(m);
2551
+ var c, y;
2552
+ (y = (c = h.value) == null ? void 0 : c.resetInputs) == null || y.call(c);
2542
2553
  }
2543
2554
  });
2544
2555
  function e() {
2545
- var m, v;
2546
- (v = (m = g.value) == null ? void 0 : m.validateInputs) == null || v.call(m);
2556
+ var c, y;
2557
+ (y = (c = h.value) == null ? void 0 : c.validateInputs) == null || y.call(c);
2547
2558
  }
2548
- async function a() {
2549
- var v, h, I, c, y;
2550
- if (!((h = (v = o.value) == null ? void 0 : v.supplier) != null && h.name)) {
2551
- d.open({
2559
+ async function i() {
2560
+ var y, k, I, v, p;
2561
+ if (!((k = (y = o.value) == null ? void 0 : y.supplier) != null && k.name)) {
2562
+ m.open({
2552
2563
  title: "Upload failed",
2553
2564
  message: "Location is required",
2554
2565
  type: "error"
2555
2566
  });
2556
2567
  return;
2557
2568
  }
2558
- if (!((I = o.value) != null && I.items) || ((y = (c = o.value) == null ? void 0 : c.items) == null ? void 0 : y.length) === 0) {
2559
- d.open({
2569
+ if (!((I = o.value) != null && I.items) || ((p = (v = o.value) == null ? void 0 : v.items) == null ? void 0 : p.length) === 0) {
2570
+ m.open({
2560
2571
  title: "Upload failed",
2561
2572
  message: "No data to upload",
2562
2573
  type: "error"
2563
2574
  });
2564
2575
  return;
2565
2576
  }
2566
- const m = o.value.effectiveAt ? new Date(o.value.effectiveAt) : null;
2567
- if (!m) {
2568
- d.open({
2577
+ const c = o.value.effectiveAt ? new Date(o.value.effectiveAt) : null;
2578
+ if (!c) {
2579
+ m.open({
2569
2580
  title: "Invalid date",
2570
2581
  message: "Transfer date is required",
2571
2582
  type: "error"
2572
2583
  });
2573
2584
  return;
2574
2585
  }
2575
- if (m.getTime() > (/* @__PURE__ */ new Date()).getTime()) {
2576
- d.open({
2586
+ if (c.getTime() > (/* @__PURE__ */ new Date()).getTime()) {
2587
+ m.open({
2577
2588
  title: "Invalid date",
2578
2589
  message: "Transfer date cannot be in the future",
2579
2590
  type: "error"
@@ -2582,37 +2593,37 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2582
2593
  }
2583
2594
  u.value = !0;
2584
2595
  try {
2585
- await p.importFromXilnex(o.value), i("update:show", !1);
2586
- } catch (E) {
2587
- await new Promise((L) => setTimeout(L, 1e3)), d.open({
2596
+ await d.importFromXilnex(o.value), l("update:show", !1);
2597
+ } catch (V) {
2598
+ await new Promise((L) => setTimeout(L, 1e3)), m.open({
2588
2599
  title: "Upload failed",
2589
- message: E == null ? void 0 : E.message,
2600
+ message: V == null ? void 0 : V.message,
2590
2601
  type: "error"
2591
2602
  });
2592
2603
  } finally {
2593
2604
  u.value = !1;
2594
2605
  }
2595
2606
  }
2596
- return (m, v) => {
2597
- const h = D("FmSpacer"), I = D("FmButton"), c = D("FmDialog");
2598
- return k(), Q(c, {
2607
+ return (c, y) => {
2608
+ const k = D("FmSpacer"), I = D("FmButton"), v = D("FmDialog");
2609
+ return S(), Q(v, {
2599
2610
  modelValue: s(t),
2600
- "onUpdate:modelValue": v[2] || (v[2] = (y) => Ce(t) ? t.value = y : null),
2611
+ "onUpdate:modelValue": y[2] || (y[2] = (p) => Ce(t) ? t.value = p : null),
2601
2612
  overlay: !0,
2602
2613
  "close-button": !1
2603
2614
  }, {
2604
- "dialog-header": R(() => v[3] || (v[3] = [
2605
- l("div", null, "Xilnex transfer order", -1)
2615
+ "dialog-header": R(() => y[3] || (y[3] = [
2616
+ a("div", null, "Xilnex transfer order", -1)
2606
2617
  ])),
2607
2618
  "dialog-footer": R(() => [
2608
- b(h, { class: "sm:hidden xs:hidden" }),
2619
+ b(k, { class: "sm:hidden xs:hidden" }),
2609
2620
  b(I, {
2610
2621
  disabled: u.value,
2611
2622
  class: "sm:w-full xs:w-full",
2612
2623
  label: "Cancel",
2613
2624
  size: "md",
2614
2625
  variant: "tertiary",
2615
- onClick: v[1] || (v[1] = (y) => i("update:show", !1))
2626
+ onClick: y[1] || (y[1] = (p) => l("update:show", !1))
2616
2627
  }, null, 8, ["disabled"]),
2617
2628
  b(I, {
2618
2629
  disabled: u.value,
@@ -2625,13 +2636,13 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2625
2636
  }, null, 8, ["disabled", "loading"])
2626
2637
  ]),
2627
2638
  default: R(() => [
2628
- l("div", xn, [
2629
- b(kn, {
2639
+ a("div", Sn, [
2640
+ b(xn, {
2630
2641
  ref_key: "formRef",
2631
- ref: g,
2632
- onValidationSuccess: a,
2642
+ ref: h,
2643
+ onValidationSuccess: i,
2633
2644
  modelValue: o.value,
2634
- "onUpdate:modelValue": v[0] || (v[0] = (y) => o.value = y)
2645
+ "onUpdate:modelValue": y[0] || (y[0] = (p) => o.value = p)
2635
2646
  }, null, 8, ["modelValue"])
2636
2647
  ])
2637
2648
  ]),
@@ -2639,26 +2650,26 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2639
2650
  }, 8, ["modelValue"]);
2640
2651
  };
2641
2652
  }
2642
- }), Cn = { class: "flex flex-col py-8" }, wn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, In = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, Fn = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, $n = {
2653
+ }), wn = { class: "flex flex-col py-8" }, In = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Fn = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, $n = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, Dn = {
2643
2654
  key: 0,
2644
2655
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2645
- }, Dn = { class: "pt-8" }, _t = "ReceiveRequestViewSearchCriteria", Qn = /* @__PURE__ */ ae({
2656
+ }, Tn = { class: "pt-8" }, _t = "ReceiveRequestViewSearchCriteria", Yn = /* @__PURE__ */ ae({
2646
2657
  __name: "ReceiveRequestView",
2647
2658
  setup(f) {
2648
- const { t: x } = pe(), r = De();
2649
- Ne.object({
2650
- name: Ne.string().optional().nullable(),
2651
- startDate: Ne.string().optional().nullable(),
2652
- endDate: Ne.string().optional().nullable()
2659
+ const { t: x } = fe(), r = De();
2660
+ Be.object({
2661
+ name: Be.string().optional().nullable(),
2662
+ startDate: Be.string().optional().nullable(),
2663
+ endDate: Be.string().optional().nullable()
2653
2664
  });
2654
- const i = O(
2655
- () => !e._currentLocation || g.loading.value
2656
- ), S = cs(), t = at();
2657
- function d() {
2665
+ const l = O(
2666
+ () => !e._currentLocation || h.loading.value
2667
+ ), C = ps(), t = at();
2668
+ function m() {
2658
2669
  const $ = {
2659
2670
  name: "",
2660
2671
  ...vt()
2661
- }, T = S.getItem(_t);
2672
+ }, T = C.getItem(_t);
2662
2673
  if (!T)
2663
2674
  return $;
2664
2675
  try {
@@ -2667,34 +2678,34 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2667
2678
  return $;
2668
2679
  }
2669
2680
  }
2670
- function p() {
2671
- S.setItem(_t, JSON.stringify(u.value));
2681
+ function d() {
2682
+ C.setItem(_t, JSON.stringify(u.value));
2672
2683
  }
2673
- const u = q(d()), g = as(
2684
+ const u = A(m()), h = ls(
2674
2685
  Ke.RECEIVE_REQUEST,
2675
2686
  u.value
2676
- ), { columnDefs: o } = ls(
2687
+ ), { columnDefs: o } = rs(
2677
2688
  Ke.RECEIVE_REQUEST,
2678
- g
2689
+ h
2679
2690
  ), e = je();
2680
- async function a() {
2681
- const $ = `inventory-record_${yt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${yt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, T = g.purchaseOrders.value.flatMap(
2682
- (z) => z.items.map((A) => {
2683
- const j = new Date(ms(z._id) ?? ""), B = z.effectiveAt ? new Date(z.effectiveAt) : void 0, G = ue(
2684
- is(A.sku, z.deliveryOrder || [])
2685
- ), C = ue(A.quantity);
2691
+ async function i() {
2692
+ const $ = `inventory-record_${yt(u.value.startDate).format("DD-MM-YYYY_HH-mm")}-${yt(u.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, T = h.purchaseOrders.value.flatMap(
2693
+ (z) => z.items.map((E) => {
2694
+ const j = new Date(ds(z._id) ?? ""), B = z.effectiveAt ? new Date(z.effectiveAt) : void 0, G = me(
2695
+ us(E.sku, z.deliveryOrder || [])
2696
+ ), _ = me(E.quantity);
2686
2697
  return {
2687
- "SKU code": A.code,
2688
- "SKU name": A.name,
2698
+ "SKU code": E.code,
2699
+ "SKU name": E.name,
2689
2700
  "PO #": z.seqNumber,
2690
2701
  "Effective at": B,
2691
2702
  Date: j,
2692
2703
  Status: z.status,
2693
2704
  Reference: z.ref ?? "",
2694
2705
  "Received quantity": G,
2695
- "Ordered quantity": C,
2696
- Unit: A.sku.unit.abbrev,
2697
- "Total cost": A.totalCost ? We(A.totalCost) : null
2706
+ "Ordered quantity": _,
2707
+ Unit: E.sku.unit.abbrev,
2708
+ "Total cost": E.totalCost ? Je(E.totalCost) : null
2698
2709
  };
2699
2710
  })
2700
2711
  ), Y = [
@@ -2708,7 +2719,7 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2708
2719
  "Ordered quantity",
2709
2720
  "Unit"
2710
2721
  ];
2711
- t.enableBackdatePo && Y.insert("Effective at", 4), t.enableTotalCost && Y.push("Total cost"), await ds(
2722
+ t.enableBackdatePo && Y.insert("Effective at", 4), t.enableTotalCost && Y.push("Total cost"), await cs(
2712
2723
  [
2713
2724
  {
2714
2725
  name: "purchases",
@@ -2723,18 +2734,18 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2723
2734
  type: "success"
2724
2735
  });
2725
2736
  }
2726
- const m = q(vt()), v = q("");
2727
- _e([() => m.value], ([$]) => {
2728
- !$.startDate || !$.endDate || (u.value.startDate = $.startDate, u.value.endDate = $.endDate, g.updateDateRange(
2737
+ const c = A(vt()), y = A("");
2738
+ be([() => c.value], ([$]) => {
2739
+ !$.startDate || !$.endDate || (u.value.startDate = $.startDate, u.value.endDate = $.endDate, h.updateDateRange(
2729
2740
  u.value.startDate,
2730
2741
  u.value.endDate
2731
- ), p());
2732
- }), _e([() => v.value], () => {
2733
- p();
2742
+ ), d());
2743
+ }), be([() => y.value], () => {
2744
+ d();
2734
2745
  });
2735
- function h($) {
2746
+ function k($) {
2736
2747
  if ($ === "create") {
2737
- if (i.value) {
2748
+ if (l.value) {
2738
2749
  r.open({
2739
2750
  title: "Loading data...",
2740
2751
  message: "Please wait.",
@@ -2742,26 +2753,28 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2742
2753
  });
2743
2754
  return;
2744
2755
  }
2745
- return g.promptCreateTransferDialog();
2756
+ return h.promptCreateTransferDialog();
2746
2757
  }
2747
- if ($ === "upload")
2748
- return g.promptUploadTransferDialog();
2758
+ if ($ === "upload" && t.enableXilnexTransferNote)
2759
+ return h.promptUploadTransferDialog();
2749
2760
  if ($ === "refresh")
2750
- return g.fetchData();
2761
+ return h.fetchData();
2751
2762
  if ($ === "export")
2752
- return a();
2763
+ return i();
2753
2764
  }
2754
- const { breakpoints: I } = nt(), c = O(() => I.value.xs || I.value.sm), y = O(() => c.value ? 10 : 20), E = ss(), L = O(() => [
2765
+ const { breakpoints: I } = nt(), v = O(() => I.value.xs || I.value.sm), p = O(() => v.value ? 10 : 20), V = os(), L = O(() => [
2755
2766
  {
2756
2767
  label: x("inventory.transfer.receiveRequest.actions.create"),
2757
2768
  value: "create",
2758
2769
  isPrimary: !0,
2759
2770
  prependIcon: "add"
2760
2771
  },
2761
- {
2762
- label: "Upload",
2763
- value: "upload"
2764
- },
2772
+ ...t.enableXilnexTransferNote ? [
2773
+ {
2774
+ label: "Upload",
2775
+ value: "upload"
2776
+ }
2777
+ ] : [],
2765
2778
  {
2766
2779
  label: x("common.refresh"),
2767
2780
  value: "refresh"
@@ -2773,74 +2786,74 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2773
2786
  ]);
2774
2787
  return ($, T) => {
2775
2788
  const Y = D("FmTable");
2776
- return k(), Q(os, {
2789
+ return S(), Q(ns, {
2777
2790
  title: s(x)("inventory.transfer.receiveRequest.title2"),
2778
2791
  actions: L.value,
2779
- "onClick:action": h
2792
+ "onClick:action": k
2780
2793
  }, {
2781
2794
  default: R(() => {
2782
2795
  var z;
2783
2796
  return [
2784
- l("div", {
2785
- class: Z([
2797
+ a("div", {
2798
+ class: X([
2786
2799
  "flex flex-col gap-8 max-h-full",
2787
2800
  {
2788
- "p-0": c.value,
2789
- "px-24 ": !c.value
2801
+ "p-0": v.value,
2802
+ "px-24 ": !v.value
2790
2803
  }
2791
2804
  ])
2792
2805
  }, [
2793
- b(ns, {
2806
+ b(as, {
2794
2807
  "date-range-query": "",
2795
- "date-range": m.value,
2796
- "onUpdate:dateRange": T[0] || (T[0] = (A) => m.value = A),
2808
+ "date-range": c.value,
2809
+ "onUpdate:dateRange": T[0] || (T[0] = (E) => c.value = E),
2797
2810
  searchable: "",
2798
2811
  "change-location": "",
2799
- search: v.value,
2800
- "onUpdate:search": T[1] || (T[1] = (A) => v.value = A)
2812
+ search: y.value,
2813
+ "onUpdate:search": T[1] || (T[1] = (E) => y.value = E)
2801
2814
  }, null, 8, ["date-range", "search"]),
2802
- (k(), Q(Y, {
2803
- style: kt(s(E).tableHeight),
2815
+ (S(), Q(Y, {
2816
+ style: kt(s(V).tableHeight),
2804
2817
  "column-defs": s(o),
2805
- "row-data": s(g).purchaseOrders.value,
2806
- "search-value": v.value,
2807
- loading: i.value,
2808
- onRowClick: T[2] || (T[2] = (A) => s(g).promptShowTransferDetails(A.original)),
2818
+ "row-data": s(h).purchaseOrders.value,
2819
+ "search-value": y.value,
2820
+ loading: l.value,
2821
+ onRowClick: T[2] || (T[2] = (E) => s(h).promptShowTransferDetails(E.original)),
2809
2822
  key: (z = s(e)._currentLocation) == null ? void 0 : z.dbName,
2810
- "page-size": y.value
2823
+ "page-size": p.value
2811
2824
  }, {
2812
- "list-row": R((A) => [
2825
+ "list-row": R((E) => [
2813
2826
  b(Ct, {
2814
- row: A,
2815
- onRowClick: s(g).promptShowTransferDetails
2827
+ row: E,
2828
+ onRowClick: s(h).promptShowTransferDetails
2816
2829
  }, {
2817
2830
  default: R((j) => {
2818
- var B, G, C, _, M, J, re, Fe, $e, Ee, qe, Qe, Ae, n, w, K, se, fe, ve, ye;
2831
+ var B, G, _, g, M, J, le, Fe, $e, Ae, Ee, Qe, Me, ke, n, w, Z, ie, ue, xe;
2819
2832
  return [
2820
- l("div", Cn, [
2821
- l("div", wn, [
2822
- b(s(ce), {
2823
- render: (C = (G = (B = j._id) == null ? void 0 : B.column) == null ? void 0 : G.columnDef) == null ? void 0 : C.cell,
2824
- props: (M = (_ = j._id) == null ? void 0 : _.getContext) == null ? void 0 : M.call(_)
2833
+ a("div", wn, [
2834
+ a("div", In, [
2835
+ b(s(pe), {
2836
+ render: (_ = (G = (B = j._id) == null ? void 0 : B.column) == null ? void 0 : G.columnDef) == null ? void 0 : _.cell,
2837
+ props: (M = (g = j._id) == null ? void 0 : g.getContext) == null ? void 0 : M.call(g)
2825
2838
  }, null, 8, ["render", "props"])
2826
2839
  ]),
2827
- l("div", In, [
2828
- b(s(ce), {
2829
- render: (Fe = (re = (J = j.supplier_name) == null ? void 0 : J.column) == null ? void 0 : re.columnDef) == null ? void 0 : Fe.cell,
2830
- props: (Ee = ($e = j.supplier_name) == null ? void 0 : $e.getContext) == null ? void 0 : Ee.call($e)
2840
+ a("div", Fn, [
2841
+ b(s(pe), {
2842
+ render: (Fe = (le = (J = j.supplier_name) == null ? void 0 : J.column) == null ? void 0 : le.columnDef) == null ? void 0 : Fe.cell,
2843
+ props: (Ae = ($e = j.supplier_name) == null ? void 0 : $e.getContext) == null ? void 0 : Ae.call($e)
2831
2844
  }, null, 8, ["render", "props"])
2832
2845
  ]),
2833
- l("div", Fn, V(A.original.items.map((xe) => `${xe.name}`).join(", ")), 1),
2834
- A.original.ref ? (k(), F("div", $n, [
2835
- b(s(ce), {
2836
- render: (Ae = (Qe = (qe = j.ref) == null ? void 0 : qe.column) == null ? void 0 : Qe.columnDef) == null ? void 0 : Ae.cell,
2837
- props: (w = (n = j.ref) == null ? void 0 : n.getContext) == null ? void 0 : w.call(n)
2846
+ a("div", $n, q(E.original.items.map((_e) => `${_e.name}`).join(", ")), 1),
2847
+ E.original.ref ? (S(), F("div", Dn, [
2848
+ b(s(pe), {
2849
+ render: (Me = (Qe = (Ee = j.ref) == null ? void 0 : Ee.column) == null ? void 0 : Qe.columnDef) == null ? void 0 : Me.cell,
2850
+ props: (n = (ke = j.ref) == null ? void 0 : ke.getContext) == null ? void 0 : n.call(ke)
2838
2851
  }, null, 8, ["render", "props"])
2839
2852
  ])) : N("", !0),
2840
- l("div", Dn, [
2841
- b(s(ce), {
2842
- render: (fe = (se = (K = j.status) == null ? void 0 : K.column) == null ? void 0 : se.columnDef) == null ? void 0 : fe.cell,
2843
- props: (ye = (ve = j.status) == null ? void 0 : ve.getContext) == null ? void 0 : ye.call(ve)
2853
+ a("div", Tn, [
2854
+ b(s(pe), {
2855
+ render: (ie = (Z = (w = j.status) == null ? void 0 : w.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ie.cell,
2856
+ props: (xe = (ue = j.status) == null ? void 0 : ue.getContext) == null ? void 0 : xe.call(ue)
2844
2857
  }, null, 8, ["render", "props"])
2845
2858
  ])
2846
2859
  ])
@@ -2852,23 +2865,23 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2852
2865
  _: 1
2853
2866
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2854
2867
  ], 2),
2855
- (k(), Q(Ut, { to: "body" }, [
2856
- b(Yo, Xe(s(g).transferDialogProps.value, {
2857
- onSubmitted: s(g).fetchData,
2858
- "on-submit:return-stock": (A, j) => s(g).submitAction(
2859
- A,
2868
+ (S(), Q(Ot, { to: "body" }, [
2869
+ b(Ko, Xe(s(h).transferDialogProps.value, {
2870
+ onSubmitted: s(h).fetchData,
2871
+ "on-submit:return-stock": (E, j) => s(h).submitAction(
2872
+ E,
2860
2873
  "returnStock",
2861
2874
  void 0,
2862
2875
  j
2863
2876
  )
2864
2877
  }), null, 16, ["onSubmitted", "on-submit:return-stock"]),
2865
- b(rs, Xe({
2878
+ b(is, Xe({
2866
2879
  scope: s(Ke).RECEIVE_REQUEST
2867
- }, s(g).transferDetailsProps.value, {
2868
- onSubmitted: s(g).fetchData,
2869
- onReturnStock: s(g).promptReturnTransferDialog
2880
+ }, s(h).transferDetailsProps.value, {
2881
+ onSubmitted: s(h).fetchData,
2882
+ onReturnStock: s(h).promptReturnTransferDialog
2870
2883
  }), null, 16, ["scope", "onSubmitted", "onReturnStock"]),
2871
- b(Sn, Ot(Nt(s(g).xilnexImportDialogProps.value)), null, 16)
2884
+ b(Cn, Nt(Bt(s(h).xilnexImportDialogProps.value)), null, 16)
2872
2885
  ]))
2873
2886
  ];
2874
2887
  }),
@@ -2878,5 +2891,5 @@ const Zo = exports.FfCalculator, Go = { class: "flex flex-col flex-1" }, Jo = {
2878
2891
  }
2879
2892
  });
2880
2893
  export {
2881
- Qn as default
2894
+ Yn as default
2882
2895
  };