@feedmepos/mf-inventory-portal 1.0.36 → 1.0.37-dev.2

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 (80) hide show
  1. package/dist/{App-BM-ivBnF.js → App-_SMozUEj.js} +1 -1
  2. package/dist/{ApprovalView-C4hE43Zp.js → ApprovalView-D55iBGg5.js} +19 -19
  3. package/dist/{BindingsDialog-BqjiXxGY.js → BindingsDialog-Di_xTPkA.js} +4 -4
  4. package/dist/{BindingsPicker-DqCR7P5k.js → BindingsPicker-BwIKt9Il.js} +1 -1
  5. package/dist/{BindingsTable-DD_mVBtS.js → BindingsTable-CMFvNSAH.js} +4 -4
  6. package/dist/{ClosingDraftView-CL09Xu9q.js → ClosingDraftView-DXoi5cw9.js} +26 -26
  7. package/dist/ClosingTemplateView-DaPOj50P.js +1849 -0
  8. package/dist/{DeliveryOrderPrintPreview-CNPUHnpX.js → DeliveryOrderPrintPreview-CkIPZo14.js} +4 -4
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DB6m8oSF.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSzt53-l.js} +11 -11
  10. package/dist/{FmMultiselectDialog-DJ5cyN7G.js → FmMultiselectDialog-EpV0X6CI.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CPAnSCWa.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Cn3qOqJr.js} +21 -21
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CauBVtK9.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BUQQL5kL.js} +1 -1
  13. package/dist/{IngredientGroupView-D0U1ivRz.js → IngredientGroupView-DvxOGAuo.js} +2 -2
  14. package/dist/IngredientsView-BhFDYfnd.js +1851 -0
  15. package/dist/{IntegrationView-hERgFYsT.js → IntegrationView-B_EmS2-x.js} +69 -69
  16. package/dist/{InventoryBindingForm-vO00BnZP.js → InventoryBindingForm-B79lRAe6.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bku7tdc-.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-DBsD7abQ.js} +24 -24
  18. package/dist/{InventoryBindingSummary-DWOniuG6.js → InventoryBindingSummary-CmnSXYAW.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C4_atZsW.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CDRN_Nrk.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DUdI1WOL.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BknocD4_.js} +10 -10
  21. package/dist/{PublishView-enVS6QHQ.js → PublishView-DNkUYpMh.js} +17 -17
  22. package/dist/{PurchaseOrderPrintPreview-Z769Yvkh.js → PurchaseOrderPrintPreview-D0UhIY8z.js} +12 -12
  23. package/dist/{ReceiveRequestView-BYYWrgNX.js → ReceiveRequestView-DsBpjA9P.js} +797 -782
  24. package/dist/{RecipeView-CU9pkFiv.js → RecipeView-lpMLqWM8.js} +3 -3
  25. package/dist/{StockView-iqR-h1Mg.js → StockView-CIgg_FTJ.js} +6 -6
  26. package/dist/{SupplierView-DFzgQ53O.js → SupplierView-fwzviqqM.js} +3 -3
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BEVlutvf.js → TransferDetails.vue_vue_type_script_setup_true_lang-TYNgMCEs.js} +604 -602
  28. package/dist/{TransferTemplateView-EZ_z14kY.js → TransferTemplateView-CSy8pydr.js} +83 -83
  29. package/dist/{UnitView-gYD75UdW.js → UnitView-CMOz7RLY.js} +3 -3
  30. package/dist/{WarehouseView-COLgYw-j.js → WarehouseView-B-1c6rRg.js} +1 -1
  31. package/dist/api/duplicate-template.d.ts +5 -0
  32. package/dist/api/inventory.d.ts +4 -0
  33. package/dist/api/netsuite.d.ts +7 -0
  34. package/dist/{app-DMbkakEB.js → app-CFm28RQ_.js} +53154 -52645
  35. package/dist/app.d.ts +9 -0
  36. package/dist/app.js +1 -1
  37. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +1 -0
  38. package/dist/components/row-action.enum.d.ts +2 -1
  39. package/dist/components/shell/inventory/binding-ui.vue.d.ts +1 -0
  40. package/dist/{decimal-BLjZMddB.js → decimal-UyI93Y1E.js} +1 -1
  41. package/dist/format-unit-display-CNki_g8Q.js +1275 -0
  42. package/dist/{index-C5rv3Yu2.js → index-BWYshfa3.js} +1 -1
  43. package/dist/{index-Bj0hlHvy.js → index-DliBh-3z.js} +1 -1
  44. package/dist/{stock-DjOpPBxG.js → stock-A60nU_aj.js} +1 -1
  45. package/dist/stores/integration/netsuite.d.ts +7 -1
  46. package/dist/stores/inventory.d.ts +9 -0
  47. package/dist/{supplier-BRKfl2V3.js → supplier-lcKFLaW5.js} +1 -1
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/{use-ingredient-select-dialog-DRIWNN3P.js → use-ingredient-select-dialog-B17VDJ0o.js} +1 -1
  50. package/dist/{use-inventory-binding-dialog-DLnKkFpe.js → use-inventory-binding-dialog-sj5lERBj.js} +1 -1
  51. package/dist/views/adjustment-template/wastage-template/actions.d.ts +4 -1
  52. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +8 -0
  53. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +24 -0
  54. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +1 -0
  55. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +16 -1
  56. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +12 -0
  57. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +2 -0
  58. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +1 -0
  59. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +2 -0
  60. package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +4 -0
  61. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +17 -0
  62. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +2 -0
  63. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +4 -0
  64. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +1 -0
  65. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +4 -0
  66. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +24 -0
  67. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +24 -0
  68. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +2 -0
  69. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +2 -0
  70. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +2 -0
  71. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +2 -0
  72. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +1 -0
  73. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +3 -0
  74. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +16 -1
  75. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +12 -0
  76. package/dist/{vue-i18n-x8-PdKzv.js → vue-i18n-CZSieSF0.js} +487 -487
  77. package/package.json +4 -4
  78. package/dist/ClosingTemplateView-CDWMdZOk.js +0 -1804
  79. package/dist/IngredientsView-pgJWthql.js +0 -1838
  80. package/dist/format-unit-display-BkXJg2Ux.js +0 -1230
@@ -1,20 +1,20 @@
1
- import { reactive as bt, onMounted as Qe, watch as _e, computed as U, h as L, defineComponent as ce, openBlock as S, createElementBlock as D, Fragment as de, renderList as Se, createElementVNode as n, toDisplayString as E, unref as s, resolveComponent as T, createVNode as y, withCtx as R, createCommentVNode as H, ref as O, createBlock as W, normalizeClass as K, normalizeStyle as gt, createTextVNode as Te, nextTick as $t, mergeProps as Ze, isRef as xe, createSlots as Tt, Teleport as Dt, normalizeProps as It, guardReactiveProps as Vt } from "vue";
2
- import { b as Me, Q as _t, c as We, m as Oe, j as Ce, a7 as je, T as Pt, au as Rt, A as qe, M as At, n as ht, ae as Ge, G as fe, am as Et, av as Ot, aw as qt, ax as Mt, K as kt, u as Je, a as et, ay as Ut, az as Nt, a6 as zt, a0 as Bt, aA as Lt, E as xt, a2 as Ht, e as Ee, x as jt, y as Qt, z as Yt, aB as He, a8 as pt, B as Kt, N as Xt, H as Zt, _ as Wt, C as Gt, W as ft } from "./app-DMbkakEB.js";
3
- import { u as tt, a as Jt, P as Xe, b as es, _ as ts, g as ss } from "./TransferDetails.vue_vue_type_script_setup_true_lang-BEVlutvf.js";
4
- import { _ as Ct, u as os, i as as, e as ns } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-DUdI1WOL.js";
5
- import { u as ls } from "./useTabStorage-BkIVScW_.js";
6
- import { useBreakpoints as st, components as ge, FmButtonVariant as rs, useSnackbar as De, useDialog as is, useProxiedModel as St } from "@feedmepos/ui-library";
7
- import { P as ae, u as wt } from "./format-unit-display-BkXJg2Ux.js";
8
- import { _ as us, F as ds, a as cs, b as ms } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CPAnSCWa.js";
9
- import { c as $e, u as ps, _ as fs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DB6m8oSF.js";
1
+ import { reactive as bt, onMounted as Qe, watch as _e, computed as N, h as L, defineComponent as ce, openBlock as S, createElementBlock as T, Fragment as de, renderList as Se, createElementVNode as n, toDisplayString as q, unref as s, resolveComponent as I, createVNode as b, withCtx as R, createCommentVNode as j, ref as M, createBlock as G, normalizeClass as Z, normalizeStyle as gt, createTextVNode as Ie, nextTick as $t, mergeProps as Ze, isRef as xe, createSlots as It, Teleport as Tt, normalizeProps as Dt, guardReactiveProps as Vt } from "vue";
2
+ import { b as Me, Q as _t, c as We, m as Oe, j as Ce, a7 as je, T as Pt, av as Rt, A as qe, M as At, n as ht, ae as Ge, G as fe, an as Et, aw as Ot, ax as qt, ay as Mt, K as kt, u as Je, a as et, az as Ut, aA as Nt, a6 as Bt, a0 as zt, aB as Lt, E as xt, a2 as Ht, e as Ee, aC as jt, x as Qt, y as Yt, z as Kt, aD as He, a8 as pt, B as Xt, N as Zt, H as Wt, _ as Gt, C as Jt, W as ft } from "./app-CFm28RQ_.js";
3
+ import { u as tt, a as es, P as Xe, b as ts, _ as ss, g as os } from "./TransferDetails.vue_vue_type_script_setup_true_lang-TYNgMCEs.js";
4
+ import { _ as Ct, u as as, i as ns, e as ls } from "./PremiumBadge.vue_vue_type_script_setup_true_lang-BknocD4_.js";
5
+ import { u as rs } from "./useTabStorage-BkIVScW_.js";
6
+ import { useBreakpoints as st, components as ge, FmButtonVariant as is, useSnackbar as Te, useDialog as us, useProxiedModel as St } from "@feedmepos/ui-library";
7
+ import { P as ne, u as wt } from "./format-unit-display-CNki_g8Q.js";
8
+ import { _ as ds, F as cs, a as ms, b as ps } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-Cn3qOqJr.js";
9
+ import { c as $e, u as fs, _ as vs } from "./FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BSzt53-l.js";
10
10
  import { useI18n as he } from "@feedmepos/mf-common";
11
- import "./FmMultiselectDialog-DJ5cyN7G.js";
12
- import { u as ot } from "./supplier-BRKfl2V3.js";
13
- import { _ as vs } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
- import { u as ys } from "./vue-i18n-x8-PdKzv.js";
11
+ import "./FmMultiselectDialog-EpV0X6CI.js";
12
+ import { u as ot } from "./supplier-lcKFLaW5.js";
13
+ import { _ as ys } from "./PreviewBadge.vue_vue_type_script_setup_true_lang-CRZiQHjx.js";
14
+ import { u as bs } from "./vue-i18n-CZSieSF0.js";
15
15
  import "./array-Ca8T3f_G.js";
16
16
  var J = /* @__PURE__ */ ((g) => (g.Code = "Code", g.Name = "Name", g.TemplateName = "TemplateName", g.Amount = "Amount", g.Cost = "Cost", g.TotalCost = "TotalCost", g.Delete = "Delete", g))(J || {});
17
- const bs = () => (he(), L(
17
+ const gs = () => (he(), L(
18
18
  Ct,
19
19
  {
20
20
  zIndex: 50,
@@ -22,40 +22,40 @@ const bs = () => (he(), L(
22
22
  },
23
23
  `Total (${ht()})`
24
24
  ));
25
- function gs(g) {
26
- const { t: w } = he(), l = bt({}), { breakpoints: f } = st(), x = We(), t = Me();
25
+ function _s(g) {
26
+ const { t: w } = he(), r = bt({}), { breakpoints: p } = st(), x = We(), t = Me();
27
27
  Qe(() => {
28
- for (const b of g.items) {
29
- if (!b.totalCost)
28
+ for (const y of g.items) {
29
+ if (!y.totalCost)
30
30
  continue;
31
31
  const { cost: e } = $e(
32
- b.sku,
33
- b.quantity,
34
- b.measurement,
32
+ y.sku,
33
+ y.quantity,
34
+ y.measurement,
35
35
  {
36
36
  supplier: g.supplier
37
37
  }
38
- ), u = b.totalCost ?? _t.reset();
39
- e ? l[b.sku._id] = e.amount !== u.amount || e.precision !== u.precision : l[b.sku._id] = !0;
38
+ ), u = y.totalCost ?? _t.reset();
39
+ e ? r[y.sku._id] = e.amount !== u.amount || e.precision !== u.precision : r[y.sku._id] = !0;
40
40
  }
41
- }), _e([() => g.supplier], ([b]) => {
41
+ }), _e([() => g.supplier], ([y]) => {
42
42
  for (const e of g.items) {
43
- if (!e.totalCost || l[e.sku._id] || !v(e.sku))
43
+ if (!e.totalCost || r[e.sku._id] || !v(e.sku))
44
44
  continue;
45
45
  const { cost: u } = $e(
46
46
  e.sku,
47
47
  e.quantity,
48
48
  e.measurement,
49
49
  {
50
- supplier: b
50
+ supplier: y
51
51
  }
52
52
  );
53
53
  g.updateItem({ ...e, totalCost: u });
54
54
  }
55
55
  });
56
- function v(b) {
56
+ function v(y) {
57
57
  var u, k, a, i, h, _, C;
58
- return !!(((k = (u = b.defaultCost) == null ? void 0 : u.costPerUnit) == null ? void 0 : k.amount) ?? ((C = (_ = (h = (i = (a = g.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : i.find((r) => r.skuId === b._id)) == null ? void 0 : h.defaultCost) == null ? void 0 : _.costPerUnit) == null ? void 0 : C.amount));
58
+ return !!(((k = (u = y.defaultCost) == null ? void 0 : u.costPerUnit) == null ? void 0 : k.amount) ?? ((C = (_ = (h = (i = (a = g.supplier) == null ? void 0 : a.supplyItems) == null ? void 0 : i.find((l) => l.skuId === y._id)) == null ? void 0 : h.defaultCost) == null ? void 0 : _.costPerUnit) == null ? void 0 : C.amount));
59
59
  }
60
60
  const F = [
61
61
  {
@@ -63,8 +63,8 @@ function gs(g) {
63
63
  header: () => w("inventory.transfer.form.items.table.Code"),
64
64
  accessorKey: "code",
65
65
  size: 200,
66
- cell(b) {
67
- const e = b.row.original;
66
+ cell(y) {
67
+ const e = y.row.original;
68
68
  return t.isEnabled ? L(
69
69
  ge.FmTooltip,
70
70
  {
@@ -99,8 +99,8 @@ function gs(g) {
99
99
  id: "Name",
100
100
  header: () => w("inventory.transfer.form.items.table.Name"),
101
101
  minSize: 300,
102
- cell(b) {
103
- const e = b.row.original;
102
+ cell(y) {
103
+ const e = y.row.original;
104
104
  return t.isEnabled ? L(
105
105
  ge.FmTooltip,
106
106
  {
@@ -136,8 +136,8 @@ function gs(g) {
136
136
  header: () => w("inventory.transfer.form.items.table.Name"),
137
137
  minSize: 300,
138
138
  enableSorting: !1,
139
- cell(b) {
140
- const e = b.row.original, u = e.code, k = e.name;
139
+ cell(y) {
140
+ const e = y.row.original, u = e.code, k = e.name;
141
141
  return L(
142
142
  ge.FmTooltip,
143
143
  { zIndex: 50 },
@@ -169,12 +169,12 @@ function gs(g) {
169
169
  id: "Amount",
170
170
  header: () => w("inventory.transfer.form.items.table.Amount"),
171
171
  minSize: 200,
172
- cell(b) {
173
- var i, h, _, C, r;
174
- const e = b.row.original, u = (i = g.forecastAmounts) == null ? void 0 : i.find((m) => m.skuId === e.sku._id), k = u ? u.helperState === "error" ? `Predicted: ${u.amount} (out of range)` : `Predicted: ${u.amount}` : void 0, a = (C = (_ = (h = g.template) == null ? void 0 : h.purchaseOrder) == null ? void 0 : _.items) == null ? void 0 : C.find(
172
+ cell(y) {
173
+ var i, h, _, C, l;
174
+ const e = y.row.original, u = (i = g.forecastAmounts) == null ? void 0 : i.find((m) => m.skuId === e.sku._id), k = u ? u.helperState === "error" ? `Predicted: ${u.amount} (out of range)` : `Predicted: ${u.amount}` : void 0, a = (C = (_ = (h = g.template) == null ? void 0 : h.purchaseOrder) == null ? void 0 : _.items) == null ? void 0 : C.find(
175
175
  (m) => m.sku._id === e.sku._id
176
176
  );
177
- return L(us, {
177
+ return L(ds, {
178
178
  style: {
179
179
  flex: "1 1 0%"
180
180
  },
@@ -188,40 +188,40 @@ function gs(g) {
188
188
  helperState: u == null ? void 0 : u.helperState,
189
189
  "onUpdate:modelValue": (m) => {
190
190
  if (!m) return;
191
- const I = {
191
+ const D = {
192
192
  ...e,
193
193
  quantity: m.amount,
194
194
  measurement: m.measurement
195
195
  };
196
196
  if (x.enableTotalCost) {
197
- const { cost: N } = $e(
198
- I.sku,
199
- I.quantity,
200
- I.measurement,
197
+ const { cost: B } = $e(
198
+ D.sku,
199
+ D.quantity,
200
+ D.measurement,
201
201
  {
202
202
  supplier: g.supplier,
203
203
  // NOTE: set undefined here if `manualTotalCost[updatedRow.sku._id] = false`, so that the function
204
204
  // will return the auto calculated default cost instead of the manual total cost
205
- manualTotalCost: l[I.sku._id] ? I.totalCost : void 0
205
+ manualTotalCost: r[D.sku._id] ? D.totalCost : void 0
206
206
  }
207
207
  );
208
- I.totalCost = N;
208
+ D.totalCost = B;
209
209
  }
210
- g.updateItem(I);
210
+ g.updateItem(D);
211
211
  },
212
212
  stepper: a == null ? void 0 : a.quantityStep,
213
213
  disableUnit: !!a,
214
214
  disabled: g.disabled,
215
215
  rules: [
216
- ds(
216
+ cs(
217
217
  +Ce(
218
- ((r = e.quantity) == null ? void 0 : r.amount) === 0 ? { amount: 0, precision: 0 } : (a == null ? void 0 : a.minimumQuantity) ?? { amount: 0, precision: 0 }
218
+ ((l = e.quantity) == null ? void 0 : l.amount) === 0 ? { amount: 0, precision: 0 } : (a == null ? void 0 : a.minimumQuantity) ?? { amount: 0, precision: 0 }
219
219
  )
220
220
  ),
221
- cs(
221
+ ms(
222
222
  a != null && a.maximumQuantity ? +Ce(a == null ? void 0 : a.maximumQuantity) : 1 / 0
223
223
  ),
224
- ...a != null && a.quantityStep ? [ms(a.quantityStep)] : []
224
+ ...a != null && a.quantityStep ? [ps(a.quantityStep)] : []
225
225
  ],
226
226
  applyDefaultRules: !0
227
227
  });
@@ -230,11 +230,11 @@ function gs(g) {
230
230
  },
231
231
  {
232
232
  id: "Cost",
233
- header: bs,
233
+ header: gs,
234
234
  size: 180,
235
- cell(b) {
236
- const e = b.row.original, u = v(e.sku), k = f.value.xs || f.value.sm;
237
- if (!l[e.sku._id] && u) {
235
+ cell(y) {
236
+ const e = y.row.original, u = v(e.sku), k = p.value.xs || p.value.sm;
237
+ if (!r[e.sku._id] && u) {
238
238
  const { cost: a, supplierOverrideCost: i } = $e(
239
239
  e.sku,
240
240
  e.quantity,
@@ -255,13 +255,13 @@ function gs(g) {
255
255
  [
256
256
  L(ge.FmButton, {
257
257
  prependIcon: "edit",
258
- variant: rs.Tertiary,
258
+ variant: is.Tertiary,
259
259
  disabled: g.disabled,
260
260
  onClick() {
261
261
  g.updateItem({
262
262
  ...e,
263
263
  totalCost: a
264
- }), l[e.sku._id] = !0;
264
+ }), r[e.sku._id] = !0;
265
265
  }
266
266
  }),
267
267
  L(
@@ -356,7 +356,7 @@ function gs(g) {
356
356
  // NOTE: different from PO template, if a default cost is reenabled,
357
357
  // the total cost will automatically assigned
358
358
  totalCost: a
359
- }), l[e.sku._id] = !1;
359
+ }), r[e.sku._id] = !1;
360
360
  }
361
361
  }) : null;
362
362
  }
@@ -368,8 +368,8 @@ function gs(g) {
368
368
  {
369
369
  id: "Delete",
370
370
  header: "",
371
- cell(b) {
372
- const e = b.row.original;
371
+ cell(y) {
372
+ const e = y.row.original;
373
373
  return L("div", { class: "flex justify-end" }, [
374
374
  L(ge.FmButton, {
375
375
  key: e.sku._id,
@@ -394,47 +394,47 @@ function gs(g) {
394
394
  }
395
395
  ];
396
396
  return {
397
- columnDefs: U(() => x.enableTotalCost && g.transferType === ae.PURCHASE ? F : F.filter(
398
- (b) => b.id !== "Cost"
397
+ columnDefs: N(() => x.enableTotalCost && g.transferType === ne.PURCHASE ? F : F.filter(
398
+ (y) => y.id !== "Cost"
399
399
  /* Cost */
400
400
  ))
401
401
  };
402
402
  }
403
- const _s = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, hs = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, ks = { class: "w-[450px] xs:w-full flex" }, xs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Cs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ft = /* @__PURE__ */ ce({
403
+ const hs = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center" }, ks = { class: "fm-typo-en-body-lg-600 xs:fm-typo-en-body-md-600 mr-auto xs:w-full" }, xs = { class: "w-[450px] xs:w-full flex" }, Cs = { class: "fm-typo-en-body-md-400 whitespace-nowrap" }, Ss = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ft = /* @__PURE__ */ ce({
404
404
  __name: "SupplierPriceHistory",
405
405
  props: {
406
406
  prices: {}
407
407
  },
408
408
  setup(g) {
409
409
  const w = ot();
410
- function l(f) {
411
- return w.suppliers.find((x) => x._id === f);
410
+ function r(p) {
411
+ return w.suppliers.find((x) => x._id === p);
412
412
  }
413
- return (f, x) => (S(), D("div", _s, [
414
- (S(!0), D(de, null, Se(Object.keys(f.prices), (t) => {
413
+ return (p, x) => (S(), T("div", hs, [
414
+ (S(!0), T(de, null, Se(Object.keys(p.prices), (t) => {
415
415
  var v;
416
- return S(), D("div", {
416
+ return S(), T("div", {
417
417
  key: t,
418
418
  class: "flex items-center gap-12 xs:gap-4 xs:flex-wrap w-full"
419
419
  }, [
420
- n("div", hs, E((v = l(t)) == null ? void 0 : v.name), 1),
421
- n("div", ks, [
422
- (S(!0), D(de, null, Se(f.prices[t].slice(0, 3), (F) => {
420
+ n("div", ks, q((v = r(t)) == null ? void 0 : v.name), 1),
421
+ n("div", xs, [
422
+ (S(!0), T(de, null, Se(p.prices[t].slice(0, 3), (F) => {
423
423
  var $;
424
- return S(), D("div", {
424
+ return S(), T("div", {
425
425
  key: F.date,
426
426
  class: "flex flex-col w-[150px] xs:flex-1 text-ellipsis cursor-pointer"
427
427
  }, [
428
- n("div", xs, [
429
- n("span", null, E(F.totalCost ? s(je)(F.totalCost) : "No data"), 1),
428
+ n("div", Cs, [
429
+ n("span", null, q(F.totalCost ? s(je)(F.totalCost) : "No data"), 1),
430
430
  x[0] || (x[0] = n("span", { class: "text-fm-color-typo-secondary" }, "/", -1)),
431
- n("span", null, E(s(Ce)(F.totalUnit, !1)), 1),
432
- n("span", null, E((($ = F.measurement) == null ? void 0 : $.abbrev) ?? F.unit.abbrev), 1)
431
+ n("span", null, q(s(Ce)(F.totalUnit, !1)), 1),
432
+ n("span", null, q((($ = F.measurement) == null ? void 0 : $.abbrev) ?? F.unit.abbrev), 1)
433
433
  ]),
434
- n("div", Cs, [
435
- n("span", null, "(#" + E(F.seqNumber) + ")", 1),
436
- x[1] || (x[1] = n("span", null, E(" "), -1)),
437
- n("span", null, E(s(Ge)(new Date(F.date))), 1)
434
+ n("div", Ss, [
435
+ n("span", null, "(#" + q(F.seqNumber) + ")", 1),
436
+ x[1] || (x[1] = n("span", null, q(" "), -1)),
437
+ n("span", null, q(s(Ge)(new Date(F.date))), 1)
438
438
  ])
439
439
  ]);
440
440
  }), 128))
@@ -443,10 +443,10 @@ const _s = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
443
443
  }), 128))
444
444
  ]));
445
445
  }
446
- }), Ss = { class: "flex flex-col gap-8 py-16" }, ws = { class: "flex items-center" }, Fs = { class: "flex-1 flex gap-1 items-center" }, $s = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ts = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ds = { class: "flex gap-8 w-full" }, Is = { class: "flex-1 flex flex-col gap-4" }, Vs = { class: "flex-1 flex flex-col gap-4" }, Ps = { class: "flex gap-8 w-full" }, Rs = { class: "flex-1 flex flex-col gap-4" }, As = {
446
+ }), ws = { class: "flex flex-col gap-8 py-16" }, Fs = { class: "flex items-center" }, $s = { class: "flex-1 flex gap-1 items-center" }, Is = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ts = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, Ds = { class: "flex gap-8 w-full" }, Vs = { class: "flex-1 flex flex-col gap-4" }, Ps = { class: "flex-1 flex flex-col gap-4" }, Rs = { class: "flex gap-8 w-full" }, As = { class: "flex-1 flex flex-col gap-4" }, Es = {
447
447
  key: 0,
448
448
  class: "flex-1 flex flex-col gap-4"
449
- }, Es = /* @__PURE__ */ ce({
449
+ }, Os = /* @__PURE__ */ ce({
450
450
  __name: "TransferItem",
451
451
  props: {
452
452
  cellByColId: {},
@@ -456,83 +456,83 @@ const _s = { class: "flex flex-col gap-8 px-16 xs:px-4 sm:px-4 py-4 items-center
456
456
  },
457
457
  setup(g) {
458
458
  const { t: w } = he();
459
- return (l, f) => {
460
- var v, F, $, b, e, u, k, a, i, h, _, C, r, m, I, N, j, Q, Y, A, q, P, d, c, z, ne, Z;
461
- const x = T("FmLabel"), t = T("FmSpacer");
462
- return S(), D("div", Ss, [
463
- n("div", ws, [
464
- n("div", Fs, [
465
- n("span", $s, " (" + E(l.row.original.sku.code) + ") ", 1),
466
- n("span", Ts, E(l.row.original.sku.name), 1)
459
+ return (r, p) => {
460
+ var v, F, $, y, e, u, k, a, i, h, _, C, l, m, D, B, Q, Y, K, E, U, P, d, c, O, ee, X;
461
+ const x = I("FmLabel"), t = I("FmSpacer");
462
+ return S(), T("div", ws, [
463
+ n("div", Fs, [
464
+ n("div", $s, [
465
+ n("span", Is, " (" + q(r.row.original.sku.code) + ") ", 1),
466
+ n("span", Ts, q(r.row.original.sku.name), 1)
467
467
  ]),
468
468
  n("div", null, [
469
- y(s(fe), {
470
- render: ($ = (F = (v = l.cellByColId.Delete) == null ? void 0 : v.column) == null ? void 0 : F.columnDef) == null ? void 0 : $.cell,
471
- props: (e = (b = l.cellByColId.Delete) == null ? void 0 : b.getContext) == null ? void 0 : e.call(b)
469
+ b(s(fe), {
470
+ render: ($ = (F = (v = r.cellByColId.Delete) == null ? void 0 : v.column) == null ? void 0 : F.columnDef) == null ? void 0 : $.cell,
471
+ props: (e = (y = r.cellByColId.Delete) == null ? void 0 : y.getContext) == null ? void 0 : e.call(y)
472
472
  }, null, 8, ["render", "props"])
473
473
  ])
474
474
  ]),
475
475
  n("div", Ds, [
476
- n("div", Is, [
477
- y(x, {
476
+ n("div", Vs, [
477
+ b(x, {
478
478
  label: s(w)(`inventory.transfer.form.items.table.${s(J).Code}`)
479
479
  }, null, 8, ["label"]),
480
- y(s(fe), {
481
- render: (a = (k = (u = l.cellByColId[s(J).Code]) == null ? void 0 : u.column) == null ? void 0 : k.columnDef) == null ? void 0 : a.cell,
482
- props: (h = (i = l.cellByColId[s(J).Code]) == null ? void 0 : i.getContext) == null ? void 0 : h.call(i)
480
+ b(s(fe), {
481
+ render: (a = (k = (u = r.cellByColId[s(J).Code]) == null ? void 0 : u.column) == null ? void 0 : k.columnDef) == null ? void 0 : a.cell,
482
+ props: (h = (i = r.cellByColId[s(J).Code]) == null ? void 0 : i.getContext) == null ? void 0 : h.call(i)
483
483
  }, null, 8, ["render", "props"]),
484
- f[0] || (f[0] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
484
+ p[0] || (p[0] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
485
485
  ]),
486
- n("div", Vs, [
487
- y(x, {
486
+ n("div", Ps, [
487
+ b(x, {
488
488
  label: s(w)(`inventory.transfer.form.items.table.${s(J).Name}`)
489
489
  }, null, 8, ["label"]),
490
- y(s(fe), {
491
- render: (r = (C = (_ = l.cellByColId[s(J).Name]) == null ? void 0 : _.column) == null ? void 0 : C.columnDef) == null ? void 0 : r.cell,
492
- props: (I = (m = l.cellByColId[s(J).Name]) == null ? void 0 : m.getContext) == null ? void 0 : I.call(m)
490
+ b(s(fe), {
491
+ render: (l = (C = (_ = r.cellByColId[s(J).Name]) == null ? void 0 : _.column) == null ? void 0 : C.columnDef) == null ? void 0 : l.cell,
492
+ props: (D = (m = r.cellByColId[s(J).Name]) == null ? void 0 : m.getContext) == null ? void 0 : D.call(m)
493
493
  }, null, 8, ["render", "props"]),
494
- f[1] || (f[1] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
494
+ p[1] || (p[1] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
495
495
  ])
496
496
  ]),
497
- n("div", Ps, [
498
- n("div", Rs, [
499
- y(x, {
497
+ n("div", Rs, [
498
+ n("div", As, [
499
+ b(x, {
500
500
  label: s(w)(`inventory.transfer.form.items.table.${s(J).Amount}`)
501
501
  }, null, 8, ["label"]),
502
- y(s(fe), {
503
- render: (Q = (j = (N = l.cellByColId[s(J).Amount]) == null ? void 0 : N.column) == null ? void 0 : j.columnDef) == null ? void 0 : Q.cell,
504
- props: (A = (Y = l.cellByColId[s(J).Amount]) == null ? void 0 : Y.getContext) == null ? void 0 : A.call(Y)
502
+ b(s(fe), {
503
+ render: (Y = (Q = (B = r.cellByColId[s(J).Amount]) == null ? void 0 : B.column) == null ? void 0 : Q.columnDef) == null ? void 0 : Y.cell,
504
+ props: (E = (K = r.cellByColId[s(J).Amount]) == null ? void 0 : K.getContext) == null ? void 0 : E.call(K)
505
505
  }, null, 8, ["render", "props"]),
506
- f[2] || (f[2] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
506
+ p[2] || (p[2] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
507
507
  ]),
508
- l.cellByColId[s(J).Cost] ? (S(), D("div", As, [
509
- y(Ct, { "z-index": 50 }, {
508
+ r.cellByColId[s(J).Cost] ? (S(), T("div", Es, [
509
+ b(Ct, { "z-index": 50 }, {
510
510
  default: R(() => [
511
- y(x, {
511
+ b(x, {
512
512
  label: s(w)(`inventory.transfer.form.items.table.${s(J).Cost}2`)
513
513
  }, null, 8, ["label"])
514
514
  ]),
515
515
  _: 1
516
516
  }),
517
- y(s(fe), {
518
- render: (d = (P = (q = l.cellByColId[s(J).Cost]) == null ? void 0 : q.column) == null ? void 0 : P.columnDef) == null ? void 0 : d.cell,
519
- props: (z = (c = l.cellByColId[s(J).Cost]) == null ? void 0 : c.getContext) == null ? void 0 : z.call(c)
517
+ b(s(fe), {
518
+ render: (d = (P = (U = r.cellByColId[s(J).Cost]) == null ? void 0 : U.column) == null ? void 0 : P.columnDef) == null ? void 0 : d.cell,
519
+ props: (O = (c = r.cellByColId[s(J).Cost]) == null ? void 0 : c.getContext) == null ? void 0 : O.call(c)
520
520
  }, null, 8, ["render", "props"]),
521
- f[3] || (f[3] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
522
- ])) : H("", !0)
521
+ p[3] || (p[3] = n("div", { class: "fm-typo-en-body-md-600 text-fm-color-primary" }, null, -1))
522
+ ])) : j("", !0)
523
523
  ]),
524
- l.showComparePrice && Object.keys(l.comparePriceBySku[(ne = l.row.original.sku) == null ? void 0 : ne._id] ?? {}).length > 0 ? (S(), D(de, { key: 0 }, [
525
- y(t, { class: "h-8" }),
526
- y(Ft, {
527
- prices: l.comparePriceBySku[(Z = l.row.original.sku) == null ? void 0 : Z._id]
524
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(ee = r.row.original.sku) == null ? void 0 : ee._id] ?? {}).length > 0 ? (S(), T(de, { key: 0 }, [
525
+ b(t, { class: "h-8" }),
526
+ b(Ft, {
527
+ prices: r.comparePriceBySku[(X = r.row.original.sku) == null ? void 0 : X._id]
528
528
  }, null, 8, ["prices"])
529
- ], 64)) : H("", !0)
529
+ ], 64)) : j("", !0)
530
530
  ]);
531
531
  };
532
532
  }
533
533
  });
534
- function Os(g) {
535
- const w = U({
534
+ function qs(g) {
535
+ const w = N({
536
536
  get() {
537
537
  const t = g.getEffectiveAt();
538
538
  return t ? new Date(t) : null;
@@ -540,42 +540,42 @@ function Os(g) {
540
540
  set(t) {
541
541
  g.setEffectiveAt((t == null ? void 0 : t.toISOString()) ?? null);
542
542
  }
543
- }), l = U({
543
+ }), r = N({
544
544
  get() {
545
545
  return !!w.value;
546
546
  },
547
547
  set(t) {
548
548
  t ? w.value = /* @__PURE__ */ new Date() : w.value = null;
549
549
  }
550
- }), f = U({
550
+ }), p = N({
551
551
  get() {
552
552
  return w.value === null ? "" : Ge(w.value);
553
553
  },
554
554
  set(t) {
555
555
  t ? w.value = /* @__PURE__ */ new Date(`${t} ${x.value}`) : w.value = null;
556
556
  }
557
- }), x = U({
557
+ }), x = N({
558
558
  get() {
559
559
  return w.value === null ? "" : Et(w.value);
560
560
  },
561
561
  set(t) {
562
- t ? w.value = /* @__PURE__ */ new Date(`${f.value} ${t}`) : w.value = null;
562
+ t ? w.value = /* @__PURE__ */ new Date(`${p.value} ${t}`) : w.value = null;
563
563
  }
564
564
  });
565
565
  return {
566
566
  backdatePo: w,
567
- backdateSwitch: l,
568
- backdateModel: f,
567
+ backdateSwitch: r,
568
+ backdateModel: p,
569
569
  backdateTimeModel: x
570
570
  };
571
571
  }
572
- const qs = {
572
+ const Ms = {
573
573
  width: "24",
574
574
  height: "24",
575
575
  viewBox: "0 0 24 24",
576
576
  fill: "none",
577
577
  xmlns: "http://www.w3.org/2000/svg"
578
- }, Ms = ["fill"], Us = ["fill"], Ns = ["stroke"], zs = ["stroke"], Bs = /* @__PURE__ */ ce({
578
+ }, Us = ["fill"], Ns = ["fill"], Bs = ["stroke"], zs = ["stroke"], Ls = /* @__PURE__ */ ce({
579
579
  __name: "SparkIcon",
580
580
  props: {
581
581
  size: {
@@ -588,22 +588,22 @@ const qs = {
588
588
  }
589
589
  },
590
590
  setup(g) {
591
- return (w, l) => (S(), D("svg", qs, [
591
+ return (w, r) => (S(), T("svg", Ms, [
592
592
  n("path", {
593
593
  d: "M7.6 7.6C8.17076 6.94229 8.5 5.5 8.5 5.5C8.5 5.5 8.81356 6.87361 9.35714 7.5C9.92948 8.15953 11.5 8.5 11.5 8.5C11.5 8.5 9.92948 8.69761 9.35714 9.35714C8.81356 9.98354 8.5 11.5 8.5 11.5C8.5 11.5 8.32076 10.1888 7.75 9.59091C7.14905 8.96136 5.5 8.5 5.5 8.5C5.5 8.5 6.99905 8.29251 7.6 7.6Z",
594
594
  fill: g.color
595
- }, null, 8, Ms),
595
+ }, null, 8, Us),
596
596
  n("path", {
597
597
  d: "M12.2 12.2C13.3415 10.8846 14 8 14 8C14 8 14.6271 10.7472 15.7143 12C16.859 13.3191 20 14 20 14C20 14 16.859 14.3952 15.7143 15.7143C14.6271 16.9671 14 20 14 20C14 20 13.6415 17.3777 12.5 16.1818C11.2981 14.9227 8 14 8 14C8 14 10.9981 13.585 12.2 12.2Z",
598
598
  fill: g.color
599
- }, null, 8, Us),
599
+ }, null, 8, Ns),
600
600
  n("path", {
601
601
  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",
602
602
  stroke: g.color,
603
603
  "stroke-width": "1.5",
604
604
  "stroke-linecap": "round",
605
605
  "stroke-linejoin": "round"
606
- }, null, 8, Ns),
606
+ }, null, 8, Bs),
607
607
  n("path", {
608
608
  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",
609
609
  stroke: g.color,
@@ -613,7 +613,7 @@ const qs = {
613
613
  }, null, 8, zs)
614
614
  ]));
615
615
  }
616
- }), Ls = { class: "flex gap-8 items-center" }, Hs = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, js = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Qs = { class: "flex items-center w-full" }, Ys = { class: "flex-1" }, Ks = { class: "fm-typo-en-title-sm-800" }, Xs = { class: "flex items-start gap-8" }, Zs = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ws = { class: "flex gap-1" }, Gs = /* @__PURE__ */ ce({
616
+ }), Hs = { class: "flex gap-8 items-center" }, js = { class: "fm-typo-en-body-lg-600 line-clamp-1" }, Qs = { class: "w-[343px] px-24 py-16 rounded-lg shadow-light-300 flex flex-col gap-[20px]" }, Ys = { class: "flex items-center w-full" }, Ks = { class: "flex-1" }, Xs = { class: "fm-typo-en-title-sm-800" }, Zs = { class: "flex items-start gap-8" }, Ws = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Gs = { class: "flex gap-1" }, Js = /* @__PURE__ */ ce({
617
617
  __name: "ForecastStock",
618
618
  props: {
619
619
  templateId: {},
@@ -623,8 +623,8 @@ const qs = {
623
623
  },
624
624
  emits: ["update:poItems", "update:forecastAmounts"],
625
625
  setup(g, { emit: w }) {
626
- const l = g, f = w, x = O(!1), t = O(7), v = os(), F = De(), { t: $ } = he();
627
- function b(a, i, h) {
626
+ const r = g, p = w, x = M(!1), t = M(7), v = as(), F = Te(), { t: $ } = he();
627
+ function y(a, i, h) {
628
628
  return i != null && a < i && (a = i), h != null && a > h && (a = h), a;
629
629
  }
630
630
  function e(a) {
@@ -637,33 +637,33 @@ const qs = {
637
637
  name: h,
638
638
  baseAmount: _,
639
639
  measurement: C,
640
- min: r,
640
+ min: l,
641
641
  max: m
642
642
  }) {
643
643
  if (C) {
644
- const I = C.conversion.amount;
645
- let N = Math.ceil(_ / I);
646
- return N = b(N, r, m), {
644
+ const D = C.conversion.amount;
645
+ let B = Math.ceil(_ / D);
646
+ return B = y(B, l, m), {
647
647
  sku: a,
648
648
  code: i,
649
649
  name: h,
650
- quantity: { amount: N, precision: 0 },
650
+ quantity: { amount: B, precision: 0 },
651
651
  measurement: C
652
652
  };
653
653
  } else {
654
- const I = Math.ceil(b(_, r, m));
654
+ const D = Math.ceil(y(_, l, m));
655
655
  return {
656
656
  sku: a,
657
657
  code: i,
658
658
  name: h,
659
- quantity: { amount: I, precision: 0 },
659
+ quantity: { amount: D, precision: 0 },
660
660
  measurement: null
661
661
  };
662
662
  }
663
663
  }
664
664
  async function k() {
665
665
  if (t.value < 1) return;
666
- x.value = !1, await v.readPurchaseOrder(t.value, l.templateId);
666
+ x.value = !1, await v.readPurchaseOrder(t.value, r.templateId);
667
667
  const a = v.purchaseOrderForecast.skus;
668
668
  if (a.length === 0) {
669
669
  F.open({
@@ -672,47 +672,47 @@ const qs = {
672
672
  });
673
673
  return;
674
674
  }
675
- const i = l.templateItems.reduce((_, C) => {
676
- var N;
677
- const r = (N = l.poItems) == null ? void 0 : N.find((j) => j.sku._id === C.sku._id), m = a.find((j) => j.id === C.sku._id);
675
+ const i = r.templateItems.reduce((_, C) => {
676
+ var B;
677
+ const l = (B = r.poItems) == null ? void 0 : B.find((Q) => Q.sku._id === C.sku._id), m = a.find((Q) => Q.id === C.sku._id);
678
678
  if (!m)
679
- return r && _.push(r), _;
680
- if (!l.templateId && m.amount <= 0) return _;
681
- const I = m.amount ?? e(r == null ? void 0 : r.quantity) ?? 0;
679
+ return l && _.push(l), _;
680
+ if (!r.templateId && m.amount <= 0) return _;
681
+ const D = m.amount ?? e(l == null ? void 0 : l.quantity) ?? 0;
682
682
  return _.push(
683
683
  u({
684
684
  sku: C.sku,
685
685
  code: C.code,
686
686
  name: C.name,
687
- baseAmount: I,
687
+ baseAmount: D,
688
688
  measurement: C.measurement || null,
689
689
  min: e(C.minimumQuantity),
690
690
  max: e(C.maximumQuantity)
691
691
  })
692
692
  ), _;
693
693
  }, []), h = a.map((_) => {
694
- const C = l.templateItems.find((Q) => Q.sku._id === _.id);
695
- let r = _.amount, m = 0;
694
+ const C = r.templateItems.find((Y) => Y.sku._id === _.id);
695
+ let l = _.amount, m = 0;
696
696
  if (C != null && C.measurement) {
697
- const Q = e(C.measurement.conversion) ?? 1;
698
- r = Math.ceil(_.amount / Q);
697
+ const Y = e(C.measurement.conversion) ?? 1;
698
+ l = Math.ceil(_.amount / Y);
699
699
  } else
700
- r = Math.ceil(_.amount);
701
- const I = e(C == null ? void 0 : C.minimumQuantity) ?? 0, N = e(C == null ? void 0 : C.maximumQuantity) ?? 1 / 0, j = r < I || r > N ? "error" : "success";
702
- return { skuId: _.id, amount: r, precision: m, helperState: j };
700
+ l = Math.ceil(_.amount);
701
+ const D = e(C == null ? void 0 : C.minimumQuantity) ?? 0, B = e(C == null ? void 0 : C.maximumQuantity) ?? 1 / 0, Q = l < D || l > B ? "error" : "success";
702
+ return { skuId: _.id, amount: l, precision: m, helperState: Q };
703
703
  });
704
- f("update:poItems", i), f("update:forecastAmounts", h);
704
+ p("update:poItems", i), p("update:forecastAmounts", h);
705
705
  }
706
706
  return (a, i) => {
707
- const h = T("FmButton"), _ = T("FmIcon"), C = T("FmStepperField"), r = T("FmPopover");
708
- return S(), W(r, {
707
+ const h = I("FmButton"), _ = I("FmIcon"), C = I("FmStepperField"), l = I("FmPopover");
708
+ return S(), G(l, {
709
709
  disabled: a.disabled,
710
710
  class: "flex",
711
711
  "show-popover": x.value,
712
712
  onPopoverChanged: i[3] || (i[3] = (m) => x.value = m)
713
713
  }, {
714
714
  "popover-button": R(() => [
715
- y(h, {
715
+ b(h, {
716
716
  label: "unused",
717
717
  variant: "secondary",
718
718
  "text-color": a.disabled ? "disabled" : "primary",
@@ -721,61 +721,61 @@ const qs = {
721
721
  disabled: a.disabled
722
722
  }, {
723
723
  default: R(() => [
724
- n("div", Ls, [
725
- y(Bs, {
724
+ n("div", Hs, [
725
+ b(Ls, {
726
726
  size: 24,
727
727
  color: a.disabled ? "#c7c7cc" : "#ff7823"
728
728
  }, null, 8, ["color"]),
729
- n("div", Hs, E(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
729
+ n("div", js, q(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
730
730
  ])
731
731
  ]),
732
732
  _: 1
733
733
  }, 8, ["text-color", "border-color", "disabled"])
734
734
  ]),
735
735
  default: R(() => [
736
- n("div", js, [
737
- n("div", Qs, [
738
- n("div", Ys, [
739
- y(vs, { "z-index": 99 }, {
736
+ n("div", Qs, [
737
+ n("div", Ys, [
738
+ n("div", Ks, [
739
+ b(ys, { "z-index": 99 }, {
740
740
  default: R(() => [
741
- n("p", Ks, E(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
741
+ n("p", Xs, q(s($)("inventory.transfer.form.items.forecastStock.title")), 1)
742
742
  ]),
743
743
  _: 1
744
744
  })
745
745
  ]),
746
- y(h, {
746
+ b(h, {
747
747
  icon: "close",
748
748
  size: "md",
749
749
  variant: "tertiary",
750
750
  onClick: i[0] || (i[0] = (m) => x.value = !1)
751
751
  })
752
752
  ]),
753
- y(C, {
753
+ b(C, {
754
754
  modelValue: t.value,
755
755
  "onUpdate:modelValue": i[1] || (i[1] = (m) => t.value = m),
756
756
  label: s($)("inventory.transfer.form.items.forecastStock.days"),
757
757
  rules: [s(qe)(1)]
758
758
  }, {
759
759
  "helper-text": R(() => [
760
- n("div", Xs, [
761
- y(_, {
760
+ n("div", Zs, [
761
+ b(_, {
762
762
  name: "warning",
763
763
  size: "sm",
764
764
  class: "text-fm-color-system-warning-300"
765
765
  }),
766
- n("div", Zs, E(s($)("inventory.transfer.form.items.forecastStock.replace")), 1)
766
+ n("div", Ws, q(s($)("inventory.transfer.form.items.forecastStock.replace")), 1)
767
767
  ])
768
768
  ]),
769
769
  _: 1
770
770
  }, 8, ["modelValue", "label", "rules"]),
771
- n("div", Ws, [
771
+ n("div", Gs, [
772
772
  i[4] || (i[4] = n("div", { class: "grow" }, null, -1)),
773
- y(h, {
773
+ b(h, {
774
774
  label: s($)("common.cancel"),
775
775
  variant: "tertiary",
776
776
  onClick: i[2] || (i[2] = (m) => x.value = !1)
777
777
  }, null, 8, ["label"]),
778
- y(h, {
778
+ b(h, {
779
779
  label: s($)("inventory.transfer.form.items.forecastStock.generate"),
780
780
  onClick: k
781
781
  }, null, 8, ["label"])
@@ -787,14 +787,14 @@ const qs = {
787
787
  };
788
788
  }
789
789
  });
790
- function Js() {
791
- const g = De(), w = tt(), l = O(!1);
792
- _e(l, (v) => {
793
- v && (x.value = !0, f().finally(() => {
790
+ function eo() {
791
+ const g = Te(), w = tt(), r = M(!1);
792
+ _e(r, (v) => {
793
+ v && (x.value = !0, p().finally(() => {
794
794
  x.value = !1;
795
795
  }));
796
796
  });
797
- async function f() {
797
+ async function p() {
798
798
  try {
799
799
  const { startDate: v, endDate: F } = Ot(6), e = (await w.getPurchaseOrders({ start: v, end: F })).filter(
800
800
  (u) => {
@@ -822,17 +822,17 @@ function Js() {
822
822
  g.open({
823
823
  title: "Something went wrong",
824
824
  message: "Cannot retrieve supplier purchase history. Please try again."
825
- }), l.value = !1;
825
+ }), r.value = !1;
826
826
  }
827
827
  }
828
- const x = O(!1), t = O({});
828
+ const x = M(!1), t = M({});
829
829
  return {
830
- comparePricesToggle: l,
830
+ comparePricesToggle: r,
831
831
  comparePriceFetching: x,
832
832
  comparePriceBySku: t
833
833
  };
834
834
  }
835
- const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }, so = ["colspan"], oo = /* @__PURE__ */ ce({
835
+ const to = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, so = { key: 0 }, oo = ["colspan"], ao = /* @__PURE__ */ ce({
836
836
  __name: "TransferItemTable",
837
837
  props: {
838
838
  templateItem: {},
@@ -843,30 +843,30 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
843
843
  },
844
844
  emits: ["update:item"],
845
845
  setup(g) {
846
- function w(l) {
847
- return l.column.columnDef.meta;
846
+ function w(r) {
847
+ return r.column.columnDef.meta;
848
848
  }
849
- return (l, f) => {
849
+ return (r, p) => {
850
850
  var x, t;
851
- return S(), D(de, null, [
851
+ return S(), T(de, null, [
852
852
  n("tr", {
853
- class: K(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
854
- "bg-fm-color-neutral-gray-100": l.row.getIsSelected()
853
+ class: Z(["border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm", {
854
+ "bg-fm-color-neutral-gray-100": r.row.getIsSelected()
855
855
  }])
856
856
  }, [
857
- (S(!0), D(de, null, Se(l.row.getVisibleCells(), (v) => {
858
- var F, $, b, e;
859
- return S(), D("td", {
857
+ (S(!0), T(de, null, Se(r.row.getVisibleCells(), (v) => {
858
+ var F, $, y, e;
859
+ return S(), T("td", {
860
860
  key: v.id,
861
- class: K(["h-[56px] text-fm-color-typo-primary", ((F = w(v)) == null ? void 0 : F.cellClass) ?? "px-16"]),
861
+ class: Z(["h-[56px] text-fm-color-typo-primary", ((F = w(v)) == null ? void 0 : F.cellClass) ?? "px-16"]),
862
862
  style: gt({
863
863
  width: ($ = w(v)) == null ? void 0 : $.width,
864
- maxWidth: (b = w(v)) == null ? void 0 : b.maxWidth,
864
+ maxWidth: (y = w(v)) == null ? void 0 : y.maxWidth,
865
865
  textAlign: ((e = w(v)) == null ? void 0 : e.textAlign) ?? "left"
866
866
  })
867
867
  }, [
868
- n("span", eo, [
869
- y(s(fe), {
868
+ n("span", to, [
869
+ b(s(fe), {
870
870
  render: v.column.columnDef.cell,
871
871
  props: v.getContext()
872
872
  }, null, 8, ["render", "props"])
@@ -874,25 +874,25 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
874
874
  ], 6);
875
875
  }), 128))
876
876
  ], 2),
877
- l.showComparePrice && Object.keys(l.comparePriceBySku[(x = l.row.original.sku) == null ? void 0 : x._id] ?? {}).length > 0 ? (S(), D("tr", to, [
877
+ r.showComparePrice && Object.keys(r.comparePriceBySku[(x = r.row.original.sku) == null ? void 0 : x._id] ?? {}).length > 0 ? (S(), T("tr", so, [
878
878
  n("td", {
879
- colspan: l.row.getVisibleCells().length
879
+ colspan: r.row.getVisibleCells().length
880
880
  }, [
881
- y(Ft, {
882
- prices: l.comparePriceBySku[(t = l.row.original.sku) == null ? void 0 : t._id]
881
+ b(Ft, {
882
+ prices: r.comparePriceBySku[(t = r.row.original.sku) == null ? void 0 : t._id]
883
883
  }, null, 8, ["prices"])
884
- ], 8, so)
885
- ])) : H("", !0)
884
+ ], 8, oo)
885
+ ])) : j("", !0)
886
886
  ], 64);
887
887
  };
888
888
  }
889
- }), ao = {
889
+ }), no = {
890
890
  key: 0,
891
891
  class: "flex flex-col gap-8"
892
- }, no = { class: "flex flex-col gap-4" }, lo = { class: "flex items-center gap-4" }, ro = {
892
+ }, lo = { class: "flex flex-col gap-4" }, ro = { class: "flex items-center gap-4" }, io = {
893
893
  key: 0,
894
894
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error"
895
- }, io = /* @__PURE__ */ ce({
895
+ }, uo = /* @__PURE__ */ ce({
896
896
  __name: "NetSuiteField",
897
897
  props: {
898
898
  required: { type: Boolean },
@@ -904,7 +904,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
904
904
  },
905
905
  emits: ["netsuite:ready"],
906
906
  setup(g, { emit: w }) {
907
- const l = Me(), f = g, x = w, { t } = ys(), v = O(!1), F = O();
907
+ const r = Me(), p = g, x = w, { t } = bs(), v = M(!1), F = M();
908
908
  Qe(() => {
909
909
  var u, k, a, i;
910
910
  let e = {
@@ -912,14 +912,14 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
912
912
  subsidiary: { id: "", name: "" },
913
913
  errors: []
914
914
  };
915
- if (!l.isEnabled || !f.required) {
915
+ if (!r.isEnabled || !p.required) {
916
916
  x("netsuite:ready", e);
917
917
  return;
918
918
  }
919
919
  try {
920
- const h = l.currentLocationSubsidiary();
921
- f.setting ? e = {
922
- ...f.setting,
920
+ const h = r.currentLocationSubsidiary();
921
+ p.setting ? e = {
922
+ ...p.setting,
923
923
  subsidiary: {
924
924
  id: h.id || "",
925
925
  name: h.name
@@ -931,64 +931,64 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
931
931
  name: h.name
932
932
  }
933
933
  };
934
- const _ = l.getAvailableItems(h.id), C = f.items.filter((r) => {
935
- if (r.measurement != null) {
936
- const m = l.getAvailableMeasurements(
937
- r.sku._id,
934
+ const _ = r.getAvailableItems(h.id), C = p.items.filter((l) => {
935
+ if (l.measurement != null) {
936
+ const m = r.getAvailableMeasurements(
937
+ l.sku._id,
938
938
  h.id
939
939
  );
940
- return _.includes(r.sku._id) && m.includes(r.measurement.id);
940
+ return _.includes(l.sku._id) && m.includes(l.measurement.id);
941
941
  }
942
- return _.includes(r.sku._id);
943
- }).map((r) => r.sku._id);
944
- f.onChange(
945
- f.items.filter((r) => C.includes(r.sku._id)),
942
+ return _.includes(l.sku._id);
943
+ }).map((l) => l.sku._id);
944
+ p.onChange(
945
+ p.items.filter((l) => C.includes(l.sku._id)),
946
946
  e
947
947
  );
948
948
  } finally {
949
- f.supplier.internal ? F.value = l.getNetSuiteLocation(
950
- `${f.supplier.internal}_${f.supplier._id}`
951
- ) : F.value = l.getNetSuiteVendor(f.supplier._id);
952
- const h = f.supplier.internal ? l.getLocationSubsidiary((u = F.value) == null ? void 0 : u.netSuiteId).id : (k = F.value) == null ? void 0 : k.subsidiaryId, _ = f.supplier.internal ? (a = l.currentLocationSubsidiary()) == null ? void 0 : a.id : (i = l.currentVendorSubsidiary(f.supplier._id)) == null ? void 0 : i.id;
953
- !l.isEnabled || h && l.isEnabled && h == _ ? x("netsuite:ready", e) : v.value = !0;
949
+ p.supplier.internal ? F.value = r.getNetSuiteLocation(
950
+ `${p.supplier.internal}_${p.supplier._id}`
951
+ ) : F.value = r.getNetSuiteVendor(p.supplier._id);
952
+ const h = p.supplier.internal ? r.getLocationSubsidiary((u = F.value) == null ? void 0 : u.netSuiteId).id : (k = F.value) == null ? void 0 : k.subsidiaryId, _ = p.supplier.internal ? (a = r.currentLocationSubsidiary()) == null ? void 0 : a.id : (i = r.currentVendorSubsidiary(p.supplier._id)) == null ? void 0 : i.id;
953
+ !r.isEnabled || h && r.isEnabled && h == _ ? x("netsuite:ready", e) : v.value = !0;
954
954
  }
955
955
  });
956
- const $ = U(
957
- () => f.supplier.internal ? l.currentLocationSubsidiary() : l.currentVendorSubsidiary(f.supplier._id)
958
- ), b = U(() => {
956
+ const $ = N(
957
+ () => p.supplier.internal ? r.currentLocationSubsidiary() : r.currentVendorSubsidiary(p.supplier._id)
958
+ ), y = N(() => {
959
959
  var e, u;
960
- return F.value == null ? `Cannot find the NetSuite location for "${f.supplier.name}"` : `The subsidiary of the request
961
- location is ${(u = l.getLocationSubsidiary((e = F.value) == null ? void 0 : e.netSuiteId)) == null ? void 0 : u.fullName}`;
960
+ return F.value == null ? `Cannot find the NetSuite location for "${p.supplier.name}"` : `The subsidiary of the request
961
+ location is ${(u = r.getLocationSubsidiary((e = F.value) == null ? void 0 : e.netSuiteId)) == null ? void 0 : u.fullName}`;
962
962
  });
963
963
  return (e, u) => {
964
- const k = T("FmLabel"), a = T("FmIcon"), i = T("FmField"), h = T("FmTooltip");
965
- return s(l).isEnabled && f.required ? (S(), D("div", ao, [
966
- y(k, {
964
+ const k = I("FmLabel"), a = I("FmIcon"), i = I("FmField"), h = I("FmTooltip");
965
+ return s(r).isEnabled && p.required ? (S(), T("div", no, [
966
+ b(k, {
967
967
  label: `NetSuite ${s(t)("inventory.transfer.form.netsuite.subsidiary")}`
968
968
  }, null, 8, ["label"]),
969
- n("div", no, [
970
- y(h, {
969
+ n("div", lo, [
970
+ b(h, {
971
971
  "z-index": 51,
972
972
  placement: "left",
973
973
  disabled: e.disabled
974
974
  }, {
975
975
  content: R(() => u[0] || (u[0] = [
976
- Te("This field is locked and based on the location of the request.")
976
+ Ie("This field is locked and based on the location of the request.")
977
977
  ])),
978
978
  default: R(() => [
979
- y(i, null, {
979
+ b(i, null, {
980
980
  default: R(() => {
981
981
  var _;
982
982
  return [
983
- n("div", lo, [
984
- y(a, {
983
+ n("div", ro, [
984
+ b(a, {
985
985
  name: "lock_outline",
986
986
  size: "sm",
987
987
  color: e.disabled ? "neutral-gray-200" : "neutral-gray-400"
988
988
  }, null, 8, ["color"]),
989
989
  n("div", {
990
- class: K([e.disabled ? "text-fm-color-typo-disabled" : ""])
991
- }, E((_ = $.value) == null ? void 0 : _.fullName), 3)
990
+ class: Z([e.disabled ? "text-fm-color-typo-disabled" : ""])
991
+ }, q((_ = $.value) == null ? void 0 : _.fullName), 3)
992
992
  ])
993
993
  ];
994
994
  }),
@@ -997,21 +997,21 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
997
997
  ]),
998
998
  _: 1
999
999
  }, 8, ["disabled"]),
1000
- v.value ? (S(), D("div", ro, E(b.value), 1)) : H("", !0)
1000
+ v.value ? (S(), T("div", io, q(y.value), 1)) : j("", !0)
1001
1001
  ])
1002
- ])) : H("", !0);
1002
+ ])) : j("", !0);
1003
1003
  };
1004
1004
  }
1005
- }), uo = { class: "flex flex-col gap-4" }, co = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, mo = { class: "flex flex-col gap-16" }, po = { class: "flex flex-col gap-24" }, fo = { class: "flex flex-col gap-8" }, vo = { class: "flex flex-col gap-4" }, yo = { class: "flex items-center gap-4" }, bo = { class: "flex flex-col gap-8" }, go = { class: "flex flex-col gap-4" }, _o = { class: "flex items-center gap-4" }, ho = {
1005
+ }), co = { class: "flex flex-col gap-4" }, mo = { class: "flex items-center gap-8 overflow-x-auto pb-12" }, po = { class: "flex flex-col gap-16" }, fo = { class: "flex flex-col gap-24" }, vo = { class: "flex flex-col gap-8" }, yo = { class: "flex flex-col gap-4" }, bo = { class: "flex items-center gap-4" }, go = { class: "flex flex-col gap-8" }, _o = { class: "flex flex-col gap-4" }, ho = { class: "flex items-center gap-4" }, ko = {
1006
1006
  key: 3,
1007
1007
  class: "p-16 border border-fm-color-neutral-gray-300 fm-corner-radius-md flex flex-col"
1008
- }, ko = {
1008
+ }, xo = {
1009
1009
  key: 0,
1010
1010
  class: "flex-1 flex gap-8 h-48 xs:flex-col xs:pt-16 sm:flex-col sm:pt-16"
1011
- }, xo = { class: "flex-1" }, Co = { class: "flex-1" }, So = {
1011
+ }, Co = { class: "flex-1" }, So = { class: "flex-1" }, wo = {
1012
1012
  key: 1,
1013
1013
  class: "flex items-center gap-4"
1014
- }, wo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, Fo = { class: "flex flex-col gap-16" }, $o = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, To = { class: "flex gap-8" }, Do = { key: 0 }, Io = /* @__PURE__ */ ce({
1014
+ }, Fo = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary translate-y-[1px]" }, $o = { class: "flex flex-col gap-16" }, Io = { class: "flex-1 gap-8 fm-typo-en-title-sm-600" }, To = { class: "flex gap-8" }, Do = { key: 0 }, Vo = /* @__PURE__ */ ce({
1015
1015
  __name: "TransferForm2",
1016
1016
  props: {
1017
1017
  modelValue: {},
@@ -1022,43 +1022,43 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1022
1022
  lastClosingDate: {}
1023
1023
  },
1024
1024
  emits: ["validation-success", "form:ready"],
1025
- setup(g, { expose: w, emit: l }) {
1026
- const f = g, x = l, t = kt(), { t: v } = he(), F = Je(), $ = et(), b = Me(), e = ot(), u = We(), k = wt(), { breakpoints: a } = st(), i = U(() => a.value.xs || a.value.sm), h = bt({
1025
+ setup(g, { expose: w, emit: r }) {
1026
+ const p = g, x = r, t = kt(), { t: v } = he(), F = Je(), $ = et(), y = Me(), e = ot(), u = We(), k = wt(), { breakpoints: a } = st(), i = N(() => a.value.xs || a.value.sm), h = bt({
1027
1027
  value: !1
1028
- }), _ = O(!1), C = O(0), r = O([]), m = U(
1028
+ }), _ = M(!1), C = M(0), l = M([]), m = N(
1029
1029
  () => {
1030
1030
  var o;
1031
- return ((o = f.modelValue) == null ? void 0 : o.templateDoc) ?? k.templates.find((p) => p._id === t.template);
1031
+ return ((o = p.modelValue) == null ? void 0 : o.templateDoc) ?? k.templates.find((f) => f._id === t.template);
1032
1032
  }
1033
- ), I = U(() => t.status === "DRAFT" || !t._rev);
1033
+ ), D = N(() => t.status === "DRAFT" || !t._rev);
1034
1034
  _e(m, (o) => {
1035
- var p, M;
1035
+ var f, A;
1036
1036
  if (o) {
1037
1037
  if (o && !o.purchaseOrder.supplier)
1038
1038
  throw new Error("Template order must have a source location");
1039
- if (I.value) {
1040
- const G = (p = o.purchaseOrder) == null ? void 0 : p.supplier.internal;
1041
- if (G && (G == "restaurant" || G == "warehouse")) {
1042
- const le = (M = o.purchaseOrder) == null ? void 0 : M.supplier._id, re = `${G}_${le}`, X = F.allLocations.find(
1043
- (ie) => ie.type === G && ie.dbName === re
1039
+ if (D.value) {
1040
+ const H = (f = o.purchaseOrder) == null ? void 0 : f.supplier.internal;
1041
+ if (H && (H == "restaurant" || H == "warehouse")) {
1042
+ const le = (A = o.purchaseOrder) == null ? void 0 : A.supplier._id, re = `${H}_${le}`, W = F.allLocations.find(
1043
+ (ie) => ie.type === H && ie.dbName === re
1044
1044
  );
1045
- if (X) {
1045
+ if (W) {
1046
1046
  const ie = {
1047
1047
  ...o.purchaseOrder.supplier,
1048
- name: X.doc.profile.name,
1049
- contactName: X.doc.profile.name,
1050
- email: X.doc.profile.email,
1051
- phoneNumber: X.doc.profile.phoneNo,
1052
- registrationNumber: X.doc.profile.regNo,
1053
- address: X.doc.profile.address
1048
+ name: W.doc.profile.name,
1049
+ contactName: W.doc.profile.name,
1050
+ email: W.doc.profile.email,
1051
+ phoneNumber: W.doc.profile.phoneNo,
1052
+ registrationNumber: W.doc.profile.regNo,
1053
+ address: W.doc.profile.address
1054
1054
  };
1055
1055
  t.supplier = ie;
1056
1056
  }
1057
1057
  } else {
1058
1058
  const le = e.suppliers.find(
1059
1059
  (re) => {
1060
- var X;
1061
- return re._id === ((X = o.purchaseOrder.supplier) == null ? void 0 : X._id);
1060
+ var W;
1061
+ return re._id === ((W = o.purchaseOrder.supplier) == null ? void 0 : W._id);
1062
1062
  }
1063
1063
  );
1064
1064
  t.supplier = le ?? t.supplier;
@@ -1070,107 +1070,108 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1070
1070
  }), Qe(() => {
1071
1071
  var o;
1072
1072
  try {
1073
- if (t.items = t.items.map((p) => ({ ...p, id: p.id ?? p.sku._id })), !t.template) return;
1074
- t.items.length || (t.items = ((o = m.value) == null ? void 0 : o.purchaseOrder.items) ?? []);
1073
+ const f = $.skuById;
1074
+ let A = t.items.map((H) => ({ ...H, id: H.id ?? H.sku._id }));
1075
+ t.template && (t.items.length || (A = ((o = m.value) == null ? void 0 : o.purchaseOrder.items) ?? [])), t.items = A.filter((H) => !f[H.sku._id].isInactive);
1075
1076
  } finally {
1076
1077
  _.value = !0;
1077
1078
  }
1078
- }), _e([_, h], ([o, p], [M, G]) => {
1079
- p.value && G.value && x("form:ready");
1079
+ }), _e([_, h], ([o, f], [A, H]) => {
1080
+ f.value && H.value && x("form:ready");
1080
1081
  });
1081
- const N = U(
1082
+ const B = N(
1082
1083
  () => F.currentLocation.type === Ut.restaurant
1083
1084
  );
1084
1085
  F.watchLocation(async () => {
1085
1086
  location && (t.supplier || (t.supplier = e.suppliers.find((o) => o) ?? t.supplier));
1086
1087
  });
1087
- const j = is(), Q = ps(
1088
+ const Q = us(), Y = fs(
1088
1089
  () => t,
1089
1090
  (o) => {
1090
1091
  Object.assign(t, o);
1091
1092
  },
1092
1093
  !0,
1093
1094
  !0
1094
- ), Y = U({
1095
+ ), K = N({
1095
1096
  get() {
1096
1097
  var o;
1097
- return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? ae.TRANSFER : ae.PURCHASE;
1098
+ return typeof ((o = t == null ? void 0 : t.supplier) == null ? void 0 : o.internal) == "string" ? ne.TRANSFER : ne.PURCHASE;
1098
1099
  },
1099
1100
  set(o) {
1100
- var M;
1101
- const p = typeof ((M = t == null ? void 0 : t.supplier) == null ? void 0 : M.internal) == "string" ? ae.TRANSFER : ae.PURCHASE;
1102
- o !== p && (t.supplier = o === ae.PURCHASE ? Q.locationOptionsTypePurchase.value[0] : Q.locationOptionsTypeTransfer.value[0]);
1101
+ var A;
1102
+ const f = typeof ((A = t == null ? void 0 : t.supplier) == null ? void 0 : A.internal) == "string" ? ne.TRANSFER : ne.PURCHASE;
1103
+ o !== f && (t.supplier = o === ne.PURCHASE ? Y.locationOptionsTypePurchase.value[0] : Y.locationOptionsTypeTransfer.value[0]);
1103
1104
  }
1104
1105
  });
1105
1106
  _e(
1106
1107
  () => {
1107
1108
  var o;
1108
- return (o = f.modelValue) == null ? void 0 : o.template;
1109
+ return (o = p.modelValue) == null ? void 0 : o.template;
1109
1110
  },
1110
1111
  (o) => {
1111
1112
  u.mustUsePoTemplate && !o && $t(() => {
1112
- var p, M;
1113
- t.supplier = ((M = (p = Q.locationOptionsTypeTransfer.value) == null ? void 0 : p.filter(
1114
- (G) => G.internal === "restaurant"
1115
- )) == null ? void 0 : M[0]) ?? t.supplier;
1113
+ var f, A;
1114
+ t.supplier = ((A = (f = Y.locationOptionsTypeTransfer.value) == null ? void 0 : f.filter(
1115
+ (H) => H.internal === "restaurant"
1116
+ )) == null ? void 0 : A[0]) ?? t.supplier;
1116
1117
  });
1117
1118
  },
1118
1119
  { immediate: !0 }
1119
1120
  );
1120
- const A = U(() => {
1121
- let o = Q.transferLocationOptions.value;
1122
- return u.mustUsePoTemplate && !t.template && (o = o.filter((p) => {
1123
- var M;
1124
- return (M = p.sublabel) == null ? void 0 : M.startsWith("restaurant");
1121
+ const E = N(() => {
1122
+ let o = Y.transferLocationOptions.value;
1123
+ return u.mustUsePoTemplate && !t.template && (o = o.filter((f) => {
1124
+ var A;
1125
+ return (A = f.sublabel) == null ? void 0 : A.startsWith("restaurant");
1125
1126
  })), o;
1126
- }), q = U({
1127
+ }), U = N({
1127
1128
  get() {
1128
1129
  var o;
1129
1130
  return (o = t.supplier) == null ? void 0 : o._id;
1130
1131
  },
1131
1132
  set(o) {
1132
- Q.transferLocationModel.value = o;
1133
+ Y.transferLocationModel.value = o;
1133
1134
  }
1134
- }), P = U({
1135
+ }), P = N({
1135
1136
  get() {
1136
1137
  return t.remark ?? void 0;
1137
1138
  },
1138
1139
  set(o) {
1139
1140
  t.remark = o;
1140
1141
  }
1141
- }), { backdatePo: d, backdateSwitch: c, backdateModel: z, backdateTimeModel: ne } = Os({
1142
+ }), { backdatePo: d, backdateSwitch: c, backdateModel: O, backdateTimeModel: ee } = qs({
1142
1143
  getEffectiveAt() {
1143
1144
  return t.effectiveAt;
1144
1145
  },
1145
1146
  setEffectiveAt(o) {
1146
1147
  t.effectiveAt = o;
1147
1148
  }
1148
- }), { comparePricesToggle: Z, comparePriceFetching: ke, comparePriceBySku: ve } = Js(), me = O();
1149
+ }), { comparePricesToggle: X, comparePriceFetching: ke, comparePriceBySku: ve } = eo(), me = M();
1149
1150
  w({
1150
1151
  validateInputs: () => {
1151
- var o, p;
1152
- (p = (o = me.value) == null ? void 0 : o.validateInputs) == null || p.call(o);
1152
+ var o, f;
1153
+ (f = (o = me.value) == null ? void 0 : o.validateInputs) == null || f.call(o);
1153
1154
  },
1154
1155
  resetInputsValidation: () => {
1155
- var o, p;
1156
- (p = (o = me.value) == null ? void 0 : o.resetInputsValidation) == null || p.call(o);
1156
+ var o, f;
1157
+ (f = (o = me.value) == null ? void 0 : o.resetInputsValidation) == null || f.call(o);
1157
1158
  },
1158
1159
  resetInputs: () => {
1159
- var o, p;
1160
- (p = (o = me.value) == null ? void 0 : o.resetInputs) == null || p.call(o);
1160
+ var o, f;
1161
+ (f = (o = me.value) == null ? void 0 : o.resetInputs) == null || f.call(o);
1161
1162
  }
1162
1163
  });
1163
- const we = U(() => ({
1164
+ const we = N(() => ({
1164
1165
  updateItem: (o) => {
1165
- const p = Nt.parse(o);
1166
- t.items = t.items.map((M) => M.id && M.id !== o.id || !M.id && M.sku._id !== o.sku._id ? M : p);
1166
+ const f = Nt.parse(o);
1167
+ t.items = t.items.map((A) => A.id && A.id !== o.id || !A.id && A.sku._id !== o.sku._id ? A : f);
1167
1168
  },
1168
1169
  deleteItem: (o) => {
1169
1170
  t.items = t.items.filter(
1170
- (p) => p.id ? p.id !== o.id : p.sku._id !== o.sku._id
1171
+ (f) => f.id ? f.id !== o.id : f.sku._id !== o.sku._id
1171
1172
  );
1172
1173
  }
1173
- })), Ue = gs({
1174
+ })), Ue = _s({
1174
1175
  updateItem: (o) => we.value.updateItem(o),
1175
1176
  deleteItem: (o) => we.value.deleteItem(o),
1176
1177
  get supplier() {
@@ -1180,48 +1181,49 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1180
1181
  return t.items;
1181
1182
  },
1182
1183
  get transferType() {
1183
- return Y.value;
1184
+ return K.value;
1184
1185
  },
1185
1186
  get template() {
1186
1187
  return m.value;
1187
1188
  },
1188
1189
  get disabled() {
1189
- return f.disabled;
1190
+ return p.disabled;
1190
1191
  },
1191
1192
  get forecastAmounts() {
1192
- return r.value;
1193
+ return l.value;
1193
1194
  }
1194
- }), Ne = U(() => Ue.columnDefs.value);
1195
+ }), Ne = N(() => Ue.columnDefs.value);
1195
1196
  function Fe() {
1196
- var X, ie, Be, Le, Pe;
1197
- const o = (Be = (ie = (X = m.value) == null ? void 0 : X.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : Be.groupBy((B) => B.sku._id), p = b.isEnabled ? b.getAvailableItems((Pe = (Le = t.netSuite) == null ? void 0 : Le.subsidiary) == null ? void 0 : Pe.id) : [], M = o != null && o.size ? $.skus.filter((B) => o.has(B._id)) : $.skus, G = b.isEnabled ? M.filter((B) => {
1198
- var oe, te, ue, pe;
1199
- const ee = (te = (oe = m.value) == null ? void 0 : oe.purchaseOrder) == null ? void 0 : te.items.find(
1200
- (ye) => ye.sku._id === B._id
1197
+ var W, ie, ze, Le, Pe;
1198
+ const o = (ze = (ie = (W = m.value) == null ? void 0 : W.purchaseOrder) == null ? void 0 : ie.items) == null ? void 0 : ze.groupBy((z) => z.sku._id), f = y.isEnabled ? y.getAvailableItems((Pe = (Le = t.netSuite) == null ? void 0 : Le.subsidiary) == null ? void 0 : Pe.id) : [], A = o != null && o.size ? $.skus.filter((z) => o.has(z._id)) : $.skus, H = y.isEnabled ? A.filter((z) => {
1199
+ var ae, se, ue, pe;
1200
+ const te = (se = (ae = m.value) == null ? void 0 : ae.purchaseOrder) == null ? void 0 : se.items.find(
1201
+ (ye) => ye.sku._id === z._id
1201
1202
  );
1202
- if (ee != null && ee.measurement != null) {
1203
- const ye = b.getAvailableMeasurements(
1204
- ee.sku._id,
1203
+ if (te != null && te.measurement != null) {
1204
+ const ye = y.getAvailableMeasurements(
1205
+ te.sku._id,
1205
1206
  (pe = (ue = t.netSuite) == null ? void 0 : ue.subsidiary) == null ? void 0 : pe.id
1206
1207
  );
1207
- return p.includes(ee.sku._id) && ye.includes(ee.measurement.id);
1208
+ return f.includes(te.sku._id) && ye.includes(te.measurement.id);
1208
1209
  }
1209
- return p.includes(B._id);
1210
- }).map((B) => B._id) : M.map((B) => B._id), le = M.map(
1211
- (B) => {
1212
- var ee, oe, te, ue;
1210
+ return f.includes(z._id);
1211
+ }).map((z) => z._id) : A.map((z) => z._id), le = A.map(
1212
+ (z) => {
1213
+ var te, ae, se, ue;
1213
1214
  return {
1214
- label: ((oe = (ee = o == null ? void 0 : o.get(B._id)) == null ? void 0 : ee[0]) == null ? void 0 : oe.name) ?? B.name,
1215
- sublabel: ((ue = (te = o == null ? void 0 : o.get(B._id)) == null ? void 0 : te[0]) == null ? void 0 : ue.code) ?? B.code,
1216
- value: B,
1217
- disabled: !G.includes(B._id)
1215
+ label: ((ae = (te = o == null ? void 0 : o.get(z._id)) == null ? void 0 : te[0]) == null ? void 0 : ae.name) ?? z.name,
1216
+ sublabel: ((ue = (se = o == null ? void 0 : o.get(z._id)) == null ? void 0 : se[0]) == null ? void 0 : ue.code) ?? z.code,
1217
+ value: z,
1218
+ disabled: !!(!H.includes(z._id) || z.isInactive),
1219
+ tags: z.isInactive ? ["Inactive"] : []
1218
1220
  };
1219
1221
  }
1220
- ), re = le.filter((B) => {
1221
- var ee;
1222
- return (ee = t.items) == null ? void 0 : ee.find((oe) => oe.sku._id === B.value._id);
1223
- }).map((B) => B.value);
1224
- j.open({
1222
+ ), re = le.filter((z) => {
1223
+ var te;
1224
+ return (te = t.items) == null ? void 0 : te.find((ae) => ae.sku._id === z.value._id);
1225
+ }).map((z) => z.value);
1226
+ Q.open({
1225
1227
  title: v("inventory.transfer.form.items.selectItem"),
1226
1228
  closeButton: !0,
1227
1229
  contentComponent: Ht,
@@ -1239,24 +1241,24 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1239
1241
  close: !0,
1240
1242
  variant: "tertiary"
1241
1243
  }
1242
- }).onPrimary((B) => {
1243
- const ee = t.items ?? [], oe = B.map((te) => {
1244
+ }).onPrimary((z) => {
1245
+ const te = t.items ?? [], ae = z.map((se) => {
1244
1246
  var ye, Re;
1245
- const ue = ee.find((be) => be.sku._id === te._id);
1247
+ const ue = te.find((be) => be.sku._id === se._id);
1246
1248
  if (ue)
1247
1249
  return ue;
1248
1250
  const pe = ((Re = (ye = m.value) == null ? void 0 : ye.purchaseOrder.items) == null ? void 0 : Re.find(
1249
- (be) => be.sku._id === te._id
1251
+ (be) => be.sku._id === se._id
1250
1252
  )) ?? {
1251
- sku: te,
1252
- code: te.code,
1253
- name: te.name,
1253
+ sku: se,
1254
+ code: se.code,
1255
+ name: se.name,
1254
1256
  quantity: {
1255
1257
  amount: 1,
1256
1258
  precision: 0
1257
1259
  }
1258
1260
  };
1259
- if (Y.value == ae.PURCHASE) {
1261
+ if (K.value == ne.PURCHASE) {
1260
1262
  const { cost: be } = $e(
1261
1263
  pe.sku,
1262
1264
  pe.quantity,
@@ -1269,104 +1271,104 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1269
1271
  }
1270
1272
  return pe;
1271
1273
  });
1272
- oe.sort((te, ue) => te.sku.code.localeCompare(ue.sku.code)), t.items = oe;
1274
+ ae.sort((se, ue) => se.sku.code.localeCompare(ue.sku.code)), t.items = ae;
1273
1275
  });
1274
1276
  }
1275
1277
  function Ye(o) {
1276
1278
  return o;
1277
1279
  }
1278
- const ze = U(() => {
1280
+ const Be = N(() => {
1279
1281
  var o;
1280
- return m.value ? ((o = m.value) == null ? void 0 : o.purchaseOrder.items) || [] : $.skus.map((p) => ({
1282
+ return m.value ? ((o = m.value) == null ? void 0 : o.purchaseOrder.items) || [] : $.skus.map((f) => ({
1281
1283
  quantity: {
1282
1284
  amount: 0,
1283
1285
  precision: 0
1284
1286
  },
1285
- name: p.name,
1286
- code: p.code,
1287
- sku: p,
1287
+ name: f.name,
1288
+ code: f.code,
1289
+ sku: f,
1288
1290
  quantityStep: {
1289
1291
  amount: 0,
1290
1292
  precision: 0
1291
1293
  },
1292
- measurement: p.trackingMeasurement ? p.unit.measurements.find((M) => M.id === p.trackingMeasurement) : null
1294
+ measurement: f.trackingMeasurement ? f.unit.measurements.find((A) => A.id === f.trackingMeasurement) : null
1293
1295
  }));
1294
- }), Ie = U(() => {
1296
+ }), De = N(() => {
1295
1297
  const o = [];
1296
1298
  return (!u.mustUsePoTemplate || u.mustUsePoTemplate && t.template) && o.push({
1297
1299
  label: v("inventory.transfer.form.type.purchase"),
1298
- value: ae.PURCHASE
1300
+ value: ne.PURCHASE
1299
1301
  }), o.push({
1300
1302
  label: v("inventory.transfer.form.type.transfer"),
1301
- value: ae.TRANSFER
1303
+ value: ne.TRANSFER
1302
1304
  }), o;
1303
- }), Ve = U(() => {
1305
+ }), Ve = N(() => {
1304
1306
  var o;
1305
- return (o = f.modelValue) == null ? void 0 : o.items.every((p) => p.quantity.amount <= 0);
1307
+ return (o = p.modelValue) == null ? void 0 : o.items.every((f) => f.quantity.amount <= 0);
1306
1308
  });
1307
- return (o, p) => {
1309
+ return (o, f) => {
1308
1310
  var ye, Re;
1309
- const M = T("FmChip"), G = T("FmLabel"), le = T("FmIcon"), re = T("FmField"), X = T("FmTooltip"), ie = T("FmSelect"), Be = T("FmTextField"), Le = T("FmTextarea"), Pe = T("FmSwitch"), B = T("FmDatePicker"), ee = T("FmTimePicker"), oe = T("FmFormGroup"), te = T("FmButton"), ue = T("FmTable"), pe = T("FmForm");
1310
- return S(), D("div", uo, [
1311
- n("div", co, [
1312
- (ye = f.modelValue) != null && ye.template ? (S(), W(M, {
1311
+ const A = I("FmChip"), H = I("FmLabel"), le = I("FmIcon"), re = I("FmField"), W = I("FmTooltip"), ie = I("FmSelect"), ze = I("FmTextField"), Le = I("FmTextarea"), Pe = I("FmSwitch"), z = I("FmDatePicker"), te = I("FmTimePicker"), ae = I("FmFormGroup"), se = I("FmButton"), ue = I("FmTable"), pe = I("FmForm");
1312
+ return S(), T("div", co, [
1313
+ n("div", mo, [
1314
+ (ye = p.modelValue) != null && ye.template ? (S(), G(A, {
1313
1315
  key: 0,
1314
1316
  variant: o.disabled ? "warning" : void 0,
1315
1317
  label: `${s(v)("inventory.transfer.template.title")}: ${((Re = m.value) == null ? void 0 : Re.name) ?? s(v)("inventory.transfer.form.loading")}`,
1316
1318
  icon: "summarize",
1317
1319
  compact: ""
1318
- }, null, 8, ["variant", "label"])) : H("", !0),
1319
- y(M, {
1320
+ }, null, 8, ["variant", "label"])) : j("", !0),
1321
+ b(A, {
1320
1322
  label: s(F).currentLocation.name,
1321
1323
  icon: "storefront",
1322
1324
  compact: ""
1323
1325
  }, null, 8, ["label"]),
1324
- o.lastClosingDate ? (S(), W(M, {
1326
+ o.lastClosingDate ? (S(), G(A, {
1325
1327
  key: 1,
1326
- label: `${s(v)("inventory.transfer.form.lastClosing")}: ${s(Ge)(o.lastClosingDate)} ${s(zt)(o.lastClosingDate)}`,
1328
+ label: `${s(v)("inventory.transfer.form.lastClosing")}: ${s(Ge)(o.lastClosingDate)} ${s(Bt)(o.lastClosingDate)}`,
1327
1329
  icon: "calendar_month",
1328
1330
  compact: ""
1329
- }, null, 8, ["label"])) : H("", !0)
1331
+ }, null, 8, ["label"])) : j("", !0)
1330
1332
  ]),
1331
- y(pe, {
1333
+ b(pe, {
1332
1334
  ref_key: "formRef",
1333
1335
  ref: me,
1334
1336
  class: "flex flex-col gap-32",
1335
1337
  disabled: o.disabled,
1336
1338
  onValidationFailed: console.log,
1337
- onValidationSuccess: p[14] || (p[14] = (be) => x("validation-success"))
1339
+ onValidationSuccess: f[14] || (f[14] = (be) => x("validation-success"))
1338
1340
  }, {
1339
1341
  default: R(() => {
1340
1342
  var be, at, nt, lt, rt, it, ut, dt;
1341
1343
  return [
1342
- n("div", mo, [
1343
- n("div", po, [
1344
- (be = f.modelValue) != null && be.template ? (S(), D(de, { key: 0 }, [
1345
- n("div", fo, [
1346
- y(G, {
1344
+ n("div", po, [
1345
+ n("div", fo, [
1346
+ (be = p.modelValue) != null && be.template ? (S(), T(de, { key: 0 }, [
1347
+ n("div", vo, [
1348
+ b(H, {
1347
1349
  label: s(v)("inventory.transfer.form.type.title")
1348
1350
  }, null, 8, ["label"]),
1349
- n("div", vo, [
1350
- y(X, {
1351
+ n("div", yo, [
1352
+ b(W, {
1351
1353
  "z-index": 51,
1352
1354
  placement: "left",
1353
1355
  disabled: o.disabled
1354
1356
  }, {
1355
- content: R(() => p[15] || (p[15] = [
1356
- Te("This field is locked from template.")
1357
+ content: R(() => f[15] || (f[15] = [
1358
+ Ie("This field is locked from template.")
1357
1359
  ])),
1358
1360
  default: R(() => [
1359
- y(re, null, {
1361
+ b(re, null, {
1360
1362
  default: R(() => [
1361
- n("div", yo, [
1362
- y(le, {
1363
+ n("div", bo, [
1364
+ b(le, {
1363
1365
  name: "lock_outline",
1364
1366
  size: "sm",
1365
1367
  color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
1366
1368
  }, null, 8, ["color"]),
1367
1369
  n("div", {
1368
- class: K({ "text-fm-color-typo-disabled": o.disabled })
1369
- }, E(s(v)(`inventory.transfer.form.type.${Y.value.toLocaleLowerCase("en-us")}`)), 3)
1370
+ class: Z({ "text-fm-color-typo-disabled": o.disabled })
1371
+ }, q(s(v)(`inventory.transfer.form.type.${K.value.toLocaleLowerCase("en-us")}`)), 3)
1370
1372
  ])
1371
1373
  ]),
1372
1374
  _: 1
@@ -1375,40 +1377,40 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1375
1377
  _: 1
1376
1378
  }, 8, ["disabled"]),
1377
1379
  n("div", {
1378
- class: K([
1380
+ class: Z([
1379
1381
  "fm-typo-en-body-sm-400",
1380
1382
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-secondary"
1381
1383
  ])
1382
1384
  }, null, 2)
1383
1385
  ])
1384
1386
  ]),
1385
- n("div", bo, [
1386
- y(G, {
1387
- label: Y.value === s(ae).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom")
1387
+ n("div", go, [
1388
+ b(H, {
1389
+ label: K.value === s(ne).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom")
1388
1390
  }, null, 8, ["label"]),
1389
- n("div", go, [
1390
- y(X, {
1391
+ n("div", _o, [
1392
+ b(W, {
1391
1393
  "z-index": 51,
1392
1394
  placement: "left",
1393
1395
  disabled: o.disabled
1394
1396
  }, {
1395
- content: R(() => p[16] || (p[16] = [
1396
- Te("This field is locked from template.")
1397
+ content: R(() => f[16] || (f[16] = [
1398
+ Ie("This field is locked from template.")
1397
1399
  ])),
1398
1400
  default: R(() => [
1399
- y(re, null, {
1401
+ b(re, null, {
1400
1402
  default: R(() => {
1401
1403
  var V;
1402
1404
  return [
1403
- n("div", _o, [
1404
- y(le, {
1405
+ n("div", ho, [
1406
+ b(le, {
1405
1407
  name: "lock_outline",
1406
1408
  size: "sm",
1407
1409
  color: o.disabled ? "neutral-gray-200" : "neutral-gray-400"
1408
1410
  }, null, 8, ["color"]),
1409
1411
  n("div", {
1410
- class: K({ "text-fm-color-typo-disabled": o.disabled })
1411
- }, E((V = A.value.find((se) => se.value === q.value)) == null ? void 0 : V.label), 3)
1412
+ class: Z({ "text-fm-color-typo-disabled": o.disabled })
1413
+ }, q((V = E.value.find((oe) => oe.value === U.value)) == null ? void 0 : V.label), 3)
1412
1414
  ])
1413
1415
  ];
1414
1416
  }),
@@ -1419,39 +1421,39 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1419
1421
  }, 8, ["disabled"])
1420
1422
  ])
1421
1423
  ])
1422
- ], 64)) : (S(), D(de, { key: 1 }, [
1423
- y(ie, {
1424
+ ], 64)) : (S(), T(de, { key: 1 }, [
1425
+ b(ie, {
1424
1426
  label: s(v)("inventory.transfer.form.type.title"),
1425
1427
  "label-mark": "required",
1426
- modelValue: Y.value,
1427
- "onUpdate:modelValue": p[0] || (p[0] = (V) => Y.value = V),
1428
- items: Ie.value,
1429
- rules: [s(qe)(1)(Ie.value)]
1428
+ modelValue: K.value,
1429
+ "onUpdate:modelValue": f[0] || (f[0] = (V) => K.value = V),
1430
+ items: De.value,
1431
+ rules: [s(qe)(1)(De.value)]
1430
1432
  }, {
1431
1433
  default: R(() => [
1432
1434
  n("span", {
1433
- class: K([
1435
+ class: Z([
1434
1436
  "line-clamp-1 fm-typo-en-body-lg-400",
1435
1437
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1436
1438
  ])
1437
- }, E(s(Bt)(Y.value)), 3)
1439
+ }, q(s(zt)(K.value)), 3)
1438
1440
  ]),
1439
1441
  _: 1
1440
1442
  }, 8, ["label", "modelValue", "items", "rules"]),
1441
- y(ie, {
1442
- label: Y.value === s(ae).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom"),
1443
+ b(ie, {
1444
+ label: K.value === s(ne).PURCHASE ? s(v)("inventory.transfer.form.purchaseFrom") : s(v)("inventory.transfer.form.transferFrom"),
1443
1445
  "label-mark": "required",
1444
- modelValue: q.value,
1445
- "onUpdate:modelValue": p[1] || (p[1] = (V) => q.value = V),
1446
- items: A.value,
1447
- rules: [s(qe)(1)(A.value)]
1446
+ modelValue: U.value,
1447
+ "onUpdate:modelValue": f[1] || (f[1] = (V) => U.value = V),
1448
+ items: E.value,
1449
+ rules: [s(qe)(1)(E.value)]
1448
1450
  }, {
1449
1451
  "menu-wrapper": R((V) => {
1450
- var se, Ae;
1452
+ var oe, Ae;
1451
1453
  return [
1452
- y(fs, Ze(V, {
1453
- items: A.value,
1454
- "model-value": (Ae = (se = o.modelValue) == null ? void 0 : se.supplier) == null ? void 0 : Ae._id
1454
+ b(vs, Ze(V, {
1455
+ items: E.value,
1456
+ "model-value": (Ae = (oe = o.modelValue) == null ? void 0 : oe.supplier) == null ? void 0 : Ae._id
1455
1457
  }), null, 16, ["items", "model-value"])
1456
1458
  ];
1457
1459
  }),
@@ -1459,103 +1461,103 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1459
1461
  var V;
1460
1462
  return [
1461
1463
  n("span", {
1462
- class: K([
1464
+ class: Z([
1463
1465
  "line-clamp-1 fm-typo-en-body-lg-400",
1464
1466
  o.disabled ? "text-fm-color-typo-disabled" : "text-fm-color-typo-primary"
1465
1467
  ])
1466
- }, E((V = A.value.find((se) => se.value === q.value)) == null ? void 0 : V.label), 3)
1468
+ }, q((V = E.value.find((oe) => oe.value === U.value)) == null ? void 0 : V.label), 3)
1467
1469
  ];
1468
1470
  }),
1469
1471
  _: 1
1470
1472
  }, 8, ["label", "modelValue", "items", "rules"])
1471
1473
  ], 64)),
1472
- y(Be, {
1474
+ b(ze, {
1473
1475
  label: s(v)("inventory.transfer.form.reference"),
1474
1476
  "label-mark": "optional",
1475
1477
  modelValue: s(t).ref,
1476
- "onUpdate:modelValue": p[2] || (p[2] = (V) => s(t).ref = V)
1478
+ "onUpdate:modelValue": f[2] || (f[2] = (V) => s(t).ref = V)
1477
1479
  }, null, 8, ["label", "modelValue"]),
1478
- y(Le, {
1480
+ b(Le, {
1479
1481
  label: s(v)("inventory.transfer.form.remark"),
1480
1482
  "label-mark": "optional",
1481
1483
  "max-length": 240,
1482
1484
  modelValue: P.value,
1483
- "onUpdate:modelValue": p[3] || (p[3] = (V) => P.value = V),
1484
- class: K([o.disabled ? "text-fm-color-typo-disabled " : ""])
1485
+ "onUpdate:modelValue": f[3] || (f[3] = (V) => P.value = V),
1486
+ class: Z([o.disabled ? "text-fm-color-typo-disabled " : ""])
1485
1487
  }, null, 8, ["label", "modelValue", "class"]),
1486
- _.value ? (S(), W(io, {
1488
+ _.value ? (S(), G(uo, {
1487
1489
  key: 2,
1488
1490
  required: s(t).template != null,
1489
1491
  disabled: o.disabled,
1490
1492
  supplier: s(t).supplier,
1491
1493
  setting: s(t).netSuite,
1492
1494
  items: s(t).items,
1493
- onChange: (V, se) => {
1494
- s(t).items = V, s(t).netSuite = se;
1495
+ onChange: (V, oe) => {
1496
+ s(t).items = V, s(t).netSuite = oe;
1495
1497
  },
1496
- "onNetsuite:ready": p[4] || (p[4] = (V) => {
1498
+ "onNetsuite:ready": f[4] || (f[4] = (V) => {
1497
1499
  h.value = !0;
1498
1500
  })
1499
- }, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : H("", !0),
1500
- s(u).enableBackdatePo ? (S(), D("div", ho, [
1501
+ }, null, 8, ["required", "disabled", "supplier", "setting", "items", "onChange"])) : j("", !0),
1502
+ s(u).enableBackdatePo ? (S(), T("div", ko, [
1501
1503
  n("div", {
1502
- class: K([
1504
+ class: Z([
1503
1505
  "flex",
1504
1506
  {
1505
1507
  "flex-col": i.value
1506
1508
  }
1507
1509
  ])
1508
1510
  }, [
1509
- y(Pe, {
1511
+ b(Pe, {
1510
1512
  modelValue: s(c),
1511
- "onUpdate:modelValue": p[5] || (p[5] = (V) => xe(c) ? c.value = V : null),
1513
+ "onUpdate:modelValue": f[5] || (f[5] = (V) => xe(c) ? c.value = V : null),
1512
1514
  label: s(v)("inventory.transfer.form.backdate.title"),
1513
1515
  sublabel: s(v)("inventory.transfer.form.backdate.subtitle"),
1514
1516
  "label-placement": "right",
1515
- disabled: N.value && !o.lastClosingDate || o.disabled
1517
+ disabled: B.value && !o.lastClosingDate || o.disabled
1516
1518
  }, null, 8, ["modelValue", "label", "sublabel", "disabled"]),
1517
1519
  n("div", {
1518
- class: K({ hidden: i.value, "w-16": !i.value })
1520
+ class: Z({ hidden: i.value, "w-16": !i.value })
1519
1521
  }, null, 2),
1520
- s(c) ? (S(), D("div", ko, [
1521
- n("div", xo, [
1522
- y(B, {
1523
- modelValue: s(z),
1524
- "onUpdate:modelValue": p[6] || (p[6] = (V) => xe(z) ? z.value = V : null)
1522
+ s(c) ? (S(), T("div", xo, [
1523
+ n("div", Co, [
1524
+ b(z, {
1525
+ modelValue: s(O),
1526
+ "onUpdate:modelValue": f[6] || (f[6] = (V) => xe(O) ? O.value = V : null)
1525
1527
  }, null, 8, ["modelValue"])
1526
1528
  ]),
1527
- n("div", Co, [
1528
- y(ee, {
1529
- modelValue: s(ne),
1530
- "onUpdate:modelValue": p[7] || (p[7] = (V) => xe(ne) ? ne.value = V : null)
1529
+ n("div", So, [
1530
+ b(te, {
1531
+ modelValue: s(ee),
1532
+ "onUpdate:modelValue": f[7] || (f[7] = (V) => xe(ee) ? ee.value = V : null)
1531
1533
  }, null, 8, ["modelValue"])
1532
1534
  ])
1533
- ])) : H("", !0)
1535
+ ])) : j("", !0)
1534
1536
  ], 2),
1535
- s(d) ? (S(), W(oe, {
1537
+ s(d) ? (S(), G(ae, {
1536
1538
  key: 0,
1537
1539
  modelValue: s(d),
1538
- "onUpdate:modelValue": p[8] || (p[8] = (V) => xe(d) ? d.value = V : null),
1540
+ "onUpdate:modelValue": f[8] || (f[8] = (V) => xe(d) ? d.value = V : null),
1539
1541
  rules: [s(Lt)(new Date(o.lastClosingDate), /* @__PURE__ */ new Date())]
1540
- }, null, 8, ["modelValue", "rules"])) : H("", !0),
1541
- N.value && !o.lastClosingDate ? (S(), D("div", So, [
1542
- y(le, {
1542
+ }, null, 8, ["modelValue", "rules"])) : j("", !0),
1543
+ B.value && !o.lastClosingDate ? (S(), T("div", wo, [
1544
+ b(le, {
1543
1545
  name: "error",
1544
1546
  size: "sm",
1545
1547
  class: "text-fm-color-typo-warning"
1546
1548
  }),
1547
- n("span", wo, E(s(v)("inventory.transfer.form.backdate.error")), 1)
1548
- ])) : H("", !0)
1549
- ])) : H("", !0)
1549
+ n("span", Fo, q(s(v)("inventory.transfer.form.backdate.error")), 1)
1550
+ ])) : j("", !0)
1551
+ ])) : j("", !0)
1550
1552
  ])
1551
1553
  ]),
1552
- n("div", Fo, [
1553
- y(oe, {
1554
+ n("div", $o, [
1555
+ b(ae, {
1554
1556
  "model-value": s(t).items,
1555
1557
  rules: [s(qe)(1)]
1556
1558
  }, null, 8, ["model-value", "rules"]),
1557
1559
  n("div", {
1558
- class: K([
1560
+ class: Z([
1559
1561
  "flex gap-16",
1560
1562
  {
1561
1563
  "flex-col items-start": i.value,
@@ -1563,9 +1565,9 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1563
1565
  }
1564
1566
  ])
1565
1567
  }, [
1566
- n("div", $o, E(s(v)("inventory.transfer.form.items.title")), 1),
1568
+ n("div", Io, q(s(v)("inventory.transfer.form.items.title")), 1),
1567
1569
  n("div", To, [
1568
- y(te, {
1570
+ b(se, {
1569
1571
  disabled: o.disabled,
1570
1572
  label: s(v)("inventory.transfer.form.items.addItem"),
1571
1573
  "prepend-icon": "add",
@@ -1573,37 +1575,37 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1573
1575
  "text-color": "primary",
1574
1576
  "bg-color": "transparent",
1575
1577
  "border-color": "primary",
1576
- onClick: p[9] || (p[9] = (V) => Fe()),
1578
+ onClick: f[9] || (f[9] = (V) => Fe()),
1577
1579
  size: "md"
1578
1580
  }, null, 8, ["disabled", "label"]),
1579
- y(Gs, {
1581
+ b(Js, {
1580
1582
  "template-id": s(t).template || void 0,
1581
- "template-items": ze.value,
1583
+ "template-items": Be.value,
1582
1584
  "po-items": s(t).items,
1583
- "onUpdate:forecastAmounts": p[10] || (p[10] = (V) => {
1584
- r.value = V;
1585
+ "onUpdate:forecastAmounts": f[10] || (f[10] = (V) => {
1586
+ l.value = V;
1585
1587
  }),
1586
- "onUpdate:poItems": p[11] || (p[11] = (V) => {
1588
+ "onUpdate:poItems": f[11] || (f[11] = (V) => {
1587
1589
  s(t).items = V, C.value++;
1588
1590
  })
1589
1591
  }, null, 8, ["template-id", "template-items", "po-items"])
1590
1592
  ])
1591
1593
  ], 2),
1592
- Y.value === s(ae).PURCHASE && I.value && s(u).enableTotalCost && ((at = o.modelValue) != null && at.items.length) ? (S(), D("div", Do, [
1593
- y(Pe, {
1594
+ K.value === s(ne).PURCHASE && D.value && s(u).enableTotalCost && ((at = o.modelValue) != null && at.items.length) ? (S(), T("div", Do, [
1595
+ b(Pe, {
1594
1596
  label: s(ke) ? s(v)("inventory.transfer.form.items.fetchingData") : s(v)("inventory.transfer.form.items.comparePriceHistory"),
1595
1597
  "prepend-icon": "compare_arrows",
1596
1598
  "label-placement": "right",
1597
- "model-value": s(Z),
1598
- "onUpdate:modelValue": p[12] || (p[12] = (V) => xe(Z) ? Z.value = V : null),
1599
+ "model-value": s(X),
1600
+ "onUpdate:modelValue": f[12] || (f[12] = (V) => xe(X) ? X.value = V : null),
1599
1601
  disabled: s(ke) || o.disabled
1600
1602
  }, null, 8, ["label", "model-value", "disabled"])
1601
- ])) : H("", !0),
1602
- y(oe, {
1603
+ ])) : j("", !0),
1604
+ b(ae, {
1603
1605
  "model-value": Ve.value,
1604
1606
  rules: [() => Ve.value ? "Must have at least one non-zero item" : !0]
1605
1607
  }, null, 8, ["model-value", "rules"]),
1606
- (S(), W(ue, {
1608
+ (S(), G(ue, {
1607
1609
  "column-defs": Ne.value,
1608
1610
  "column-visibility": {
1609
1611
  [s(J).Code]: !(((nt = o.modelValue) == null ? void 0 : nt.template) ?? ((lt = o.modelValue) == null ? void 0 : lt.templateDoc)),
@@ -1616,31 +1618,31 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1616
1618
  "page-size": s(t).items.length
1617
1619
  }, {
1618
1620
  "table-row": R((V) => {
1619
- var se, Ae, ct, mt;
1621
+ var oe, Ae, ct, mt;
1620
1622
  return [
1621
- y(oo, {
1623
+ b(ao, {
1622
1624
  "compare-price-by-sku": s(ve),
1623
- "show-compare-price": Y.value === s(ae).PURCHASE && s(Z),
1625
+ "show-compare-price": K.value === s(ne).PURCHASE && s(X),
1624
1626
  row: V,
1625
- "template-item": (mt = (ct = (Ae = (se = o.modelValue) == null ? void 0 : se.templateDoc) == null ? void 0 : Ae.purchaseOrder) == null ? void 0 : ct.items) == null ? void 0 : mt.find(
1627
+ "template-item": (mt = (ct = (Ae = (oe = o.modelValue) == null ? void 0 : oe.templateDoc) == null ? void 0 : Ae.purchaseOrder) == null ? void 0 : ct.items) == null ? void 0 : mt.find(
1626
1628
  (Ke) => Ke.sku._id === V.original.sku._id
1627
1629
  ),
1628
- "onUpdate:item": p[13] || (p[13] = (Ke) => we.value.updateItem(Ke)),
1630
+ "onUpdate:item": f[13] || (f[13] = (Ke) => we.value.updateItem(Ke)),
1629
1631
  disabled: o.disabled
1630
1632
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "template-item", "disabled"])
1631
1633
  ];
1632
1634
  }),
1633
1635
  "list-row": R((V) => [
1634
- (S(), W(xt, {
1636
+ (S(), G(xt, {
1635
1637
  row: V,
1636
- key: s(t).items.map((se) => se.sku._id).join(".")
1638
+ key: s(t).items.map((oe) => oe.sku._id).join(".")
1637
1639
  }, {
1638
- default: R((se) => [
1639
- y(Es, {
1640
+ default: R((oe) => [
1641
+ b(Os, {
1640
1642
  "compare-price-by-sku": s(ve),
1641
- "show-compare-price": Y.value === s(ae).PURCHASE && s(Z),
1643
+ "show-compare-price": K.value === s(ne).PURCHASE && s(X),
1642
1644
  row: V,
1643
- "cell-by-col-id": se
1645
+ "cell-by-col-id": oe
1644
1646
  }, null, 8, ["compare-price-by-sku", "show-compare-price", "row", "cell-by-col-id"])
1645
1647
  ]),
1646
1648
  _: 2
@@ -1656,7 +1658,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1656
1658
  ]);
1657
1659
  };
1658
1660
  }
1659
- }), Vo = { class: "flex items-center" }, Po = { class: "fm-typo-en-title-md-800" }, Ro = { class: "flex gap-4" }, Ao = /* @__PURE__ */ ce({
1661
+ }), Po = { class: "flex items-center" }, Ro = { class: "fm-typo-en-title-md-800" }, Ao = { class: "flex gap-4" }, Eo = /* @__PURE__ */ ce({
1660
1662
  __name: "TransferDialog",
1661
1663
  props: {
1662
1664
  mode: {},
@@ -1666,9 +1668,9 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1666
1668
  lastClosingDate: {}
1667
1669
  },
1668
1670
  emits: ["update:show", "submitted"],
1669
- setup(g, { expose: w, emit: l }) {
1671
+ setup(g, { expose: w, emit: r }) {
1670
1672
  var P;
1671
- const f = g, x = l, t = tt(), v = wt(), F = De(), $ = ot(), b = et(), e = Je(), { t: u } = he(), k = O(!1), a = O(!1), i = O(!1);
1673
+ const p = g, x = r, t = tt(), v = wt(), F = Te(), $ = ot(), y = et(), e = Je(), { t: u } = he(), k = M(!1), a = M(!1), i = M(!1);
1672
1674
  async function h(d) {
1673
1675
  if (d) {
1674
1676
  a.value = !1;
@@ -1714,20 +1716,20 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1714
1716
  _id: "",
1715
1717
  seqNumber: 0,
1716
1718
  deliveryOrder: [],
1717
- template: f.templateId,
1718
- templateDoc: v.templates.find((c) => c._id === f.templateId)
1719
+ template: p.templateId,
1720
+ templateDoc: v.templates.find((c) => c._id === p.templateId)
1719
1721
  };
1720
1722
  }
1721
- const C = St(f, "show"), r = O(f.modelValue ?? _()), m = O(((P = f.modelValue) == null ? void 0 : P._id) ?? `${Math.random()}`);
1723
+ const C = St(p, "show"), l = M(p.modelValue ?? _()), m = M(((P = p.modelValue) == null ? void 0 : P._id) ?? `${Math.random()}`);
1722
1724
  _e(
1723
- () => f.show,
1725
+ () => p.show,
1724
1726
  (d) => {
1725
1727
  var c;
1726
- d && (i.value = !1, r.value = f.modelValue ?? _(), m.value = ((c = f.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
1728
+ d && (i.value = !1, l.value = p.modelValue ?? _(), m.value = ((c = p.modelValue) == null ? void 0 : c._id) ?? `${Math.random()}`);
1727
1729
  }
1728
1730
  );
1729
- const I = U(() => !a.value || !i.value), N = U(() => {
1730
- switch (f.mode) {
1731
+ const D = N(() => !a.value || !i.value), B = N(() => {
1732
+ switch (p.mode) {
1731
1733
  case Ee.READ:
1732
1734
  return "View transfer";
1733
1735
  case Ee.CREATE:
@@ -1736,23 +1738,23 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1736
1738
  return u("inventory.transfer.receiveRequest.update.title");
1737
1739
  }
1738
1740
  return "";
1739
- }), j = O();
1741
+ }), Q = M();
1740
1742
  w({
1741
1743
  validateInputs: () => {
1742
1744
  var d, c;
1743
- (c = (d = j.value) == null ? void 0 : d.validateInputs) == null || c.call(d);
1745
+ (c = (d = Q.value) == null ? void 0 : d.validateInputs) == null || c.call(d);
1744
1746
  },
1745
1747
  resetInputsValidation: () => {
1746
1748
  var d, c;
1747
- (c = (d = j.value) == null ? void 0 : d.resetInputsValidation) == null || c.call(d);
1749
+ (c = (d = Q.value) == null ? void 0 : d.resetInputsValidation) == null || c.call(d);
1748
1750
  },
1749
1751
  resetInputs: () => {
1750
1752
  var d, c;
1751
- (c = (d = j.value) == null ? void 0 : d.resetInputs) == null || c.call(d);
1753
+ (c = (d = Q.value) == null ? void 0 : d.resetInputs) == null || c.call(d);
1752
1754
  }
1753
1755
  });
1754
- async function Q() {
1755
- const d = r.value;
1756
+ async function Y() {
1757
+ const d = l.value;
1756
1758
  if (k.value = !0, d.items = d.items.filter((c) => c.quantity.amount > 0), !d.items.length) {
1757
1759
  F.open({
1758
1760
  title: "Cannot create order",
@@ -1761,7 +1763,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1761
1763
  });
1762
1764
  return;
1763
1765
  }
1764
- (d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...z }) => z));
1766
+ (d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...O }) => O));
1765
1767
  try {
1766
1768
  await t.createPurchaseOrder(d), await new Promise((c) => setTimeout(c, 1e3)), F.open({
1767
1769
  title: u("inventory.transfer.receiveRequest.create.success"),
@@ -1778,8 +1780,8 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1778
1780
  k.value = !1;
1779
1781
  }
1780
1782
  }
1781
- async function Y() {
1782
- const d = r.value;
1783
+ async function K() {
1784
+ const d = l.value;
1783
1785
  if (k.value = !0, d.items = d.items.filter((c) => c.quantity.amount > 0), !d.items.length) {
1784
1786
  F.open({
1785
1787
  title: "Cannot create order",
@@ -1788,7 +1790,7 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1788
1790
  });
1789
1791
  return;
1790
1792
  }
1791
- (d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...z }) => z));
1793
+ (d.supplier.internal === "warehouse" || d.supplier.internal === "restaurant") && (d.items = d.items.map(({ totalCost: c, ...O }) => O));
1792
1794
  try {
1793
1795
  await t.updatePurchaseOrder(d), await new Promise((c) => setTimeout(c, 1e3)), F.open({
1794
1796
  title: u("inventory.transfer.receiveRequest.update.success"),
@@ -1805,61 +1807,74 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1805
1807
  k.value = !1;
1806
1808
  }
1807
1809
  }
1808
- function A() {
1809
- switch (f.mode) {
1810
+ function E() {
1811
+ switch (p.mode) {
1810
1812
  case Ee.CREATE:
1811
- return Q();
1812
- case Ee.UPDATE:
1813
1813
  return Y();
1814
+ case Ee.UPDATE:
1815
+ return K();
1814
1816
  }
1815
1817
  }
1816
- function q() {
1817
- var d, c;
1818
- (c = (d = j.value) == null ? void 0 : d.validateInputs) == null || c.call(d);
1818
+ function U() {
1819
+ var O, ee;
1820
+ const d = jt.validatePurchaseOrderItems({
1821
+ skusById: y.skuById ?? {},
1822
+ items: l.value.items ?? []
1823
+ }), c = Object.values(d).flat();
1824
+ if (c.length > 0) {
1825
+ const X = c[0];
1826
+ F.open({
1827
+ title: `[Row ${X.index + 1}] "${X.poItem.sku.name}"`,
1828
+ message: `${X.message}`,
1829
+ type: "error"
1830
+ });
1831
+ return;
1832
+ }
1833
+ (ee = (O = Q.value) == null ? void 0 : O.validateInputs) == null || ee.call(O);
1819
1834
  }
1820
1835
  return (d, c) => {
1821
- const z = T("FmButton"), ne = T("FmSideSheet");
1822
- return S(), W(ne, {
1836
+ const O = I("FmButton"), ee = I("FmSideSheet");
1837
+ return S(), G(ee, {
1823
1838
  modelValue: s(C),
1824
- "onUpdate:modelValue": c[3] || (c[3] = (Z) => xe(C) ? C.value = Z : null),
1839
+ "onUpdate:modelValue": c[3] || (c[3] = (X) => xe(C) ? C.value = X : null),
1825
1840
  "dismiss-away": "",
1826
1841
  "close-button": "",
1827
1842
  "max-width": 900
1828
1843
  }, {
1829
1844
  "side-sheet-header": R(() => [
1830
- n("div", Vo, [
1831
- n("div", Po, E(N.value), 1)
1845
+ n("div", Po, [
1846
+ n("div", Ro, q(B.value), 1)
1832
1847
  ])
1833
1848
  ]),
1834
1849
  default: R(() => [
1835
- (S(), W(Io, {
1850
+ (S(), G(Vo, {
1836
1851
  class: "w-full",
1837
1852
  ref_key: "formRef",
1838
- ref: j,
1853
+ ref: Q,
1839
1854
  "onForm:ready": c[0] || (c[0] = () => i.value = !0),
1840
- onValidationSuccess: A,
1841
- modelValue: r.value,
1842
- "onUpdate:modelValue": c[1] || (c[1] = (Z) => r.value = Z),
1843
- disabled: k.value || I.value,
1855
+ onValidationSuccess: E,
1856
+ modelValue: l.value,
1857
+ "onUpdate:modelValue": c[1] || (c[1] = (X) => l.value = X),
1858
+ disabled: k.value || D.value,
1844
1859
  suppliers: s($).suppliers,
1845
- skus: s(b).skus,
1860
+ skus: s(y).skus,
1846
1861
  key: m.value,
1847
1862
  "last-closing-date": d.lastClosingDate
1848
1863
  }, null, 8, ["modelValue", "disabled", "suppliers", "skus", "last-closing-date"]))
1849
1864
  ]),
1850
1865
  "side-sheet-footer": R(() => [
1851
- n("div", Ro, [
1852
- y(z, {
1866
+ n("div", Ao, [
1867
+ b(O, {
1853
1868
  loading: k.value,
1854
- disabled: I.value,
1869
+ disabled: D.value,
1855
1870
  label: s(u)("common.save"),
1856
- onClick: q
1871
+ onClick: U
1857
1872
  }, null, 8, ["loading", "disabled", "label"]),
1858
- y(z, {
1859
- disabled: I.value,
1873
+ b(O, {
1874
+ disabled: D.value,
1860
1875
  variant: "tertiary",
1861
1876
  label: s(u)("common.close"),
1862
- onClick: c[2] || (c[2] = (Z) => x("update:show", !1))
1877
+ onClick: c[2] || (c[2] = (X) => x("update:show", !1))
1863
1878
  }, null, 8, ["disabled", "label"])
1864
1879
  ])
1865
1880
  ]),
@@ -1868,17 +1883,17 @@ const eo = { class: "fm-typo-body-md-400 line-clamp-2 w-full" }, to = { key: 0 }
1868
1883
  };
1869
1884
  }
1870
1885
  });
1871
- function Eo(g) {
1872
- const [w, l, f, ...x] = jt(g), t = f.map((b) => b.toLowerCase().trim().replace(/ /g, "_")), F = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((b) => !t.includes(b));
1886
+ function Oo(g) {
1887
+ const [w, r, p, ...x] = Qt(g), t = p.map((y) => y.toLowerCase().trim().replace(/ /g, "_")), F = ["item_name", "transfer_quantity(uom)", "uom", "scanned_code"].filter((y) => !t.includes(y));
1873
1888
  if (F.length)
1874
1889
  throw new Error(
1875
1890
  `Missing headers (${F.join()}). Excel file does not come from the template.`
1876
1891
  );
1877
- return x.map((b, e) => {
1892
+ return x.map((y, e) => {
1878
1893
  const u = {};
1879
1894
  for (const k in t) {
1880
1895
  const a = t[k];
1881
- Object.assign(u, { [a]: b[k] });
1896
+ Object.assign(u, { [a]: y[k] });
1882
1897
  }
1883
1898
  return {
1884
1899
  index: e,
@@ -1886,12 +1901,12 @@ function Eo(g) {
1886
1901
  };
1887
1902
  });
1888
1903
  }
1889
- function Oo(g) {
1904
+ function qo(g) {
1890
1905
  const w = g.SheetNames;
1891
1906
  try {
1892
1907
  return w.reduce(
1893
- (f, x) => {
1894
- const t = new Array(), v = g.Sheets[x], F = et(), $ = Eo(v), b = [];
1908
+ (p, x) => {
1909
+ const t = new Array(), v = g.Sheets[x], F = et(), $ = Oo(v), y = [];
1895
1910
  for (const { index: u, data: k } of $) {
1896
1911
  k.scanned_code === "" && t.push(`Row ${u + 1}: Scanned code is empty`), k.item_name === "" && t.push(`Row ${u + 1}: Item name is empty`), k.uom === "" && t.push(`Row ${u + 1}: UOM is empty`), k["transfer_quantity(uom)"] === "" && t.push(`Row ${u + 1}: Transfer quantity is empty`);
1897
1912
  const a = F.skus.find((_) => _.code === k.scanned_code);
@@ -1909,7 +1924,7 @@ function Oo(g) {
1909
1924
  }
1910
1925
  h = _;
1911
1926
  }
1912
- b.push({
1927
+ y.push({
1913
1928
  sku: a,
1914
1929
  code: k.scanned_code,
1915
1930
  name: k.item_name,
@@ -1919,31 +1934,31 @@ function Oo(g) {
1919
1934
  }
1920
1935
  const e = {
1921
1936
  type: "create",
1922
- poItems: b,
1937
+ poItems: y,
1923
1938
  excelSheetName: x,
1924
1939
  errors: t
1925
1940
  };
1926
- return f.importCreateResult.push(e), f;
1941
+ return p.importCreateResult.push(e), p;
1927
1942
  },
1928
1943
  {
1929
1944
  invalidExcel: !1,
1930
1945
  importCreateResult: new Array()
1931
1946
  }
1932
1947
  );
1933
- } catch (l) {
1948
+ } catch (r) {
1934
1949
  return {
1935
1950
  invalidExcel: !0,
1936
- invalidExcelMessage: (l == null ? void 0 : l.message) ?? "Invalid excel",
1951
+ invalidExcelMessage: (r == null ? void 0 : r.message) ?? "Invalid excel",
1937
1952
  importCreateResult: []
1938
1953
  };
1939
1954
  }
1940
1955
  }
1941
- const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = { class: "flex flex-col" }, No = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, zo = {
1956
+ const Mo = exports.FfCalculator, Uo = { class: "flex flex-col flex-1" }, No = { class: "flex flex-col" }, Bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary flex items-center gap-4" }, zo = {
1942
1957
  key: 0,
1943
1958
  class: "text-fm-color-typo-secondary fm-typo-en-body-sm-400"
1944
- }, Bo = { key: 0 }, Lo = {
1945
- class: /* @__PURE__ */ K(["fm-typo-en-body-lg-600"])
1946
- }, Ho = { class: "flex-1" }, jo = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, Qo = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, Yo = { class: "text-fm-color-typo-primary" }, Ko = { class: "ml-auto" }, Xo = { key: 0 }, Zo = /* @__PURE__ */ ce({
1959
+ }, Lo = { key: 0 }, Ho = {
1960
+ class: /* @__PURE__ */ Z(["fm-typo-en-body-lg-600"])
1961
+ }, jo = { class: "flex-1" }, Qo = { class: "flex-auto line-clamp-2 text-ellipsis break-all fm-typo-en-body-sm-400" }, Yo = { class: "flex-auto line-clamp-2 text-ellipsis break-all" }, Ko = { class: "text-fm-color-typo-primary" }, Xo = { class: "ml-auto" }, Zo = { key: 0 }, Wo = /* @__PURE__ */ ce({
1947
1962
  __name: "XilnexResult",
1948
1963
  props: {
1949
1964
  type: {},
@@ -1952,123 +1967,123 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
1952
1967
  errors: {}
1953
1968
  },
1954
1969
  setup(g) {
1955
- const w = g, { t: l } = he(), f = O(!1), x = () => {
1956
- w.errors.length && (f.value = !f.value);
1970
+ const w = g, { t: r } = he(), p = M(!1), x = () => {
1971
+ w.errors.length && (p.value = !p.value);
1957
1972
  };
1958
1973
  return (t, v) => {
1959
- var b;
1960
- const F = T("FmIcon"), $ = T("FmTooltip");
1961
- return S(), D("div", Mo, [
1974
+ var y;
1975
+ const F = I("FmIcon"), $ = I("FmTooltip");
1976
+ return S(), T("div", Uo, [
1962
1977
  n("div", {
1963
1978
  onClick: x,
1964
- class: K({
1979
+ class: Z({
1965
1980
  "cursor-pointer": t.errors.length
1966
1981
  })
1967
1982
  }, [
1968
- n("div", Uo, [
1969
- n("div", No, [
1983
+ n("div", No, [
1984
+ n("div", Bo, [
1970
1985
  n("div", {
1971
- class: K({
1986
+ class: Z({
1972
1987
  "text-fm-color-system-error-300": t.errors.length
1973
1988
  })
1974
1989
  }, [
1975
- Te(E(t.name) + " ", 1),
1976
- t.type === "create" ? (S(), D("span", zo, "(" + E(s(l)("inventory.closing.template.import.new")) + ")", 1)) : H("", !0)
1990
+ Ie(q(t.name) + " ", 1),
1991
+ t.type === "create" ? (S(), T("span", zo, "(" + q(s(r)("inventory.closing.template.import.new")) + ")", 1)) : j("", !0)
1977
1992
  ], 2),
1978
- t.errors.length ? (S(), D("div", Bo, [
1979
- y(F, {
1993
+ t.errors.length ? (S(), T("div", Lo, [
1994
+ b(F, {
1980
1995
  name: "error",
1981
1996
  size: "sm",
1982
1997
  color: "system-error-300"
1983
1998
  })
1984
- ])) : H("", !0)
1999
+ ])) : j("", !0)
1985
2000
  ]),
1986
2001
  v[0] || (v[0] = n("hr", { class: "my-2" }, null, -1)),
1987
- n("div", Lo, [
1988
- (b = t.items) != null && b.length ? (S(!0), D(de, { key: 0 }, Se(t.items, (e, u) => (S(), D("div", {
2002
+ n("div", Ho, [
2003
+ (y = t.items) != null && y.length ? (S(!0), T(de, { key: 0 }, Se(t.items, (e, u) => (S(), T("div", {
1989
2004
  key: u,
1990
2005
  class: "flex gap-4 mt-2 items-center"
1991
2006
  }, [
1992
- n("div", Ho, [
1993
- y($, {
2007
+ n("div", jo, [
2008
+ b($, {
1994
2009
  content: e.code,
1995
2010
  placement: "top",
1996
2011
  "z-index": 51
1997
2012
  }, {
1998
2013
  default: R(() => [
1999
- n("span", jo, E(e.code), 1)
2014
+ n("span", Qo, q(e.code), 1)
2000
2015
  ]),
2001
2016
  _: 2
2002
2017
  }, 1032, ["content"]),
2003
- y($, {
2018
+ b($, {
2004
2019
  content: e.name,
2005
2020
  placement: "top",
2006
2021
  "z-index": 51
2007
2022
  }, {
2008
2023
  default: R(() => [
2009
- n("span", Qo, E(e.name), 1)
2024
+ n("span", Yo, q(e.name), 1)
2010
2025
  ]),
2011
2026
  _: 2
2012
2027
  }, 1032, ["content"])
2013
2028
  ]),
2014
2029
  n("div", null, [
2015
- n("span", Yo, E(s(qo).toFormatString({
2030
+ n("span", Ko, q(s(Mo).toFormatString({
2016
2031
  value: e.quantity
2017
2032
  })), 1),
2018
- Te(" " + E(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
2033
+ Ie(" " + q(e.measurement ? e.measurement.abbrev : e.sku.unit.abbrev), 1)
2019
2034
  ])
2020
- ]))), 128)) : H("", !0)
2035
+ ]))), 128)) : j("", !0)
2021
2036
  ])
2022
2037
  ]),
2023
- n("div", Ko, [
2024
- t.errors.length ? (S(), W(F, {
2038
+ n("div", Xo, [
2039
+ t.errors.length ? (S(), G(F, {
2025
2040
  key: 0,
2026
- name: f.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
2041
+ name: p.value ? "keyboard_arrow_up" : "keyboard_arrow_down",
2027
2042
  size: "md"
2028
- }, null, 8, ["name"])) : H("", !0)
2043
+ }, null, 8, ["name"])) : j("", !0)
2029
2044
  ])
2030
2045
  ], 2),
2031
- f.value ? (S(), D("div", {
2046
+ p.value ? (S(), T("div", {
2032
2047
  key: 0,
2033
- class: K(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
2048
+ class: Z(["flex flex-col gap-4 pl-8 fm-typo-en-body-sm-400", {
2034
2049
  "text-fm-color-typo-secondary": !t.errors.length,
2035
2050
  "text-fm-color-system-error-300": t.errors.length
2036
2051
  }])
2037
2052
  }, [
2038
- t.errors.length ? (S(), D("div", Xo, [
2053
+ t.errors.length ? (S(), T("div", Zo, [
2039
2054
  n("ol", null, [
2040
- (S(!0), D(de, null, Se(t.errors, (e, u) => (S(), D("li", { key: u }, E(e), 1))), 128))
2055
+ (S(!0), T(de, null, Se(t.errors, (e, u) => (S(), T("li", { key: u }, q(e), 1))), 128))
2041
2056
  ])
2042
- ])) : H("", !0)
2043
- ], 2)) : H("", !0)
2057
+ ])) : j("", !0)
2058
+ ], 2)) : j("", !0)
2044
2059
  ]);
2045
2060
  };
2046
2061
  }
2047
- }), Wo = { class: "flex flex-col gap-24" }, Go = {
2062
+ }), Go = { class: "flex flex-col gap-24" }, Jo = {
2048
2063
  key: 0,
2049
2064
  class: "flex items-center gap-8"
2050
- }, Jo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ea = { class: "flex flex-col gap-8" }, ta = { class: "line-clamp-2 text-ellipsis break-all" }, sa = {
2065
+ }, ea = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ta = { class: "flex flex-col gap-8" }, sa = { class: "line-clamp-2 text-ellipsis break-all" }, oa = {
2051
2066
  key: 2,
2052
2067
  class: "shrink-0"
2053
- }, oa = {
2068
+ }, aa = {
2054
2069
  key: 0,
2055
2070
  class: "flex flex-col"
2056
- }, aa = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, na = {
2071
+ }, na = { class: "text-fm-color-system-error-300 fm-typo-en-body-sm-400" }, la = {
2057
2072
  key: 0,
2058
2073
  class: "max-h-[200px] overflow-y-auto flex flex-col gap-8"
2059
- }, la = { class: "fm-typo-en-body-lg-600" }, vt = "Transfer note", ra = /* @__PURE__ */ ce({
2074
+ }, ra = { class: "fm-typo-en-body-lg-600" }, vt = "Transfer note", ia = /* @__PURE__ */ ce({
2060
2075
  __name: "XilnexImportForm",
2061
2076
  setup(g, { expose: w }) {
2062
- const l = O(null), f = De(), x = O(!1), t = O(!1), v = kt(), F = O(!1), $ = Me();
2063
- O([]);
2064
- const b = U({
2077
+ const r = M(null), p = Te(), x = M(!1), t = M(!1), v = kt(), F = M(!1), $ = Me();
2078
+ M([]);
2079
+ const y = N({
2065
2080
  get() {
2066
- var r;
2067
- return ((r = v.supplier) == null ? void 0 : r.name) ?? "";
2081
+ var l;
2082
+ return ((l = v.supplier) == null ? void 0 : l.name) ?? "";
2068
2083
  },
2069
- set(r) {
2070
- r && (v.supplier = {
2071
- name: r,
2084
+ set(l) {
2085
+ l && (v.supplier = {
2086
+ name: l,
2072
2087
  registrationNumber: "",
2073
2088
  _id: "xilnex",
2074
2089
  internal: "restaurant",
@@ -2084,93 +2099,93 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2084
2099
  }
2085
2100
  });
2086
2101
  Qe(async () => {
2087
- const r = await $.getNetSuiteLocations();
2088
- console.log(r), F.value = !0;
2102
+ const l = await $.getNetSuiteLocations();
2103
+ console.log(l), F.value = !0;
2089
2104
  });
2090
- const e = U({
2105
+ const e = N({
2091
2106
  get() {
2092
2107
  return "";
2093
2108
  },
2094
- set(r) {
2095
- if (r) {
2096
- const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [I, N, j] = r.split("-");
2097
- m.setFullYear(parseInt(I)), m.setMonth(parseInt(N) - 1), m.setDate(parseInt(j)), v.effectiveAt = m.toISOString();
2109
+ set(l) {
2110
+ if (l) {
2111
+ const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [D, B, Q] = l.split("-");
2112
+ m.setFullYear(parseInt(D)), m.setMonth(parseInt(B) - 1), m.setDate(parseInt(Q)), v.effectiveAt = m.toISOString();
2098
2113
  }
2099
2114
  }
2100
- }), u = U({
2115
+ }), u = N({
2101
2116
  get() {
2102
2117
  return null;
2103
2118
  },
2104
- set(r) {
2105
- if (r) {
2106
- const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [I, N] = r.split(":");
2107
- m.setMinutes(parseInt(I)), m.setSeconds(parseInt(N)), v.effectiveAt = m.toISOString();
2119
+ set(l) {
2120
+ if (l) {
2121
+ const m = v.effectiveAt ? new Date(v.effectiveAt) : /* @__PURE__ */ new Date(), [D, B] = l.split(":");
2122
+ m.setMinutes(parseInt(D)), m.setSeconds(parseInt(B)), v.effectiveAt = m.toISOString();
2108
2123
  }
2109
2124
  }
2110
- }), k = O(new Array()), a = O([]), i = U(
2111
- () => !!k.value.length || a.value.some((r) => r.errors.length)
2112
- ), h = O();
2125
+ }), k = M(new Array()), a = M([]), i = N(
2126
+ () => !!k.value.length || a.value.some((l) => l.errors.length)
2127
+ ), h = M();
2113
2128
  w({
2114
2129
  validateInputs: () => {
2115
- var r, m;
2116
- (m = (r = h.value) == null ? void 0 : r.validateInputs) == null || m.call(r);
2130
+ var l, m;
2131
+ (m = (l = h.value) == null ? void 0 : l.validateInputs) == null || m.call(l);
2117
2132
  },
2118
2133
  resetInputsValidation: () => {
2119
- var r, m;
2120
- (m = (r = h.value) == null ? void 0 : r.resetInputsValidation) == null || m.call(r);
2134
+ var l, m;
2135
+ (m = (l = h.value) == null ? void 0 : l.resetInputsValidation) == null || m.call(l);
2121
2136
  },
2122
2137
  resetInputs: () => {
2123
- var r, m;
2124
- (m = (r = h.value) == null ? void 0 : r.resetInputs) == null || m.call(r);
2138
+ var l, m;
2139
+ (m = (l = h.value) == null ? void 0 : l.resetInputs) == null || m.call(l);
2125
2140
  }
2126
2141
  });
2127
2142
  const { t: _ } = he();
2128
- async function C(r) {
2143
+ async function C(l) {
2129
2144
  k.value = [], a.value = [];
2130
2145
  try {
2131
2146
  x.value = !0;
2132
2147
  const [m] = await Promise.all([
2133
- Yt(r),
2148
+ Kt(l),
2134
2149
  // fake buffer
2135
- new Promise((N) => setTimeout(N, 1e3))
2136
- ]), I = Oo(m);
2137
- if (I.invalidExcel) {
2150
+ new Promise((B) => setTimeout(B, 1e3))
2151
+ ]), D = qo(m);
2152
+ if (D.invalidExcel) {
2138
2153
  k.value.push(
2139
- I.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel")
2154
+ D.invalidExcelMessage ?? _("inventory.ingredient.import.fileError.invalidExcel")
2140
2155
  );
2141
2156
  return;
2142
2157
  }
2143
- if (a.value = I.importCreateResult, !a.value.length) {
2158
+ if (a.value = D.importCreateResult, !a.value.length) {
2144
2159
  k.value.push(_("inventory.ingredient.import.fileError.noData"));
2145
2160
  return;
2146
2161
  }
2147
- v.items = a.value.map((N) => N.poItems).flat();
2162
+ v.items = a.value.map((B) => B.poItems).flat();
2148
2163
  } catch (m) {
2149
- f.open({
2164
+ p.open({
2150
2165
  title: _("inventory.ingredient.import.fileError.unableToRead"),
2151
2166
  message: m == null ? void 0 : m.message,
2152
2167
  type: "error"
2153
2168
  }), console.error("Error in reading file", m);
2154
2169
  } finally {
2155
- k.value.length && f.open({
2170
+ k.value.length && p.open({
2156
2171
  title: _("inventory.ingredient.import.fileError.invalidExcel"),
2157
2172
  type: "error"
2158
2173
  }), x.value = !1;
2159
2174
  }
2160
2175
  }
2161
- return _e(l, (r) => {
2162
- r && C(r);
2163
- }), (r, m) => {
2164
- const I = T("FmSelect"), N = T("FmDatePicker"), j = T("FmTimePicker"), Q = T("FmCircularProgress"), Y = T("FmLabel"), A = T("FmIcon"), q = T("FmButton"), P = T("FmForm");
2165
- return S(), W(P, {
2176
+ return _e(r, (l) => {
2177
+ l && C(l);
2178
+ }), (l, m) => {
2179
+ const D = I("FmSelect"), B = I("FmDatePicker"), Q = I("FmTimePicker"), Y = I("FmCircularProgress"), K = I("FmLabel"), E = I("FmIcon"), U = I("FmButton"), P = I("FmForm");
2180
+ return S(), G(P, {
2166
2181
  ref_key: "formRef",
2167
2182
  ref: h
2168
2183
  }, {
2169
2184
  default: R(() => [
2170
- n("div", Wo, [
2171
- y(I, {
2172
- modelValue: b.value,
2173
- "onUpdate:modelValue": m[0] || (m[0] = (d) => b.value = d),
2185
+ n("div", Go, [
2186
+ b(D, {
2187
+ modelValue: y.value,
2188
+ "onUpdate:modelValue": m[0] || (m[0] = (d) => y.value = d),
2174
2189
  label: "Transfer from",
2175
2190
  searchable: "",
2176
2191
  searchTarget: "label",
@@ -2185,50 +2200,50 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2185
2200
  "helper-text": "Helper",
2186
2201
  rules: [s(Oe)()]
2187
2202
  }, null, 8, ["modelValue", "rules"]),
2188
- y(N, {
2203
+ b(B, {
2189
2204
  modelValue: e.value,
2190
2205
  "onUpdate:modelValue": m[1] || (m[1] = (d) => e.value = d),
2191
2206
  label: "Transfer date",
2192
2207
  rules: [s(Oe)()]
2193
2208
  }, null, 8, ["modelValue", "rules"]),
2194
- y(j, {
2209
+ b(Q, {
2195
2210
  modelValue: u.value,
2196
2211
  "onUpdate:modelValue": m[2] || (m[2] = (d) => u.value = d),
2197
2212
  label: "Transfer time",
2198
2213
  rules: [s(Oe)()]
2199
2214
  }, null, 8, ["modelValue", "rules"]),
2200
- t.value ? (S(), D("div", Go, [
2215
+ t.value ? (S(), T("div", Jo, [
2201
2216
  n("div", null, [
2202
- y(Q, {
2217
+ b(Y, {
2203
2218
  size: "md",
2204
2219
  color: "neutral-gray-200"
2205
2220
  })
2206
2221
  ]),
2207
- n("div", Jo, E(s(_)("inventory.formField.loading")), 1)
2208
- ])) : (S(), D(de, { key: 1 }, [
2209
- y(Qt, {
2222
+ n("div", ea, q(s(_)("inventory.formField.loading")), 1)
2223
+ ])) : (S(), T(de, { key: 1 }, [
2224
+ b(Yt, {
2210
2225
  "max-file-size": 5,
2211
- class: K({
2226
+ class: Z({
2212
2227
  "w-full": !0,
2213
- "h-[200px]": !l.value
2228
+ "h-[200px]": !r.value
2214
2229
  }),
2215
2230
  accept: ".xlsx,.xls",
2216
2231
  label: vt,
2217
- onFileUpload: m[3] || (m[3] = (d) => l.value = d),
2232
+ onFileUpload: m[3] || (m[3] = (d) => r.value = d),
2218
2233
  "button-label": s(_)("inventory.ingredient.import.selectFile")
2219
- }, Tt({ _: 2 }, [
2220
- l.value ? {
2234
+ }, It({ _: 2 }, [
2235
+ r.value ? {
2221
2236
  name: "default",
2222
2237
  fn: R(({ openFileDialog: d }) => [
2223
- y(Y, null, {
2238
+ b(K, null, {
2224
2239
  default: R(() => [
2225
- Te(E(vt))
2240
+ Ie(q(vt))
2226
2241
  ]),
2227
2242
  _: 1
2228
2243
  }),
2229
- n("div", ea, [
2244
+ n("div", ta, [
2230
2245
  n("div", {
2231
- class: K([
2246
+ class: Z([
2232
2247
  "fm-corner-radius-md p-16 flex items-center gap-16",
2233
2248
  {
2234
2249
  "border border-fm-color-neutral-gray-100": x.value,
@@ -2237,18 +2252,18 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2237
2252
  }
2238
2253
  ])
2239
2254
  }, [
2240
- x.value ? (S(), W(Q, {
2255
+ x.value ? (S(), G(Y, {
2241
2256
  key: 0,
2242
2257
  size: "md",
2243
2258
  color: "neutral-gray-200"
2244
- })) : (S(), W(A, {
2259
+ })) : (S(), G(E, {
2245
2260
  key: 1,
2246
2261
  name: i.value ? "error" : "attach_file",
2247
2262
  outline: "",
2248
2263
  color: i.value ? "system-error-300" : void 0
2249
2264
  }, null, 8, ["name", "color"])),
2250
2265
  n("div", {
2251
- class: K([
2266
+ class: Z([
2252
2267
  "fm-typo-en-body-md-400 flex-1 h-[36px] flex items-center",
2253
2268
  {
2254
2269
  "text-fm-color-typo-disabled": x.value,
@@ -2256,10 +2271,10 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2256
2271
  }
2257
2272
  ])
2258
2273
  }, [
2259
- n("div", ta, E(l.value.name), 1)
2274
+ n("div", sa, q(r.value.name), 1)
2260
2275
  ], 2),
2261
- x.value ? H("", !0) : (S(), D("div", sa, [
2262
- y(q, {
2276
+ x.value ? j("", !0) : (S(), T("div", oa, [
2277
+ b(U, {
2263
2278
  label: s(_)("inventory.ingredient.import.replaceFile"),
2264
2279
  variant: i.value ? "destructive" : "secondary",
2265
2280
  "prepend-icon": i.value ? void 0 : "autorenew",
@@ -2267,34 +2282,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2267
2282
  }, null, 8, ["label", "variant", "prepend-icon", "onClick"])
2268
2283
  ]))
2269
2284
  ], 2),
2270
- k.value.length ? (S(), D("div", oa, [
2271
- (S(!0), D(de, null, Se(k.value, (c, z) => (S(), D("div", {
2272
- key: z,
2285
+ k.value.length ? (S(), T("div", aa, [
2286
+ (S(!0), T(de, null, Se(k.value, (c, O) => (S(), T("div", {
2287
+ key: O,
2273
2288
  class: "flex gap-8 items-center"
2274
2289
  }, [
2275
- y(A, {
2290
+ b(E, {
2276
2291
  name: "error",
2277
2292
  size: "sm",
2278
2293
  color: "system-error-300"
2279
2294
  }),
2280
- n("div", aa, E(c), 1)
2295
+ n("div", na, q(c), 1)
2281
2296
  ]))), 128))
2282
- ])) : H("", !0)
2297
+ ])) : j("", !0)
2283
2298
  ])
2284
2299
  ]),
2285
2300
  key: "0"
2286
2301
  } : void 0
2287
2302
  ]), 1032, ["class", "button-label"]),
2288
- l.value ? (S(), D("div", na, [
2289
- n("div", la, E(s(_)("inventory.ingredient.import.summary")), 1),
2290
- (S(!0), D(de, null, Se(a.value, (d, c) => (S(), W(Zo, {
2303
+ r.value ? (S(), T("div", la, [
2304
+ n("div", ra, q(s(_)("inventory.ingredient.import.summary")), 1),
2305
+ (S(!0), T(de, null, Se(a.value, (d, c) => (S(), G(Wo, {
2291
2306
  key: c,
2292
2307
  name: `Transfer Note ${c + 1}`,
2293
2308
  items: d.poItems,
2294
2309
  errors: d.errors,
2295
2310
  type: "create"
2296
2311
  }, null, 8, ["name", "items", "errors"]))), 128))
2297
- ])) : H("", !0)
2312
+ ])) : j("", !0)
2298
2313
  ], 64))
2299
2314
  ])
2300
2315
  ]),
@@ -2302,34 +2317,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2302
2317
  }, 512);
2303
2318
  };
2304
2319
  }
2305
- }), ia = { class: "w-[480px]" }, ua = /* @__PURE__ */ ce({
2320
+ }), ua = { class: "w-[480px]" }, da = /* @__PURE__ */ ce({
2306
2321
  __name: "XilnexImportDialog",
2307
2322
  props: {
2308
2323
  show: { type: Boolean }
2309
2324
  },
2310
2325
  emits: ["update:show", "submitted"],
2311
- setup(g, { expose: w, emit: l }) {
2312
- const f = l, t = St(g, "show"), v = De(), F = tt(), $ = O(!1), b = O(), e = O();
2326
+ setup(g, { expose: w, emit: r }) {
2327
+ const p = r, t = St(g, "show"), v = Te(), F = tt(), $ = M(!1), y = M(), e = M();
2313
2328
  w({
2314
2329
  validateInputs: () => {
2315
2330
  var a, i;
2316
- (i = (a = b.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
2331
+ (i = (a = y.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
2317
2332
  },
2318
2333
  resetInputsValidation: () => {
2319
2334
  var a, i;
2320
- (i = (a = b.value) == null ? void 0 : a.resetInputsValidation) == null || i.call(a);
2335
+ (i = (a = y.value) == null ? void 0 : a.resetInputsValidation) == null || i.call(a);
2321
2336
  },
2322
2337
  resetInputs: () => {
2323
2338
  var a, i;
2324
- (i = (a = b.value) == null ? void 0 : a.resetInputs) == null || i.call(a);
2339
+ (i = (a = y.value) == null ? void 0 : a.resetInputs) == null || i.call(a);
2325
2340
  }
2326
2341
  });
2327
2342
  function u() {
2328
2343
  var a, i;
2329
- (i = (a = b.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
2344
+ (i = (a = y.value) == null ? void 0 : a.validateInputs) == null || i.call(a);
2330
2345
  }
2331
2346
  async function k() {
2332
- var i, h, _, C, r;
2347
+ var i, h, _, C, l;
2333
2348
  if (!((h = (i = e.value) == null ? void 0 : i.supplier) != null && h.name)) {
2334
2349
  v.open({
2335
2350
  title: "Upload failed",
@@ -2338,7 +2353,7 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2338
2353
  });
2339
2354
  return;
2340
2355
  }
2341
- if (!((_ = e.value) != null && _.items) || ((r = (C = e.value) == null ? void 0 : C.items) == null ? void 0 : r.length) === 0) {
2356
+ if (!((_ = e.value) != null && _.items) || ((l = (C = e.value) == null ? void 0 : C.items) == null ? void 0 : l.length) === 0) {
2342
2357
  v.open({
2343
2358
  title: "Upload failed",
2344
2359
  message: "No data to upload",
@@ -2365,9 +2380,9 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2365
2380
  }
2366
2381
  $.value = !0;
2367
2382
  try {
2368
- await F.importFromXilnex(e.value), f("update:show", !1);
2383
+ await F.importFromXilnex(e.value), p("update:show", !1);
2369
2384
  } catch (m) {
2370
- await new Promise((I) => setTimeout(I, 1e3)), v.open({
2385
+ await new Promise((D) => setTimeout(D, 1e3)), v.open({
2371
2386
  title: "Upload failed",
2372
2387
  message: m == null ? void 0 : m.message,
2373
2388
  type: "error"
@@ -2377,10 +2392,10 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2377
2392
  }
2378
2393
  }
2379
2394
  return (a, i) => {
2380
- const h = T("FmSpacer"), _ = T("FmButton"), C = T("FmDialog");
2381
- return S(), W(C, {
2395
+ const h = I("FmSpacer"), _ = I("FmButton"), C = I("FmDialog");
2396
+ return S(), G(C, {
2382
2397
  modelValue: s(t),
2383
- "onUpdate:modelValue": i[2] || (i[2] = (r) => xe(t) ? t.value = r : null),
2398
+ "onUpdate:modelValue": i[2] || (i[2] = (l) => xe(t) ? t.value = l : null),
2384
2399
  overlay: !0,
2385
2400
  "close-button": !1
2386
2401
  }, {
@@ -2388,16 +2403,16 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2388
2403
  n("div", null, "Xilnex transfer order", -1)
2389
2404
  ])),
2390
2405
  "dialog-footer": R(() => [
2391
- y(h, { class: "sm:hidden xs:hidden" }),
2392
- y(_, {
2406
+ b(h, { class: "sm:hidden xs:hidden" }),
2407
+ b(_, {
2393
2408
  disabled: $.value,
2394
2409
  class: "sm:w-full xs:w-full",
2395
2410
  label: "Cancel",
2396
2411
  size: "md",
2397
2412
  variant: "tertiary",
2398
- onClick: i[1] || (i[1] = (r) => f("update:show", !1))
2413
+ onClick: i[1] || (i[1] = (l) => p("update:show", !1))
2399
2414
  }, null, 8, ["disabled"]),
2400
- y(_, {
2415
+ b(_, {
2401
2416
  disabled: $.value,
2402
2417
  loading: $.value,
2403
2418
  class: "sm:w-full xs:w-full",
@@ -2408,13 +2423,13 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2408
2423
  }, null, 8, ["disabled", "loading"])
2409
2424
  ]),
2410
2425
  default: R(() => [
2411
- n("div", ia, [
2412
- y(ra, {
2426
+ n("div", ua, [
2427
+ b(ia, {
2413
2428
  ref_key: "formRef",
2414
- ref: b,
2429
+ ref: y,
2415
2430
  onValidationSuccess: k,
2416
2431
  modelValue: e.value,
2417
- "onUpdate:modelValue": i[0] || (i[0] = (r) => e.value = r)
2432
+ "onUpdate:modelValue": i[0] || (i[0] = (l) => e.value = l)
2418
2433
  }, null, 8, ["modelValue"])
2419
2434
  ])
2420
2435
  ]),
@@ -2422,60 +2437,60 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2422
2437
  }, 8, ["modelValue"]);
2423
2438
  };
2424
2439
  }
2425
- }), da = { class: "flex flex-col py-8" }, ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ma = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, fa = {
2440
+ }), ca = { class: "flex flex-col py-8" }, ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, pa = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1" }, va = {
2426
2441
  key: 0,
2427
2442
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary line-clamp-1"
2428
- }, va = { class: "pt-8" }, yt = "ReceiveRequestViewSearchCriteria", Va = /* @__PURE__ */ ce({
2443
+ }, ya = { class: "pt-8" }, yt = "ReceiveRequestViewSearchCriteria", Pa = /* @__PURE__ */ ce({
2429
2444
  __name: "ReceiveRequestView",
2430
2445
  setup(g) {
2431
- const { t: w } = he(), l = De();
2446
+ const { t: w } = he(), r = Te();
2432
2447
  He.object({
2433
2448
  name: He.string().optional().nullable(),
2434
2449
  startDate: He.string().optional().nullable(),
2435
2450
  endDate: He.string().optional().nullable()
2436
2451
  });
2437
- const f = U(
2452
+ const p = N(
2438
2453
  () => !k._currentLocation || e.loading.value
2439
- ), x = ls(), t = We(), v = Me();
2454
+ ), x = rs(), t = We(), v = Me();
2440
2455
  function F() {
2441
- const A = {
2456
+ const E = {
2442
2457
  name: "",
2443
2458
  ...pt()
2444
- }, q = x.getItem(yt);
2445
- if (!q)
2446
- return A;
2459
+ }, U = x.getItem(yt);
2460
+ if (!U)
2461
+ return E;
2447
2462
  try {
2448
- return JSON.parse(q);
2463
+ return JSON.parse(U);
2449
2464
  } catch {
2450
- return A;
2465
+ return E;
2451
2466
  }
2452
2467
  }
2453
2468
  function $() {
2454
- x.setItem(yt, JSON.stringify(b.value));
2469
+ x.setItem(yt, JSON.stringify(y.value));
2455
2470
  }
2456
- const b = O(F()), e = Jt(
2471
+ const y = M(F()), e = es(
2457
2472
  Xe.RECEIVE_REQUEST,
2458
- b.value
2459
- ), { columnDefs: u } = es(
2473
+ y.value
2474
+ ), { columnDefs: u } = ts(
2460
2475
  Xe.RECEIVE_REQUEST,
2461
2476
  e
2462
2477
  ), k = Je();
2463
2478
  async function a() {
2464
- const A = `inventory-record_${ft(b.value.startDate).format("DD-MM-YYYY_HH-mm")}-${ft(b.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, q = e.purchaseOrders.value.flatMap(
2479
+ const E = `inventory-record_${ft(y.value.startDate).format("DD-MM-YYYY_HH-mm")}-${ft(y.value.endDate).format("DD-MM-YYYY_HH-mm")}.xlsx`, U = e.purchaseOrders.value.flatMap(
2465
2480
  (d) => d.items.map((c) => {
2466
2481
  var me;
2467
- const z = new Date(as(d._id) ?? ""), ne = d.effectiveAt ? new Date(d.effectiveAt) : void 0, Z = Ce(
2468
- ss(c.sku, d.deliveryOrder || [])
2482
+ const O = new Date(ns(d._id) ?? ""), ee = d.effectiveAt ? new Date(d.effectiveAt) : void 0, X = Ce(
2483
+ os(c.sku, d.deliveryOrder || [])
2469
2484
  ), ke = Ce(c.quantity), ve = ((me = c == null ? void 0 : c.measurement) == null ? void 0 : me.abbrev) || c.sku.unit.abbrev;
2470
2485
  return {
2471
2486
  "SKU code": c.code,
2472
2487
  "SKU name": c.name,
2473
2488
  "PO #": d.seqNumber,
2474
- "Effective at": ne,
2475
- Date: z,
2489
+ "Effective at": ee,
2490
+ Date: O,
2476
2491
  Status: d.status,
2477
2492
  Reference: d.ref ?? "",
2478
- "Received quantity": Z,
2493
+ "Received quantity": X,
2479
2494
  "Ordered quantity": ke,
2480
2495
  Unit: ve,
2481
2496
  "Total cost": c.totalCost ? je(c.totalCost) : null
@@ -2492,34 +2507,34 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2492
2507
  "Ordered quantity",
2493
2508
  "Unit"
2494
2509
  ];
2495
- t.enableBackdatePo && P.insert("Effective at", 4), t.enableTotalCost && P.push("Total cost"), await ns(
2510
+ t.enableBackdatePo && P.insert("Effective at", 4), t.enableTotalCost && P.push("Total cost"), await ls(
2496
2511
  [
2497
2512
  {
2498
2513
  name: "purchases",
2499
- data: q,
2514
+ data: U,
2500
2515
  columns: P
2501
2516
  }
2502
2517
  ],
2503
- A
2504
- ), l.open({
2518
+ E
2519
+ ), r.open({
2505
2520
  title: w("inventory.transfer.receiveRequest.export.success"),
2506
- message: w("inventory.transfer.receiveRequest.export.message", [A]),
2521
+ message: w("inventory.transfer.receiveRequest.export.message", [E]),
2507
2522
  type: "success"
2508
2523
  });
2509
2524
  }
2510
- const i = O(pt()), h = O("");
2511
- _e([() => i.value], ([A]) => {
2512
- !A.startDate || !A.endDate || (b.value.startDate = A.startDate, b.value.endDate = A.endDate, e.updateDateRange(
2513
- b.value.startDate,
2514
- b.value.endDate
2525
+ const i = M(pt()), h = M("");
2526
+ _e([() => i.value], ([E]) => {
2527
+ !E.startDate || !E.endDate || (y.value.startDate = E.startDate, y.value.endDate = E.endDate, e.updateDateRange(
2528
+ y.value.startDate,
2529
+ y.value.endDate
2515
2530
  ), $());
2516
2531
  }), _e([() => h.value], () => {
2517
2532
  $();
2518
2533
  });
2519
- function _(A) {
2520
- if (A === "create") {
2521
- if (f.value) {
2522
- l.open({
2534
+ function _(E) {
2535
+ if (E === "create") {
2536
+ if (p.value) {
2537
+ r.open({
2523
2538
  title: "Loading data...",
2524
2539
  message: "Please wait.",
2525
2540
  type: "info"
@@ -2528,14 +2543,14 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2528
2543
  }
2529
2544
  return e.promptCreateTransferDialog();
2530
2545
  }
2531
- if (A === "upload" && t.enableXilnexTransferNote)
2546
+ if (E === "upload" && t.enableXilnexTransferNote)
2532
2547
  return e.promptUploadTransferDialog();
2533
- if (A === "refresh")
2548
+ if (E === "refresh")
2534
2549
  return e.fetchData();
2535
- if (A === "export")
2550
+ if (E === "export")
2536
2551
  return a();
2537
2552
  }
2538
- const { breakpoints: C } = st(), r = U(() => C.value.xs || C.value.sm), m = U(() => r.value ? 10 : 20), I = Kt(), N = U(() => [
2553
+ const { breakpoints: C } = st(), l = N(() => C.value.xs || C.value.sm), m = N(() => l.value ? 10 : 20), D = Xt(), B = N(() => [
2539
2554
  {
2540
2555
  label: w("inventory.transfer.receiveRequest.actions.create"),
2541
2556
  value: "create",
@@ -2556,8 +2571,8 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2556
2571
  label: w("inventory.common.export"),
2557
2572
  value: "export"
2558
2573
  }
2559
- ]), j = U(() => {
2560
- const A = [
2574
+ ]), Q = N(() => {
2575
+ const E = [
2561
2576
  {
2562
2577
  type: "string",
2563
2578
  key: "status",
@@ -2566,7 +2581,7 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2566
2581
  new Set(e.purchaseOrders.value.map((P) => P.status))
2567
2582
  )
2568
2583
  }
2569
- ], q = [
2584
+ ], U = [
2570
2585
  {
2571
2586
  type: "string",
2572
2587
  key: "netsuiteTransactionNumber",
@@ -2595,98 +2610,98 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2595
2610
  }).filter((P) => P != null)
2596
2611
  }
2597
2612
  ];
2598
- return [...A, ...v.isEnabled ? q : []];
2599
- }), Q = O(null), Y = U(() => {
2600
- if (!Q.value)
2613
+ return [...E, ...v.isEnabled ? U : []];
2614
+ }), Y = M(null), K = N(() => {
2615
+ if (!Y.value)
2601
2616
  return e.purchaseOrders.value;
2602
- const A = Xt.build(Q.value);
2603
- return e.purchaseOrders.value.filter((q) => {
2604
- var P, d, c, z;
2605
- return Zt(
2617
+ const E = Zt.build(Y.value);
2618
+ return e.purchaseOrders.value.filter((U) => {
2619
+ var P, d, c, O;
2620
+ return Wt(
2606
2621
  {
2607
- netsuiteTransactionNumber: (d = (P = q.netSuite) == null ? void 0 : P.additionalInfo) == null ? void 0 : d.transactionnumber,
2608
- netsuiteOrderNo: (c = q.netSuite) == null ? void 0 : c.refNo,
2609
- netsuiteOrderId: (z = q.netSuite) == null ? void 0 : z.id,
2610
- status: q.status
2622
+ netsuiteTransactionNumber: (d = (P = U.netSuite) == null ? void 0 : P.additionalInfo) == null ? void 0 : d.transactionnumber,
2623
+ netsuiteOrderNo: (c = U.netSuite) == null ? void 0 : c.refNo,
2624
+ netsuiteOrderId: (O = U.netSuite) == null ? void 0 : O.id,
2625
+ status: U.status
2611
2626
  },
2612
- A
2627
+ E
2613
2628
  );
2614
2629
  });
2615
2630
  });
2616
- return (A, q) => {
2617
- const P = T("FmTable");
2618
- return S(), W(Wt, {
2631
+ return (E, U) => {
2632
+ const P = I("FmTable");
2633
+ return S(), G(Gt, {
2619
2634
  title: s(w)("inventory.transfer.receiveRequest.title2"),
2620
- actions: N.value,
2635
+ actions: B.value,
2621
2636
  "onClick:action": _
2622
2637
  }, {
2623
2638
  default: R(() => {
2624
2639
  var d;
2625
2640
  return [
2626
2641
  n("div", {
2627
- class: K([
2642
+ class: Z([
2628
2643
  "flex flex-col gap-8 max-h-full",
2629
2644
  {
2630
- "p-0": r.value,
2631
- "px-24 ": !r.value
2645
+ "p-0": l.value,
2646
+ "px-24 ": !l.value
2632
2647
  }
2633
2648
  ])
2634
2649
  }, [
2635
- y(Gt, {
2650
+ b(Jt, {
2636
2651
  "date-range-query": "",
2637
2652
  "date-range": i.value,
2638
- "onUpdate:dateRange": q[0] || (q[0] = (c) => i.value = c),
2653
+ "onUpdate:dateRange": U[0] || (U[0] = (c) => i.value = c),
2639
2654
  searchable: "",
2640
2655
  "change-location": "",
2641
2656
  search: h.value,
2642
- "onUpdate:search": q[1] || (q[1] = (c) => h.value = c),
2657
+ "onUpdate:search": U[1] || (U[1] = (c) => h.value = c),
2643
2658
  filterable: "",
2644
- "filter-attributes": j.value,
2645
- filter: Q.value,
2646
- "onUpdate:filter": q[2] || (q[2] = (c) => Q.value = c)
2659
+ "filter-attributes": Q.value,
2660
+ filter: Y.value,
2661
+ "onUpdate:filter": U[2] || (U[2] = (c) => Y.value = c)
2647
2662
  }, null, 8, ["date-range", "search", "filter-attributes", "filter"]),
2648
- (S(), W(P, {
2649
- style: gt(s(I).tableHeight),
2663
+ (S(), G(P, {
2664
+ style: gt(s(D).tableHeight),
2650
2665
  "column-defs": s(u),
2651
- "row-data": Y.value,
2666
+ "row-data": K.value,
2652
2667
  "search-value": h.value,
2653
- loading: f.value,
2654
- onRowClick: q[3] || (q[3] = (c) => s(e).promptShowTransferDetails(c.original)),
2668
+ loading: p.value,
2669
+ onRowClick: U[3] || (U[3] = (c) => s(e).promptShowTransferDetails(c.original)),
2655
2670
  key: (d = s(k)._currentLocation) == null ? void 0 : d.dbName,
2656
2671
  "page-size": m.value
2657
2672
  }, {
2658
2673
  "list-row": R((c) => [
2659
- y(xt, {
2674
+ b(xt, {
2660
2675
  row: c,
2661
2676
  onRowClick: s(e).promptShowTransferDetails
2662
2677
  }, {
2663
- default: R((z) => {
2664
- var ne, Z, ke, ve, me, we, Ue, Ne, Fe, Ye, ze, Ie, Ve, o, p, M, G, le, re, X;
2678
+ default: R((O) => {
2679
+ var ee, X, ke, ve, me, we, Ue, Ne, Fe, Ye, Be, De, Ve, o, f, A, H, le, re, W;
2665
2680
  return [
2666
- n("div", da, [
2667
- n("div", ca, [
2668
- y(s(fe), {
2669
- render: (ke = (Z = (ne = z._id) == null ? void 0 : ne.column) == null ? void 0 : Z.columnDef) == null ? void 0 : ke.cell,
2670
- props: (me = (ve = z._id) == null ? void 0 : ve.getContext) == null ? void 0 : me.call(ve)
2681
+ n("div", ca, [
2682
+ n("div", ma, [
2683
+ b(s(fe), {
2684
+ render: (ke = (X = (ee = O._id) == null ? void 0 : ee.column) == null ? void 0 : X.columnDef) == null ? void 0 : ke.cell,
2685
+ props: (me = (ve = O._id) == null ? void 0 : ve.getContext) == null ? void 0 : me.call(ve)
2671
2686
  }, null, 8, ["render", "props"])
2672
2687
  ]),
2673
- n("div", ma, [
2674
- y(s(fe), {
2675
- render: (Ne = (Ue = (we = z.supplier_name) == null ? void 0 : we.column) == null ? void 0 : Ue.columnDef) == null ? void 0 : Ne.cell,
2676
- props: (Ye = (Fe = z.supplier_name) == null ? void 0 : Fe.getContext) == null ? void 0 : Ye.call(Fe)
2688
+ n("div", pa, [
2689
+ b(s(fe), {
2690
+ render: (Ne = (Ue = (we = O.supplier_name) == null ? void 0 : we.column) == null ? void 0 : Ue.columnDef) == null ? void 0 : Ne.cell,
2691
+ props: (Ye = (Fe = O.supplier_name) == null ? void 0 : Fe.getContext) == null ? void 0 : Ye.call(Fe)
2677
2692
  }, null, 8, ["render", "props"])
2678
2693
  ]),
2679
- n("div", pa, E(c.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
2680
- c.original.ref ? (S(), D("div", fa, [
2681
- y(s(fe), {
2682
- render: (Ve = (Ie = (ze = z.ref) == null ? void 0 : ze.column) == null ? void 0 : Ie.columnDef) == null ? void 0 : Ve.cell,
2683
- props: (p = (o = z.ref) == null ? void 0 : o.getContext) == null ? void 0 : p.call(o)
2694
+ n("div", fa, q(c.original.items.map((ie) => `${ie.name}`).join(", ")), 1),
2695
+ c.original.ref ? (S(), T("div", va, [
2696
+ b(s(fe), {
2697
+ render: (Ve = (De = (Be = O.ref) == null ? void 0 : Be.column) == null ? void 0 : De.columnDef) == null ? void 0 : Ve.cell,
2698
+ props: (f = (o = O.ref) == null ? void 0 : o.getContext) == null ? void 0 : f.call(o)
2684
2699
  }, null, 8, ["render", "props"])
2685
- ])) : H("", !0),
2686
- n("div", va, [
2687
- y(s(fe), {
2688
- render: (le = (G = (M = z.status) == null ? void 0 : M.column) == null ? void 0 : G.columnDef) == null ? void 0 : le.cell,
2689
- props: (X = (re = z.status) == null ? void 0 : re.getContext) == null ? void 0 : X.call(re)
2700
+ ])) : j("", !0),
2701
+ n("div", ya, [
2702
+ b(s(fe), {
2703
+ render: (le = (H = (A = O.status) == null ? void 0 : A.column) == null ? void 0 : H.columnDef) == null ? void 0 : le.cell,
2704
+ props: (W = (re = O.status) == null ? void 0 : re.getContext) == null ? void 0 : W.call(re)
2690
2705
  }, null, 8, ["render", "props"])
2691
2706
  ])
2692
2707
  ])
@@ -2698,16 +2713,16 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2698
2713
  _: 1
2699
2714
  }, 8, ["style", "column-defs", "row-data", "search-value", "loading", "page-size"]))
2700
2715
  ], 2),
2701
- (S(), W(Dt, { to: "body" }, [
2702
- y(Ao, Ze(s(e).transferDialogProps.value, {
2716
+ (S(), G(Tt, { to: "body" }, [
2717
+ b(Eo, Ze(s(e).transferDialogProps.value, {
2703
2718
  onSubmitted: s(e).fetchData
2704
2719
  }), null, 16, ["onSubmitted"]),
2705
- y(ts, Ze({
2720
+ b(ss, Ze({
2706
2721
  scope: s(Xe).RECEIVE_REQUEST
2707
2722
  }, s(e).transferDetailsProps.value, {
2708
2723
  onSubmitted: s(e).fetchData
2709
2724
  }), null, 16, ["scope", "onSubmitted"]),
2710
- y(ua, It(Vt(s(e).xilnexImportDialogProps.value)), null, 16)
2725
+ b(da, Dt(Vt(s(e).xilnexImportDialogProps.value)), null, 16)
2711
2726
  ]))
2712
2727
  ];
2713
2728
  }),
@@ -2717,5 +2732,5 @@ const qo = exports.FfCalculator, Mo = { class: "flex flex-col flex-1" }, Uo = {
2717
2732
  }
2718
2733
  });
2719
2734
  export {
2720
- Va as default
2735
+ Pa as default
2721
2736
  };