@feedmepos/mf-inventory-portal 1.0.37-dev.3 → 1.0.37

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-Dmd2G8R5.js → App-PCcAF8Xv.js} +1 -1
  2. package/dist/{ApprovalView-Dp3k5vDw.js → ApprovalView-CAF8rKoi.js} +19 -19
  3. package/dist/{BindingsDialog-D80Yhk4v.js → BindingsDialog-DwqG0Hsz.js} +4 -4
  4. package/dist/{BindingsPicker-BYRH73Mx.js → BindingsPicker-Q-I3VeNS.js} +1 -1
  5. package/dist/{BindingsTable-CvblcQnI.js → BindingsTable-Dg9eIaTK.js} +4 -4
  6. package/dist/{ClosingDraftView-DiUIrHnf.js → ClosingDraftView-wGfktZWC.js} +26 -26
  7. package/dist/ClosingTemplateView-NRHvagkV.js +1804 -0
  8. package/dist/{DeliveryOrderPrintPreview-7DmbPXg9.js → DeliveryOrderPrintPreview-B0XUNKJb.js} +4 -4
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-C_QmBqHi.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bgof7EWF.js} +11 -11
  10. package/dist/{FmMultiselectDialog-m2Wih5ZC.js → FmMultiselectDialog-CzkgAIGY.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-C0Ky06__.js → FmUnitInput.vue_vue_type_script_setup_true_lang-CgU3fI7R.js} +21 -21
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DLfxc861.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-BJ0tegHR.js} +1 -1
  13. package/dist/{IngredientGroupView-Um-bP1SR.js → IngredientGroupView-BcTQ0KqW.js} +2 -2
  14. package/dist/IngredientsView-Yj3W5zHy.js +1838 -0
  15. package/dist/{IntegrationView-DfBOpvo1.js → IntegrationView-JI6kjKNB.js} +76 -77
  16. package/dist/{InventoryBindingForm-sbgSzNep.js → InventoryBindingForm-DeEj_xzq.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYpXwzuu.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BaNc5eeK.js} +24 -24
  18. package/dist/{InventoryBindingSummary-BWdagbGS.js → InventoryBindingSummary-Bipyw3xO.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BvdA5Qfu.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BQBjpBNL.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CBH7oYpv.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DPwHQy_S.js} +10 -10
  21. package/dist/{PublishView-CjX1ZmFe.js → PublishView-7XkvtNnX.js} +17 -17
  22. package/dist/{PurchaseOrderPrintPreview-M20PXH1Z.js → PurchaseOrderPrintPreview-eSOFS1g6.js} +12 -12
  23. package/dist/{ReceiveRequestView-CF9p1j-M.js → ReceiveRequestView-BuOj9nZG.js} +782 -797
  24. package/dist/{RecipeView-kVgJAZ9d.js → RecipeView-Bmgrlys8.js} +3 -3
  25. package/dist/{StockView-B9bSTjY4.js → StockView-By7lUolG.js} +6 -6
  26. package/dist/{SupplierView-uaW913cH.js → SupplierView-BP4FxIE9.js} +3 -3
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-Bwiv5v2m.js → TransferDetails.vue_vue_type_script_setup_true_lang-D7k3PiMo.js} +602 -604
  28. package/dist/{TransferTemplateView-BuHT8mNT.js → TransferTemplateView-C6AXtV1p.js} +83 -83
  29. package/dist/{UnitView-Db_ETZrB.js → UnitView-CpJT9nbZ.js} +3 -3
  30. package/dist/{WarehouseView-2SJNm6XK.js → WarehouseView-bD9WOJAb.js} +1 -1
  31. package/dist/api/inventory.d.ts +0 -4
  32. package/dist/api/netsuite.d.ts +0 -7
  33. package/dist/{app-CoEB-VoH.js → app-8I_gNY_C.js} +61439 -61948
  34. package/dist/app.d.ts +0 -9
  35. package/dist/app.js +1 -1
  36. package/dist/components/inventory-binding/InventoryBinding.vue.d.ts +0 -1
  37. package/dist/components/row-action.enum.d.ts +1 -2
  38. package/dist/components/shell/inventory/binding-ui.vue.d.ts +0 -1
  39. package/dist/{decimal-B7itxUWP.js → decimal-XS-oUZ58.js} +1 -1
  40. package/dist/format-unit-display-Bqbyy60P.js +1230 -0
  41. package/dist/{index-DfWaG7Tl.js → index-ByjAx-mG.js} +1 -1
  42. package/dist/{index-YGLKr3WK.js → index-CxWZtTgh.js} +1 -1
  43. package/dist/{stock-CCQ352Hu.js → stock-Di0sHyh2.js} +1 -1
  44. package/dist/stores/integration/netsuite.d.ts +1 -7
  45. package/dist/stores/inventory.d.ts +0 -9
  46. package/dist/{supplier-BCwA2FHM.js → supplier-BOti7LMg.js} +1 -1
  47. package/dist/tsconfig.app.tsbuildinfo +1 -1
  48. package/dist/{use-ingredient-select-dialog-DOONV-IL.js → use-ingredient-select-dialog-DHNa-mhW.js} +1 -1
  49. package/dist/{use-inventory-binding-dialog-BPM-7FrW.js → use-inventory-binding-dialog-CvyHpZHX.js} +1 -1
  50. package/dist/views/adjustment-template/wastage-template/actions.d.ts +1 -4
  51. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +0 -8
  52. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +0 -24
  53. package/dist/views/closing-template/components/closing-template-form/composables/use-closing-template-items.d.ts +0 -1
  54. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +1 -16
  55. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +0 -12
  56. package/dist/views/ingredients/components/ingredient-form/IngredientForm.vue.d.ts +0 -2
  57. package/dist/views/ingredients/composables/use-ingredient-table.d.ts +0 -1
  58. package/dist/views/integration/components/netsuite/InventoryTransferIngredientTable.vue.d.ts +0 -2
  59. package/dist/views/integration/components/netsuite/business/BusinessNetSuiteSideSheet.vue.d.ts +0 -4
  60. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +0 -17
  61. package/dist/views/receive-request/components/transfer-form/components/ForecastStock.vue.d.ts +0 -2
  62. package/dist/views/receive-request/components/transfer-form/components/TransferItemTable.vue.d.ts +0 -4
  63. package/dist/views/receive-request/components/transfer-form/composables/use-transfer-items.d.ts +0 -1
  64. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +0 -4
  65. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +0 -24
  66. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +0 -24
  67. package/dist/views/stock/components/dialog/AdjustedItemForm.vue.d.ts +0 -2
  68. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +0 -2
  69. package/dist/views/transfer-template/components/transfer-template-form/components/NetSuiteCustomCodeSelection.vue.d.ts +0 -2
  70. package/dist/views/transfer-template/components/transfer-template-form/components/TransferTemplateItemTable.vue.d.ts +0 -2
  71. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.d.ts +0 -1
  72. package/dist/views/transfer-template/composables/use-netsuite-custom-field.d.ts +0 -3
  73. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +1 -16
  74. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +0 -12
  75. package/dist/{vue-i18n-DZAYeut-.js → vue-i18n-y6eJldrX.js} +490 -490
  76. package/package.json +3 -3
  77. package/dist/ClosingTemplateView-BGyaxOv_.js +0 -1849
  78. package/dist/IngredientsView-BOYvD0VL.js +0 -1858
  79. package/dist/api/duplicate-template.d.ts +0 -5
  80. package/dist/format-unit-display-DswmXjqB.js +0 -1275
@@ -1,70 +1,70 @@
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-CoEB-VoH.js";
2
- import { ref as j, 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 M, 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-B7itxUWP.js";
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-8I_gNY_C.js";
2
+ import { ref as M, computed as Z, h as A, defineComponent as pe, reactive as ht, onMounted as nt, resolveComponent as z, openBlock as b, createBlock as ae, withCtx as se, createElementVNode as a, 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-XS-oUZ58.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-DswmXjqB.js";
5
+ import { b as wt, u as Rt, P as fe, f as Ot } from "./format-unit-display-Bqbyy60P.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-C0Ky06__.js";
8
+ import { _ as xt, F as Dt, a as qt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-CgU3fI7R.js";
9
9
  import { u as At, R as Ze } from "./usePromise-CbVUCxhj.js";
10
- import { u as Tt } from "./index-DfWaG7Tl.js";
11
- const $e = lt((S, e) => {
12
- const i = de(), b = Ae();
10
+ import { u as Tt } from "./index-ByjAx-mG.js";
11
+ const $e = lt((_, e) => {
12
+ const i = de(), g = Ae();
13
13
  return {
14
- async readRequests(c, t, u) {
15
- const o = c ?? i.currentLocationDBName, s = `${S.inventoryBackendUrl}/${o}/purchase-request`;
16
- return t && u ? await e.get(`${s}?startDate=${t}&endDate=${u}`) : await e.get(s);
14
+ async readRequests(d, t, l) {
15
+ const n = d ?? i.currentLocationDBName, s = `${_.inventoryBackendUrl}/${n}/purchase-request`;
16
+ return t && l ? await e.get(`${s}?startDate=${t}&endDate=${l}`) : await e.get(s);
17
17
  },
18
- async readRequestById(c, t) {
19
- const u = t ?? i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${u}/purchase-request/${c}`;
20
- return await e.get(o);
18
+ async readRequestById(d, t) {
19
+ const l = t ?? i.currentLocationDBName, n = `${_.inventoryBackendUrl}/${l}/purchase-request/${d}`;
20
+ return await e.get(n);
21
21
  },
22
- async readRequestByIds(c, t) {
23
- const u = t ?? i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${u}/purchase-request/find`;
24
- return await e.post(o, { requestIds: c });
22
+ async readRequestByIds(d, t) {
23
+ const l = t ?? i.currentLocationDBName, n = `${_.inventoryBackendUrl}/${l}/purchase-request/find`;
24
+ return await e.post(n, { requestIds: d });
25
25
  },
26
26
  async getPurchaseOrders({
27
- start: c,
27
+ start: d,
28
28
  end: t
29
29
  }) {
30
- const u = i.currentLocationDBName, o = `${S.inventoryBackendUrl}/${u}/purchase-order`;
31
- return await e.get(`${o}?start=${c}&end=${t}`);
30
+ const l = i.currentLocationDBName, n = `${_.inventoryBackendUrl}/${l}/purchase-order`;
31
+ return await e.get(`${n}?start=${d}&end=${t}`);
32
32
  },
33
- async getLatestPurchaseOrderRequest(c) {
34
- const t = i.currentLocationDBName, u = `${S.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
35
- return await e.get(`${u}/${c}`);
33
+ async getLatestPurchaseOrderRequest(d) {
34
+ const t = i.currentLocationDBName, l = `${_.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
35
+ return await e.get(`${l}/${d}`);
36
36
  },
37
- async getPurchaseOrderById(c) {
38
- const t = i.currentLocationDBName, u = `${S.inventoryBackendUrl}/${t}/purchase-order`;
39
- return await e.get(`${u}/${c}`);
37
+ async getPurchaseOrderById(d) {
38
+ const t = i.currentLocationDBName, l = `${_.inventoryBackendUrl}/${t}/purchase-order`;
39
+ return await e.get(`${l}/${d}`);
40
40
  },
41
41
  /**
42
42
  * @deprecated Use `processPurchaseOrderV2` instead.
43
43
  */
44
- async processPurchaseOrder(c, t) {
45
- const u = i.currentLocationDBName, o = t || u, s = `${S.inventoryBackendUrl}/${o}/purchase-order/run-operation`;
46
- return await e.put(s, c);
44
+ async processPurchaseOrder(d, t) {
45
+ const l = i.currentLocationDBName, n = t || l, s = `${_.inventoryBackendUrl}/${n}/purchase-order/run-operation`;
46
+ return await e.put(s, d);
47
47
  },
48
- async createPurchaseOrder(c) {
49
- const t = i.currentLocationDBName, u = `${S.inventoryBackendUrl}/${t}/purchase-order`;
50
- return await e.post(u, c);
48
+ async createPurchaseOrder(d) {
49
+ const t = i.currentLocationDBName, l = `${_.inventoryBackendUrl}/${t}/purchase-order`;
50
+ return await e.post(l, d);
51
51
  },
52
- async updatePurchaseOrder(c) {
53
- const t = i.currentLocationDBName, u = `${S.inventoryBackendUrl}/${t}/purchase-order`;
54
- return await e.put(u, c);
52
+ async updatePurchaseOrder(d) {
53
+ const t = i.currentLocationDBName, l = `${_.inventoryBackendUrl}/${t}/purchase-order`;
54
+ return await e.put(l, d);
55
55
  },
56
- async importFromXilnex(c) {
57
- const t = i.currentLocationDBName, u = `${S.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
58
- return await e.post(u, c);
56
+ async importFromXilnex(d) {
57
+ const t = i.currentLocationDBName, l = `${_.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
58
+ return await e.post(l, d);
59
59
  },
60
- async processPurchaseOrderV2(c, t) {
61
- const u = i.currentLocationDBName, o = t || u, s = `${S.inventoryBackendUrl}/${o}/v2/purchase-order/run-operation`;
62
- return await e.put(s, c);
60
+ async processPurchaseOrderV2(d, t) {
61
+ const l = i.currentLocationDBName, n = t || l, s = `${_.inventoryBackendUrl}/${n}/v2/purchase-order/run-operation`;
62
+ return await e.put(s, d);
63
63
  },
64
64
  async getWorkflowConfig() {
65
- var o;
66
- const t = `business_${(o = b.currentBusiness.value) == null ? void 0 : o._id}`, u = `${S.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
67
- return await e.get(u);
65
+ var n;
66
+ const t = `business_${(n = g.currentBusiness.value) == null ? void 0 : n._id}`, l = `${_.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
67
+ return await e.get(l);
68
68
  }
69
69
  };
70
70
  }), ot = {
@@ -136,47 +136,47 @@ const $e = lt((S, e) => {
136
136
  }
137
137
  };
138
138
  function it() {
139
- const S = de(), e = $e(), i = De();
140
- async function b(t, u) {
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, u || o);
139
+ const _ = de(), e = $e(), i = De();
140
+ async function g(t, l) {
141
+ const n = _.currentLocationDBName;
142
+ return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t, l || n);
143
143
  }
144
- async function c(t, u) {
145
- const o = S.currentLocationDBName;
146
- return await e.processPurchaseOrderV2(t, u || o);
144
+ async function d(t, l) {
145
+ const n = _.currentLocationDBName;
146
+ return await e.processPurchaseOrderV2(t, l || n);
147
147
  }
148
- return (t) => i.useOperatePurchaseOrderV2 ? c(t.operateV2, t.transferTo) : b(t.operate, t.transferTo);
148
+ return (t) => i.useOperatePurchaseOrderV2 ? d(t.operateV2, t.transferTo) : g(t.operate, t.transferTo);
149
149
  }
150
- var Ue = /* @__PURE__ */ ((S) => (S.RECEIVE_REQUEST = "receive/request", S.APPROVAL = "approval", S))(Ue || {});
151
- const we = j(), Be = j();
152
- function Bs(S, e) {
153
- const i = Me(), b = de(), c = De();
150
+ var Ue = /* @__PURE__ */ ((_) => (_.RECEIVE_REQUEST = "receive/request", _.APPROVAL = "approval", _))(Ue || {});
151
+ const we = M(), Be = M();
152
+ function Bs(_, e) {
153
+ const i = Me(), g = de(), d = De();
154
154
  qe();
155
- const t = wt(), u = Rt(), o = j(!1), s = Te(), y = $e(), _ = j(new Array()), p = j(
155
+ const t = wt(), l = Rt(), n = M(!1), s = Te(), y = $e(), S = M(new Array()), f = M(
156
156
  e != null && e.startDate && (e != null && e.endDate) ? e : ct()
157
- ), m = Q(() => {
158
- const D = new Date(p.value.startDate), r = new Date(p.value.endDate);
157
+ ), c = Z(() => {
158
+ const x = new Date(f.value.startDate), r = new Date(f.value.endDate);
159
159
  return {
160
- start: ut(D).toISOString(),
160
+ start: ut(x).toISOString(),
161
161
  end: dt(r).toISOString()
162
162
  };
163
- }), l = j(new Array()), n = mt(), g = j(null);
164
- async function x(D) {
163
+ }), u = M(new Array()), o = mt(), v = M(null);
164
+ async function D(x) {
165
165
  function r(R) {
166
166
  const w = {
167
167
  mode: Ye.CREATE,
168
- modelValue: D || void 0,
168
+ modelValue: x || void 0,
169
169
  show: !0,
170
170
  "onUpdate:show"($) {
171
171
  we.value.show = $;
172
172
  },
173
173
  templateId: R,
174
- lastClosingDate: g.value
174
+ lastClosingDate: v.value
175
175
  };
176
176
  we.value = w;
177
177
  }
178
- let d;
179
- c.mustUsePoTemplate && !(D != null && D.template) ? i.open({
178
+ let m;
179
+ d.mustUsePoTemplate && !(x != null && x.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
- d = await t.getTemplateId(), d && r(d);
192
+ m = await t.getTemplateId(), m && r(m);
193
193
  }).onSecondary(() => {
194
194
  r(void 0);
195
- }) : r(d);
195
+ }) : r(m);
196
196
  }
197
- function q(D) {
197
+ function q(x) {
198
198
  const r = {
199
199
  mode: Ye.UPDATE,
200
- modelValue: et(D),
200
+ modelValue: et(x),
201
201
  show: !0,
202
- "onUpdate:show"(d) {
203
- we.value.show = d;
202
+ "onUpdate:show"(m) {
203
+ we.value.show = m;
204
204
  },
205
- lastClosingDate: g.value
205
+ lastClosingDate: v.value
206
206
  };
207
207
  we.value = r;
208
208
  }
209
- async function V() {
210
- _.value = [], o.value = !0;
209
+ async function j() {
210
+ S.value = [], n.value = !0;
211
211
  try {
212
- _.value = await y.getPurchaseOrders(m.value).then((R) => R.sort((w, $) => $._id.localeCompare(w._id)));
213
- const D = await n.readCurrentLocationLastClosing(!0), r = D == null ? void 0 : D._id;
214
- r && (g.value = ft(r)), await c.awaitFeatureLoaded(() => c.mustUsePoTemplate) && await u.fetchTemplates();
215
- const d = _.value.map((R) => {
212
+ S.value = await y.getPurchaseOrders(c.value).then((R) => R.sort((w, $) => $._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 = S.value.map((R) => {
216
216
  var w;
217
217
  return ((w = R.request) == null ? void 0 : w.id) ?? "";
218
218
  }).filter((R) => R);
219
- l.value = await y.readRequestByIds(d);
219
+ u.value = await y.readRequestByIds(m);
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
- o.value = !1;
227
+ n.value = !1;
228
228
  }
229
229
  }
230
230
  async function T() {
231
- l.value = [], o.value = !0;
231
+ u.value = [], n.value = !0;
232
232
  try {
233
- l.value = await y.readRequests(
233
+ u.value = await y.readRequests(
234
234
  void 0,
235
- m.value.start,
236
- m.value.end
237
- ).then((D) => D.reverse());
235
+ c.value.start,
236
+ c.value.end
237
+ ).then((x) => x.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
- o.value = !1;
245
+ n.value = !1;
246
246
  }
247
247
  }
248
248
  function F() {
249
- switch (S) {
249
+ switch (_) {
250
250
  case "receive/request":
251
- return V();
251
+ return j();
252
252
  case "approval":
253
253
  return T();
254
254
  }
255
255
  }
256
- function K(D, r) {
257
- p.value = {
258
- startDate: D,
256
+ function K(x, r) {
257
+ f.value = {
258
+ startDate: x,
259
259
  endDate: r
260
260
  }, F();
261
261
  }
262
- b.watchLocation(async (D) => {
263
- if (!D) {
264
- _.value = [];
262
+ g.watchLocation(async (x) => {
263
+ if (!x) {
264
+ S.value = [];
265
265
  return;
266
266
  }
267
267
  await F();
268
268
  });
269
- const W = j(), le = j(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
- ($) => $.purchaseOrderId === D._id ? $ : null
269
+ const G = 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
+ ($) => $.purchaseOrderId === x._id ? $ : null
274
274
  ) ?? void 0);
275
- const R = S === "receive/request" ? b.currentLocation : r == null ? void 0 : r.to, w = {
275
+ const R = _ === "receive/request" ? g.currentLocation : r == null ? void 0 : r.to, w = {
276
276
  poRequest: r,
277
- purchaseOrder: D,
277
+ purchaseOrder: x,
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
- canApprove: S === "approval",
282
+ canApprove: _ === "approval",
283
283
  "onUpdate:show"($) {
284
- W.value.show = $;
284
+ G.value.show = $;
285
285
  },
286
- scope: S
286
+ scope: _
287
287
  };
288
- W.value = w;
288
+ G.value = w;
289
289
  }
290
- async function ye(D, r, d, R) {
290
+ async function ye(x, r, m, R) {
291
291
  const w = it();
292
- o.value = !0;
292
+ n.value = !0;
293
293
  try {
294
294
  await w({
295
295
  operate: {
296
296
  operation: r,
297
- doc: D,
297
+ doc: x,
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) && c.autoReceiveWarehouse ? {
301
+ r === O.enum.completeReceive) && d.autoReceiveWarehouse ? {
302
302
  autoReceive: !0
303
303
  } : void 0
304
304
  )
305
305
  },
306
306
  operateV2: {
307
- _id: D._id,
308
- _rev: D._rev ?? "",
307
+ _id: x._id,
308
+ _rev: x._rev ?? "",
309
309
  action: r,
310
310
  payloads: []
311
311
  },
312
312
  transferTo: R
313
- }), await new Promise((X) => setTimeout(X, 1e3));
314
- const G = de().currentLocationDBName.startsWith("restaurant_");
315
- r === O.enum.confirmDraft && D.effectiveAt && G ? s.open({
313
+ }), await new Promise((Q) => setTimeout(Q, 1e3));
314
+ const W = de().currentLocationDBName.startsWith("restaurant_");
315
+ r === O.enum.confirmDraft && x.effectiveAt && W ? s.open({
316
316
  title: "Success",
317
- message: `${d}. The backdate will be reflected once your POS has received this change.`,
317
+ message: `${m}. 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: d,
321
+ message: m,
322
322
  type: "success"
323
323
  });
324
324
  } catch ($) {
@@ -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, D, $);
329
+ }), console.error("Error when submitting PO operation", r, x, $);
330
330
  } finally {
331
- o.value = !1, F();
331
+ n.value = !1, F();
332
332
  }
333
333
  }
334
- async function Ce(D, r, d) {
334
+ async function Ce(x, r, m) {
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: $.message,
348
348
  primaryActions: $.primaryActions
349
349
  }).onPrimary(() => {
350
- ye(D, r, w, d);
350
+ ye(x, r, w, m);
351
351
  });
352
352
  }
353
353
  async function ce() {
@@ -362,51 +362,51 @@ function Bs(S, e) {
362
362
  close: !0
363
363
  }
364
364
  }).onPrimary(() => {
365
- const D = {
365
+ const x = {
366
366
  show: !0,
367
367
  "onUpdate:show"(r) {
368
368
  Be.value.show = r;
369
369
  }
370
370
  };
371
- Be.value = D;
371
+ Be.value = x;
372
372
  });
373
373
  }
374
374
  return {
375
- purchaseOrders: _,
376
- purchaseRequests: l,
375
+ purchaseOrders: S,
376
+ purchaseRequests: u,
377
377
  updateDateRange: K,
378
378
  fetchData: F,
379
- loading: o,
379
+ loading: n,
380
380
  transferDialogProps: we,
381
- promptCreateTransferDialog: x,
381
+ promptCreateTransferDialog: D,
382
382
  promptUpdateTransferDialog: q,
383
- transferDetailsProps: W,
383
+ transferDetailsProps: G,
384
384
  promptShowTransferDetails: oe,
385
385
  submitAction: Ce,
386
386
  xilnexImportDialogProps: Be,
387
387
  promptUploadTransferDialog: ce
388
388
  };
389
389
  }
390
- function $t(S, e) {
390
+ function $t(_, e) {
391
391
  return e.reduce(
392
- (b, c) => {
393
- const t = c.received.find((u) => u.sku._id === S._id);
394
- return t && (b = Le(b, t.amount)), b;
392
+ (g, d) => {
393
+ const t = d.received.find((l) => l.sku._id === _._id);
394
+ return t && (g = Le(g, t.amount)), g;
395
395
  },
396
- St.toPrecision(ke(0), S.unit.precision)
396
+ St.toPrecision(ke(0), _.unit.precision)
397
397
  );
398
398
  }
399
- function Ct(S) {
400
- const { po: e, currentLocation: i, business: b, fulfilling: c, por: t } = S, { name: u, address: o, regNo: s } = i.doc.profile, y = {
401
- name: u,
399
+ function Ct(_) {
400
+ const { po: e, currentLocation: i, business: g, fulfilling: d, por: t } = _, { name: l, address: n, regNo: s } = i.doc.profile, y = {
401
+ name: l,
402
402
  registrationNumber: s,
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
- }, _ = {
403
+ line1: n == null ? void 0 : n.line1,
404
+ line2: n == null ? void 0 : n.line2,
405
+ postcode: n == null ? void 0 : n.postcode,
406
+ city: n == null ? void 0 : n.city,
407
+ state: n == null ? void 0 : n.state,
408
+ country: n == null ? void 0 : n.country
409
+ }, S = {
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
- }, p = e.items.map((T) => {
420
- const { sku: F, measurement: K } = T, W = ie(
419
+ }, f = e.items.map((T) => {
420
+ const { sku: F, measurement: K } = T, G = ie(
421
421
  $t(T.sku, e.deliveryOrder || []),
422
422
  !1
423
423
  );
@@ -426,12 +426,12 @@ function Ct(S) {
426
426
  description: F.name,
427
427
  quantity: ie(T.quantity, !1),
428
428
  unit: (K == null ? void 0 : K.abbrev) || F.unit.abbrev,
429
- received: W,
429
+ received: G,
430
430
  cost: T.totalCost ? `${T.totalCost.currency} ${pt.toFormatString({
431
431
  value: T.totalCost
432
432
  })}` : void 0
433
433
  };
434
- }), m = e.deliveryOrder.map((T) => ({
434
+ }), c = e.deliveryOrder.map((T) => ({
435
435
  createdAt: tt(new Date(T.createdAt)),
436
436
  ref: T.deliveryOrderNumber,
437
437
  remark: T.remark || "",
@@ -444,32 +444,32 @@ function Ct(S) {
444
444
  unit: ((K = F.measurement) == null ? void 0 : K.abbrev) || F.sku.unit.abbrev
445
445
  };
446
446
  })
447
- })), l = [
447
+ })), u = [
448
448
  // Production
449
449
  "67ca5d2c80bd0e001c5bf5bc",
450
450
  // Dev
451
451
  "6880b36a3054c5001db19218"
452
452
  ];
453
- let n = "Inventory Receive Note";
454
- if (e.supplier.internal ? (n = "Inventory Transfer Note", l.includes((b == null ? void 0 : b._id) || "") && (n = "Stock Request")) : n = "Purchase Order", t) {
453
+ let o = "Inventory Receive Note";
454
+ if (e.supplier.internal ? (o = "Inventory Transfer Note", u.includes((g == null ? void 0 : g._id) || "") && (o = "Stock Request")) : o = "Purchase Order", t) {
455
455
  const T = t.from.dbName;
456
- i.dbName === T || (n = "Inventory Receive Note");
456
+ i.dbName === T || (o = "Inventory Receive Note");
457
457
  }
458
- const x = {
459
- title: n,
460
- businessName: b == null ? void 0 : b.name,
461
- logo: b == null ? void 0 : b.thumbnail,
458
+ const D = {
459
+ title: o,
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: _,
468
- items: p,
467
+ supplier: S,
468
+ items: f,
469
469
  status: e.status,
470
- deliveryOrders: m
471
- }, q = new URL(window.location.href), V = c && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
472
- q.pathname = q.hostname.includes("portal.feedme") ? `/inventory/${V}` : `/${V}`, q.searchParams.append("data", JSON.stringify(x)), window.open(q.href, "_blank", "noreferrer");
470
+ deliveryOrders: c
471
+ }, q = new URL(window.location.href), j = d && (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(D)), window.open(q.href, "_blank", "noreferrer");
473
473
  }
474
474
  const be = {
475
475
  submitRequest: {
@@ -533,70 +533,70 @@ const be = {
533
533
  value: O.enum.returnStock
534
534
  }
535
535
  };
536
- function Es(S, e) {
537
- const i = de(), b = qe(), c = Ae(), { t } = at();
538
- function u(m) {
539
- switch (m.status) {
536
+ function Es(_, e) {
537
+ const i = de(), g = qe(), d = Ae(), { t } = at();
538
+ function l(c) {
539
+ switch (c.status) {
540
540
  case "DRAFT":
541
541
  return [
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],
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],
545
545
  be[O.enum.cancelDraft]
546
546
  ];
547
547
  case "RECEIVING":
548
548
  return [
549
549
  be[O.enum.completeReceive],
550
- re[Z.Details],
551
- re[Z.Print]
550
+ re[J.Details],
551
+ re[J.Print]
552
552
  ];
553
553
  case "REQUESTING":
554
- return S === "receive/request" ? [re[Z.Details], re[Z.Print]] : [
554
+ return _ === "receive/request" ? [re[J.Details], re[J.Print]] : [
555
555
  be[O.enum.approveRequest],
556
556
  be[O.enum.rejectRequest],
557
- re[Z.Details]
557
+ re[J.Details]
558
558
  // DefaultRowActions[RowActionEnum.Print]
559
559
  ];
560
560
  case "PROCESSING":
561
- return [re[Z.Details], re[Z.Print]];
561
+ return [re[J.Details], re[J.Print]];
562
562
  case "COMPLETE":
563
563
  case "CANCEL":
564
564
  default:
565
- return [re[Z.Details], re[Z.Print]];
565
+ return [re[J.Details], re[J.Print]];
566
566
  }
567
567
  }
568
- function o(m) {
569
- return Object.values(O.enum).includes(m);
568
+ function n(c) {
569
+ return Object.values(O.enum).includes(c);
570
570
  }
571
- async function s(m, l, n) {
572
- var x, q, V, T, F, K;
573
- const g = 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 = g.netSuite) != null && q.refNo) && (g.ref = [((V = n == null ? void 0 : n.netSuite) == null ? void 0 : V.refNo) || ((T = g.netSuite) == null ? void 0 : T.refNo)].filter((le) => le).join(" ")), Ct({
577
- po: g,
578
- currentLocation: W,
579
- business: c.currentBusiness.value,
580
- fulfilling: S === "approval",
581
- por: n
571
+ async function s(c, u, o) {
572
+ var D, q, j, T, F, K;
573
+ const v = et(u);
574
+ if (c === J.Print) {
575
+ const G = (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 = [((j = o == null ? void 0 : o.netSuite) == null ? void 0 : j.refNo) || ((T = v.netSuite) == null ? void 0 : T.refNo)].filter((le) => le).join(" ")), Ct({
577
+ po: v,
578
+ currentLocation: G,
579
+ business: d.currentBusiness.value,
580
+ fulfilling: _ === "approval",
581
+ por: o
582
582
  });
583
583
  return;
584
584
  }
585
- if (m === Z.Details) {
586
- e.promptShowTransferDetails(g, n);
585
+ if (c === J.Details) {
586
+ e.promptShowTransferDetails(v, o);
587
587
  return;
588
588
  }
589
- if (m === Z.Update) {
590
- (F = e.promptUpdateTransferDialog) == null || F.call(e, g);
589
+ if (c === J.Update) {
590
+ (F = e.promptUpdateTransferDialog) == null || F.call(e, v);
591
591
  return;
592
592
  }
593
- if (o(m)) {
594
- e.submitAction(l, m, (K = n == null ? void 0 : n.to) == null ? void 0 : K.dbName);
593
+ if (n(c)) {
594
+ e.submitAction(u, c, (K = o == null ? void 0 : o.to) == null ? void 0 : K.dbName);
595
595
  return;
596
596
  }
597
597
  }
598
598
  function y() {
599
- const m = [
599
+ const c = [
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(l) {
611
- return xe(`${l.getValue()}`);
610
+ cell(u) {
611
+ return xe(`${u.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(l) {
639
- const n = t(`inventory.transfer.status.${l.getValue() ?? ""}`), g = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
638
+ cell(u) {
639
+ const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.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-${g}`
648
+ class: `fm-status-badge fm-status-badge-${v}`
649
649
  },
650
- n
650
+ o
651
651
  )
652
652
  );
653
653
  },
@@ -656,9 +656,9 @@ function Es(S, e) {
656
656
  },
657
657
  {
658
658
  id: "action",
659
- cell(l) {
660
- const n = l.row.original, g = u(n);
661
- return Qe(g, (x) => s(x, n));
659
+ cell(u) {
660
+ const o = u.row.original, v = l(o);
661
+ return Qe(v, (D) => s(D, o));
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 (b.isEnabled) {
672
- const l = [
671
+ if (g.isEnabled) {
672
+ const u = [
673
673
  {
674
674
  id: "netsuiteTransferOrder",
675
675
  header: () => "NetSuite Order (ID)",
676
- cell(n) {
677
- var x;
678
- const g = n.row.original;
679
- return (x = g.netSuite) != null && x.id ? `${g.netSuite.refNo} (${g.netSuite.id})` : "N/A";
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";
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(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";
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";
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
- m.splice(m.length - 2, 0, ...l);
703
+ c.splice(c.length - 2, 0, ...u);
704
704
  }
705
- return m;
705
+ return c;
706
706
  }
707
- function _() {
708
- const m = [
707
+ function S() {
708
+ const c = [
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(l) {
720
- return xe(`${l.getValue()}`);
719
+ cell(u) {
720
+ return xe(`${u.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(l) {
745
- const n = t(`inventory.transfer.status.${l.getValue() ?? ""}`), g = `${l.getValue() ?? ""}`.toLocaleLowerCase("en-us");
744
+ cell(u) {
745
+ const o = t(`inventory.transfer.status.${u.getValue() ?? ""}`), v = `${u.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-${g}`
754
+ class: `fm-status-badge fm-status-badge-${v}`
755
755
  },
756
- n
756
+ o
757
757
  )
758
758
  );
759
759
  },
@@ -761,14 +761,14 @@ function Es(S, e) {
761
761
  },
762
762
  {
763
763
  id: "action",
764
- cell(l) {
765
- const n = l.row.original, x = (n.purchaseOrder ? u(n.purchaseOrder) : []).map((q) => q.value === Z.Print ? {
764
+ cell(u) {
765
+ const o = u.row.original, D = (o.purchaseOrder ? l(o.purchaseOrder) : []).map((q) => q.value === J.Print ? {
766
766
  ...q,
767
767
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
768
768
  } : q);
769
769
  return Qe(
770
- x,
771
- (q) => n.purchaseOrder ? s(q, n.purchaseOrder, n) : void 0
770
+ D,
771
+ (q) => o.purchaseOrder ? s(q, o.purchaseOrder, o) : 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 (b.isEnabled) {
783
- const l = [
782
+ if (g.isEnabled) {
783
+ const u = [
784
784
  {
785
785
  id: "netsuiteTransferOrder",
786
786
  header: () => "NetSuite Order (ID)",
787
- cell(n) {
788
- var x;
789
- const g = n.row.original;
790
- return (x = g.netSuite) != null && x.id ? `${g.netSuite.refNo} (${g.netSuite.id})` : "N/A";
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";
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(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";
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";
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
- m.splice(m.length - 2, 0, ...l);
814
+ c.splice(c.length - 2, 0, ...u);
815
815
  }
816
- return m;
816
+ return c;
817
817
  }
818
818
  return {
819
- columnDefs: Q(() => S === "receive/request" ? y() : _())
819
+ columnDefs: Z(() => _ === "receive/request" ? y() : S())
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({
@@ -826,44 +826,42 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
826
826
  confirm: { type: Function }
827
827
  },
828
828
  emits: ["update:show"],
829
- setup(S, { emit: e }) {
830
- const i = S, b = ht({
829
+ setup(_, { emit: e }) {
830
+ const i = _, g = ht({
831
831
  id: "",
832
832
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
833
833
  items: []
834
- }), c = j(), t = e;
835
- nt(() => {
836
- i.purchaseOrder && (b.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 }
834
+ }), d = M(), t = e;
835
+ return nt(() => {
836
+ i.purchaseOrder && (g.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 }
841
841
  })));
842
- });
843
- const u = Q(() => b.items.length <= 10);
844
- return (o, s) => {
845
- const y = z("FmTable"), _ = z("FmButton"), p = z("FmForm");
846
- return h(), ae(p, {
842
+ }), (l, n) => {
843
+ const s = z("FmTable"), y = z("FmButton"), S = z("FmForm");
844
+ return b(), ae(S, {
847
845
  ref_key: "formRef",
848
- ref: c,
846
+ ref: d,
849
847
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
850
848
  onValidationFailed: console.log,
851
- onValidationSuccess: s[1] || (s[1] = () => i.confirm(b))
849
+ onValidationSuccess: n[1] || (n[1] = () => i.confirm(g))
852
850
  }, {
853
851
  default: se(() => [
854
- s[2] || (s[2] = a("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
852
+ n[2] || (n[2] = a("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
855
853
  a("div", Pt, [
856
854
  a("div", It, [
857
- I(y, {
855
+ I(s, {
858
856
  "column-defs": [
859
857
  {
860
858
  header: "Code",
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);
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);
863
861
  return A(
864
- v(Je).FmTooltip,
862
+ h(Je).FmTooltip,
865
863
  {
866
- content: l.code,
864
+ content: c.code,
867
865
  placement: "top",
868
866
  variant: "plain",
869
867
  zIndex: 50
@@ -873,19 +871,19 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
873
871
  {
874
872
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
875
873
  },
876
- l.code
874
+ c.code
877
875
  )
878
876
  );
879
877
  }
880
878
  },
881
879
  {
882
880
  header: "Name",
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);
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);
885
883
  return A(
886
- v(Je).FmTooltip,
884
+ h(Je).FmTooltip,
887
885
  {
888
- content: l.name,
886
+ content: c.name,
889
887
  placement: "top",
890
888
  variant: "plain",
891
889
  zIndex: 50
@@ -895,15 +893,15 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
895
893
  {
896
894
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
897
895
  },
898
- l.name
896
+ c.name
899
897
  )
900
898
  );
901
899
  }
902
900
  },
903
901
  {
904
902
  header: "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), g = l.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 ?? {
907
905
  amount: 1,
908
906
  precision: 0
909
907
  };
@@ -912,47 +910,47 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
912
910
  flex: "1 1 0%"
913
911
  },
914
912
  modelValue: {
915
- amount: g,
916
- measurement: l.measurement ?? null
913
+ amount: o,
914
+ measurement: c.measurement ?? null
917
915
  },
918
- key: l.id ?? l.sku._id,
919
- unit: l.sku.unit,
920
- "onUpdate:modelValue": (x) => {
921
- if (!x) return;
922
- const q = b.items.find((V) => V.id === l.id || V.sku._id === l.sku._id);
923
- q && (q.amount = x.amount);
916
+ key: c.id ?? c.sku._id,
917
+ unit: c.sku.unit,
918
+ "onUpdate:modelValue": (v) => {
919
+ if (!v) return;
920
+ const D = g.items.find((q) => q.id === c.id || q.sku._id === c.sku._id);
921
+ D && (D.amount = v.amount);
924
922
  },
925
923
  disableUnit: !0,
926
924
  rules: [
927
- v(Dt)(
928
- +v(ie)({ amount: 0, precision: 0 })
925
+ h(Dt)(
926
+ +h(ie)({ amount: 0, precision: 0 })
929
927
  ),
930
- v(qt)(+v(ie)(n.quantity))
928
+ h(qt)(+h(ie)(u.quantity))
931
929
  ],
932
930
  applyDefaultRules: !0
933
931
  });
934
932
  }
935
933
  }
936
934
  ],
937
- "row-data": b.items,
938
- "hide-footer": u.value
939
- }, null, 8, ["column-defs", "row-data", "hide-footer"])
935
+ "row-data": g.items,
936
+ "hide-footer": !0
937
+ }, null, 8, ["column-defs", "row-data"])
940
938
  ])
941
939
  ]),
942
940
  a("div", Ft, [
943
- I(_, {
941
+ I(y, {
944
942
  class: "px-16",
945
943
  label: "Confirm",
946
944
  size: "md",
947
945
  variant: "primary",
948
946
  type: "submit"
949
947
  }),
950
- I(_, {
948
+ I(y, {
951
949
  class: "px-16",
952
950
  label: "Cancel",
953
951
  size: "md",
954
952
  variant: "secondary",
955
- onClick: s[0] || (s[0] = () => t("update:show", !1))
953
+ onClick: n[0] || (n[0] = () => t("update:show", !1))
956
954
  })
957
955
  ])
958
956
  ]),
@@ -1026,23 +1024,23 @@ const Pt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1026
1024
  }
1027
1025
  };
1028
1026
  function Et() {
1029
- const S = De();
1027
+ const _ = De();
1030
1028
  return {
1031
1029
  ableToMarkReceived(e) {
1032
1030
  if (!e || e.status !== ue.enum.RECEIVING)
1033
1031
  return !1;
1034
- const b = de().currentLocationDBName;
1035
- return `${e.supplier.internal}_${e.supplier._id}` !== b;
1032
+ const g = de().currentLocationDBName;
1033
+ return `${e.supplier.internal}_${e.supplier._id}` !== g;
1036
1034
  },
1037
1035
  ableToMarkApproved(e) {
1038
1036
  return !(!e || (e == null ? void 0 : e.status) !== ue.enum.REQUESTING);
1039
1037
  },
1040
1038
  ableToCreateFulfillment(e, i) {
1041
- var t, u;
1042
- if (!S.acceptRequireFulfillment || !e || !i || e.status !== ue.enum.PROCESSING || !i.processedAt)
1039
+ var t, l;
1040
+ if (!_.acceptRequireFulfillment || !e || !i || e.status !== ue.enum.PROCESSING || !i.processedAt)
1043
1041
  return !1;
1044
- const b = (t = i == null ? void 0 : i.from) == null ? void 0 : t.dbName, c = (u = i == null ? void 0 : i.to) == null ? void 0 : u.dbName;
1045
- return !(b.startsWith("restaurant_") && c.startsWith("restaurant_"));
1042
+ const g = (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 !(g.startsWith("restaurant_") && d.startsWith("restaurant_"));
1046
1044
  }
1047
1045
  };
1048
1046
  }
@@ -1054,17 +1052,17 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1054
1052
  isTransferBetweenOutlets: { type: Boolean },
1055
1053
  scope: {}
1056
1054
  },
1057
- setup(S) {
1058
- const e = S, i = qe(), b = Te(), c = Me(), t = j(!1);
1059
- Q(() => {
1060
- var _, p, m, l;
1061
- let o = !0;
1062
- i.isEnabled || (o = !1);
1055
+ setup(_) {
1056
+ const e = _, i = qe(), g = Te(), d = Me(), t = M(!1);
1057
+ Z(() => {
1058
+ var S, f, c, u;
1059
+ let n = !0;
1060
+ i.isEnabled || (n = !1);
1063
1061
  const s = e.purchaseOrder, y = e.poRequest;
1064
- return s && ((_ = s == null ? void 0 : s.supplier) != null && _.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;
1062
+ return s && ((S = s == null ? void 0 : s.supplier) != null && S.internal ? (!y && s.status == ue.enum.DRAFT && (n = !1), y && !((f = y == null ? void 0 : y.netSuite) != null && f.id) && (n = !1), e.isTransferBetweenOutlets && (n = !1)) : ((s == null ? void 0 : s.status) !== ue.enum.REQUESTING && s.supplier.internal && (n = !1), !y && !((c = s == null ? void 0 : s.netSuite) != null && c.id) && (n = !1), !y && ((u = s == null ? void 0 : s.netSuite) != null && u.id) && (s == null ? void 0 : s.status) == ue.enum.REQUESTING && (n = !1))), n;
1065
1063
  });
1066
- async function u() {
1067
- t.value || c.open({
1064
+ async function l() {
1065
+ t.value || d.open({
1068
1066
  title: "Sync with NetSuite",
1069
1067
  contentComponent: A("div", [
1070
1068
  A("p", "Are you sure you want to sync now?"),
@@ -1082,20 +1080,20 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1082
1080
  },
1083
1081
  secondaryActions: { text: "Not now", close: !0 }
1084
1082
  }).onPrimary(async () => {
1085
- var o, s, y;
1083
+ var n, s, y;
1086
1084
  try {
1087
1085
  t.value = !0;
1088
- const _ = ((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;
1086
+ const S = ((n = e.purchaseOrder) == null ? void 0 : n._id) || ((s = e.poRequest) == null ? void 0 : s.purchaseOrderId) || "", f = (y = e.poRequest) == null ? void 0 : y.to.dbName;
1089
1087
  await i.syncPurchaseOrder(
1090
- _,
1091
- e.scope === "approval" ? p : void 0
1092
- ), b.open({
1088
+ S,
1089
+ e.scope === "approval" ? f : void 0
1090
+ ), g.open({
1093
1091
  title: "Sync with NetSuite",
1094
1092
  message: "Requested to sync with NetSuite. Please wait a moment.",
1095
1093
  type: "success"
1096
- }), await new Promise((m) => setTimeout(m, 5e3)), t.value = !1;
1094
+ }), await new Promise((c) => setTimeout(c, 5e3)), t.value = !1;
1097
1095
  } catch {
1098
- b.open({
1096
+ g.open({
1099
1097
  title: "Error",
1100
1098
  message: "Failed to sync with NetSuite",
1101
1099
  type: "error"
@@ -1103,15 +1101,15 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1103
1101
  }
1104
1102
  });
1105
1103
  }
1106
- return (o, s) => {
1104
+ return (n, s) => {
1107
1105
  const y = z("FmButton");
1108
- return h(), N("div", Lt, [
1106
+ return b(), N("div", Lt, [
1109
1107
  I(y, {
1110
1108
  "prepend-icon": "sync",
1111
1109
  variant: "secondary",
1112
1110
  label: "Sync",
1113
1111
  loading: t.value,
1114
- onClick: u,
1112
+ onClick: l,
1115
1113
  "text-color": "primary",
1116
1114
  "bg-color": "transparent",
1117
1115
  "border-color": "primary"
@@ -1125,7 +1123,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1125
1123
  }, Mt = { class: "flex flex-col gap-4" }, jt = { class: "fm-typo-en-body-lg-600" }, Kt = {
1126
1124
  key: 0,
1127
1125
  class: "flex flex-col gap-4"
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 = {
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 = {
1129
1127
  key: 1,
1130
1128
  class: "flex flex-col gap-4"
1131
1129
  }, 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 = {
@@ -1144,60 +1142,60 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1144
1142
  isTransferBetweenOutlets: { type: Boolean },
1145
1143
  scope: {}
1146
1144
  },
1147
- setup(S) {
1148
- const e = S, i = qe(), b = $e(), c = j(e.poRequest);
1145
+ setup(_) {
1146
+ const e = _, i = qe(), g = $e(), d = M(e.poRequest);
1149
1147
  nt(async () => {
1150
1148
  var s;
1151
1149
  if (!e.poRequest && ((s = e.purchaseOrder) != null && s._id)) {
1152
- const y = await b.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1153
- c.value = y;
1150
+ const y = await g.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1151
+ d.value = y;
1154
1152
  }
1155
1153
  });
1156
- const t = Q(
1154
+ const t = Z(
1157
1155
  () => {
1158
- var s, y, _, p, m, l;
1156
+ var s, y, S, f, c, u;
1159
1157
  return i.getSubsidiaryFullName(
1160
- ((_ = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : _.id) || ((l = (m = (p = e.poRequest) == null ? void 0 : p.netSuite) == null ? void 0 : m.subsidiary) == null ? void 0 : l.id)
1158
+ ((S = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : S.id) || ((u = (c = (f = e.poRequest) == null ? void 0 : f.netSuite) == null ? void 0 : c.subsidiary) == null ? void 0 : u.id)
1161
1159
  ).fullName;
1162
1160
  }
1163
- ), u = Q(() => {
1164
- var s, y, _, p, m, l, n, g, x, q, V, T;
1165
- return (_ = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.additionalInfo) != null && _.transactionnumber ? (l = (m = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : m.additionalInfo) == null ? void 0 : l.transactionnumber : (x = (g = (n = c.value) == null ? void 0 : n.netSuite) == null ? void 0 : g.additionalInfo) != null && x.transactionnumber ? (T = (V = (q = c.value) == null ? void 0 : q.netSuite) == null ? void 0 : V.additionalInfo) == null ? void 0 : T.transactionnumber : null;
1166
- }), o = Q(() => {
1167
- var s, y, _, p, m, l;
1168
- return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((p = (_ = e.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) == null ? void 0 : p.length) > 0 ? (l = (m = e.purchaseOrder) == null ? void 0 : m.deliveryFullfillment) == null ? void 0 : l.map((n) => {
1169
- var g;
1170
- return (g = n.netSuite) == null ? void 0 : g.refNo;
1161
+ ), l = Z(() => {
1162
+ var s, y, S, f, c, u, o, v, D, q, j, T;
1163
+ return (S = (y = (s = e.purchaseOrder) == null ? void 0 : s.netSuite) == null ? void 0 : y.additionalInfo) != null && S.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 ? (T = (j = (q = d.value) == null ? void 0 : q.netSuite) == null ? void 0 : j.additionalInfo) == null ? void 0 : T.transactionnumber : null;
1164
+ }), n = Z(() => {
1165
+ var s, y, S, f, c, u;
1166
+ return (y = (s = e.purchaseOrder) == null ? void 0 : s.deliveryFullfillment) != null && y.length && ((f = (S = e.purchaseOrder) == null ? void 0 : S.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;
1171
1169
  }).join(", ") : "N/A";
1172
1170
  });
1173
1171
  return (s, y) => {
1174
- var _, p, m, l, n, g, x, q, V, T, F, K, W, le, oe, ye;
1175
- return v(i).isEnabled ? (h(), N("div", Vt, [
1172
+ var S, f, c, u, o, v, D, q, j, T, F, K, G, le, oe, ye;
1173
+ return h(i).isEnabled ? (b(), N("div", Vt, [
1176
1174
  a("div", Mt, [
1177
1175
  y[0] || (y[0] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1178
1176
  a("div", jt, k(t.value || "N/A"), 1)
1179
1177
  ]),
1180
- !s.isTransferBetweenOutlets && s.scope === v(Ue).RECEIVE_REQUEST ? (h(), N("div", Kt, [
1181
- a("div", zt, " NetSuite " + k((p = (_ = s.purchaseOrder) == null ? void 0 : _.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),
1178
+ !s.isTransferBetweenOutlets && s.scope === h(Ue).RECEIVE_REQUEST ? (b(), N("div", Kt, [
1179
+ a("div", zt, " NetSuite " + k((f = (S = s.purchaseOrder) == null ? void 0 : S.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),
1182
1180
  a("div", Ht, [
1183
- (g = (n = s.purchaseOrder) == null ? void 0 : n.netSuite) != null && g.id ? (h(), N("span", Wt, k((q = (x = s.purchaseOrder) == null ? void 0 : x.netSuite) == null ? void 0 : q.refNo) + " (" + k((T = (V = s.purchaseOrder) == null ? void 0 : V.netSuite) == null ? void 0 : T.id) + ") ", 1)) : (h(), N("span", Gt, "N/A"))
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((T = (j = s.purchaseOrder) == null ? void 0 : j.netSuite) == null ? void 0 : T.id) + ") ", 1)) : (b(), N("span", Wt, "N/A"))
1184
1182
  ])
1185
- ])) : M("", !0),
1186
- !s.isTransferBetweenOutlets && c.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),
1183
+ ])) : V("", !0),
1184
+ !s.isTransferBetweenOutlets && d.value || s.scope === h(Ue).APPROVAL ? (b(), N("div", Yt, [
1185
+ a("div", Qt, " (Request) NetSuite " + k(s.transferType === h(fe).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1188
1186
  a("div", Xt, [
1189
- (K = (F = c.value) == null ? void 0 : F.netSuite) != null && K.id ? (h(), N("span", Jt, k((le = (W = c.value) == null ? void 0 : W.netSuite) == null ? void 0 : le.refNo) + " (" + k((ye = (oe = c.value) == null ? void 0 : oe.netSuite) == null ? void 0 : ye.id) + ") ", 1)) : (h(), N("span", Zt, "N/A"))
1187
+ (K = (F = d.value) == null ? void 0 : F.netSuite) != null && K.id ? (b(), N("span", Jt, k((le = (G = d.value) == null ? void 0 : G.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"))
1190
1188
  ])
1191
- ])) : M("", !0),
1192
- u.value ? (h(), N("div", er, [
1189
+ ])) : V("", !0),
1190
+ l.value ? (b(), N("div", er, [
1193
1191
  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(u.value), 1)
1195
- ])) : M("", !0),
1196
- v(i).isEnabled && s.transferType === v(fe).TRANSFER && !s.isTransferBetweenOutlets ? (h(), N("div", rr, [
1192
+ a("div", tr, k(l.value), 1)
1193
+ ])) : V("", !0),
1194
+ h(i).isEnabled && s.transferType === h(fe).TRANSFER && !s.isTransferBetweenOutlets ? (b(), N("div", rr, [
1197
1195
  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)
1199
- ])) : M("", !0)
1200
- ])) : M("", !0);
1196
+ a("div", sr, k(n.value), 1)
1197
+ ])) : V("", !0)
1198
+ ])) : V("", !0);
1201
1199
  };
1202
1200
  }
1203
1201
  }), ar = { class: "flex flex-row-reverse" }, or = /* @__PURE__ */ pe({
@@ -1206,31 +1204,31 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1206
1204
  netsuiteId: {},
1207
1205
  purchaseOrderId: {}
1208
1206
  },
1209
- setup(S) {
1207
+ setup(_) {
1210
1208
  const e = Te(), i = st();
1211
- async function b(c, t) {
1212
- let u = `attributes.pod:netsuite* AND body.message:*${c}*`;
1209
+ async function g(d, t) {
1210
+ let l = `attributes.pod:netsuite* AND body.message:*${d}*`;
1213
1211
  if (t) {
1214
1212
  const s = t.replace(/:/g, "\\:");
1215
- u = `attributes.pod:netsuite* AND (body.message:*${c}* OR ${s})`;
1213
+ l = `attributes.pod:netsuite* AND (body.message:*${d}* OR ${s})`;
1216
1214
  }
1217
- const { url: o } = await i.getLogs(u);
1215
+ const { url: n } = await i.getLogs(l);
1218
1216
  e.open(
1219
1217
  {
1220
1218
  message: "Opening NetSuite logs...",
1221
1219
  type: "info"
1222
1220
  },
1223
1221
  800
1224
- ), await new Promise((s) => setTimeout(s, 800)), window.open(o, "_blank");
1222
+ ), await new Promise((s) => setTimeout(s, 800)), window.open(n, "_blank");
1225
1223
  }
1226
- return (c, t) => {
1227
- const u = z("FmButton");
1228
- return h(), N("div", ar, [
1229
- I(u, {
1224
+ return (d, t) => {
1225
+ const l = z("FmButton");
1226
+ return b(), N("div", ar, [
1227
+ I(l, {
1230
1228
  "prepend-icon": "history",
1231
1229
  variant: "secondary",
1232
1230
  label: "Logs",
1233
- onClick: t[0] || (t[0] = (o) => b(c.netsuiteId, c.purchaseOrderId)),
1231
+ onClick: t[0] || (t[0] = (n) => g(d.netsuiteId, d.purchaseOrderId)),
1234
1232
  "text-color": "primary",
1235
1233
  "bg-color": "transparent",
1236
1234
  "border-color": "primary"
@@ -1247,68 +1245,68 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1247
1245
  netsuiteId: {},
1248
1246
  purchaseOrderId: {}
1249
1247
  },
1250
- setup(S) {
1251
- const e = S, i = st(), b = j(!1), c = de(), t = j(!0), u = j(!1), o = j(null);
1248
+ setup(_) {
1249
+ const e = _, i = st(), g = M(!1), d = de(), t = M(!0), l = M(!1), n = M(null);
1252
1250
  async function s() {
1253
- if (!o.value) {
1254
- b.value = !0;
1251
+ if (!n.value) {
1252
+ g.value = !0;
1255
1253
  try {
1256
1254
  t.value = !0;
1257
1255
  const y = await i.getMoreInfo(
1258
- c.currentLocation.dbName,
1256
+ d.currentLocation.dbName,
1259
1257
  e.purchaseOrderId
1260
1258
  );
1261
- o.value = y, u.value = !1;
1259
+ n.value = y, l.value = !1;
1262
1260
  } catch {
1263
- u.value = !0;
1261
+ l.value = !0;
1264
1262
  } finally {
1265
1263
  t.value = !1;
1266
1264
  }
1267
1265
  }
1268
1266
  }
1269
- return (y, _) => {
1270
- const p = z("FmButton"), m = z("FmLabel"), l = z("FmDialog");
1271
- return h(), N("div", ir, [
1272
- I(l, {
1273
- modelValue: b.value,
1274
- "onUpdate:modelValue": _[2] || (_[2] = (n) => b.value = n),
1267
+ return (y, S) => {
1268
+ const f = z("FmButton"), c = z("FmLabel"), u = z("FmDialog");
1269
+ return b(), N("div", ir, [
1270
+ I(u, {
1271
+ modelValue: g.value,
1272
+ "onUpdate:modelValue": S[2] || (S[2] = (o) => g.value = o),
1275
1273
  overlay: !0
1276
1274
  }, {
1277
1275
  "dialog-button": se(() => [
1278
- I(p, {
1276
+ I(f, {
1279
1277
  "prepend-icon": "info",
1280
1278
  variant: "secondary",
1281
1279
  label: "Latest Info",
1282
- onClick: _[0] || (_[0] = (n) => s()),
1280
+ onClick: S[0] || (S[0] = (o) => s()),
1283
1281
  "text-color": "primary",
1284
1282
  "bg-color": "transparent",
1285
1283
  "border-color": "primary"
1286
1284
  })
1287
1285
  ]),
1288
- "dialog-header": se(() => _[3] || (_[3] = [
1286
+ "dialog-header": se(() => S[3] || (S[3] = [
1289
1287
  a("div", null, "NetSuite latest info", -1)
1290
1288
  ])),
1291
1289
  "dialog-footer": se(() => [
1292
- I(p, {
1290
+ I(f, {
1293
1291
  class: "ml-auto sm:w-full xs:w-full",
1294
1292
  label: "Close",
1295
1293
  size: "md",
1296
1294
  variant: "primary",
1297
- onClick: _[1] || (_[1] = (n) => b.value = !1)
1295
+ onClick: S[1] || (S[1] = (o) => g.value = !1)
1298
1296
  })
1299
1297
  ]),
1300
1298
  default: se(() => [
1301
- t.value ? (h(), N("div", lr, "Loading...")) : (h(), N("div", cr, [
1302
- u.value ? (h(), N("p", fr, "Something went wrong.")) : (h(!0), N(te, { key: 0 }, me(o.value, (n, g) => (h(), N("div", {
1303
- key: g,
1299
+ t.value ? (b(), N("div", lr, "Loading...")) : (b(), N("div", cr, [
1300
+ l.value ? (b(), N("p", fr, "Something went wrong.")) : (b(!0), N(te, { key: 0 }, me(n.value, (o, v) => (b(), N("div", {
1301
+ key: v,
1304
1302
  class: "mb-2"
1305
1303
  }, [
1306
1304
  a("div", null, [
1307
- I(m, {
1308
- label: v(Ve)(g)
1305
+ I(c, {
1306
+ label: h(Ve)(v)
1309
1307
  }, null, 8, ["label"]),
1310
1308
  a("div", ur, [
1311
- Array.isArray(n) ? (h(), N("span", dr, k(n.length > 0 ? n.join(", ") : "N/A"), 1)) : (h(), N("span", mr, k(n), 1))
1309
+ Array.isArray(o) ? (b(), N("span", dr, k(o.length > 0 ? o.join(", ") : "N/A"), 1)) : (b(), N("span", mr, k(o), 1))
1312
1310
  ])
1313
1311
  ])
1314
1312
  ]))), 128))
@@ -1331,49 +1329,49 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1331
1329
  transferToDbName: {},
1332
1330
  scope: {}
1333
1331
  },
1334
- setup(S) {
1335
- const e = S, i = Tt(), b = Ae(), c = Q(() => {
1336
- var s, y, _, p, m, l, n;
1337
- const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : _.internal) === "restaurant", u = e.transferType === fe.PURCHASE, o = e.transferType === fe.TRANSFER;
1338
- return u || 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);
1332
+ setup(_) {
1333
+ const e = _, i = Tt(), g = Ae(), d = Z(() => {
1334
+ var s, y, S, f, c, u, o;
1335
+ const t = ((s = e.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((S = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : S.internal) === "restaurant", l = e.transferType === fe.PURCHASE, n = e.transferType === fe.TRANSFER;
1336
+ return l || n && !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);
1339
1337
  });
1340
- return (t, u) => {
1341
- var s, y, _, p, m, l, n, g, x, q, V, T;
1342
- const o = z("FmMenuDivider");
1343
- return v(i).isNetSuiteEnabled && c.value ? (h(), N("div", yr, [
1338
+ return (t, l) => {
1339
+ var s, y, S, f, c, u, o, v, D, q, j, T;
1340
+ const n = z("FmMenuDivider");
1341
+ return h(i).isNetSuiteEnabled && d.value ? (b(), N("div", yr, [
1344
1342
  a("div", vr, [
1345
- u[0] || (u[0] = a("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1343
+ l[0] || (l[0] = a("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1346
1344
  a("div", hr, [
1347
1345
  a("div", br, [
1348
- (s = v(b).sessionUser.value) != null && s.role.isAdmin && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && _.id) ? (h(), ae(pr, {
1346
+ (s = h(g).sessionUser.value) != null && s.role.isAdmin && ((S = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && S.id) ? (b(), ae(pr, {
1349
1347
  key: 0,
1350
- "netsuite-id": (m = (p = t.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : m.id,
1351
- "purchase-order-id": (l = t.purchaseOrder) == null ? void 0 : l._id
1352
- }, null, 8, ["netsuite-id", "purchase-order-id"])) : M("", !0),
1353
- (n = v(b).sessionUser.value) != null && n.role.isAdmin && ((x = (g = e.purchaseOrder) == null ? void 0 : g.netSuite) != null && x.id) ? (h(), ae(or, {
1348
+ "netsuite-id": (c = (f = t.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : c.id,
1349
+ "purchase-order-id": (u = t.purchaseOrder) == null ? void 0 : u._id
1350
+ }, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
1351
+ (o = h(g).sessionUser.value) != null && o.role.isAdmin && ((D = (v = e.purchaseOrder) == null ? void 0 : v.netSuite) != null && D.id) ? (b(), ae(or, {
1354
1352
  key: 1,
1355
- "netsuite-id": (V = (q = t.purchaseOrder) == null ? void 0 : q.netSuite) == null ? void 0 : V.id,
1353
+ "netsuite-id": (j = (q = t.purchaseOrder) == null ? void 0 : q.netSuite) == null ? void 0 : j.id,
1356
1354
  "purchase-order-id": (T = t.purchaseOrder) == null ? void 0 : T._id
1357
- }, null, 8, ["netsuite-id", "purchase-order-id"])) : M("", !0),
1355
+ }, null, 8, ["netsuite-id", "purchase-order-id"])) : V("", !0),
1358
1356
  I(Ut, {
1359
1357
  "po-request": t.poRequest,
1360
1358
  "purchase-order": t.purchaseOrder,
1361
- "is-transfer-between-outlets": !c.value,
1359
+ "is-transfer-between-outlets": !d.value,
1362
1360
  scope: t.scope
1363
1361
  }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
1364
1362
  ])
1365
1363
  ])
1366
1364
  ]),
1367
- I(o),
1365
+ I(n),
1368
1366
  I(nr, {
1369
1367
  "po-request": t.poRequest,
1370
1368
  "purchase-order": t.purchaseOrder,
1371
1369
  "transfer-type": t.transferType,
1372
1370
  "transfer-to-db-name": t.transferToDbName,
1373
- "is-transfer-between-outlets": !c.value,
1371
+ "is-transfer-between-outlets": !d.value,
1374
1372
  scope: t.scope
1375
1373
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
1376
- ])) : M("", !0);
1374
+ ])) : V("", !0);
1377
1375
  };
1378
1376
  }
1379
1377
  }), _r = { class: "flex flex-col gap-16 w-full h-full" }, Sr = { class: "flex justify-between" }, wr = { class: "fm-typo-en-body-lg-600" }, Rr = { class: "flex flex-col gap-8" }, Or = { class: "flex flex-col gap-4" }, Nr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, kr = { class: "flex gap-1" }, xr = { class: "fm-typo-en-body-lg-600" }, Dr = {
@@ -1391,7 +1389,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1391
1389
  }, Vr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Mr = { class: "fm-typo-en-body-lg-600" }, jr = {
1392
1390
  key: 4,
1393
1391
  class: "flex flex-col gap-4"
1394
- }, 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 = {
1392
+ }, 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 = {
1395
1393
  key: 0,
1396
1394
  class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1397
1395
  }, ss = { class: "py-8" }, ns = { class: "flex justify-end gap-4 items-center" }, as = { class: "fm-typo-en-body-lg-600" }, os = {
@@ -1428,32 +1426,32 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1428
1426
  scope: {}
1429
1427
  },
1430
1428
  emits: ["update:show", "submitted"],
1431
- setup(S, { emit: e }) {
1432
- const i = S, b = e, c = Me(), t = Te(), u = De(), o = de(), s = Ae(), y = Q(
1429
+ setup(_, { emit: e }) {
1430
+ const i = _, g = e, d = Me(), t = Te(), l = De(), n = de(), s = Ae(), y = Z(
1433
1431
  () => {
1434
- var r, d;
1432
+ var r, m;
1435
1433
  return {
1436
1434
  id: ((r = s.sessionUser.value) == null ? void 0 : r.id) ?? "",
1437
- name: ((d = s.sessionUser.value) == null ? void 0 : d.displayName) ?? ""
1435
+ name: ((m = s.sessionUser.value) == null ? void 0 : m.displayName) ?? ""
1438
1436
  };
1439
1437
  }
1440
- ), _ = Et(), { t: p } = at(), m = Q(
1438
+ ), S = Et(), { t: f } = at(), c = Z(
1441
1439
  () => {
1442
- var r, d, R, w;
1443
- 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;
1440
+ var r, m, R, w;
1441
+ 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;
1444
1442
  }
1445
- ), l = j(!1), n = j(""), g = j(!0), x = $e(), q = At(x.getWorkflowConfig), V = it(), T = Q(() => {
1443
+ ), u = M(!1), o = M(""), v = M(!0), D = $e(), q = At(D.getWorkflowConfig), j = it(), T = Z(() => {
1446
1444
  if (!i.purchaseOrder)
1447
1445
  return [];
1448
1446
  const r = q.result.value;
1449
1447
  if (r.state === Ze.loading)
1450
1448
  return [];
1451
- const d = {
1449
+ const m = {
1452
1450
  user: y.value,
1453
- executedAt: o.locations.computeFirst(
1451
+ executedAt: n.locations.computeFirst(
1454
1452
  (w) => {
1455
1453
  var $;
1456
- return w.dbName === (($ = o._currentLocation) == null ? void 0 : $.dbName) ? w : null;
1454
+ return w.dbName === (($ = n._currentLocation) == null ? void 0 : $.dbName) ? w : null;
1457
1455
  }
1458
1456
  ),
1459
1457
  purchaseOrderRequest: i.poRequest,
@@ -1462,7 +1460,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1462
1460
  let R = [];
1463
1461
  try {
1464
1462
  r.state === Ze.error ? (console.error("Error fetching workflow config:", r.error), R = Pe.getAvailableActions({
1465
- ...d,
1463
+ ...m,
1466
1464
  orderConfig: Pe.getDefaultConfig()
1467
1465
  }).actions.filter(
1468
1466
  (w) => (
@@ -1471,7 +1469,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1471
1469
  w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
1472
1470
  )
1473
1471
  )) : R = Pe.getAvailableActions({
1474
- ...d,
1472
+ ...m,
1475
1473
  orderConfig: r.data
1476
1474
  }).actions.filter(
1477
1475
  (w) => w !== O.enum.receiveStock && w !== O.enum.processRequest && w !== O.enum.closeRequest
@@ -1480,25 +1478,25 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1480
1478
  console.error("Error getting available actions:", w);
1481
1479
  }
1482
1480
  return i.scope === "approval" && (R = R.filter((w) => w !== O.enum.completeReceive)), R;
1483
- }), F = kt(i, "show"), K = Q(() => [
1481
+ }), F = kt(i, "show"), K = Z(() => [
1484
1482
  {
1485
- label: p("inventory.transfer.receiveRequest.details.overview"),
1483
+ label: f("inventory.transfer.receiveRequest.details.overview"),
1486
1484
  value: "overview"
1487
1485
  },
1488
1486
  {
1489
- label: p("inventory.transfer.receiveRequest.details.deliveryHistory"),
1487
+ label: f("inventory.transfer.receiveRequest.details.deliveryHistory"),
1490
1488
  value: "deliveryHistory"
1491
1489
  }
1492
- ]), W = j(K.value[0]);
1490
+ ]), G = M(K.value[0]);
1493
1491
  bt(
1494
1492
  () => i.show,
1495
1493
  (r) => {
1496
- r && (W.value = K.value[0]);
1494
+ r && (G.value = K.value[0]);
1497
1495
  }
1498
1496
  );
1499
- async function le(r, d, R, w, $) {
1500
- return new Promise((G, X) => {
1501
- c.open({
1497
+ async function le(r, m, R, w, $) {
1498
+ return new Promise((W, Q) => {
1499
+ d.open({
1502
1500
  closeButton: !1,
1503
1501
  title: w.title,
1504
1502
  message: w.message,
@@ -1506,68 +1504,68 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1506
1504
  secondaryActions: { text: "No", close: !1 }
1507
1505
  }).onPrimary(async () => {
1508
1506
  var C, B, H, E;
1509
- const f = [];
1510
- R === O.enum.approveRequest ? (f.push({
1507
+ const p = [];
1508
+ R === O.enum.approveRequest ? (p.push({
1511
1509
  action: "approveRequest",
1512
1510
  payload: null
1513
- }), d.fulfillment && f.push({
1511
+ }), m.fulfillment && p.push({
1514
1512
  action: "processRequest",
1515
1513
  payload: {
1516
1514
  fulfillmentId: "",
1517
1515
  deliveryOrderNumber: "",
1518
1516
  deliveryRemark: null,
1519
- items: d.fulfillment.items,
1517
+ items: m.fulfillment.items,
1520
1518
  createdBy: y.value
1521
1519
  }
1522
- })) : R === O.enum.processRequest ? d.fulfillment && f.push({
1520
+ })) : R === O.enum.processRequest ? m.fulfillment && p.push({
1523
1521
  action: "processRequest",
1524
1522
  payload: {
1525
1523
  fulfillmentId: "",
1526
1524
  deliveryOrderNumber: "",
1527
1525
  deliveryRemark: null,
1528
- items: d.fulfillment.items,
1526
+ items: m.fulfillment.items,
1529
1527
  createdBy: y.value
1530
1528
  }
1531
- }) : R === O.enum.rejectRequest ? f.push({
1529
+ }) : R === O.enum.rejectRequest ? p.push({
1532
1530
  action: "rejectRequest",
1533
1531
  payload: null
1534
- }) : R === O.enum.closeRequest && f.push({
1532
+ }) : R === O.enum.closeRequest && p.push({
1535
1533
  action: "closeRequest",
1536
1534
  payload: null
1537
1535
  });
1538
1536
  try {
1539
- await V({
1537
+ await j({
1540
1538
  operate: {
1541
1539
  operation: R,
1542
1540
  doc: r,
1543
- options: d
1541
+ options: m
1544
1542
  },
1545
1543
  operateV2: {
1546
1544
  _id: ((C = i.purchaseOrder) == null ? void 0 : C._id) ?? "",
1547
1545
  _rev: ((B = i.purchaseOrder) == null ? void 0 : B._rev) ?? "",
1548
1546
  action: R,
1549
- payloads: f
1547
+ payloads: p
1550
1548
  // add payload if action is receiveStock or processRequest
1551
1549
  },
1552
1550
  transferTo: (E = (H = i.poRequest) == null ? void 0 : H.to) == null ? void 0 : E.dbName
1553
- }).delayed(1e3), G("submitted");
1554
- } catch (J) {
1555
- X(J);
1551
+ }).delayed(1e3), W("submitted");
1552
+ } catch (X) {
1553
+ Q(X);
1556
1554
  }
1557
1555
  }).onSecondary(() => {
1558
- G("cancelled");
1559
- for (let f = 0; f < $ + 2; f++)
1560
- c.close();
1556
+ W("cancelled");
1557
+ for (let p = 0; p < $ + 2; p++)
1558
+ d.close();
1561
1559
  }).onClose(() => {
1562
1560
  });
1563
1561
  });
1564
1562
  }
1565
1563
  async function oe(r) {
1566
- var w, $, G, X;
1564
+ var w, $, W, Q;
1567
1565
  if (r === O.enum.receiveStock)
1568
1566
  return;
1569
- const d = ot[r];
1570
- if (!d) {
1567
+ const m = ot[r];
1568
+ if (!m) {
1571
1569
  t.open({
1572
1570
  title: "Something went wrong",
1573
1571
  message: `Cannot process order: ${Ve(r)}`,
@@ -1575,46 +1573,46 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1575
1573
  });
1576
1574
  return;
1577
1575
  }
1578
- const { successMessage: R } = d;
1576
+ const { successMessage: R } = m;
1579
1577
  if (i.purchaseOrder) {
1580
- n.value = `${r}`, l.value = !0, g.value = !1;
1581
- const f = {};
1578
+ o.value = `${r}`, u.value = !0, v.value = !1;
1579
+ const p = {};
1582
1580
  let C = 0;
1583
1581
  if ((r === O.enum.confirmDraft || // auto receive for warehouse to warehouse
1584
- r === O.enum.completeReceive) && u.autoReceiveWarehouse)
1585
- f.autoReceive = !0;
1586
- else if ((r === O.enum.approveRequest || r === O.enum.processRequest) && u.acceptRequireFulfillment) {
1587
- const B = ($ = (w = i.poRequest) == null ? void 0 : w.from) == null ? void 0 : $.dbName, H = (X = (G = i.poRequest) == null ? void 0 : G.to) == null ? void 0 : X.dbName;
1582
+ r === O.enum.completeReceive) && l.autoReceiveWarehouse)
1583
+ p.autoReceive = !0;
1584
+ else if ((r === O.enum.approveRequest || r === O.enum.processRequest) && l.acceptRequireFulfillment) {
1585
+ const B = ($ = (w = i.poRequest) == null ? void 0 : w.from) == null ? void 0 : $.dbName, H = (Q = (W = i.poRequest) == null ? void 0 : W.to) == null ? void 0 : Q.dbName;
1588
1586
  if (B && H && (B.startsWith("warehouse_") || H.startsWith("warehouse_"))) {
1589
- const E = await new Promise((J, L) => {
1590
- c.open({
1587
+ const E = await new Promise((X, L) => {
1588
+ d.open({
1591
1589
  closeButton: !1,
1592
1590
  title: "Confirm transfer amount",
1593
1591
  dialogComponent: Bt,
1594
1592
  dialogComponentProps: {
1595
1593
  purchaseOrder: i.purchaseOrder,
1596
- confirm: J,
1594
+ confirm: X,
1597
1595
  "onUpdate:show": (ne) => {
1598
- ne || (n.value = "", l.value = !1, g.value = !0, C++, c.close()), L("cancelled");
1596
+ ne || (o.value = "", u.value = !1, v.value = !0, C++, d.close()), L("cancelled");
1599
1597
  }
1600
1598
  }
1601
1599
  });
1602
1600
  });
1603
- f.fulfillment = E;
1601
+ p.fulfillment = E;
1604
1602
  }
1605
1603
  }
1606
1604
  try {
1607
1605
  await le(
1608
1606
  i.purchaseOrder,
1609
- f,
1607
+ p,
1610
1608
  r,
1611
- d,
1609
+ m,
1612
1610
  C
1613
1611
  ) === "submitted" && (t.open({
1614
1612
  title: "Success",
1615
1613
  message: R,
1616
1614
  type: "success"
1617
- }), b("update:show", !1), b("submitted"));
1615
+ }), g("update:show", !1), g("submitted"));
1618
1616
  } catch (B) {
1619
1617
  t.open({
1620
1618
  title: "Something went wrong",
@@ -1622,16 +1620,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1622
1620
  type: "error"
1623
1621
  }), console.error("Error when submitting PO operation", r, i.purchaseOrder, B);
1624
1622
  } finally {
1625
- n.value = "", l.value = !1, g.value = !0;
1623
+ o.value = "", u.value = !1, v.value = !0;
1626
1624
  }
1627
1625
  }
1628
1626
  }
1629
- const ye = Q(() => {
1630
- var r, d;
1631
- return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((d = i.purchaseOrder) == null ? void 0 : d.status) === ue.enum.COMPLETE;
1632
- }), Ce = Q(() => {
1633
- var G, X, f;
1634
- const R = (((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? []).flatMap((C) => C.received ?? []).reduce(
1627
+ const ye = Z(() => {
1628
+ var r, m;
1629
+ return ((r = i.purchaseOrder) == null ? void 0 : r.status) === ue.enum.RECEIVING || ((m = i.purchaseOrder) == null ? void 0 : m.status) === ue.enum.COMPLETE;
1630
+ }), Ce = Z(() => {
1631
+ var W, Q, p;
1632
+ const R = (((W = i.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? []).flatMap((C) => C.received ?? []).reduce(
1635
1633
  (C, B) => {
1636
1634
  const H = C[B.sku._id] ?? [];
1637
1635
  return C[B.sku._id] = [...H, B], C;
@@ -1639,68 +1637,68 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1639
1637
  {}
1640
1638
  ), w = Object.entries(R).reduce(
1641
1639
  (C, [B, H]) => {
1642
- const E = H.reduce((J, L) => {
1640
+ const E = H.reduce((X, L) => {
1643
1641
  const ne = yt(
1644
- J,
1645
- Math.max(J.precision, L.amount.precision)
1642
+ X,
1643
+ Math.max(X.precision, L.amount.precision)
1646
1644
  );
1647
1645
  return Le(ne, L.amount);
1648
1646
  }, ke(0));
1649
1647
  return C[B] = E, C;
1650
1648
  },
1651
1649
  {}
1652
- ), $ = ((X = i.purchaseOrder) == null ? void 0 : X.items) ?? [];
1650
+ ), $ = ((Q = i.purchaseOrder) == null ? void 0 : Q.items) ?? [];
1653
1651
  for (const C of $)
1654
- w[f = C.sku._id] ?? (w[f] = ke(0));
1652
+ w[p = C.sku._id] ?? (w[p] = ke(0));
1655
1653
  return w;
1656
- }), ce = Q(() => {
1657
- var G, X;
1658
- const r = ((G = i.purchaseOrder) == null ? void 0 : G.deliveryOrder) ?? [], d = ((X = i.purchaseOrder) == null ? void 0 : X.deliveryFullfillment) ?? [], R = [
1659
- ...r.map((f) => ({
1660
- createdAt: f.createdAt,
1654
+ }), ce = Z(() => {
1655
+ var W, Q;
1656
+ const r = ((W = i.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], m = ((Q = i.purchaseOrder) == null ? void 0 : Q.deliveryFullfillment) ?? [], R = [
1657
+ ...r.map((p) => ({
1658
+ createdAt: p.createdAt,
1661
1659
  type: "grn",
1662
- doc: f
1660
+ doc: p
1663
1661
  })),
1664
- ...d.map((f) => ({
1665
- createdAt: f.createdAt,
1662
+ ...m.map((p) => ({
1663
+ createdAt: p.createdAt,
1666
1664
  type: "fulfillment",
1667
- doc: f
1665
+ doc: p
1668
1666
  }))
1669
1667
  ];
1670
- R.reverse().sort((f, C) => f.createdAt.localeCompare(C.createdAt));
1671
- function w(f) {
1672
- var H, E, J, L, ne, ge, _e, Se, U;
1673
- const C = d.findIndex((P) => P.id === f.fullfillmentId), B = [
1674
- (E = (H = d[C]) == null ? void 0 : H.netSuite) != null && E.refNo ? {
1668
+ R.reverse().sort((p, C) => p.createdAt.localeCompare(C.createdAt));
1669
+ function w(p) {
1670
+ var H, E, X, L, ne, ge, _e, Se, U;
1671
+ const C = m.findIndex((P) => P.id === p.fullfillmentId), B = [
1672
+ (E = (H = m[C]) == null ? void 0 : H.netSuite) != null && E.refNo ? {
1675
1673
  label: "Fulfillment's ref no. (Netsuite)",
1676
- values: [(L = (J = d[C]) == null ? void 0 : J.netSuite) == null ? void 0 : L.refNo]
1674
+ values: [(L = (X = m[C]) == null ? void 0 : X.netSuite) == null ? void 0 : L.refNo]
1677
1675
  } : null,
1678
- (ne = f == null ? void 0 : f.netSuite) != null && ne.refNo ? {
1676
+ (ne = p == null ? void 0 : p.netSuite) != null && ne.refNo ? {
1679
1677
  label: "Netsuite ref no.",
1680
- values: [(ge = f == null ? void 0 : f.netSuite) == null ? void 0 : ge.refNo]
1678
+ values: [(ge = p == null ? void 0 : p.netSuite) == null ? void 0 : ge.refNo]
1681
1679
  } : null,
1682
- (_e = f == null ? void 0 : f.netSuite) != null && _e.recordType ? {
1680
+ (_e = p == null ? void 0 : p.netSuite) != null && _e.recordType ? {
1683
1681
  label: "Netsuite Type",
1684
- values: [rt((Se = f == null ? void 0 : f.netSuite) == null ? void 0 : Se.recordType)]
1682
+ values: [rt((Se = p == null ? void 0 : p.netSuite) == null ? void 0 : Se.recordType)]
1685
1683
  } : null
1686
1684
  ];
1687
1685
  return {
1688
1686
  header: "Received",
1689
- date: Ie(new Date(f.createdAt)),
1687
+ date: Ie(new Date(p.createdAt)),
1690
1688
  info: [
1691
1689
  {
1692
1690
  label: "Adjustment date",
1693
1691
  values: [
1694
- f.adjustment ? Ie(new Date(vt(f.adjustment))) : "-"
1692
+ p.adjustment ? Ie(new Date(vt(p.adjustment))) : "-"
1695
1693
  ]
1696
1694
  },
1697
1695
  {
1698
1696
  label: "Received by",
1699
- values: [(U = f.createdBy) == null ? void 0 : U.name]
1697
+ values: [(U = p.createdBy) == null ? void 0 : U.name]
1700
1698
  },
1701
1699
  {
1702
1700
  label: "Received items",
1703
- values: f.received.map((P) => {
1701
+ values: p.received.map((P) => {
1704
1702
  var Y;
1705
1703
  return A("div", [
1706
1704
  A(
@@ -1773,13 +1771,13 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1773
1771
  ]);
1774
1772
  })
1775
1773
  },
1776
- f.deliveryOrderNumber ? {
1774
+ p.deliveryOrderNumber ? {
1777
1775
  label: "Delivery order no.",
1778
- values: [f.deliveryOrderNumber]
1776
+ values: [p.deliveryOrderNumber]
1779
1777
  } : null,
1780
- f.remark ? {
1778
+ p.remark ? {
1781
1779
  label: "Remark",
1782
- values: [f.remark]
1780
+ values: [p.remark]
1783
1781
  } : null,
1784
1782
  C > -1 ? {
1785
1783
  label: "Fulfilment's sequence",
@@ -1789,12 +1787,12 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1789
1787
  ].filter((P) => P)
1790
1788
  };
1791
1789
  }
1792
- function $(f) {
1790
+ function $(p) {
1793
1791
  var B, H;
1794
- const C = d.findIndex((E) => E.id === f.id);
1792
+ const C = m.findIndex((E) => E.id === p.id);
1795
1793
  return {
1796
1794
  header: "Fulfillment",
1797
- date: Ie(new Date(f.createdAt)),
1795
+ date: Ie(new Date(p.createdAt)),
1798
1796
  info: [
1799
1797
  {
1800
1798
  label: "Sequence",
@@ -1802,8 +1800,8 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1802
1800
  },
1803
1801
  {
1804
1802
  label: "Receiveable items",
1805
- values: f.items.map((E) => {
1806
- var J;
1803
+ values: p.items.map((E) => {
1804
+ var X;
1807
1805
  return A("div", [
1808
1806
  A(
1809
1807
  "div",
@@ -1857,7 +1855,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1857
1855
  {
1858
1856
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1859
1857
  },
1860
- ((J = E.measurement) == null ? void 0 : J.abbrev) ?? E.sku.unit.abbrev
1858
+ ((X = E.measurement) == null ? void 0 : X.abbrev) ?? E.sku.unit.abbrev
1861
1859
  )
1862
1860
  ]
1863
1861
  ),
@@ -1875,40 +1873,40 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1875
1873
  ]);
1876
1874
  })
1877
1875
  },
1878
- (B = f.netSuite) != null && B.refNo ? {
1876
+ (B = p.netSuite) != null && B.refNo ? {
1879
1877
  label: "Ref no. (Netsuite)",
1880
- values: [(H = f.netSuite) == null ? void 0 : H.refNo]
1878
+ values: [(H = p.netSuite) == null ? void 0 : H.refNo]
1881
1879
  } : null
1882
1880
  ].filter((E) => E)
1883
1881
  };
1884
1882
  }
1885
- return R.map((f) => {
1886
- switch (f.type) {
1883
+ return R.map((p) => {
1884
+ switch (p.type) {
1887
1885
  case "grn":
1888
- return w(f.doc);
1886
+ return w(p.doc);
1889
1887
  case "fulfillment":
1890
- return $(f.doc);
1888
+ return $(p.doc);
1891
1889
  }
1892
1890
  });
1893
- }), D = Q(() => {
1894
- var d;
1891
+ }), x = Z(() => {
1892
+ var m;
1895
1893
  const r = {
1896
1894
  ...ke(0),
1897
1895
  currency: Xe()
1898
1896
  };
1899
- return ((d = i.purchaseOrder) == null ? void 0 : d.items.reduce((R, w) => ({
1897
+ return ((m = i.purchaseOrder) == null ? void 0 : m.items.reduce((R, w) => ({
1900
1898
  ...Le(R, w.totalCost ?? r),
1901
1899
  currency: Xe()
1902
1900
  }), r)) ?? r;
1903
1901
  });
1904
- return (r, d) => {
1905
- var E, J;
1906
- const R = z("FmButtonGroup"), w = z("FmChip"), $ = z("FmMenuDivider"), G = z("FmCard"), X = z("FmIcon"), f = z("FmTooltip"), C = z("FmSpacer"), B = z("FmButton"), H = z("FmSideSheet");
1907
- return h(), ae(H, {
1908
- header: v(p)("inventory.transfer.receiveRequest.details.title") + ((E = r.purchaseOrder) != null && E.seqNumber ? ` #${(J = r.purchaseOrder) == null ? void 0 : J.seqNumber}` : ""),
1909
- modelValue: v(F),
1910
- "onUpdate:modelValue": d[5] || (d[5] = (L) => gt(F) ? F.value = L : null),
1911
- "dismiss-away": g.value,
1902
+ return (r, m) => {
1903
+ var E, X;
1904
+ const R = z("FmButtonGroup"), w = z("FmChip"), $ = z("FmMenuDivider"), W = z("FmCard"), Q = z("FmIcon"), p = z("FmTooltip"), C = z("FmSpacer"), B = z("FmButton"), H = z("FmSideSheet");
1905
+ return b(), ae(H, {
1906
+ header: h(f)("inventory.transfer.receiveRequest.details.title") + ((E = r.purchaseOrder) != null && E.seqNumber ? ` #${(X = r.purchaseOrder) == null ? void 0 : X.seqNumber}` : ""),
1907
+ modelValue: h(F),
1908
+ "onUpdate:modelValue": m[5] || (m[5] = (L) => gt(F) ? F.value = L : null),
1909
+ "dismiss-away": v.value,
1912
1910
  "close-button": "",
1913
1911
  "max-width": 600
1914
1912
  }, {
@@ -1919,24 +1917,24 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1919
1917
  a("div", null, [
1920
1918
  I(R, {
1921
1919
  items: K.value,
1922
- modelValue: W.value,
1923
- "onUpdate:modelValue": d[0] || (d[0] = (U) => W.value = U)
1920
+ modelValue: G.value,
1921
+ "onUpdate:modelValue": m[0] || (m[0] = (U) => G.value = U)
1924
1922
  }, null, 8, ["items", "modelValue"])
1925
1923
  ]),
1926
- W.value.value === "overview" ? (h(), N(te, { key: 0 }, [
1924
+ G.value.value === "overview" ? (b(), N(te, { key: 0 }, [
1927
1925
  a("div", null, [
1928
- I(G, {
1926
+ I(W, {
1929
1927
  variant: "outlined",
1930
1928
  class: "flex flex-col gap-8 px-12 py-16"
1931
1929
  }, {
1932
1930
  default: se(() => {
1933
- var U, P, Y, ve, he, Re, je, Ke, ze, He, We, Ge;
1931
+ var U, P, Y, ve, he, Re, je, Ke, ze, He, Ge, We;
1934
1932
  return [
1935
1933
  a("div", Sr, [
1936
- a("div", wr, k(v(p)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1934
+ a("div", wr, k(h(f)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1937
1935
  a("div", null, [
1938
1936
  I(w, {
1939
- label: v(p)(`inventory.transfer.status.${(U = r.purchaseOrder) == null ? void 0 : U.status}`),
1937
+ label: h(f)(`inventory.transfer.status.${(U = r.purchaseOrder) == null ? void 0 : U.status}`),
1940
1938
  class: Ne(`fm-status-badge fm-status-badge-${(Y = (P = r.purchaseOrder) == null ? void 0 : P.status) == null ? void 0 : Y.toLocaleLowerCase("en-us")}`),
1941
1939
  compact: ""
1942
1940
  }, null, 8, ["label", "class"])
@@ -1946,36 +1944,36 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1946
1944
  a("div", Rr, [
1947
1945
  a("div", Or, [
1948
1946
  a("div", Nr, [
1949
- a("div", kr, k(v(p)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1947
+ a("div", kr, k(h(f)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1950
1948
  ]),
1951
- a("div", xr, k(v(xe)(((ve = r.purchaseOrder) == null ? void 0 : ve._id) ?? "")), 1)
1949
+ a("div", xr, k(h(xe)(((ve = r.purchaseOrder) == null ? void 0 : ve._id) ?? "")), 1)
1952
1950
  ]),
1953
- (he = r.purchaseOrder) != null && he.effectiveAt ? (h(), N("div", Dr, [
1954
- a("div", qr, k(v(p)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1955
- a("div", Ar, k(v(tt)(new Date((Re = r.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1956
- ])) : M("", !0),
1951
+ (he = r.purchaseOrder) != null && he.effectiveAt ? (b(), N("div", Dr, [
1952
+ a("div", qr, k(h(f)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1953
+ a("div", Ar, k(h(tt)(new Date((Re = r.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1954
+ ])) : V("", !0),
1957
1955
  a("div", Tr, [
1958
- a("div", $r, k(v(p)("inventory.transfer.receiveRequest.details.type.title")), 1),
1959
- a("div", Cr, k(v(p)(
1960
- `inventory.transfer.receiveRequest.details.type.${m.value.toLocaleLowerCase("en-US")}`
1956
+ a("div", $r, k(h(f)("inventory.transfer.receiveRequest.details.type.title")), 1),
1957
+ a("div", Cr, k(h(f)(
1958
+ `inventory.transfer.receiveRequest.details.type.${c.value.toLocaleLowerCase("en-US")}`
1961
1959
  )), 1)
1962
1960
  ]),
1963
- (Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (h(), N("div", Pr, [
1964
- a("div", Ir, k(v(p)("inventory.transfer.receiveRequest.details.from")), 1),
1961
+ (Ke = (je = r.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (b(), N("div", Pr, [
1962
+ a("div", Ir, k(h(f)("inventory.transfer.receiveRequest.details.from")), 1),
1965
1963
  a("div", Fr, k((He = (ze = r.purchaseOrder) == null ? void 0 : ze.supplier) == null ? void 0 : He.name), 1)
1966
- ])) : M("", !0),
1967
- r.transferTo ? (h(), N("div", Br, [
1968
- a("div", Er, k(v(p)("inventory.transfer.receiveRequest.details.to")), 1),
1964
+ ])) : V("", !0),
1965
+ r.transferTo ? (b(), N("div", Br, [
1966
+ a("div", Er, k(h(f)("inventory.transfer.receiveRequest.details.to")), 1),
1969
1967
  a("div", Lr, k(r.transferTo), 1)
1970
- ])) : M("", !0),
1971
- (We = r.purchaseOrder) != null && We.ref ? (h(), N("div", Ur, [
1972
- a("div", Vr, k(v(p)("inventory.transfer.receiveRequest.details.reference")), 1),
1968
+ ])) : V("", !0),
1969
+ (Ge = r.purchaseOrder) != null && Ge.ref ? (b(), N("div", Ur, [
1970
+ a("div", Vr, k(h(f)("inventory.transfer.receiveRequest.details.reference")), 1),
1973
1971
  a("div", Mr, k(r.purchaseOrder.ref), 1)
1974
- ])) : M("", !0),
1975
- (Ge = r.purchaseOrder) != null && Ge.remark ? (h(), N("div", jr, [
1976
- a("div", Kr, k(v(p)("inventory.transfer.receiveRequest.details.remark")), 1),
1972
+ ])) : V("", !0),
1973
+ (We = r.purchaseOrder) != null && We.remark ? (b(), N("div", jr, [
1974
+ a("div", Kr, k(h(f)("inventory.transfer.receiveRequest.details.remark")), 1),
1977
1975
  a("div", zr, k(r.purchaseOrder.remark), 1)
1978
- ])) : M("", !0)
1976
+ ])) : V("", !0)
1979
1977
  ])
1980
1978
  ];
1981
1979
  }),
@@ -1985,16 +1983,16 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
1985
1983
  I(gr, {
1986
1984
  "po-request": r.poRequest,
1987
1985
  purchaseOrder: r.purchaseOrder,
1988
- transferType: m.value,
1986
+ transferType: c.value,
1989
1987
  transferToDbName: r.transferToDbName,
1990
1988
  scope: r.scope
1991
1989
  }, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
1992
1990
  a("div", Hr, [
1993
- a("div", Wr, [
1994
- a("div", Gr, [
1991
+ a("div", Gr, [
1992
+ a("div", Wr, [
1995
1993
  a("span", Yr, [
1996
- Fe(k(ye.value ? v(p)("inventory.transfer.receiveRequest.details.receivedItems") : v(p)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1997
- (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, {
1994
+ Fe(k(ye.value ? h(f)("inventory.transfer.receiveRequest.details.receivedItems") : h(f)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1995
+ (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, {
1998
1996
  key: 0,
1999
1997
  variant: "rich",
2000
1998
  placement: "top",
@@ -2004,11 +2002,11 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2004
2002
  var U, P;
2005
2003
  return [
2006
2004
  a("div", Qr, [
2007
- (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", {
2005
+ (b(!0), N(te, null, me((P = (U = r.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : P.missingItems, (Y, ve) => (b(), N("div", {
2008
2006
  class: "flex justify-center align-middle",
2009
2007
  key: ve
2010
2008
  }, [
2011
- I(X, {
2009
+ I(Q, {
2012
2010
  name: "arrow_right",
2013
2011
  size: "sm"
2014
2012
  }),
@@ -2018,47 +2016,47 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2018
2016
  ];
2019
2017
  }),
2020
2018
  default: se(() => [
2021
- I(X, {
2019
+ I(Q, {
2022
2020
  name: "error",
2023
2021
  color: "#ff2c2c",
2024
2022
  size: "sm"
2025
2023
  })
2026
2024
  ]),
2027
2025
  _: 1
2028
- })) : M("", !0)
2026
+ })) : V("", !0)
2029
2027
  ])
2030
2028
  ]),
2031
2029
  I($),
2032
- (h(!0), N(te, null, me(((Se = r.purchaseOrder) == null ? void 0 : Se.items) ?? [], (U) => {
2030
+ (b(!0), N(te, null, me(((Se = r.purchaseOrder) == null ? void 0 : Se.items) ?? [], (U) => {
2033
2031
  var P;
2034
- return h(), N("div", {
2032
+ return b(), N("div", {
2035
2033
  key: U.code,
2036
2034
  class: "flex flex-col"
2037
2035
  }, [
2038
2036
  a("div", Xr, [
2039
2037
  a("div", Jr, k(U.name), 1),
2040
- a("div", Zr, k(v(ie)(Ce.value[U.sku._id], !1)) + "/" + k(v(Ot)(U.quantity, U.sku.unit, U.measurement)), 1)
2038
+ a("div", Zr, k(h(ie)(Ce.value[U.sku._id], !1)) + "/" + k(h(Ot)(U.quantity, U.sku.unit, U.measurement)), 1)
2041
2039
  ]),
2042
2040
  a("div", es, [
2043
2041
  a("div", ts, k(U.code), 1),
2044
- (P = U.totalCost) != null && P.amount && v(u).enableTotalCost ? (h(), N("div", rs, " (" + k(v(Oe)(U.totalCost)) + ") ", 1)) : M("", !0)
2042
+ (P = U.totalCost) != null && P.amount && h(l).enableTotalCost ? (b(), N("div", rs, " (" + k(h(Oe)(U.totalCost)) + ") ", 1)) : V("", !0)
2045
2043
  ])
2046
2044
  ]);
2047
2045
  }), 128)),
2048
- +v(ie)(D.value) ? (h(), N(te, { key: 0 }, [
2046
+ +h(ie)(x.value) ? (b(), N(te, { key: 0 }, [
2049
2047
  a("div", ss, [
2050
2048
  I($)
2051
2049
  ]),
2052
2050
  a("div", ns, [
2053
- d[6] || (d[6] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2054
- a("div", as, k(v(Oe)(D.value)), 1)
2051
+ m[6] || (m[6] = a("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2052
+ a("div", as, k(h(Oe)(x.value)), 1)
2055
2053
  ])
2056
- ], 64)) : M("", !0)
2054
+ ], 64)) : V("", !0)
2057
2055
  ])
2058
2056
  ])
2059
- ], 64)) : W.value.value === "deliveryHistory" ? (h(), N("div", os, [
2060
- ce.value.length ? (h(), N("div", ds, [
2061
- (h(!0), N(te, null, me(ce.value, (U, P) => (h(), N(te, { key: P }, [
2057
+ ], 64)) : G.value.value === "deliveryHistory" ? (b(), N("div", os, [
2058
+ ce.value.length ? (b(), N("div", ds, [
2059
+ (b(!0), N(te, null, me(ce.value, (U, P) => (b(), N(te, { key: P }, [
2062
2060
  a("div", ms, [
2063
2061
  a("div", fs, [
2064
2062
  a("div", ps, [
@@ -2072,7 +2070,7 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2072
2070
  ])
2073
2071
  }, null, 2)
2074
2072
  ]),
2075
- d[7] || (d[7] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2073
+ m[7] || (m[7] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2076
2074
  a("div", ys, [
2077
2075
  a("div", {
2078
2076
  class: Ne([
@@ -2105,25 +2103,25 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2105
2103
  ])
2106
2104
  ]),
2107
2105
  a("div", ws, [
2108
- I(G, {
2106
+ I(W, {
2109
2107
  variant: "outlined",
2110
2108
  class: "py-12 px-16"
2111
2109
  }, {
2112
2110
  default: se(() => [
2113
2111
  a("div", Rs, [
2114
- (h(!0), N(te, null, me(U.info, (Y, ve) => (h(), N("div", {
2112
+ (b(!0), N(te, null, me(U.info, (Y, ve) => (b(), N("div", {
2115
2113
  key: ve,
2116
2114
  class: "flex flex-col gap-4"
2117
2115
  }, [
2118
2116
  a("div", Os, k(Y == null ? void 0 : Y.label), 1),
2119
2117
  a("div", Ns, [
2120
- (h(!0), N(te, null, me(Y == null ? void 0 : Y.values, (he, Re) => (h(), N("div", {
2118
+ (b(!0), N(te, null, me(Y == null ? void 0 : Y.values, (he, Re) => (b(), N("div", {
2121
2119
  key: Re,
2122
2120
  class: "fm-typo-en-body-lg-600"
2123
2121
  }, [
2124
- typeof he == "string" ? (h(), N(te, { key: 0 }, [
2122
+ typeof he == "string" ? (b(), N(te, { key: 0 }, [
2125
2123
  Fe(k(he), 1)
2126
- ], 64)) : (h(), ae(_t(he), { key: 1 }))
2124
+ ], 64)) : (b(), ae(_t(he), { key: 1 }))
2127
2125
  ]))), 128))
2128
2126
  ])
2129
2127
  ]))), 128))
@@ -2134,60 +2132,60 @@ const Lt = { class: "flex flex-row-reverse" }, Ut = /* @__PURE__ */ pe({
2134
2132
  ])
2135
2133
  ])
2136
2134
  ], 64))), 128))
2137
- ])) : (h(), N("div", is, [
2135
+ ])) : (b(), N("div", is, [
2138
2136
  I(C),
2139
2137
  a("div", null, [
2140
2138
  a("img", {
2141
- src: v(Nt),
2139
+ src: h(Nt),
2142
2140
  alt: "List is empty"
2143
2141
  }, null, 8, ls)
2144
2142
  ]),
2145
- a("div", cs, k(v(p)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2146
- a("div", us, k(v(p)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2143
+ a("div", cs, k(h(f)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2144
+ a("div", us, k(h(f)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2147
2145
  I(C),
2148
2146
  I(C)
2149
2147
  ]))
2150
- ])) : M("", !0)
2148
+ ])) : V("", !0)
2151
2149
  ])
2152
2150
  ];
2153
2151
  }),
2154
2152
  "side-sheet-footer": se(() => [
2155
2153
  a("div", ks, [
2156
- (h(!0), N(te, null, me(T.value, (L) => (h(), N(te, null, [
2157
- v(Ee)[L].available != !1 ? (h(), ae(B, {
2154
+ (b(!0), N(te, null, me(T.value, (L) => (b(), N(te, null, [
2155
+ h(Ee)[L].available != !1 ? (b(), ae(B, {
2158
2156
  key: L,
2159
- label: v(p)(v(Ee)[L].translationKey),
2157
+ label: h(f)(h(Ee)[L].translationKey),
2160
2158
  onClick: (ne) => oe(L),
2161
- loading: n.value === L,
2162
- disabled: n.value !== L && l.value,
2163
- variant: v(Ee)[L].buttonVariant
2164
- }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : M("", !0)
2159
+ loading: o.value === L,
2160
+ disabled: o.value !== L && u.value,
2161
+ variant: h(Ee)[L].buttonVariant
2162
+ }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : V("", !0)
2165
2163
  ], 64))), 256)),
2166
- v(_).ableToMarkReceived(r.purchaseOrder) && !T.value.includes("completeReceive") ? (h(), ae(B, {
2164
+ h(S).ableToMarkReceived(r.purchaseOrder) && !T.value.includes("completeReceive") ? (b(), ae(B, {
2167
2165
  key: 0,
2168
- label: v(p)("inventory.transfer.receiveRequest.actions.completeReceive"),
2169
- onClick: d[1] || (d[1] = (L) => oe("completeReceive")),
2170
- loading: n.value === "completeReceive",
2171
- disabled: n.value !== "completeReceive" && l.value
2172
- }, null, 8, ["label", "loading", "disabled"])) : M("", !0),
2173
- v(_).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !T.value.includes("approveRequest") ? (h(), ae(B, {
2166
+ label: h(f)("inventory.transfer.receiveRequest.actions.completeReceive"),
2167
+ onClick: m[1] || (m[1] = (L) => oe("completeReceive")),
2168
+ loading: o.value === "completeReceive",
2169
+ disabled: o.value !== "completeReceive" && u.value
2170
+ }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2171
+ h(S).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !T.value.includes("approveRequest") ? (b(), ae(B, {
2174
2172
  key: 1,
2175
- label: v(p)("inventory.transfer.approval.actions.approveRequest"),
2176
- onClick: d[2] || (d[2] = (L) => oe("approveRequest")),
2177
- loading: n.value === "approveRequest",
2178
- disabled: n.value !== "approveRequest" && l.value
2179
- }, null, 8, ["label", "loading", "disabled"])) : M("", !0),
2180
- v(_).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) ? (h(), ae(B, {
2173
+ label: h(f)("inventory.transfer.approval.actions.approveRequest"),
2174
+ onClick: m[2] || (m[2] = (L) => oe("approveRequest")),
2175
+ loading: o.value === "approveRequest",
2176
+ disabled: o.value !== "approveRequest" && u.value
2177
+ }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2178
+ h(S).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && i.scope === "approval" ? (b(), ae(B, {
2181
2179
  key: 2,
2182
- label: v(p)("inventory.transfer.receiveRequest.actions.processRequest"),
2183
- onClick: d[3] || (d[3] = (L) => oe("processRequest")),
2184
- loading: n.value === "processRequest",
2185
- disabled: n.value !== "processRequest" && l.value
2186
- }, null, 8, ["label", "loading", "disabled"])) : M("", !0),
2180
+ label: h(f)("inventory.transfer.receiveRequest.actions.processRequest"),
2181
+ onClick: m[3] || (m[3] = (L) => oe("processRequest")),
2182
+ loading: o.value === "processRequest",
2183
+ disabled: o.value !== "processRequest" && u.value
2184
+ }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
2187
2185
  I(B, {
2188
- label: v(p)("common.close"),
2186
+ label: h(f)("common.close"),
2189
2187
  variant: "tertiary",
2190
- onClick: d[4] || (d[4] = (L) => b("update:show", !1))
2188
+ onClick: m[4] || (m[4] = (L) => g("update:show", !1))
2191
2189
  }, null, 8, ["label"])
2192
2190
  ])
2193
2191
  ]),