@feedmepos/mf-inventory-portal 0.0.25-dev.31 → 0.0.25-dev.33

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 (45) hide show
  1. package/dist/{App-9X9XkRz2.js → App-BHIdSSIe.js} +2 -2
  2. package/dist/{ApprovalView-CoIwMOje.js → ApprovalView-BHsPq9fp.js} +2 -2
  3. package/dist/{BindingsDialog-B3ul7-vn.js → BindingsDialog-CcA_m9fC.js} +2 -2
  4. package/dist/{BindingsPicker-CWMHp2sY.js → BindingsPicker-UttPVr0V.js} +1 -1
  5. package/dist/{BindingsTable-BqST2NOr.js → BindingsTable-CQKt-n8j.js} +1 -1
  6. package/dist/{ClosingDraftView-CeN0MagA.js → ClosingDraftView-tYyeEBsI.js} +2 -2
  7. package/dist/{ClosingTemplateView-BmTacXGq.js → ClosingTemplateView-CjFaTKSv.js} +2 -2
  8. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CigELrfY.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B544ZjAk.js} +3 -3
  9. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-Bp2oPPMX.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6LxuLjN.js} +1 -1
  10. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CbTEp_-D.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-hU74c6gB.js} +1 -1
  11. package/dist/{IngredientGroupView-DPpznEXs.js → IngredientGroupView-CjMBtQnL.js} +1 -1
  12. package/dist/{IngredientsView-D2RCvzFX.js → IngredientsView-Dr6lDeAa.js} +4 -4
  13. package/dist/{IntegrationView-Qxv2pvF6.js → IntegrationView-ltFLmByt.js} +1 -1
  14. package/dist/{InventoryBindingForm-Do7ElpgS.js → InventoryBindingForm-BVtDX2SX.js} +1 -1
  15. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-veh3riBN.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CUykd8am.js} +3 -3
  16. package/dist/{InventoryBindingSummary-By58hpzm.js → InventoryBindingSummary-CvzXOSPU.js} +1 -1
  17. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Dx3lo70J.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DNs_wg0e.js} +1 -1
  18. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-E3HiIawC.js → PremiumBadge.vue_vue_type_script_setup_true_lang-BCwv6pd5.js} +1 -1
  19. package/dist/{PublishView-C7Sk1xx_.js → PublishView-Cq_ylGgc.js} +2 -2
  20. package/dist/{PurchaseOrderPrintPreview-Dm6VK50g.js → PurchaseOrderPrintPreview-CYCmhU-e.js} +1 -1
  21. package/dist/{ReceiveRequestView-OjIHRXR0.js → ReceiveRequestView-LnqepR2e.js} +9 -9
  22. package/dist/{RecipeView-DvUxMPcE.js → RecipeView-CMs6Qt9A.js} +3 -3
  23. package/dist/{StockView-BmWtH5o7.js → StockView-e-PcQAKr.js} +7 -7
  24. package/dist/{SupplierView-CSRJiF0L.js → SupplierView-CeXmu4st.js} +4 -4
  25. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BQ1zIGI5.js → TransferDetails.vue_vue_type_script_setup_true_lang-DW_wzTB0.js} +658 -646
  26. package/dist/{TransferTemplateView-DVZ-l-Qd.js → TransferTemplateView-_jXDAlSR.js} +7 -7
  27. package/dist/{UnitView-KxXsoPf-.js → UnitView-CYqpDvJJ.js} +3 -3
  28. package/dist/{WarehouseView-pP_XFBL6.js → WarehouseView-Ce8XkGoe.js} +1 -1
  29. package/dist/api/purchase-order.d.ts +4 -1
  30. package/dist/{app-qP-te2rC.js → app-mT4U5kNO.js} +3019 -2994
  31. package/dist/app.js +1 -1
  32. package/dist/{decimal-CNwkFnUQ.js → decimal-B7ZVTj3Q.js} +1 -1
  33. package/dist/{feature-D4R2fV5-.js → feature-BdqR6_vW.js} +1 -1
  34. package/dist/{format-unit-display-BmyzOzt2.js → format-unit-display-DgTlT1cC.js} +2 -2
  35. package/dist/{index-B6w232vo.js → index-BO9UatRG.js} +2 -2
  36. package/dist/{stock-XRT7HXo1.js → stock-CtxeFyYM.js} +1 -1
  37. package/dist/{supplier-BcKjL7Tk.js → supplier-Bz2bTujX.js} +1 -1
  38. package/dist/tsconfig.app.tsbuildinfo +1 -1
  39. package/dist/{use-ingredient-select-dialog-BjX2siCb.js → use-ingredient-select-dialog-q3WmGGOm.js} +1 -1
  40. package/dist/{use-inventory-binding-dialog-BypYql87.js → use-inventory-binding-dialog-D246fGyU.js} +1 -1
  41. package/dist/views/receive-request/components/transfer-details/TransferDetails.vue.d.ts +178 -0
  42. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +730 -11
  43. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +556 -21
  44. package/dist/{vue-i18n-BRVI-fYl.js → vue-i18n-iWMdXkLq.js} +321 -321
  45. package/package.json +3 -3
@@ -1,54 +1,54 @@
1
- import { W as it, u as Pe, aL as k, a5 as ct, a7 as ut, a8 as dt, am as ft, d as Be, e as tt, av as M, T as st, aM as mt, Y as Ke, K as $e, i as Re, aN as rt, ac as Ee, f as Je, D as Z, h as Q, b as ze, a6 as pt, as as Ze, a0 as Te, ai as Me, aw as vt } from "./app-qP-te2rC.js";
2
- import { ref as V, computed as X, h as N, defineComponent as Qe, onMounted as yt, unref as o, openBlock as l, createElementBlock as _, createElementVNode as e, toDisplayString as m, createCommentVNode as D, resolveComponent as ie, createVNode as B, watch as ht, createBlock as ee, isRef as gt, withCtx as be, Fragment as te, normalizeClass as he, createTextVNode as je, renderList as _e, resolveDynamicComponent as bt } from "vue";
1
+ import { W as it, u as Pe, aL as R, a5 as ct, a7 as ut, a8 as dt, am as ft, d as Be, e as tt, av as j, T as st, aM as mt, Y as Ke, K as qe, i as Oe, aN as rt, ac as Ee, f as Je, D as te, h as Q, b as ze, a6 as pt, as as Ze, a0 as $e, ai as Me, aw as vt } from "./app-mT4U5kNO.js";
2
+ import { ref as K, computed as X, h as N, defineComponent as Qe, onMounted as yt, unref as n, openBlock as c, createElementBlock as _, createElementVNode as e, toDisplayString as m, createCommentVNode as D, resolveComponent as ce, createVNode as B, watch as ht, createBlock as se, isRef as gt, withCtx as _e, Fragment as re, normalizeClass as ge, createTextVNode as je, renderList as Se, resolveDynamicComponent as bt } from "vue";
3
3
  import { useI18n as at } from "@feedmepos/mf-common";
4
- import { b as _t, u as St, f as Ge, P as ge } from "./format-unit-display-BmyzOzt2.js";
4
+ import { b as _t, u as St, f as Ge, P as be } from "./format-unit-display-DgTlT1cC.js";
5
5
  import { E as et } from "./empty-placeholder-wf6-BWE8.js";
6
6
  import { useDialog as Ye, useSnackbar as We, useProxiedModel as wt } from "@feedmepos/ui-library";
7
- import { u as nt } from "./feature-D4R2fV5-.js";
8
- import { F as xt } from "./decimal-CNwkFnUQ.js";
7
+ import { u as nt } from "./feature-BdqR6_vW.js";
8
+ import { F as xt } from "./decimal-B7ZVTj3Q.js";
9
9
  const Xe = it((p, v) => {
10
- const f = Pe();
10
+ const a = Pe();
11
11
  return {
12
- async readRequests(n) {
13
- const S = n ?? f.currentLocationDBName, O = `${p.inventoryBackendUrl}/${S}/purchase-request`;
14
- return await v.get(O);
12
+ async readRequests(i) {
13
+ const w = i ?? a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-request`;
14
+ return await v.get(x);
15
15
  },
16
16
  async getPurchaseOrders({
17
- start: n,
18
- end: S
17
+ start: i,
18
+ end: w
19
19
  }) {
20
- const O = f.currentLocationDBName, $ = `${p.inventoryBackendUrl}/${O}/purchase-order`;
21
- return await v.get(`${$}?start=${n}&end=${S}`);
20
+ const x = a.currentLocationDBName, L = `${p.inventoryBackendUrl}/${x}/purchase-order`;
21
+ return await v.get(`${L}?start=${i}&end=${w}`);
22
22
  },
23
- async getLatestPurchaseOrderRequest(n, S) {
24
- S ?? (S = f.currentLocationDBName);
25
- const O = `${p.inventoryBackendUrl}/${S}/purchase-request/find-by-purchase-order-id`;
26
- return await v.get(`${O}/${n}`);
23
+ async getLatestPurchaseOrderRequest(i, w) {
24
+ w ?? (w = a.currentLocationDBName);
25
+ const x = `${p.inventoryBackendUrl}/${w}/purchase-request/find-by-purchase-order-id`;
26
+ return await v.get(`${x}/${i}`);
27
27
  },
28
- async getPurchaseOrderById(n, S) {
29
- S ?? (S = f.currentLocationDBName);
30
- const O = `${p.inventoryBackendUrl}/${S}/purchase-order`;
31
- return await v.get(`${O}/${n}`);
28
+ async getPurchaseOrderById(i, w) {
29
+ w ?? (w = a.currentLocationDBName);
30
+ const x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
31
+ return await v.get(`${x}/${i}`);
32
32
  },
33
- async processPurchaseOrder(n, S) {
34
- const O = f.currentLocationDBName, $ = S || O, C = `${p.inventoryBackendUrl}/${$}/purchase-order/run-operation`;
35
- return await v.put(C, n);
33
+ async processPurchaseOrder(i, w) {
34
+ const x = a.currentLocationDBName, L = w || x, q = `${p.inventoryBackendUrl}/${L}/purchase-order/run-operation`;
35
+ return await v.put(q, i);
36
36
  },
37
- async createPurchaseOrder(n) {
38
- const S = f.currentLocationDBName, O = `${p.inventoryBackendUrl}/${S}/purchase-order`;
39
- return await v.post(O, n);
37
+ async createPurchaseOrder(i) {
38
+ const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
39
+ return await v.post(x, i);
40
40
  },
41
- async updatePurchaseOrder(n) {
42
- const S = f.currentLocationDBName, O = `${p.inventoryBackendUrl}/${S}/purchase-order`;
43
- return await v.put(O, n);
41
+ async updatePurchaseOrder(i) {
42
+ const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order`;
43
+ return await v.put(x, i);
44
44
  },
45
- async importFromXilnex(n) {
46
- const S = f.currentLocationDBName, O = `${p.inventoryBackendUrl}/${S}/purchase-order/import-from-xilnex`;
47
- return await v.post(O, n);
45
+ async importFromXilnex(i) {
46
+ const w = a.currentLocationDBName, x = `${p.inventoryBackendUrl}/${w}/purchase-order/import-from-xilnex`;
47
+ return await v.post(x, i);
48
48
  }
49
49
  };
50
50
  }), ot = {
51
- [k.enum.confirmDraft]: {
51
+ [R.enum.confirmDraft]: {
52
52
  primaryActions: {
53
53
  text: "Confirm draft",
54
54
  close: !0
@@ -57,7 +57,7 @@ const Xe = it((p, v) => {
57
57
  message: "Purchase order cannot be changed after confirm draft.",
58
58
  successMessage: "Purchase order draft has been confirmed"
59
59
  },
60
- [k.enum.cancelDraft]: {
60
+ [R.enum.cancelDraft]: {
61
61
  primaryActions: {
62
62
  text: "Cancel draft",
63
63
  close: !0,
@@ -67,7 +67,7 @@ const Xe = it((p, v) => {
67
67
  message: "Purchase order cannot be changed after cancelled draft.",
68
68
  successMessage: "Purchase order draft has been cancelled"
69
69
  },
70
- [k.enum.submitRequest]: {
70
+ [R.enum.submitRequest]: {
71
71
  primaryActions: {
72
72
  text: "Submit request",
73
73
  close: !0
@@ -76,7 +76,7 @@ const Xe = it((p, v) => {
76
76
  message: "Purchase order cannot be changed after confirm draft.",
77
77
  successMessage: "Purchase order draft has been submitted"
78
78
  },
79
- [k.enum.completeReceive]: {
79
+ [R.enum.completeReceive]: {
80
80
  primaryActions: {
81
81
  text: "Mark received",
82
82
  close: !0
@@ -85,7 +85,7 @@ const Xe = it((p, v) => {
85
85
  message: "Purchase order cannot be changed after it has complete receiving.",
86
86
  successMessage: "Purchase order has been marked as received"
87
87
  },
88
- [k.enum.approveRequest]: {
88
+ [R.enum.approveRequest]: {
89
89
  primaryActions: {
90
90
  text: "Approve request",
91
91
  close: !0
@@ -94,7 +94,7 @@ const Xe = it((p, v) => {
94
94
  message: "Purchase order will be approved.",
95
95
  successMessage: "Purchase order has been approved"
96
96
  },
97
- [k.enum.rejectRequest]: {
97
+ [R.enum.rejectRequest]: {
98
98
  primaryActions: {
99
99
  text: "Reject request",
100
100
  close: !0,
@@ -106,46 +106,46 @@ const Xe = it((p, v) => {
106
106
  }
107
107
  };
108
108
  var He = /* @__PURE__ */ ((p) => (p.RECEIVE_REQUEST = "receive/request", p.APPROVAL = "approval", p))(He || {});
109
- const Se = V(), Ve = V();
109
+ const we = K(), Ve = K();
110
110
  function Fr(p, v) {
111
- const f = Ye(), n = Pe(), S = nt(), O = _t(), $ = St(), C = V(!1), d = We(), r = Xe(), a = V(new Array()), c = V(
111
+ const a = Ye(), i = Pe(), w = nt(), x = _t(), L = St(), q = K(!1), u = We(), t = Xe(), o = K(new Array()), l = K(
112
112
  v != null && v.startDate && (v != null && v.endDate) ? v : ct()
113
- ), u = X(() => {
114
- const y = new Date(c.value.startDate), h = new Date(c.value.endDate);
113
+ ), d = X(() => {
114
+ const y = new Date(l.value.startDate), h = new Date(l.value.endDate);
115
115
  return {
116
116
  start: ut(y).toISOString(),
117
117
  end: dt(h).toISOString()
118
118
  };
119
- }), i = V(new Array()), F = ft(), U = V(null);
120
- function Y(y) {
119
+ }), f = K(new Array()), F = ft(), U = K(null);
120
+ function J(y) {
121
121
  const h = {
122
122
  mode: Be.CREATE,
123
123
  modelValue: void 0,
124
124
  returnFrom: y,
125
125
  show: !0,
126
- "onUpdate:show"(t) {
127
- Se.value.show = t;
126
+ "onUpdate:show"(s) {
127
+ we.value.show = s;
128
128
  },
129
129
  lastClosingDate: U.value
130
130
  };
131
- Se.value = h;
131
+ we.value = h;
132
132
  }
133
- async function E(y) {
134
- function h(s) {
135
- const x = {
133
+ async function T(y) {
134
+ function h(r) {
135
+ const O = {
136
136
  mode: Be.CREATE,
137
137
  modelValue: y || void 0,
138
138
  show: !0,
139
- "onUpdate:show"(R) {
140
- Se.value.show = R;
139
+ "onUpdate:show"(k) {
140
+ we.value.show = k;
141
141
  },
142
- templateId: s,
142
+ templateId: r,
143
143
  lastClosingDate: U.value
144
144
  };
145
- Se.value = x;
145
+ we.value = O;
146
146
  }
147
- let t;
148
- S.mustUsePoTemplate && !(y != null && y.template) ? f.open({
147
+ let s;
148
+ w.mustUsePoTemplate && !(y != null && y.template) ? a.open({
149
149
  title: "Create transfer",
150
150
  message: "",
151
151
  primaryActions: {
@@ -158,170 +158,170 @@ function Fr(p, v) {
158
158
  close: !0
159
159
  }
160
160
  }).onPrimary(async () => {
161
- t = await O.getTemplateId(), t && h(t);
161
+ s = await x.getTemplateId(), s && h(s);
162
162
  }).onSecondary(() => {
163
163
  h(void 0);
164
- }) : h(t);
164
+ }) : h(s);
165
165
  }
166
- function H(y) {
166
+ function M(y) {
167
167
  const h = {
168
168
  mode: Be.UPDATE,
169
169
  modelValue: tt(y),
170
170
  show: !0,
171
- "onUpdate:show"(t) {
172
- Se.value.show = t;
171
+ "onUpdate:show"(s) {
172
+ we.value.show = s;
173
173
  },
174
174
  lastClosingDate: U.value
175
175
  };
176
- Se.value = h;
176
+ we.value = h;
177
177
  }
178
- async function ue() {
179
- a.value = [], C.value = !0;
178
+ async function Y() {
179
+ o.value = [], q.value = !0;
180
180
  try {
181
- a.value = await r.getPurchaseOrders(u.value).then((t) => t.sort((s, x) => x._id.localeCompare(s._id)));
181
+ o.value = await t.getPurchaseOrders(d.value).then((s) => s.sort((r, O) => O._id.localeCompare(r._id)));
182
182
  const y = await F.readLastClosing(!0), h = y == null ? void 0 : y._id;
183
- h && (U.value = mt(h)), S.mustUsePoTemplate && await $.fetchTemplates();
183
+ h && (U.value = mt(h)), w.mustUsePoTemplate && await L.fetchTemplates();
184
184
  } catch {
185
- d.open({
185
+ u.open({
186
186
  title: "Something went wrong",
187
187
  message: "Error at fetching purchase orders",
188
188
  type: "error"
189
189
  });
190
190
  } finally {
191
- C.value = !1;
191
+ q.value = !1;
192
192
  }
193
193
  }
194
- async function we() {
195
- i.value = [], C.value = !0;
194
+ async function de() {
195
+ f.value = [], q.value = !0;
196
196
  try {
197
- i.value = await r.readRequests().then((y) => y.reverse());
197
+ f.value = await t.readRequests().then((y) => y.reverse());
198
198
  } catch {
199
- d.open({
199
+ u.open({
200
200
  title: "Something went wrong",
201
201
  message: "Error at fetching purchase requests",
202
202
  type: "error"
203
203
  });
204
204
  } finally {
205
- C.value = !1;
205
+ q.value = !1;
206
206
  }
207
207
  }
208
- function se() {
208
+ function Z() {
209
209
  switch (p) {
210
210
  case "receive/request":
211
- return ue();
211
+ return Y();
212
212
  case "approval":
213
- return we();
213
+ return de();
214
214
  }
215
215
  }
216
- function de(y, h) {
217
- c.value = {
216
+ function fe(y, h) {
217
+ l.value = {
218
218
  startDate: y,
219
219
  endDate: h
220
- }, se();
220
+ }, Z();
221
221
  }
222
- n.watchLocation(async (y) => {
222
+ i.watchLocation(async (y) => {
223
223
  if (!y) {
224
- a.value = [];
224
+ o.value = [];
225
225
  return;
226
226
  }
227
- await se();
227
+ await Z();
228
228
  });
229
- const z = V(), Ce = V(Math.random().toString());
229
+ const z = K(), Ce = K(Math.random().toString());
230
230
  async function Ie(y, h) {
231
- var R, T;
232
- const t = Math.random().toString();
233
- Ce.value = t;
234
- const s = p === "receive/request" ? n.currentLocation : h == null ? void 0 : h.to, x = {
231
+ var k, P;
232
+ const s = Math.random().toString();
233
+ Ce.value = s;
234
+ const r = p === "receive/request" ? i.currentLocation : h == null ? void 0 : h.to, O = {
235
235
  poRequest: h,
236
236
  purchaseOrder: y,
237
- transferTo: s == null ? void 0 : s.name,
238
- transferToDbName: s == null ? void 0 : s.dbName,
237
+ transferTo: r == null ? void 0 : r.name,
238
+ transferToDbName: r == null ? void 0 : r.dbName,
239
239
  show: !0,
240
240
  canResubmit: !1,
241
241
  canApprove: p === "approval",
242
- "onUpdate:show"(P) {
243
- z.value.show = P;
242
+ "onUpdate:show"(C) {
243
+ z.value.show = C;
244
244
  },
245
245
  scope: p
246
246
  };
247
- if (z.value = x, !(h || y.status !== M.enum.REQUESTING)) {
247
+ if (z.value = O, !(h || y.status !== j.enum.REQUESTING)) {
248
248
  try {
249
- h = (await r.readRequests(
249
+ h = (await t.readRequests(
250
250
  `${y.supplier.internal}_${y.supplier._id}`
251
- )).find((K) => K.purchaseOrderId === y._id);
251
+ )).find((G) => G.purchaseOrderId === y._id);
252
252
  } catch {
253
253
  console.error("Error at fetching po request to check");
254
254
  }
255
- t === Ce.value && (z.value.canResubmit = !h, z.value.transferTo = (R = h == null ? void 0 : h.to) == null ? void 0 : R.name, z.value.transferToDbName = (T = h == null ? void 0 : h.to) == null ? void 0 : T.dbName);
255
+ s === Ce.value && (z.value.canResubmit = !h, z.value.transferTo = (k = h == null ? void 0 : h.to) == null ? void 0 : k.name, z.value.transferToDbName = (P = h == null ? void 0 : h.to) == null ? void 0 : P.dbName);
256
256
  }
257
257
  }
258
- async function re(y, h, t, s) {
259
- C.value = !0;
258
+ async function ae(y, h, s, r) {
259
+ q.value = !0;
260
260
  try {
261
- await r.processPurchaseOrder(
261
+ await t.processPurchaseOrder(
262
262
  {
263
263
  operation: h,
264
264
  doc: y,
265
265
  options: (
266
266
  // auto receive for supplier to warehouse
267
- (h === k.enum.confirmDraft || // auto receive for warehouse to warehouse
268
- h === k.enum.completeReceive) && S.autoReceiveWarehouse ? {
267
+ (h === R.enum.confirmDraft || // auto receive for warehouse to warehouse
268
+ h === R.enum.completeReceive) && w.autoReceiveWarehouse ? {
269
269
  autoReceive: !0
270
270
  } : void 0
271
271
  )
272
272
  },
273
- s
274
- ), await new Promise((T) => setTimeout(T, 1e3));
275
- const R = Pe().currentLocationDBName.startsWith("restaurant_");
276
- h === k.enum.confirmDraft && y.effectiveAt && R ? d.open({
273
+ r
274
+ ), await new Promise((P) => setTimeout(P, 1e3));
275
+ const k = Pe().currentLocationDBName.startsWith("restaurant_");
276
+ h === R.enum.confirmDraft && y.effectiveAt && k ? u.open({
277
277
  title: "Success",
278
- message: `${t}. The backdate will be reflected once your POS has received this change.`,
278
+ message: `${s}. The backdate will be reflected once your POS has received this change.`,
279
279
  type: "success"
280
- }) : d.open({
280
+ }) : u.open({
281
281
  title: "Success",
282
- message: t,
282
+ message: s,
283
283
  type: "success"
284
284
  });
285
- } catch (x) {
286
- d.open({
285
+ } catch (O) {
286
+ u.open({
287
287
  title: "Something went wrong",
288
288
  message: "Please try again.",
289
289
  type: "error"
290
- }), console.error("Error when submitting PO operation", h, y, x);
290
+ }), console.error("Error when submitting PO operation", h, y, O);
291
291
  } finally {
292
- C.value = !1, se();
292
+ q.value = !1, Z();
293
293
  }
294
294
  }
295
- async function Le(y, h, t, s) {
296
- if (h === k.enum.returnStock)
297
- return s ? re(
295
+ async function Le(y, h, s, r) {
296
+ if (h === R.enum.returnStock)
297
+ return r ? ae(
298
298
  {
299
299
  returnOrder: y,
300
- purchaseOrder: s
300
+ purchaseOrder: r
301
301
  },
302
302
  h,
303
303
  "Transfer order successfully created."
304
304
  ) : void 0;
305
- const x = ot[h];
306
- if (!x) {
307
- d.open({
305
+ const O = ot[h];
306
+ if (!O) {
307
+ u.open({
308
308
  title: "Something went wrong",
309
309
  message: `Cannot process order: ${st(h)}`,
310
310
  type: "error"
311
311
  });
312
312
  return;
313
313
  }
314
- const { successMessage: R, ...T } = x;
315
- f.open({
316
- title: T.title,
317
- message: T.message,
318
- primaryActions: T.primaryActions
314
+ const { successMessage: k, ...P } = O;
315
+ a.open({
316
+ title: P.title,
317
+ message: P.message,
318
+ primaryActions: P.primaryActions
319
319
  }).onPrimary(() => {
320
- re(y, h, R, t);
320
+ ae(y, h, k, s);
321
321
  });
322
322
  }
323
323
  async function Fe() {
324
- f.open({
324
+ a.open({
325
325
  title: "Upload Transfer",
326
326
  primaryActions: {
327
327
  text: "Xilnex transfer note",
@@ -342,15 +342,15 @@ function Fr(p, v) {
342
342
  });
343
343
  }
344
344
  return {
345
- purchaseOrders: a,
346
- purchaseRequests: i,
347
- updateDateRange: de,
348
- fetchData: se,
349
- loading: C,
350
- transferDialogProps: Se,
351
- promptCreateTransferDialog: E,
352
- promptUpdateTransferDialog: H,
353
- promptReturnTransferDialog: Y,
345
+ purchaseOrders: o,
346
+ purchaseRequests: f,
347
+ updateDateRange: fe,
348
+ fetchData: Z,
349
+ loading: q,
350
+ transferDialogProps: we,
351
+ promptCreateTransferDialog: T,
352
+ promptUpdateTransferDialog: M,
353
+ promptReturnTransferDialog: J,
354
354
  transferDetailsProps: z,
355
355
  promptShowTransferDetails: Ie,
356
356
  submitAction: Le,
@@ -358,26 +358,26 @@ function Fr(p, v) {
358
358
  promptUploadTransferDialog: Fe
359
359
  };
360
360
  }
361
- function Rt(p, v) {
361
+ function Ot(p, v) {
362
362
  return v.reduce(
363
- (n, S) => {
364
- const O = S.received.find(($) => $.sku._id === p._id);
365
- return O && (n = Ke(n, O.amount)), n;
363
+ (i, w) => {
364
+ const x = w.received.find((L) => L.sku._id === p._id);
365
+ return x && (i = Ke(i, x.amount)), i;
366
366
  },
367
- xt.toPrecision($e(0), p.unit.precision)
367
+ xt.toPrecision(qe(0), p.unit.precision)
368
368
  );
369
369
  }
370
370
  function lt(p, v) {
371
- const { name: f, address: n, regNo: S } = v.doc.profile, O = {
372
- name: f,
373
- registrationNumber: S,
374
- line1: n == null ? void 0 : n.line1,
375
- line2: n == null ? void 0 : n.line2,
376
- postcode: n == null ? void 0 : n.postcode,
377
- city: n == null ? void 0 : n.city,
378
- state: n == null ? void 0 : n.state,
379
- country: n == null ? void 0 : n.country
380
- }, $ = {
371
+ const { name: a, address: i, regNo: w } = v.doc.profile, x = {
372
+ name: a,
373
+ registrationNumber: w,
374
+ line1: i == null ? void 0 : i.line1,
375
+ line2: i == null ? void 0 : i.line2,
376
+ postcode: i == null ? void 0 : i.postcode,
377
+ city: i == null ? void 0 : i.city,
378
+ state: i == null ? void 0 : i.state,
379
+ country: i == null ? void 0 : i.country
380
+ }, L = {
381
381
  name: p.supplier.name,
382
382
  registrationNumber: p.supplier.registrationNumber,
383
383
  line1: p.supplier.address.line1,
@@ -386,177 +386,189 @@ function lt(p, v) {
386
386
  city: p.supplier.address.city,
387
387
  state: p.supplier.address.state,
388
388
  country: p.supplier.address.country
389
- }, C = p.items.map((c) => {
390
- const { sku: u, measurement: i } = c, F = Re(
391
- Rt(c.sku, p.deliveryOrder || []),
389
+ }, q = p.items.map((l) => {
390
+ const { sku: d, measurement: f } = l, F = Oe(
391
+ Ot(l.sku, p.deliveryOrder || []),
392
392
  !1
393
393
  );
394
394
  return {
395
- code: u.code,
396
- description: u.name,
397
- quantity: Ge(c.quantity, u.unit, c.measurement),
398
- unit: (i == null ? void 0 : i.abbrev) || u.unit.abbrev,
395
+ code: d.code,
396
+ description: d.name,
397
+ quantity: Ge(l.quantity, d.unit, l.measurement),
398
+ unit: (f == null ? void 0 : f.abbrev) || d.unit.abbrev,
399
399
  received: F
400
400
  };
401
- }), d = p.deliveryOrder.map((c) => ({
402
- createdAt: rt(new Date(c.createdAt)),
403
- ref: c.deliveryOrderNumber,
404
- remark: c.remark || "",
405
- items: c.received.map((u) => {
406
- var i;
401
+ }), u = p.deliveryOrder.map((l) => ({
402
+ createdAt: rt(new Date(l.createdAt)),
403
+ ref: l.deliveryOrderNumber,
404
+ remark: l.remark || "",
405
+ items: l.received.map((d) => {
406
+ var f;
407
407
  return {
408
- code: u.sku.code,
409
- description: u.sku.name,
410
- quantity: Re(u.amount),
411
- unit: ((i = u.measurement) == null ? void 0 : i.abbrev) || u.sku.unit.abbrev
408
+ code: d.sku.code,
409
+ description: d.sku.name,
410
+ quantity: Oe(d.amount),
411
+ unit: ((f = d.measurement) == null ? void 0 : f.abbrev) || d.sku.unit.abbrev
412
412
  };
413
413
  })
414
- })), r = {
414
+ })), t = {
415
415
  orderNumber: p.seqNumber.toString(),
416
416
  createdAt: Ee(p._id),
417
417
  ref: p.ref || "",
418
418
  remark: p.remark || "",
419
- buyer: O,
420
- supplier: $,
421
- items: C,
419
+ buyer: x,
420
+ supplier: L,
421
+ items: q,
422
422
  status: p.status,
423
- deliveryOrders: d
424
- }, a = new URL("https://inventory.feedme.cc");
425
- a.pathname = a.hostname.includes("inventory.feedme") || a.hostname.includes("localhost") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", a.searchParams.append("data", JSON.stringify(r)), window.open(a.href, "_blank", "noreferrer");
423
+ deliveryOrders: u
424
+ }, o = new URL("https://inventory.feedme.cc");
425
+ o.pathname = o.hostname.includes("inventory.feedme") || o.hostname.includes("localhost") ? "/receive-request/print-preview" : "/inventory/receive-request/print-preview", o.searchParams.append("data", JSON.stringify(t)), window.open(o.href, "_blank", "noreferrer");
426
426
  }
427
427
  const xe = {
428
428
  submitRequest: {
429
429
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
430
430
  color: "text-fm-color-typo-primary",
431
- value: k.enum.submitRequest
431
+ value: R.enum.submitRequest
432
432
  },
433
433
  confirmDraft: {
434
434
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
435
435
  color: "text-fm-color-typo-primary",
436
- value: k.enum.confirmDraft
436
+ value: R.enum.confirmDraft
437
437
  },
438
438
  cancelDraft: {
439
439
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
440
440
  color: "text-fm-color-typo-error",
441
- value: k.enum.cancelDraft
441
+ value: R.enum.cancelDraft
442
442
  },
443
443
  approveRequest: {
444
444
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
445
445
  color: "text-fm-color-typo-primary",
446
- value: k.enum.approveRequest
446
+ value: R.enum.approveRequest
447
447
  },
448
448
  rejectRequest: {
449
449
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
450
450
  color: "text-fm-color-typo-error",
451
- value: k.enum.rejectRequest
451
+ value: R.enum.rejectRequest
452
452
  },
453
453
  processRequest: {
454
454
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
455
455
  color: "text-fm-color-typo-primary",
456
- value: k.enum.processRequest
456
+ value: R.enum.processRequest
457
457
  },
458
458
  receiveStock: {
459
459
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
460
460
  color: "text-fm-color-typo-primary",
461
- value: k.enum.receiveStock
461
+ value: R.enum.receiveStock
462
462
  },
463
463
  completeReceive: {
464
464
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
465
465
  color: "text-fm-color-typo-primary",
466
- value: k.enum.completeReceive
466
+ value: R.enum.completeReceive
467
467
  },
468
468
  returnStock: {
469
469
  translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
470
470
  color: "text-fm-color-typo-primary",
471
- value: k.enum.returnStock
471
+ value: R.enum.returnStock
472
472
  }
473
473
  };
474
474
  function Ur(p, v) {
475
- const f = Pe(), { t: n } = at();
476
- function S(a) {
477
- switch (a.status) {
475
+ Pe();
476
+ const { t: a } = at();
477
+ function i(t) {
478
+ switch (t.status) {
478
479
  case "DRAFT":
479
480
  return [
480
- Z[Q.Update],
481
- Z[Q.Details],
482
- a.supplier.internal === "restaurant" || a.supplier.internal === "warehouse" ? xe[k.enum.submitRequest] : xe[k.enum.confirmDraft],
483
- xe[k.enum.cancelDraft],
484
- Z[Q.Print]
481
+ te[Q.Update],
482
+ te[Q.Details],
483
+ t.supplier.internal === "restaurant" || t.supplier.internal === "warehouse" ? xe[R.enum.submitRequest] : xe[R.enum.confirmDraft],
484
+ xe[R.enum.cancelDraft],
485
+ te[Q.Print]
485
486
  ];
486
487
  case "RECEIVING":
487
488
  return [
488
- xe[k.enum.completeReceive],
489
- Z[Q.Details],
490
- Z[Q.Print]
489
+ xe[R.enum.completeReceive],
490
+ te[Q.Details],
491
+ te[Q.Print]
491
492
  ];
492
493
  case "REQUESTING":
493
- return p === "receive/request" ? [Z[Q.Details], Z[Q.Print]] : [
494
- xe[k.enum.approveRequest],
495
- xe[k.enum.rejectRequest],
496
- Z[Q.Details],
497
- Z[Q.Print]
494
+ return p === "receive/request" ? [te[Q.Details], te[Q.Print]] : [
495
+ xe[R.enum.approveRequest],
496
+ xe[R.enum.rejectRequest],
497
+ te[Q.Details],
498
+ te[Q.Print]
498
499
  ];
499
500
  case "PROCESSING":
500
- return [Z[Q.Details], Z[Q.Print]];
501
+ return [te[Q.Details], te[Q.Print]];
501
502
  case "COMPLETE":
502
503
  case "CANCEL":
503
504
  default:
504
- return [Z[Q.Details], Z[Q.Print]];
505
+ return [te[Q.Details], te[Q.Print]];
505
506
  }
506
507
  }
507
- function O(a) {
508
- return Object.values(k.enum).includes(a);
508
+ function w(t) {
509
+ return Object.values(R.enum).includes(t);
509
510
  }
510
- async function $(a, c, u) {
511
- var F, U;
512
- const i = tt(c);
513
- if (a === Q.Print) {
514
- lt(i, f.currentLocation);
511
+ async function x(t, o, l) {
512
+ var f, F, U, J, T, M;
513
+ const d = tt(o);
514
+ if (t === Q.Print) {
515
+ const Y = (l == null ? void 0 : l.toInventoryLocation) ?? {
516
+ name: "",
517
+ type: "restaurant",
518
+ acceptRequest: !0,
519
+ dbName: "",
520
+ doc: {
521
+ _id: "",
522
+ businessId: "",
523
+ profile: {}
524
+ }
525
+ }, de = `${((f = l == null ? void 0 : l.netSuite) == null ? void 0 : f.id) ?? ""} ${((F = l == null ? void 0 : l.netSuite) == null ? void 0 : F.refNo) ?? ""}`.trim() || `${((U = d.netSuite) == null ? void 0 : U.id) ?? ""} ${((J = d.netSuite) == null ? void 0 : J.refNo) ?? ""}`.trim();
526
+ d.ref = [de ? `Netsuite: (${de})` : "", d.ref].filter((Z) => Z).join(" "), lt(d, Y);
515
527
  return;
516
528
  }
517
- if (a === Q.Details) {
518
- v.promptShowTransferDetails(i, u).catch((Y) => {
519
- console.error("error on promptShowTransferDetails", { error: Y, poRequest: u });
529
+ if (t === Q.Details) {
530
+ v.promptShowTransferDetails(d, l).catch((Y) => {
531
+ console.error("error on promptShowTransferDetails", { error: Y, poRequest: l });
520
532
  });
521
533
  return;
522
534
  }
523
- if (a === Q.Update) {
524
- (F = v.promptUpdateTransferDialog) == null || F.call(v, i);
535
+ if (t === Q.Update) {
536
+ (T = v.promptUpdateTransferDialog) == null || T.call(v, d);
525
537
  return;
526
538
  }
527
- if (O(a) && a != k.enum.returnStock && a != k.enum.receiveStock) {
528
- v.submitAction(c, a, (U = u == null ? void 0 : u.to) == null ? void 0 : U.dbName).then((Y) => {
529
- console.error("error on po action", { action: a, error: Y });
539
+ if (w(t) && t != R.enum.returnStock && t != R.enum.receiveStock) {
540
+ v.submitAction(o, t, (M = l == null ? void 0 : l.to) == null ? void 0 : M.dbName).then((Y) => {
541
+ console.error("error on po action", { action: t, error: Y });
530
542
  });
531
543
  return;
532
544
  }
533
545
  }
534
- function C() {
546
+ function L() {
535
547
  return [
536
548
  {
537
549
  accessorKey: "seqNumber",
538
- header: () => n("inventory.transfer.table.seqNo"),
550
+ header: () => a("inventory.transfer.table.seqNo"),
539
551
  enableSorting: !0,
540
552
  size: 80,
541
553
  sortUndefined: "last"
542
554
  },
543
555
  {
544
556
  accessorKey: "_id",
545
- header: () => n("inventory.transfer.table.createdAt"),
546
- cell(a) {
547
- return Ee(`${a.getValue()}`);
557
+ header: () => a("inventory.transfer.table.createdAt"),
558
+ cell(t) {
559
+ return Ee(`${t.getValue()}`);
548
560
  },
549
561
  enableSorting: !0
550
562
  },
551
563
  {
552
564
  accessorKey: "supplier.name",
553
- header: () => n("inventory.transfer.table.transferFrom"),
565
+ header: () => a("inventory.transfer.table.transferFrom"),
554
566
  enableSorting: !0,
555
567
  size: 200
556
568
  },
557
569
  {
558
570
  accessorKey: "items.length",
559
- header: () => n("inventory.transfer.table.noOfItems"),
571
+ header: () => a("inventory.transfer.table.noOfItems"),
560
572
  enableSorting: !1,
561
573
  meta: {
562
574
  width: "10rem"
@@ -564,15 +576,15 @@ function Ur(p, v) {
564
576
  },
565
577
  {
566
578
  accessorKey: "ref",
567
- header: () => n("inventory.transfer.table.reference"),
579
+ header: () => a("inventory.transfer.table.reference"),
568
580
  enableSorting: !1,
569
581
  size: "auto"
570
582
  },
571
583
  {
572
584
  accessorKey: "status",
573
- header: () => n("inventory.transfer.table.status"),
574
- cell(a) {
575
- const c = n(`inventory.transfer.status.${a.getValue() ?? ""}`), u = `${a.getValue() ?? ""}`.toLocaleLowerCase("en-us");
585
+ header: () => a("inventory.transfer.table.status"),
586
+ cell(t) {
587
+ const o = a(`inventory.transfer.status.${t.getValue() ?? ""}`), l = `${t.getValue() ?? ""}`.toLocaleLowerCase("en-us");
576
588
  return N(
577
589
  "div",
578
590
  {
@@ -581,9 +593,9 @@ function Ur(p, v) {
581
593
  N(
582
594
  "div",
583
595
  {
584
- class: `fm-status-badge fm-status-badge-${u}`
596
+ class: `fm-status-badge fm-status-badge-${l}`
585
597
  },
586
- c
598
+ o
587
599
  )
588
600
  );
589
601
  },
@@ -592,9 +604,9 @@ function Ur(p, v) {
592
604
  },
593
605
  {
594
606
  id: "action",
595
- cell(a) {
596
- const c = a.row.original, u = S(c);
597
- return Je(u, (i) => $(i, c));
607
+ cell(t) {
608
+ const o = t.row.original, l = i(o);
609
+ return Je(l, (d) => x(d, o));
598
610
  },
599
611
  enableSorting: !1,
600
612
  size: 40,
@@ -605,45 +617,45 @@ function Ur(p, v) {
605
617
  }
606
618
  ];
607
619
  }
608
- function d() {
620
+ function q() {
609
621
  return [
610
622
  {
611
623
  accessorKey: "purchaseOrder.seqNumber",
612
- header: () => n("inventory.transfer.table.seqNo"),
624
+ header: () => a("inventory.transfer.table.seqNo"),
613
625
  enableSorting: !0,
614
626
  size: 80,
615
627
  sortUndefined: "last"
616
628
  },
617
629
  {
618
630
  accessorKey: "purchaseOrder._id",
619
- header: () => n("inventory.transfer.table.createdAt"),
620
- cell(a) {
621
- return Ee(`${a.getValue()}`);
631
+ header: () => a("inventory.transfer.table.createdAt"),
632
+ cell(t) {
633
+ return Ee(`${t.getValue()}`);
622
634
  },
623
635
  enableSorting: !0
624
636
  },
625
637
  {
626
638
  accessorKey: "to.name",
627
- header: () => n("inventory.transfer.table.transferTo"),
639
+ header: () => a("inventory.transfer.table.transferTo"),
628
640
  enableSorting: !1,
629
641
  size: 200
630
642
  },
631
643
  {
632
644
  accessorKey: "purchaseOrder.items.length",
633
- header: () => n("inventory.transfer.table.noOfItems"),
645
+ header: () => a("inventory.transfer.table.noOfItems"),
634
646
  enableSorting: !1
635
647
  },
636
648
  {
637
649
  accessorKey: "purchaseOrder.ref",
638
- header: () => n("inventory.transfer.table.reference"),
650
+ header: () => a("inventory.transfer.table.reference"),
639
651
  enableSorting: !1,
640
652
  size: "auto"
641
653
  },
642
654
  {
643
655
  accessorKey: "purchaseOrder.status",
644
- header: () => n("inventory.transfer.table.status"),
645
- cell(a) {
646
- const c = n(`inventory.transfer.status.${a.getValue() ?? ""}`), u = `${a.getValue() ?? ""}`.toLocaleLowerCase("en-us");
656
+ header: () => a("inventory.transfer.table.status"),
657
+ cell(t) {
658
+ const o = a(`inventory.transfer.status.${t.getValue() ?? ""}`), l = `${t.getValue() ?? ""}`.toLocaleLowerCase("en-us");
647
659
  return N(
648
660
  "div",
649
661
  {
@@ -652,9 +664,9 @@ function Ur(p, v) {
652
664
  N(
653
665
  "div",
654
666
  {
655
- class: `fm-status-badge fm-status-badge-${u}`
667
+ class: `fm-status-badge fm-status-badge-${l}`
656
668
  },
657
- c
669
+ o
658
670
  )
659
671
  );
660
672
  },
@@ -662,17 +674,17 @@ function Ur(p, v) {
662
674
  },
663
675
  {
664
676
  id: "action",
665
- cell(a) {
666
- const c = a.row.original, u = c.purchaseOrder ? S(c.purchaseOrder) : [];
677
+ cell(t) {
678
+ const o = t.row.original, l = o.purchaseOrder ? i(o.purchaseOrder) : [];
667
679
  return Je(
668
- u,
669
- (i) => c.purchaseOrder ? $(
670
- i,
680
+ l,
681
+ (d) => o.purchaseOrder ? x(
682
+ d,
671
683
  {
672
- ...c.purchaseOrder,
673
- _rev: c.purchaseOrder._rev ?? ""
684
+ ...o.purchaseOrder,
685
+ _rev: o.purchaseOrder._rev ?? ""
674
686
  },
675
- c
687
+ o
676
688
  ) : void 0
677
689
  );
678
690
  },
@@ -685,23 +697,23 @@ function Ur(p, v) {
685
697
  }
686
698
  ];
687
699
  }
688
- const r = X(() => p === "receive/request" ? C() : d());
700
+ const u = X(() => p === "receive/request" ? L() : q());
689
701
  return {
690
702
  get columnDefs() {
691
- return r.value;
703
+ return u.value;
692
704
  }
693
705
  };
694
706
  }
695
- const Ot = {
707
+ const kt = {
696
708
  key: 0,
697
709
  class: "flex flex-col gap-8"
698
- }, kt = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-lg-600" }, Nt = {
710
+ }, Rt = { class: "flex flex-col gap-4" }, Dt = { class: "fm-typo-en-body-lg-600" }, Nt = {
699
711
  key: 0,
700
712
  class: "flex flex-col gap-4"
701
- }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, qt = { class: "fm-typo-en-body-lg-600" }, Tt = { key: 0 }, Pt = { key: 1 }, Ct = {
713
+ }, At = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Tt = { class: "fm-typo-en-body-lg-600" }, $t = { key: 0 }, Pt = { key: 1 }, Ct = {
702
714
  key: 1,
703
715
  class: "flex flex-col gap-4"
704
- }, $t = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600" }, It = { key: 0 }, Lt = { key: 1 }, Ft = {
716
+ }, qt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Et = { class: "fm-typo-en-body-lg-600" }, It = { key: 0 }, Lt = { key: 1 }, Ft = {
705
717
  key: 2,
706
718
  class: "flex flex-col gap-4"
707
719
  }, Ut = { class: "fm-typo-en-body-lg-600" }, Bt = {
@@ -718,57 +730,57 @@ const Ot = {
718
730
  scope: {}
719
731
  },
720
732
  setup(p) {
721
- const v = p, f = ze(), n = Xe(), S = V(v.poRequest);
733
+ const v = p, a = ze(), i = Xe(), w = K(v.poRequest);
722
734
  yt(async () => {
723
- var d;
724
- if (!v.poRequest && ((d = v.purchaseOrder) != null && d._id)) {
725
- const r = await n.getLatestPurchaseOrderRequest(v.purchaseOrder._id);
726
- S.value = r;
735
+ var u;
736
+ if (!v.poRequest && ((u = v.purchaseOrder) != null && u._id)) {
737
+ const t = await i.getLatestPurchaseOrderRequest(v.purchaseOrder._id);
738
+ w.value = t;
727
739
  }
728
740
  });
729
- const O = X(
741
+ const x = X(
730
742
  () => {
731
- var d, r, a, c, u, i;
732
- return f.getSubsidiaryFullName(
733
- ((a = (r = (d = v.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : r.subsidiary) == null ? void 0 : a.id) || ((i = (u = (c = v.poRequest) == null ? void 0 : c.netSuite) == null ? void 0 : u.subsidiary) == null ? void 0 : i.id)
743
+ var u, t, o, l, d, f;
744
+ return a.getSubsidiaryFullName(
745
+ ((o = (t = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : t.subsidiary) == null ? void 0 : o.id) || ((f = (d = (l = v.poRequest) == null ? void 0 : l.netSuite) == null ? void 0 : d.subsidiary) == null ? void 0 : f.id)
734
746
  ).fullName;
735
747
  }
736
- ), $ = X(() => {
737
- var d, r, a, c, u, i, F, U, Y, E, H, ue;
738
- return (a = (r = (d = v.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : r.additionalInfo) != null && a.transactionnumber ? (i = (u = (c = v.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : i.transactionnumber : (Y = (U = (F = S.value) == null ? void 0 : F.netSuite) == null ? void 0 : U.additionalInfo) != null && Y.transactionnumber ? (ue = (H = (E = S.value) == null ? void 0 : E.netSuite) == null ? void 0 : H.additionalInfo) == null ? void 0 : ue.transactionnumber : null;
739
- }), C = X(() => {
740
- var d, r, a, c, u, i;
741
- return (r = (d = v.purchaseOrder) == null ? void 0 : d.deliveryFullfillment) != null && r.length && ((c = (a = v.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) == null ? void 0 : c.length) > 0 ? (i = (u = v.purchaseOrder) == null ? void 0 : u.deliveryFullfillment) == null ? void 0 : i.map((F) => {
748
+ ), L = X(() => {
749
+ var u, t, o, l, d, f, F, U, J, T, M, Y;
750
+ return (o = (t = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : t.additionalInfo) != null && o.transactionnumber ? (f = (d = (l = v.purchaseOrder) == null ? void 0 : l.netSuite) == null ? void 0 : d.additionalInfo) == null ? void 0 : f.transactionnumber : (J = (U = (F = w.value) == null ? void 0 : F.netSuite) == null ? void 0 : U.additionalInfo) != null && J.transactionnumber ? (Y = (M = (T = w.value) == null ? void 0 : T.netSuite) == null ? void 0 : M.additionalInfo) == null ? void 0 : Y.transactionnumber : null;
751
+ }), q = X(() => {
752
+ var u, t, o, l, d, f;
753
+ return (t = (u = v.purchaseOrder) == null ? void 0 : u.deliveryFullfillment) != null && t.length && ((l = (o = v.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) == null ? void 0 : l.length) > 0 ? (f = (d = v.purchaseOrder) == null ? void 0 : d.deliveryFullfillment) == null ? void 0 : f.map((F) => {
742
754
  var U;
743
755
  return (U = F.netSuite) == null ? void 0 : U.refNo;
744
756
  }).join(", ") : "N/A";
745
757
  });
746
- return (d, r) => {
747
- var a, c, u, i, F, U, Y, E, H, ue, we, se, de, z;
748
- return o(f).isEnabled ? (l(), _("div", Ot, [
749
- e("div", kt, [
750
- r[0] || (r[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
751
- e("div", Dt, m(O.value || "N/A"), 1)
758
+ return (u, t) => {
759
+ var o, l, d, f, F, U, J, T, M, Y, de, Z, fe, z;
760
+ return n(a).isEnabled ? (c(), _("div", kt, [
761
+ e("div", Rt, [
762
+ t[0] || (t[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
763
+ e("div", Dt, m(x.value || "N/A"), 1)
752
764
  ]),
753
- !d.isTransferBetweenOutlets && ((a = d.purchaseOrder) == null ? void 0 : a.status) !== o(M).Enum.REQUESTING && d.scope === o(He).RECEIVE_REQUEST ? (l(), _("div", Nt, [
754
- e("div", At, " NetSuite " + m(d.transferType === o(ge).PURCHASE ? "purchase order" : "transfer order") + " (ID) ", 1),
755
- e("div", qt, [
756
- (u = (c = d.purchaseOrder) == null ? void 0 : c.netSuite) != null && u.id ? (l(), _("span", Tt, m((F = (i = d.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : F.refNo) + " (" + m((Y = (U = d.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : Y.id) + ") ", 1)) : (l(), _("span", Pt, "N/A"))
765
+ !u.isTransferBetweenOutlets && ((o = u.purchaseOrder) == null ? void 0 : o.status) !== n(j).Enum.REQUESTING && u.scope === n(He).RECEIVE_REQUEST ? (c(), _("div", Nt, [
766
+ e("div", At, " NetSuite " + m(u.transferType === n(be).PURCHASE ? "purchase order" : "transfer order") + " (ID) ", 1),
767
+ e("div", Tt, [
768
+ (d = (l = u.purchaseOrder) == null ? void 0 : l.netSuite) != null && d.id ? (c(), _("span", $t, m((F = (f = u.purchaseOrder) == null ? void 0 : f.netSuite) == null ? void 0 : F.refNo) + " (" + m((J = (U = u.purchaseOrder) == null ? void 0 : U.netSuite) == null ? void 0 : J.id) + ") ", 1)) : (c(), _("span", Pt, "N/A"))
757
769
  ])
758
770
  ])) : D("", !0),
759
- !d.isTransferBetweenOutlets && S.value && ((E = d.purchaseOrder) == null ? void 0 : E.status) === o(M).Enum.REQUESTING || d.scope === o(He).APPROVAL ? (l(), _("div", Ct, [
760
- e("div", $t, " (Request) NetSuite " + m(d.transferType === o(ge).PURCHASE ? "Purchase order" : "Transfer order") + " (ID) ", 1),
771
+ !u.isTransferBetweenOutlets && w.value && ((T = u.purchaseOrder) == null ? void 0 : T.status) === n(j).Enum.REQUESTING || u.scope === n(He).APPROVAL ? (c(), _("div", Ct, [
772
+ e("div", qt, " (Request) NetSuite " + m(u.transferType === n(be).PURCHASE ? "Purchase order" : "Transfer order") + " (ID) ", 1),
761
773
  e("div", Et, [
762
- (ue = (H = S.value) == null ? void 0 : H.netSuite) != null && ue.id ? (l(), _("span", It, m((se = (we = S.value) == null ? void 0 : we.netSuite) == null ? void 0 : se.refNo) + " (" + m((z = (de = S.value) == null ? void 0 : de.netSuite) == null ? void 0 : z.id) + ") ", 1)) : (l(), _("span", Lt, "N/A"))
774
+ (Y = (M = w.value) == null ? void 0 : M.netSuite) != null && Y.id ? (c(), _("span", It, m((Z = (de = w.value) == null ? void 0 : de.netSuite) == null ? void 0 : Z.refNo) + " (" + m((z = (fe = w.value) == null ? void 0 : fe.netSuite) == null ? void 0 : z.id) + ") ", 1)) : (c(), _("span", Lt, "N/A"))
763
775
  ])
764
776
  ])) : D("", !0),
765
- $.value ? (l(), _("div", Ft, [
766
- r[1] || (r[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite transaction number ", -1)),
767
- e("div", Ut, m($.value), 1)
777
+ L.value ? (c(), _("div", Ft, [
778
+ t[1] || (t[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite transaction number ", -1)),
779
+ e("div", Ut, m(L.value), 1)
768
780
  ])) : D("", !0),
769
- o(f).isEnabled && d.transferType === o(ge).TRANSFER && !d.isTransferBetweenOutlets ? (l(), _("div", Bt, [
770
- r[2] || (r[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
771
- e("div", Mt, m(C.value), 1)
781
+ n(a).isEnabled && u.transferType === n(be).TRANSFER && !u.isTransferBetweenOutlets ? (c(), _("div", Bt, [
782
+ t[2] || (t[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
783
+ e("div", Mt, m(q.value), 1)
772
784
  ])) : D("", !0)
773
785
  ])) : D("", !0);
774
786
  };
@@ -784,15 +796,15 @@ const Ot = {
784
796
  isTransferBetweenOutlets: { type: Boolean }
785
797
  },
786
798
  setup(p) {
787
- const v = p, f = ze(), n = We(), S = Ye(), O = V(!1), $ = X(() => {
788
- var c, u, i, F;
789
- let d = !0;
790
- f.isEnabled || (d = !1);
791
- const r = v.purchaseOrder, a = v.poRequest;
792
- return r && ((c = r == null ? void 0 : r.supplier) != null && c.internal ? (!a && r.status == M.enum.DRAFT && (d = !1), a && !((u = a == null ? void 0 : a.netSuite) != null && u.id) && (d = !1), v.isTransferBetweenOutlets && (d = !1)) : ((r == null ? void 0 : r.status) !== M.enum.REQUESTING && r.supplier.internal && (d = !1), !a && !((i = r == null ? void 0 : r.netSuite) != null && i.id) && (d = !1), !a && ((F = r == null ? void 0 : r.netSuite) != null && F.id) && (r == null ? void 0 : r.status) == M.enum.REQUESTING && (d = !1))), d;
799
+ const v = p, a = ze(), i = We(), w = Ye(), x = K(!1), L = X(() => {
800
+ var l, d, f, F;
801
+ let u = !0;
802
+ a.isEnabled || (u = !1);
803
+ const t = v.purchaseOrder, o = v.poRequest;
804
+ return t && ((l = t == null ? void 0 : t.supplier) != null && l.internal ? (!o && t.status == j.enum.DRAFT && (u = !1), o && !((d = o == null ? void 0 : o.netSuite) != null && d.id) && (u = !1), v.isTransferBetweenOutlets && (u = !1)) : ((t == null ? void 0 : t.status) !== j.enum.REQUESTING && t.supplier.internal && (u = !1), !o && !((f = t == null ? void 0 : t.netSuite) != null && f.id) && (u = !1), !o && ((F = t == null ? void 0 : t.netSuite) != null && F.id) && (t == null ? void 0 : t.status) == j.enum.REQUESTING && (u = !1))), u;
793
805
  });
794
- async function C() {
795
- O.value || S.open({
806
+ async function q() {
807
+ x.value || w.open({
796
808
  title: "Sync with NetSuite",
797
809
  contentComponent: N("div", [
798
810
  N("p", "Are you sure you want to sync now?"),
@@ -810,45 +822,45 @@ const Ot = {
810
822
  },
811
823
  secondaryActions: { text: "Not now", close: !0 }
812
824
  }).onPrimary(async () => {
813
- var d;
825
+ var u;
814
826
  try {
815
- O.value = !0;
816
- const r = v.purchaseOrder, a = v.poRequest;
817
- let c = "purchaseOrder";
818
- if ((d = r == null ? void 0 : r.supplier) != null && d.internal && (c = "purchaseOrderRequest"), !(r != null && r._id)) {
819
- n.open({
827
+ x.value = !0;
828
+ const t = v.purchaseOrder, o = v.poRequest;
829
+ let l = "purchaseOrder";
830
+ if ((u = t == null ? void 0 : t.supplier) != null && u.internal && (l = "purchaseOrderRequest"), !(t != null && t._id)) {
831
+ i.open({
820
832
  title: "Error",
821
833
  message: "Invalid sync ID",
822
834
  type: "error"
823
835
  });
824
836
  return;
825
837
  }
826
- await f.syncTransferOrder(c, r == null ? void 0 : r._id, a == null ? void 0 : a._id), n.open({
838
+ await a.syncTransferOrder(l, t == null ? void 0 : t._id, o == null ? void 0 : o._id), i.open({
827
839
  title: "Sync with NetSuite",
828
840
  message: "Requested to sync with NetSuite. Please wait a moment.",
829
841
  type: "success"
830
842
  });
831
843
  } catch {
832
- n.open({
844
+ i.open({
833
845
  title: "Error",
834
846
  message: "Failed to sync with NetSuite",
835
847
  type: "error"
836
848
  });
837
849
  }
838
850
  setTimeout(() => {
839
- O.value = !1;
851
+ x.value = !1;
840
852
  }, 5e3);
841
853
  });
842
854
  }
843
- return (d, r) => {
844
- const a = ie("FmButton");
845
- return $.value ? (l(), _("div", Vt, [
846
- B(a, {
855
+ return (u, t) => {
856
+ const o = ce("FmButton");
857
+ return L.value ? (c(), _("div", Vt, [
858
+ B(o, {
847
859
  "prepend-icon": "sync",
848
860
  variant: "secondary",
849
861
  label: "Sync",
850
- loading: O.value,
851
- onClick: C,
862
+ loading: x.value,
863
+ onClick: q,
852
864
  "text-color": "primary",
853
865
  "bg-color": "transparent",
854
866
  "border-color": "primary"
@@ -874,13 +886,13 @@ const Ot = {
874
886
  }, vs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ys = { class: "fm-typo-en-body-lg-600" }, hs = {
875
887
  key: 0,
876
888
  class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
877
- }, gs = { class: "flex gap-8 items-center" }, bs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, _s = { class: "flex flex-col gap-8" }, Ss = { class: "flex gap-8 items-center" }, ws = { class: "flex-1 fm-typo-en-body-lg-600" }, xs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Rs = { class: "flex w-full gap-4" }, Os = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, ks = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Ds = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ns = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, As = {
889
+ }, gs = { class: "flex gap-8 items-center" }, bs = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, _s = { class: "flex flex-col gap-8" }, Ss = { class: "flex gap-8 items-center" }, ws = { class: "flex-1 fm-typo-en-body-lg-600" }, xs = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Os = { class: "flex w-full gap-4" }, ks = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Rs = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Ds = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Ns = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, As = {
878
890
  key: 0,
879
891
  class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
880
- }, qs = { class: "py-8" }, Ts = { class: "flex justify-end gap-4 items-center" }, Ps = { class: "fm-typo-en-body-lg-600" }, Cs = {
892
+ }, Ts = { class: "py-8" }, $s = { class: "flex justify-end gap-4 items-center" }, Ps = { class: "fm-typo-en-body-lg-600" }, Cs = {
881
893
  key: 1,
882
894
  class: "flex-1 xs:w-screen xs:max-w-full"
883
- }, $s = {
895
+ }, qs = {
884
896
  key: 0,
885
897
  class: "flex flex-col items-center gap-8 h-full"
886
898
  }, Es = ["src"], Is = { class: "fm-typo-en-body-lg-600" }, Ls = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, Fs = {
@@ -919,7 +931,7 @@ const Ot = {
919
931
  }, gr = { class: "flex-1 flex flex-col items-center" }, br = {
920
932
  class: "py-12 flex flex-col gap-4 flex-1",
921
933
  name: "delivery details"
922
- }, _r = { class: "flex flex-col gap-8" }, Sr = { class: "flex flex-col gap-4" }, wr = { class: "fm-typo-en-body-lg-600" }, xr = { class: "flex w-full gap-4" }, Rr = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Or = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, kr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Dr = { class: "grow fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" }, Nr = {
934
+ }, _r = { class: "flex flex-col gap-8" }, Sr = { class: "flex flex-col gap-4" }, wr = { class: "fm-typo-en-body-lg-600" }, xr = { class: "flex w-full gap-4" }, Or = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, kr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Rr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Dr = { class: "grow fm-typo-en-body-md-400 text-fm-color-typo-secondary line-clamp-1" }, Nr = {
923
935
  key: 0,
924
936
  class: "line-clamp-1 fm-typo-en-body-md-400 text-fm-color-typo-secondary"
925
937
  }, Ar = { class: "flex gap-8 xs:flex-col" }, Br = /* @__PURE__ */ Qe({
@@ -936,178 +948,178 @@ const Ot = {
936
948
  },
937
949
  emits: ["update:show", "submitted", "returnStock"],
938
950
  setup(p, { emit: v }) {
939
- const f = p, n = v, S = Ye(), O = We(), $ = nt(), C = ze(), d = Pe(), { t: r } = at(), a = X(
951
+ const a = p, i = v, w = Ye(), x = We(), L = nt(), q = ze(), u = Pe(), { t } = at(), o = X(
940
952
  () => {
941
- var t, s, x, R;
942
- return ((s = (t = f.purchaseOrder) == null ? void 0 : t.supplier) == null ? void 0 : s.internal) === "restaurant" || ((R = (x = f.purchaseOrder) == null ? void 0 : x.supplier) == null ? void 0 : R.internal) === "warehouse" ? ge.TRANSFER : ge.PURCHASE;
953
+ var s, r, O, k;
954
+ return ((r = (s = a.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : r.internal) === "restaurant" || ((k = (O = a.purchaseOrder) == null ? void 0 : O.supplier) == null ? void 0 : k.internal) === "warehouse" ? be.TRANSFER : be.PURCHASE;
943
955
  }
944
- ), c = X(() => {
945
- var t, s, x;
946
- return a.value === ge.TRANSFER && ((t = f.transferToDbName) == null ? void 0 : t.startsWith("restaurant")) && ((x = (s = f.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : x.internal) === "restaurant";
947
- }), u = V(!1), i = V(""), F = V(!0), U = Xe(), Y = wt(f, "show"), E = V(null), H = V({}), ue = X(() => E.value === null), we = V(""), se = X(() => {
948
- var s, x, R, T, P, K, g, w, I;
949
- if (!$.enableReturnStocks || !((x = (s = f.purchaseOrder) == null ? void 0 : s.supplier) != null && x.internal) || ((R = f.purchaseOrder) == null ? void 0 : R.status) !== M.enum.COMPLETE || !d.locationById[(P = (T = f.purchaseOrder) == null ? void 0 : T.supplier) == null ? void 0 : P._id]) return !1;
950
- if (!C.isEnabled) {
951
- const j = C.getNetSuiteLocation(
952
- (g = (K = f.purchaseOrder) == null ? void 0 : K.supplier) == null ? void 0 : g._id
953
- ), L = C.getLocationSubsidiary(j == null ? void 0 : j.id), W = C.getNetSuiteLocation(
954
- d.currentLocation.doc._id
955
- ), ae = C.getLocationSubsidiary(W == null ? void 0 : W.id);
956
- if ((L == null ? void 0 : L.id) !== (ae == null ? void 0 : ae.id)) return !1;
956
+ ), l = X(() => {
957
+ var s, r, O;
958
+ return o.value === be.TRANSFER && ((s = a.transferToDbName) == null ? void 0 : s.startsWith("restaurant")) && ((O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : O.internal) === "restaurant";
959
+ }), d = K(!1), f = K(""), F = K(!0), U = Xe(), J = wt(a, "show"), T = K(null), M = K({}), Y = X(() => T.value === null), de = K(""), Z = X(() => {
960
+ var r, O, k, P, C, G, g, S, E;
961
+ if (!L.enableReturnStocks || !((O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) != null && O.internal) || ((k = a.purchaseOrder) == null ? void 0 : k.status) !== j.enum.COMPLETE || !u.locationById[(C = (P = a.purchaseOrder) == null ? void 0 : P.supplier) == null ? void 0 : C._id]) return !1;
962
+ if (!q.isEnabled) {
963
+ const V = q.getNetSuiteLocation(
964
+ (g = (G = a.purchaseOrder) == null ? void 0 : G.supplier) == null ? void 0 : g._id
965
+ ), I = q.getLocationSubsidiary(V == null ? void 0 : V.id), W = q.getNetSuiteLocation(
966
+ u.currentLocation.doc._id
967
+ ), ne = q.getLocationSubsidiary(W == null ? void 0 : W.id);
968
+ if ((I == null ? void 0 : I.id) !== (ne == null ? void 0 : ne.id)) return !1;
957
969
  }
958
- return !!((I = (w = f.purchaseOrder) == null ? void 0 : w.deliveryOrder) != null && I.length);
959
- }), de = X(() => {
960
- const t = [
970
+ return !!((E = (S = a.purchaseOrder) == null ? void 0 : S.deliveryOrder) != null && E.length);
971
+ }), fe = X(() => {
972
+ const s = [
961
973
  {
962
- label: r("inventory.transfer.receiveRequest.details.overview"),
974
+ label: t("inventory.transfer.receiveRequest.details.overview"),
963
975
  value: "overview"
964
976
  },
965
977
  {
966
- label: r("inventory.transfer.receiveRequest.details.deliveryHistory"),
978
+ label: t("inventory.transfer.receiveRequest.details.deliveryHistory"),
967
979
  value: "deliveryHistory"
968
980
  }
969
981
  ];
970
- return se.value && t.push({
982
+ return Z.value && s.push({
971
983
  label: "Returns",
972
984
  value: "returns"
973
- }), t;
974
- }), z = V(de.value[0]);
985
+ }), s;
986
+ }), z = K(fe.value[0]);
975
987
  async function Ce() {
976
- var t, s, x, R, T;
977
- E.value = null, H.value = {};
988
+ var s, r, O, k, P;
989
+ T.value = null, M.value = {};
978
990
  try {
979
- const P = ((t = f.purchaseOrder) == null ? void 0 : t.returnPoIds) ?? [], K = new Array(), g = `${(x = (s = f.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : x.internal}_${(T = (R = f.purchaseOrder) == null ? void 0 : R.supplier) == null ? void 0 : T._id}`;
980
- for (const w of P) {
981
- const [I, j] = await Promise.all([
982
- U.getPurchaseOrderById(w, g),
983
- U.getLatestPurchaseOrderRequest(w, g)
991
+ const C = ((s = a.purchaseOrder) == null ? void 0 : s.returnPoIds) ?? [], G = new Array(), g = `${(O = (r = a.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : O.internal}_${(P = (k = a.purchaseOrder) == null ? void 0 : k.supplier) == null ? void 0 : P._id}`;
992
+ for (const S of C) {
993
+ const [E, V] = await Promise.all([
994
+ U.getPurchaseOrderById(S, g),
995
+ U.getLatestPurchaseOrderRequest(S, g)
984
996
  ]);
985
- K.push(I), j && (H.value[w] = j);
997
+ G.push(E), V && (M.value[S] = V);
986
998
  }
987
- K.sort((w, I) => I._id.localeCompare(w._id)), E.value = K;
988
- } catch (P) {
989
- console.error("error on fetching return orders", P), we.value = `Something went wrong while retrieving returns. ${(P == null ? void 0 : P.message) ?? P}`, E.value = [];
999
+ G.sort((S, E) => E._id.localeCompare(S._id)), T.value = G;
1000
+ } catch (C) {
1001
+ console.error("error on fetching return orders", C), de.value = `Something went wrong while retrieving returns. ${(C == null ? void 0 : C.message) ?? C}`, T.value = [];
990
1002
  }
991
1003
  }
992
1004
  ht(
993
- () => f.show,
994
- (t) => {
995
- t && (z.value = de.value[0], Ce());
1005
+ () => a.show,
1006
+ (s) => {
1007
+ s && (z.value = fe.value[0], Ce());
996
1008
  }
997
1009
  );
998
- async function Ie(t, s, x) {
999
- i.value = `${s}`, u.value = !0, F.value = !1;
1010
+ async function Ie(s, r, O) {
1011
+ f.value = `${r}`, d.value = !0, F.value = !1;
1000
1012
  try {
1001
1013
  await U.processPurchaseOrder(
1002
1014
  {
1003
- operation: s,
1004
- doc: t,
1015
+ operation: r,
1016
+ doc: s,
1005
1017
  options: (
1006
1018
  // auto receive for supplier to warehouse
1007
- (s === k.enum.confirmDraft || // auto receive for warehouse to warehouse
1008
- s === k.enum.completeReceive) && $.autoReceiveWarehouse ? {
1019
+ (r === R.enum.confirmDraft || // auto receive for warehouse to warehouse
1020
+ r === R.enum.completeReceive) && L.autoReceiveWarehouse ? {
1009
1021
  autoReceive: !0
1010
1022
  } : void 0
1011
1023
  )
1012
1024
  },
1013
- f.transferToDbName
1014
- ), await new Promise((R) => setTimeout(R, 1e3)), O.open({
1025
+ a.transferToDbName
1026
+ ), await new Promise((k) => setTimeout(k, 1e3)), x.open({
1015
1027
  title: "Success",
1016
- message: x,
1028
+ message: O,
1017
1029
  type: "success"
1018
- }), n("update:show", !1), n("submitted");
1019
- } catch (R) {
1020
- O.open({
1030
+ }), i("update:show", !1), i("submitted");
1031
+ } catch (k) {
1032
+ x.open({
1021
1033
  title: "Something went wrong",
1022
1034
  message: "Please try again.",
1023
1035
  type: "error"
1024
- }), console.error("Error when submitting PO operation", s, t, R);
1036
+ }), console.error("Error when submitting PO operation", r, s, k);
1025
1037
  } finally {
1026
- i.value = "", u.value = !1, F.value = !0;
1038
+ f.value = "", d.value = !1, F.value = !0;
1027
1039
  }
1028
1040
  }
1029
- async function re(t) {
1030
- if (t === k.enum.returnStock) {
1031
- f.purchaseOrder && n("returnStock", f.purchaseOrder), n("update:show", !1);
1041
+ async function ae(s) {
1042
+ if (s === R.enum.returnStock) {
1043
+ a.purchaseOrder && i("returnStock", a.purchaseOrder), i("update:show", !1);
1032
1044
  return;
1033
1045
  }
1034
- if (t === k.enum.receiveStock)
1046
+ if (s === R.enum.receiveStock)
1035
1047
  return;
1036
- const s = ot[t];
1037
- if (!s) {
1038
- O.open({
1048
+ const r = ot[s];
1049
+ if (!r) {
1050
+ x.open({
1039
1051
  title: "Something went wrong",
1040
- message: `Cannot process order: ${st(t)}`,
1052
+ message: `Cannot process order: ${st(s)}`,
1041
1053
  type: "error"
1042
1054
  });
1043
1055
  return;
1044
1056
  }
1045
- const { successMessage: x, ...R } = s;
1046
- S.open({
1047
- title: R.title,
1048
- message: R.message,
1049
- primaryActions: R.primaryActions
1057
+ const { successMessage: O, ...k } = r;
1058
+ w.open({
1059
+ title: k.title,
1060
+ message: k.message,
1061
+ primaryActions: k.primaryActions
1050
1062
  }).onPrimary(() => {
1051
- f.purchaseOrder && Ie(f.purchaseOrder, t, x);
1063
+ a.purchaseOrder && Ie(a.purchaseOrder, s, O);
1052
1064
  });
1053
1065
  }
1054
1066
  const Le = X(() => {
1055
- var t, s;
1056
- return ((t = f.purchaseOrder) == null ? void 0 : t.status) === M.enum.RECEIVING || ((s = f.purchaseOrder) == null ? void 0 : s.status) === M.enum.COMPLETE;
1067
+ var s, r;
1068
+ return ((s = a.purchaseOrder) == null ? void 0 : s.status) === j.enum.RECEIVING || ((r = a.purchaseOrder) == null ? void 0 : r.status) === j.enum.COMPLETE;
1057
1069
  }), Fe = X(() => {
1058
- var P, K, g;
1059
- const x = (((P = f.purchaseOrder) == null ? void 0 : P.deliveryOrder) ?? []).flatMap((w) => w.received ?? []).reduce(
1060
- (w, I) => {
1061
- const j = w[I.sku._id] ?? [];
1062
- return w[I.sku._id] = [...j, I], w;
1070
+ var C, G, g;
1071
+ const O = (((C = a.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? []).flatMap((S) => S.received ?? []).reduce(
1072
+ (S, E) => {
1073
+ const V = S[E.sku._id] ?? [];
1074
+ return S[E.sku._id] = [...V, E], S;
1063
1075
  },
1064
1076
  {}
1065
- ), R = Object.entries(x).reduce(
1066
- (w, [I, j]) => {
1067
- const L = j.reduce((W, ae) => {
1068
- const ne = pt(
1077
+ ), k = Object.entries(O).reduce(
1078
+ (S, [E, V]) => {
1079
+ const I = V.reduce((W, ne) => {
1080
+ const oe = pt(
1069
1081
  W,
1070
- Math.max(W.precision, ae.amount.precision)
1082
+ Math.max(W.precision, ne.amount.precision)
1071
1083
  );
1072
- return Ke(ne, ae.amount);
1073
- }, $e(0));
1074
- return w[I] = L, w;
1084
+ return Ke(oe, ne.amount);
1085
+ }, qe(0));
1086
+ return S[E] = I, S;
1075
1087
  },
1076
1088
  {}
1077
- ), T = ((K = f.purchaseOrder) == null ? void 0 : K.items) ?? [];
1078
- for (const w of T)
1079
- R[g = w.sku._id] ?? (R[g] = $e(0));
1080
- return R;
1089
+ ), P = ((G = a.purchaseOrder) == null ? void 0 : G.items) ?? [];
1090
+ for (const S of P)
1091
+ k[g = S.sku._id] ?? (k[g] = qe(0));
1092
+ return k;
1081
1093
  }), y = X(() => {
1082
- var P, K;
1083
- const t = ((P = f.purchaseOrder) == null ? void 0 : P.deliveryOrder) ?? [], s = ((K = f.purchaseOrder) == null ? void 0 : K.deliveryFullfillment) ?? [], x = [
1084
- ...t.map((g) => ({
1094
+ var C, G;
1095
+ const s = ((C = a.purchaseOrder) == null ? void 0 : C.deliveryOrder) ?? [], r = ((G = a.purchaseOrder) == null ? void 0 : G.deliveryFullfillment) ?? [], O = [
1096
+ ...s.map((g) => ({
1085
1097
  createdAt: g.createdAt,
1086
1098
  type: "grn",
1087
1099
  doc: g
1088
1100
  })),
1089
- ...s.map((g) => ({
1101
+ ...r.map((g) => ({
1090
1102
  createdAt: g.createdAt,
1091
1103
  type: "fulfillment",
1092
1104
  doc: g
1093
1105
  }))
1094
1106
  ];
1095
- x.reverse().sort((g, w) => g.createdAt.localeCompare(w.createdAt));
1096
- function R(g) {
1097
- var I, j, L, W, ae, ne, fe;
1098
- const w = s.findIndex((G) => G.id === g.fullfillmentId);
1107
+ O.reverse().sort((g, S) => g.createdAt.localeCompare(S.createdAt));
1108
+ function k(g) {
1109
+ var E, V, I, W, ne, oe, me;
1110
+ const S = r.findIndex((H) => H.id === g.fullfillmentId);
1099
1111
  return {
1100
1112
  header: "Received",
1101
1113
  date: Me(new Date(g.createdAt)),
1102
1114
  info: [
1103
1115
  {
1104
1116
  label: "Received by",
1105
- values: [(I = g.createdBy) == null ? void 0 : I.name]
1117
+ values: [(E = g.createdBy) == null ? void 0 : E.name]
1106
1118
  },
1107
1119
  {
1108
1120
  label: "Received items",
1109
- values: g.received.map((G) => {
1110
- var me;
1121
+ values: g.received.map((H) => {
1122
+ var pe;
1111
1123
  return N("div", [
1112
1124
  N(
1113
1125
  "div",
@@ -1126,14 +1138,14 @@ const Ot = {
1126
1138
  {
1127
1139
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
1128
1140
  },
1129
- `${G.sku.name}`
1141
+ `${H.sku.name}`
1130
1142
  ),
1131
1143
  N(
1132
1144
  "span",
1133
1145
  {
1134
1146
  class: "fm-typo-en-body-md-400"
1135
1147
  },
1136
- `${G.sku.code} `
1148
+ `${H.sku.code} `
1137
1149
  )
1138
1150
  ]
1139
1151
  ),
@@ -1154,14 +1166,14 @@ const Ot = {
1154
1166
  {
1155
1167
  class: "fm-typo-en-body-lg-600 self-end"
1156
1168
  },
1157
- Re(G.amount, !1)
1169
+ Oe(H.amount, !1)
1158
1170
  ),
1159
1171
  N(
1160
1172
  "span",
1161
1173
  {
1162
1174
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1163
1175
  },
1164
- ((me = G.measurement) == null ? void 0 : me.abbrev) ?? G.sku.unit.abbrev
1176
+ ((pe = H.measurement) == null ? void 0 : pe.abbrev) ?? H.sku.unit.abbrev
1165
1177
  )
1166
1178
  ]
1167
1179
  ),
@@ -1170,7 +1182,7 @@ const Ot = {
1170
1182
  {
1171
1183
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1172
1184
  },
1173
- `${G.cost ? `(${Te(G.cost)})` : ""}`
1185
+ `${H.cost ? `(${$e(H.cost)})` : ""}`
1174
1186
  )
1175
1187
  ]
1176
1188
  )
@@ -1187,35 +1199,35 @@ const Ot = {
1187
1199
  label: "Remark",
1188
1200
  values: [g.remark]
1189
1201
  } : null,
1190
- w > -1 ? {
1202
+ S > -1 ? {
1191
1203
  label: "Fulfilment's sequence",
1192
- values: [`${w + 1}`]
1204
+ values: [`${S + 1}`]
1193
1205
  } : null,
1194
- (L = (j = s[w]) == null ? void 0 : j.netSuite) != null && L.refNo ? {
1206
+ (I = (V = r[S]) == null ? void 0 : V.netSuite) != null && I.refNo ? {
1195
1207
  label: "Fulfillment's ref no. (Netsuite)",
1196
- values: [(ae = (W = s[w]) == null ? void 0 : W.netSuite) == null ? void 0 : ae.refNo]
1208
+ values: [(ne = (W = r[S]) == null ? void 0 : W.netSuite) == null ? void 0 : ne.refNo]
1197
1209
  } : null,
1198
- (ne = g == null ? void 0 : g.netSuite) != null && ne.refNo ? {
1210
+ (oe = g == null ? void 0 : g.netSuite) != null && oe.refNo ? {
1199
1211
  label: "Item receipt (Netsuite)",
1200
- values: [(fe = g == null ? void 0 : g.netSuite) == null ? void 0 : fe.refNo]
1212
+ values: [(me = g == null ? void 0 : g.netSuite) == null ? void 0 : me.refNo]
1201
1213
  } : null
1202
- ].filter((G) => G)
1214
+ ].filter((H) => H)
1203
1215
  };
1204
1216
  }
1205
- function T(g) {
1206
- var I, j;
1207
- const w = s.findIndex((L) => L.id === g.id);
1217
+ function P(g) {
1218
+ var E, V;
1219
+ const S = r.findIndex((I) => I.id === g.id);
1208
1220
  return {
1209
1221
  header: "Fulfillment",
1210
1222
  date: Me(new Date(g.createdAt)),
1211
1223
  info: [
1212
1224
  {
1213
1225
  label: "Sequence",
1214
- values: [String(w + 1)]
1226
+ values: [String(S + 1)]
1215
1227
  },
1216
1228
  {
1217
1229
  label: "Receiveable items",
1218
- values: g.items.map((L) => {
1230
+ values: g.items.map((I) => {
1219
1231
  var W;
1220
1232
  return N("div", [
1221
1233
  N(
@@ -1235,14 +1247,14 @@ const Ot = {
1235
1247
  {
1236
1248
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
1237
1249
  },
1238
- `${L.sku.name}`
1250
+ `${I.sku.name}`
1239
1251
  ),
1240
1252
  N(
1241
1253
  "span",
1242
1254
  {
1243
1255
  class: "fm-typo-en-body-md-400"
1244
1256
  },
1245
- `${L.sku.code} `
1257
+ `${I.sku.code} `
1246
1258
  )
1247
1259
  ]
1248
1260
  ),
@@ -1263,14 +1275,14 @@ const Ot = {
1263
1275
  {
1264
1276
  class: "fm-typo-en-body-lg-600 self-end"
1265
1277
  },
1266
- Re(L.amount, !1)
1278
+ Oe(I.amount, !1)
1267
1279
  ),
1268
1280
  N(
1269
1281
  "span",
1270
1282
  {
1271
1283
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1272
1284
  },
1273
- ((W = L.measurement) == null ? void 0 : W.abbrev) ?? L.sku.unit.abbrev
1285
+ ((W = I.measurement) == null ? void 0 : W.abbrev) ?? I.sku.unit.abbrev
1274
1286
  )
1275
1287
  ]
1276
1288
  ),
@@ -1279,7 +1291,7 @@ const Ot = {
1279
1291
  {
1280
1292
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1281
1293
  },
1282
- `${L.cost ? `(${Te(L.cost)})` : ""}`
1294
+ `${I.cost ? `(${$e(I.cost)})` : ""}`
1283
1295
  )
1284
1296
  ]
1285
1297
  )
@@ -1288,106 +1300,106 @@ const Ot = {
1288
1300
  ]);
1289
1301
  })
1290
1302
  },
1291
- (I = g.netSuite) != null && I.refNo ? {
1303
+ (E = g.netSuite) != null && E.refNo ? {
1292
1304
  label: "Ref no. (Netsuite)",
1293
- values: [(j = g.netSuite) == null ? void 0 : j.refNo]
1305
+ values: [(V = g.netSuite) == null ? void 0 : V.refNo]
1294
1306
  } : null
1295
- ].filter((L) => L)
1307
+ ].filter((I) => I)
1296
1308
  };
1297
1309
  }
1298
- return x.map((g) => {
1310
+ return O.map((g) => {
1299
1311
  switch (g.type) {
1300
1312
  case "grn":
1301
- return R(g.doc);
1313
+ return k(g.doc);
1302
1314
  case "fulfillment":
1303
- return T(g.doc);
1315
+ return P(g.doc);
1304
1316
  }
1305
1317
  });
1306
1318
  }), h = X(() => {
1307
- var s;
1308
- const t = {
1309
- ...$e(0),
1319
+ var r;
1320
+ const s = {
1321
+ ...qe(0),
1310
1322
  currency: Ze()
1311
1323
  };
1312
- return ((s = f.purchaseOrder) == null ? void 0 : s.items.reduce((x, R) => ({
1313
- ...Ke(x, R.totalCost ?? t),
1324
+ return ((r = a.purchaseOrder) == null ? void 0 : r.items.reduce((O, k) => ({
1325
+ ...Ke(O, k.totalCost ?? s),
1314
1326
  currency: Ze()
1315
- }), t)) ?? t;
1327
+ }), s)) ?? s;
1316
1328
  });
1317
- return (t, s) => {
1318
- var W, ae;
1319
- const x = ie("FmButtonGroup"), R = ie("FmChip"), T = ie("FmMenuDivider"), P = ie("FmCard"), K = ie("FmIcon"), g = ie("FmTooltip"), w = ie("FmButton"), I = ie("FmSpacer"), j = ie("FmCircularProgress"), L = ie("FmSideSheet");
1320
- return l(), ee(L, {
1321
- header: o(r)("inventory.transfer.receiveRequest.details.title") + ((W = t.purchaseOrder) != null && W.seqNumber ? ` #${(ae = t.purchaseOrder) == null ? void 0 : ae.seqNumber}` : ""),
1322
- modelValue: o(Y),
1323
- "onUpdate:modelValue": s[11] || (s[11] = (ne) => gt(Y) ? Y.value = ne : null),
1329
+ return (s, r) => {
1330
+ var W, ne;
1331
+ const O = ce("FmButtonGroup"), k = ce("FmChip"), P = ce("FmMenuDivider"), C = ce("FmCard"), G = ce("FmIcon"), g = ce("FmTooltip"), S = ce("FmButton"), E = ce("FmSpacer"), V = ce("FmCircularProgress"), I = ce("FmSideSheet");
1332
+ return c(), se(I, {
1333
+ header: n(t)("inventory.transfer.receiveRequest.details.title") + ((W = s.purchaseOrder) != null && W.seqNumber ? ` #${(ne = s.purchaseOrder) == null ? void 0 : ne.seqNumber}` : ""),
1334
+ modelValue: n(J),
1335
+ "onUpdate:modelValue": r[11] || (r[11] = (oe) => gt(J) ? J.value = oe : null),
1324
1336
  "dismiss-away": F.value,
1325
1337
  "close-button": "",
1326
1338
  "max-width": 600
1327
1339
  }, {
1328
- default: be(() => {
1329
- var ne, fe, G, me, Oe, ke, De, Ne;
1340
+ default: _e(() => {
1341
+ var oe, me, H, pe, ke, Re, De, Ne;
1330
1342
  return [
1331
1343
  e("div", Gt, [
1332
1344
  e("div", null, [
1333
- B(x, {
1334
- items: de.value,
1345
+ B(O, {
1346
+ items: fe.value,
1335
1347
  modelValue: z.value,
1336
- "onUpdate:modelValue": s[0] || (s[0] = (b) => z.value = b)
1348
+ "onUpdate:modelValue": r[0] || (r[0] = (b) => z.value = b)
1337
1349
  }, null, 8, ["items", "modelValue"])
1338
1350
  ]),
1339
- z.value.value === "overview" ? (l(), _(te, { key: 0 }, [
1351
+ z.value.value === "overview" ? (c(), _(re, { key: 0 }, [
1340
1352
  e("div", null, [
1341
- B(P, {
1353
+ B(C, {
1342
1354
  variant: "outlined",
1343
1355
  class: "flex flex-col gap-8 px-12 py-16"
1344
1356
  }, {
1345
- default: be(() => {
1346
- var b, A, q, oe, le, ce, pe, ve, J, ye, Ae, qe;
1357
+ default: _e(() => {
1358
+ var b, A, $, le, ie, ue, ve, ye, ee, he, Ae, Te;
1347
1359
  return [
1348
1360
  e("div", Ht, [
1349
- e("div", zt, m(o(r)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1361
+ e("div", zt, m(n(t)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1350
1362
  e("div", null, [
1351
- B(R, {
1352
- label: o(r)(`inventory.transfer.status.${(b = t.purchaseOrder) == null ? void 0 : b.status}`),
1353
- class: he(`fm-status-badge fm-status-badge-${(q = (A = t.purchaseOrder) == null ? void 0 : A.status) == null ? void 0 : q.toLocaleLowerCase("en-us")}`),
1363
+ B(k, {
1364
+ label: n(t)(`inventory.transfer.status.${(b = s.purchaseOrder) == null ? void 0 : b.status}`),
1365
+ class: ge(`fm-status-badge fm-status-badge-${($ = (A = s.purchaseOrder) == null ? void 0 : A.status) == null ? void 0 : $.toLocaleLowerCase("en-us")}`),
1354
1366
  compact: ""
1355
1367
  }, null, 8, ["label", "class"])
1356
1368
  ])
1357
1369
  ]),
1358
- B(T),
1370
+ B(P),
1359
1371
  e("div", Qt, [
1360
1372
  e("div", Yt, [
1361
1373
  e("div", Wt, [
1362
- e("div", Xt, m(o(r)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1374
+ e("div", Xt, m(n(t)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1363
1375
  ]),
1364
- e("div", Jt, m(o(Ee)(((oe = t.purchaseOrder) == null ? void 0 : oe._id) ?? "")), 1)
1376
+ e("div", Jt, m(n(Ee)(((le = s.purchaseOrder) == null ? void 0 : le._id) ?? "")), 1)
1365
1377
  ]),
1366
- (le = t.purchaseOrder) != null && le.effectiveAt ? (l(), _("div", Zt, [
1367
- e("div", es, m(o(r)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1368
- e("div", ts, m(o(rt)(new Date((ce = t.purchaseOrder) == null ? void 0 : ce.effectiveAt))), 1)
1378
+ (ie = s.purchaseOrder) != null && ie.effectiveAt ? (c(), _("div", Zt, [
1379
+ e("div", es, m(n(t)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1380
+ e("div", ts, m(n(rt)(new Date((ue = s.purchaseOrder) == null ? void 0 : ue.effectiveAt))), 1)
1369
1381
  ])) : D("", !0),
1370
1382
  e("div", ss, [
1371
- e("div", rs, m(o(r)("inventory.transfer.receiveRequest.details.type.title")), 1),
1372
- e("div", as, m(o(r)(
1373
- `inventory.transfer.receiveRequest.details.type.${a.value.toLocaleLowerCase("en-US")}`
1383
+ e("div", rs, m(n(t)("inventory.transfer.receiveRequest.details.type.title")), 1),
1384
+ e("div", as, m(n(t)(
1385
+ `inventory.transfer.receiveRequest.details.type.${o.value.toLocaleLowerCase("en-US")}`
1374
1386
  )), 1)
1375
1387
  ]),
1376
- (ve = (pe = t.purchaseOrder) == null ? void 0 : pe.supplier) != null && ve.name ? (l(), _("div", ns, [
1377
- e("div", os, m(o(r)("inventory.transfer.receiveRequest.details.from")), 1),
1378
- e("div", ls, m((ye = (J = t.purchaseOrder) == null ? void 0 : J.supplier) == null ? void 0 : ye.name), 1)
1388
+ (ye = (ve = s.purchaseOrder) == null ? void 0 : ve.supplier) != null && ye.name ? (c(), _("div", ns, [
1389
+ e("div", os, m(n(t)("inventory.transfer.receiveRequest.details.from")), 1),
1390
+ e("div", ls, m((he = (ee = s.purchaseOrder) == null ? void 0 : ee.supplier) == null ? void 0 : he.name), 1)
1379
1391
  ])) : D("", !0),
1380
- t.transferTo ? (l(), _("div", is, [
1381
- e("div", cs, m(o(r)("inventory.transfer.receiveRequest.details.to")), 1),
1382
- e("div", us, m(t.transferTo), 1)
1392
+ s.transferTo ? (c(), _("div", is, [
1393
+ e("div", cs, m(n(t)("inventory.transfer.receiveRequest.details.to")), 1),
1394
+ e("div", us, m(s.transferTo), 1)
1383
1395
  ])) : D("", !0),
1384
- (Ae = t.purchaseOrder) != null && Ae.ref ? (l(), _("div", ds, [
1385
- e("div", fs, m(o(r)("inventory.transfer.receiveRequest.details.reference")), 1),
1386
- e("div", ms, m(t.purchaseOrder.ref), 1)
1396
+ (Ae = s.purchaseOrder) != null && Ae.ref ? (c(), _("div", ds, [
1397
+ e("div", fs, m(n(t)("inventory.transfer.receiveRequest.details.reference")), 1),
1398
+ e("div", ms, m(s.purchaseOrder.ref), 1)
1387
1399
  ])) : D("", !0),
1388
- (qe = t.purchaseOrder) != null && qe.remark ? (l(), _("div", ps, [
1389
- e("div", vs, m(o(r)("inventory.transfer.receiveRequest.details.remark")), 1),
1390
- e("div", ys, m(t.purchaseOrder.remark), 1)
1400
+ (Te = s.purchaseOrder) != null && Te.remark ? (c(), _("div", ps, [
1401
+ e("div", vs, m(n(t)("inventory.transfer.receiveRequest.details.remark")), 1),
1402
+ e("div", ys, m(s.purchaseOrder.remark), 1)
1391
1403
  ])) : D("", !0)
1392
1404
  ])
1393
1405
  ];
@@ -1395,57 +1407,57 @@ const Ot = {
1395
1407
  _: 1
1396
1408
  })
1397
1409
  ]),
1398
- c.value ? D("", !0) : (l(), _("div", hs, [
1410
+ l.value ? D("", !0) : (c(), _("div", hs, [
1399
1411
  e("div", gs, [
1400
- s[12] || (s[12] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1412
+ r[12] || (r[12] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1401
1413
  e("div", null, [
1402
1414
  B(Kt, {
1403
- "po-request": t.poRequest,
1404
- "purchase-order": t.purchaseOrder,
1405
- "is-transfer-between-outlets": c.value
1415
+ "po-request": s.poRequest,
1416
+ "purchase-order": s.purchaseOrder,
1417
+ "is-transfer-between-outlets": l.value
1406
1418
  }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
1407
1419
  ])
1408
1420
  ]),
1409
- B(T),
1421
+ B(P),
1410
1422
  B(jt, {
1411
- "po-request": t.poRequest,
1412
- "purchase-order": t.purchaseOrder,
1413
- "transfer-type": a.value,
1414
- "transfer-to-db-name": t.transferToDbName,
1415
- "is-transfer-between-outlets": c.value,
1416
- scope: t.scope
1423
+ "po-request": s.poRequest,
1424
+ "purchase-order": s.purchaseOrder,
1425
+ "transfer-type": o.value,
1426
+ "transfer-to-db-name": s.transferToDbName,
1427
+ "is-transfer-between-outlets": l.value,
1428
+ scope: s.scope
1417
1429
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
1418
1430
  ])),
1419
1431
  e("div", bs, [
1420
1432
  e("div", _s, [
1421
1433
  e("div", Ss, [
1422
1434
  e("span", ws, [
1423
- je(m(Le.value ? o(r)("inventory.transfer.receiveRequest.details.receivedItems") : o(r)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1424
- (fe = (ne = t.purchaseOrder) == null ? void 0 : ne.netSuite) != null && fe.missingItems && ((me = (G = t.purchaseOrder) == null ? void 0 : G.netSuite) == null ? void 0 : me.missingItems.length) > 0 ? (l(), ee(g, {
1435
+ je(m(Le.value ? n(t)("inventory.transfer.receiveRequest.details.receivedItems") : n(t)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1436
+ (me = (oe = s.purchaseOrder) == null ? void 0 : oe.netSuite) != null && me.missingItems && ((pe = (H = s.purchaseOrder) == null ? void 0 : H.netSuite) == null ? void 0 : pe.missingItems.length) > 0 ? (c(), se(g, {
1425
1437
  key: 0,
1426
1438
  variant: "rich",
1427
1439
  placement: "top",
1428
1440
  "z-index": 51
1429
1441
  }, {
1430
- content: be(() => {
1442
+ content: _e(() => {
1431
1443
  var b, A;
1432
1444
  return [
1433
1445
  e("div", xs, [
1434
- (l(!0), _(te, null, _e((A = (b = t.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : A.missingItems, (q, oe) => (l(), _("div", {
1446
+ (c(!0), _(re, null, Se((A = (b = s.purchaseOrder) == null ? void 0 : b.netSuite) == null ? void 0 : A.missingItems, ($, le) => (c(), _("div", {
1435
1447
  class: "flex justify-center align-middle",
1436
- key: oe
1448
+ key: le
1437
1449
  }, [
1438
- B(K, {
1450
+ B(G, {
1439
1451
  name: "arrow_right",
1440
1452
  size: "sm"
1441
1453
  }),
1442
- je(" " + m(`(${q.netSuiteId}) ${q.name}: ${q.reason}`), 1)
1454
+ je(" " + m(`(${$.netSuiteId}) ${$.name}: ${$.reason}`), 1)
1443
1455
  ]))), 128))
1444
1456
  ])
1445
1457
  ];
1446
1458
  }),
1447
- default: be(() => [
1448
- B(K, {
1459
+ default: _e(() => [
1460
+ B(G, {
1449
1461
  name: "error",
1450
1462
  color: "#ff2c2c",
1451
1463
  size: "sm"
@@ -1455,13 +1467,13 @@ const Ot = {
1455
1467
  })) : D("", !0)
1456
1468
  ]),
1457
1469
  e("div", null, [
1458
- se.value && E.value != null && !((Oe = E.value) != null && Oe.length) ? (l(), ee(w, {
1470
+ Z.value && T.value != null && !((ke = T.value) != null && ke.length) ? (c(), se(S, {
1459
1471
  key: 0,
1460
1472
  label: "Return",
1461
1473
  variant: "secondary",
1462
- onClick: s[1] || (s[1] = (b) => re("returnStock")),
1463
- loading: i.value === "returnStock",
1464
- disabled: i.value !== "returnStock" && u.value,
1474
+ onClick: r[1] || (r[1] = (b) => ae("returnStock")),
1475
+ loading: f.value === "returnStock",
1476
+ disabled: f.value !== "returnStock" && d.value,
1465
1477
  "prepend-icon": "undo",
1466
1478
  "text-color": "primary",
1467
1479
  "bg-color": "transparent",
@@ -1469,42 +1481,42 @@ const Ot = {
1469
1481
  }, null, 8, ["loading", "disabled"])) : D("", !0)
1470
1482
  ])
1471
1483
  ]),
1472
- B(T),
1473
- (l(!0), _(te, null, _e(((ke = t.purchaseOrder) == null ? void 0 : ke.items) ?? [], (b) => {
1484
+ B(P),
1485
+ (c(!0), _(re, null, Se(((Re = s.purchaseOrder) == null ? void 0 : Re.items) ?? [], (b) => {
1474
1486
  var A;
1475
- return l(), _("div", {
1487
+ return c(), _("div", {
1476
1488
  key: b.code,
1477
1489
  class: "flex flex-col"
1478
1490
  }, [
1479
- e("div", Rs, [
1480
- e("div", Os, m(b.name), 1),
1481
- e("div", ks, m(o(Re)(Fe.value[b.sku._id], !1)) + "/" + m(o(Ge)(b.quantity, b.sku.unit, b.measurement)), 1)
1491
+ e("div", Os, [
1492
+ e("div", ks, m(b.name), 1),
1493
+ e("div", Rs, m(n(Oe)(Fe.value[b.sku._id], !1)) + "/" + m(n(Ge)(b.quantity, b.sku.unit, b.measurement)), 1)
1482
1494
  ]),
1483
1495
  e("div", Ds, [
1484
1496
  e("div", Ns, m(b.code), 1),
1485
- (A = b.totalCost) != null && A.amount && o($).enableTotalCost ? (l(), _("div", As, " (" + m(o(Te)(b.totalCost)) + ") ", 1)) : D("", !0)
1497
+ (A = b.totalCost) != null && A.amount && n(L).enableTotalCost ? (c(), _("div", As, " (" + m(n($e)(b.totalCost)) + ") ", 1)) : D("", !0)
1486
1498
  ])
1487
1499
  ]);
1488
1500
  }), 128)),
1489
- +o(Re)(h.value) ? (l(), _(te, { key: 0 }, [
1490
- e("div", qs, [
1491
- B(T)
1492
- ]),
1501
+ +n(Oe)(h.value) ? (c(), _(re, { key: 0 }, [
1493
1502
  e("div", Ts, [
1494
- s[13] || (s[13] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
1495
- e("div", Ps, m(o(Te)(h.value)), 1)
1503
+ B(P)
1504
+ ]),
1505
+ e("div", $s, [
1506
+ r[13] || (r[13] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
1507
+ e("div", Ps, m(n($e)(h.value)), 1)
1496
1508
  ])
1497
1509
  ], 64)) : D("", !0)
1498
1510
  ])
1499
1511
  ])
1500
- ], 64)) : z.value.value === "deliveryHistory" ? (l(), _("div", Cs, [
1501
- y.value.length ? (l(), _("div", Fs, [
1502
- (l(!0), _(te, null, _e(y.value, (b, A) => (l(), _(te, { key: A }, [
1512
+ ], 64)) : z.value.value === "deliveryHistory" ? (c(), _("div", Cs, [
1513
+ y.value.length ? (c(), _("div", Fs, [
1514
+ (c(!0), _(re, null, Se(y.value, (b, A) => (c(), _(re, { key: A }, [
1503
1515
  e("div", Us, [
1504
1516
  e("div", Bs, [
1505
1517
  e("div", Ms, [
1506
1518
  e("div", {
1507
- class: he([
1519
+ class: ge([
1508
1520
  {
1509
1521
  "bg-fm-color-primary": A !== 0,
1510
1522
  "bg-white": A === 0
@@ -1513,10 +1525,10 @@ const Ot = {
1513
1525
  ])
1514
1526
  }, null, 2)
1515
1527
  ]),
1516
- s[14] || (s[14] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1528
+ r[14] || (r[14] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1517
1529
  e("div", js, [
1518
1530
  e("div", {
1519
- class: he([
1531
+ class: ge([
1520
1532
  {
1521
1533
  "bg-fm-color-primary": A < y.value.length - 1,
1522
1534
  "bg-white": A >= y.value.length - 1
@@ -1535,7 +1547,7 @@ const Ot = {
1535
1547
  e("div", zs, [
1536
1548
  e("div", Qs, [
1537
1549
  e("div", {
1538
- class: he([
1550
+ class: ge([
1539
1551
  {
1540
1552
  "bg-fm-color-primary": A < y.value.length - 1,
1541
1553
  "bg-white": A >= y.value.length - 1
@@ -1546,25 +1558,25 @@ const Ot = {
1546
1558
  ])
1547
1559
  ]),
1548
1560
  e("div", Ys, [
1549
- B(P, {
1561
+ B(C, {
1550
1562
  variant: "outlined",
1551
1563
  class: "py-12 px-16"
1552
1564
  }, {
1553
- default: be(() => [
1565
+ default: _e(() => [
1554
1566
  e("div", Ws, [
1555
- (l(!0), _(te, null, _e(b.info, (q, oe) => (l(), _("div", {
1556
- key: oe,
1567
+ (c(!0), _(re, null, Se(b.info, ($, le) => (c(), _("div", {
1568
+ key: le,
1557
1569
  class: "flex flex-col gap-4"
1558
1570
  }, [
1559
- e("div", Xs, m(q == null ? void 0 : q.label), 1),
1571
+ e("div", Xs, m($ == null ? void 0 : $.label), 1),
1560
1572
  e("div", Js, [
1561
- (l(!0), _(te, null, _e(q == null ? void 0 : q.values, (le, ce) => (l(), _("div", {
1562
- key: ce,
1573
+ (c(!0), _(re, null, Se($ == null ? void 0 : $.values, (ie, ue) => (c(), _("div", {
1574
+ key: ue,
1563
1575
  class: "fm-typo-en-body-lg-600"
1564
1576
  }, [
1565
- typeof le == "string" ? (l(), _(te, { key: 0 }, [
1566
- je(m(le), 1)
1567
- ], 64)) : (l(), ee(bt(le), { key: 1 }))
1577
+ typeof ie == "string" ? (c(), _(re, { key: 0 }, [
1578
+ je(m(ie), 1)
1579
+ ], 64)) : (c(), se(bt(ie), { key: 1 }))
1568
1580
  ]))), 128))
1569
1581
  ])
1570
1582
  ]))), 128))
@@ -1575,33 +1587,33 @@ const Ot = {
1575
1587
  ])
1576
1588
  ])
1577
1589
  ], 64))), 128))
1578
- ])) : (l(), _("div", $s, [
1579
- B(I),
1590
+ ])) : (c(), _("div", qs, [
1591
+ B(E),
1580
1592
  e("div", null, [
1581
1593
  e("img", {
1582
- src: o(et),
1594
+ src: n(et),
1583
1595
  alt: "List is empty"
1584
1596
  }, null, 8, Es)
1585
1597
  ]),
1586
- e("div", Is, m(o(r)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1587
- e("div", Ls, m(o(r)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
1588
- B(I),
1589
- B(I)
1598
+ e("div", Is, m(n(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1599
+ e("div", Ls, m(n(t)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
1600
+ B(E),
1601
+ B(E)
1590
1602
  ]))
1591
- ])) : z.value.value === "returns" && se.value ? (l(), _("div", Zs, [
1592
- ue.value ? (l(), _("div", er, [
1593
- s[15] || (s[15] = e("div", { class: "h-80" }, null, -1)),
1594
- B(j),
1595
- s[16] || (s[16] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, "Loading...", -1))
1596
- ])) : (De = E.value) != null && De.length ? (l(), _("div", nr, [
1597
- (l(!0), _(te, null, _e(E.value, (b, A) => (l(), _(te, {
1603
+ ])) : z.value.value === "returns" && Z.value ? (c(), _("div", Zs, [
1604
+ Y.value ? (c(), _("div", er, [
1605
+ r[15] || (r[15] = e("div", { class: "h-80" }, null, -1)),
1606
+ B(V),
1607
+ r[16] || (r[16] = e("div", { class: "text-fm-color-typo-secondary fm-typo-en-body-lg-400" }, "Loading...", -1))
1608
+ ])) : (De = T.value) != null && De.length ? (c(), _("div", nr, [
1609
+ (c(!0), _(re, null, Se(T.value, (b, A) => (c(), _(re, {
1598
1610
  key: b._id
1599
1611
  }, [
1600
1612
  e("div", or, [
1601
1613
  e("div", lr, [
1602
1614
  e("div", ir, [
1603
1615
  e("div", {
1604
- class: he([
1616
+ class: ge([
1605
1617
  {
1606
1618
  "bg-fm-color-primary": A !== 0,
1607
1619
  "bg-white": A === 0
@@ -1610,13 +1622,13 @@ const Ot = {
1610
1622
  ])
1611
1623
  }, null, 2)
1612
1624
  ]),
1613
- s[19] || (s[19] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1625
+ r[19] || (r[19] = e("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
1614
1626
  e("div", cr, [
1615
1627
  e("div", {
1616
- class: he([
1628
+ class: ge([
1617
1629
  {
1618
- "bg-fm-color-primary": A < E.value.length - 1,
1619
- "bg-white": A >= E.value.length - 1
1630
+ "bg-fm-color-primary": A < T.value.length - 1,
1631
+ "bg-white": A >= T.value.length - 1
1620
1632
  },
1621
1633
  "w-[2px] h-full"
1622
1634
  ])
@@ -1629,36 +1641,36 @@ const Ot = {
1629
1641
  e("span", null, " Return #" + m(b.seqNumber), 1),
1630
1642
  e("span", mr, [
1631
1643
  e("span", {
1632
- class: he(`fm-status-badge fm-status-badge-${`${b.status}`.toLocaleLowerCase("en-us")}`)
1633
- }, m(o(r)(`inventory.transfer.status.${b.status}`)), 3)
1644
+ class: ge(`fm-status-badge fm-status-badge-${`${b.status}`.toLocaleLowerCase("en-us")}`)
1645
+ }, m(n(t)(`inventory.transfer.status.${b.status}`)), 3)
1634
1646
  ])
1635
1647
  ]),
1636
- e("div", pr, m(o(Me)(o(vt)(b._id))), 1)
1648
+ e("div", pr, m(n(Me)(n(vt)(b._id))), 1)
1637
1649
  ]),
1638
1650
  e("div", vr, [
1639
- B(w, {
1651
+ B(S, {
1640
1652
  variant: "secondary",
1641
1653
  label: "Print",
1642
1654
  "prepend-icon": "print",
1643
1655
  "text-color": "primary",
1644
1656
  "bg-color": "transparent",
1645
1657
  "border-color": "primary",
1646
- onClick: (q) => {
1647
- var oe, le, ce, pe, ve, J, ye, Ae, qe;
1648
- return o(lt)(
1658
+ onClick: ($) => {
1659
+ var le, ie, ue, ve, ye, ee, he, Ae, Te;
1660
+ return n(lt)(
1649
1661
  {
1650
1662
  ...b,
1651
1663
  ref: [
1652
1664
  b.ref,
1653
- (le = (oe = H.value[b._id]) == null ? void 0 : oe.netSuite) != null && le.refNo ? `Netsuite ${(pe = (ce = H.value[b._id]) == null ? void 0 : ce.netSuite) == null ? void 0 : pe.refNo} (${(J = (ve = H.value[b._id]) == null ? void 0 : ve.netSuite) == null ? void 0 : J.id})` : ""
1665
+ (ie = (le = M.value[b._id]) == null ? void 0 : le.netSuite) != null && ie.refNo ? `Netsuite ${(ve = (ue = M.value[b._id]) == null ? void 0 : ue.netSuite) == null ? void 0 : ve.refNo} (${(ee = (ye = M.value[b._id]) == null ? void 0 : ye.netSuite) == null ? void 0 : ee.id})` : ""
1654
1666
  ].filter((Ue) => Ue == null ? void 0 : Ue.trim()).join()
1655
1667
  },
1656
1668
  {
1657
1669
  doc: {
1658
1670
  profile: {
1659
- name: (ye = t.purchaseOrder) == null ? void 0 : ye.supplier.name,
1660
- address: (Ae = t.purchaseOrder) == null ? void 0 : Ae.supplier.address,
1661
- regNo: (qe = t.purchaseOrder) == null ? void 0 : qe.supplier.registrationNumber
1671
+ name: (he = s.purchaseOrder) == null ? void 0 : he.supplier.name,
1672
+ address: (Ae = s.purchaseOrder) == null ? void 0 : Ae.supplier.address,
1673
+ regNo: (Te = s.purchaseOrder) == null ? void 0 : Te.supplier.registrationNumber
1662
1674
  }
1663
1675
  }
1664
1676
  }
@@ -1672,10 +1684,10 @@ const Ot = {
1672
1684
  e("div", hr, [
1673
1685
  e("div", gr, [
1674
1686
  e("div", {
1675
- class: he([
1687
+ class: ge([
1676
1688
  {
1677
- "bg-fm-color-primary": A < E.value.length - 1,
1678
- "bg-white": A >= E.value.length - 1
1689
+ "bg-fm-color-primary": A < T.value.length - 1,
1690
+ "bg-white": A >= T.value.length - 1
1679
1691
  },
1680
1692
  "w-[2px] h-full"
1681
1693
  ])
@@ -1683,35 +1695,35 @@ const Ot = {
1683
1695
  ])
1684
1696
  ]),
1685
1697
  e("div", br, [
1686
- B(P, {
1698
+ B(C, {
1687
1699
  variant: "outlined",
1688
1700
  class: "py-12 px-16"
1689
1701
  }, {
1690
- default: be(() => {
1691
- var q, oe, le, ce, pe, ve;
1702
+ default: _e(() => {
1703
+ var $, le, ie, ue, ve, ye;
1692
1704
  return [
1693
1705
  e("div", _r, [
1694
- (oe = (q = H.value[b._id]) == null ? void 0 : q.netSuite) != null && oe.id ? (l(), _(te, { key: 0 }, [
1706
+ (le = ($ = M.value[b._id]) == null ? void 0 : $.netSuite) != null && le.id ? (c(), _(re, { key: 0 }, [
1695
1707
  e("div", Sr, [
1696
- s[20] || (s[20] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Netsuite transfer order (ID) ", -1)),
1697
- e("div", wr, m((ce = (le = H.value[b._id]) == null ? void 0 : le.netSuite) == null ? void 0 : ce.refNo) + " (" + m((ve = (pe = H.value[b._id]) == null ? void 0 : pe.netSuite) == null ? void 0 : ve.id) + ") ", 1)
1708
+ r[20] || (r[20] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Netsuite transfer order (ID) ", -1)),
1709
+ e("div", wr, m((ue = (ie = M.value[b._id]) == null ? void 0 : ie.netSuite) == null ? void 0 : ue.refNo) + " (" + m((ye = (ve = M.value[b._id]) == null ? void 0 : ve.netSuite) == null ? void 0 : ye.id) + ") ", 1)
1698
1710
  ]),
1699
- B(T)
1711
+ B(P)
1700
1712
  ], 64)) : D("", !0),
1701
- s[21] || (s[21] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Returning items ", -1)),
1702
- (l(!0), _(te, null, _e((b == null ? void 0 : b.items) ?? [], (J) => {
1703
- var ye;
1704
- return l(), _("div", {
1705
- key: J.code,
1713
+ r[21] || (r[21] = e("div", { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, " Returning items ", -1)),
1714
+ (c(!0), _(re, null, Se((b == null ? void 0 : b.items) ?? [], (ee) => {
1715
+ var he;
1716
+ return c(), _("div", {
1717
+ key: ee.code,
1706
1718
  class: "flex flex-col"
1707
1719
  }, [
1708
1720
  e("div", xr, [
1709
- e("div", Rr, m(J.name), 1),
1710
- e("div", Or, m(o(Ge)(J.quantity, J.sku.unit, J.measurement)), 1)
1721
+ e("div", Or, m(ee.name), 1),
1722
+ e("div", kr, m(n(Ge)(ee.quantity, ee.sku.unit, ee.measurement)), 1)
1711
1723
  ]),
1712
- e("div", kr, [
1713
- e("div", Dr, m(J.code), 1),
1714
- (ye = J.totalCost) != null && ye.amount && o($).enableTotalCost ? (l(), _("div", Nr, " (" + m(o(Te)(J.totalCost)) + ") ", 1)) : D("", !0)
1724
+ e("div", Rr, [
1725
+ e("div", Dr, m(ee.code), 1),
1726
+ (he = ee.totalCost) != null && he.amount && n(L).enableTotalCost ? (c(), _("div", Nr, " (" + m(n($e)(ee.totalCost)) + ") ", 1)) : D("", !0)
1715
1727
  ])
1716
1728
  ]);
1717
1729
  }), 128))
@@ -1723,24 +1735,24 @@ const Ot = {
1723
1735
  ])
1724
1736
  ])
1725
1737
  ], 64))), 128))
1726
- ])) : (l(), _("div", tr, [
1727
- s[17] || (s[17] = e("div", { class: "h-80" }, null, -1)),
1738
+ ])) : (c(), _("div", tr, [
1739
+ r[17] || (r[17] = e("div", { class: "h-80" }, null, -1)),
1728
1740
  e("div", null, [
1729
1741
  e("img", {
1730
- src: o(et),
1742
+ src: n(et),
1731
1743
  alt: "List is empty"
1732
1744
  }, null, 8, sr)
1733
1745
  ]),
1734
- e("div", rr, m(o(r)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1735
- s[18] || (s[18] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, " You may view return request history here. ", -1)),
1746
+ e("div", rr, m(n(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1747
+ r[18] || (r[18] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, " You may view return request history here. ", -1)),
1736
1748
  e("div", ar, [
1737
- se.value && E.value != null && !((Ne = E.value) != null && Ne.length) ? (l(), ee(w, {
1749
+ Z.value && T.value != null && !((Ne = T.value) != null && Ne.length) ? (c(), se(S, {
1738
1750
  key: 0,
1739
1751
  label: "Create return request",
1740
1752
  variant: "secondary",
1741
- onClick: s[2] || (s[2] = (b) => re("returnStock")),
1742
- loading: i.value === "returnStock",
1743
- disabled: i.value !== "returnStock" && u.value,
1753
+ onClick: r[2] || (r[2] = (b) => ae("returnStock")),
1754
+ loading: f.value === "returnStock",
1755
+ disabled: f.value !== "returnStock" && d.value,
1744
1756
  "prepend-icon": "undo",
1745
1757
  "text-color": "primary",
1746
1758
  "bg-color": "transparent",
@@ -1752,66 +1764,66 @@ const Ot = {
1752
1764
  ])
1753
1765
  ];
1754
1766
  }),
1755
- "side-sheet-footer": be(() => {
1756
- var ne, fe, G, me, Oe, ke, De, Ne, b, A;
1767
+ "side-sheet-footer": _e(() => {
1768
+ var oe, me, H, pe, ke, Re, De, Ne, b, A;
1757
1769
  return [
1758
1770
  e("div", Ar, [
1759
- ((ne = t.purchaseOrder) == null ? void 0 : ne.status) === o(M).enum.DRAFT && a.value === o(ge).PURCHASE ? (l(), ee(w, {
1771
+ ((oe = s.purchaseOrder) == null ? void 0 : oe.status) === n(j).enum.DRAFT && o.value === n(be).PURCHASE ? (c(), se(S, {
1760
1772
  key: 0,
1761
- label: o(r)("inventory.transfer.receiveRequest.actions.confirmDraft"),
1762
- onClick: s[3] || (s[3] = (q) => re("confirmDraft")),
1763
- loading: i.value === "confirmDraft",
1764
- disabled: i.value !== "confirmDraft" && u.value
1773
+ label: n(t)("inventory.transfer.receiveRequest.actions.confirmDraft"),
1774
+ onClick: r[3] || (r[3] = ($) => ae("confirmDraft")),
1775
+ loading: f.value === "confirmDraft",
1776
+ disabled: f.value !== "confirmDraft" && d.value
1765
1777
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1766
- ((fe = t.purchaseOrder) == null ? void 0 : fe.status) === o(M).enum.DRAFT && a.value === o(ge).TRANSFER ? (l(), ee(w, {
1778
+ ((me = s.purchaseOrder) == null ? void 0 : me.status) === n(j).enum.DRAFT && o.value === n(be).TRANSFER ? (c(), se(S, {
1767
1779
  key: 1,
1768
- label: o(r)("inventory.transfer.receiveRequest.actions.submitRequest"),
1769
- onClick: s[4] || (s[4] = (q) => re("submitRequest")),
1770
- loading: i.value === "submitRequest",
1771
- disabled: i.value !== "submitRequest" && u.value
1780
+ label: n(t)("inventory.transfer.receiveRequest.actions.submitRequest"),
1781
+ onClick: r[4] || (r[4] = ($) => ae("submitRequest")),
1782
+ loading: f.value === "submitRequest",
1783
+ disabled: f.value !== "submitRequest" && d.value
1772
1784
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1773
- ((G = t.purchaseOrder) == null ? void 0 : G.status) === o(M).enum.DRAFT ? (l(), ee(w, {
1785
+ ((H = s.purchaseOrder) == null ? void 0 : H.status) === n(j).enum.DRAFT ? (c(), se(S, {
1774
1786
  key: 2,
1775
- label: o(r)("inventory.transfer.receiveRequest.actions.cancelDraft"),
1776
- onClick: s[5] || (s[5] = (q) => re("cancelDraft")),
1777
- loading: i.value === "cancelDraft",
1778
- disabled: i.value !== "cancelDraft" && u.value,
1787
+ label: n(t)("inventory.transfer.receiveRequest.actions.cancelDraft"),
1788
+ onClick: r[5] || (r[5] = ($) => ae("cancelDraft")),
1789
+ loading: f.value === "cancelDraft",
1790
+ disabled: f.value !== "cancelDraft" && d.value,
1779
1791
  variant: "destructive"
1780
1792
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1781
- ((me = t.purchaseOrder) == null ? void 0 : me.status) === o(M).enum.RECEIVING ? (l(), ee(w, {
1793
+ ((pe = s.purchaseOrder) == null ? void 0 : pe.status) === n(j).enum.RECEIVING ? (c(), se(S, {
1782
1794
  key: 3,
1783
- label: o(r)("inventory.transfer.receiveRequest.actions.completeReceive"),
1784
- onClick: s[6] || (s[6] = (q) => re("completeReceive")),
1785
- loading: i.value === "completeReceive",
1786
- disabled: i.value !== "completeReceive" && u.value
1795
+ label: n(t)("inventory.transfer.receiveRequest.actions.completeReceive"),
1796
+ onClick: r[6] || (r[6] = ($) => ae("completeReceive")),
1797
+ loading: f.value === "completeReceive",
1798
+ disabled: f.value !== "completeReceive" && d.value
1787
1799
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1788
- t.canResubmit ? (l(), ee(w, {
1800
+ s.canResubmit ? (c(), se(S, {
1789
1801
  key: 4,
1790
- label: o(r)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
1791
- onClick: s[7] || (s[7] = (q) => re("submitRequest")),
1792
- loading: i.value === "submitRequest",
1793
- disabled: i.value !== "submitRequest" && u.value
1802
+ label: n(t)("inventory.transfer.receiveRequest.actions.resubmitRequest"),
1803
+ onClick: r[7] || (r[7] = ($) => ae("submitRequest")),
1804
+ loading: f.value === "submitRequest",
1805
+ disabled: f.value !== "submitRequest" && d.value
1794
1806
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1795
- (((Oe = t.purchaseOrder) == null ? void 0 : Oe.status) === o(M).enum.REQUESTING || ((ke = t.purchaseOrder) == null ? void 0 : ke.status) === o(M).enum.PROCESSING) && t.canApprove ? (l(), ee(w, {
1807
+ (((ke = s.purchaseOrder) == null ? void 0 : ke.status) === n(j).enum.REQUESTING || ((Re = s.purchaseOrder) == null ? void 0 : Re.status) === n(j).enum.PROCESSING) && s.canApprove ? (c(), se(S, {
1796
1808
  key: 5,
1797
- label: o(r)("inventory.transfer.approval.actions.approveRequest"),
1798
- onClick: s[8] || (s[8] = (q) => re("approveRequest")),
1799
- loading: i.value === "approveRequest",
1800
- disabled: i.value !== "approveRequest" && u.value
1809
+ label: n(t)("inventory.transfer.approval.actions.approveRequest"),
1810
+ onClick: r[8] || (r[8] = ($) => ae("approveRequest")),
1811
+ loading: f.value === "approveRequest",
1812
+ disabled: f.value !== "approveRequest" && d.value
1801
1813
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1802
- ((De = t.purchaseOrder) == null ? void 0 : De.status) === o(M).enum.REQUESTING && t.canApprove ? (l(), ee(w, {
1814
+ ((De = s.purchaseOrder) == null ? void 0 : De.status) === n(j).enum.REQUESTING && s.canApprove ? (c(), se(S, {
1803
1815
  key: 6,
1804
- label: o(r)("inventory.transfer.approval.actions.rejectRequest"),
1805
- onClick: s[9] || (s[9] = (q) => re("rejectRequest")),
1806
- loading: i.value === "rejectRequest",
1807
- disabled: i.value !== "rejectRequest" && u.value,
1816
+ label: n(t)("inventory.transfer.approval.actions.rejectRequest"),
1817
+ onClick: r[9] || (r[9] = ($) => ae("rejectRequest")),
1818
+ loading: f.value === "rejectRequest",
1819
+ disabled: f.value !== "rejectRequest" && d.value,
1808
1820
  variant: "destructive"
1809
1821
  }, null, 8, ["label", "loading", "disabled"])) : D("", !0),
1810
- ((Ne = t.purchaseOrder) == null ? void 0 : Ne.status) !== o(M).enum.COMPLETE && ((b = t.purchaseOrder) == null ? void 0 : b.status) !== o(M).enum.CANCEL && (((A = t.purchaseOrder) == null ? void 0 : A.status) !== o(M).enum.REQUESTING || t.canApprove) ? (l(), ee(w, {
1822
+ ((Ne = s.purchaseOrder) == null ? void 0 : Ne.status) !== n(j).enum.COMPLETE && ((b = s.purchaseOrder) == null ? void 0 : b.status) !== n(j).enum.CANCEL && (((A = s.purchaseOrder) == null ? void 0 : A.status) !== n(j).enum.REQUESTING || s.canApprove) ? (c(), se(S, {
1811
1823
  key: 7,
1812
- label: o(r)("common.close"),
1824
+ label: n(t)("common.close"),
1813
1825
  variant: "tertiary",
1814
- onClick: s[10] || (s[10] = (q) => n("update:show", !1))
1826
+ onClick: r[10] || (r[10] = ($) => i("update:show", !1))
1815
1827
  }, null, 8, ["label"])) : D("", !0)
1816
1828
  ])
1817
1829
  ];
@@ -1826,6 +1838,6 @@ export {
1826
1838
  Br as _,
1827
1839
  Fr as a,
1828
1840
  Ur as b,
1829
- Rt as g,
1841
+ Ot as g,
1830
1842
  Xe as u
1831
1843
  };