@feedmepos/mf-inventory-portal 1.0.38 → 1.0.39

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-Bh_jIWxm.js → App-Bt0e2n-m.js} +1 -1
  2. package/dist/{ApprovalView-U-Jo7wyv.js → ApprovalView-BYd63yvj.js} +19 -19
  3. package/dist/{BindingsDialog-CC0wt6a_.js → BindingsDialog-9D6UOcDp.js} +4 -4
  4. package/dist/{BindingsPicker-WL_1lOdc.js → BindingsPicker--Vm4weI3.js} +1 -1
  5. package/dist/{BindingsTable-DJf1WJou.js → BindingsTable-DGHN8lRO.js} +4 -4
  6. package/dist/{ClosingDraftView-BI19VIT_.js → ClosingDraftView-CH8j-LTL.js} +26 -26
  7. package/dist/ClosingTemplateView-IKON-MRo.js +1849 -0
  8. package/dist/{DeliveryOrderPrintPreview-LANZdQE7.js → DeliveryOrderPrintPreview-Ck-nrZ3U.js} +4 -4
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bhz1nVO6.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Csnq6SpA.js} +11 -11
  10. package/dist/{FmMultiselectDialog-B16LNSaK.js → FmMultiselectDialog-x_pPeeUw.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-pAmapm7v.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B88hbpoh.js} +21 -21
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-D7wM9EQ2.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DMs8hdak.js} +1 -1
  13. package/dist/{IngredientGroupView-Bi8657CZ.js → IngredientGroupView-D1qKwLux.js} +2 -2
  14. package/dist/IngredientsView-BeBN6cke.js +1858 -0
  15. package/dist/{IntegrationView-mYS_UJlk.js → IntegrationView-By8g31e5.js} +77 -76
  16. package/dist/{InventoryBindingForm-D-Y-IDFl.js → InventoryBindingForm-CU0pvHRP.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-ByFJ6s6U.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-NxZjLjCh.js} +24 -24
  18. package/dist/{InventoryBindingSummary-z6XljZ_R.js → InventoryBindingSummary-B_y6WR3o.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-ihrVnPMe.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CPGZh3TN.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-DhoXg0vX.js → PremiumBadge.vue_vue_type_script_setup_true_lang-g2XDRfkl.js} +10 -10
  21. package/dist/{PublishView-DB7j7FkK.js → PublishView-B_c-fWDu.js} +17 -17
  22. package/dist/{PurchaseOrderPrintPreview-CTQIzDKp.js → PurchaseOrderPrintPreview-BCRL75HR.js} +12 -12
  23. package/dist/{ReceiveRequestView-B2UDO9o9.js → ReceiveRequestView-BrwJpnEe.js} +797 -782
  24. package/dist/{RecipeView-BIDDh0V9.js → RecipeView-Cn6NY1IO.js} +3 -3
  25. package/dist/{StockView-BgzAJBdL.js → StockView-DEx5DPM9.js} +6 -6
  26. package/dist/{SupplierView-zS3HDy59.js → SupplierView-BFNNKC01.js} +3 -3
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-DhnPjxXG.js → TransferDetails.vue_vue_type_script_setup_true_lang-UN-fDAMb.js} +634 -632
  28. package/dist/{TransferTemplateView-DLS9QAGY.js → TransferTemplateView-CS8mbtcf.js} +83 -83
  29. package/dist/{UnitView-B8mfgqXO.js → UnitView-UKnui3HV.js} +3 -3
  30. package/dist/{WarehouseView-D4yYBRSM.js → WarehouseView-K4AyxptS.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-BLo-E2P1.js → app-DqUjChxa.js} +52853 -52344
  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-u4mLA_2Z.js → decimal-LA_Bg4TZ.js} +1 -1
  41. package/dist/format-unit-display-Btqn8Vdi.js +1275 -0
  42. package/dist/{index-BbBtmjWx.js → index-DlXAEnHf.js} +1 -1
  43. package/dist/{index-Bu2R1xRv.js → index-iifMSNu9.js} +1 -1
  44. package/dist/{stock-BxIuAFed.js → stock-CuKsIhl3.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-CQftkZPG.js → supplier-C4vIJUP1.js} +1 -1
  48. package/dist/tsconfig.app.tsbuildinfo +1 -1
  49. package/dist/{use-ingredient-select-dialog-C9I7bja9.js → use-ingredient-select-dialog-Rax2O0HM.js} +1 -1
  50. package/dist/{use-inventory-binding-dialog-s8nyBhfo.js → use-inventory-binding-dialog-DdggFLK-.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-C3CYm8Dg.js → vue-i18n-CkkKCDtp.js} +475 -475
  77. package/package.json +1 -1
  78. package/dist/ClosingTemplateView-B6p83fs1.js +0 -1804
  79. package/dist/IngredientsView-CGEQ-GvW.js +0 -1838
  80. package/dist/format-unit-display-g_Tq_sk7.js +0 -1230
@@ -1,70 +1,70 @@
1
- import { a3 as lt, u as de, aN as O, c as De, b as qe, a8 as ct, aa as ut, ab as dt, aO as mt, e as Ye, f as et, a0 as Ve, aP as ft, a5 as Le, T as ke, j as ie, aQ as pt, aR as tt, af as xe, h as Qe, i as J, D as re, aw as ue, aS as rt, aT as st, aU as Pe, a9 as yt, au as Xe, a7 as Oe, ak as Ie, ax as vt } from "./app-BLo-E2P1.js";
2
- import { ref as M, computed as Z, h as A, defineComponent as pe, reactive as ht, onMounted as nt, resolveComponent as K, openBlock as b, createBlock as ae, withCtx as se, createElementVNode as n, createVNode as I, unref as h, createElementBlock as N, toDisplayString as k, createCommentVNode as V, Fragment as te, renderList as me, watch as bt, isRef as gt, normalizeClass as Ne, createTextVNode as Fe, resolveDynamicComponent as _t } from "vue";
3
- import { F as St } from "./decimal-u4mLA_2Z.js";
1
+ import { a3 as lt, u as de, aP as O, c as De, b as qe, a8 as ct, aa as ut, ab as dt, aQ as mt, e as Ye, f as et, a0 as Ve, aR as ft, a5 as Le, T as ke, j as ie, aS as pt, aT as tt, af as xe, h as Qe, i as Z, D as re, ax as ue, aU as rt, aV as st, aW as Pe, a9 as yt, av as Xe, a7 as Oe, al as Ie, ay as vt } from "./app-DqUjChxa.js";
2
+ import { ref as M, computed as Q, h as A, defineComponent as pe, reactive as ht, onMounted as nt, resolveComponent as z, openBlock as h, createBlock as ae, withCtx as se, createElementVNode as a, createVNode as I, unref as v, createElementBlock as N, toDisplayString as k, createCommentVNode as V, Fragment as te, renderList as me, watch as bt, isRef as gt, normalizeClass as Ne, createTextVNode as Fe, resolveDynamicComponent as _t } from "vue";
3
+ import { F as St } from "./decimal-LA_Bg4TZ.js";
4
4
  import { useCoreStore as Ae, useI18n as at } from "@feedmepos/mf-common";
5
- import { b as wt, u as Rt, P as fe, f as Ot } from "./format-unit-display-g_Tq_sk7.js";
5
+ import { b as wt, u as Rt, P as fe, f as Ot } from "./format-unit-display-Btqn8Vdi.js";
6
6
  import { E as Nt } from "./empty-placeholder-wf6-BWE8.js";
7
7
  import { useDialog as Me, useSnackbar as Te, components as Je, FmButtonVariant as ee, useProxiedModel as kt } from "@feedmepos/ui-library";
8
- import { _ as xt, F as Dt, a as qt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-pAmapm7v.js";
8
+ import { _ as xt, F as Dt, a as qt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B88hbpoh.js";
9
9
  import { u as At, R as Ze } from "./usePromise-CbVUCxhj.js";
10
- import { u as Tt } from "./index-Bu2R1xRv.js";
10
+ import { u as Tt } from "./index-iifMSNu9.js";
11
11
  const $e = lt((S, e) => {
12
- const i = de(), _ = Ae();
12
+ const i = de(), g = Ae();
13
13
  return {
14
- async readRequests(d, t, l) {
15
- const a = d ?? i.currentLocationDBName, s = `${S.inventoryBackendUrl}/${a}/purchase-request`;
16
- return t && l ? await e.get(`${s}?startDate=${t}&endDate=${l}`) : await e.get(s);
14
+ async readRequests(u, t, c) {
15
+ const o = u ?? i.currentLocationDBName, s = `${S.inventoryBackendUrl}/${o}/purchase-request`;
16
+ return t && c ? await e.get(`${s}?startDate=${t}&endDate=${c}`) : await e.get(s);
17
17
  },
18
- async readRequestById(d, t) {
19
- const l = t ?? i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-request/${d}`;
20
- return await e.get(a);
18
+ async readRequestById(u, t) {
19
+ const c = t ?? i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${c}/purchase-request/${u}`;
20
+ return await e.get(o);
21
21
  },
22
- async readRequestByIds(d, t) {
23
- const l = t ?? i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-request/find`;
24
- return await e.post(a, { requestIds: d });
22
+ async readRequestByIds(u, t) {
23
+ const c = t ?? i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${c}/purchase-request/find`;
24
+ return await e.post(o, { requestIds: u });
25
25
  },
26
26
  async getPurchaseOrders({
27
- start: d,
27
+ start: u,
28
28
  end: t
29
29
  }) {
30
- const l = i.currentLocationDBName, a = `${S.inventoryBackendUrl}/${l}/purchase-order`;
31
- return await e.get(`${a}?start=${d}&end=${t}`);
30
+ const c = i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${c}/purchase-order`;
31
+ return await e.get(`${o}?start=${u}&end=${t}`);
32
32
  },
33
- async getLatestPurchaseOrderRequest(d) {
34
- const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
35
- return await e.get(`${l}/${d}`);
33
+ async getLatestPurchaseOrderRequest(u) {
34
+ const t = i.currentLocationDBName, c = `${S.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
35
+ return await e.get(`${c}/${u}`);
36
36
  },
37
- async getPurchaseOrderById(d) {
38
- const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
39
- return await e.get(`${l}/${d}`);
37
+ async getPurchaseOrderById(u) {
38
+ const t = i.currentLocationDBName, c = `${S.inventoryBackendUrl}/${t}/purchase-order`;
39
+ return await e.get(`${c}/${u}`);
40
40
  },
41
41
  /**
42
42
  * @deprecated Use `processPurchaseOrderV2` instead.
43
43
  */
44
- async processPurchaseOrder(d, t) {
45
- const l = i.currentLocationDBName, a = t || l, s = `${S.inventoryBackendUrl}/${a}/purchase-order/run-operation`;
46
- return await e.put(s, d);
44
+ async processPurchaseOrder(u, t) {
45
+ const c = i.currentLocationDBName, o = t || c, s = `${S.inventoryBackendUrl}/${o}/purchase-order/run-operation`;
46
+ return await e.put(s, u);
47
47
  },
48
- async createPurchaseOrder(d) {
49
- const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
50
- return await e.post(l, d);
48
+ async createPurchaseOrder(u) {
49
+ const t = i.currentLocationDBName, c = `${S.inventoryBackendUrl}/${t}/purchase-order`;
50
+ return await e.post(c, u);
51
51
  },
52
- async updatePurchaseOrder(d) {
53
- const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order`;
54
- return await e.put(l, d);
52
+ async updatePurchaseOrder(u) {
53
+ const t = i.currentLocationDBName, c = `${S.inventoryBackendUrl}/${t}/purchase-order`;
54
+ return await e.put(c, u);
55
55
  },
56
- async importFromXilnex(d) {
57
- const t = i.currentLocationDBName, l = `${S.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
58
- return await e.post(l, d);
56
+ async importFromXilnex(u) {
57
+ const t = i.currentLocationDBName, c = `${S.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
58
+ return await e.post(c, u);
59
59
  },
60
- async processPurchaseOrderV2(d, t) {
61
- const l = i.currentLocationDBName, a = t || l, s = `${S.inventoryBackendUrl}/${a}/v2/purchase-order/run-operation`;
62
- return await e.put(s, d);
60
+ async processPurchaseOrderV2(u, t) {
61
+ const c = i.currentLocationDBName, o = t || c, s = `${S.inventoryBackendUrl}/${o}/v2/purchase-order/run-operation`;
62
+ return await e.put(s, u);
63
63
  },
64
64
  async getWorkflowConfig() {
65
- var a;
66
- const t = `business_${(a = _.currentBusiness.value) == null ? void 0 : a._id}`, l = `${S.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
67
- return await e.get(l);
65
+ var o;
66
+ const t = `business_${(o = g.currentBusiness.value) == null ? void 0 : o._id}`, c = `${S.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
67
+ return await e.get(c);
68
68
  }
69
69
  };
70
70
  }), ot = {
@@ -137,46 +137,46 @@ const $e = lt((S, e) => {
137
137
  };
138
138
  function it() {
139
139
  const S = de(), e = $e(), i = De();
140
- async function _(t, l) {
141
- const a = S.currentLocationDBName;
142
- return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t, l || a);
140
+ async function g(t, c) {
141
+ const o = S.currentLocationDBName;
142
+ return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t, c || o);
143
143
  }
144
- async function d(t, l) {
145
- const a = S.currentLocationDBName;
146
- return await e.processPurchaseOrderV2(t, l || a);
144
+ async function u(t, c) {
145
+ const o = S.currentLocationDBName;
146
+ return await e.processPurchaseOrderV2(t, c || o);
147
147
  }
148
- return (t) => i.useOperatePurchaseOrderV2 ? d(t.operateV2, t.transferTo) : _(t.operate, t.transferTo);
148
+ return (t) => i.useOperatePurchaseOrderV2 ? u(t.operateV2, t.transferTo) : g(t.operate, t.transferTo);
149
149
  }
150
150
  var Ue = /* @__PURE__ */ ((S) => (S.RECEIVE_REQUEST = "receive/request", S.APPROVAL = "approval", S))(Ue || {});
151
151
  const we = M(), Be = M();
152
152
  function Bs(S, e) {
153
- const i = Me(), _ = de(), d = De();
153
+ const i = Me(), g = de(), u = De();
154
154
  qe();
155
- const t = wt(), l = Rt(), a = M(!1), s = Te(), y = $e(), g = M(new Array()), f = M(
155
+ const t = wt(), c = Rt(), o = M(!1), s = Te(), y = $e(), b = M(new Array()), p = M(
156
156
  e != null && e.startDate && (e != null && e.endDate) ? e : ct()
157
- ), c = Z(() => {
158
- const x = new Date(f.value.startDate), r = new Date(f.value.endDate);
157
+ ), m = Q(() => {
158
+ const D = new Date(p.value.startDate), r = new Date(p.value.endDate);
159
159
  return {
160
- start: ut(x).toISOString(),
160
+ start: ut(D).toISOString(),
161
161
  end: dt(r).toISOString()
162
162
  };
163
- }), u = M(new Array()), o = mt(), v = M(null);
164
- async function D(x) {
163
+ }), l = M(new Array()), n = mt(), _ = M(null);
164
+ async function x(D) {
165
165
  function r(R) {
166
166
  const w = {
167
167
  mode: Ye.CREATE,
168
- modelValue: x || void 0,
168
+ modelValue: D || void 0,
169
169
  show: !0,
170
170
  "onUpdate:show"(T) {
171
171
  we.value.show = T;
172
172
  },
173
173
  templateId: R,
174
- lastClosingDate: v.value
174
+ lastClosingDate: _.value
175
175
  };
176
176
  we.value = w;
177
177
  }
178
- let m;
179
- d.mustUsePoTemplate && !(x != null && x.template) ? i.open({
178
+ let d;
179
+ u.mustUsePoTemplate && !(D != null && D.template) ? i.open({
180
180
  title: "Create transfer",
181
181
  message: "",
182
182
  primaryActions: {
@@ -189,34 +189,34 @@ function Bs(S, e) {
189
189
  close: !0
190
190
  }
191
191
  }).onPrimary(async () => {
192
- m = await t.getTemplateId(), m && r(m);
192
+ d = await t.getTemplateId(), d && r(d);
193
193
  }).onSecondary(() => {
194
194
  r(void 0);
195
- }) : r(m);
195
+ }) : r(d);
196
196
  }
197
- function q(x) {
197
+ function q(D) {
198
198
  const r = {
199
199
  mode: Ye.UPDATE,
200
- modelValue: et(x),
200
+ modelValue: et(D),
201
201
  show: !0,
202
- "onUpdate:show"(m) {
203
- we.value.show = m;
202
+ "onUpdate:show"(d) {
203
+ we.value.show = d;
204
204
  },
205
- lastClosingDate: v.value
205
+ lastClosingDate: _.value
206
206
  };
207
207
  we.value = r;
208
208
  }
209
- async function Y() {
210
- g.value = [], a.value = !0;
209
+ async function j() {
210
+ b.value = [], o.value = !0;
211
211
  try {
212
- g.value = await y.getPurchaseOrders(c.value).then((R) => R.sort((w, T) => T._id.localeCompare(w._id)));
213
- const x = await o.readCurrentLocationLastClosing(!0), r = x == null ? void 0 : x._id;
214
- r && (v.value = ft(r)), await d.awaitFeatureLoaded(() => d.mustUsePoTemplate) && await l.fetchTemplates();
215
- const m = g.value.map((R) => {
212
+ b.value = await y.getPurchaseOrders(m.value).then((R) => R.sort((w, T) => T._id.localeCompare(w._id)));
213
+ const D = await n.readCurrentLocationLastClosing(!0), r = D == null ? void 0 : D._id;
214
+ r && (_.value = ft(r)), await u.awaitFeatureLoaded(() => u.mustUsePoTemplate) && await c.fetchTemplates();
215
+ const d = b.value.map((R) => {
216
216
  var w;
217
217
  return ((w = R.request) == null ? void 0 : w.id) ?? "";
218
218
  }).filter((R) => R);
219
- u.value = await y.readRequestByIds(m);
219
+ l.value = await y.readRequestByIds(d);
220
220
  } catch {
221
221
  s.open({
222
222
  title: "Something went wrong",
@@ -224,17 +224,17 @@ function Bs(S, e) {
224
224
  type: "error"
225
225
  });
226
226
  } finally {
227
- a.value = !1;
227
+ o.value = !1;
228
228
  }
229
229
  }
230
230
  async function C() {
231
- u.value = [], a.value = !0;
231
+ l.value = [], o.value = !0;
232
232
  try {
233
- u.value = await y.readRequests(
233
+ l.value = await y.readRequests(
234
234
  void 0,
235
- c.value.start,
236
- c.value.end
237
- ).then((x) => x.reverse());
235
+ m.value.start,
236
+ m.value.end
237
+ ).then((D) => D.reverse());
238
238
  } catch {
239
239
  s.open({
240
240
  title: "Something went wrong",
@@ -242,83 +242,83 @@ function Bs(S, e) {
242
242
  type: "error"
243
243
  });
244
244
  } finally {
245
- a.value = !1;
245
+ o.value = !1;
246
246
  }
247
247
  }
248
248
  function F() {
249
249
  switch (S) {
250
250
  case "receive/request":
251
- return Y();
251
+ return j();
252
252
  case "approval":
253
253
  return C();
254
254
  }
255
255
  }
256
- function j(x, r) {
257
- f.value = {
258
- startDate: x,
256
+ function K(D, r) {
257
+ p.value = {
258
+ startDate: D,
259
259
  endDate: r
260
260
  }, F();
261
261
  }
262
- _.watchLocation(async (x) => {
263
- if (!x) {
264
- g.value = [];
262
+ g.watchLocation(async (D) => {
263
+ if (!D) {
264
+ b.value = [];
265
265
  return;
266
266
  }
267
267
  await F();
268
268
  });
269
- const H = M(), le = M(Math.random().toString());
270
- async function oe(x, r) {
271
- const m = Math.random().toString();
272
- le.value = m, r ?? (r = u.value.computeFirst(
273
- (T) => T.purchaseOrderId === x._id ? T : null
269
+ const W = M(), le = M(Math.random().toString());
270
+ async function oe(D, r) {
271
+ const d = Math.random().toString();
272
+ le.value = d, r ?? (r = l.value.computeFirst(
273
+ (T) => T.purchaseOrderId === D._id ? T : null
274
274
  ) ?? void 0);
275
- const R = S === "receive/request" ? _.currentLocation : r == null ? void 0 : r.to, w = {
275
+ const R = S === "receive/request" ? g.currentLocation : r == null ? void 0 : r.to, w = {
276
276
  poRequest: r,
277
- purchaseOrder: x,
277
+ purchaseOrder: D,
278
278
  transferTo: R == null ? void 0 : R.name,
279
279
  transferToDbName: R == null ? void 0 : R.dbName,
280
280
  show: !0,
281
281
  canResubmit: !1,
282
282
  canApprove: S === "approval",
283
283
  "onUpdate:show"(T) {
284
- H.value.show = T;
284
+ W.value.show = T;
285
285
  },
286
286
  scope: S
287
287
  };
288
- H.value = w;
288
+ W.value = w;
289
289
  }
290
- async function ye(x, r, m, R) {
290
+ async function ye(D, r, d, R) {
291
291
  const w = it();
292
- a.value = !0;
292
+ o.value = !0;
293
293
  try {
294
294
  await w({
295
295
  operate: {
296
296
  operation: r,
297
- doc: x,
297
+ doc: D,
298
298
  options: (
299
299
  // auto receive for supplier to warehouse
300
300
  (r === O.enum.confirmDraft || // auto receive for warehouse to warehouse
301
- r === O.enum.completeReceive) && d.autoReceiveWarehouse ? {
301
+ r === O.enum.completeReceive) && u.autoReceiveWarehouse ? {
302
302
  autoReceive: !0
303
303
  } : void 0
304
304
  )
305
305
  },
306
306
  operateV2: {
307
- _id: x._id,
308
- _rev: x._rev ?? "",
307
+ _id: D._id,
308
+ _rev: D._rev ?? "",
309
309
  action: r,
310
310
  payloads: []
311
311
  },
312
312
  transferTo: R
313
- }), await new Promise((Q) => setTimeout(Q, 1e3));
313
+ }), await new Promise((X) => setTimeout(X, 1e3));
314
314
  const G = de().currentLocationDBName.startsWith("restaurant_");
315
- r === O.enum.confirmDraft && x.effectiveAt && G ? s.open({
315
+ r === O.enum.confirmDraft && D.effectiveAt && G ? s.open({
316
316
  title: "Success",
317
- message: `${m}. The backdate will be reflected once your POS has received this change.`,
317
+ message: `${d}. The backdate will be reflected once your POS has received this change.`,
318
318
  type: "success"
319
319
  }) : s.open({
320
320
  title: "Success",
321
- message: m,
321
+ message: d,
322
322
  type: "success"
323
323
  });
324
324
  } catch (T) {
@@ -326,12 +326,12 @@ function Bs(S, e) {
326
326
  title: "Something went wrong",
327
327
  message: "Please try again.",
328
328
  type: "error"
329
- }), console.error("Error when submitting PO operation", r, x, T);
329
+ }), console.error("Error when submitting PO operation", r, D, T);
330
330
  } finally {
331
- a.value = !1, F();
331
+ o.value = !1, F();
332
332
  }
333
333
  }
334
- async function Ce(x, r, m) {
334
+ async function Ce(D, r, d) {
335
335
  const R = ot[r];
336
336
  if (!R) {
337
337
  s.open({
@@ -347,7 +347,7 @@ function Bs(S, e) {
347
347
  message: T.message,
348
348
  primaryActions: T.primaryActions
349
349
  }).onPrimary(() => {
350
- ye(x, r, w, m);
350
+ ye(D, r, w, d);
351
351
  });
352
352
  }
353
353
  async function ce() {
@@ -362,25 +362,25 @@ function Bs(S, e) {
362
362
  close: !0
363
363
  }
364
364
  }).onPrimary(() => {
365
- const x = {
365
+ const D = {
366
366
  show: !0,
367
367
  "onUpdate:show"(r) {
368
368
  Be.value.show = r;
369
369
  }
370
370
  };
371
- Be.value = x;
371
+ Be.value = D;
372
372
  });
373
373
  }
374
374
  return {
375
- purchaseOrders: g,
376
- purchaseRequests: u,
377
- updateDateRange: j,
375
+ purchaseOrders: b,
376
+ purchaseRequests: l,
377
+ updateDateRange: K,
378
378
  fetchData: F,
379
- loading: a,
379
+ loading: o,
380
380
  transferDialogProps: we,
381
- promptCreateTransferDialog: D,
381
+ promptCreateTransferDialog: x,
382
382
  promptUpdateTransferDialog: q,
383
- transferDetailsProps: H,
383
+ transferDetailsProps: W,
384
384
  promptShowTransferDetails: oe,
385
385
  submitAction: Ce,
386
386
  xilnexImportDialogProps: Be,
@@ -389,24 +389,24 @@ function Bs(S, e) {
389
389
  }
390
390
  function $t(S, e) {
391
391
  return e.reduce(
392
- (_, d) => {
393
- const t = d.received.find((l) => l.sku._id === S._id);
394
- return t && (_ = Le(_, t.amount)), _;
392
+ (g, u) => {
393
+ const t = u.received.find((c) => c.sku._id === S._id);
394
+ return t && (g = Le(g, t.amount)), g;
395
395
  },
396
396
  St.toPrecision(ke(0), S.unit.precision)
397
397
  );
398
398
  }
399
399
  function Ct(S) {
400
- const { po: e, currentLocation: i, business: _, fulfilling: d, por: t } = S, { name: l, address: a, regNo: s } = i.doc.profile, y = {
401
- name: l,
400
+ const { po: e, currentLocation: i, business: g, fulfilling: u, por: t } = S, { name: c, address: o, regNo: s } = i.doc.profile, y = {
401
+ name: c,
402
402
  registrationNumber: s,
403
- line1: a == null ? void 0 : a.line1,
404
- line2: a == null ? void 0 : a.line2,
405
- postcode: a == null ? void 0 : a.postcode,
406
- city: a == null ? void 0 : a.city,
407
- state: a == null ? void 0 : a.state,
408
- country: a == null ? void 0 : a.country
409
- }, g = {
403
+ line1: o == null ? void 0 : o.line1,
404
+ line2: o == null ? void 0 : o.line2,
405
+ postcode: o == null ? void 0 : o.postcode,
406
+ city: o == null ? void 0 : o.city,
407
+ state: o == null ? void 0 : o.state,
408
+ country: o == null ? void 0 : o.country
409
+ }, b = {
410
410
  name: e.supplier.name,
411
411
  phoneNumber: e.supplier.phoneNumber,
412
412
  registrationNumber: e.supplier.registrationNumber,
@@ -416,8 +416,8 @@ function Ct(S) {
416
416
  city: e.supplier.address.city,
417
417
  state: e.supplier.address.state,
418
418
  country: e.supplier.address.country
419
- }, f = e.items.map((C) => {
420
- const { sku: F, measurement: j } = C, H = ie(
419
+ }, p = e.items.map((C) => {
420
+ const { sku: F, measurement: K } = C, W = ie(
421
421
  $t(C.sku, e.deliveryOrder || []),
422
422
  !1
423
423
  );
@@ -425,51 +425,51 @@ function Ct(S) {
425
425
  code: F.code,
426
426
  description: F.name,
427
427
  quantity: ie(C.quantity, !1),
428
- unit: (j == null ? void 0 : j.abbrev) || F.unit.abbrev,
429
- received: H,
428
+ unit: (K == null ? void 0 : K.abbrev) || F.unit.abbrev,
429
+ received: W,
430
430
  cost: C.totalCost ? `${C.totalCost.currency} ${pt.toFormatString({
431
431
  value: C.totalCost
432
432
  })}` : void 0
433
433
  };
434
- }), c = e.deliveryOrder.map((C) => ({
434
+ }), m = e.deliveryOrder.map((C) => ({
435
435
  createdAt: tt(new Date(C.createdAt)),
436
436
  ref: C.deliveryOrderNumber,
437
437
  remark: C.remark || "",
438
438
  items: C.received.map((F) => {
439
- var j;
439
+ var K;
440
440
  return {
441
441
  code: F.sku.code,
442
442
  description: F.sku.name,
443
443
  quantity: ie(F.amount),
444
- unit: ((j = F.measurement) == null ? void 0 : j.abbrev) || F.sku.unit.abbrev
444
+ unit: ((K = F.measurement) == null ? void 0 : K.abbrev) || F.sku.unit.abbrev
445
445
  };
446
446
  })
447
- })), u = [
447
+ })), l = [
448
448
  // Production
449
449
  "67ca5d2c80bd0e001c5bf5bc",
450
450
  // Dev
451
451
  "6880b36a3054c5001db19218"
452
452
  ];
453
- let o = "Inventory Receive Note";
454
- if (e.supplier.internal ? (o = "Inventory Transfer Note", u.includes((_ == null ? void 0 : _._id) || "") && (o = "Stock Request")) : o = "Purchase Order", t) {
453
+ let n = "Inventory Receive Note";
454
+ if (e.supplier.internal ? (n = "Inventory Transfer Note", l.includes((g == null ? void 0 : g._id) || "") && (n = "Stock Request")) : n = "Purchase Order", t) {
455
455
  const C = t.from.dbName;
456
- i.dbName === C || (o = "Inventory Receive Note");
456
+ i.dbName === C || (n = "Inventory Receive Note");
457
457
  }
458
- const D = {
459
- title: o,
460
- businessName: _ == null ? void 0 : _.name,
461
- logo: _ == null ? void 0 : _.thumbnail,
458
+ const x = {
459
+ title: n,
460
+ businessName: g == null ? void 0 : g.name,
461
+ logo: g == null ? void 0 : g.thumbnail,
462
462
  orderNumber: e.seqNumber.toString(),
463
463
  createdAt: xe(e._id),
464
464
  ref: e.ref || "",
465
465
  remark: e.remark || "",
466
466
  buyer: y,
467
- supplier: g,
468
- items: f,
467
+ supplier: b,
468
+ items: p,
469
469
  status: e.status,
470
- deliveryOrders: c
471
- }, q = new URL(window.location.href), Y = d && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
472
- q.pathname = q.hostname.includes("portal.feedme") ? `/inventory/${Y}` : `/${Y}`, q.searchParams.append("data", JSON.stringify(D)), window.open(q.href, "_blank", "noreferrer");
470
+ deliveryOrders: m
471
+ }, q = new URL(window.location.href), j = u && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
472
+ q.pathname = q.hostname.includes("portal.feedme") ? `/inventory/${j}` : `/${j}`, q.searchParams.append("data", JSON.stringify(x)), window.open(q.href, "_blank", "noreferrer");
473
473
  }
474
474
  const be = {
475
475
  submitRequest: {
@@ -534,69 +534,69 @@ const be = {
534
534
  }
535
535
  };
536
536
  function Es(S, e) {
537
- const i = de(), _ = qe(), d = Ae(), { t } = at();
538
- function l(c) {
539
- switch (c.status) {
537
+ const i = de(), g = qe(), u = Ae(), { t } = at();
538
+ function c(m) {
539
+ switch (m.status) {
540
540
  case "DRAFT":
541
541
  return [
542
- re[J.Update],
543
- re[J.Details],
544
- c.supplier.internal === "restaurant" || c.supplier.internal === "warehouse" ? be[O.enum.submitRequest] : be[O.enum.confirmDraft],
542
+ re[Z.Update],
543
+ re[Z.Details],
544
+ m.supplier.internal === "restaurant" || m.supplier.internal === "warehouse" ? be[O.enum.submitRequest] : be[O.enum.confirmDraft],
545
545
  be[O.enum.cancelDraft]
546
546
  ];
547
547
  case "RECEIVING":
548
548
  return [
549
549
  be[O.enum.completeReceive],
550
- re[J.Details],
551
- re[J.Print]
550
+ re[Z.Details],
551
+ re[Z.Print]
552
552
  ];
553
553
  case "REQUESTING":
554
- return S === "receive/request" ? [re[J.Details], re[J.Print]] : [
554
+ return S === "receive/request" ? [re[Z.Details], re[Z.Print]] : [
555
555
  be[O.enum.approveRequest],
556
556
  be[O.enum.rejectRequest],
557
- re[J.Details]
557
+ re[Z.Details]
558
558
  // DefaultRowActions[RowActionEnum.Print]
559
559
  ];
560
560
  case "PROCESSING":
561
- return [re[J.Details], re[J.Print]];
561
+ return [re[Z.Details], re[Z.Print]];
562
562
  case "COMPLETE":
563
563
  case "CANCEL":
564
564
  default:
565
- return [re[J.Details], re[J.Print]];
565
+ return [re[Z.Details], re[Z.Print]];
566
566
  }
567
567
  }
568
- function a(c) {
569
- return Object.values(O.enum).includes(c);
568
+ function o(m) {
569
+ return Object.values(O.enum).includes(m);
570
570
  }
571
- async function s(c, u, o) {
572
- var D, q, Y, C, F, j;
573
- const v = et(u);
574
- if (c === J.Print) {
575
- const H = (o == null ? void 0 : o.toInventoryLocation) ?? i.currentLocation;
576
- ((D = o == null ? void 0 : o.netSuite) != null && D.refNo || (q = v.netSuite) != null && q.refNo) && (v.ref = [((Y = o == null ? void 0 : o.netSuite) == null ? void 0 : Y.refNo) || ((C = v.netSuite) == null ? void 0 : C.refNo)].filter((le) => le).join(" ")), Ct({
577
- po: v,
578
- currentLocation: H,
579
- business: d.currentBusiness.value,
571
+ async function s(m, l, n) {
572
+ var x, q, j, C, F, K;
573
+ const _ = et(l);
574
+ if (m === Z.Print) {
575
+ const W = (n == null ? void 0 : n.toInventoryLocation) ?? i.currentLocation;
576
+ ((x = n == null ? void 0 : n.netSuite) != null && x.refNo || (q = _.netSuite) != null && q.refNo) && (_.ref = [((j = n == null ? void 0 : n.netSuite) == null ? void 0 : j.refNo) || ((C = _.netSuite) == null ? void 0 : C.refNo)].filter((le) => le).join(" ")), Ct({
577
+ po: _,
578
+ currentLocation: W,
579
+ business: u.currentBusiness.value,
580
580
  fulfilling: S === "approval",
581
- por: o
581
+ por: n
582
582
  });
583
583
  return;
584
584
  }
585
- if (c === J.Details) {
586
- e.promptShowTransferDetails(v, o);
585
+ if (m === Z.Details) {
586
+ e.promptShowTransferDetails(_, n);
587
587
  return;
588
588
  }
589
- if (c === J.Update) {
590
- (F = e.promptUpdateTransferDialog) == null || F.call(e, v);
589
+ if (m === Z.Update) {
590
+ (F = e.promptUpdateTransferDialog) == null || F.call(e, _);
591
591
  return;
592
592
  }
593
- if (a(c)) {
594
- e.submitAction(u, c, (j = o == null ? void 0 : o.to) == null ? void 0 : j.dbName);
593
+ if (o(m)) {
594
+ e.submitAction(l, m, (K = n == null ? void 0 : n.to) == null ? void 0 : K.dbName);
595
595
  return;
596
596
  }
597
597
  }
598
598
  function y() {
599
- const c = [
599
+ const m = [
600
600
  {
601
601
  accessorKey: "seqNumber",
602
602
  header: () => t("inventory.transfer.table.seqNo"),
@@ -607,8 +607,8 @@ function Es(S, e) {
607
607
  {
608
608
  accessorKey: "_id",
609
609
  header: () => t("inventory.transfer.table.createdAt"),
610
- cell(u) {
611
- return xe(`${u.getValue()}`);
610
+ cell(l) {
611
+ return xe(`${l.getValue()}`);
612
612
  },
613
613
  enableSorting: !0
614
614
  },
@@ -635,8 +635,8 @@ function Es(S, e) {
635
635
  {
636
636
  accessorKey: "status",
637
637
  header: () => t("inventory.transfer.table.status"),
638
- cell(u) {
639
- const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
638
+ cell(l) {
639
+ const n = t(`inventory.transfer.status.${l.getValue() ?? ""}`), _ = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
640
640
  return A(
641
641
  "div",
642
642
  {
@@ -645,9 +645,9 @@ function Es(S, e) {
645
645
  A(
646
646
  "div",
647
647
  {
648
- class: `fm-status-badge fm-status-badge-${v}`
648
+ class: `fm-status-badge fm-status-badge-${_}`
649
649
  },
650
- o
650
+ n
651
651
  )
652
652
  );
653
653
  },
@@ -656,9 +656,9 @@ function Es(S, e) {
656
656
  },
657
657
  {
658
658
  id: "action",
659
- cell(u) {
660
- const o = u.row.original, v = l(o);
661
- return Qe(v, (D) => s(D, o));
659
+ cell(l) {
660
+ const n = l.row.original, _ = c(n);
661
+ return Qe(_, (x) => s(x, n));
662
662
  },
663
663
  enableSorting: !1,
664
664
  size: 40,
@@ -668,15 +668,15 @@ function Es(S, e) {
668
668
  }
669
669
  }
670
670
  ];
671
- if (_.isEnabled) {
672
- const u = [
671
+ if (g.isEnabled) {
672
+ const l = [
673
673
  {
674
674
  id: "netsuiteTransferOrder",
675
675
  header: () => "NetSuite Order (ID)",
676
- cell(o) {
677
- var D;
678
- const v = o.row.original;
679
- return (D = v.netSuite) != null && D.id ? `${v.netSuite.refNo} (${v.netSuite.id})` : "N/A";
676
+ cell(n) {
677
+ var x;
678
+ const _ = n.row.original;
679
+ return (x = _.netSuite) != null && x.id ? `${_.netSuite.refNo} (${_.netSuite.id})` : "N/A";
680
680
  },
681
681
  enableSorting: !1,
682
682
  size: 200,
@@ -688,9 +688,9 @@ function Es(S, e) {
688
688
  {
689
689
  id: "netsuiteTransactionNumber",
690
690
  header: () => "NetSuite Transaction No.",
691
- cell(o) {
692
- var D, q;
693
- return ((q = (D = o.row.original.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
691
+ cell(n) {
692
+ var x, q;
693
+ return ((q = (x = n.row.original.netSuite) == null ? void 0 : x.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
694
694
  },
695
695
  enableSorting: !1,
696
696
  size: 200,
@@ -700,12 +700,12 @@ function Es(S, e) {
700
700
  }
701
701
  }
702
702
  ];
703
- c.splice(c.length - 2, 0, ...u);
703
+ m.splice(m.length - 2, 0, ...l);
704
704
  }
705
- return c;
705
+ return m;
706
706
  }
707
- function g() {
708
- const c = [
707
+ function b() {
708
+ const m = [
709
709
  {
710
710
  accessorKey: "purchaseOrder.seqNumber",
711
711
  header: () => t("inventory.transfer.table.seqNo"),
@@ -716,8 +716,8 @@ function Es(S, e) {
716
716
  {
717
717
  accessorKey: "purchaseOrder._id",
718
718
  header: () => t("inventory.transfer.table.createdAt"),
719
- cell(u) {
720
- return xe(`${u.getValue()}`);
719
+ cell(l) {
720
+ return xe(`${l.getValue()}`);
721
721
  },
722
722
  enableSorting: !0
723
723
  },
@@ -741,8 +741,8 @@ function Es(S, e) {
741
741
  {
742
742
  accessorKey: "purchaseOrder.status",
743
743
  header: () => t("inventory.transfer.table.status"),
744
- cell(u) {
745
- const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
744
+ cell(l) {
745
+ const n = t(`inventory.transfer.status.${l.getValue() ?? ""}`), _ = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
746
746
  return A(
747
747
  "div",
748
748
  {
@@ -751,9 +751,9 @@ function Es(S, e) {
751
751
  A(
752
752
  "div",
753
753
  {
754
- class: `fm-status-badge fm-status-badge-${v}`
754
+ class: `fm-status-badge fm-status-badge-${_}`
755
755
  },
756
- o
756
+ n
757
757
  )
758
758
  );
759
759
  },
@@ -761,14 +761,14 @@ function Es(S, e) {
761
761
  },
762
762
  {
763
763
  id: "action",
764
- cell(u) {
765
- const o = u.row.original, D = (o.purchaseOrder ? l(o.purchaseOrder) : []).map((q) => q.value === J.Print ? {
764
+ cell(l) {
765
+ const n = l.row.original, x = (n.purchaseOrder ? c(n.purchaseOrder) : []).map((q) => q.value === Z.Print ? {
766
766
  ...q,
767
767
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
768
768
  } : q);
769
769
  return Qe(
770
- D,
771
- (q) => o.purchaseOrder ? s(q, o.purchaseOrder, o) : void 0
770
+ x,
771
+ (q) => n.purchaseOrder ? s(q, n.purchaseOrder, n) : void 0
772
772
  );
773
773
  },
774
774
  enableSorting: !1,
@@ -779,15 +779,15 @@ function Es(S, e) {
779
779
  }
780
780
  }
781
781
  ];
782
- if (_.isEnabled) {
783
- const u = [
782
+ if (g.isEnabled) {
783
+ const l = [
784
784
  {
785
785
  id: "netsuiteTransferOrder",
786
786
  header: () => "NetSuite Order (ID)",
787
- cell(o) {
788
- var D;
789
- const v = o.row.original;
790
- return (D = v.netSuite) != null && D.id ? `${v.netSuite.refNo} (${v.netSuite.id})` : "N/A";
787
+ cell(n) {
788
+ var x;
789
+ const _ = n.row.original;
790
+ return (x = _.netSuite) != null && x.id ? `${_.netSuite.refNo} (${_.netSuite.id})` : "N/A";
791
791
  },
792
792
  enableSorting: !1,
793
793
  size: 200,
@@ -799,9 +799,9 @@ function Es(S, e) {
799
799
  {
800
800
  id: "netsuiteTransactionNumber",
801
801
  header: () => "NetSuite Transaction No.",
802
- cell(o) {
803
- var D, q;
804
- return ((q = (D = o.row.original.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
802
+ cell(n) {
803
+ var x, q;
804
+ return ((q = (x = n.row.original.netSuite) == null ? void 0 : x.additionalInfo) == null ? void 0 : q.transactionnumber) ?? "N/A";
805
805
  },
806
806
  enableSorting: !1,
807
807
  size: 200,
@@ -811,12 +811,12 @@ function Es(S, e) {
811
811
  }
812
812
  }
813
813
  ];
814
- c.splice(c.length - 2, 0, ...u);
814
+ m.splice(m.length - 2, 0, ...l);
815
815
  }
816
- return c;
816
+ return m;
817
817
  }
818
818
  return {
819
- columnDefs: Z(() => S === "receive/request" ? y() : g())
819
+ columnDefs: Q(() => S === "receive/request" ? y() : b())
820
820
  };
821
821
  }
822
822
  const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, It = { class: "flex flex-col gap-8" }, Ft = { class: "flex w-full justify-end gap-16" }, Bt = /* @__PURE__ */ pe({
@@ -827,41 +827,43 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
827
827
  },
828
828
  emits: ["update:show"],
829
829
  setup(S, { emit: e }) {
830
- const i = S, _ = ht({
830
+ const i = S, g = ht({
831
831
  id: "",
832
832
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
833
833
  items: []
834
- }), d = M(), t = e;
835
- return nt(() => {
836
- i.purchaseOrder && (_.items = i.purchaseOrder.items.map((l) => ({
837
- id: l.id,
838
- sku: l.sku,
839
- measurement: l.measurement,
840
- amount: l.quantity ?? { amount: 1, precision: 0 }
834
+ }), u = M(), t = e;
835
+ nt(() => {
836
+ i.purchaseOrder && (g.items = i.purchaseOrder.items.map((o) => ({
837
+ id: o.id,
838
+ sku: o.sku,
839
+ measurement: o.measurement,
840
+ amount: o.quantity ?? { amount: 1, precision: 0 }
841
841
  })));
842
- }), (l, a) => {
843
- const s = K("FmTable"), y = K("FmButton"), g = K("FmForm");
844
- return b(), ae(g, {
842
+ });
843
+ const c = Q(() => g.items.length <= 10);
844
+ return (o, s) => {
845
+ const y = z("FmTable"), b = z("FmButton"), p = z("FmForm");
846
+ return h(), ae(p, {
845
847
  ref_key: "formRef",
846
- ref: d,
848
+ ref: u,
847
849
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
848
850
  onValidationFailed: console.log,
849
- onValidationSuccess: a[1] || (a[1] = () => i.confirm(_))
851
+ onValidationSuccess: s[1] || (s[1] = () => i.confirm(g))
850
852
  }, {
851
853
  default: se(() => [
852
- a[2] || (a[2] = n("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
853
- n("div", Pt, [
854
- n("div", It, [
855
- I(s, {
854
+ s[2] || (s[2] = a("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
855
+ a("div", Pt, [
856
+ a("div", It, [
857
+ I(y, {
856
858
  "column-defs": [
857
859
  {
858
860
  header: "Code",
859
- cell: (f) => {
860
- const c = i.purchaseOrder.items.find((u) => u.id === f.row.original.id || u.sku._id === f.row.original.sku._id);
861
+ cell: (m) => {
862
+ const l = i.purchaseOrder.items.find((n) => n.id === m.row.original.id || n.sku._id === m.row.original.sku._id);
861
863
  return A(
862
- h(Je).FmTooltip,
864
+ v(Je).FmTooltip,
863
865
  {
864
- content: c.code,
866
+ content: l.code,
865
867
  placement: "top",
866
868
  variant: "plain",
867
869
  zIndex: 50
@@ -871,19 +873,19 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
871
873
  {
872
874
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
873
875
  },
874
- c.code
876
+ l.code
875
877
  )
876
878
  );
877
879
  }
878
880
  },
879
881
  {
880
882
  header: "Name",
881
- cell: (f) => {
882
- const c = i.purchaseOrder.items.find((u) => u.id === f.row.original.id || u.sku._id === f.row.original.sku._id);
883
+ cell: (m) => {
884
+ const l = i.purchaseOrder.items.find((n) => n.id === m.row.original.id || n.sku._id === m.row.original.sku._id);
883
885
  return A(
884
- h(Je).FmTooltip,
886
+ v(Je).FmTooltip,
885
887
  {
886
- content: c.name,
888
+ content: l.name,
887
889
  placement: "top",
888
890
  variant: "plain",
889
891
  zIndex: 50
@@ -893,15 +895,15 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
893
895
  {
894
896
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
895
897
  },
896
- c.name
898
+ l.name
897
899
  )
898
900
  );
899
901
  }
900
902
  },
901
903
  {
902
904
  header: "Amount",
903
- cell: (f) => {
904
- const c = f.row.original, u = i.purchaseOrder.items.find((v) => v.id === c.id || v.sku._id === c.sku._id), o = c.amount ?? {
905
+ cell: (m) => {
906
+ const l = m.row.original, n = i.purchaseOrder.items.find((x) => x.id === l.id || x.sku._id === l.sku._id), _ = l.amount ?? {
905
907
  amount: 1,
906
908
  precision: 0
907
909
  };
@@ -910,47 +912,47 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
910
912
  flex: "1 1 0%"
911
913
  },
912
914
  modelValue: {
913
- amount: o,
914
- measurement: c.measurement ?? null
915
+ amount: _,
916
+ measurement: l.measurement ?? null
915
917
  },
916
- key: c.id ?? c.sku._id,
917
- unit: c.sku.unit,
918
- "onUpdate:modelValue": (v) => {
919
- if (!v) return;
920
- const D = _.items.find((q) => q.id === c.id || q.sku._id === c.sku._id);
921
- D && (D.amount = v.amount);
918
+ key: l.id ?? l.sku._id,
919
+ unit: l.sku.unit,
920
+ "onUpdate:modelValue": (x) => {
921
+ if (!x) return;
922
+ const q = g.items.find((j) => j.id === l.id || j.sku._id === l.sku._id);
923
+ q && (q.amount = x.amount);
922
924
  },
923
925
  disableUnit: !0,
924
926
  rules: [
925
- h(Dt)(
926
- +h(ie)({ amount: 0, precision: 0 })
927
+ v(Dt)(
928
+ +v(ie)({ amount: 0, precision: 0 })
927
929
  ),
928
- h(qt)(+h(ie)(u.quantity))
930
+ v(qt)(+v(ie)(n.quantity))
929
931
  ],
930
932
  applyDefaultRules: !0
931
933
  });
932
934
  }
933
935
  }
934
936
  ],
935
- "row-data": _.items,
936
- "hide-footer": !0
937
- }, null, 8, ["column-defs", "row-data"])
937
+ "row-data": g.items,
938
+ "hide-footer": c.value
939
+ }, null, 8, ["column-defs", "row-data", "hide-footer"])
938
940
  ])
939
941
  ]),
940
- n("div", Ft, [
941
- I(y, {
942
+ a("div", Ft, [
943
+ I(b, {
942
944
  class: "px-16",
943
945
  label: "Confirm",
944
946
  size: "md",
945
947
  variant: "primary",
946
948
  type: "submit"
947
949
  }),
948
- I(y, {
950
+ I(b, {
949
951
  class: "px-16",
950
952
  label: "Cancel",
951
953
  size: "md",
952
954
  variant: "secondary",
953
- onClick: a[0] || (a[0] = () => t("update:show", !1))
955
+ onClick: s[0] || (s[0] = () => t("update:show", !1))
954
956
  })
955
957
  ])
956
958
  ]),
@@ -1029,18 +1031,18 @@ function Et() {
1029
1031
  ableToMarkReceived(e) {
1030
1032
  if (!e || e.status !== ue.enum.RECEIVING)
1031
1033
  return !1;
1032
- const _ = de().currentLocationDBName;
1033
- return `${e.supplier.internal}_${e.supplier._id}` !== _;
1034
+ const g = de().currentLocationDBName;
1035
+ return `${e.supplier.internal}_${e.supplier._id}` !== g;
1034
1036
  },
1035
1037
  ableToMarkApproved(e) {
1036
1038
  return !(!e || (e == null ? void 0 : e.status) !== ue.enum.REQUESTING);
1037
1039
  },
1038
1040
  ableToCreateFulfillment(e, i) {
1039
- var t, l;
1041
+ var t, c;
1040
1042
  if (!S.acceptRequireFulfillment || !e || !i || e.status !== ue.enum.PROCESSING || !i.processedAt)
1041
1043
  return !1;
1042
- const _ = (t = i == null ? void 0 : i.from) == null ? void 0 : t.dbName, d = (l = i == null ? void 0 : i.to) == null ? void 0 : l.dbName;
1043
- return !(_.startsWith("restaurant_") && d.startsWith("restaurant_"));
1044
+ const g = (t = i == null ? void 0 : i.from) == null ? void 0 : t.dbName, u = (c = i == null ? void 0 : i.to) == null ? void 0 : c.dbName;
1045
+ return !(g.startsWith("restaurant_") && u.startsWith("restaurant_"));
1044
1046
  }
1045
1047
  };
1046
1048
  }
@@ -1053,16 +1055,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1053
1055
  scope: {}
1054
1056
  },
1055
1057
  setup(S) {
1056
- const e = S, i = qe(), _ = Te(), d = Me(), t = M(!1);
1057
- Z(() => {
1058
- var g, f, c, u;
1059
- let a = !0;
1060
- i.isEnabled || (a = !1);
1058
+ const e = S, i = qe(), g = Te(), u = Me(), t = M(!1);
1059
+ Q(() => {
1060
+ var b, p, m, l;
1061
+ let o = !0;
1062
+ i.isEnabled || (o = !1);
1061
1063
  const s = e.purchaseOrder, y = e.poRequest;
1062
- return s && ((g = s == null ? void 0 : s.supplier) != null && g.internal ? (!y && s.status == ue.enum.DRAFT && (a = !1), y && !((f = y == null ? void 0 : y.netSuite) != null && f.id) && (a = !1), e.isTransferBetweenOutlets && (a = !1)) : ((s == null ? void 0 : s.status) !== ue.enum.REQUESTING && s.supplier.internal && (a = !1), !y && !((c = s == null ? void 0 : s.netSuite) != null && c.id) && (a = !1), !y && ((u = s == null ? void 0 : s.netSuite) != null && u.id) && (s == null ? void 0 : s.status) == ue.enum.REQUESTING && (a = !1))), a;
1064
+ return s && ((b = s == null ? void 0 : s.supplier) != null && b.internal ? (!y && s.status == ue.enum.DRAFT && (o = !1), y && !((p = y == null ? void 0 : y.netSuite) != null && p.id) && (o = !1), e.isTransferBetweenOutlets && (o = !1)) : ((s == null ? void 0 : s.status) !== ue.enum.REQUESTING && s.supplier.internal && (o = !1), !y && !((m = s == null ? void 0 : s.netSuite) != null && m.id) && (o = !1), !y && ((l = s == null ? void 0 : s.netSuite) != null && l.id) && (s == null ? void 0 : s.status) == ue.enum.REQUESTING && (o = !1))), o;
1063
1065
  });
1064
- async function l() {
1065
- t.value || d.open({
1066
+ async function c() {
1067
+ t.value || u.open({
1066
1068
  title: "Sync with NetSuite",
1067
1069
  contentComponent: A("div", [
1068
1070
  A("p", "Are you sure you want to sync now?"),
@@ -1080,20 +1082,20 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1080
1082
  },
1081
1083
  secondaryActions: { text: "Not now", close: !0 }
1082
1084
  }).onPrimary(async () => {
1083
- var a, s, y;
1085
+ var o, s, y;
1084
1086
  try {
1085
1087
  t.value = !0;
1086
- const g = ((a = e.purchaseOrder) == null ? void 0 : a._id) || ((s = e.poRequest) == null ? void 0 : s.purchaseOrderId) || "", f = (y = e.poRequest) == null ? void 0 : y.to.dbName;
1088
+ const b = ((o = e.purchaseOrder) == null ? void 0 : o._id) || ((s = e.poRequest) == null ? void 0 : s.purchaseOrderId) || "", p = (y = e.poRequest) == null ? void 0 : y.to.dbName;
1087
1089
  await i.syncPurchaseOrder(
1088
- g,
1089
- e.scope === "approval" ? f : void 0
1090
- ), _.open({
1090
+ b,
1091
+ e.scope === "approval" ? p : void 0
1092
+ ), g.open({
1091
1093
  title: "Sync with NetSuite",
1092
1094
  message: "Requested to sync with NetSuite. Please wait a moment.",
1093
1095
  type: "success"
1094
- }), await new Promise((c) => setTimeout(c, 5e3)), t.value = !1;
1096
+ }), await new Promise((m) => setTimeout(m, 5e3)), t.value = !1;
1095
1097
  } catch {
1096
- _.open({
1098
+ g.open({
1097
1099
  title: "Error",
1098
1100
  message: "Failed to sync with NetSuite",
1099
1101
  type: "error"
@@ -1101,15 +1103,15 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1101
1103
  }
1102
1104
  });
1103
1105
  }
1104
- return (a, s) => {
1105
- const y = K("FmButton");
1106
- return b(), N("div", Lt, [
1106
+ return (o, s) => {
1107
+ const y = z("FmButton");
1108
+ return h(), N("div", Lt, [
1107
1109
  I(y, {
1108
1110
  "prepend-icon": "sync",
1109
1111
  variant: "secondary",
1110
1112
  label: "Sync",
1111
1113
  loading: t.value,
1112
- onClick: l,
1114
+ onClick: c,
1113
1115
  "text-color": "primary",
1114
1116
  "bg-color": "transparent",
1115
1117
  "border-color": "primary"
@@ -1123,7 +1125,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1123
1125
  }, Mt = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-body-lg-600" }, Kt = {
1124
1126
  key: 0,
1125
1127
  class: "flex flex-col gap-4"
1126
- }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" }, Gt = { key: 0 }, Wt = { key: 1 }, Yt = {
1128
+ }, zt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ht = { class: "fm-typo-en-body-lg-600" }, Wt = { key: 0 }, Gt = { key: 1 }, Yt = {
1127
1129
  key: 1,
1128
1130
  class: "flex flex-col gap-4"
1129
1131
  }, Qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Xt = { class: "fm-typo-en-body-lg-600" }, Jt = { key: 0 }, Zt = { key: 1 }, er = {
@@ -1143,57 +1145,57 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1143
1145
  scope: {}
1144
1146
  },
1145
1147
  setup(S) {
1146
- const e = S, i = qe(), _ = $e(), d = M(e.poRequest);
1148
+ const e = S, i = qe(), g = $e(), u = M(e.poRequest);
1147
1149
  nt(async () => {
1148
1150
  var s;
1149
1151
  if (!e.poRequest && ((s = e.purchaseOrder) != null && s._id)) {
1150
- const y = await _.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1151
- d.value = y;
1152
+ const y = await g.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1153
+ u.value = y;
1152
1154
  }
1153
1155
  });
1154
- const t = Z(
1156
+ const t = Q(
1155
1157
  () => {
1156
- var s, y, g, f, c, u;
1158
+ var s, y, b, p, m, l;
1157
1159
  return i.getSubsidiaryFullName(
1158
- ((g = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : g.id) || ((u = (c = (f = e.poRequest) == null ? void 0 : f.netSuite) == null ? void 0 : c.subsidiary) == null ? void 0 : u.id)
1160
+ ((b = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : b.id) || ((l = (m = (p = e.poRequest) == null ? void 0 : p.netSuite) == null ? void 0 : m.subsidiary) == null ? void 0 : l.id)
1159
1161
  ).fullName;
1160
1162
  }
1161
- ), l = Z(() => {
1162
- var s, y, g, f, c, u, o, v, D, q, Y, C;
1163
- return (g = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.additionalInfo) != null && g.transactionnumber ? (u = (c = (f = e.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.additionalInfo) == null ? void 0 : u.transactionnumber : (D = (v = (o = d.value) == null ? void 0 : o.netSuite) == null ? void 0 : v.additionalInfo) != null && D.transactionnumber ? (C = (Y = (q = d.value) == null ? void 0 : q.netSuite) == null ? void 0 : Y.additionalInfo) == null ? void 0 : C.transactionnumber : null;
1164
- }), a = Z(() => {
1165
- var s, y, g, f, c, u;
1166
- return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((f = (g = e.purchaseOrder) == null ? void 0 : g.deliveryFullfillment) == null ? void 0 : f.length) > 0 ? (u = (c = e.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) == null ? void 0 : u.map((o) => {
1167
- var v;
1168
- return (v = o.netSuite) == null ? void 0 : v.refNo;
1163
+ ), c = Q(() => {
1164
+ var s, y, b, p, m, l, n, _, x, q, j, C;
1165
+ return (b = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.additionalInfo) != null && b.transactionnumber ? (l = (m = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : m.additionalInfo) == null ? void 0 : l.transactionnumber : (x = (_ = (n = u.value) == null ? void 0 : n.netSuite) == null ? void 0 : _.additionalInfo) != null && x.transactionnumber ? (C = (j = (q = u.value) == null ? void 0 : q.netSuite) == null ? void 0 : j.additionalInfo) == null ? void 0 : C.transactionnumber : null;
1166
+ }), o = Q(() => {
1167
+ var s, y, b, p, m, l;
1168
+ return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((p = (b = e.purchaseOrder) == null ? void 0 : b.deliveryFullfillment) == null ? void 0 : p.length) > 0 ? (l = (m = e.purchaseOrder) == null ? void 0 : m.deliveryFullfillment) == null ? void 0 : l.map((n) => {
1169
+ var _;
1170
+ return (_ = n.netSuite) == null ? void 0 : _.refNo;
1169
1171
  }).join(", ") : "N/A";
1170
1172
  });
1171
1173
  return (s, y) => {
1172
- var g, f, c, u, o, v, D, q, Y, C, F, j, H, le, oe, ye;
1173
- return h(i).isEnabled ? (b(), N("div", Vt, [
1174
- n("div", Mt, [
1175
- y[0] || (y[0] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1176
- n("div", jt, k(t.value || "N/A"), 1)
1174
+ var b, p, m, l, n, _, x, q, j, C, F, K, W, le, oe, ye;
1175
+ return v(i).isEnabled ? (h(), N("div", Vt, [
1176
+ a("div", Mt, [
1177
+ y[0] || (y[0] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1178
+ a("div", jt, k(t.value || "N/A"), 1)
1177
1179
  ]),
1178
- !s.isTransferBetweenOutlets && s.scope === h(Ue).RECEIVE_REQUEST ? (b(), N("div", Kt, [
1179
- n("div", zt, " NetSuite " + k((f = (g = s.purchaseOrder) == null ? void 0 : g.netSuite) != null && f.recordType ? h(rt)((u = (c = s.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : u.recordType) : s.transferType === h(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1180
- n("div", Ht, [
1181
- (v = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) != null && v.id ? (b(), N("span", Gt, k((q = (D = s.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : q.refNo) + " (" + k((C = (Y = s.purchaseOrder) == null ? void 0 : Y.netSuite) == null ? void 0 : C.id) + ") ", 1)) : (b(), N("span", Wt, "N/A"))
1180
+ !s.isTransferBetweenOutlets && s.scope === v(Ue).RECEIVE_REQUEST ? (h(), N("div", Kt, [
1181
+ a("div", zt, " NetSuite " + k((p = (b = s.purchaseOrder) == null ? void 0 : b.netSuite) != null && p.recordType ? v(rt)((l = (m = s.purchaseOrder) == null ? void 0 : m.netSuite) == null ? void 0 : l.recordType) : s.transferType === v(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1182
+ a("div", Ht, [
1183
+ (_ = (n = s.purchaseOrder) == null ? void 0 : n.netSuite) != null && _.id ? (h(), N("span", Wt, k((q = (x = s.purchaseOrder) == null ? void 0 : x.netSuite) == null ? void 0 : q.refNo) + " (" + k((C = (j = s.purchaseOrder) == null ? void 0 : j.netSuite) == null ? void 0 : C.id) + ") ", 1)) : (h(), N("span", Gt, "N/A"))
1182
1184
  ])
1183
1185
  ])) : V("", !0),
1184
- !s.isTransferBetweenOutlets && d.value || s.scope === h(Ue).APPROVAL ? (b(), N("div", Yt, [
1185
- n("div", Qt, " (Request) NetSuite " + k(s.transferType === h(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1186
- n("div", Xt, [
1187
- (j = (F = d.value) == null ? void 0 : F.netSuite) != null && j.id ? (b(), N("span", Jt, k((le = (H = d.value) == null ? void 0 : H.netSuite) == null ? void 0 : le.refNo) + " (" + k((ye = (oe = d.value) == null ? void 0 : oe.netSuite) == null ? void 0 : ye.id) + ") ", 1)) : (b(), N("span", Zt, "N/A"))
1186
+ !s.isTransferBetweenOutlets && u.value || s.scope === v(Ue).APPROVAL ? (h(), N("div", Yt, [
1187
+ a("div", Qt, " (Request) NetSuite " + k(s.transferType === v(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1188
+ a("div", Xt, [
1189
+ (K = (F = u.value) == null ? void 0 : F.netSuite) != null && K.id ? (h(), N("span", Jt, k((le = (W = u.value) == null ? void 0 : W.netSuite) == null ? void 0 : le.refNo) + " (" + k((ye = (oe = u.value) == null ? void 0 : oe.netSuite) == null ? void 0 : ye.id) + ") ", 1)) : (h(), N("span", Zt, "N/A"))
1188
1190
  ])
1189
1191
  ])) : V("", !0),
1190
- l.value ? (b(), N("div", er, [
1191
- y[1] || (y[1] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1192
- n("div", tr, k(l.value), 1)
1192
+ c.value ? (h(), N("div", er, [
1193
+ y[1] || (y[1] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1194
+ a("div", tr, k(c.value), 1)
1193
1195
  ])) : V("", !0),
1194
- h(i).isEnabled && s.transferType === h(fe).TRANSFER && !s.isTransferBetweenOutlets ? (b(), N("div", rr, [
1195
- y[2] || (y[2] = n("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1196
- n("div", sr, k(a.value), 1)
1196
+ v(i).isEnabled && s.transferType === v(fe).TRANSFER && !s.isTransferBetweenOutlets ? (h(), N("div", rr, [
1197
+ y[2] || (y[2] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1198
+ a("div", sr, k(o.value), 1)
1197
1199
  ])) : V("", !0)
1198
1200
  ])) : V("", !0);
1199
1201
  };
@@ -1206,36 +1208,36 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1206
1208
  },
1207
1209
  setup(S) {
1208
1210
  const e = Te(), i = st();
1209
- async function _(d, t) {
1210
- const l = [];
1211
- if (d && l.push(`body.message:*${d}*`), t) {
1212
- const g = t.replace(/:/g, "\\:");
1213
- l.push(`${g}`);
1211
+ async function g(u, t) {
1212
+ const c = [];
1213
+ if (u && c.push(`body.message:*${u}*`), t) {
1214
+ const b = t.replace(/:/g, "\\:");
1215
+ c.push(`${b}`);
1214
1216
  }
1215
- if (l.length === 0) {
1217
+ if (c.length === 0) {
1216
1218
  e.open({
1217
1219
  message: "Cannot open logs without valid filters.",
1218
1220
  type: "error"
1219
1221
  });
1220
1222
  return;
1221
1223
  }
1222
- const s = `attributes.pod:netsuite* AND (${l.join(" OR ")})`, { url: y } = await i.getLogs(s);
1224
+ const s = `attributes.pod:netsuite* AND (${c.join(" OR ")})`, { url: y } = await i.getLogs(s);
1223
1225
  e.open(
1224
1226
  {
1225
1227
  message: "Opening NetSuite logs...",
1226
1228
  type: "info"
1227
1229
  },
1228
1230
  800
1229
- ), await new Promise((g) => setTimeout(g, 800)), window.open(y, "_blank");
1231
+ ), await new Promise((b) => setTimeout(b, 800)), window.open(y, "_blank");
1230
1232
  }
1231
- return (d, t) => {
1232
- const l = K("FmButton");
1233
- return b(), N("div", ar, [
1234
- I(l, {
1233
+ return (u, t) => {
1234
+ const c = z("FmButton");
1235
+ return h(), N("div", ar, [
1236
+ I(c, {
1235
1237
  "prepend-icon": "history",
1236
1238
  variant: "secondary",
1237
1239
  label: "Logs",
1238
- onClick: t[0] || (t[0] = (a) => _(d.netsuiteId, d.purchaseOrderId)),
1240
+ onClick: t[0] || (t[0] = (o) => g(u.netsuiteId, u.purchaseOrderId)),
1239
1241
  "text-color": "primary",
1240
1242
  "bg-color": "transparent",
1241
1243
  "border-color": "primary"
@@ -1253,67 +1255,67 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1253
1255
  purchaseOrderId: {}
1254
1256
  },
1255
1257
  setup(S) {
1256
- const e = S, i = st(), _ = M(!1), d = de(), t = M(!0), l = M(!1), a = M(null);
1258
+ const e = S, i = st(), g = M(!1), u = de(), t = M(!0), c = M(!1), o = M(null);
1257
1259
  async function s() {
1258
- if (!a.value) {
1259
- _.value = !0;
1260
+ if (!o.value) {
1261
+ g.value = !0;
1260
1262
  try {
1261
1263
  t.value = !0;
1262
1264
  const y = await i.getMoreInfo(
1263
- d.currentLocation.dbName,
1265
+ u.currentLocation.dbName,
1264
1266
  e.purchaseOrderId
1265
1267
  );
1266
- a.value = y, l.value = !1;
1268
+ o.value = y, c.value = !1;
1267
1269
  } catch {
1268
- l.value = !0;
1270
+ c.value = !0;
1269
1271
  } finally {
1270
1272
  t.value = !1;
1271
1273
  }
1272
1274
  }
1273
1275
  }
1274
- return (y, g) => {
1275
- const f = K("FmButton"), c = K("FmLabel"), u = K("FmDialog");
1276
- return b(), N("div", ir, [
1277
- I(u, {
1278
- modelValue: _.value,
1279
- "onUpdate:modelValue": g[2] || (g[2] = (o) => _.value = o),
1276
+ return (y, b) => {
1277
+ const p = z("FmButton"), m = z("FmLabel"), l = z("FmDialog");
1278
+ return h(), N("div", ir, [
1279
+ I(l, {
1280
+ modelValue: g.value,
1281
+ "onUpdate:modelValue": b[2] || (b[2] = (n) => g.value = n),
1280
1282
  overlay: !0
1281
1283
  }, {
1282
1284
  "dialog-button": se(() => [
1283
- I(f, {
1285
+ I(p, {
1284
1286
  "prepend-icon": "info",
1285
1287
  variant: "secondary",
1286
1288
  label: "Latest Info",
1287
- onClick: g[0] || (g[0] = (o) => s()),
1289
+ onClick: b[0] || (b[0] = (n) => s()),
1288
1290
  "text-color": "primary",
1289
1291
  "bg-color": "transparent",
1290
1292
  "border-color": "primary"
1291
1293
  })
1292
1294
  ]),
1293
- "dialog-header": se(() => g[3] || (g[3] = [
1294
- n("div", null, "NetSuite latest info", -1)
1295
+ "dialog-header": se(() => b[3] || (b[3] = [
1296
+ a("div", null, "NetSuite latest info", -1)
1295
1297
  ])),
1296
1298
  "dialog-footer": se(() => [
1297
- I(f, {
1299
+ I(p, {
1298
1300
  class: "ml-auto sm:w-full xs:w-full",
1299
1301
  label: "Close",
1300
1302
  size: "md",
1301
1303
  variant: "primary",
1302
- onClick: g[1] || (g[1] = (o) => _.value = !1)
1304
+ onClick: b[1] || (b[1] = (n) => g.value = !1)
1303
1305
  })
1304
1306
  ]),
1305
1307
  default: se(() => [
1306
- t.value ? (b(), N("div", lr, "Loading...")) : (b(), N("div", cr, [
1307
- l.value ? (b(), N("p", fr, "Something went wrong.")) : (b(!0), N(te, { key: 0 }, me(a.value, (o, v) => (b(), N("div", {
1308
- key: v,
1308
+ t.value ? (h(), N("div", lr, "Loading...")) : (h(), N("div", cr, [
1309
+ c.value ? (h(), N("p", fr, "Something went wrong.")) : (h(!0), N(te, { key: 0 }, me(o.value, (n, _) => (h(), N("div", {
1310
+ key: _,
1309
1311
  class: "mb-2"
1310
1312
  }, [
1311
- n("div", null, [
1312
- I(c, {
1313
- label: h(Ve)(v)
1313
+ a("div", null, [
1314
+ I(m, {
1315
+ label: v(Ve)(_)
1314
1316
  }, null, 8, ["label"]),
1315
- n("div", ur, [
1316
- Array.isArray(o) ? (b(), N("span", dr, k(o.length > 0 ? o.join(", ") : "N/A"), 1)) : (b(), N("span", mr, k(o), 1))
1317
+ a("div", ur, [
1318
+ Array.isArray(n) ? (h(), N("span", dr, k(n.length > 0 ? n.join(", ") : "N/A"), 1)) : (h(), N("span", mr, k(n), 1))
1317
1319
  ])
1318
1320
  ])
1319
1321
  ]))), 128))
@@ -1337,45 +1339,45 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1337
1339
  scope: {}
1338
1340
  },
1339
1341
  setup(S) {
1340
- const e = S, i = Tt(), _ = Ae(), d = Z(() => {
1341
- var s, y, g, f, c, u, o;
1342
- const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((g = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : g.internal) === "restaurant", l = e.transferType === fe.PURCHASE, a = e.transferType === fe.TRANSFER;
1343
- return l || a && !t || ((c = (f = e.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.id) || ((o = (u = e.poRequest) == null ? void 0 : u.netSuite) == null ? void 0 : o.id);
1342
+ const e = S, i = Tt(), g = Ae(), u = Q(() => {
1343
+ var s, y, b, p, m, l, n;
1344
+ const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((b = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : b.internal) === "restaurant", c = e.transferType === fe.PURCHASE, o = e.transferType === fe.TRANSFER;
1345
+ return c || o && !t || ((m = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : m.id) || ((n = (l = e.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : n.id);
1344
1346
  });
1345
- return (t, l) => {
1346
- var s, y, g, f, c, u, o, v, D, q;
1347
- const a = K("FmMenuDivider");
1348
- return h(i).isNetSuiteEnabled && d.value ? (b(), N("div", yr, [
1349
- n("div", vr, [
1350
- l[0] || (l[0] = n("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1351
- n("div", hr, [
1352
- n("div", br, [
1353
- (s = h(_).sessionUser.value) != null && s.role.isAdmin && ((g = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && g.id) ? (b(), ae(pr, {
1347
+ return (t, c) => {
1348
+ var s, y, b, p, m, l, n, _, x, q;
1349
+ const o = z("FmMenuDivider");
1350
+ return v(i).isNetSuiteEnabled && u.value ? (h(), N("div", yr, [
1351
+ a("div", vr, [
1352
+ c[0] || (c[0] = a("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1353
+ a("div", hr, [
1354
+ a("div", br, [
1355
+ (s = v(g).sessionUser.value) != null && s.role.isAdmin && ((b = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && b.id) ? (h(), ae(pr, {
1354
1356
  key: 0,
1355
- "netsuite-id": (c = (f = t.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.id,
1356
- "purchase-order-id": (u = t.purchaseOrder) == null ? void 0 : u._id
1357
+ "netsuite-id": (m = (p = t.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : m.id,
1358
+ "purchase-order-id": (l = t.purchaseOrder) == null ? void 0 : l._id
1357
1359
  }, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
1358
- (o = h(_).sessionUser.value) != null && o.role.isAdmin ? (b(), ae(or, {
1360
+ (n = v(g).sessionUser.value) != null && n.role.isAdmin ? (h(), ae(or, {
1359
1361
  key: 1,
1360
- "netsuite-id": (D = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.id,
1362
+ "netsuite-id": (x = (_ = t.purchaseOrder) == null ? void 0 : _.netSuite) == null ? void 0 : x.id,
1361
1363
  "purchase-order-id": (q = t.purchaseOrder) == null ? void 0 : q._id
1362
1364
  }, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
1363
1365
  I(Ut, {
1364
1366
  "po-request": t.poRequest,
1365
1367
  "purchase-order": t.purchaseOrder,
1366
- "is-transfer-between-outlets": !d.value,
1368
+ "is-transfer-between-outlets": !u.value,
1367
1369
  scope: t.scope
1368
1370
  }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
1369
1371
  ])
1370
1372
  ])
1371
1373
  ]),
1372
- I(a),
1374
+ I(o),
1373
1375
  I(nr, {
1374
1376
  "po-request": t.poRequest,
1375
1377
  "purchase-order": t.purchaseOrder,
1376
1378
  "transfer-type": t.transferType,
1377
1379
  "transfer-to-db-name": t.transferToDbName,
1378
- "is-transfer-between-outlets": !d.value,
1380
+ "is-transfer-between-outlets": !u.value,
1379
1381
  scope: t.scope
1380
1382
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
1381
1383
  ])) : V("", !0);
@@ -1396,7 +1398,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1396
1398
  }, Vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mr = { class: "fm-typo-en-body-lg-600" }, jr = {
1397
1399
  key: 4,
1398
1400
  class: "flex flex-col gap-4"
1399
- }, Kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-lg-600" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Gr = { class: "flex flex-col gap-8" }, Wr = { class: "flex gap-8 items-center" }, Yr = { class: "flex-1 fm-typo-en-body-lg-600" }, Qr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Xr = { class: "flex w-full gap-4" }, Jr = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Zr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, es = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, ts = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, rs = {
1401
+ }, Kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, zr = { class: "fm-typo-en-body-lg-600" }, Hr = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Wr = { class: "flex flex-col gap-8" }, Gr = { class: "flex gap-8 items-center" }, Yr = { class: "flex-1 fm-typo-en-body-lg-600" }, Qr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Xr = { class: "flex w-full gap-4" }, Jr = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Zr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, es = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, ts = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, rs = {
1400
1402
  key: 0,
1401
1403
  class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1402
1404
  }, ss = { class: "py-8" }, ns = { class: "flex justify-end gap-4 items-center" }, as = { class: "fm-typo-en-body-lg-600" }, os = {
@@ -1434,31 +1436,31 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1434
1436
  },
1435
1437
  emits: ["update:show", "submitted"],
1436
1438
  setup(S, { emit: e }) {
1437
- const i = S, _ = e, d = Me(), t = Te(), l = De(), a = de(), s = Ae(), y = Z(
1439
+ const i = S, g = e, u = Me(), t = Te(), c = De(), o = de(), s = Ae(), y = Q(
1438
1440
  () => {
1439
- var r, m;
1441
+ var r, d;
1440
1442
  return {
1441
1443
  id: ((r = s.sessionUser.value) == null ? void 0 : r.id) ?? "",
1442
- name: ((m = s.sessionUser.value) == null ? void 0 : m.displayName) ?? ""
1444
+ name: ((d = s.sessionUser.value) == null ? void 0 : d.displayName) ?? ""
1443
1445
  };
1444
1446
  }
1445
- ), g = Et(), { t: f } = at(), c = Z(
1447
+ ), b = Et(), { t: p } = at(), m = Q(
1446
1448
  () => {
1447
- var r, m, R, w;
1448
- return ((m = (r = i.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : m.internal) === "restaurant" || ((w = (R = i.purchaseOrder) == null ? void 0 : R.supplier) == null ? void 0 : w.internal) === "warehouse" ? fe.TRANSFER : fe.PURCHASE;
1449
+ var r, d, R, w;
1450
+ return ((d = (r = i.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : d.internal) === "restaurant" || ((w = (R = i.purchaseOrder) == null ? void 0 : R.supplier) == null ? void 0 : w.internal) === "warehouse" ? fe.TRANSFER : fe.PURCHASE;
1449
1451
  }
1450
- ), u = M(!1), o = M(""), v = M(!0), D = $e(), q = At(D.getWorkflowConfig), Y = it(), C = Z(() => {
1452
+ ), l = M(!1), n = M(""), _ = M(!0), x = $e(), q = At(x.getWorkflowConfig), j = it(), C = Q(() => {
1451
1453
  if (!i.purchaseOrder)
1452
1454
  return [];
1453
1455
  const r = q.result.value;
1454
1456
  if (r.state === Ze.loading)
1455
1457
  return [];
1456
- const m = {
1458
+ const d = {
1457
1459
  user: y.value,
1458
- executedAt: a.locations.computeFirst(
1460
+ executedAt: o.locations.computeFirst(
1459
1461
  (w) => {
1460
1462
  var T;
1461
- return w.dbName === ((T = a._currentLocation) == null ? void 0 : T.dbName) ? w : null;
1463
+ return w.dbName === ((T = o._currentLocation) == null ? void 0 : T.dbName) ? w : null;
1462
1464
  }
1463
1465
  ),
1464
1466
  purchaseOrderRequest: i.poRequest,
@@ -1467,7 +1469,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1467
1469
  let R = [];
1468
1470
  try {
1469
1471
  r.state === Ze.error ? (console.error("Error fetching workflow config:", r.error), R = Pe.getAvailableActions({
1470
- ...m,
1472
+ ...d,
1471
1473
  orderConfig: Pe.getDefaultConfig()
1472
1474
  }).actions.filter(
1473
1475
  (w) => (
@@ -1476,7 +1478,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1476
1478
  w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
1477
1479
  )
1478
1480
  )) : R = Pe.getAvailableActions({
1479
- ...m,
1481
+ ...d,
1480
1482
  orderConfig: r.data
1481
1483
  }).actions.filter(
1482
1484
  (w) => w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
@@ -1485,94 +1487,94 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1485
1487
  console.error("Error getting available actions:", w);
1486
1488
  }
1487
1489
  return i.scope === "approval" && (R = R.filter((w) => w !== O.enum.completeReceive)), R;
1488
- }), F = kt(i, "show"), j = Z(() => [
1490
+ }), F = kt(i, "show"), K = Q(() => [
1489
1491
  {
1490
- label: f("inventory.transfer.receiveRequest.details.overview"),
1492
+ label: p("inventory.transfer.receiveRequest.details.overview"),
1491
1493
  value: "overview"
1492
1494
  },
1493
1495
  {
1494
- label: f("inventory.transfer.receiveRequest.details.deliveryHistory"),
1496
+ label: p("inventory.transfer.receiveRequest.details.deliveryHistory"),
1495
1497
  value: "deliveryHistory"
1496
1498
  }
1497
- ]), H = M(j.value[0]);
1499
+ ]), W = M(K.value[0]);
1498
1500
  bt(
1499
1501
  () => i.show,
1500
1502
  (r) => {
1501
- r && (H.value = j.value[0]);
1503
+ r && (W.value = K.value[0]);
1502
1504
  }
1503
1505
  );
1504
- async function le(r, m, R, w, T) {
1505
- return new Promise((G, Q) => {
1506
- d.open({
1506
+ async function le(r, d, R, w, T) {
1507
+ return new Promise((G, X) => {
1508
+ u.open({
1507
1509
  closeButton: !1,
1508
1510
  title: w.title,
1509
1511
  message: w.message,
1510
1512
  primaryActions: w.primaryActions,
1511
1513
  secondaryActions: { text: "No", close: !1 }
1512
1514
  }).onPrimary(async () => {
1513
- var $, B, z, E;
1514
- const p = [];
1515
- R === O.enum.approveRequest ? (p.push({
1515
+ var $, B, H, E;
1516
+ const f = [];
1517
+ R === O.enum.approveRequest ? (f.push({
1516
1518
  action: "approveRequest",
1517
1519
  payload: null
1518
- }), m.fulfillment && p.push({
1520
+ }), d.fulfillment && f.push({
1519
1521
  action: "processRequest",
1520
1522
  payload: {
1521
1523
  fulfillmentId: "",
1522
1524
  deliveryOrderNumber: "",
1523
1525
  deliveryRemark: null,
1524
- items: m.fulfillment.items,
1526
+ items: d.fulfillment.items,
1525
1527
  createdBy: y.value
1526
1528
  }
1527
- })) : R === O.enum.processRequest ? m.fulfillment && p.push({
1529
+ })) : R === O.enum.processRequest ? d.fulfillment && f.push({
1528
1530
  action: "processRequest",
1529
1531
  payload: {
1530
1532
  fulfillmentId: "",
1531
1533
  deliveryOrderNumber: "",
1532
1534
  deliveryRemark: null,
1533
- items: m.fulfillment.items,
1535
+ items: d.fulfillment.items,
1534
1536
  createdBy: y.value
1535
1537
  }
1536
- }) : R === O.enum.rejectRequest ? p.push({
1538
+ }) : R === O.enum.rejectRequest ? f.push({
1537
1539
  action: "rejectRequest",
1538
1540
  payload: null
1539
- }) : R === O.enum.closeRequest && p.push({
1541
+ }) : R === O.enum.closeRequest && f.push({
1540
1542
  action: "closeRequest",
1541
1543
  payload: null
1542
1544
  });
1543
1545
  try {
1544
- await Y({
1546
+ await j({
1545
1547
  operate: {
1546
1548
  operation: R,
1547
1549
  doc: r,
1548
- options: m
1550
+ options: d
1549
1551
  },
1550
1552
  operateV2: {
1551
1553
  _id: (($ = i.purchaseOrder) == null ? void 0 : $._id) ?? "",
1552
1554
  _rev: ((B = i.purchaseOrder) == null ? void 0 : B._rev) ?? "",
1553
1555
  action: R,
1554
- payloads: p
1556
+ payloads: f
1555
1557
  // add payload if action is receiveStock or processRequest
1556
1558
  },
1557
- transferTo: (E = (z = i.poRequest) == null ? void 0 : z.to) == null ? void 0 : E.dbName
1559
+ transferTo: (E = (H = i.poRequest) == null ? void 0 : H.to) == null ? void 0 : E.dbName
1558
1560
  }).delayed(1e3), G("submitted");
1559
- } catch (X) {
1560
- Q(X);
1561
+ } catch (J) {
1562
+ X(J);
1561
1563
  }
1562
1564
  }).onSecondary(() => {
1563
1565
  G("cancelled");
1564
- for (let p = 0; p < T + 2; p++)
1565
- d.close();
1566
+ for (let f = 0; f < T + 2; f++)
1567
+ u.close();
1566
1568
  }).onClose(() => {
1567
1569
  });
1568
1570
  });
1569
1571
  }
1570
1572
  async function oe(r) {
1571
- var w, T, G, Q;
1573
+ var w, T, G, X;
1572
1574
  if (r === O.enum.receiveStock)
1573
1575
  return;
1574
- const m = ot[r];
1575
- if (!m) {
1576
+ const d = ot[r];
1577
+ if (!d) {
1576
1578
  t.open({
1577
1579
  title: "Something went wrong",
1578
1580
  message: `Cannot process order: ${Ve(r)}`,
@@ -1580,46 +1582,46 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1580
1582
  });
1581
1583
  return;
1582
1584
  }
1583
- const { successMessage: R } = m;
1585
+ const { successMessage: R } = d;
1584
1586
  if (i.purchaseOrder) {
1585
- o.value = `${r}`, u.value = !0, v.value = !1;
1586
- const p = {};
1587
+ n.value = `${r}`, l.value = !0, _.value = !1;
1588
+ const f = {};
1587
1589
  let $ = 0;
1588
1590
  if ((r === O.enum.confirmDraft || // auto receive for warehouse to warehouse
1589
- r === O.enum.completeReceive) && l.autoReceiveWarehouse)
1590
- p.autoReceive = !0;
1591
- else if ((r === O.enum.approveRequest || r === O.enum.processRequest) && l.acceptRequireFulfillment) {
1592
- const B = (T = (w = i.poRequest) == null ? void 0 : w.from) == null ? void 0 : T.dbName, z = (Q = (G = i.poRequest) == null ? void 0 : G.to) == null ? void 0 : Q.dbName;
1593
- if (B && z && (B.startsWith("warehouse_") || z.startsWith("warehouse_"))) {
1594
- const E = await new Promise((X, L) => {
1595
- d.open({
1591
+ r === O.enum.completeReceive) && c.autoReceiveWarehouse)
1592
+ f.autoReceive = !0;
1593
+ else if ((r === O.enum.approveRequest || r === O.enum.processRequest) && c.acceptRequireFulfillment) {
1594
+ const B = (T = (w = i.poRequest) == null ? void 0 : w.from) == null ? void 0 : T.dbName, H = (X = (G = i.poRequest) == null ? void 0 : G.to) == null ? void 0 : X.dbName;
1595
+ if (B && H && (B.startsWith("warehouse_") || H.startsWith("warehouse_"))) {
1596
+ const E = await new Promise((J, L) => {
1597
+ u.open({
1596
1598
  closeButton: !1,
1597
1599
  title: "Confirm transfer amount",
1598
1600
  dialogComponent: Bt,
1599
1601
  dialogComponentProps: {
1600
1602
  purchaseOrder: i.purchaseOrder,
1601
- confirm: X,
1603
+ confirm: J,
1602
1604
  "onUpdate:show": (ne) => {
1603
- ne || (o.value = "", u.value = !1, v.value = !0, $++, d.close()), L("cancelled");
1605
+ ne || (n.value = "", l.value = !1, _.value = !0, $++, u.close()), L("cancelled");
1604
1606
  }
1605
1607
  }
1606
1608
  });
1607
1609
  });
1608
- p.fulfillment = E;
1610
+ f.fulfillment = E;
1609
1611
  }
1610
1612
  }
1611
1613
  try {
1612
1614
  await le(
1613
1615
  i.purchaseOrder,
1614
- p,
1616
+ f,
1615
1617
  r,
1616
- m,
1618
+ d,
1617
1619
  $
1618
1620
  ) === "submitted" && (t.open({
1619
1621
  title: "Success",
1620
1622
  message: R,
1621
1623
  type: "success"
1622
- }), _("update:show", !1), _("submitted"));
1624
+ }), g("update:show", !1), g("submitted"));
1623
1625
  } catch (B) {
1624
1626
  t.open({
1625
1627
  title: "Something went wrong",
@@ -1627,86 +1629,86 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1627
1629
  type: "error"
1628
1630
  }), console.error("Error when submitting PO operation", r, i.purchaseOrder, B);
1629
1631
  } finally {
1630
- o.value = "", u.value = !1, v.value = !0;
1632
+ n.value = "", l.value = !1, _.value = !0;
1631
1633
  }
1632
1634
  }
1633
1635
  }
1634
- const ye = Z(() => {
1635
- var r, m;
1636
- return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((m = i.purchaseOrder) == null ? void 0 : m.status) === ue.enum.COMPLETE;
1637
- }), Ce = Z(() => {
1638
- var G, Q, p;
1636
+ const ye = Q(() => {
1637
+ var r, d;
1638
+ return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((d = i.purchaseOrder) == null ? void 0 : d.status) === ue.enum.COMPLETE;
1639
+ }), Ce = Q(() => {
1640
+ var G, X, f;
1639
1641
  const R = (((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? []).flatMap(($) => $.received ?? []).reduce(
1640
1642
  ($, B) => {
1641
- const z = $[B.sku._id] ?? [];
1642
- return $[B.sku._id] = [...z, B], $;
1643
+ const H = $[B.sku._id] ?? [];
1644
+ return $[B.sku._id] = [...H, B], $;
1643
1645
  },
1644
1646
  {}
1645
1647
  ), w = Object.entries(R).reduce(
1646
- ($, [B, z]) => {
1647
- const E = z.reduce((X, L) => {
1648
+ ($, [B, H]) => {
1649
+ const E = H.reduce((J, L) => {
1648
1650
  const ne = yt(
1649
- X,
1650
- Math.max(X.precision, L.amount.precision)
1651
+ J,
1652
+ Math.max(J.precision, L.amount.precision)
1651
1653
  );
1652
1654
  return Le(ne, L.amount);
1653
1655
  }, ke(0));
1654
1656
  return $[B] = E, $;
1655
1657
  },
1656
1658
  {}
1657
- ), T = ((Q = i.purchaseOrder) == null ? void 0 : Q.items) ?? [];
1659
+ ), T = ((X = i.purchaseOrder) == null ? void 0 : X.items) ?? [];
1658
1660
  for (const $ of T)
1659
- w[p = $.sku._id] ?? (w[p] = ke(0));
1661
+ w[f = $.sku._id] ?? (w[f] = ke(0));
1660
1662
  return w;
1661
- }), ce = Z(() => {
1662
- var G, Q;
1663
- const r = ((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [], m = ((Q = i.purchaseOrder) == null ? void 0 : Q.deliveryFullfillment) ?? [], R = [
1664
- ...r.map((p) => ({
1665
- createdAt: p.createdAt,
1663
+ }), ce = Q(() => {
1664
+ var G, X;
1665
+ const r = ((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [], d = ((X = i.purchaseOrder) == null ? void 0 : X.deliveryFullfillment) ?? [], R = [
1666
+ ...r.map((f) => ({
1667
+ createdAt: f.createdAt,
1666
1668
  type: "grn",
1667
- doc: p
1669
+ doc: f
1668
1670
  })),
1669
- ...m.map((p) => ({
1670
- createdAt: p.createdAt,
1671
+ ...d.map((f) => ({
1672
+ createdAt: f.createdAt,
1671
1673
  type: "fulfillment",
1672
- doc: p
1674
+ doc: f
1673
1675
  }))
1674
1676
  ];
1675
- R.reverse().sort((p, $) => p.createdAt.localeCompare($.createdAt));
1676
- function w(p) {
1677
- var z, E, X, L, ne, ge, _e, Se, U;
1678
- const $ = m.findIndex((P) => P.id === p.fullfillmentId), B = [
1679
- (E = (z = m[$]) == null ? void 0 : z.netSuite) != null && E.refNo ? {
1677
+ R.reverse().sort((f, $) => f.createdAt.localeCompare($.createdAt));
1678
+ function w(f) {
1679
+ var H, E, J, L, ne, ge, _e, Se, U;
1680
+ const $ = d.findIndex((P) => P.id === f.fullfillmentId), B = [
1681
+ (E = (H = d[$]) == null ? void 0 : H.netSuite) != null && E.refNo ? {
1680
1682
  label: "Fulfillment's ref no. (Netsuite)",
1681
- values: [(L = (X = m[$]) == null ? void 0 : X.netSuite) == null ? void 0 : L.refNo]
1683
+ values: [(L = (J = d[$]) == null ? void 0 : J.netSuite) == null ? void 0 : L.refNo]
1682
1684
  } : null,
1683
- (ne = p == null ? void 0 : p.netSuite) != null && ne.refNo ? {
1685
+ (ne = f == null ? void 0 : f.netSuite) != null && ne.refNo ? {
1684
1686
  label: "Netsuite ref no.",
1685
- values: [(ge = p == null ? void 0 : p.netSuite) == null ? void 0 : ge.refNo]
1687
+ values: [(ge = f == null ? void 0 : f.netSuite) == null ? void 0 : ge.refNo]
1686
1688
  } : null,
1687
- (_e = p == null ? void 0 : p.netSuite) != null && _e.recordType ? {
1689
+ (_e = f == null ? void 0 : f.netSuite) != null && _e.recordType ? {
1688
1690
  label: "Netsuite Type",
1689
- values: [rt((Se = p == null ? void 0 : p.netSuite) == null ? void 0 : Se.recordType)]
1691
+ values: [rt((Se = f == null ? void 0 : f.netSuite) == null ? void 0 : Se.recordType)]
1690
1692
  } : null
1691
1693
  ];
1692
1694
  return {
1693
1695
  header: "Received",
1694
- date: Ie(new Date(p.createdAt)),
1696
+ date: Ie(new Date(f.createdAt)),
1695
1697
  info: [
1696
1698
  {
1697
1699
  label: "Adjustment date",
1698
1700
  values: [
1699
- p.adjustment ? Ie(new Date(vt(p.adjustment))) : "-"
1701
+ f.adjustment ? Ie(new Date(vt(f.adjustment))) : "-"
1700
1702
  ]
1701
1703
  },
1702
1704
  {
1703
1705
  label: "Received by",
1704
- values: [(U = p.createdBy) == null ? void 0 : U.name]
1706
+ values: [(U = f.createdBy) == null ? void 0 : U.name]
1705
1707
  },
1706
1708
  {
1707
1709
  label: "Received items",
1708
- values: p.received.map((P) => {
1709
- var W;
1710
+ values: f.received.map((P) => {
1711
+ var Y;
1710
1712
  return A("div", [
1711
1713
  A(
1712
1714
  "div",
@@ -1760,7 +1762,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1760
1762
  {
1761
1763
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1762
1764
  },
1763
- ((W = P.measurement) == null ? void 0 : W.abbrev) ?? P.sku.unit.abbrev
1765
+ ((Y = P.measurement) == null ? void 0 : Y.abbrev) ?? P.sku.unit.abbrev
1764
1766
  )
1765
1767
  ]
1766
1768
  ),
@@ -1778,13 +1780,13 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1778
1780
  ]);
1779
1781
  })
1780
1782
  },
1781
- p.deliveryOrderNumber ? {
1783
+ f.deliveryOrderNumber ? {
1782
1784
  label: "Delivery order no.",
1783
- values: [p.deliveryOrderNumber]
1785
+ values: [f.deliveryOrderNumber]
1784
1786
  } : null,
1785
- p.remark ? {
1787
+ f.remark ? {
1786
1788
  label: "Remark",
1787
- values: [p.remark]
1789
+ values: [f.remark]
1788
1790
  } : null,
1789
1791
  $ > -1 ? {
1790
1792
  label: "Fulfilment's sequence",
@@ -1794,12 +1796,12 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1794
1796
  ].filter((P) => P)
1795
1797
  };
1796
1798
  }
1797
- function T(p) {
1798
- var B, z;
1799
- const $ = m.findIndex((E) => E.id === p.id);
1799
+ function T(f) {
1800
+ var B, H;
1801
+ const $ = d.findIndex((E) => E.id === f.id);
1800
1802
  return {
1801
1803
  header: "Fulfillment",
1802
- date: Ie(new Date(p.createdAt)),
1804
+ date: Ie(new Date(f.createdAt)),
1803
1805
  info: [
1804
1806
  {
1805
1807
  label: "Sequence",
@@ -1807,8 +1809,8 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1807
1809
  },
1808
1810
  {
1809
1811
  label: "Receiveable items",
1810
- values: p.items.map((E) => {
1811
- var X;
1812
+ values: f.items.map((E) => {
1813
+ var J;
1812
1814
  return A("div", [
1813
1815
  A(
1814
1816
  "div",
@@ -1862,7 +1864,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1862
1864
  {
1863
1865
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1864
1866
  },
1865
- ((X = E.measurement) == null ? void 0 : X.abbrev) ?? E.sku.unit.abbrev
1867
+ ((J = E.measurement) == null ? void 0 : J.abbrev) ?? E.sku.unit.abbrev
1866
1868
  )
1867
1869
  ]
1868
1870
  ),
@@ -1880,106 +1882,106 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1880
1882
  ]);
1881
1883
  })
1882
1884
  },
1883
- (B = p.netSuite) != null && B.refNo ? {
1885
+ (B = f.netSuite) != null && B.refNo ? {
1884
1886
  label: "Ref no. (Netsuite)",
1885
- values: [(z = p.netSuite) == null ? void 0 : z.refNo]
1887
+ values: [(H = f.netSuite) == null ? void 0 : H.refNo]
1886
1888
  } : null
1887
1889
  ].filter((E) => E)
1888
1890
  };
1889
1891
  }
1890
- return R.map((p) => {
1891
- switch (p.type) {
1892
+ return R.map((f) => {
1893
+ switch (f.type) {
1892
1894
  case "grn":
1893
- return w(p.doc);
1895
+ return w(f.doc);
1894
1896
  case "fulfillment":
1895
- return T(p.doc);
1897
+ return T(f.doc);
1896
1898
  }
1897
1899
  });
1898
- }), x = Z(() => {
1899
- var m;
1900
+ }), D = Q(() => {
1901
+ var d;
1900
1902
  const r = {
1901
1903
  ...ke(0),
1902
1904
  currency: Xe()
1903
1905
  };
1904
- return ((m = i.purchaseOrder) == null ? void 0 : m.items.reduce((R, w) => ({
1906
+ return ((d = i.purchaseOrder) == null ? void 0 : d.items.reduce((R, w) => ({
1905
1907
  ...Le(R, w.totalCost ?? r),
1906
1908
  currency: Xe()
1907
1909
  }), r)) ?? r;
1908
1910
  });
1909
- return (r, m) => {
1910
- var E, X;
1911
- const R = K("FmButtonGroup"), w = K("FmChip"), T = K("FmMenuDivider"), G = K("FmCard"), Q = K("FmIcon"), p = K("FmTooltip"), $ = K("FmSpacer"), B = K("FmButton"), z = K("FmSideSheet");
1912
- return b(), ae(z, {
1913
- header: h(f)("inventory.transfer.receiveRequest.details.title") + ((E = r.purchaseOrder) != null && E.seqNumber ? ` #${(X = r.purchaseOrder) == null ? void 0 : X.seqNumber}` : ""),
1914
- modelValue: h(F),
1915
- "onUpdate:modelValue": m[5] || (m[5] = (L) => gt(F) ? F.value = L : null),
1916
- "dismiss-away": v.value,
1911
+ return (r, d) => {
1912
+ var E, J;
1913
+ const R = z("FmButtonGroup"), w = z("FmChip"), T = z("FmMenuDivider"), G = z("FmCard"), X = z("FmIcon"), f = z("FmTooltip"), $ = z("FmSpacer"), B = z("FmButton"), H = z("FmSideSheet");
1914
+ return h(), ae(H, {
1915
+ header: v(p)("inventory.transfer.receiveRequest.details.title") + ((E = r.purchaseOrder) != null && E.seqNumber ? ` #${(J = r.purchaseOrder) == null ? void 0 : J.seqNumber}` : ""),
1916
+ modelValue: v(F),
1917
+ "onUpdate:modelValue": d[5] || (d[5] = (L) => gt(F) ? F.value = L : null),
1918
+ "dismiss-away": _.value,
1917
1919
  "close-button": "",
1918
1920
  "max-width": 600
1919
1921
  }, {
1920
1922
  default: se(() => {
1921
1923
  var L, ne, ge, _e, Se;
1922
1924
  return [
1923
- n("div", _r, [
1924
- n("div", null, [
1925
+ a("div", _r, [
1926
+ a("div", null, [
1925
1927
  I(R, {
1926
- items: j.value,
1927
- modelValue: H.value,
1928
- "onUpdate:modelValue": m[0] || (m[0] = (U) => H.value = U)
1928
+ items: K.value,
1929
+ modelValue: W.value,
1930
+ "onUpdate:modelValue": d[0] || (d[0] = (U) => W.value = U)
1929
1931
  }, null, 8, ["items", "modelValue"])
1930
1932
  ]),
1931
- H.value.value === "overview" ? (b(), N(te, { key: 0 }, [
1932
- n("div", null, [
1933
+ W.value.value === "overview" ? (h(), N(te, { key: 0 }, [
1934
+ a("div", null, [
1933
1935
  I(G, {
1934
1936
  variant: "outlined",
1935
1937
  class: "flex flex-col gap-8 px-12 py-16"
1936
1938
  }, {
1937
1939
  default: se(() => {
1938
- var U, P, W, ve, he, Re, je, Ke, ze, He, Ge, We;
1940
+ var U, P, Y, ve, he, Re, je, Ke, ze, He, We, Ge;
1939
1941
  return [
1940
- n("div", Sr, [
1941
- n("div", wr, k(h(f)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1942
- n("div", null, [
1942
+ a("div", Sr, [
1943
+ a("div", wr, k(v(p)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1944
+ a("div", null, [
1943
1945
  I(w, {
1944
- label: h(f)(`inventory.transfer.status.${(U = r.purchaseOrder) == null ? void 0 : U.status}`),
1945
- class: Ne(`fm-status-badge fm-status-badge-${(W = (P = r.purchaseOrder) == null ? void 0 : P.status) == null ? void 0 : W.toLocaleLowerCase("en-us")}`),
1946
+ label: v(p)(`inventory.transfer.status.${(U = r.purchaseOrder) == null ? void 0 : U.status}`),
1947
+ class: Ne(`fm-status-badge fm-status-badge-${(Y = (P = r.purchaseOrder) == null ? void 0 : P.status) == null ? void 0 : Y.toLocaleLowerCase("en-us")}`),
1946
1948
  compact: ""
1947
1949
  }, null, 8, ["label", "class"])
1948
1950
  ])
1949
1951
  ]),
1950
1952
  I(T),
1951
- n("div", Rr, [
1952
- n("div", Or, [
1953
- n("div", Nr, [
1954
- n("div", kr, k(h(f)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1953
+ a("div", Rr, [
1954
+ a("div", Or, [
1955
+ a("div", Nr, [
1956
+ a("div", kr, k(v(p)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1955
1957
  ]),
1956
- n("div", xr, k(h(xe)(((ve = r.purchaseOrder) == null ? void 0 : ve._id) ?? "")), 1)
1958
+ a("div", xr, k(v(xe)(((ve = r.purchaseOrder) == null ? void 0 : ve._id) ?? "")), 1)
1957
1959
  ]),
1958
- (he = r.purchaseOrder) != null && he.effectiveAt ? (b(), N("div", Dr, [
1959
- n("div", qr, k(h(f)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1960
- n("div", Ar, k(h(tt)(new Date((Re = r.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1960
+ (he = r.purchaseOrder) != null && he.effectiveAt ? (h(), N("div", Dr, [
1961
+ a("div", qr, k(v(p)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1962
+ a("div", Ar, k(v(tt)(new Date((Re = r.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1961
1963
  ])) : V("", !0),
1962
- n("div", Tr, [
1963
- n("div", $r, k(h(f)("inventory.transfer.receiveRequest.details.type.title")), 1),
1964
- n("div", Cr, k(h(f)(
1965
- `inventory.transfer.receiveRequest.details.type.${c.value.toLocaleLowerCase("en-US")}`
1964
+ a("div", Tr, [
1965
+ a("div", $r, k(v(p)("inventory.transfer.receiveRequest.details.type.title")), 1),
1966
+ a("div", Cr, k(v(p)(
1967
+ `inventory.transfer.receiveRequest.details.type.${m.value.toLocaleLowerCase("en-US")}`
1966
1968
  )), 1)
1967
1969
  ]),
1968
- (Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (b(), N("div", Pr, [
1969
- n("div", Ir, k(h(f)("inventory.transfer.receiveRequest.details.from")), 1),
1970
- n("div", Fr, k((He = (ze = r.purchaseOrder) == null ? void 0 : ze.supplier) == null ? void 0 : He.name), 1)
1970
+ (Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (h(), N("div", Pr, [
1971
+ a("div", Ir, k(v(p)("inventory.transfer.receiveRequest.details.from")), 1),
1972
+ a("div", Fr, k((He = (ze = r.purchaseOrder) == null ? void 0 : ze.supplier) == null ? void 0 : He.name), 1)
1971
1973
  ])) : V("", !0),
1972
- r.transferTo ? (b(), N("div", Br, [
1973
- n("div", Er, k(h(f)("inventory.transfer.receiveRequest.details.to")), 1),
1974
- n("div", Lr, k(r.transferTo), 1)
1974
+ r.transferTo ? (h(), N("div", Br, [
1975
+ a("div", Er, k(v(p)("inventory.transfer.receiveRequest.details.to")), 1),
1976
+ a("div", Lr, k(r.transferTo), 1)
1975
1977
  ])) : V("", !0),
1976
- (Ge = r.purchaseOrder) != null && Ge.ref ? (b(), N("div", Ur, [
1977
- n("div", Vr, k(h(f)("inventory.transfer.receiveRequest.details.reference")), 1),
1978
- n("div", Mr, k(r.purchaseOrder.ref), 1)
1978
+ (We = r.purchaseOrder) != null && We.ref ? (h(), N("div", Ur, [
1979
+ a("div", Vr, k(v(p)("inventory.transfer.receiveRequest.details.reference")), 1),
1980
+ a("div", Mr, k(r.purchaseOrder.ref), 1)
1979
1981
  ])) : V("", !0),
1980
- (We = r.purchaseOrder) != null && We.remark ? (b(), N("div", jr, [
1981
- n("div", Kr, k(h(f)("inventory.transfer.receiveRequest.details.remark")), 1),
1982
- n("div", zr, k(r.purchaseOrder.remark), 1)
1982
+ (Ge = r.purchaseOrder) != null && Ge.remark ? (h(), N("div", jr, [
1983
+ a("div", Kr, k(v(p)("inventory.transfer.receiveRequest.details.remark")), 1),
1984
+ a("div", zr, k(r.purchaseOrder.remark), 1)
1983
1985
  ])) : V("", !0)
1984
1986
  ])
1985
1987
  ];
@@ -1990,16 +1992,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1990
1992
  I(gr, {
1991
1993
  "po-request": r.poRequest,
1992
1994
  purchaseOrder: r.purchaseOrder,
1993
- transferType: c.value,
1995
+ transferType: m.value,
1994
1996
  transferToDbName: r.transferToDbName,
1995
1997
  scope: r.scope
1996
1998
  }, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
1997
- n("div", Hr, [
1998
- n("div", Gr, [
1999
- n("div", Wr, [
2000
- n("span", Yr, [
2001
- Fe(k(ye.value ? h(f)("inventory.transfer.receiveRequest.details.receivedItems") : h(f)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2002
- (ne = (L = r.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((_e = (ge = r.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (b(), ae(p, {
1999
+ a("div", Hr, [
2000
+ a("div", Wr, [
2001
+ a("div", Gr, [
2002
+ a("span", Yr, [
2003
+ Fe(k(ye.value ? v(p)("inventory.transfer.receiveRequest.details.receivedItems") : v(p)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2004
+ (ne = (L = r.purchaseOrder) == null ? void 0 : L.netSuite) != null && ne.missingItems && ((_e = (ge = r.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (h(), ae(f, {
2003
2005
  key: 0,
2004
2006
  variant: "rich",
2005
2007
  placement: "top",
@@ -2008,22 +2010,22 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2008
2010
  content: se(() => {
2009
2011
  var U, P;
2010
2012
  return [
2011
- n("div", Qr, [
2012
- (b(!0), N(te, null, me((P = (U = r.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : P.missingItems, (W, ve) => (b(), N("div", {
2013
+ a("div", Qr, [
2014
+ (h(!0), N(te, null, me((P = (U = r.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : P.missingItems, (Y, ve) => (h(), N("div", {
2013
2015
  class: "flex justify-center align-middle",
2014
2016
  key: ve
2015
2017
  }, [
2016
- I(Q, {
2018
+ I(X, {
2017
2019
  name: "arrow_right",
2018
2020
  size: "sm"
2019
2021
  }),
2020
- Fe(" " + k(`(${W.netSuiteId}) ${W.name}: ${W.reason}`), 1)
2022
+ Fe(" " + k(`(${Y.netSuiteId}) ${Y.name}: ${Y.reason}`), 1)
2021
2023
  ]))), 128))
2022
2024
  ])
2023
2025
  ];
2024
2026
  }),
2025
2027
  default: se(() => [
2026
- I(Q, {
2028
+ I(X, {
2027
2029
  name: "error",
2028
2030
  color: "#ff2c2c",
2029
2031
  size: "sm"
@@ -2034,40 +2036,40 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2034
2036
  ])
2035
2037
  ]),
2036
2038
  I(T),
2037
- (b(!0), N(te, null, me(((Se = r.purchaseOrder) == null ? void 0 : Se.items) ?? [], (U) => {
2039
+ (h(!0), N(te, null, me(((Se = r.purchaseOrder) == null ? void 0 : Se.items) ?? [], (U) => {
2038
2040
  var P;
2039
- return b(), N("div", {
2041
+ return h(), N("div", {
2040
2042
  key: U.code,
2041
2043
  class: "flex flex-col"
2042
2044
  }, [
2043
- n("div", Xr, [
2044
- n("div", Jr, k(U.name), 1),
2045
- n("div", Zr, k(h(ie)(Ce.value[U.sku._id], !1)) + "/" + k(h(Ot)(U.quantity, U.sku.unit, U.measurement)), 1)
2045
+ a("div", Xr, [
2046
+ a("div", Jr, k(U.name), 1),
2047
+ a("div", Zr, k(v(ie)(Ce.value[U.sku._id], !1)) + "/" + k(v(Ot)(U.quantity, U.sku.unit, U.measurement)), 1)
2046
2048
  ]),
2047
- n("div", es, [
2048
- n("div", ts, k(U.code), 1),
2049
- (P = U.totalCost) != null && P.amount && h(l).enableTotalCost ? (b(), N("div", rs, " (" + k(h(Oe)(U.totalCost)) + ") ", 1)) : V("", !0)
2049
+ a("div", es, [
2050
+ a("div", ts, k(U.code), 1),
2051
+ (P = U.totalCost) != null && P.amount && v(c).enableTotalCost ? (h(), N("div", rs, " (" + k(v(Oe)(U.totalCost)) + ") ", 1)) : V("", !0)
2050
2052
  ])
2051
2053
  ]);
2052
2054
  }), 128)),
2053
- +h(ie)(x.value) ? (b(), N(te, { key: 0 }, [
2054
- n("div", ss, [
2055
+ +v(ie)(D.value) ? (h(), N(te, { key: 0 }, [
2056
+ a("div", ss, [
2055
2057
  I(T)
2056
2058
  ]),
2057
- n("div", ns, [
2058
- m[6] || (m[6] = n("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2059
- n("div", as, k(h(Oe)(x.value)), 1)
2059
+ a("div", ns, [
2060
+ d[6] || (d[6] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2061
+ a("div", as, k(v(Oe)(D.value)), 1)
2060
2062
  ])
2061
2063
  ], 64)) : V("", !0)
2062
2064
  ])
2063
2065
  ])
2064
- ], 64)) : H.value.value === "deliveryHistory" ? (b(), N("div", os, [
2065
- ce.value.length ? (b(), N("div", ds, [
2066
- (b(!0), N(te, null, me(ce.value, (U, P) => (b(), N(te, { key: P }, [
2067
- n("div", ms, [
2068
- n("div", fs, [
2069
- n("div", ps, [
2070
- n("div", {
2066
+ ], 64)) : W.value.value === "deliveryHistory" ? (h(), N("div", os, [
2067
+ ce.value.length ? (h(), N("div", ds, [
2068
+ (h(!0), N(te, null, me(ce.value, (U, P) => (h(), N(te, { key: P }, [
2069
+ a("div", ms, [
2070
+ a("div", fs, [
2071
+ a("div", ps, [
2072
+ a("div", {
2071
2073
  class: Ne([
2072
2074
  {
2073
2075
  "bg-fm-color-primary": P !== 0,
@@ -2077,9 +2079,9 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2077
2079
  ])
2078
2080
  }, null, 2)
2079
2081
  ]),
2080
- m[7] || (m[7] = n("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2081
- n("div", ys, [
2082
- n("div", {
2082
+ d[7] || (d[7] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2083
+ a("div", ys, [
2084
+ a("div", {
2083
2085
  class: Ne([
2084
2086
  {
2085
2087
  "bg-fm-color-primary": P < ce.value.length - 1,
@@ -2090,15 +2092,15 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2090
2092
  }, null, 2)
2091
2093
  ])
2092
2094
  ]),
2093
- n("div", vs, [
2094
- n("div", hs, k(U.header), 1),
2095
- n("div", bs, k(U.date), 1)
2095
+ a("div", vs, [
2096
+ a("div", hs, k(U.header), 1),
2097
+ a("div", bs, k(U.date), 1)
2096
2098
  ])
2097
2099
  ]),
2098
- n("div", gs, [
2099
- n("div", _s, [
2100
- n("div", Ss, [
2101
- n("div", {
2100
+ a("div", gs, [
2101
+ a("div", _s, [
2102
+ a("div", Ss, [
2103
+ a("div", {
2102
2104
  class: Ne([
2103
2105
  {
2104
2106
  "bg-fm-color-primary": P < ce.value.length - 1,
@@ -2109,26 +2111,26 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2109
2111
  }, null, 2)
2110
2112
  ])
2111
2113
  ]),
2112
- n("div", ws, [
2114
+ a("div", ws, [
2113
2115
  I(G, {
2114
2116
  variant: "outlined",
2115
2117
  class: "py-12 px-16"
2116
2118
  }, {
2117
2119
  default: se(() => [
2118
- n("div", Rs, [
2119
- (b(!0), N(te, null, me(U.info, (W, ve) => (b(), N("div", {
2120
+ a("div", Rs, [
2121
+ (h(!0), N(te, null, me(U.info, (Y, ve) => (h(), N("div", {
2120
2122
  key: ve,
2121
2123
  class: "flex flex-col gap-4"
2122
2124
  }, [
2123
- n("div", Os, k(W == null ? void 0 : W.label), 1),
2124
- n("div", Ns, [
2125
- (b(!0), N(te, null, me(W == null ? void 0 : W.values, (he, Re) => (b(), N("div", {
2125
+ a("div", Os, k(Y == null ? void 0 : Y.label), 1),
2126
+ a("div", Ns, [
2127
+ (h(!0), N(te, null, me(Y == null ? void 0 : Y.values, (he, Re) => (h(), N("div", {
2126
2128
  key: Re,
2127
2129
  class: "fm-typo-en-body-lg-600"
2128
2130
  }, [
2129
- typeof he == "string" ? (b(), N(te, { key: 0 }, [
2131
+ typeof he == "string" ? (h(), N(te, { key: 0 }, [
2130
2132
  Fe(k(he), 1)
2131
- ], 64)) : (b(), ae(_t(he), { key: 1 }))
2133
+ ], 64)) : (h(), ae(_t(he), { key: 1 }))
2132
2134
  ]))), 128))
2133
2135
  ])
2134
2136
  ]))), 128))
@@ -2139,16 +2141,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2139
2141
  ])
2140
2142
  ])
2141
2143
  ], 64))), 128))
2142
- ])) : (b(), N("div", is, [
2144
+ ])) : (h(), N("div", is, [
2143
2145
  I($),
2144
- n("div", null, [
2145
- n("img", {
2146
- src: h(Nt),
2146
+ a("div", null, [
2147
+ a("img", {
2148
+ src: v(Nt),
2147
2149
  alt: "List is empty"
2148
2150
  }, null, 8, ls)
2149
2151
  ]),
2150
- n("div", cs, k(h(f)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2151
- n("div", us, k(h(f)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2152
+ a("div", cs, k(v(p)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2153
+ a("div", us, k(v(p)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2152
2154
  I($),
2153
2155
  I($)
2154
2156
  ]))
@@ -2157,42 +2159,42 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2157
2159
  ];
2158
2160
  }),
2159
2161
  "side-sheet-footer": se(() => [
2160
- n("div", ks, [
2161
- (b(!0), N(te, null, me(C.value, (L) => (b(), N(te, null, [
2162
- h(Ee)[L].available != !1 ? (b(), ae(B, {
2162
+ a("div", ks, [
2163
+ (h(!0), N(te, null, me(C.value, (L) => (h(), N(te, null, [
2164
+ v(Ee)[L].available != !1 ? (h(), ae(B, {
2163
2165
  key: L,
2164
- label: h(f)(h(Ee)[L].translationKey),
2166
+ label: v(p)(v(Ee)[L].translationKey),
2165
2167
  onClick: (ne) => oe(L),
2166
- loading: o.value === L,
2167
- disabled: o.value !== L && u.value,
2168
- variant: h(Ee)[L].buttonVariant
2168
+ loading: n.value === L,
2169
+ disabled: n.value !== L && l.value,
2170
+ variant: v(Ee)[L].buttonVariant
2169
2171
  }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : V("", !0)
2170
2172
  ], 64))), 256)),
2171
- h(g).ableToMarkReceived(r.purchaseOrder) && !C.value.includes("completeReceive") ? (b(), ae(B, {
2173
+ v(b).ableToMarkReceived(r.purchaseOrder) && !C.value.includes("completeReceive") ? (h(), ae(B, {
2172
2174
  key: 0,
2173
- label: h(f)("inventory.transfer.receiveRequest.actions.completeReceive"),
2174
- onClick: m[1] || (m[1] = (L) => oe("completeReceive")),
2175
- loading: o.value === "completeReceive",
2176
- disabled: o.value !== "completeReceive" && u.value
2175
+ label: v(p)("inventory.transfer.receiveRequest.actions.completeReceive"),
2176
+ onClick: d[1] || (d[1] = (L) => oe("completeReceive")),
2177
+ loading: n.value === "completeReceive",
2178
+ disabled: n.value !== "completeReceive" && l.value
2177
2179
  }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2178
- h(g).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !C.value.includes("approveRequest") ? (b(), ae(B, {
2180
+ v(b).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !C.value.includes("approveRequest") ? (h(), ae(B, {
2179
2181
  key: 1,
2180
- label: h(f)("inventory.transfer.approval.actions.approveRequest"),
2181
- onClick: m[2] || (m[2] = (L) => oe("approveRequest")),
2182
- loading: o.value === "approveRequest",
2183
- disabled: o.value !== "approveRequest" && u.value
2182
+ label: v(p)("inventory.transfer.approval.actions.approveRequest"),
2183
+ onClick: d[2] || (d[2] = (L) => oe("approveRequest")),
2184
+ loading: n.value === "approveRequest",
2185
+ disabled: n.value !== "approveRequest" && l.value
2184
2186
  }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2185
- h(g).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && i.scope === "approval" ? (b(), ae(B, {
2187
+ v(b).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && i.scope === "approval" ? (h(), ae(B, {
2186
2188
  key: 2,
2187
- label: h(f)("inventory.transfer.receiveRequest.actions.processRequest"),
2188
- onClick: m[3] || (m[3] = (L) => oe("processRequest")),
2189
- loading: o.value === "processRequest",
2190
- disabled: o.value !== "processRequest" && u.value
2189
+ label: v(p)("inventory.transfer.receiveRequest.actions.processRequest"),
2190
+ onClick: d[3] || (d[3] = (L) => oe("processRequest")),
2191
+ loading: n.value === "processRequest",
2192
+ disabled: n.value !== "processRequest" && l.value
2191
2193
  }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2192
2194
  I(B, {
2193
- label: h(f)("common.close"),
2195
+ label: v(p)("common.close"),
2194
2196
  variant: "tertiary",
2195
- onClick: m[4] || (m[4] = (L) => _("update:show", !1))
2197
+ onClick: d[4] || (d[4] = (L) => g("update:show", !1))
2196
2198
  }, null, 8, ["label"])
2197
2199
  ])
2198
2200
  ]),