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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/dist/{App-Y3jnuLk5.js → App-B-nI29_9.js} +1 -1
  2. package/dist/{ApprovalView-hZtL3Sua.js → ApprovalView-BfPeHvSD.js} +2 -2
  3. package/dist/{BindingsDialog-D9ti8JsW.js → BindingsDialog-C7F9iWm8.js} +2 -2
  4. package/dist/{BindingsPicker-9FxsKtvd.js → BindingsPicker-Co-yI_sT.js} +1 -1
  5. package/dist/{BindingsTable-DxdQOwbf.js → BindingsTable-BdIxsyz3.js} +1 -1
  6. package/dist/{ClosingDraftView-BTuZHGjn.js → ClosingDraftView-Cb_yM-zH.js} +2 -2
  7. package/dist/{ClosingTemplateView-CE0tWxSQ.js → ClosingTemplateView-BFJfFFAM.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-CsM1VMSs.js → DeliveryOrderPrintPreview-Drere-i3.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-D7NiMP9x.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Boejs9ce.js} +3 -3
  10. package/dist/{FmMultiselectDialog-AUVC5_8U.js → FmMultiselectDialog-DY6sGXeT.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BujCH0Hv.js → FmUnitInput.vue_vue_type_script_setup_true_lang-dJ5ogZkp.js} +1 -1
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CK786OeU.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-3KMq32uv.js} +1 -1
  13. package/dist/{IngredientGroupView-aK1emYCJ.js → IngredientGroupView-BQ9sVyyo.js} +2 -2
  14. package/dist/{IngredientsView-CqL_zM0S.js → IngredientsView-Ckc38Pmx.js} +4 -4
  15. package/dist/{IntegrationView-DJdRbi4v.js → IntegrationView-u4NrNGsu.js} +3 -3
  16. package/dist/{InventoryBindingForm-CrIqBVXt.js → InventoryBindingForm-DdEH5h1a.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-BGrSJsKM.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CEBg3W7N.js} +3 -3
  18. package/dist/{InventoryBindingSummary-DWG59xhc.js → InventoryBindingSummary-CrJ_gJtY.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dy7HIgLl.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-T1FCwDNT.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-NEqCvCvz.js → PremiumBadge.vue_vue_type_script_setup_true_lang--iqMiaAR.js} +1 -1
  21. package/dist/{PublishView-Chk6c4or.js → PublishView-CI0ZcCdg.js} +1 -1
  22. package/dist/{PurchaseOrderPrintPreview-CY2Zzcaf.js → PurchaseOrderPrintPreview-N8RQIyXL.js} +1 -1
  23. package/dist/{ReceiveRequestView-DOCTQ6zm.js → ReceiveRequestView-BhFmuwna.js} +8 -8
  24. package/dist/{RecipeView-BlWs9gRL.js → RecipeView-DGMRC95R.js} +3 -3
  25. package/dist/{StockView-6wts4hQa.js → StockView-DsaJFBfk.js} +6 -6
  26. package/dist/{SupplierView-Di7PdPIc.js → SupplierView-CJ8GoKDm.js} +3 -3
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BOV7ntEz.js → TransferDetails.vue_vue_type_script_setup_true_lang-D_ZaY1CU.js} +602 -586
  28. package/dist/{TransferTemplateView-CMmuNxry.js → TransferTemplateView-D3LLpBHC.js} +6 -6
  29. package/dist/{UnitView-B-ba0CCd.js → UnitView-y-mN7vfi.js} +3 -3
  30. package/dist/{WarehouseView-DMeecKhM.js → WarehouseView-DAxqUFNw.js} +1 -1
  31. package/dist/{app-CrnHc0xr.js → app-LANrJGcw.js} +15710 -16089
  32. package/dist/app.js +1 -1
  33. package/dist/{decimal-D8iEMhaw.js → decimal-BVHw1oWk.js} +1 -1
  34. package/dist/{format-unit-display-DRKgUUX9.js → format-unit-display-DYMpvtXq.js} +2 -2
  35. package/dist/{index-z0AxAVmq.js → index-ChUdGYpp.js} +1 -1
  36. package/dist/{index-CaI4x97V.js → index-vXejDFcV.js} +1 -1
  37. package/dist/{stock-D4ij2Bnb.js → stock-C44UfJRT.js} +1 -1
  38. package/dist/style.css +1 -1
  39. package/dist/{supplier-CuLUQnUj.js → supplier-bSKffDOa.js} +1 -1
  40. package/dist/tsconfig.app.tsbuildinfo +1 -1
  41. package/dist/{use-ingredient-select-dialog-BbL7y_hv.js → use-ingredient-select-dialog-DcC9S3Gs.js} +1 -1
  42. package/dist/{use-inventory-binding-dialog-BkGX5Rc4.js → use-inventory-binding-dialog-BWn08ETN.js} +1 -1
  43. package/package.json +1 -1
  44. package/dist/components/FmMultiselectDialogTemporary.vue.d.ts +0 -41
@@ -1,74 +1,74 @@
1
- import { a3 as pt, u as me, aR as R, aS as Te, ay as ie, c as $e, b as Ae, a8 as vt, aa as yt, ab as ht, aT as bt, e as Xe, f as rt, a0 as Ke, aU as gt, a5 as st, T as nt, j as fe, aV as _t, aW as at, af as qe, h as Ze, i as J, D as ne, aX as ot, aY as it, aZ as Ee, aw as Je, a7 as Ne, am as Le, az as St, a_ as ke, Q as wt } from "./app-CrnHc0xr.js";
2
- import { ref as M, computed as Z, h as T, defineComponent as he, reactive as Rt, onMounted as lt, resolveComponent as z, openBlock as g, createBlock as oe, withCtx as ae, createElementVNode as o, createVNode as I, unref as S, createElementBlock as x, toDisplayString as D, createCommentVNode as U, Fragment as se, renderList as ve, watch as Ot, isRef as xt, normalizeClass as De, createTextVNode as Be, resolveDynamicComponent as Nt } from "vue";
3
- import { F as kt } from "./decimal-D8iEMhaw.js";
1
+ import { a3 as pt, u as me, aR as O, aS as $e, ay as ie, c as Ae, b as Te, a8 as vt, aa as yt, ab as ht, aT as bt, e as Xe, f as rt, a0 as Ke, aU as gt, a5 as st, T as nt, j as fe, aV as _t, aW as at, af as qe, h as Ze, i as J, D as ne, aX as ot, aY as it, aZ as Ee, aw as Je, a7 as xe, am as Le, az as St, a_ as ke, Q as wt } from "./app-LANrJGcw.js";
2
+ import { ref as M, computed as Z, h as $, defineComponent as he, reactive as Rt, onMounted as lt, resolveComponent as z, openBlock as g, createBlock as oe, withCtx as ae, createElementVNode as o, createVNode as I, unref as S, createElementBlock as N, toDisplayString as D, createCommentVNode as U, Fragment as se, renderList as ve, watch as Ot, isRef as Nt, normalizeClass as De, createTextVNode as Be, resolveDynamicComponent as xt } from "vue";
3
+ import { F as kt } from "./decimal-BVHw1oWk.js";
4
4
  import { useCoreStore as Pe, useI18n as ct } from "@feedmepos/mf-common";
5
5
  import { useDialog as je, useSnackbar as Ce, components as et, FmButtonVariant as re, useProxiedModel as Dt } from "@feedmepos/ui-library";
6
- import { b as qt, u as Tt, P as ye, f as $t } from "./format-unit-display-DRKgUUX9.js";
7
- import { E as At } from "./empty-placeholder-wf6-BWE8.js";
8
- import { _ as Pt, F as Ct, a as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BujCH0Hv.js";
6
+ import { b as qt, u as $t, P as ye, f as At } from "./format-unit-display-DYMpvtXq.js";
7
+ import { E as Tt } from "./empty-placeholder-wf6-BWE8.js";
8
+ import { _ as Pt, F as Ct, a as It } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-dJ5ogZkp.js";
9
9
  import { u as Ft, R as tt } from "./usePromise-CbVUCxhj.js";
10
- import { u as Et } from "./index-z0AxAVmq.js";
11
- const Ie = pt((m, e) => {
12
- const a = me(), h = Pe();
10
+ import { u as Et } from "./index-ChUdGYpp.js";
11
+ const Ie = pt((p, e) => {
12
+ const a = me(), b = Pe();
13
13
  return {
14
14
  async readRequests(u, t, c) {
15
- const i = u ?? a.currentLocationDBName, n = `${m.inventoryBackendUrl}/${i}/purchase-request`;
15
+ const i = u ?? a.currentLocationDBName, n = `${p.inventoryBackendUrl}/${i}/purchase-request`;
16
16
  return t && c ? await e.get(`${n}?startDate=${t}&endDate=${c}`) : await e.get(n);
17
17
  },
18
18
  async readRequestById(u, t) {
19
- const c = t ?? a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-request/${u}`;
19
+ const c = t ?? a.currentLocationDBName, i = `${p.inventoryBackendUrl}/${c}/purchase-request/${u}`;
20
20
  return await e.get(i);
21
21
  },
22
22
  async readRequestByIds(u, t) {
23
- const c = t ?? a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-request/find`;
23
+ const c = t ?? a.currentLocationDBName, i = `${p.inventoryBackendUrl}/${c}/purchase-request/find`;
24
24
  return await e.post(i, { requestIds: u });
25
25
  },
26
26
  async getPurchaseOrders({
27
27
  start: u,
28
28
  end: t
29
29
  }) {
30
- const c = a.currentLocationDBName, i = `${m.inventoryBackendUrl}/${c}/purchase-order`;
30
+ const c = a.currentLocationDBName, i = `${p.inventoryBackendUrl}/${c}/purchase-order`;
31
31
  return await e.get(`${i}?start=${u}&end=${t}`);
32
32
  },
33
33
  async getLatestPurchaseOrderRequest(u) {
34
- const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
34
+ const t = a.currentLocationDBName, c = `${p.inventoryBackendUrl}/${t}/purchase-request/find-by-purchase-order-id`;
35
35
  return await e.get(`${c}/${u}`);
36
36
  },
37
37
  async getPurchaseOrderById(u) {
38
- const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
38
+ const t = a.currentLocationDBName, c = `${p.inventoryBackendUrl}/${t}/purchase-order`;
39
39
  return await e.get(`${c}/${u}`);
40
40
  },
41
41
  /**
42
42
  * @deprecated Use `processPurchaseOrderV2` instead.
43
43
  */
44
44
  async processPurchaseOrder(u, t) {
45
- const c = a.currentLocationDBName, i = t || c, n = `${m.inventoryBackendUrl}/${i}/purchase-order/run-operation`;
45
+ const c = a.currentLocationDBName, i = t || c, n = `${p.inventoryBackendUrl}/${i}/purchase-order/run-operation`;
46
46
  return await e.put(n, u);
47
47
  },
48
48
  async createPurchaseOrder(u) {
49
- const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
49
+ const t = a.currentLocationDBName, c = `${p.inventoryBackendUrl}/${t}/purchase-order`;
50
50
  return await e.post(c, u);
51
51
  },
52
52
  async updatePurchaseOrder(u) {
53
- const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order`;
53
+ const t = a.currentLocationDBName, c = `${p.inventoryBackendUrl}/${t}/purchase-order`;
54
54
  return await e.put(c, u);
55
55
  },
56
56
  async importFromXilnex(u) {
57
- const t = a.currentLocationDBName, c = `${m.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
57
+ const t = a.currentLocationDBName, c = `${p.inventoryBackendUrl}/${t}/purchase-order/import-from-xilnex`;
58
58
  return await e.post(c, u);
59
59
  },
60
60
  async processPurchaseOrderV2(u, t) {
61
- const c = a.currentLocationDBName, i = t || c, n = `${m.inventoryBackendUrl}/${i}/v2/purchase-order/run-operation`;
61
+ const c = a.currentLocationDBName, i = t || c, n = `${p.inventoryBackendUrl}/${i}/v2/purchase-order/run-operation`;
62
62
  return await e.put(n, u);
63
63
  },
64
64
  async getWorkflowConfig() {
65
65
  var i;
66
- const t = `business_${(i = h.currentBusiness.value) == null ? void 0 : i._id}`, c = `${m.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
66
+ const t = `business_${(i = b.currentBusiness.value) == null ? void 0 : i._id}`, c = `${p.inventoryBackendUrl}/${t}/v2/purchase-order/workflow-config`;
67
67
  return await e.get(c);
68
68
  }
69
69
  };
70
70
  }), ut = {
71
- [R.enum.confirmDraft]: {
71
+ [O.enum.confirmDraft]: {
72
72
  primaryActions: {
73
73
  text: "Confirm draft",
74
74
  close: !0
@@ -77,7 +77,7 @@ const Ie = pt((m, e) => {
77
77
  message: "Purchase order cannot be changed after confirm draft.",
78
78
  successMessage: "Purchase order draft has been confirmed"
79
79
  },
80
- [R.enum.cancelDraft]: {
80
+ [O.enum.cancelDraft]: {
81
81
  primaryActions: {
82
82
  text: "Cancel draft",
83
83
  close: !0,
@@ -87,7 +87,7 @@ const Ie = pt((m, e) => {
87
87
  message: "Purchase order cannot be changed after cancelled draft.",
88
88
  successMessage: "Purchase order draft has been cancelled"
89
89
  },
90
- [R.enum.submitRequest]: {
90
+ [O.enum.submitRequest]: {
91
91
  primaryActions: {
92
92
  text: "Submit request",
93
93
  close: !0
@@ -96,7 +96,7 @@ const Ie = pt((m, e) => {
96
96
  message: "Purchase order cannot be changed after confirm draft.",
97
97
  successMessage: "Purchase order draft has been submitted"
98
98
  },
99
- [R.enum.completeReceive]: {
99
+ [O.enum.completeReceive]: {
100
100
  primaryActions: {
101
101
  text: "Mark received",
102
102
  close: !0
@@ -105,7 +105,7 @@ const Ie = pt((m, e) => {
105
105
  message: "Purchase order cannot be changed after it has complete receiving.",
106
106
  successMessage: "Purchase order has been marked as received"
107
107
  },
108
- [R.enum.approveRequest]: {
108
+ [O.enum.approveRequest]: {
109
109
  primaryActions: {
110
110
  text: "Accept request",
111
111
  close: !0
@@ -114,7 +114,7 @@ const Ie = pt((m, e) => {
114
114
  message: "Transfer out request will be accepted.",
115
115
  successMessage: "Transfer out request has been approved"
116
116
  },
117
- [R.enum.rejectRequest]: {
117
+ [O.enum.rejectRequest]: {
118
118
  primaryActions: {
119
119
  text: "Reject request",
120
120
  close: !0,
@@ -124,7 +124,7 @@ const Ie = pt((m, e) => {
124
124
  message: "Purchase order will be rejected.",
125
125
  successMessage: "Purchase order has been rejected"
126
126
  },
127
- [R.enum.processRequest]: {
127
+ [O.enum.processRequest]: {
128
128
  primaryActions: {
129
129
  text: "Process request",
130
130
  close: !0,
@@ -135,70 +135,70 @@ const Ie = pt((m, e) => {
135
135
  successMessage: "Purchase order has been processed"
136
136
  }
137
137
  };
138
- function ze(m) {
139
- return Te.generatedPOReceivedMap({
140
- purchaseOrder: m
138
+ function ze(p) {
139
+ return $e.generatedPOReceivedMap({
140
+ purchaseOrder: p
141
141
  });
142
142
  }
143
- function Lt(m) {
144
- return Te.validatePOItemReceivedStatus({
145
- dto: m
143
+ function Lt(p) {
144
+ return $e.validatePOItemReceivedStatus({
145
+ dto: p
146
146
  });
147
147
  }
148
- function dt(m) {
149
- return Te.validatePOReceivedStatus({
150
- receivedMap: m
148
+ function dt(p) {
149
+ return $e.validatePOReceivedStatus({
150
+ receivedMap: p
151
151
  });
152
152
  }
153
- function ft(m, e, a) {
154
- if (!ie.safeParse(m).success)
155
- throw new Error(`Invalid purchase order status: ${m}`);
156
- const h = ie.parse(m);
157
- return Te.orderStatusCombination({
158
- status: h,
153
+ function ft(p, e, a) {
154
+ if (!ie.safeParse(p).success)
155
+ throw new Error(`Invalid purchase order status: ${p}`);
156
+ const b = ie.parse(p);
157
+ return $e.orderStatusCombination({
158
+ status: b,
159
159
  isPOPartialReceive: e,
160
160
  isPOOverReceive: a
161
161
  });
162
162
  }
163
163
  function mt() {
164
- const m = me(), e = Ie(), a = $e();
165
- async function h(t, c) {
166
- const i = m.currentLocationDBName;
167
- return t.doc.supplier.internal && t.operation === R.enum.confirmDraft && (t.operation = R.enum.submitRequest), await e.processPurchaseOrder(t, c || i);
164
+ const p = me(), e = Ie(), a = Ae();
165
+ async function b(t, c) {
166
+ const i = p.currentLocationDBName;
167
+ return t.doc.supplier.internal && t.operation === O.enum.confirmDraft && (t.operation = O.enum.submitRequest), await e.processPurchaseOrder(t, c || i);
168
168
  }
169
169
  async function u(t, c) {
170
- const i = m.currentLocationDBName;
170
+ const i = p.currentLocationDBName;
171
171
  return await e.processPurchaseOrderV2(t, c || i);
172
172
  }
173
- return (t) => a.useOperatePurchaseOrderV2 ? u(t.operateV2, t.transferTo) : h(t.operate, t.transferTo);
173
+ return (t) => a.useOperatePurchaseOrderV2 ? u(t.operateV2, t.transferTo) : b(t.operate, t.transferTo);
174
174
  }
175
- var Me = /* @__PURE__ */ ((m) => (m.RECEIVE_REQUEST = "receive/request", m.APPROVAL = "approval", m))(Me || {});
175
+ var Me = /* @__PURE__ */ ((p) => (p.RECEIVE_REQUEST = "receive/request", p.APPROVAL = "approval", p))(Me || {});
176
176
  const Oe = M(), Ve = M();
177
- function zs(m, e) {
178
- const a = je(), h = me(), u = $e();
179
- Ae();
180
- const t = qt(), c = Tt(), i = M(!1), n = Ce(), y = Ie(), _ = M(new Array()), p = M(
177
+ function zs(p, e) {
178
+ const a = je(), b = me(), u = Ae();
179
+ Te();
180
+ const t = qt(), c = $t(), i = M(!1), n = Ce(), h = Ie(), _ = M(new Array()), v = M(
181
181
  e != null && e.startDate && (e != null && e.endDate) ? e : vt()
182
- ), f = Z(() => {
183
- const k = new Date(p.value.startDate), A = new Date(p.value.endDate);
182
+ ), m = Z(() => {
183
+ const k = new Date(v.value.startDate), T = new Date(v.value.endDate);
184
184
  return {
185
185
  start: yt(k).toISOString(),
186
- end: ht(A).toISOString()
186
+ end: ht(T).toISOString()
187
187
  };
188
- }), l = M(new Array()), s = bt(), b = M(null);
189
- async function O(k) {
190
- function A(r) {
191
- const d = {
188
+ }), l = M(new Array()), r = bt(), d = M(null);
189
+ async function w(k) {
190
+ function T(s) {
191
+ const f = {
192
192
  mode: Xe.CREATE,
193
193
  modelValue: k || void 0,
194
194
  show: !0,
195
- "onUpdate:show"(w) {
196
- Oe.value.show = w;
195
+ "onUpdate:show"(R) {
196
+ Oe.value.show = R;
197
197
  },
198
- templateId: r,
199
- lastClosingDate: b.value
198
+ templateId: s,
199
+ lastClosingDate: d.value
200
200
  };
201
- Oe.value = d;
201
+ Oe.value = f;
202
202
  }
203
203
  let H;
204
204
  u.mustUsePoTemplate && !(k != null && k.template) ? a.open({
@@ -214,34 +214,34 @@ function zs(m, e) {
214
214
  close: !0
215
215
  }
216
216
  }).onPrimary(async () => {
217
- H = await t.getTemplateId(), H && A(H);
217
+ H = await t.getTemplateId(), H && T(H);
218
218
  }).onSecondary(() => {
219
- A(void 0);
220
- }) : A(H);
219
+ T(void 0);
220
+ }) : T(H);
221
221
  }
222
- function N(k) {
223
- const A = {
222
+ function x(k) {
223
+ const T = {
224
224
  mode: Xe.UPDATE,
225
225
  modelValue: rt(k),
226
226
  show: !0,
227
227
  "onUpdate:show"(H) {
228
228
  Oe.value.show = H;
229
229
  },
230
- lastClosingDate: b.value
230
+ lastClosingDate: d.value
231
231
  };
232
- Oe.value = A;
232
+ Oe.value = T;
233
233
  }
234
234
  async function E() {
235
235
  _.value = [], i.value = !0;
236
236
  try {
237
- _.value = await y.getPurchaseOrders(f.value).then((r) => r.sort((d, w) => w._id.localeCompare(d._id)));
238
- const k = await s.readCurrentLocationLastClosing(!0), A = k == null ? void 0 : k._id;
239
- A && (b.value = gt(A)), await u.awaitFeatureLoaded(() => u.mustUsePoTemplate) && await c.fetchTemplates();
240
- const H = _.value.map((r) => {
241
- var d;
242
- return ((d = r.request) == null ? void 0 : d.id) ?? "";
243
- }).filter((r) => r);
244
- l.value = await y.readRequestByIds(H);
237
+ _.value = await h.getPurchaseOrders(m.value).then((s) => s.sort((f, R) => R._id.localeCompare(f._id)));
238
+ const k = await r.readCurrentLocationLastClosing(!0), T = k == null ? void 0 : k._id;
239
+ T && (d.value = gt(T)), await u.awaitFeatureLoaded(() => u.mustUsePoTemplate) && await c.fetchTemplates();
240
+ const H = _.value.map((s) => {
241
+ var f;
242
+ return ((f = s.request) == null ? void 0 : f.id) ?? "";
243
+ }).filter((s) => s);
244
+ l.value = await h.readRequestByIds(H);
245
245
  } catch {
246
246
  n.open({
247
247
  title: "Something went wrong",
@@ -252,13 +252,13 @@ function zs(m, e) {
252
252
  i.value = !1;
253
253
  }
254
254
  }
255
- async function $() {
255
+ async function A() {
256
256
  l.value = [], i.value = !0;
257
257
  try {
258
- l.value = await y.readRequests(
258
+ l.value = await h.readRequests(
259
259
  void 0,
260
- f.value.start,
261
- f.value.end
260
+ m.value.start,
261
+ m.value.end
262
262
  ).then((k) => k.reverse());
263
263
  } catch {
264
264
  n.open({
@@ -271,20 +271,20 @@ function zs(m, e) {
271
271
  }
272
272
  }
273
273
  function P() {
274
- switch (m) {
274
+ switch (p) {
275
275
  case "receive/request":
276
276
  return E();
277
277
  case "approval":
278
- return $();
278
+ return A();
279
279
  }
280
280
  }
281
- function K(k, A) {
282
- p.value = {
281
+ function K(k, T) {
282
+ v.value = {
283
283
  startDate: k,
284
- endDate: A
284
+ endDate: T
285
285
  }, P();
286
286
  }
287
- h.watchLocation(async (k) => {
287
+ b.watchLocation(async (k) => {
288
288
  if (!k) {
289
289
  _.value = [];
290
290
  return;
@@ -292,39 +292,39 @@ function zs(m, e) {
292
292
  await P();
293
293
  });
294
294
  const G = M(), ce = M(Math.random().toString());
295
- async function le(k, A) {
295
+ async function le(k, T) {
296
296
  const H = Math.random().toString();
297
- ce.value = H, A ?? (A = l.value.computeFirst(
298
- (w) => w.purchaseOrderId === k._id ? w : null
297
+ ce.value = H, T ?? (T = l.value.computeFirst(
298
+ (R) => R.purchaseOrderId === k._id ? R : null
299
299
  ) ?? void 0);
300
- const r = m === "receive/request" ? h.currentLocation : A == null ? void 0 : A.to, d = {
301
- poRequest: A,
300
+ const s = p === "receive/request" ? b.currentLocation : T == null ? void 0 : T.to, f = {
301
+ poRequest: T,
302
302
  purchaseOrder: k,
303
- transferTo: r == null ? void 0 : r.name,
304
- transferToDbName: r == null ? void 0 : r.dbName,
303
+ transferTo: s == null ? void 0 : s.name,
304
+ transferToDbName: s == null ? void 0 : s.dbName,
305
305
  show: !0,
306
306
  canResubmit: !1,
307
- canApprove: m === "approval",
308
- "onUpdate:show"(w) {
309
- G.value.show = w;
307
+ canApprove: p === "approval",
308
+ "onUpdate:show"(R) {
309
+ G.value.show = R;
310
310
  },
311
- scope: m,
311
+ scope: p,
312
312
  receivedMap: ze(k) ?? {}
313
313
  };
314
- G.value = d;
314
+ G.value = f;
315
315
  }
316
- async function be(k, A, H, r) {
317
- const d = mt();
316
+ async function be(k, T, H, s) {
317
+ const f = mt();
318
318
  i.value = !0;
319
319
  try {
320
- await d({
320
+ await f({
321
321
  operate: {
322
- operation: A,
322
+ operation: T,
323
323
  doc: k,
324
324
  options: (
325
325
  // auto receive for supplier to warehouse
326
- (A === R.enum.confirmDraft || // auto receive for warehouse to warehouse
327
- A === R.enum.completeReceive) && u.autoReceiveWarehouse ? {
326
+ (T === O.enum.confirmDraft || // auto receive for warehouse to warehouse
327
+ T === O.enum.completeReceive) && u.autoReceiveWarehouse ? {
328
328
  autoReceive: !0
329
329
  } : void 0
330
330
  )
@@ -332,13 +332,13 @@ function zs(m, e) {
332
332
  operateV2: {
333
333
  _id: k._id,
334
334
  _rev: k._rev ?? "",
335
- action: A,
335
+ action: T,
336
336
  payloads: []
337
337
  },
338
- transferTo: r
338
+ transferTo: s
339
339
  }), await new Promise((j) => setTimeout(j, 1e3));
340
340
  const q = me().currentLocationDBName.startsWith("restaurant_");
341
- A === R.enum.confirmDraft && k.effectiveAt && q ? n.open({
341
+ T === O.enum.confirmDraft && k.effectiveAt && q ? n.open({
342
342
  title: "Success",
343
343
  message: `${H}. The backdate will be reflected once your POS has received this change.`,
344
344
  type: "success"
@@ -347,33 +347,33 @@ function zs(m, e) {
347
347
  message: H,
348
348
  type: "success"
349
349
  });
350
- } catch (w) {
350
+ } catch (R) {
351
351
  n.open({
352
352
  title: "Something went wrong",
353
353
  message: "Please try again.",
354
354
  type: "error"
355
- }), console.error("Error when submitting PO operation", A, k, w);
355
+ }), console.error("Error when submitting PO operation", T, k, R);
356
356
  } finally {
357
357
  i.value = !1, P();
358
358
  }
359
359
  }
360
- async function Fe(k, A, H) {
361
- const r = ut[A];
362
- if (!r) {
360
+ async function Fe(k, T, H) {
361
+ const s = ut[T];
362
+ if (!s) {
363
363
  n.open({
364
364
  title: "Something went wrong",
365
- message: `Cannot process order: ${Ke(A)}`,
365
+ message: `Cannot process order: ${Ke(T)}`,
366
366
  type: "error"
367
367
  });
368
368
  return;
369
369
  }
370
- const { successMessage: d, ...w } = r;
370
+ const { successMessage: f, ...R } = s;
371
371
  a.open({
372
- title: w.title,
373
- message: w.message,
374
- primaryActions: w.primaryActions
372
+ title: R.title,
373
+ message: R.message,
374
+ primaryActions: R.primaryActions
375
375
  }).onPrimary(() => {
376
- be(k, A, d, H);
376
+ be(k, T, f, H);
377
377
  });
378
378
  }
379
379
  async function ue() {
@@ -390,8 +390,8 @@ function zs(m, e) {
390
390
  }).onPrimary(() => {
391
391
  const k = {
392
392
  show: !0,
393
- "onUpdate:show"(A) {
394
- Ve.value.show = A;
393
+ "onUpdate:show"(T) {
394
+ Ve.value.show = T;
395
395
  }
396
396
  };
397
397
  Ve.value = k;
@@ -404,8 +404,8 @@ function zs(m, e) {
404
404
  fetchData: P,
405
405
  loading: i,
406
406
  transferDialogProps: Oe,
407
- promptCreateTransferDialog: O,
408
- promptUpdateTransferDialog: N,
407
+ promptCreateTransferDialog: w,
408
+ promptUpdateTransferDialog: x,
409
409
  transferDetailsProps: G,
410
410
  promptShowTransferDetails: le,
411
411
  submitAction: Fe,
@@ -413,17 +413,17 @@ function zs(m, e) {
413
413
  promptUploadTransferDialog: ue
414
414
  };
415
415
  }
416
- function Bt(m, e) {
416
+ function Bt(p, e) {
417
417
  return e.reduce(
418
- (h, u) => {
419
- const t = u.received.find((c) => c.sku._id === m._id);
420
- return t && (h = st(h, t.amount)), h;
418
+ (b, u) => {
419
+ const t = u.received.find((c) => c.sku._id === p._id);
420
+ return t && (b = st(b, t.amount)), b;
421
421
  },
422
- kt.toPrecision(nt(0), m.unit.precision)
422
+ kt.toPrecision(nt(0), p.unit.precision)
423
423
  );
424
424
  }
425
- function Vt(m) {
426
- const { po: e, currentLocation: a, business: h, fulfilling: u, por: t } = m, { name: c, address: i, regNo: n } = a.doc.profile, y = {
425
+ function Vt(p) {
426
+ const { po: e, currentLocation: a, business: b, fulfilling: u, por: t } = p, { name: c, address: i, regNo: n } = a.doc.profile, h = {
427
427
  name: c,
428
428
  registrationNumber: n,
429
429
  line1: i == null ? void 0 : i.line1,
@@ -442,26 +442,26 @@ function Vt(m) {
442
442
  city: e.supplier.address.city,
443
443
  state: e.supplier.address.state,
444
444
  country: e.supplier.address.country
445
- }, p = e.items.map(($) => {
446
- const { sku: P, measurement: K } = $, G = fe(
447
- Bt($.sku, e.deliveryOrder || []),
445
+ }, v = e.items.map((A) => {
446
+ const { sku: P, measurement: K } = A, G = fe(
447
+ Bt(A.sku, e.deliveryOrder || []),
448
448
  !1
449
449
  );
450
450
  return {
451
451
  code: P.code,
452
452
  description: P.name,
453
- quantity: fe($.quantity, !1),
453
+ quantity: fe(A.quantity, !1),
454
454
  unit: (K == null ? void 0 : K.abbrev) || P.unit.abbrev,
455
455
  received: G,
456
- cost: $.totalCost ? `${$.totalCost.currency} ${_t.toFormatString({
457
- value: $.totalCost
456
+ cost: A.totalCost ? `${A.totalCost.currency} ${_t.toFormatString({
457
+ value: A.totalCost
458
458
  })}` : void 0
459
459
  };
460
- }), f = e.deliveryOrder.map(($) => ({
461
- createdAt: at(new Date($.createdAt)),
462
- ref: $.deliveryOrderNumber,
463
- remark: $.remark || "",
464
- items: $.received.map((P) => {
460
+ }), m = e.deliveryOrder.map((A) => ({
461
+ createdAt: at(new Date(A.createdAt)),
462
+ ref: A.deliveryOrderNumber,
463
+ remark: A.remark || "",
464
+ items: A.received.map((P) => {
465
465
  var K;
466
466
  return {
467
467
  code: P.sku.code,
@@ -476,72 +476,72 @@ function Vt(m) {
476
476
  // Dev
477
477
  "6880b36a3054c5001db19218"
478
478
  ];
479
- let s = "Inventory Receive Note";
480
- if (e.supplier.internal ? (s = "Inventory Transfer Note", l.includes((h == null ? void 0 : h._id) || "") && (s = "Stock Request")) : s = "Purchase Order", t) {
481
- const $ = t.from.dbName;
482
- a.dbName === $ || (s = "Inventory Receive Note");
479
+ let r = "Inventory Receive Note";
480
+ if (e.supplier.internal ? (r = "Inventory Transfer Note", l.includes((b == null ? void 0 : b._id) || "") && (r = "Stock Request")) : r = "Purchase Order", t) {
481
+ const A = t.from.dbName;
482
+ a.dbName === A || (r = "Inventory Receive Note");
483
483
  }
484
- const O = {
485
- title: s,
486
- businessName: h == null ? void 0 : h.name,
487
- logo: h == null ? void 0 : h.thumbnail,
484
+ const w = {
485
+ title: r,
486
+ businessName: b == null ? void 0 : b.name,
487
+ logo: b == null ? void 0 : b.thumbnail,
488
488
  orderNumber: e.seqNumber.toString(),
489
489
  createdAt: qe(e._id),
490
490
  ref: e.ref || "",
491
491
  remark: e.remark || "",
492
- buyer: y,
492
+ buyer: h,
493
493
  supplier: _,
494
- items: p,
494
+ items: v,
495
495
  status: e.status,
496
- deliveryOrders: f
497
- }, N = new URL(window.location.href), E = u && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
498
- N.pathname = N.hostname.includes("portal.feedme") ? `/inventory/${E}` : `/${E}`, N.searchParams.append("data", JSON.stringify(O)), window.open(N.href, "_blank", "noreferrer");
496
+ deliveryOrders: m
497
+ }, x = new URL(window.location.href), E = u && (e.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
498
+ x.pathname = x.hostname.includes("portal.feedme") ? `/inventory/${E}` : `/${E}`, x.searchParams.append("data", JSON.stringify(w)), window.open(x.href, "_blank", "noreferrer");
499
499
  }
500
500
  const Se = {
501
501
  submitRequest: {
502
502
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
503
503
  color: "text-fm-color-typo-primary",
504
- value: R.enum.submitRequest
504
+ value: O.enum.submitRequest
505
505
  },
506
506
  confirmDraft: {
507
507
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
508
508
  color: "text-fm-color-typo-primary",
509
- value: R.enum.confirmDraft
509
+ value: O.enum.confirmDraft
510
510
  },
511
511
  cancelDraft: {
512
512
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
513
513
  color: "text-fm-color-typo-error",
514
- value: R.enum.cancelDraft
514
+ value: O.enum.cancelDraft
515
515
  },
516
516
  approveRequest: {
517
517
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
518
518
  color: "text-fm-color-typo-primary",
519
- value: R.enum.approveRequest
519
+ value: O.enum.approveRequest
520
520
  },
521
521
  rejectRequest: {
522
522
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
523
523
  color: "text-fm-color-typo-error",
524
- value: R.enum.rejectRequest
524
+ value: O.enum.rejectRequest
525
525
  },
526
526
  processRequest: {
527
527
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
528
528
  color: "text-fm-color-typo-primary",
529
- value: R.enum.processRequest
529
+ value: O.enum.processRequest
530
530
  },
531
531
  receiveStock: {
532
532
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
533
533
  color: "text-fm-color-typo-primary",
534
- value: R.enum.receiveStock
534
+ value: O.enum.receiveStock
535
535
  },
536
536
  completeReceive: {
537
537
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
538
538
  color: "text-fm-color-typo-primary",
539
- value: R.enum.completeReceive
539
+ value: O.enum.completeReceive
540
540
  },
541
541
  closeRequest: {
542
542
  translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
543
543
  color: "system-error-300",
544
- value: R.enum.closeRequest
544
+ value: O.enum.closeRequest
545
545
  },
546
546
  approveDraft: {
547
547
  translationKey: "",
@@ -556,30 +556,30 @@ const Se = {
556
556
  returnStock: {
557
557
  translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
558
558
  color: "text-fm-color-typo-primary",
559
- value: R.enum.returnStock
559
+ value: O.enum.returnStock
560
560
  }
561
561
  };
562
- function Hs(m, e) {
563
- const a = me(), h = Ae(), u = Pe(), { t } = ct();
564
- function c(f) {
565
- switch (f.status) {
562
+ function Hs(p, e) {
563
+ const a = me(), b = Te(), u = Pe(), { t } = ct();
564
+ function c(m) {
565
+ switch (m.status) {
566
566
  case "DRAFT":
567
567
  return [
568
568
  ne[J.Update],
569
569
  ne[J.Details],
570
- f.supplier.internal === "restaurant" || f.supplier.internal === "warehouse" ? Se[R.enum.submitRequest] : Se[R.enum.confirmDraft],
571
- Se[R.enum.cancelDraft]
570
+ m.supplier.internal === "restaurant" || m.supplier.internal === "warehouse" ? Se[O.enum.submitRequest] : Se[O.enum.confirmDraft],
571
+ Se[O.enum.cancelDraft]
572
572
  ];
573
573
  case "RECEIVING":
574
574
  return [
575
- Se[R.enum.completeReceive],
575
+ Se[O.enum.completeReceive],
576
576
  ne[J.Details],
577
577
  ne[J.Print]
578
578
  ];
579
579
  case "REQUESTING":
580
- return m === "receive/request" ? [ne[J.Details], ne[J.Print]] : [
581
- Se[R.enum.approveRequest],
582
- Se[R.enum.rejectRequest],
580
+ return p === "receive/request" ? [ne[J.Details], ne[J.Print]] : [
581
+ Se[O.enum.approveRequest],
582
+ Se[O.enum.rejectRequest],
583
583
  ne[J.Details]
584
584
  // DefaultRowActions[RowActionEnum.Print]
585
585
  ];
@@ -591,38 +591,38 @@ function Hs(m, e) {
591
591
  return [ne[J.Details], ne[J.Print]];
592
592
  }
593
593
  }
594
- function i(f) {
595
- return Object.values(R.enum).includes(f);
594
+ function i(m) {
595
+ return Object.values(O.enum).includes(m);
596
596
  }
597
- async function n(f, l, s) {
598
- var O, N, E, $, P, K;
599
- const b = rt(l);
600
- if (f === J.Print) {
601
- const G = (s == null ? void 0 : s.toInventoryLocation) ?? a.currentLocation;
602
- ((O = s == null ? void 0 : s.netSuite) != null && O.refNo || (N = b.netSuite) != null && N.refNo) && (b.ref = [((E = s == null ? void 0 : s.netSuite) == null ? void 0 : E.refNo) || (($ = b.netSuite) == null ? void 0 : $.refNo)].filter((ce) => ce).join(" ")), Vt({
603
- po: b,
597
+ async function n(m, l, r) {
598
+ var w, x, E, A, P, K;
599
+ const d = rt(l);
600
+ if (m === J.Print) {
601
+ const G = (r == null ? void 0 : r.toInventoryLocation) ?? a.currentLocation;
602
+ ((w = r == null ? void 0 : r.netSuite) != null && w.refNo || (x = d.netSuite) != null && x.refNo) && (d.ref = [((E = r == null ? void 0 : r.netSuite) == null ? void 0 : E.refNo) || ((A = d.netSuite) == null ? void 0 : A.refNo)].filter((ce) => ce).join(" ")), Vt({
603
+ po: d,
604
604
  currentLocation: G,
605
605
  business: u.currentBusiness.value,
606
- fulfilling: m === "approval",
607
- por: s
606
+ fulfilling: p === "approval",
607
+ por: r
608
608
  });
609
609
  return;
610
610
  }
611
- if (f === J.Details) {
612
- e.promptShowTransferDetails(b, s);
611
+ if (m === J.Details) {
612
+ e.promptShowTransferDetails(d, r);
613
613
  return;
614
614
  }
615
- if (f === J.Update) {
616
- (P = e.promptUpdateTransferDialog) == null || P.call(e, b);
615
+ if (m === J.Update) {
616
+ (P = e.promptUpdateTransferDialog) == null || P.call(e, d);
617
617
  return;
618
618
  }
619
- if (i(f)) {
620
- e.submitAction(l, f, (K = s == null ? void 0 : s.to) == null ? void 0 : K.dbName);
619
+ if (i(m)) {
620
+ e.submitAction(l, m, (K = r == null ? void 0 : r.to) == null ? void 0 : K.dbName);
621
621
  return;
622
622
  }
623
623
  }
624
- function y() {
625
- const f = [
624
+ function h() {
625
+ const m = [
626
626
  {
627
627
  accessorKey: "seqNumber",
628
628
  header: () => t("inventory.transfer.table.seqNo"),
@@ -648,15 +648,15 @@ function Hs(m, e) {
648
648
  accessorKey: "items.length",
649
649
  header: () => t("inventory.transfer.table.noOfItems"),
650
650
  cell: (l) => {
651
- const s = l.row.original.version || "1", b = l.getValue();
652
- return T("div", { class: "flex items-center gap-2" }, [
653
- b,
654
- s !== "1" ? T(
651
+ const r = l.row.original.version || "1", d = l.getValue();
652
+ return $("div", { class: "flex items-center gap-2" }, [
653
+ d,
654
+ r !== "1" ? $(
655
655
  "div",
656
656
  {
657
657
  class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
658
658
  },
659
- `v${s}`
659
+ `v${r}`
660
660
  ) : null
661
661
  ]);
662
662
  },
@@ -675,21 +675,21 @@ function Hs(m, e) {
675
675
  accessorKey: "status",
676
676
  header: () => t("inventory.transfer.table.status"),
677
677
  cell(l) {
678
- const s = l.getValue(), b = ze(l.row.original), { partial: O, over: N } = dt(b), E = t(
679
- `inventory.transfer.status.${ft(s ?? "", O, N)}`
680
- ), $ = `${s ?? ""}`.toLocaleLowerCase("en-us");
681
- return T(
678
+ const r = l.getValue(), d = ze(l.row.original), { partial: w, over: x } = dt(d), E = t(
679
+ `inventory.transfer.status.${ft(r ?? "", w, x)}`
680
+ ), A = `${r ?? ""}`.toLocaleLowerCase("en-us");
681
+ return $(
682
682
  "div",
683
683
  {
684
684
  class: "flex"
685
685
  },
686
- T(
686
+ $(
687
687
  "div",
688
688
  {
689
689
  class: [
690
690
  "fm-status-badge",
691
- `fm-status-badge-${$}`,
692
- N && "fm-status-badge-error"
691
+ `fm-status-badge-${A}`,
692
+ x && "fm-status-badge-error"
693
693
  ].filter(Boolean).join(" ")
694
694
  },
695
695
  `${E}`
@@ -702,8 +702,8 @@ function Hs(m, e) {
702
702
  {
703
703
  id: "action",
704
704
  cell(l) {
705
- const s = l.row.original, b = c(s);
706
- return Ze(b, (O) => n(O, s));
705
+ const r = l.row.original, d = c(r);
706
+ return Ze(d, (w) => n(w, r));
707
707
  },
708
708
  enableSorting: !1,
709
709
  size: 40,
@@ -713,15 +713,19 @@ function Hs(m, e) {
713
713
  }
714
714
  }
715
715
  ];
716
- if (h.isEnabled) {
716
+ if (b.isEnabled) {
717
717
  const l = [
718
718
  {
719
719
  id: "netsuiteTransferOrder",
720
+ accessorFn: (r) => {
721
+ var d;
722
+ return (d = r.netSuite) != null && d.id ? `${r.netSuite.refNo} (${r.netSuite.id})` : "N/A";
723
+ },
720
724
  header: () => "NetSuite Order (ID)",
721
- cell(s) {
722
- var O;
723
- const b = s.row.original;
724
- return (O = b.netSuite) != null && O.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
725
+ cell(r) {
726
+ var w;
727
+ const d = r.row.original;
728
+ return (w = d.netSuite) != null && w.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
725
729
  },
726
730
  enableSorting: !1,
727
731
  size: 200,
@@ -732,10 +736,14 @@ function Hs(m, e) {
732
736
  },
733
737
  {
734
738
  id: "netsuiteTransactionNumber",
739
+ accessorFn: (r) => {
740
+ var d, w;
741
+ return ((w = (d = r.netSuite) == null ? void 0 : d.additionalInfo) == null ? void 0 : w.transactionnumber) ?? "N/A";
742
+ },
735
743
  header: () => "NetSuite Transaction No.",
736
- cell(s) {
737
- var O, N;
738
- return ((N = (O = s.row.original.netSuite) == null ? void 0 : O.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
744
+ cell(r) {
745
+ var w, x;
746
+ return ((x = (w = r.row.original.netSuite) == null ? void 0 : w.additionalInfo) == null ? void 0 : x.transactionnumber) ?? "N/A";
739
747
  },
740
748
  enableSorting: !1,
741
749
  size: 200,
@@ -745,12 +753,12 @@ function Hs(m, e) {
745
753
  }
746
754
  }
747
755
  ];
748
- f.splice(f.length - 1, 0, ...l);
756
+ m.splice(m.length - 1, 0, ...l);
749
757
  }
750
- return f;
758
+ return m;
751
759
  }
752
760
  function _() {
753
- const f = [
761
+ const m = [
754
762
  {
755
763
  accessorKey: "purchaseOrder.seqNumber",
756
764
  header: () => t("inventory.transfer.table.seqNo"),
@@ -787,19 +795,19 @@ function Hs(m, e) {
787
795
  accessorKey: "purchaseOrder.status",
788
796
  header: () => t("inventory.transfer.table.status"),
789
797
  cell(l) {
790
- var $, P;
791
- const s = l.row.original, b = l.getValue(), O = b === "RECEIVING" && (((P = ($ = s.purchaseOrder) == null ? void 0 : $.deliveryOrder) == null ? void 0 : P.length) ?? 0) > 0, N = t(O ? "inventory.transfer.status.PARTIAL_RECEIVED" : `inventory.transfer.status.${b ?? ""}`), E = O ? "partially_received" : `${b ?? ""}`.toLocaleLowerCase("en-us");
792
- return T(
798
+ var A, P;
799
+ const r = l.row.original, d = l.getValue(), w = d === "RECEIVING" && (((P = (A = r.purchaseOrder) == null ? void 0 : A.deliveryOrder) == null ? void 0 : P.length) ?? 0) > 0, x = t(w ? "inventory.transfer.status.PARTIAL_RECEIVED" : `inventory.transfer.status.${d ?? ""}`), E = w ? "partially_received" : `${d ?? ""}`.toLocaleLowerCase("en-us");
800
+ return $(
793
801
  "div",
794
802
  {
795
803
  class: "flex"
796
804
  },
797
- T(
805
+ $(
798
806
  "div",
799
807
  {
800
808
  class: `fm-status-badge fm-status-badge-${E}`
801
809
  },
802
- N
810
+ x
803
811
  )
804
812
  );
805
813
  },
@@ -808,13 +816,13 @@ function Hs(m, e) {
808
816
  {
809
817
  id: "action",
810
818
  cell(l) {
811
- const s = l.row.original, O = (s.purchaseOrder ? c(s.purchaseOrder) : []).map((N) => N.value === J.Print ? {
812
- ...N,
819
+ const r = l.row.original, w = (r.purchaseOrder ? c(r.purchaseOrder) : []).map((x) => x.value === J.Print ? {
820
+ ...x,
813
821
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
814
- } : N);
822
+ } : x);
815
823
  return Ze(
816
- O,
817
- (N) => s.purchaseOrder ? n(N, s.purchaseOrder, s) : void 0
824
+ w,
825
+ (x) => r.purchaseOrder ? n(x, r.purchaseOrder, r) : void 0
818
826
  );
819
827
  },
820
828
  enableSorting: !1,
@@ -825,15 +833,19 @@ function Hs(m, e) {
825
833
  }
826
834
  }
827
835
  ];
828
- if (h.isEnabled) {
836
+ if (b.isEnabled) {
829
837
  const l = [
830
838
  {
831
839
  id: "netsuiteTransferOrder",
840
+ accessorFn: (r) => {
841
+ var d;
842
+ return (d = r.netSuite) != null && d.id ? `${r.netSuite.refNo} (${r.netSuite.id})` : "N/A";
843
+ },
832
844
  header: () => "NetSuite Order (ID)",
833
- cell(s) {
834
- var O;
835
- const b = s.row.original;
836
- return (O = b.netSuite) != null && O.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
845
+ cell(r) {
846
+ var w;
847
+ const d = r.row.original;
848
+ return (w = d.netSuite) != null && w.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
837
849
  },
838
850
  enableSorting: !1,
839
851
  size: 200,
@@ -844,10 +856,14 @@ function Hs(m, e) {
844
856
  },
845
857
  {
846
858
  id: "netsuiteTransactionNumber",
859
+ accessorFn: (r) => {
860
+ var d, w;
861
+ return ((w = (d = r.netSuite) == null ? void 0 : d.additionalInfo) == null ? void 0 : w.transactionnumber) ?? "N/A";
862
+ },
847
863
  header: () => "NetSuite Transaction No.",
848
- cell(s) {
849
- var O, N;
850
- return ((N = (O = s.row.original.netSuite) == null ? void 0 : O.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
864
+ cell(r) {
865
+ var w, x;
866
+ return ((x = (w = r.row.original.netSuite) == null ? void 0 : w.additionalInfo) == null ? void 0 : x.transactionnumber) ?? "N/A";
851
867
  },
852
868
  enableSorting: !1,
853
869
  size: 200,
@@ -857,12 +873,12 @@ function Hs(m, e) {
857
873
  }
858
874
  }
859
875
  ];
860
- f.splice(f.length - 2, 0, ...l);
876
+ m.splice(m.length - 2, 0, ...l);
861
877
  }
862
- return f;
878
+ return m;
863
879
  }
864
880
  return {
865
- columnDefs: Z(() => m === "receive/request" ? y() : _())
881
+ columnDefs: Z(() => p === "receive/request" ? h() : _())
866
882
  };
867
883
  }
868
884
  const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Mt = { class: "flex flex-col gap-8" }, Kt = { class: "flex w-full justify-end gap-16" }, jt = /* @__PURE__ */ he({
@@ -872,41 +888,41 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
872
888
  confirm: { type: Function }
873
889
  },
874
890
  emits: ["update:show"],
875
- setup(m, { emit: e }) {
876
- const a = m, h = Rt({
891
+ setup(p, { emit: e }) {
892
+ const a = p, b = Rt({
877
893
  id: "",
878
894
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
879
895
  items: []
880
896
  }), u = M(), t = e;
881
897
  lt(() => {
882
- a.purchaseOrder && (h.items = a.purchaseOrder.items.map((i) => ({
898
+ a.purchaseOrder && (b.items = a.purchaseOrder.items.map((i) => ({
883
899
  id: i.id,
884
900
  sku: i.sku,
885
901
  measurement: i.measurement,
886
902
  amount: i.quantity ?? { amount: 1, precision: 0 }
887
903
  })));
888
904
  });
889
- const c = Z(() => h.items.length <= 10);
905
+ const c = Z(() => b.items.length <= 10);
890
906
  return (i, n) => {
891
- const y = z("FmTable"), _ = z("FmButton"), p = z("FmForm");
892
- return g(), oe(p, {
907
+ const h = z("FmTable"), _ = z("FmButton"), v = z("FmForm");
908
+ return g(), oe(v, {
893
909
  ref_key: "formRef",
894
910
  ref: u,
895
911
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
896
912
  onValidationFailed: console.log,
897
- onValidationSuccess: n[1] || (n[1] = () => a.confirm(h))
913
+ onValidationSuccess: n[1] || (n[1] = () => a.confirm(b))
898
914
  }, {
899
915
  default: ae(() => [
900
916
  n[2] || (n[2] = o("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
901
917
  o("div", Ut, [
902
918
  o("div", Mt, [
903
- I(y, {
919
+ I(h, {
904
920
  "column-defs": [
905
921
  {
906
922
  header: "Code",
907
- cell: (f) => {
908
- const l = a.purchaseOrder.items.find((s) => s.id === f.row.original.id || s.sku._id === f.row.original.sku._id);
909
- return T(
923
+ cell: (m) => {
924
+ const l = a.purchaseOrder.items.find((r) => r.id === m.row.original.id || r.sku._id === m.row.original.sku._id);
925
+ return $(
910
926
  S(et).FmTooltip,
911
927
  {
912
928
  content: l.code,
@@ -914,7 +930,7 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
914
930
  variant: "plain",
915
931
  zIndex: 50
916
932
  },
917
- T(
933
+ $(
918
934
  "span",
919
935
  {
920
936
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
@@ -926,9 +942,9 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
926
942
  },
927
943
  {
928
944
  header: "Name",
929
- cell: (f) => {
930
- const l = a.purchaseOrder.items.find((s) => s.id === f.row.original.id || s.sku._id === f.row.original.sku._id);
931
- return T(
945
+ cell: (m) => {
946
+ const l = a.purchaseOrder.items.find((r) => r.id === m.row.original.id || r.sku._id === m.row.original.sku._id);
947
+ return $(
932
948
  S(et).FmTooltip,
933
949
  {
934
950
  content: l.name,
@@ -936,7 +952,7 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
936
952
  variant: "plain",
937
953
  zIndex: 50
938
954
  },
939
- T(
955
+ $(
940
956
  "span",
941
957
  {
942
958
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
@@ -948,39 +964,39 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
948
964
  },
949
965
  {
950
966
  header: "Amount",
951
- cell: (f) => {
952
- const l = f.row.original, s = a.purchaseOrder.items.find((O) => O.id === l.id || O.sku._id === l.sku._id), b = l.amount ?? {
967
+ cell: (m) => {
968
+ const l = m.row.original, r = a.purchaseOrder.items.find((w) => w.id === l.id || w.sku._id === l.sku._id), d = l.amount ?? {
953
969
  amount: 1,
954
970
  precision: 0
955
971
  };
956
- return T(Pt, {
972
+ return $(Pt, {
957
973
  style: {
958
974
  flex: "1 1 0%"
959
975
  },
960
976
  modelValue: {
961
- amount: b,
977
+ amount: d,
962
978
  measurement: l.measurement ?? null
963
979
  },
964
980
  key: l.id ?? l.sku._id,
965
981
  unit: l.sku.unit,
966
- "onUpdate:modelValue": (O) => {
967
- if (!O) return;
968
- const N = h.items.find((E) => E.id === l.id || E.sku._id === l.sku._id);
969
- N && (N.amount = O.amount);
982
+ "onUpdate:modelValue": (w) => {
983
+ if (!w) return;
984
+ const x = b.items.find((E) => E.id === l.id || E.sku._id === l.sku._id);
985
+ x && (x.amount = w.amount);
970
986
  },
971
987
  disableUnit: !0,
972
988
  rules: [
973
989
  S(Ct)(
974
990
  +S(fe)({ amount: 0, precision: 0 })
975
991
  ),
976
- S(It)(+S(fe)(s.quantity))
992
+ S(It)(+S(fe)(r.quantity))
977
993
  ],
978
994
  applyDefaultRules: !0
979
995
  });
980
996
  }
981
997
  }
982
998
  ],
983
- "row-data": h.items,
999
+ "row-data": b.items,
984
1000
  "hide-footer": c.value
985
1001
  }, null, 8, ["column-defs", "row-data", "hide-footer"])
986
1002
  ])
@@ -1072,23 +1088,23 @@ const Ut = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1072
1088
  }
1073
1089
  };
1074
1090
  function zt() {
1075
- const m = $e();
1091
+ const p = Ae();
1076
1092
  return {
1077
1093
  ableToMarkReceived(e) {
1078
1094
  if (!e || e.status !== ie.enum.RECEIVING)
1079
1095
  return !1;
1080
- const h = me().currentLocationDBName;
1081
- return `${e.supplier.internal}_${e.supplier._id}` !== h;
1096
+ const b = me().currentLocationDBName;
1097
+ return `${e.supplier.internal}_${e.supplier._id}` !== b;
1082
1098
  },
1083
1099
  ableToMarkApproved(e) {
1084
1100
  return !(!e || (e == null ? void 0 : e.status) !== ie.enum.REQUESTING);
1085
1101
  },
1086
1102
  ableToCreateFulfillment(e, a) {
1087
1103
  var t, c;
1088
- if (!m.acceptRequireFulfillment || !e || !a || e.status !== ie.enum.PROCESSING || !a.processedAt)
1104
+ if (!p.acceptRequireFulfillment || !e || !a || e.status !== ie.enum.PROCESSING || !a.processedAt)
1089
1105
  return !1;
1090
- const h = (t = a == null ? void 0 : a.from) == null ? void 0 : t.dbName, u = (c = a == null ? void 0 : a.to) == null ? void 0 : c.dbName;
1091
- return !(h.startsWith("restaurant_") && u.startsWith("restaurant_"));
1106
+ const b = (t = a == null ? void 0 : a.from) == null ? void 0 : t.dbName, u = (c = a == null ? void 0 : a.to) == null ? void 0 : c.dbName;
1107
+ return !(b.startsWith("restaurant_") && u.startsWith("restaurant_"));
1092
1108
  }
1093
1109
  };
1094
1110
  }
@@ -1100,22 +1116,22 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1100
1116
  isTransferBetweenOutlets: { type: Boolean },
1101
1117
  scope: {}
1102
1118
  },
1103
- setup(m) {
1104
- const e = m, a = Ae(), h = Ce(), u = je(), t = M(!1);
1119
+ setup(p) {
1120
+ const e = p, a = Te(), b = Ce(), u = je(), t = M(!1);
1105
1121
  Z(() => {
1106
- var _, p, f, l;
1122
+ var _, v, m, l;
1107
1123
  let i = !0;
1108
1124
  a.isEnabled || (i = !1);
1109
- const n = e.purchaseOrder, y = e.poRequest;
1110
- return n && ((_ = n == null ? void 0 : n.supplier) != null && _.internal ? (!y && n.status == ie.enum.DRAFT && (i = !1), y && !((p = y == null ? void 0 : y.netSuite) != null && p.id) && (i = !1), e.isTransferBetweenOutlets && (i = !1)) : ((n == null ? void 0 : n.status) !== ie.enum.REQUESTING && n.supplier.internal && (i = !1), !y && !((f = n == null ? void 0 : n.netSuite) != null && f.id) && (i = !1), !y && ((l = n == null ? void 0 : n.netSuite) != null && l.id) && (n == null ? void 0 : n.status) == ie.enum.REQUESTING && (i = !1))), i;
1125
+ const n = e.purchaseOrder, h = e.poRequest;
1126
+ return n && ((_ = n == null ? void 0 : n.supplier) != null && _.internal ? (!h && n.status == ie.enum.DRAFT && (i = !1), h && !((v = h == null ? void 0 : h.netSuite) != null && v.id) && (i = !1), e.isTransferBetweenOutlets && (i = !1)) : ((n == null ? void 0 : n.status) !== ie.enum.REQUESTING && n.supplier.internal && (i = !1), !h && !((m = n == null ? void 0 : n.netSuite) != null && m.id) && (i = !1), !h && ((l = n == null ? void 0 : n.netSuite) != null && l.id) && (n == null ? void 0 : n.status) == ie.enum.REQUESTING && (i = !1))), i;
1111
1127
  });
1112
1128
  async function c() {
1113
1129
  t.value || u.open({
1114
1130
  title: "Sync with NetSuite",
1115
- contentComponent: T("div", [
1116
- T("p", "Are you sure you want to sync now?"),
1117
- T("br"),
1118
- T(
1131
+ contentComponent: $("div", [
1132
+ $("p", "Are you sure you want to sync now?"),
1133
+ $("br"),
1134
+ $(
1119
1135
  "p",
1120
1136
  { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" },
1121
1137
  "Please wait a moment before syncing manually to avoid unnecessary actions."
@@ -1128,20 +1144,20 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1128
1144
  },
1129
1145
  secondaryActions: { text: "Not now", close: !0 }
1130
1146
  }).onPrimary(async () => {
1131
- var i, n, y;
1147
+ var i, n, h;
1132
1148
  try {
1133
1149
  t.value = !0;
1134
- const _ = ((i = e.purchaseOrder) == null ? void 0 : i._id) || ((n = e.poRequest) == null ? void 0 : n.purchaseOrderId) || "", p = (y = e.poRequest) == null ? void 0 : y.to.dbName;
1150
+ const _ = ((i = e.purchaseOrder) == null ? void 0 : i._id) || ((n = e.poRequest) == null ? void 0 : n.purchaseOrderId) || "", v = (h = e.poRequest) == null ? void 0 : h.to.dbName;
1135
1151
  await a.syncPurchaseOrder(
1136
1152
  _,
1137
- e.scope === "approval" ? p : void 0
1138
- ), h.open({
1153
+ e.scope === "approval" ? v : void 0
1154
+ ), b.open({
1139
1155
  title: "Sync with NetSuite",
1140
1156
  message: "Requested to sync with NetSuite. Please wait a moment.",
1141
1157
  type: "success"
1142
- }), await new Promise((f) => setTimeout(f, 5e3)), t.value = !1;
1158
+ }), await new Promise((m) => setTimeout(m, 5e3)), t.value = !1;
1143
1159
  } catch {
1144
- h.open({
1160
+ b.open({
1145
1161
  title: "Error",
1146
1162
  message: "Failed to sync with NetSuite",
1147
1163
  type: "error"
@@ -1150,9 +1166,9 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1150
1166
  });
1151
1167
  }
1152
1168
  return (i, n) => {
1153
- const y = z("FmButton");
1154
- return g(), x("div", Ht, [
1155
- I(y, {
1169
+ const h = z("FmButton");
1170
+ return g(), N("div", Ht, [
1171
+ I(h, {
1156
1172
  "prepend-icon": "sync",
1157
1173
  variant: "secondary",
1158
1174
  label: "Sync",
@@ -1190,57 +1206,57 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1190
1206
  isTransferBetweenOutlets: { type: Boolean },
1191
1207
  scope: {}
1192
1208
  },
1193
- setup(m) {
1194
- const e = m, a = Ae(), h = Ie(), u = M(e.poRequest);
1209
+ setup(p) {
1210
+ const e = p, a = Te(), b = Ie(), u = M(e.poRequest);
1195
1211
  lt(async () => {
1196
1212
  var n;
1197
1213
  if (!e.poRequest && ((n = e.purchaseOrder) != null && n._id)) {
1198
- const y = await h.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1199
- u.value = y;
1214
+ const h = await b.getLatestPurchaseOrderRequest(e.purchaseOrder._id);
1215
+ u.value = h;
1200
1216
  }
1201
1217
  });
1202
1218
  const t = Z(
1203
1219
  () => {
1204
- var n, y, _, p, f, l;
1220
+ var n, h, _, v, m, l;
1205
1221
  return a.getSubsidiaryFullName(
1206
- ((_ = (y = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : y.subsidiary) == null ? void 0 : _.id) || ((l = (f = (p = e.poRequest) == null ? void 0 : p.netSuite) == null ? void 0 : f.subsidiary) == null ? void 0 : l.id)
1222
+ ((_ = (h = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : h.subsidiary) == null ? void 0 : _.id) || ((l = (m = (v = e.poRequest) == null ? void 0 : v.netSuite) == null ? void 0 : m.subsidiary) == null ? void 0 : l.id)
1207
1223
  ).fullName;
1208
1224
  }
1209
1225
  ), c = Z(() => {
1210
- var n, y, _, p, f, l, s, b, O, N, E, $;
1211
- return (_ = (y = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : y.additionalInfo) != null && _.transactionnumber ? (l = (f = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.additionalInfo) == null ? void 0 : l.transactionnumber : (O = (b = (s = u.value) == null ? void 0 : s.netSuite) == null ? void 0 : b.additionalInfo) != null && O.transactionnumber ? ($ = (E = (N = u.value) == null ? void 0 : N.netSuite) == null ? void 0 : E.additionalInfo) == null ? void 0 : $.transactionnumber : null;
1226
+ var n, h, _, v, m, l, r, d, w, x, E, A;
1227
+ return (_ = (h = (n = e.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : h.additionalInfo) != null && _.transactionnumber ? (l = (m = (v = e.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : m.additionalInfo) == null ? void 0 : l.transactionnumber : (w = (d = (r = u.value) == null ? void 0 : r.netSuite) == null ? void 0 : d.additionalInfo) != null && w.transactionnumber ? (A = (E = (x = u.value) == null ? void 0 : x.netSuite) == null ? void 0 : E.additionalInfo) == null ? void 0 : A.transactionnumber : null;
1212
1228
  }), i = Z(() => {
1213
- var n, y, _, p, f, l;
1214
- return (y = (n = e.purchaseOrder) == null ? void 0 : n.deliveryFullfillment) != null && y.length && ((p = (_ = e.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) == null ? void 0 : p.length) > 0 ? (l = (f = e.purchaseOrder) == null ? void 0 : f.deliveryFullfillment) == null ? void 0 : l.map((s) => {
1215
- var b;
1216
- return (b = s.netSuite) == null ? void 0 : b.refNo;
1229
+ var n, h, _, v, m, l;
1230
+ return (h = (n = e.purchaseOrder) == null ? void 0 : n.deliveryFullfillment) != null && h.length && ((v = (_ = e.purchaseOrder) == null ? void 0 : _.deliveryFullfillment) == null ? void 0 : v.length) > 0 ? (l = (m = e.purchaseOrder) == null ? void 0 : m.deliveryFullfillment) == null ? void 0 : l.map((r) => {
1231
+ var d;
1232
+ return (d = r.netSuite) == null ? void 0 : d.refNo;
1217
1233
  }).join(", ") : "N/A";
1218
1234
  });
1219
- return (n, y) => {
1220
- var _, p, f, l, s, b, O, N, E, $, P, K, G, ce, le, be;
1221
- return S(a).isEnabled ? (g(), x("div", Wt, [
1235
+ return (n, h) => {
1236
+ var _, v, m, l, r, d, w, x, E, A, P, K, G, ce, le, be;
1237
+ return S(a).isEnabled ? (g(), N("div", Wt, [
1222
1238
  o("div", Yt, [
1223
- y[0] || (y[0] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1239
+ h[0] || (h[0] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1224
1240
  o("div", Qt, D(t.value || "N/A"), 1)
1225
1241
  ]),
1226
- !n.isTransferBetweenOutlets && n.scope === S(Me).RECEIVE_REQUEST ? (g(), x("div", Xt, [
1227
- o("div", Zt, " NetSuite " + D((p = (_ = n.purchaseOrder) == null ? void 0 : _.netSuite) != null && p.recordType ? S(ot)((l = (f = n.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : l.recordType) : n.transferType === S(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1242
+ !n.isTransferBetweenOutlets && n.scope === S(Me).RECEIVE_REQUEST ? (g(), N("div", Xt, [
1243
+ o("div", Zt, " NetSuite " + D((v = (_ = n.purchaseOrder) == null ? void 0 : _.netSuite) != null && v.recordType ? S(ot)((l = (m = n.purchaseOrder) == null ? void 0 : m.netSuite) == null ? void 0 : l.recordType) : n.transferType === S(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1228
1244
  o("div", Jt, [
1229
- (b = (s = n.purchaseOrder) == null ? void 0 : s.netSuite) != null && b.id ? (g(), x("span", er, D((N = (O = n.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : N.refNo) + " (" + D(($ = (E = n.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : $.id) + ") ", 1)) : (g(), x("span", tr, "N/A"))
1245
+ (d = (r = n.purchaseOrder) == null ? void 0 : r.netSuite) != null && d.id ? (g(), N("span", er, D((x = (w = n.purchaseOrder) == null ? void 0 : w.netSuite) == null ? void 0 : x.refNo) + " (" + D((A = (E = n.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : A.id) + ") ", 1)) : (g(), N("span", tr, "N/A"))
1230
1246
  ])
1231
1247
  ])) : U("", !0),
1232
- !n.isTransferBetweenOutlets && u.value || n.scope === S(Me).APPROVAL ? (g(), x("div", rr, [
1248
+ !n.isTransferBetweenOutlets && u.value || n.scope === S(Me).APPROVAL ? (g(), N("div", rr, [
1233
1249
  o("div", sr, " (Request) NetSuite " + D(n.transferType === S(ye).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1234
1250
  o("div", nr, [
1235
- (K = (P = u.value) == null ? void 0 : P.netSuite) != null && K.id ? (g(), x("span", ar, D((ce = (G = u.value) == null ? void 0 : G.netSuite) == null ? void 0 : ce.refNo) + " (" + D((be = (le = u.value) == null ? void 0 : le.netSuite) == null ? void 0 : be.id) + ") ", 1)) : (g(), x("span", or, "N/A"))
1251
+ (K = (P = u.value) == null ? void 0 : P.netSuite) != null && K.id ? (g(), N("span", ar, D((ce = (G = u.value) == null ? void 0 : G.netSuite) == null ? void 0 : ce.refNo) + " (" + D((be = (le = u.value) == null ? void 0 : le.netSuite) == null ? void 0 : be.id) + ") ", 1)) : (g(), N("span", or, "N/A"))
1236
1252
  ])
1237
1253
  ])) : U("", !0),
1238
- c.value ? (g(), x("div", ir, [
1239
- y[1] || (y[1] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1254
+ c.value ? (g(), N("div", ir, [
1255
+ h[1] || (h[1] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1240
1256
  o("div", lr, D(c.value), 1)
1241
1257
  ])) : U("", !0),
1242
- S(a).isEnabled && n.transferType === S(ye).TRANSFER && !n.isTransferBetweenOutlets ? (g(), x("div", cr, [
1243
- y[2] || (y[2] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1258
+ S(a).isEnabled && n.transferType === S(ye).TRANSFER && !n.isTransferBetweenOutlets ? (g(), N("div", cr, [
1259
+ h[2] || (h[2] = o("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1244
1260
  o("div", ur, D(i.value), 1)
1245
1261
  ])) : U("", !0)
1246
1262
  ])) : U("", !0);
@@ -1252,9 +1268,9 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1252
1268
  netsuiteId: {},
1253
1269
  purchaseOrderId: {}
1254
1270
  },
1255
- setup(m) {
1271
+ setup(p) {
1256
1272
  const e = Ce(), a = it();
1257
- async function h(u, t) {
1273
+ async function b(u, t) {
1258
1274
  const c = [];
1259
1275
  if (u && c.push(`body.message:*${u}*`), t) {
1260
1276
  const _ = t.replace(/:/g, "\\:");
@@ -1267,23 +1283,23 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1267
1283
  });
1268
1284
  return;
1269
1285
  }
1270
- const n = `attributes.pod:netsuite* AND (${c.join(" OR ")})`, { url: y } = await a.getLogs(n);
1286
+ const n = `attributes.pod:netsuite* AND (${c.join(" OR ")})`, { url: h } = await a.getLogs(n);
1271
1287
  e.open(
1272
1288
  {
1273
1289
  message: "Opening NetSuite logs...",
1274
1290
  type: "info"
1275
1291
  },
1276
1292
  800
1277
- ), await new Promise((_) => setTimeout(_, 800)), window.open(y, "_blank");
1293
+ ), await new Promise((_) => setTimeout(_, 800)), window.open(h, "_blank");
1278
1294
  }
1279
1295
  return (u, t) => {
1280
1296
  const c = z("FmButton");
1281
- return g(), x("div", fr, [
1297
+ return g(), N("div", fr, [
1282
1298
  I(c, {
1283
1299
  "prepend-icon": "history",
1284
1300
  variant: "secondary",
1285
1301
  label: "Logs",
1286
- onClick: t[0] || (t[0] = (i) => h(u.netsuiteId, u.purchaseOrderId)),
1302
+ onClick: t[0] || (t[0] = (i) => b(u.netsuiteId, u.purchaseOrderId)),
1287
1303
  "text-color": "primary",
1288
1304
  "bg-color": "transparent",
1289
1305
  "border-color": "primary"
@@ -1300,18 +1316,18 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1300
1316
  netsuiteId: {},
1301
1317
  purchaseOrderId: {}
1302
1318
  },
1303
- setup(m) {
1304
- const e = m, a = it(), h = M(!1), u = me(), t = M(!0), c = M(!1), i = M(null);
1319
+ setup(p) {
1320
+ const e = p, a = it(), b = M(!1), u = me(), t = M(!0), c = M(!1), i = M(null);
1305
1321
  async function n() {
1306
1322
  if (!i.value) {
1307
- h.value = !0;
1323
+ b.value = !0;
1308
1324
  try {
1309
1325
  t.value = !0;
1310
- const y = await a.getMoreInfo(
1326
+ const h = await a.getMoreInfo(
1311
1327
  u.currentLocation.dbName,
1312
1328
  e.purchaseOrderId
1313
1329
  );
1314
- i.value = y, c.value = !1;
1330
+ i.value = h, c.value = !1;
1315
1331
  } catch {
1316
1332
  c.value = !0;
1317
1333
  } finally {
@@ -1319,20 +1335,20 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1319
1335
  }
1320
1336
  }
1321
1337
  }
1322
- return (y, _) => {
1323
- const p = z("FmButton"), f = z("FmLabel"), l = z("FmDialog");
1324
- return g(), x("div", pr, [
1338
+ return (h, _) => {
1339
+ const v = z("FmButton"), m = z("FmLabel"), l = z("FmDialog");
1340
+ return g(), N("div", pr, [
1325
1341
  I(l, {
1326
- modelValue: h.value,
1327
- "onUpdate:modelValue": _[2] || (_[2] = (s) => h.value = s),
1342
+ modelValue: b.value,
1343
+ "onUpdate:modelValue": _[2] || (_[2] = (r) => b.value = r),
1328
1344
  overlay: !0
1329
1345
  }, {
1330
1346
  "dialog-button": ae(() => [
1331
- I(p, {
1347
+ I(v, {
1332
1348
  "prepend-icon": "info",
1333
1349
  variant: "secondary",
1334
1350
  label: "Latest Info",
1335
- onClick: _[0] || (_[0] = (s) => n()),
1351
+ onClick: _[0] || (_[0] = (r) => n()),
1336
1352
  "text-color": "primary",
1337
1353
  "bg-color": "transparent",
1338
1354
  "border-color": "primary"
@@ -1342,26 +1358,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1342
1358
  o("div", null, "NetSuite latest info", -1)
1343
1359
  ])),
1344
1360
  "dialog-footer": ae(() => [
1345
- I(p, {
1361
+ I(v, {
1346
1362
  class: "ml-auto sm:w-full xs:w-full",
1347
1363
  label: "Close",
1348
1364
  size: "md",
1349
1365
  variant: "primary",
1350
- onClick: _[1] || (_[1] = (s) => h.value = !1)
1366
+ onClick: _[1] || (_[1] = (r) => b.value = !1)
1351
1367
  })
1352
1368
  ]),
1353
1369
  default: ae(() => [
1354
- t.value ? (g(), x("div", vr, "Loading...")) : (g(), x("div", yr, [
1355
- c.value ? (g(), x("p", _r, "Something went wrong.")) : (g(!0), x(se, { key: 0 }, ve(i.value, (s, b) => (g(), x("div", {
1356
- key: b,
1370
+ t.value ? (g(), N("div", vr, "Loading...")) : (g(), N("div", yr, [
1371
+ c.value ? (g(), N("p", _r, "Something went wrong.")) : (g(!0), N(se, { key: 0 }, ve(i.value, (r, d) => (g(), N("div", {
1372
+ key: d,
1357
1373
  class: "mb-2"
1358
1374
  }, [
1359
1375
  o("div", null, [
1360
- I(f, {
1361
- label: S(Ke)(b)
1376
+ I(m, {
1377
+ label: S(Ke)(d)
1362
1378
  }, null, 8, ["label"]),
1363
1379
  o("div", hr, [
1364
- Array.isArray(s) ? (g(), x("span", br, D(s.length > 0 ? s.join(", ") : "N/A"), 1)) : (g(), x("span", gr, D(s), 1))
1380
+ Array.isArray(r) ? (g(), N("span", br, D(r.length > 0 ? r.join(", ") : "N/A"), 1)) : (g(), N("span", gr, D(r), 1))
1365
1381
  ])
1366
1382
  ])
1367
1383
  ]))), 128))
@@ -1375,7 +1391,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1375
1391
  }), wr = {
1376
1392
  key: 0,
1377
1393
  class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
1378
- }, Rr = { class: "flex gap-8 items-center" }, Or = { class: "ml-auto" }, xr = { class: "flex gap-4" }, Nr = /* @__PURE__ */ he({
1394
+ }, Rr = { class: "flex gap-8 items-center" }, Or = { class: "ml-auto" }, Nr = { class: "flex gap-4" }, xr = /* @__PURE__ */ he({
1379
1395
  __name: "NetSuitePanel",
1380
1396
  props: {
1381
1397
  poRequest: {},
@@ -1384,29 +1400,29 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1384
1400
  transferToDbName: {},
1385
1401
  scope: {}
1386
1402
  },
1387
- setup(m) {
1388
- const e = m, a = Et(), h = Pe(), u = Z(() => {
1389
- var n, y, _, p, f, l, s;
1390
- const t = ((n = e.transferToDbName) == null ? void 0 : n.startsWith("restaurant")) && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.supplier) == null ? void 0 : _.internal) === "restaurant", c = e.transferType === ye.PURCHASE, i = e.transferType === ye.TRANSFER;
1391
- return c || i && !t || ((f = (p = e.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.id) || ((s = (l = e.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : s.id);
1403
+ setup(p) {
1404
+ const e = p, a = Et(), b = Pe(), u = Z(() => {
1405
+ var n, h, _, v, m, l, r;
1406
+ const t = ((n = e.transferToDbName) == null ? void 0 : n.startsWith("restaurant")) && ((_ = (h = e.purchaseOrder) == null ? void 0 : h.supplier) == null ? void 0 : _.internal) === "restaurant", c = e.transferType === ye.PURCHASE, i = e.transferType === ye.TRANSFER;
1407
+ return c || i && !t || ((m = (v = e.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : m.id) || ((r = (l = e.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : r.id);
1392
1408
  });
1393
1409
  return (t, c) => {
1394
- var n, y, _, p, f, l, s, b, O, N;
1410
+ var n, h, _, v, m, l, r, d, w, x;
1395
1411
  const i = z("FmMenuDivider");
1396
- return S(a).isNetSuiteEnabled && u.value ? (g(), x("div", wr, [
1412
+ return S(a).isNetSuiteEnabled && u.value ? (g(), N("div", wr, [
1397
1413
  o("div", Rr, [
1398
1414
  c[0] || (c[0] = o("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1399
1415
  o("div", Or, [
1400
- o("div", xr, [
1401
- (n = S(h).sessionUser.value) != null && n.role.isAdmin && ((_ = (y = e.purchaseOrder) == null ? void 0 : y.netSuite) != null && _.id) ? (g(), oe(Sr, {
1416
+ o("div", Nr, [
1417
+ (n = S(b).sessionUser.value) != null && n.role.isAdmin && ((_ = (h = e.purchaseOrder) == null ? void 0 : h.netSuite) != null && _.id) ? (g(), oe(Sr, {
1402
1418
  key: 0,
1403
- "netsuite-id": (f = (p = t.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : f.id,
1419
+ "netsuite-id": (m = (v = t.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : m.id,
1404
1420
  "purchase-order-id": (l = t.purchaseOrder) == null ? void 0 : l._id
1405
1421
  }, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0),
1406
- (s = S(h).sessionUser.value) != null && s.role.isAdmin ? (g(), oe(mr, {
1422
+ (r = S(b).sessionUser.value) != null && r.role.isAdmin ? (g(), oe(mr, {
1407
1423
  key: 1,
1408
- "netsuite-id": (O = (b = t.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : O.id,
1409
- "purchase-order-id": (N = t.purchaseOrder) == null ? void 0 : N._id
1424
+ "netsuite-id": (w = (d = t.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : w.id,
1425
+ "purchase-order-id": (x = t.purchaseOrder) == null ? void 0 : x._id
1410
1426
  }, null, 8, ["netsuite-id", "purchase-order-id"])) : U("", !0),
1411
1427
  I(Gt, {
1412
1428
  "po-request": t.poRequest,
@@ -1429,7 +1445,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1429
1445
  ])) : U("", !0);
1430
1446
  };
1431
1447
  }
1432
- }), kr = { class: "flex flex-col gap-16 w-full h-full" }, Dr = { class: "flex justify-between" }, qr = { class: "fm-typo-en-body-lg-600" }, Tr = { class: "flex flex-col gap-8" }, $r = { class: "flex flex-col gap-4" }, Ar = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pr = { class: "flex gap-1" }, Cr = { class: "fm-typo-en-body-lg-600" }, Ir = {
1448
+ }), kr = { class: "flex flex-col gap-16 w-full h-full" }, Dr = { class: "flex justify-between" }, qr = { class: "fm-typo-en-body-lg-600" }, $r = { class: "flex flex-col gap-8" }, Ar = { class: "flex flex-col gap-4" }, Tr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Pr = { class: "flex gap-1" }, Cr = { class: "fm-typo-en-body-lg-600" }, Ir = {
1433
1449
  key: 0,
1434
1450
  class: "flex flex-col gap-4"
1435
1451
  }, Fr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Er = { class: "fm-typo-en-body-lg-600" }, Lr = { class: "flex flex-col gap-4" }, Br = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Vr = { class: "fm-typo-en-body-lg-600" }, Ur = {
@@ -1462,13 +1478,13 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1462
1478
  }, ws = { class: "flex-1 flex flex-col items-center" }, Rs = { class: "flex-1 flex flex-col items-center" }, Os = {
1463
1479
  class: "py-12 flex flex-col gap-4",
1464
1480
  name: "received-at header"
1465
- }, xs = { class: "fm-typo-en-body-lg-400" }, Ns = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-12 content-stretch" }, Ds = {
1481
+ }, Ns = { class: "fm-typo-en-body-lg-400" }, xs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-12 content-stretch" }, Ds = {
1466
1482
  class: "flex flex-col w-24",
1467
1483
  name: "circles"
1468
- }, qs = { class: "flex-1 flex flex-col items-center" }, Ts = {
1484
+ }, qs = { class: "flex-1 flex flex-col items-center" }, $s = {
1469
1485
  class: "py-12 flex flex-col gap-4 flex-1",
1470
1486
  name: "delivery details"
1471
- }, $s = { class: "flex flex-col gap-8" }, As = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ps = { class: "flex flex-col gap-4" }, Cs = { class: "flex gap-8 xs:flex-col" }, Gs = /* @__PURE__ */ he({
1487
+ }, As = { class: "flex flex-col gap-8" }, Ts = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ps = { class: "flex flex-col gap-4" }, Cs = { class: "flex gap-8 xs:flex-col" }, Gs = /* @__PURE__ */ he({
1472
1488
  __name: "TransferDetails",
1473
1489
  props: {
1474
1490
  poRequest: {},
@@ -1482,28 +1498,28 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1482
1498
  receivedMap: {}
1483
1499
  },
1484
1500
  emits: ["update:show", "submitted"],
1485
- setup(m, { emit: e }) {
1486
- const a = m, h = e, u = je(), t = Ce(), c = $e(), i = me(), n = Pe(), y = Z(
1501
+ setup(p, { emit: e }) {
1502
+ const a = p, b = e, u = je(), t = Ce(), c = Ae(), i = me(), n = Pe(), h = Z(
1487
1503
  () => {
1488
- var r, d;
1504
+ var s, f;
1489
1505
  return {
1490
- id: ((r = n.sessionUser.value) == null ? void 0 : r.id) ?? "",
1491
- name: ((d = n.sessionUser.value) == null ? void 0 : d.displayName) ?? ""
1506
+ id: ((s = n.sessionUser.value) == null ? void 0 : s.id) ?? "",
1507
+ name: ((f = n.sessionUser.value) == null ? void 0 : f.displayName) ?? ""
1492
1508
  };
1493
1509
  }
1494
- ), _ = zt(), { t: p } = ct(), f = Z(
1510
+ ), _ = zt(), { t: v } = ct(), m = Z(
1495
1511
  () => {
1496
- var r, d, w, q;
1497
- return ((d = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : d.internal) === "restaurant" || ((q = (w = a.purchaseOrder) == null ? void 0 : w.supplier) == null ? void 0 : q.internal) === "warehouse" ? ye.TRANSFER : ye.PURCHASE;
1512
+ var s, f, R, q;
1513
+ return ((f = (s = a.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : f.internal) === "restaurant" || ((q = (R = a.purchaseOrder) == null ? void 0 : R.supplier) == null ? void 0 : q.internal) === "warehouse" ? ye.TRANSFER : ye.PURCHASE;
1498
1514
  }
1499
- ), l = M(!1), s = M(""), b = M(!0), O = Ie(), N = Ft(O.getWorkflowConfig), E = mt(), $ = Z(() => {
1515
+ ), l = M(!1), r = M(""), d = M(!0), w = Ie(), x = Ft(w.getWorkflowConfig), E = mt(), A = Z(() => {
1500
1516
  if (!a.purchaseOrder)
1501
1517
  return [];
1502
- const r = N.result.value;
1503
- if (r.state === tt.loading)
1518
+ const s = x.result.value;
1519
+ if (s.state === tt.loading)
1504
1520
  return [];
1505
- const d = {
1506
- user: y.value,
1521
+ const f = {
1522
+ user: h.value,
1507
1523
  executedAt: i.locations.computeFirst(
1508
1524
  (q) => {
1509
1525
  var j;
@@ -1513,44 +1529,44 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1513
1529
  purchaseOrderRequest: a.poRequest,
1514
1530
  purchaseOrder: a.purchaseOrder
1515
1531
  };
1516
- let w = [];
1532
+ let R = [];
1517
1533
  try {
1518
- r.state === tt.error ? (console.error("Error fetching workflow config:", r.error), w = Ee.getAvailableActions({
1519
- ...d,
1534
+ s.state === tt.error ? (console.error("Error fetching workflow config:", s.error), R = Ee.getAvailableActions({
1535
+ ...f,
1520
1536
  orderConfig: Ee.getDefaultConfig()
1521
1537
  }).actions.filter(
1522
1538
  (q) => (
1523
1539
  // TODO: create receiveStock & processRequest dialog
1524
1540
  // to create their payload
1525
- q !== R.enum.receiveStock && q !== R.enum.processRequest && q !== R.enum.closeRequest
1541
+ q !== O.enum.receiveStock && q !== O.enum.processRequest && q !== O.enum.closeRequest
1526
1542
  )
1527
- )) : w = Ee.getAvailableActions({
1528
- ...d,
1529
- orderConfig: r.data
1543
+ )) : R = Ee.getAvailableActions({
1544
+ ...f,
1545
+ orderConfig: s.data
1530
1546
  }).actions.filter(
1531
- (q) => q !== R.enum.receiveStock && q !== R.enum.processRequest && q !== R.enum.closeRequest
1547
+ (q) => q !== O.enum.receiveStock && q !== O.enum.processRequest && q !== O.enum.closeRequest
1532
1548
  );
1533
1549
  } catch (q) {
1534
1550
  console.error("Error getting available actions:", q);
1535
1551
  }
1536
- return a.scope === "approval" && (w = w.filter((q) => q !== R.enum.completeReceive)), w;
1552
+ return a.scope === "approval" && (R = R.filter((q) => q !== O.enum.completeReceive)), R;
1537
1553
  }), P = Dt(a, "show"), K = Z(() => [
1538
1554
  {
1539
- label: p("inventory.transfer.receiveRequest.details.overview"),
1555
+ label: v("inventory.transfer.receiveRequest.details.overview"),
1540
1556
  value: "overview"
1541
1557
  },
1542
1558
  {
1543
- label: p("inventory.transfer.receiveRequest.details.deliveryHistory"),
1559
+ label: v("inventory.transfer.receiveRequest.details.deliveryHistory"),
1544
1560
  value: "deliveryHistory"
1545
1561
  }
1546
1562
  ]), G = M(K.value[0]);
1547
1563
  Ot(
1548
1564
  () => a.show,
1549
- (r) => {
1550
- r && (G.value = K.value[0]);
1565
+ (s) => {
1566
+ s && (G.value = K.value[0]);
1551
1567
  }
1552
1568
  );
1553
- async function ce(r, d, w, q, j) {
1569
+ async function ce(s, f, R, q, j) {
1554
1570
  return new Promise((W, ee) => {
1555
1571
  u.open({
1556
1572
  closeButton: !1,
@@ -1560,47 +1576,47 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1560
1576
  secondaryActions: { text: "No", close: !1 }
1561
1577
  }).onPrimary(async () => {
1562
1578
  var L, Y, Q, F;
1563
- const v = [];
1564
- w === R.enum.approveRequest ? (v.push({
1579
+ const y = [];
1580
+ R === O.enum.approveRequest ? (y.push({
1565
1581
  action: "approveRequest",
1566
1582
  payload: null
1567
- }), d.fulfillment && v.push({
1583
+ }), f.fulfillment && y.push({
1568
1584
  action: "processRequest",
1569
1585
  payload: {
1570
1586
  fulfillmentId: "",
1571
1587
  deliveryOrderNumber: "",
1572
1588
  deliveryRemark: null,
1573
- items: d.fulfillment.items,
1574
- createdBy: y.value
1589
+ items: f.fulfillment.items,
1590
+ createdBy: h.value
1575
1591
  }
1576
- })) : w === R.enum.processRequest ? d.fulfillment && v.push({
1592
+ })) : R === O.enum.processRequest ? f.fulfillment && y.push({
1577
1593
  action: "processRequest",
1578
1594
  payload: {
1579
1595
  fulfillmentId: "",
1580
1596
  deliveryOrderNumber: "",
1581
1597
  deliveryRemark: null,
1582
- items: d.fulfillment.items,
1583
- createdBy: y.value
1598
+ items: f.fulfillment.items,
1599
+ createdBy: h.value
1584
1600
  }
1585
- }) : w === R.enum.rejectRequest ? v.push({
1601
+ }) : R === O.enum.rejectRequest ? y.push({
1586
1602
  action: "rejectRequest",
1587
1603
  payload: null
1588
- }) : w === R.enum.closeRequest && v.push({
1604
+ }) : R === O.enum.closeRequest && y.push({
1589
1605
  action: "closeRequest",
1590
1606
  payload: null
1591
1607
  });
1592
1608
  try {
1593
1609
  await E({
1594
1610
  operate: {
1595
- operation: w,
1596
- doc: r,
1597
- options: d
1611
+ operation: R,
1612
+ doc: s,
1613
+ options: f
1598
1614
  },
1599
1615
  operateV2: {
1600
1616
  _id: ((L = a.purchaseOrder) == null ? void 0 : L._id) ?? "",
1601
1617
  _rev: ((Y = a.purchaseOrder) == null ? void 0 : Y._rev) ?? "",
1602
- action: w,
1603
- payloads: v
1618
+ action: R,
1619
+ payloads: y
1604
1620
  // add payload if action is receiveStock or processRequest
1605
1621
  },
1606
1622
  transferTo: (F = (Q = a.poRequest) == null ? void 0 : Q.to) == null ? void 0 : F.dbName
@@ -1610,35 +1626,35 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1610
1626
  }
1611
1627
  }).onSecondary(() => {
1612
1628
  W("cancelled");
1613
- for (let v = 0; v < j + 2; v++)
1629
+ for (let y = 0; y < j + 2; y++)
1614
1630
  u.close();
1615
1631
  }).onClose(() => {
1616
1632
  });
1617
1633
  });
1618
1634
  }
1619
- async function le(r) {
1620
- var j, W, ee, v;
1621
- if (r === R.enum.receiveStock)
1635
+ async function le(s) {
1636
+ var j, W, ee, y;
1637
+ if (s === O.enum.receiveStock)
1622
1638
  return;
1623
- const d = ut[r];
1624
- if (!d) {
1639
+ const f = ut[s];
1640
+ if (!f) {
1625
1641
  t.open({
1626
1642
  title: "Something went wrong",
1627
- message: `Cannot process order: ${Ke(r)}`,
1643
+ message: `Cannot process order: ${Ke(s)}`,
1628
1644
  type: "error"
1629
1645
  });
1630
1646
  return;
1631
1647
  }
1632
- const { successMessage: w, ...q } = d;
1648
+ const { successMessage: R, ...q } = f;
1633
1649
  if (a.purchaseOrder) {
1634
- s.value = `${r}`, l.value = !0, b.value = !1;
1650
+ r.value = `${s}`, l.value = !0, d.value = !1;
1635
1651
  const L = {};
1636
1652
  let Y = 0;
1637
- if ((r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
1638
- r === R.enum.completeReceive) && c.autoReceiveWarehouse)
1653
+ if ((s === O.enum.confirmDraft || // auto receive for warehouse to warehouse
1654
+ s === O.enum.completeReceive) && c.autoReceiveWarehouse)
1639
1655
  L.autoReceive = !0;
1640
- else if ((r === R.enum.approveRequest || r === R.enum.processRequest) && c.acceptRequireFulfillment) {
1641
- const Q = (W = (j = a.poRequest) == null ? void 0 : j.from) == null ? void 0 : W.dbName, F = (v = (ee = a.poRequest) == null ? void 0 : ee.to) == null ? void 0 : v.dbName;
1656
+ else if ((s === O.enum.approveRequest || s === O.enum.processRequest) && c.acceptRequireFulfillment) {
1657
+ const Q = (W = (j = a.poRequest) == null ? void 0 : j.from) == null ? void 0 : W.dbName, F = (y = (ee = a.poRequest) == null ? void 0 : ee.to) == null ? void 0 : y.dbName;
1642
1658
  if (Q && F && (Q.startsWith("warehouse_") || F.startsWith("warehouse_"))) {
1643
1659
  const te = await new Promise((B, de) => {
1644
1660
  u.open({
@@ -1649,7 +1665,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1649
1665
  purchaseOrder: a.purchaseOrder,
1650
1666
  confirm: B,
1651
1667
  "onUpdate:show": (pe) => {
1652
- pe || (s.value = "", l.value = !1, b.value = !0, Y++, u.close()), de("cancelled");
1668
+ pe || (r.value = "", l.value = !1, d.value = !0, Y++, u.close()), de("cancelled");
1653
1669
  }
1654
1670
  }
1655
1671
  });
@@ -1661,103 +1677,103 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1661
1677
  await ce(
1662
1678
  a.purchaseOrder,
1663
1679
  L,
1664
- r,
1665
- d,
1680
+ s,
1681
+ f,
1666
1682
  Y
1667
1683
  ) === "submitted" && (t.open({
1668
1684
  title: "Success",
1669
- message: w,
1685
+ message: R,
1670
1686
  type: "success"
1671
- }), h("update:show", !1), h("submitted"));
1687
+ }), b("update:show", !1), b("submitted"));
1672
1688
  } catch (Q) {
1673
1689
  t.open({
1674
1690
  title: "Something went wrong",
1675
1691
  message: "Please try again.",
1676
1692
  type: "error"
1677
- }), console.error("Error when submitting PO operation", r, a.purchaseOrder, Q);
1693
+ }), console.error("Error when submitting PO operation", s, a.purchaseOrder, Q);
1678
1694
  } finally {
1679
- s.value = "", l.value = !1, b.value = !0;
1695
+ r.value = "", l.value = !1, d.value = !0;
1680
1696
  }
1681
1697
  }
1682
1698
  }
1683
1699
  const be = Z(() => {
1684
- var r, d;
1685
- return ((r = a.purchaseOrder) == null ? void 0 : r.status) === ie.enum.RECEIVING || ((d = a.purchaseOrder) == null ? void 0 : d.status) === ie.enum.COMPLETE;
1700
+ var s, f;
1701
+ return ((s = a.purchaseOrder) == null ? void 0 : s.status) === ie.enum.RECEIVING || ((f = a.purchaseOrder) == null ? void 0 : f.status) === ie.enum.COMPLETE;
1686
1702
  }), Fe = Z(() => {
1687
- const r = a.purchaseOrder;
1688
- if (!r) return;
1689
- const d = ze(r), { partial: w, over: q } = dt(d);
1690
- return p(`inventory.transfer.status.${ft(r.status, w, q)}`);
1703
+ const s = a.purchaseOrder;
1704
+ if (!s) return;
1705
+ const f = ze(s), { partial: R, over: q } = dt(f);
1706
+ return v(`inventory.transfer.status.${ft(s.status, R, q)}`);
1691
1707
  }), ue = Z(() => {
1692
1708
  var W, ee;
1693
- const r = ((W = a.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], d = ((ee = a.purchaseOrder) == null ? void 0 : ee.deliveryFullfillment) ?? [], w = [
1694
- ...r.map((v) => ({
1695
- createdAt: v.createdAt,
1709
+ const s = ((W = a.purchaseOrder) == null ? void 0 : W.deliveryOrder) ?? [], f = ((ee = a.purchaseOrder) == null ? void 0 : ee.deliveryFullfillment) ?? [], R = [
1710
+ ...s.map((y) => ({
1711
+ createdAt: y.createdAt,
1696
1712
  type: "grn",
1697
- doc: v
1713
+ doc: y
1698
1714
  })),
1699
- ...d.map((v) => ({
1700
- createdAt: v.createdAt,
1715
+ ...f.map((y) => ({
1716
+ createdAt: y.createdAt,
1701
1717
  type: "fulfillment",
1702
- doc: v
1718
+ doc: y
1703
1719
  }))
1704
1720
  ];
1705
- w.reverse().sort((v, L) => v.createdAt.localeCompare(L.createdAt));
1706
- function q(v) {
1721
+ R.reverse().sort((y, L) => y.createdAt.localeCompare(L.createdAt));
1722
+ function q(y) {
1707
1723
  var Q, F, te, B, de, pe, we, Re, V;
1708
- const L = d.findIndex((C) => C.id === v.fullfillmentId), Y = [
1709
- (F = (Q = d[L]) == null ? void 0 : Q.netSuite) != null && F.refNo ? {
1724
+ const L = f.findIndex((C) => C.id === y.fullfillmentId), Y = [
1725
+ (F = (Q = f[L]) == null ? void 0 : Q.netSuite) != null && F.refNo ? {
1710
1726
  label: "Fulfillment's ref no. (Netsuite)",
1711
- values: [(B = (te = d[L]) == null ? void 0 : te.netSuite) == null ? void 0 : B.refNo]
1727
+ values: [(B = (te = f[L]) == null ? void 0 : te.netSuite) == null ? void 0 : B.refNo]
1712
1728
  } : null,
1713
- (de = v == null ? void 0 : v.netSuite) != null && de.refNo ? {
1729
+ (de = y == null ? void 0 : y.netSuite) != null && de.refNo ? {
1714
1730
  label: "Netsuite ref no.",
1715
- values: [(pe = v == null ? void 0 : v.netSuite) == null ? void 0 : pe.refNo]
1731
+ values: [(pe = y == null ? void 0 : y.netSuite) == null ? void 0 : pe.refNo]
1716
1732
  } : null,
1717
- (we = v == null ? void 0 : v.netSuite) != null && we.recordType ? {
1733
+ (we = y == null ? void 0 : y.netSuite) != null && we.recordType ? {
1718
1734
  label: "Netsuite Type",
1719
- values: [ot((Re = v == null ? void 0 : v.netSuite) == null ? void 0 : Re.recordType)]
1735
+ values: [ot((Re = y == null ? void 0 : y.netSuite) == null ? void 0 : Re.recordType)]
1720
1736
  } : null
1721
1737
  ];
1722
1738
  return {
1723
1739
  header: "Received",
1724
- date: Le(new Date(v.createdAt)),
1740
+ date: Le(new Date(y.createdAt)),
1725
1741
  info: [
1726
1742
  {
1727
1743
  label: "Adjustment date",
1728
1744
  values: [
1729
- v.adjustment ? Le(new Date(St(v.adjustment))) : "-"
1745
+ y.adjustment ? Le(new Date(St(y.adjustment))) : "-"
1730
1746
  ]
1731
1747
  },
1732
1748
  {
1733
1749
  label: "Received by",
1734
- values: [(V = v.createdBy) == null ? void 0 : V.name]
1750
+ values: [(V = y.createdBy) == null ? void 0 : V.name]
1735
1751
  },
1736
1752
  {
1737
1753
  label: "Received items",
1738
- values: v.received.map((C) => {
1754
+ values: y.received.map((C) => {
1739
1755
  var X;
1740
- return T("div", [
1741
- T(
1756
+ return $("div", [
1757
+ $(
1742
1758
  "div",
1743
1759
  {
1744
1760
  class: "flex gap-4"
1745
1761
  },
1746
1762
  [
1747
- T(
1763
+ $(
1748
1764
  "div",
1749
1765
  {
1750
1766
  class: "flex flex-col"
1751
1767
  },
1752
1768
  [
1753
- T(
1769
+ $(
1754
1770
  "span",
1755
1771
  {
1756
1772
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
1757
1773
  },
1758
1774
  `${C.sku.name}`
1759
1775
  ),
1760
- T(
1776
+ $(
1761
1777
  "span",
1762
1778
  {
1763
1779
  class: "fm-typo-en-body-md-400"
@@ -1766,26 +1782,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1766
1782
  )
1767
1783
  ]
1768
1784
  ),
1769
- T(
1785
+ $(
1770
1786
  "div",
1771
1787
  {
1772
1788
  class: "ml-auto flex flex-col"
1773
1789
  },
1774
1790
  [
1775
- T(
1791
+ $(
1776
1792
  "div",
1777
1793
  {
1778
1794
  class: "ml-auto flex gap-1"
1779
1795
  },
1780
1796
  [
1781
- T(
1797
+ $(
1782
1798
  "span",
1783
1799
  {
1784
1800
  class: "fm-typo-en-body-lg-600 self-end"
1785
1801
  },
1786
1802
  fe(C.amount, !1)
1787
1803
  ),
1788
- T(
1804
+ $(
1789
1805
  "span",
1790
1806
  {
1791
1807
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
@@ -1794,12 +1810,12 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1794
1810
  )
1795
1811
  ]
1796
1812
  ),
1797
- T(
1813
+ $(
1798
1814
  "div",
1799
1815
  {
1800
1816
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1801
1817
  },
1802
- `${C.cost ? `(${Ne(C.cost)})` : ""}`
1818
+ `${C.cost ? `(${xe(C.cost)})` : ""}`
1803
1819
  )
1804
1820
  ]
1805
1821
  )
@@ -1808,13 +1824,13 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1808
1824
  ]);
1809
1825
  })
1810
1826
  },
1811
- v.deliveryOrderNumber ? {
1827
+ y.deliveryOrderNumber ? {
1812
1828
  label: "Delivery order no.",
1813
- values: [v.deliveryOrderNumber]
1829
+ values: [y.deliveryOrderNumber]
1814
1830
  } : null,
1815
- v.remark ? {
1831
+ y.remark ? {
1816
1832
  label: "Remark",
1817
- values: [v.remark]
1833
+ values: [y.remark]
1818
1834
  } : null,
1819
1835
  L > -1 ? {
1820
1836
  label: "Fulfilment's sequence",
@@ -1824,12 +1840,12 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1824
1840
  ].filter((C) => C)
1825
1841
  };
1826
1842
  }
1827
- function j(v) {
1843
+ function j(y) {
1828
1844
  var Y, Q;
1829
- const L = d.findIndex((F) => F.id === v.id);
1845
+ const L = f.findIndex((F) => F.id === y.id);
1830
1846
  return {
1831
1847
  header: "Fulfillment",
1832
- date: Le(new Date(v.createdAt)),
1848
+ date: Le(new Date(y.createdAt)),
1833
1849
  info: [
1834
1850
  {
1835
1851
  label: "Sequence",
@@ -1837,29 +1853,29 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1837
1853
  },
1838
1854
  {
1839
1855
  label: "Receiveable items",
1840
- values: v.items.map((F) => {
1856
+ values: y.items.map((F) => {
1841
1857
  var te;
1842
- return T("div", [
1843
- T(
1858
+ return $("div", [
1859
+ $(
1844
1860
  "div",
1845
1861
  {
1846
1862
  class: "flex gap-4"
1847
1863
  },
1848
1864
  [
1849
- T(
1865
+ $(
1850
1866
  "div",
1851
1867
  {
1852
1868
  class: "flex flex-col"
1853
1869
  },
1854
1870
  [
1855
- T(
1871
+ $(
1856
1872
  "span",
1857
1873
  {
1858
1874
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
1859
1875
  },
1860
1876
  `${F.sku.name}`
1861
1877
  ),
1862
- T(
1878
+ $(
1863
1879
  "span",
1864
1880
  {
1865
1881
  class: "fm-typo-en-body-md-400"
@@ -1868,26 +1884,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1868
1884
  )
1869
1885
  ]
1870
1886
  ),
1871
- T(
1887
+ $(
1872
1888
  "div",
1873
1889
  {
1874
1890
  class: "ml-auto flex flex-col"
1875
1891
  },
1876
1892
  [
1877
- T(
1893
+ $(
1878
1894
  "div",
1879
1895
  {
1880
1896
  class: "ml-auto flex gap-1"
1881
1897
  },
1882
1898
  [
1883
- T(
1899
+ $(
1884
1900
  "span",
1885
1901
  {
1886
1902
  class: "fm-typo-en-body-lg-600 self-end"
1887
1903
  },
1888
1904
  fe(F.amount, !1)
1889
1905
  ),
1890
- T(
1906
+ $(
1891
1907
  "span",
1892
1908
  {
1893
1909
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
@@ -1896,12 +1912,12 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1896
1912
  )
1897
1913
  ]
1898
1914
  ),
1899
- T(
1915
+ $(
1900
1916
  "div",
1901
1917
  {
1902
1918
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1903
1919
  },
1904
- `${F.cost ? `(${Ne(F.cost)})` : ""}`
1920
+ `${F.cost ? `(${xe(F.cost)})` : ""}`
1905
1921
  )
1906
1922
  ]
1907
1923
  )
@@ -1910,50 +1926,50 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1910
1926
  ]);
1911
1927
  })
1912
1928
  },
1913
- (Y = v.netSuite) != null && Y.refNo ? {
1929
+ (Y = y.netSuite) != null && Y.refNo ? {
1914
1930
  label: "Ref no. (Netsuite)",
1915
- values: [(Q = v.netSuite) == null ? void 0 : Q.refNo]
1931
+ values: [(Q = y.netSuite) == null ? void 0 : Q.refNo]
1916
1932
  } : null
1917
1933
  ].filter((F) => F)
1918
1934
  };
1919
1935
  }
1920
- return w.map((v) => {
1921
- switch (v.type) {
1936
+ return R.map((y) => {
1937
+ switch (y.type) {
1922
1938
  case "grn":
1923
- return q(v.doc);
1939
+ return q(y.doc);
1924
1940
  case "fulfillment":
1925
- return j(v.doc);
1941
+ return j(y.doc);
1926
1942
  }
1927
1943
  });
1928
1944
  }), k = Z(() => {
1929
- var d;
1930
- const r = {
1945
+ var f;
1946
+ const s = {
1931
1947
  ...nt(0),
1932
1948
  currency: Je()
1933
1949
  };
1934
- return ((d = a.purchaseOrder) == null ? void 0 : d.items.reduce((w, q) => ({
1935
- ...st(w, q.totalCost ?? r),
1950
+ return ((f = a.purchaseOrder) == null ? void 0 : f.items.reduce((R, q) => ({
1951
+ ...st(R, q.totalCost ?? s),
1936
1952
  currency: Je()
1937
- }), r)) ?? r;
1953
+ }), s)) ?? s;
1938
1954
  });
1939
- function A(r) {
1955
+ function T(s) {
1940
1956
  var W;
1941
- const w = (((W = a.purchaseOrder) == null ? void 0 : W.version) ?? ke.enum[1]) === ke.enum[2] ? r.id : r.sku._id, q = a.receivedMap[w];
1942
- return `<span class="${H(r)} fm-typo-en-body-lg-600">${wt.toFormatString({ value: q.received })}</span>/${$t(r.quantity, r.sku.unit, r.measurement)}`;
1957
+ const R = (((W = a.purchaseOrder) == null ? void 0 : W.version) ?? ke.enum[1]) === ke.enum[2] ? s.id : s.sku._id, q = a.receivedMap[R];
1958
+ return `<span class="${H(s)} fm-typo-en-body-lg-600">${wt.toFormatString({ value: q.received })}</span>/${At(s.quantity, s.sku.unit, s.measurement)}`;
1943
1959
  }
1944
- function H(r) {
1960
+ function H(s) {
1945
1961
  var L;
1946
- const w = (((L = a.purchaseOrder) == null ? void 0 : L.version) ?? ke.enum[1]) === ke.enum[2] ? r.id : r.sku._id, q = a.receivedMap[w], { isPartialReceive: j, isNoReceive: W, isOverReceive: ee, isFullReceive: v } = Lt(q);
1947
- return W ? "text-fm-color-typo-tertiary" : j ? "text-fm-color-system-warning-300" : ee ? "text-fm-color-system-error-300" : v ? "text-fm-color-system-success-300" : "";
1962
+ const R = (((L = a.purchaseOrder) == null ? void 0 : L.version) ?? ke.enum[1]) === ke.enum[2] ? s.id : s.sku._id, q = a.receivedMap[R], { isPartialReceive: j, isNoReceive: W, isOverReceive: ee, isFullReceive: y } = Lt(q);
1963
+ return W ? "text-fm-color-typo-tertiary" : j ? "text-fm-color-system-warning-300" : ee ? "text-fm-color-system-error-300" : y ? "text-fm-color-system-success-300" : "";
1948
1964
  }
1949
- return (r, d) => {
1965
+ return (s, f) => {
1950
1966
  var F, te;
1951
- const w = z("FmButtonGroup"), q = z("FmChip"), j = z("FmMenuDivider"), W = z("FmCard"), ee = z("FmIcon"), v = z("FmTooltip"), L = z("FmSpacer"), Y = z("FmButton"), Q = z("FmSideSheet");
1967
+ const R = z("FmButtonGroup"), q = z("FmChip"), j = z("FmMenuDivider"), W = z("FmCard"), ee = z("FmIcon"), y = z("FmTooltip"), L = z("FmSpacer"), Y = z("FmButton"), Q = z("FmSideSheet");
1952
1968
  return g(), oe(Q, {
1953
- header: S(p)("inventory.transfer.receiveRequest.details.title") + ((F = r.purchaseOrder) != null && F.seqNumber ? ` #${(te = r.purchaseOrder) == null ? void 0 : te.seqNumber}` : ""),
1969
+ header: S(v)("inventory.transfer.receiveRequest.details.title") + ((F = s.purchaseOrder) != null && F.seqNumber ? ` #${(te = s.purchaseOrder) == null ? void 0 : te.seqNumber}` : ""),
1954
1970
  modelValue: S(P),
1955
- "onUpdate:modelValue": d[5] || (d[5] = (B) => xt(P) ? P.value = B : null),
1956
- "dismiss-away": b.value,
1971
+ "onUpdate:modelValue": f[5] || (f[5] = (B) => Nt(P) ? P.value = B : null),
1972
+ "dismiss-away": d.value,
1957
1973
  "close-button": "",
1958
1974
  "max-width": 600
1959
1975
  }, {
@@ -1962,64 +1978,64 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
1962
1978
  return [
1963
1979
  o("div", kr, [
1964
1980
  o("div", null, [
1965
- I(w, {
1981
+ I(R, {
1966
1982
  items: K.value,
1967
1983
  modelValue: G.value,
1968
- "onUpdate:modelValue": d[0] || (d[0] = (V) => G.value = V)
1984
+ "onUpdate:modelValue": f[0] || (f[0] = (V) => G.value = V)
1969
1985
  }, null, 8, ["items", "modelValue"])
1970
1986
  ]),
1971
- G.value.value === "overview" ? (g(), x(se, { key: 0 }, [
1987
+ G.value.value === "overview" ? (g(), N(se, { key: 0 }, [
1972
1988
  o("div", null, [
1973
1989
  I(W, {
1974
1990
  variant: "outlined",
1975
1991
  class: "flex flex-col gap-8 px-12 py-16"
1976
1992
  }, {
1977
1993
  default: ae(() => {
1978
- var V, C, X, ge, _e, xe, He, Ge, We, Ye, Qe;
1994
+ var V, C, X, ge, _e, Ne, He, Ge, We, Ye, Qe;
1979
1995
  return [
1980
1996
  o("div", Dr, [
1981
- o("div", qr, D(S(p)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1997
+ o("div", qr, D(S(v)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1982
1998
  o("div", null, [
1983
1999
  I(q, {
1984
2000
  label: Fe.value,
1985
- class: De(`fm-status-badge fm-status-badge-${(C = (V = r.purchaseOrder) == null ? void 0 : V.status) == null ? void 0 : C.toLocaleLowerCase("en-us")}`),
2001
+ class: De(`fm-status-badge fm-status-badge-${(C = (V = s.purchaseOrder) == null ? void 0 : V.status) == null ? void 0 : C.toLocaleLowerCase("en-us")}`),
1986
2002
  compact: ""
1987
2003
  }, null, 8, ["label", "class"])
1988
2004
  ])
1989
2005
  ]),
1990
2006
  I(j),
1991
- o("div", Tr, [
1992
- o("div", $r, [
1993
- o("div", Ar, [
1994
- o("div", Pr, D(S(p)("inventory.transfer.receiveRequest.details.createdAt")), 1)
2007
+ o("div", $r, [
2008
+ o("div", Ar, [
2009
+ o("div", Tr, [
2010
+ o("div", Pr, D(S(v)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1995
2011
  ]),
1996
- o("div", Cr, D(S(qe)(((X = r.purchaseOrder) == null ? void 0 : X._id) ?? "")), 1)
2012
+ o("div", Cr, D(S(qe)(((X = s.purchaseOrder) == null ? void 0 : X._id) ?? "")), 1)
1997
2013
  ]),
1998
- (ge = r.purchaseOrder) != null && ge.effectiveAt ? (g(), x("div", Ir, [
1999
- o("div", Fr, D(S(p)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
2000
- o("div", Er, D(S(at)(new Date((_e = r.purchaseOrder) == null ? void 0 : _e.effectiveAt))), 1)
2014
+ (ge = s.purchaseOrder) != null && ge.effectiveAt ? (g(), N("div", Ir, [
2015
+ o("div", Fr, D(S(v)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
2016
+ o("div", Er, D(S(at)(new Date((_e = s.purchaseOrder) == null ? void 0 : _e.effectiveAt))), 1)
2001
2017
  ])) : U("", !0),
2002
2018
  o("div", Lr, [
2003
- o("div", Br, D(S(p)("inventory.transfer.receiveRequest.details.type.title")), 1),
2004
- o("div", Vr, D(S(p)(
2005
- `inventory.transfer.receiveRequest.details.type.${f.value.toLocaleLowerCase("en-US")}`
2019
+ o("div", Br, D(S(v)("inventory.transfer.receiveRequest.details.type.title")), 1),
2020
+ o("div", Vr, D(S(v)(
2021
+ `inventory.transfer.receiveRequest.details.type.${m.value.toLocaleLowerCase("en-US")}`
2006
2022
  )), 1)
2007
2023
  ]),
2008
- (He = (xe = r.purchaseOrder) == null ? void 0 : xe.supplier) != null && He.name ? (g(), x("div", Ur, [
2009
- o("div", Mr, D(S(p)("inventory.transfer.receiveRequest.details.from")), 1),
2010
- o("div", Kr, D((We = (Ge = r.purchaseOrder) == null ? void 0 : Ge.supplier) == null ? void 0 : We.name), 1)
2024
+ (He = (Ne = s.purchaseOrder) == null ? void 0 : Ne.supplier) != null && He.name ? (g(), N("div", Ur, [
2025
+ o("div", Mr, D(S(v)("inventory.transfer.receiveRequest.details.from")), 1),
2026
+ o("div", Kr, D((We = (Ge = s.purchaseOrder) == null ? void 0 : Ge.supplier) == null ? void 0 : We.name), 1)
2011
2027
  ])) : U("", !0),
2012
- r.transferTo ? (g(), x("div", jr, [
2013
- o("div", zr, D(S(p)("inventory.transfer.receiveRequest.details.to")), 1),
2014
- o("div", Hr, D(r.transferTo), 1)
2028
+ s.transferTo ? (g(), N("div", jr, [
2029
+ o("div", zr, D(S(v)("inventory.transfer.receiveRequest.details.to")), 1),
2030
+ o("div", Hr, D(s.transferTo), 1)
2015
2031
  ])) : U("", !0),
2016
- (Ye = r.purchaseOrder) != null && Ye.ref ? (g(), x("div", Gr, [
2017
- o("div", Wr, D(S(p)("inventory.transfer.receiveRequest.details.reference")), 1),
2018
- o("div", Yr, D(r.purchaseOrder.ref), 1)
2032
+ (Ye = s.purchaseOrder) != null && Ye.ref ? (g(), N("div", Gr, [
2033
+ o("div", Wr, D(S(v)("inventory.transfer.receiveRequest.details.reference")), 1),
2034
+ o("div", Yr, D(s.purchaseOrder.ref), 1)
2019
2035
  ])) : U("", !0),
2020
- (Qe = r.purchaseOrder) != null && Qe.remark ? (g(), x("div", Qr, [
2021
- o("div", Xr, D(S(p)("inventory.transfer.receiveRequest.details.remark")), 1),
2022
- o("div", Zr, D(r.purchaseOrder.remark), 1)
2036
+ (Qe = s.purchaseOrder) != null && Qe.remark ? (g(), N("div", Qr, [
2037
+ o("div", Xr, D(S(v)("inventory.transfer.receiveRequest.details.remark")), 1),
2038
+ o("div", Zr, D(s.purchaseOrder.remark), 1)
2023
2039
  ])) : U("", !0)
2024
2040
  ])
2025
2041
  ];
@@ -2027,19 +2043,19 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2027
2043
  _: 1
2028
2044
  })
2029
2045
  ]),
2030
- I(Nr, {
2031
- "po-request": r.poRequest,
2032
- purchaseOrder: r.purchaseOrder,
2033
- transferType: f.value,
2034
- transferToDbName: r.transferToDbName,
2035
- scope: r.scope
2046
+ I(xr, {
2047
+ "po-request": s.poRequest,
2048
+ purchaseOrder: s.purchaseOrder,
2049
+ transferType: m.value,
2050
+ transferToDbName: s.transferToDbName,
2051
+ scope: s.scope
2036
2052
  }, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
2037
2053
  o("div", Jr, [
2038
2054
  o("div", es, [
2039
2055
  o("div", ts, [
2040
2056
  o("span", rs, [
2041
- Be(D(be.value ? S(p)("inventory.transfer.receiveRequest.details.receivedItems") : S(p)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2042
- (de = (B = r.purchaseOrder) == null ? void 0 : B.netSuite) != null && de.missingItems && ((we = (pe = r.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : we.missingItems.length) > 0 ? (g(), oe(v, {
2057
+ Be(D(be.value ? S(v)("inventory.transfer.receiveRequest.details.receivedItems") : S(v)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2058
+ (de = (B = s.purchaseOrder) == null ? void 0 : B.netSuite) != null && de.missingItems && ((we = (pe = s.purchaseOrder) == null ? void 0 : pe.netSuite) == null ? void 0 : we.missingItems.length) > 0 ? (g(), oe(y, {
2043
2059
  key: 0,
2044
2060
  variant: "rich",
2045
2061
  placement: "top",
@@ -2049,7 +2065,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2049
2065
  var V, C;
2050
2066
  return [
2051
2067
  o("div", ss, [
2052
- (g(!0), x(se, null, ve((C = (V = r.purchaseOrder) == null ? void 0 : V.netSuite) == null ? void 0 : C.missingItems, (X, ge) => (g(), x("div", {
2068
+ (g(!0), N(se, null, ve((C = (V = s.purchaseOrder) == null ? void 0 : V.netSuite) == null ? void 0 : C.missingItems, (X, ge) => (g(), N("div", {
2053
2069
  class: "flex justify-center align-middle",
2054
2070
  key: ge
2055
2071
  }, [
@@ -2074,9 +2090,9 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2074
2090
  ])
2075
2091
  ]),
2076
2092
  I(j),
2077
- (g(!0), x(se, null, ve(((Re = r.purchaseOrder) == null ? void 0 : Re.items) ?? [], (V) => {
2093
+ (g(!0), N(se, null, ve(((Re = s.purchaseOrder) == null ? void 0 : Re.items) ?? [], (V) => {
2078
2094
  var C;
2079
- return g(), x("div", {
2095
+ return g(), N("div", {
2080
2096
  key: V.code,
2081
2097
  class: "flex flex-col"
2082
2098
  }, [
@@ -2084,30 +2100,30 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2084
2100
  o("div", as, D(V.name), 1),
2085
2101
  o("div", os, [
2086
2102
  o("span", {
2087
- innerHTML: A(V)
2103
+ innerHTML: T(V)
2088
2104
  }, null, 8, is)
2089
2105
  ])
2090
2106
  ]),
2091
2107
  o("div", ls, [
2092
2108
  o("div", cs, D(V.code), 1),
2093
- (C = V.totalCost) != null && C.amount && S(c).enableTotalCost ? (g(), x("div", us, " (" + D(S(Ne)(V.totalCost)) + ") ", 1)) : U("", !0)
2109
+ (C = V.totalCost) != null && C.amount && S(c).enableTotalCost ? (g(), N("div", us, " (" + D(S(xe)(V.totalCost)) + ") ", 1)) : U("", !0)
2094
2110
  ])
2095
2111
  ]);
2096
2112
  }), 128)),
2097
- +S(fe)(k.value) ? (g(), x(se, { key: 0 }, [
2113
+ +S(fe)(k.value) ? (g(), N(se, { key: 0 }, [
2098
2114
  o("div", ds, [
2099
2115
  I(j)
2100
2116
  ]),
2101
2117
  o("div", fs, [
2102
- d[6] || (d[6] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2103
- o("div", ms, D(S(Ne)(k.value)), 1)
2118
+ f[6] || (f[6] = o("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
2119
+ o("div", ms, D(S(xe)(k.value)), 1)
2104
2120
  ])
2105
2121
  ], 64)) : U("", !0)
2106
2122
  ])
2107
2123
  ])
2108
- ], 64)) : G.value.value === "deliveryHistory" ? (g(), x("div", ps, [
2109
- ue.value.length ? (g(), x("div", gs, [
2110
- (g(!0), x(se, null, ve(ue.value, (V, C) => (g(), x(se, { key: C }, [
2124
+ ], 64)) : G.value.value === "deliveryHistory" ? (g(), N("div", ps, [
2125
+ ue.value.length ? (g(), N("div", gs, [
2126
+ (g(!0), N(se, null, ve(ue.value, (V, C) => (g(), N(se, { key: C }, [
2111
2127
  o("div", _s, [
2112
2128
  o("div", Ss, [
2113
2129
  o("div", ws, [
@@ -2121,7 +2137,7 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2121
2137
  ])
2122
2138
  }, null, 2)
2123
2139
  ]),
2124
- d[7] || (d[7] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2140
+ f[7] || (f[7] = o("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2125
2141
  o("div", Rs, [
2126
2142
  o("div", {
2127
2143
  class: De([
@@ -2135,8 +2151,8 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2135
2151
  ])
2136
2152
  ]),
2137
2153
  o("div", Os, [
2138
- o("div", xs, D(V.header), 1),
2139
- o("div", Ns, D(V.date), 1)
2154
+ o("div", Ns, D(V.header), 1),
2155
+ o("div", xs, D(V.date), 1)
2140
2156
  ])
2141
2157
  ]),
2142
2158
  o("div", ks, [
@@ -2153,26 +2169,26 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2153
2169
  }, null, 2)
2154
2170
  ])
2155
2171
  ]),
2156
- o("div", Ts, [
2172
+ o("div", $s, [
2157
2173
  I(W, {
2158
2174
  variant: "outlined",
2159
2175
  class: "py-12 px-16"
2160
2176
  }, {
2161
2177
  default: ae(() => [
2162
- o("div", $s, [
2163
- (g(!0), x(se, null, ve(V.info, (X, ge) => (g(), x("div", {
2178
+ o("div", As, [
2179
+ (g(!0), N(se, null, ve(V.info, (X, ge) => (g(), N("div", {
2164
2180
  key: ge,
2165
2181
  class: "flex flex-col gap-4"
2166
2182
  }, [
2167
- o("div", As, D(X == null ? void 0 : X.label), 1),
2183
+ o("div", Ts, D(X == null ? void 0 : X.label), 1),
2168
2184
  o("div", Ps, [
2169
- (g(!0), x(se, null, ve(X == null ? void 0 : X.values, (_e, xe) => (g(), x("div", {
2170
- key: xe,
2185
+ (g(!0), N(se, null, ve(X == null ? void 0 : X.values, (_e, Ne) => (g(), N("div", {
2186
+ key: Ne,
2171
2187
  class: "fm-typo-en-body-lg-600"
2172
2188
  }, [
2173
- typeof _e == "string" ? (g(), x(se, { key: 0 }, [
2189
+ typeof _e == "string" ? (g(), N(se, { key: 0 }, [
2174
2190
  Be(D(_e), 1)
2175
- ], 64)) : (g(), oe(Nt(_e), { key: 1 }))
2191
+ ], 64)) : (g(), oe(xt(_e), { key: 1 }))
2176
2192
  ]))), 128))
2177
2193
  ])
2178
2194
  ]))), 128))
@@ -2183,16 +2199,16 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2183
2199
  ])
2184
2200
  ])
2185
2201
  ], 64))), 128))
2186
- ])) : (g(), x("div", vs, [
2202
+ ])) : (g(), N("div", vs, [
2187
2203
  I(L),
2188
2204
  o("div", null, [
2189
2205
  o("img", {
2190
- src: S(At),
2206
+ src: S(Tt),
2191
2207
  alt: "List is empty"
2192
2208
  }, null, 8, ys)
2193
2209
  ]),
2194
- o("div", hs, D(S(p)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2195
- o("div", bs, D(S(p)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2210
+ o("div", hs, D(S(v)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
2211
+ o("div", bs, D(S(v)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
2196
2212
  I(L),
2197
2213
  I(L)
2198
2214
  ]))
@@ -2202,41 +2218,41 @@ const Ht = { class: "flex flex-row-reverse" }, Gt = /* @__PURE__ */ he({
2202
2218
  }),
2203
2219
  "side-sheet-footer": ae(() => [
2204
2220
  o("div", Cs, [
2205
- (g(!0), x(se, null, ve($.value, (B) => (g(), x(se, null, [
2221
+ (g(!0), N(se, null, ve(A.value, (B) => (g(), N(se, null, [
2206
2222
  S(Ue)[B].available != !1 ? (g(), oe(Y, {
2207
2223
  key: B,
2208
- label: S(p)(S(Ue)[B].translationKey),
2224
+ label: S(v)(S(Ue)[B].translationKey),
2209
2225
  onClick: (de) => le(B),
2210
- loading: s.value === B,
2211
- disabled: s.value !== B && l.value,
2226
+ loading: r.value === B,
2227
+ disabled: r.value !== B && l.value,
2212
2228
  variant: S(Ue)[B].buttonVariant
2213
2229
  }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : U("", !0)
2214
2230
  ], 64))), 256)),
2215
- S(_).ableToMarkReceived(r.purchaseOrder) && !$.value.includes("completeReceive") ? (g(), oe(Y, {
2231
+ S(_).ableToMarkReceived(s.purchaseOrder) && !A.value.includes("completeReceive") ? (g(), oe(Y, {
2216
2232
  key: 0,
2217
- label: S(p)("inventory.transfer.receiveRequest.actions.completeReceive"),
2218
- onClick: d[1] || (d[1] = (B) => le("completeReceive")),
2219
- loading: s.value === "completeReceive",
2220
- disabled: s.value !== "completeReceive" && l.value
2233
+ label: S(v)("inventory.transfer.receiveRequest.actions.completeReceive"),
2234
+ onClick: f[1] || (f[1] = (B) => le("completeReceive")),
2235
+ loading: r.value === "completeReceive",
2236
+ disabled: r.value !== "completeReceive" && l.value
2221
2237
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
2222
- S(_).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !$.value.includes("approveRequest") ? (g(), oe(Y, {
2238
+ S(_).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !A.value.includes("approveRequest") ? (g(), oe(Y, {
2223
2239
  key: 1,
2224
- label: S(p)("inventory.transfer.approval.actions.approveRequest"),
2225
- onClick: d[2] || (d[2] = (B) => le("approveRequest")),
2226
- loading: s.value === "approveRequest",
2227
- disabled: s.value !== "approveRequest" && l.value
2240
+ label: S(v)("inventory.transfer.approval.actions.approveRequest"),
2241
+ onClick: f[2] || (f[2] = (B) => le("approveRequest")),
2242
+ loading: r.value === "approveRequest",
2243
+ disabled: r.value !== "approveRequest" && l.value
2228
2244
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
2229
- S(_).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && a.scope === "approval" ? (g(), oe(Y, {
2245
+ S(_).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && a.scope === "approval" ? (g(), oe(Y, {
2230
2246
  key: 2,
2231
- label: S(p)("inventory.transfer.receiveRequest.actions.processRequest"),
2232
- onClick: d[3] || (d[3] = (B) => le("processRequest")),
2233
- loading: s.value === "processRequest",
2234
- disabled: s.value !== "processRequest" && l.value
2247
+ label: S(v)("inventory.transfer.receiveRequest.actions.processRequest"),
2248
+ onClick: f[3] || (f[3] = (B) => le("processRequest")),
2249
+ loading: r.value === "processRequest",
2250
+ disabled: r.value !== "processRequest" && l.value
2235
2251
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
2236
2252
  I(Y, {
2237
- label: S(p)("common.close"),
2253
+ label: S(v)("common.close"),
2238
2254
  variant: "tertiary",
2239
- onClick: d[4] || (d[4] = (B) => h("update:show", !1))
2255
+ onClick: f[4] || (f[4] = (B) => b("update:show", !1))
2240
2256
  }, null, 8, ["label"])
2241
2257
  ])
2242
2258
  ]),