@feedmepos/mf-inventory-portal 1.0.12-dev.2 → 1.0.12-dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/{App-Byn7tHre.js → App-CljcnwTp.js} +2 -2
  2. package/dist/{ApprovalView-C_B6Ud1v.js → ApprovalView-DKHAt7sK.js} +2 -2
  3. package/dist/{BindingsDialog-DpM-rpFr.js → BindingsDialog-6ugkEqMg.js} +2 -2
  4. package/dist/{BindingsPicker-CCKlnHQ8.js → BindingsPicker-CUEp4Rya.js} +1 -1
  5. package/dist/{BindingsTable-m3Z7ozrU.js → BindingsTable-CDEEfdfm.js} +1 -1
  6. package/dist/{ClosingDraftView-Dm8eo0Vz.js → ClosingDraftView-l-X-AkGj.js} +2 -2
  7. package/dist/{ClosingTemplateView-C0kKeAKu.js → ClosingTemplateView-BG_TYDpD.js} +2 -2
  8. package/dist/{DeliveryOrderPrintPreview-BiFBV9NI.js → DeliveryOrderPrintPreview-C8jN6FgI.js} +1 -1
  9. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-bBhR9dWX.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bs1AUyTV.js} +3 -3
  10. package/dist/{FmMultiselectDialog-Cg-plZjp.js → FmMultiselectDialog-EdDWUr8X.js} +1 -1
  11. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B0DdbgR8.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BowjSVzo.js} +1 -1
  12. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-DNkyBsYX.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-DBgStPS1.js} +1 -1
  13. package/dist/{IngredientGroupView-oRzzQrxP.js → IngredientGroupView-B7xqsZxh.js} +2 -2
  14. package/dist/{IngredientsView-UYr-9ckX.js → IngredientsView-B1-n1Zuh.js} +4 -4
  15. package/dist/{IntegrationView-Nb0j9Myn.js → IntegrationView-DZRfJNZa.js} +1585 -1585
  16. package/dist/{InventoryBindingForm-CfV17fI5.js → InventoryBindingForm-GMN9TPaW.js} +1 -1
  17. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-LZRjwQEB.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-CeYnBXsj.js} +3 -3
  18. package/dist/{InventoryBindingSummary-B2rDd4KS.js → InventoryBindingSummary-Ik2xxLpF.js} +1 -1
  19. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-O3oG04C3.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-BVO2un0T.js} +1 -1
  20. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-C9P0w1Yo.js → PremiumBadge.vue_vue_type_script_setup_true_lang-DhaFDjSB.js} +1 -1
  21. package/dist/{PublishView-lKWxaVGi.js → PublishView-BewFP4rz.js} +2 -2
  22. package/dist/{PurchaseOrderPrintPreview-C3pE7pKw.js → PurchaseOrderPrintPreview-1bOdlac_.js} +1 -1
  23. package/dist/{ReceiveRequestView-Cntcdt7e.js → ReceiveRequestView-DyDpfSKU.js} +10 -10
  24. package/dist/{RecipeView-bzu1U9Gq.js → RecipeView-aa5rptHU.js} +3 -3
  25. package/dist/{StockView-R5AjS5ZP.js → StockView-D_X0Cfg7.js} +7 -7
  26. package/dist/{SupplierView-BP_67SXq.js → SupplierView-D2SizsKP.js} +4 -4
  27. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BvgmrVSD.js → TransferDetails.vue_vue_type_script_setup_true_lang-C0Pp6j3l.js} +468 -449
  28. package/dist/{TransferTemplateView-BJLK64th.js → TransferTemplateView-BryKJByH.js} +7 -7
  29. package/dist/{UnitView--wdY45MB.js → UnitView-sxq1JS_q.js} +3 -3
  30. package/dist/{WarehouseView-iSOrBTnq.js → WarehouseView-CPWmY5ep.js} +1 -1
  31. package/dist/api/purchase-order.d.ts +1 -1
  32. package/dist/{app-kveWTQjE.js → app-PeqY3WSF.js} +3402 -3378
  33. package/dist/app.d.ts +3 -0
  34. package/dist/app.js +1 -1
  35. package/dist/{decimal-DY8OyZOE.js → decimal-CdkeOQTR.js} +1 -1
  36. package/dist/{feature-C0TlUzuT.js → feature-BByh_whS.js} +762 -458
  37. package/dist/{format-unit-display-Q_edRr_A.js → format-unit-display-DWnOEHsP.js} +2 -2
  38. package/dist/{index-B-ZEfBgj.js → index-BV_MbLKM.js} +2 -2
  39. package/dist/{index-BMpOpRCf.js → index-Bzox-uMM.js} +1 -1
  40. package/dist/{stock-C40mVN4W.js → stock-rByuoj6o.js} +1 -1
  41. package/dist/stores/integration/netsuite.d.ts +1 -1
  42. package/dist/{supplier-DvZ8SCGg.js → supplier-DIWM2MFM.js} +2 -2
  43. package/dist/{use-ingredient-select-dialog-CeK0rLZb.js → use-ingredient-select-dialog-dO5sLLm4.js} +1 -1
  44. package/dist/{use-inventory-binding-dialog-BV-rxXkP.js → use-inventory-binding-dialog-Dnn4uY0z.js} +1 -1
  45. package/dist/views/receive-request/components/netsuite/NetSuiteProps.d.ts +1 -0
  46. package/dist/views/receive-request/components/transfer-form/TransferForm.vue.d.ts +4 -4
  47. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +1 -1
  48. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +6 -6
  49. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +6 -6
  50. package/dist/{vue-i18n-CYoGKQoJ.js → vue-i18n-BrUAO3nM.js} +230 -230
  51. package/package.json +1 -1
@@ -1,35 +1,35 @@
1
- import { X as it, u as me, aH as D, b as Be, a2 as ut, a4 as dt, a5 as mt, aI as ft, d as Ye, e as tt, T as rt, aJ as pt, Z as Fe, J as ke, i as le, aK as st, a9 as De, f as We, h as z, D as Z, aq as se, a3 as yt, ao as Je, a1 as xe, aL as vt, ae as Pe, ar as ht } from "./app-kveWTQjE.js";
2
- import { ref as j, computed as G, h as N, defineComponent as Ne, onMounted as at, unref as p, openBlock as _, createElementBlock as k, createElementVNode as r, toDisplayString as R, createCommentVNode as L, resolveComponent as Q, createVNode as E, reactive as bt, createBlock as ue, withCtx as de, watch as gt, isRef as _t, Fragment as te, normalizeClass as Oe, createTextVNode as $e, renderList as ye, resolveDynamicComponent as wt } from "vue";
3
- import { F as St } from "./decimal-DY8OyZOE.js";
4
- import { b as Rt, u as xt, f as nt, P as he } from "./format-unit-display-Q_edRr_A.js";
1
+ import { X as it, u as me, aH as x, b as Be, a2 as ut, a4 as dt, a5 as mt, aI as ft, d as Ye, e as tt, T as rt, aJ as pt, Z as Fe, J as ke, i as le, aK as st, a9 as De, f as We, h as z, D as Z, aq as se, a3 as yt, ao as Je, a1 as xe, aL as vt, ae as Pe, ar as ht } from "./app-PeqY3WSF.js";
2
+ import { ref as j, computed as G, h as N, defineComponent as qe, onMounted as at, unref as y, openBlock as _, createElementBlock as q, createElementVNode as r, toDisplayString as R, createCommentVNode as V, resolveComponent as Q, createVNode as E, reactive as bt, createBlock as ue, withCtx as de, watch as gt, isRef as _t, Fragment as re, normalizeClass as Oe, createTextVNode as $e, renderList as ye, resolveDynamicComponent as wt } from "vue";
3
+ import { F as St } from "./decimal-CdkeOQTR.js";
4
+ import { b as Rt, u as xt, f as nt, P as he } from "./format-unit-display-DWnOEHsP.js";
5
5
  import { useCoreStore as Ue, useI18n as ot } from "@feedmepos/mf-common";
6
6
  import { E as Ot } from "./empty-placeholder-wf6-BWE8.js";
7
- import { useDialog as Le, useSnackbar as Ve, components as Xe, FmButtonVariant as re, useProxiedModel as kt } from "@feedmepos/ui-library";
8
- import { u as Me, F as Ce } from "./feature-C0TlUzuT.js";
9
- import { u as Dt } from "./index-B-ZEfBgj.js";
10
- import { _ as Nt, F as qt, a as At } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B0DdbgR8.js";
7
+ import { useDialog as Le, useSnackbar as Ve, components as Xe, FmButtonVariant as ee, useProxiedModel as kt } from "@feedmepos/ui-library";
8
+ import { u as Me, F as Ce } from "./feature-BByh_whS.js";
9
+ import { u as Dt } from "./index-BV_MbLKM.js";
10
+ import { _ as qt, F as Nt, a as At } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BowjSVzo.js";
11
11
  import { u as Tt, R as Ze } from "./usePromise-CbVUCxhj.js";
12
- const qe = it((n, l) => {
13
- const o = me(), g = Ue();
12
+ const Ne = it((n, l) => {
13
+ const o = me(), b = Ue();
14
14
  return {
15
15
  async readRequests(m, s, f) {
16
- const i = m ?? o.currentLocationDBName, a = `${n.inventoryBackendUrl}/${i}/purchase-request`;
16
+ const u = m ?? o.currentLocationDBName, a = `${n.inventoryBackendUrl}/${u}/purchase-request`;
17
17
  return s && f ? await l.get(`${a}?startDate=${s}&endDate=${f}`) : await l.get(a);
18
18
  },
19
19
  async readRequestById(m, s) {
20
- const f = s ?? o.currentLocationDBName, i = `${n.inventoryBackendUrl}/${f}/purchase-request/${m}`;
21
- return await l.get(i);
20
+ const f = s ?? o.currentLocationDBName, u = `${n.inventoryBackendUrl}/${f}/purchase-request/${m}`;
21
+ return await l.get(u);
22
22
  },
23
23
  async readRequestByIds(m, s) {
24
- const f = s ?? o.currentLocationDBName, i = `${n.inventoryBackendUrl}/${f}/purchase-request/find`;
25
- return await l.post(i, { requestIds: m });
24
+ const f = s ?? o.currentLocationDBName, u = `${n.inventoryBackendUrl}/${f}/purchase-request/find`;
25
+ return await l.post(u, { requestIds: m });
26
26
  },
27
27
  async getPurchaseOrders({
28
28
  start: m,
29
29
  end: s
30
30
  }) {
31
- const f = o.currentLocationDBName, i = `${n.inventoryBackendUrl}/${f}/purchase-order`;
32
- return await l.get(`${i}?start=${m}&end=${s}`);
31
+ const f = o.currentLocationDBName, u = `${n.inventoryBackendUrl}/${f}/purchase-order`;
32
+ return await l.get(`${u}?start=${m}&end=${s}`);
33
33
  },
34
34
  async getLatestPurchaseOrderRequest(m) {
35
35
  const s = o.currentLocationDBName, f = `${n.inventoryBackendUrl}/${s}/purchase-request/find-by-purchase-order-id`;
@@ -43,11 +43,7 @@ const qe = it((n, l) => {
43
43
  * @deprecated Use `processPurchaseOrderV2` instead.
44
44
  */
45
45
  async processPurchaseOrder(m, s) {
46
- const f = o.currentLocationDBName, i = s || f, a = `${n.inventoryBackendUrl}/${i}/purchase-order/run-operation`;
47
- return await l.put(a, m);
48
- },
49
- async processPurchaseOrderV2(m, s) {
50
- const f = o.currentLocationDBName, i = s || f, a = `${n.inventoryBackendUrl}/${i}/v2/purchase-order/run-operation`;
46
+ const f = o.currentLocationDBName, u = s || f, a = `${n.inventoryBackendUrl}/${u}/purchase-order/run-operation`;
51
47
  return await l.put(a, m);
52
48
  },
53
49
  async createPurchaseOrder(m) {
@@ -62,14 +58,18 @@ const qe = it((n, l) => {
62
58
  const s = o.currentLocationDBName, f = `${n.inventoryBackendUrl}/${s}/purchase-order/import-from-xilnex`;
63
59
  return await l.post(f, m);
64
60
  },
61
+ async processPurchaseOrderV2(m, s) {
62
+ const f = o.currentLocationDBName, u = s || f, a = `${n.inventoryBackendUrl}/${u}/v2/purchase-order/run-operation`;
63
+ return await l.put(a, m);
64
+ },
65
65
  async getWorkflowConfig() {
66
- var i;
67
- const s = `business_${(i = g.currentBusiness.value) == null ? void 0 : i._id}`, f = `${n.inventoryBackendUrl}/${s}/v2/purchase-order/workflow-config`;
66
+ var u;
67
+ const s = `business_${(u = b.currentBusiness.value) == null ? void 0 : u._id}`, f = `${n.inventoryBackendUrl}/${s}/v2/purchase-order/workflow-config`;
68
68
  return await l.get(f);
69
69
  }
70
70
  };
71
71
  }), ct = {
72
- [D.enum.confirmDraft]: {
72
+ [x.enum.confirmDraft]: {
73
73
  primaryActions: {
74
74
  text: "Confirm draft",
75
75
  close: !0
@@ -78,7 +78,7 @@ const qe = it((n, l) => {
78
78
  message: "Purchase order cannot be changed after confirm draft.",
79
79
  successMessage: "Purchase order draft has been confirmed"
80
80
  },
81
- [D.enum.cancelDraft]: {
81
+ [x.enum.cancelDraft]: {
82
82
  primaryActions: {
83
83
  text: "Cancel draft",
84
84
  close: !0,
@@ -88,7 +88,7 @@ const qe = it((n, l) => {
88
88
  message: "Purchase order cannot be changed after cancelled draft.",
89
89
  successMessage: "Purchase order draft has been cancelled"
90
90
  },
91
- [D.enum.submitRequest]: {
91
+ [x.enum.submitRequest]: {
92
92
  primaryActions: {
93
93
  text: "Submit request",
94
94
  close: !0
@@ -97,7 +97,7 @@ const qe = it((n, l) => {
97
97
  message: "Purchase order cannot be changed after confirm draft.",
98
98
  successMessage: "Purchase order draft has been submitted"
99
99
  },
100
- [D.enum.completeReceive]: {
100
+ [x.enum.completeReceive]: {
101
101
  primaryActions: {
102
102
  text: "Mark received",
103
103
  close: !0
@@ -106,7 +106,7 @@ const qe = it((n, l) => {
106
106
  message: "Purchase order cannot be changed after it has complete receiving.",
107
107
  successMessage: "Purchase order has been marked as received"
108
108
  },
109
- [D.enum.approveRequest]: {
109
+ [x.enum.approveRequest]: {
110
110
  primaryActions: {
111
111
  text: "Accept request",
112
112
  close: !0
@@ -115,7 +115,7 @@ const qe = it((n, l) => {
115
115
  message: "Transfer out request will be accepted.",
116
116
  successMessage: "Transfer out request has been approved"
117
117
  },
118
- [D.enum.rejectRequest]: {
118
+ [x.enum.rejectRequest]: {
119
119
  primaryActions: {
120
120
  text: "Reject request",
121
121
  close: !0,
@@ -127,39 +127,39 @@ const qe = it((n, l) => {
127
127
  }
128
128
  };
129
129
  function lt() {
130
- const n = me(), l = qe(), o = Me();
131
- async function g(s, f) {
132
- const i = n.currentLocationDBName;
133
- return s.doc.supplier.internal && s.operation === D.enum.confirmDraft && (s.operation = D.enum.submitRequest), await l.processPurchaseOrder(s, f || i);
130
+ const n = me(), l = Ne(), o = Me();
131
+ async function b(s, f) {
132
+ const u = n.currentLocationDBName;
133
+ return s.doc.supplier.internal && s.operation === x.enum.confirmDraft && (s.operation = x.enum.submitRequest), await l.processPurchaseOrder(s, f || u);
134
134
  }
135
135
  async function m(s, f) {
136
- const i = n.currentLocationDBName;
137
- return await l.processPurchaseOrderV2(s, f || i);
136
+ const u = n.currentLocationDBName;
137
+ return await l.processPurchaseOrderV2(s, f || u);
138
138
  }
139
- return (s) => o.useOperatePurchaseOrderV2 ? m(s.operateV2, s.transferTo) : g(s.operate, s.transferTo);
139
+ return (s) => o.useOperatePurchaseOrderV2 ? m(s.operateV2, s.transferTo) : b(s.operate, s.transferTo);
140
140
  }
141
141
  var Ee = /* @__PURE__ */ ((n) => (n.RECEIVE_REQUEST = "receive/request", n.APPROVAL = "approval", n))(Ee || {});
142
142
  const Se = j(), Ie = j();
143
143
  function Os(n, l) {
144
- const o = Le(), g = me(), m = Me();
144
+ const o = Le(), b = me(), m = Me();
145
145
  Be();
146
- const s = Rt(), f = xt(), i = j(!1), a = Ve(), h = qe(), u = j(new Array()), y = j(
146
+ const s = Rt(), f = xt(), u = j(!1), a = Ve(), h = Ne(), i = j(new Array()), p = j(
147
147
  l != null && l.startDate && (l != null && l.endDate) ? l : ut()
148
148
  ), t = G(() => {
149
- const x = new Date(y.value.startDate), S = new Date(y.value.endDate);
149
+ const O = new Date(p.value.startDate), S = new Date(p.value.endDate);
150
150
  return {
151
- start: dt(x).toISOString(),
151
+ start: dt(O).toISOString(),
152
152
  end: mt(S).toISOString()
153
153
  };
154
- }), v = j(new Array()), O = ft(), w = j(null);
155
- async function q(x) {
154
+ }), v = j(new Array()), D = ft(), w = j(null);
155
+ async function A(O) {
156
156
  function S(e) {
157
157
  const c = {
158
158
  mode: Ye.CREATE,
159
- modelValue: x || void 0,
159
+ modelValue: O || void 0,
160
160
  show: !0,
161
- "onUpdate:show"(b) {
162
- Se.value.show = b;
161
+ "onUpdate:show"(g) {
162
+ Se.value.show = g;
163
163
  },
164
164
  templateId: e,
165
165
  lastClosingDate: w.value
@@ -167,7 +167,7 @@ function Os(n, l) {
167
167
  Se.value = c;
168
168
  }
169
169
  let B;
170
- m.mustUsePoTemplate && !(x != null && x.template) ? o.open({
170
+ m.mustUsePoTemplate && !(O != null && O.template) ? o.open({
171
171
  title: "Create transfer",
172
172
  message: "",
173
173
  primaryActions: {
@@ -185,10 +185,10 @@ function Os(n, l) {
185
185
  S(void 0);
186
186
  }) : S(B);
187
187
  }
188
- function I(x) {
188
+ function I(O) {
189
189
  const S = {
190
190
  mode: Ye.UPDATE,
191
- modelValue: tt(x),
191
+ modelValue: tt(O),
192
192
  show: !0,
193
193
  "onUpdate:show"(B) {
194
194
  Se.value.show = B;
@@ -198,12 +198,12 @@ function Os(n, l) {
198
198
  Se.value = S;
199
199
  }
200
200
  async function W() {
201
- u.value = [], i.value = !0;
201
+ i.value = [], u.value = !0;
202
202
  try {
203
- u.value = await h.getPurchaseOrders(t.value).then((e) => e.sort((c, b) => b._id.localeCompare(c._id)));
204
- const x = await O.readCurrentLocationLastClosing(!0), S = x == null ? void 0 : x._id;
203
+ i.value = await h.getPurchaseOrders(t.value).then((e) => e.sort((c, g) => g._id.localeCompare(c._id)));
204
+ const O = await D.readCurrentLocationLastClosing(!0), S = O == null ? void 0 : O._id;
205
205
  S && (w.value = pt(S)), m.mustUsePoTemplate && await f.fetchTemplates();
206
- const B = u.value.map((e) => {
206
+ const B = i.value.map((e) => {
207
207
  var c;
208
208
  return ((c = e.request) == null ? void 0 : c.id) ?? "";
209
209
  }).filter((e) => e);
@@ -215,17 +215,17 @@ function Os(n, l) {
215
215
  type: "error"
216
216
  });
217
217
  } finally {
218
- i.value = !1;
218
+ u.value = !1;
219
219
  }
220
220
  }
221
221
  async function J() {
222
- v.value = [], i.value = !0;
222
+ v.value = [], u.value = !0;
223
223
  try {
224
224
  v.value = await h.readRequests(
225
225
  void 0,
226
226
  t.value.start,
227
227
  t.value.end
228
- ).then((x) => x.reverse());
228
+ ).then((O) => O.reverse());
229
229
  } catch {
230
230
  a.open({
231
231
  title: "Something went wrong",
@@ -233,7 +233,7 @@ function Os(n, l) {
233
233
  type: "error"
234
234
  });
235
235
  } finally {
236
- i.value = !1;
236
+ u.value = !1;
237
237
  }
238
238
  }
239
239
  function ae() {
@@ -244,65 +244,65 @@ function Os(n, l) {
244
244
  return J();
245
245
  }
246
246
  }
247
- function ne(x, S) {
248
- y.value = {
249
- startDate: x,
247
+ function ne(O, S) {
248
+ p.value = {
249
+ startDate: O,
250
250
  endDate: S
251
251
  }, ae();
252
252
  }
253
- g.watchLocation(async (x) => {
254
- if (!x) {
255
- u.value = [];
253
+ b.watchLocation(async (O) => {
254
+ if (!O) {
255
+ i.value = [];
256
256
  return;
257
257
  }
258
258
  await ae();
259
259
  });
260
- const ee = j(), oe = j(Math.random().toString());
261
- async function ie(x, S) {
260
+ const te = j(), oe = j(Math.random().toString());
261
+ async function ie(O, S) {
262
262
  const B = Math.random().toString();
263
263
  oe.value = B, S ?? (S = v.value.computeFirst(
264
- (b) => b.purchaseOrderId === x._id ? b : null
264
+ (g) => g.purchaseOrderId === O._id ? g : null
265
265
  ) ?? void 0);
266
- const e = n === "receive/request" ? g.currentLocation : S == null ? void 0 : S.to, c = {
266
+ const e = n === "receive/request" ? b.currentLocation : S == null ? void 0 : S.to, c = {
267
267
  poRequest: S,
268
- purchaseOrder: x,
268
+ purchaseOrder: O,
269
269
  transferTo: e == null ? void 0 : e.name,
270
270
  transferToDbName: e == null ? void 0 : e.dbName,
271
271
  show: !0,
272
272
  canResubmit: !1,
273
273
  canApprove: n === "approval",
274
- "onUpdate:show"(b) {
275
- ee.value.show = b;
274
+ "onUpdate:show"(g) {
275
+ te.value.show = g;
276
276
  },
277
277
  scope: n
278
278
  };
279
- ee.value = c;
279
+ te.value = c;
280
280
  }
281
- async function Ae(x, S, B, e) {
281
+ async function Ae(O, S, B, e) {
282
282
  const c = lt();
283
- i.value = !0;
283
+ u.value = !0;
284
284
  try {
285
285
  await c({
286
286
  operate: {
287
287
  operation: S,
288
- doc: x,
288
+ doc: O,
289
289
  options: (
290
290
  // auto receive for supplier to warehouse
291
- (S === D.enum.confirmDraft || // auto receive for warehouse to warehouse
292
- S === D.enum.completeReceive) && m.autoReceiveWarehouse ? {
291
+ (S === x.enum.confirmDraft || // auto receive for warehouse to warehouse
292
+ S === x.enum.completeReceive) && m.autoReceiveWarehouse ? {
293
293
  autoReceive: !0
294
294
  } : void 0
295
295
  )
296
296
  },
297
297
  operateV2: {
298
- _id: x._id,
299
- _rev: x._rev ?? "",
298
+ _id: O._id,
299
+ _rev: O._rev ?? "",
300
300
  action: S
301
301
  },
302
302
  transferTo: e
303
- }), await new Promise((K) => setTimeout(K, 1e3));
304
- const P = me().currentLocationDBName.startsWith("restaurant_");
305
- S === D.enum.confirmDraft && x.effectiveAt && P ? a.open({
303
+ }), await new Promise((U) => setTimeout(U, 1e3));
304
+ const k = me().currentLocationDBName.startsWith("restaurant_");
305
+ S === x.enum.confirmDraft && O.effectiveAt && k ? a.open({
306
306
  title: "Success",
307
307
  message: `${B}. The backdate will be reflected once your POS has received this change.`,
308
308
  type: "success"
@@ -311,17 +311,17 @@ function Os(n, l) {
311
311
  message: B,
312
312
  type: "success"
313
313
  });
314
- } catch (b) {
314
+ } catch (g) {
315
315
  a.open({
316
316
  title: "Something went wrong",
317
317
  message: "Please try again.",
318
318
  type: "error"
319
- }), console.error("Error when submitting PO operation", S, x, b);
319
+ }), console.error("Error when submitting PO operation", S, O, g);
320
320
  } finally {
321
- i.value = !1, ae();
321
+ u.value = !1, ae();
322
322
  }
323
323
  }
324
- async function be(x, S, B) {
324
+ async function be(O, S, B) {
325
325
  const e = ct[S];
326
326
  if (!e) {
327
327
  a.open({
@@ -331,13 +331,13 @@ function Os(n, l) {
331
331
  });
332
332
  return;
333
333
  }
334
- const { successMessage: c, ...b } = e;
334
+ const { successMessage: c, ...g } = e;
335
335
  o.open({
336
- title: b.title,
337
- message: b.message,
338
- primaryActions: b.primaryActions
336
+ title: g.title,
337
+ message: g.message,
338
+ primaryActions: g.primaryActions
339
339
  }).onPrimary(() => {
340
- Ae(x, S, c, B);
340
+ Ae(O, S, c, B);
341
341
  });
342
342
  }
343
343
  async function Te() {
@@ -352,25 +352,25 @@ function Os(n, l) {
352
352
  close: !0
353
353
  }
354
354
  }).onPrimary(() => {
355
- const x = {
355
+ const O = {
356
356
  show: !0,
357
357
  "onUpdate:show"(S) {
358
358
  Ie.value.show = S;
359
359
  }
360
360
  };
361
- Ie.value = x;
361
+ Ie.value = O;
362
362
  });
363
363
  }
364
364
  return {
365
- purchaseOrders: u,
365
+ purchaseOrders: i,
366
366
  purchaseRequests: v,
367
367
  updateDateRange: ne,
368
368
  fetchData: ae,
369
- loading: i,
369
+ loading: u,
370
370
  transferDialogProps: Se,
371
- promptCreateTransferDialog: q,
371
+ promptCreateTransferDialog: A,
372
372
  promptUpdateTransferDialog: I,
373
- transferDetailsProps: ee,
373
+ transferDetailsProps: te,
374
374
  promptShowTransferDetails: ie,
375
375
  submitAction: be,
376
376
  xilnexImportDialogProps: Ie,
@@ -379,15 +379,15 @@ function Os(n, l) {
379
379
  }
380
380
  function Pt(n, l) {
381
381
  return l.reduce(
382
- (g, m) => {
382
+ (b, m) => {
383
383
  const s = m.received.find((f) => f.sku._id === n._id);
384
- return s && (g = Fe(g, s.amount)), g;
384
+ return s && (b = Fe(b, s.amount)), b;
385
385
  },
386
386
  St.toPrecision(ke(0), n.unit.precision)
387
387
  );
388
388
  }
389
- function $t(n, l, o, g) {
390
- const { name: m, address: s, regNo: f } = l.doc.profile, i = {
389
+ function $t(n, l, o, b) {
390
+ const { name: m, address: s, regNo: f } = l.doc.profile, u = {
391
391
  name: m,
392
392
  registrationNumber: f,
393
393
  line1: s == null ? void 0 : s.line1,
@@ -406,86 +406,91 @@ function $t(n, l, o, g) {
406
406
  city: n.supplier.address.city,
407
407
  state: n.supplier.address.state,
408
408
  country: n.supplier.address.country
409
- }, h = n.items.map((O) => {
410
- const { sku: w, measurement: q } = O, I = le(
411
- Pt(O.sku, n.deliveryOrder || []),
409
+ }, h = n.items.map((D) => {
410
+ const { sku: w, measurement: A } = D, I = le(
411
+ Pt(D.sku, n.deliveryOrder || []),
412
412
  !1
413
413
  );
414
414
  return {
415
415
  code: w.code,
416
416
  description: w.name,
417
- quantity: nt(O.quantity, w.unit, O.measurement),
418
- unit: (q == null ? void 0 : q.abbrev) || w.unit.abbrev,
417
+ quantity: nt(D.quantity, w.unit, D.measurement),
418
+ unit: (A == null ? void 0 : A.abbrev) || w.unit.abbrev,
419
419
  received: I
420
420
  };
421
- }), u = n.deliveryOrder.map((O) => ({
422
- createdAt: st(new Date(O.createdAt)),
423
- ref: O.deliveryOrderNumber,
424
- remark: O.remark || "",
425
- items: O.received.map((w) => {
426
- var q;
421
+ }), i = n.deliveryOrder.map((D) => ({
422
+ createdAt: st(new Date(D.createdAt)),
423
+ ref: D.deliveryOrderNumber,
424
+ remark: D.remark || "",
425
+ items: D.received.map((w) => {
426
+ var A;
427
427
  return {
428
428
  code: w.sku.code,
429
429
  description: w.sku.name,
430
430
  quantity: le(w.amount),
431
- unit: ((q = w.measurement) == null ? void 0 : q.abbrev) || w.sku.unit.abbrev
431
+ unit: ((A = w.measurement) == null ? void 0 : A.abbrev) || w.sku.unit.abbrev
432
432
  };
433
433
  })
434
- })), y = {
434
+ })), p = {
435
435
  businessName: o == null ? void 0 : o.name,
436
436
  logo: o == null ? void 0 : o.thumbnail,
437
437
  orderNumber: n.seqNumber.toString(),
438
438
  createdAt: De(n._id),
439
439
  ref: n.ref || "",
440
440
  remark: n.remark || "",
441
- buyer: i,
441
+ buyer: u,
442
442
  supplier: a,
443
443
  items: h,
444
444
  status: n.status,
445
- deliveryOrders: u
446
- }, t = new URL(window.location.href), v = g && (n.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
447
- t.pathname = t.hostname.includes("portal.feedme") ? `/inventory/${v}` : `/${v}`, t.searchParams.append("data", JSON.stringify(y)), window.open(t.href, "_blank", "noreferrer");
445
+ deliveryOrders: i
446
+ }, t = new URL(window.location.href), v = b && (n.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
447
+ t.pathname = t.hostname.includes("portal.feedme") ? `/inventory/${v}` : `/${v}`, t.searchParams.append("data", JSON.stringify(p)), window.open(t.href, "_blank", "noreferrer");
448
448
  }
449
449
  const ve = {
450
450
  submitRequest: {
451
451
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
452
452
  color: "text-fm-color-typo-primary",
453
- value: D.enum.submitRequest
453
+ value: x.enum.submitRequest
454
454
  },
455
455
  confirmDraft: {
456
456
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
457
457
  color: "text-fm-color-typo-primary",
458
- value: D.enum.confirmDraft
458
+ value: x.enum.confirmDraft
459
459
  },
460
460
  cancelDraft: {
461
461
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
462
462
  color: "text-fm-color-typo-error",
463
- value: D.enum.cancelDraft
463
+ value: x.enum.cancelDraft
464
464
  },
465
465
  approveRequest: {
466
466
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
467
467
  color: "text-fm-color-typo-primary",
468
- value: D.enum.approveRequest
468
+ value: x.enum.approveRequest
469
469
  },
470
470
  rejectRequest: {
471
471
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
472
472
  color: "text-fm-color-typo-error",
473
- value: D.enum.rejectRequest
473
+ value: x.enum.rejectRequest
474
474
  },
475
475
  processRequest: {
476
476
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
477
477
  color: "text-fm-color-typo-primary",
478
- value: D.enum.processRequest
478
+ value: x.enum.processRequest
479
479
  },
480
480
  receiveStock: {
481
481
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
482
482
  color: "text-fm-color-typo-primary",
483
- value: D.enum.receiveStock
483
+ value: x.enum.receiveStock
484
484
  },
485
485
  completeReceive: {
486
486
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
487
487
  color: "text-fm-color-typo-primary",
488
- value: D.enum.completeReceive
488
+ value: x.enum.completeReceive
489
+ },
490
+ closeRequest: {
491
+ translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
492
+ color: "system-error-300",
493
+ value: x.enum.closeRequest
489
494
  },
490
495
  approveDraft: {
491
496
  label: void 0,
@@ -502,26 +507,26 @@ const ve = {
502
507
  };
503
508
  function ks(n, l) {
504
509
  me();
505
- const o = Ue(), { t: g } = ot();
506
- function m(u) {
507
- switch (u.status) {
510
+ const o = Ue(), { t: b } = ot();
511
+ function m(i) {
512
+ switch (i.status) {
508
513
  case "DRAFT":
509
514
  return [
510
515
  Z[z.Update],
511
516
  Z[z.Details],
512
- u.supplier.internal === "restaurant" || u.supplier.internal === "warehouse" ? ve[D.enum.submitRequest] : ve[D.enum.confirmDraft],
513
- ve[D.enum.cancelDraft]
517
+ i.supplier.internal === "restaurant" || i.supplier.internal === "warehouse" ? ve[x.enum.submitRequest] : ve[x.enum.confirmDraft],
518
+ ve[x.enum.cancelDraft]
514
519
  ];
515
520
  case "RECEIVING":
516
521
  return [
517
- ve[D.enum.completeReceive],
522
+ ve[x.enum.completeReceive],
518
523
  Z[z.Details],
519
524
  Z[z.Print]
520
525
  ];
521
526
  case "REQUESTING":
522
527
  return n === "receive/request" ? [Z[z.Details], Z[z.Print]] : [
523
- ve[D.enum.approveRequest],
524
- ve[D.enum.rejectRequest],
528
+ ve[x.enum.approveRequest],
529
+ ve[x.enum.rejectRequest],
525
530
  Z[z.Details]
526
531
  // DefaultRowActions[RowActionEnum.Print]
527
532
  ];
@@ -533,13 +538,13 @@ function ks(n, l) {
533
538
  return [Z[z.Details], Z[z.Print]];
534
539
  }
535
540
  }
536
- function s(u) {
537
- return Object.values(D.enum).includes(u);
541
+ function s(i) {
542
+ return Object.values(x.enum).includes(i);
538
543
  }
539
- async function f(u, y, t) {
540
- var O, w, q, I;
541
- const v = tt(y);
542
- if (u === z.Print) {
544
+ async function f(i, p, t) {
545
+ var D, w, A, I;
546
+ const v = tt(p);
547
+ if (i === z.Print) {
543
548
  const W = (t == null ? void 0 : t.toInventoryLocation) ?? {
544
549
  name: "",
545
550
  type: "restaurant",
@@ -551,48 +556,48 @@ function ks(n, l) {
551
556
  profile: {}
552
557
  }
553
558
  };
554
- v.ref = [((O = t == null ? void 0 : t.netSuite) == null ? void 0 : O.refNo) || ((w = v.netSuite) == null ? void 0 : w.refNo)].filter((J) => J).join(" "), $t(v, W, o.currentBusiness.value, n === "approval");
559
+ v.ref = [((D = t == null ? void 0 : t.netSuite) == null ? void 0 : D.refNo) || ((w = v.netSuite) == null ? void 0 : w.refNo)].filter((J) => J).join(" "), $t(v, W, o.currentBusiness.value, n === "approval");
555
560
  return;
556
561
  }
557
- if (u === z.Details) {
562
+ if (i === z.Details) {
558
563
  l.promptShowTransferDetails(v, t);
559
564
  return;
560
565
  }
561
- if (u === z.Update) {
562
- (q = l.promptUpdateTransferDialog) == null || q.call(l, v);
566
+ if (i === z.Update) {
567
+ (A = l.promptUpdateTransferDialog) == null || A.call(l, v);
563
568
  return;
564
569
  }
565
- if (s(u)) {
566
- l.submitAction(y, u, (I = t == null ? void 0 : t.to) == null ? void 0 : I.dbName);
570
+ if (s(i)) {
571
+ l.submitAction(p, i, (I = t == null ? void 0 : t.to) == null ? void 0 : I.dbName);
567
572
  return;
568
573
  }
569
574
  }
570
- function i() {
575
+ function u() {
571
576
  return [
572
577
  {
573
578
  accessorKey: "seqNumber",
574
- header: () => g("inventory.transfer.table.seqNo"),
579
+ header: () => b("inventory.transfer.table.seqNo"),
575
580
  enableSorting: !0,
576
581
  size: 80,
577
582
  sortUndefined: "last"
578
583
  },
579
584
  {
580
585
  accessorKey: "_id",
581
- header: () => g("inventory.transfer.table.createdAt"),
582
- cell(u) {
583
- return De(`${u.getValue()}`);
586
+ header: () => b("inventory.transfer.table.createdAt"),
587
+ cell(i) {
588
+ return De(`${i.getValue()}`);
584
589
  },
585
590
  enableSorting: !0
586
591
  },
587
592
  {
588
593
  accessorKey: "supplier.name",
589
- header: () => g("inventory.transfer.table.transferFrom"),
594
+ header: () => b("inventory.transfer.table.transferFrom"),
590
595
  enableSorting: !0,
591
596
  size: 200
592
597
  },
593
598
  {
594
599
  accessorKey: "items.length",
595
- header: () => g("inventory.transfer.table.noOfItems"),
600
+ header: () => b("inventory.transfer.table.noOfItems"),
596
601
  enableSorting: !1,
597
602
  meta: {
598
603
  width: "10rem"
@@ -600,15 +605,15 @@ function ks(n, l) {
600
605
  },
601
606
  {
602
607
  accessorKey: "ref",
603
- header: () => g("inventory.transfer.table.reference"),
608
+ header: () => b("inventory.transfer.table.reference"),
604
609
  enableSorting: !1,
605
610
  size: "auto"
606
611
  },
607
612
  {
608
613
  accessorKey: "status",
609
- header: () => g("inventory.transfer.table.status"),
610
- cell(u) {
611
- const y = g(`inventory.transfer.status.${u.getValue() ?? ""}`), t = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
614
+ header: () => b("inventory.transfer.table.status"),
615
+ cell(i) {
616
+ const p = b(`inventory.transfer.status.${i.getValue() ?? ""}`), t = `${i.getValue() ?? ""}`.toLocaleLowerCase("en-us");
612
617
  return N(
613
618
  "div",
614
619
  {
@@ -619,7 +624,7 @@ function ks(n, l) {
619
624
  {
620
625
  class: `fm-status-badge fm-status-badge-${t}`
621
626
  },
622
- y
627
+ p
623
628
  )
624
629
  );
625
630
  },
@@ -628,9 +633,9 @@ function ks(n, l) {
628
633
  },
629
634
  {
630
635
  id: "action",
631
- cell(u) {
632
- const y = u.row.original, t = m(y);
633
- return We(t, (v) => f(v, y));
636
+ cell(i) {
637
+ const p = i.row.original, t = m(p);
638
+ return We(t, (v) => f(v, p));
634
639
  },
635
640
  enableSorting: !1,
636
641
  size: 40,
@@ -645,41 +650,41 @@ function ks(n, l) {
645
650
  return [
646
651
  {
647
652
  accessorKey: "purchaseOrder.seqNumber",
648
- header: () => g("inventory.transfer.table.seqNo"),
653
+ header: () => b("inventory.transfer.table.seqNo"),
649
654
  enableSorting: !0,
650
655
  size: 80,
651
656
  sortUndefined: "last"
652
657
  },
653
658
  {
654
659
  accessorKey: "purchaseOrder._id",
655
- header: () => g("inventory.transfer.table.createdAt"),
656
- cell(u) {
657
- return De(`${u.getValue()}`);
660
+ header: () => b("inventory.transfer.table.createdAt"),
661
+ cell(i) {
662
+ return De(`${i.getValue()}`);
658
663
  },
659
664
  enableSorting: !0
660
665
  },
661
666
  {
662
667
  accessorKey: "to.name",
663
- header: () => g("inventory.transfer.table.transferTo"),
668
+ header: () => b("inventory.transfer.table.transferTo"),
664
669
  enableSorting: !1,
665
670
  size: 200
666
671
  },
667
672
  {
668
673
  accessorKey: "purchaseOrder.items.length",
669
- header: () => g("inventory.transfer.table.noOfItems"),
674
+ header: () => b("inventory.transfer.table.noOfItems"),
670
675
  enableSorting: !1
671
676
  },
672
677
  {
673
678
  accessorKey: "purchaseOrder.ref",
674
- header: () => g("inventory.transfer.table.reference"),
679
+ header: () => b("inventory.transfer.table.reference"),
675
680
  enableSorting: !1,
676
681
  size: "auto"
677
682
  },
678
683
  {
679
684
  accessorKey: "purchaseOrder.status",
680
- header: () => g("inventory.transfer.table.status"),
681
- cell(u) {
682
- const y = g(`inventory.transfer.status.${u.getValue() ?? ""}`), t = `${u.getValue() ?? ""}`.toLocaleLowerCase("en-us");
685
+ header: () => b("inventory.transfer.table.status"),
686
+ cell(i) {
687
+ const p = b(`inventory.transfer.status.${i.getValue() ?? ""}`), t = `${i.getValue() ?? ""}`.toLocaleLowerCase("en-us");
683
688
  return N(
684
689
  "div",
685
690
  {
@@ -690,7 +695,7 @@ function ks(n, l) {
690
695
  {
691
696
  class: `fm-status-badge fm-status-badge-${t}`
692
697
  },
693
- y
698
+ p
694
699
  )
695
700
  );
696
701
  },
@@ -698,14 +703,14 @@ function ks(n, l) {
698
703
  },
699
704
  {
700
705
  id: "action",
701
- cell(u) {
702
- const y = u.row.original, v = (y.purchaseOrder ? m(y.purchaseOrder) : []).map((O) => O.value === z.Print ? {
703
- ...O,
706
+ cell(i) {
707
+ const p = i.row.original, v = (p.purchaseOrder ? m(p.purchaseOrder) : []).map((D) => D.value === z.Print ? {
708
+ ...D,
704
709
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
705
- } : O);
710
+ } : D);
706
711
  return We(
707
712
  v,
708
- (O) => y.purchaseOrder ? f(O, y.purchaseOrder, y) : void 0
713
+ (D) => p.purchaseOrder ? f(D, p.purchaseOrder, p) : void 0
709
714
  );
710
715
  },
711
716
  enableSorting: !1,
@@ -717,7 +722,7 @@ function ks(n, l) {
717
722
  }
718
723
  ];
719
724
  }
720
- const h = G(() => n === "receive/request" ? i() : a());
725
+ const h = G(() => n === "receive/request" ? u() : a());
721
726
  return {
722
727
  get columnDefs() {
723
728
  return h.value;
@@ -733,13 +738,13 @@ const Ct = {
733
738
  }, Bt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ut = { class: "fm-typo-en-body-lg-600" }, Lt = { key: 0 }, Vt = { key: 1 }, Mt = {
734
739
  key: 1,
735
740
  class: "flex flex-col gap-4"
736
- }, jt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Kt = { class: "fm-typo-en-body-lg-600" }, zt = { key: 0 }, Gt = { key: 1 }, Ht = {
741
+ }, Kt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, jt = { class: "fm-typo-en-body-lg-600" }, zt = { key: 0 }, Gt = { key: 1 }, Ht = {
737
742
  key: 2,
738
743
  class: "flex flex-col gap-4"
739
744
  }, Qt = { class: "fm-typo-en-body-lg-600" }, Yt = {
740
745
  key: 3,
741
746
  class: "flex flex-col gap-4"
742
- }, Wt = { class: "fm-typo-en-body-lg-600" }, Jt = /* @__PURE__ */ Ne({
747
+ }, Wt = { class: "fm-typo-en-body-lg-600" }, Jt = /* @__PURE__ */ qe({
743
748
  __name: "NetSuiteInfo",
744
749
  props: {
745
750
  transferType: {},
@@ -750,76 +755,77 @@ const Ct = {
750
755
  scope: {}
751
756
  },
752
757
  setup(n) {
753
- const l = n, o = Be(), g = qe(), m = j(l.poRequest);
758
+ const l = n, o = Be(), b = Ne(), m = j(l.poRequest);
754
759
  at(async () => {
755
760
  var a;
756
761
  if (!l.poRequest && ((a = l.purchaseOrder) != null && a._id)) {
757
- const h = await g.getLatestPurchaseOrderRequest(l.purchaseOrder._id);
762
+ const h = await b.getLatestPurchaseOrderRequest(l.purchaseOrder._id);
758
763
  m.value = h;
759
764
  }
760
765
  });
761
766
  const s = G(
762
767
  () => {
763
- var a, h, u, y, t, v;
768
+ var a, h, i, p, t, v;
764
769
  return o.getSubsidiaryFullName(
765
- ((u = (h = (a = l.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : h.subsidiary) == null ? void 0 : u.id) || ((v = (t = (y = l.poRequest) == null ? void 0 : y.netSuite) == null ? void 0 : t.subsidiary) == null ? void 0 : v.id)
770
+ ((i = (h = (a = l.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : h.subsidiary) == null ? void 0 : i.id) || ((v = (t = (p = l.poRequest) == null ? void 0 : p.netSuite) == null ? void 0 : t.subsidiary) == null ? void 0 : v.id)
766
771
  ).fullName;
767
772
  }
768
773
  ), f = G(() => {
769
- var a, h, u, y, t, v, O, w, q, I, W, J;
770
- return (u = (h = (a = l.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : h.additionalInfo) != null && u.transactionnumber ? (v = (t = (y = l.purchaseOrder) == null ? void 0 : y.netSuite) == null ? void 0 : t.additionalInfo) == null ? void 0 : v.transactionnumber : (q = (w = (O = m.value) == null ? void 0 : O.netSuite) == null ? void 0 : w.additionalInfo) != null && q.transactionnumber ? (J = (W = (I = m.value) == null ? void 0 : I.netSuite) == null ? void 0 : W.additionalInfo) == null ? void 0 : J.transactionnumber : null;
771
- }), i = G(() => {
772
- var a, h, u, y, t, v;
773
- return (h = (a = l.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && h.length && ((y = (u = l.purchaseOrder) == null ? void 0 : u.deliveryFullfillment) == null ? void 0 : y.length) > 0 ? (v = (t = l.purchaseOrder) == null ? void 0 : t.deliveryFullfillment) == null ? void 0 : v.map((O) => {
774
+ var a, h, i, p, t, v, D, w, A, I, W, J;
775
+ return (i = (h = (a = l.purchaseOrder) == null ? void 0 : a.netSuite) == null ? void 0 : h.additionalInfo) != null && i.transactionnumber ? (v = (t = (p = l.purchaseOrder) == null ? void 0 : p.netSuite) == null ? void 0 : t.additionalInfo) == null ? void 0 : v.transactionnumber : (A = (w = (D = m.value) == null ? void 0 : D.netSuite) == null ? void 0 : w.additionalInfo) != null && A.transactionnumber ? (J = (W = (I = m.value) == null ? void 0 : I.netSuite) == null ? void 0 : W.additionalInfo) == null ? void 0 : J.transactionnumber : null;
776
+ }), u = G(() => {
777
+ var a, h, i, p, t, v;
778
+ return (h = (a = l.purchaseOrder) == null ? void 0 : a.deliveryFullfillment) != null && h.length && ((p = (i = l.purchaseOrder) == null ? void 0 : i.deliveryFullfillment) == null ? void 0 : p.length) > 0 ? (v = (t = l.purchaseOrder) == null ? void 0 : t.deliveryFullfillment) == null ? void 0 : v.map((D) => {
774
779
  var w;
775
- return (w = O.netSuite) == null ? void 0 : w.refNo;
780
+ return (w = D.netSuite) == null ? void 0 : w.refNo;
776
781
  }).join(", ") : "N/A";
777
782
  });
778
783
  return (a, h) => {
779
- var u, y, t, v, O, w, q, I, W, J, ae, ne, ee, oe;
780
- return p(o).isEnabled ? (_(), k("div", Ct, [
784
+ var i, p, t, v, D, w, A, I, W, J, ae, ne, te, oe;
785
+ return y(o).isEnabled ? (_(), q("div", Ct, [
781
786
  r("div", It, [
782
787
  h[0] || (h[0] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
783
788
  r("div", Ft, R(s.value || "N/A"), 1)
784
789
  ]),
785
- !a.isTransferBetweenOutlets && ((u = a.purchaseOrder) == null ? void 0 : u.status) !== p(se).Enum.REQUESTING && a.scope === p(Ee).RECEIVE_REQUEST ? (_(), k("div", Et, [
786
- r("div", Bt, " NetSuite " + R(a.transferType === p(he).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
790
+ !a.isTransferBetweenOutlets && ((i = a.purchaseOrder) == null ? void 0 : i.status) !== y(se).Enum.REQUESTING && a.scope === y(Ee).RECEIVE_REQUEST ? (_(), q("div", Et, [
791
+ r("div", Bt, " NetSuite " + R(a.transferType === y(he).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
787
792
  r("div", Ut, [
788
- (t = (y = a.purchaseOrder) == null ? void 0 : y.netSuite) != null && t.id ? (_(), k("span", Lt, R((O = (v = a.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : O.refNo) + " (" + R((q = (w = a.purchaseOrder) == null ? void 0 : w.netSuite) == null ? void 0 : q.id) + ") ", 1)) : (_(), k("span", Vt, "N/A"))
793
+ (t = (p = a.purchaseOrder) == null ? void 0 : p.netSuite) != null && t.id ? (_(), q("span", Lt, R((D = (v = a.purchaseOrder) == null ? void 0 : v.netSuite) == null ? void 0 : D.refNo) + " (" + R((A = (w = a.purchaseOrder) == null ? void 0 : w.netSuite) == null ? void 0 : A.id) + ") ", 1)) : (_(), q("span", Vt, "N/A"))
789
794
  ])
790
- ])) : L("", !0),
791
- !a.isTransferBetweenOutlets && m.value && ((I = a.purchaseOrder) == null ? void 0 : I.status) === p(se).Enum.REQUESTING || a.scope === p(Ee).APPROVAL ? (_(), k("div", Mt, [
792
- r("div", jt, " (Request) NetSuite " + R(a.transferType === p(he).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
793
- r("div", Kt, [
794
- (J = (W = m.value) == null ? void 0 : W.netSuite) != null && J.id ? (_(), k("span", zt, R((ne = (ae = m.value) == null ? void 0 : ae.netSuite) == null ? void 0 : ne.refNo) + " (" + R((oe = (ee = m.value) == null ? void 0 : ee.netSuite) == null ? void 0 : oe.id) + ") ", 1)) : (_(), k("span", Gt, "N/A"))
795
+ ])) : V("", !0),
796
+ !a.isTransferBetweenOutlets && m.value && ((I = a.purchaseOrder) == null ? void 0 : I.status) === y(se).Enum.REQUESTING || a.scope === y(Ee).APPROVAL ? (_(), q("div", Mt, [
797
+ r("div", Kt, " (Request) NetSuite " + R(a.transferType === y(he).PURCHASE ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
798
+ r("div", jt, [
799
+ (J = (W = m.value) == null ? void 0 : W.netSuite) != null && J.id ? (_(), q("span", zt, R((ne = (ae = m.value) == null ? void 0 : ae.netSuite) == null ? void 0 : ne.refNo) + " (" + R((oe = (te = m.value) == null ? void 0 : te.netSuite) == null ? void 0 : oe.id) + ") ", 1)) : (_(), q("span", Gt, "N/A"))
795
800
  ])
796
- ])) : L("", !0),
797
- f.value ? (_(), k("div", Ht, [
801
+ ])) : V("", !0),
802
+ f.value ? (_(), q("div", Ht, [
798
803
  h[1] || (h[1] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
799
804
  r("div", Qt, R(f.value), 1)
800
- ])) : L("", !0),
801
- p(o).isEnabled && a.transferType === p(he).TRANSFER && !a.isTransferBetweenOutlets ? (_(), k("div", Yt, [
805
+ ])) : V("", !0),
806
+ y(o).isEnabled && a.transferType === y(he).TRANSFER && !a.isTransferBetweenOutlets ? (_(), q("div", Yt, [
802
807
  h[2] || (h[2] = r("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
803
- r("div", Wt, R(i.value), 1)
804
- ])) : L("", !0)
805
- ])) : L("", !0);
808
+ r("div", Wt, R(u.value), 1)
809
+ ])) : V("", !0)
810
+ ])) : V("", !0);
806
811
  };
807
812
  }
808
- }), Xt = { class: "flex flex-row-reverse" }, Zt = /* @__PURE__ */ Ne({
813
+ }), Xt = { class: "flex flex-row-reverse" }, Zt = /* @__PURE__ */ qe({
809
814
  __name: "NetSuiteSync",
810
815
  props: {
811
816
  poRequest: {},
812
817
  purchaseOrder: {},
813
- isTransferBetweenOutlets: { type: Boolean }
818
+ isTransferBetweenOutlets: { type: Boolean },
819
+ scope: {}
814
820
  },
815
821
  setup(n) {
816
- const l = n, o = Be(), g = Ve(), m = Le(), s = j(!1);
822
+ const l = n, o = Be(), b = Ve(), m = Le(), s = j(!1);
817
823
  G(() => {
818
- var u, y, t, v;
819
- let i = !0;
820
- o.isEnabled || (i = !1);
824
+ var i, p, t, v;
825
+ let u = !0;
826
+ o.isEnabled || (u = !1);
821
827
  const a = l.purchaseOrder, h = l.poRequest;
822
- return a && ((u = a == null ? void 0 : a.supplier) != null && u.internal ? (!h && a.status == se.enum.DRAFT && (i = !1), h && !((y = h == null ? void 0 : h.netSuite) != null && y.id) && (i = !1), l.isTransferBetweenOutlets && (i = !1)) : ((a == null ? void 0 : a.status) !== se.enum.REQUESTING && a.supplier.internal && (i = !1), !h && !((t = a == null ? void 0 : a.netSuite) != null && t.id) && (i = !1), !h && ((v = a == null ? void 0 : a.netSuite) != null && v.id) && (a == null ? void 0 : a.status) == se.enum.REQUESTING && (i = !1))), i;
828
+ return a && ((i = a == null ? void 0 : a.supplier) != null && i.internal ? (!h && a.status == se.enum.DRAFT && (u = !1), h && !((p = h == null ? void 0 : h.netSuite) != null && p.id) && (u = !1), l.isTransferBetweenOutlets && (u = !1)) : ((a == null ? void 0 : a.status) !== se.enum.REQUESTING && a.supplier.internal && (u = !1), !h && !((t = a == null ? void 0 : a.netSuite) != null && t.id) && (u = !1), !h && ((v = a == null ? void 0 : a.netSuite) != null && v.id) && (a == null ? void 0 : a.status) == se.enum.REQUESTING && (u = !1))), u;
823
829
  });
824
830
  async function f() {
825
831
  s.value || m.open({
@@ -840,17 +846,20 @@ const Ct = {
840
846
  },
841
847
  secondaryActions: { text: "Not now", close: !0 }
842
848
  }).onPrimary(async () => {
843
- var i, a;
849
+ var u, a, h;
844
850
  try {
845
851
  s.value = !0;
846
- const h = ((i = l.purchaseOrder) == null ? void 0 : i._id) || ((a = l.poRequest) == null ? void 0 : a.purchaseOrderId) || "";
847
- await o.syncPurchaseOrder(h), g.open({
852
+ const i = ((u = l.purchaseOrder) == null ? void 0 : u._id) || ((a = l.poRequest) == null ? void 0 : a.purchaseOrderId) || "", p = (h = l.poRequest) == null ? void 0 : h.to.dbName;
853
+ await o.syncPurchaseOrder(
854
+ i,
855
+ l.scope === "approval" ? p : void 0
856
+ ), b.open({
848
857
  title: "Sync with NetSuite",
849
858
  message: "Requested to sync with NetSuite. Please wait a moment.",
850
859
  type: "success"
851
- }), await new Promise((u) => setTimeout(u, 5e3)), s.value = !1;
860
+ }), await new Promise((t) => setTimeout(t, 5e3)), s.value = !1;
852
861
  } catch {
853
- g.open({
862
+ b.open({
854
863
  title: "Error",
855
864
  message: "Failed to sync with NetSuite",
856
865
  type: "error"
@@ -858,9 +867,9 @@ const Ct = {
858
867
  }
859
868
  });
860
869
  }
861
- return (i, a) => {
870
+ return (u, a) => {
862
871
  const h = Q("FmButton");
863
- return _(), k("div", Xt, [
872
+ return _(), q("div", Xt, [
864
873
  E(h, {
865
874
  "prepend-icon": "sync",
866
875
  variant: "secondary",
@@ -874,7 +883,7 @@ const Ct = {
874
883
  ]);
875
884
  };
876
885
  }
877
- }), er = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, tr = { class: "flex flex-col gap-8" }, rr = { class: "flex w-full justify-end gap-16" }, sr = /* @__PURE__ */ Ne({
886
+ }), er = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, tr = { class: "flex flex-col gap-8" }, rr = { class: "flex w-full justify-end gap-16" }, sr = /* @__PURE__ */ qe({
878
887
  __name: "FulfillmentForm",
879
888
  props: {
880
889
  purchaseOrder: {},
@@ -882,39 +891,39 @@ const Ct = {
882
891
  },
883
892
  emits: ["update:show"],
884
893
  setup(n, { emit: l }) {
885
- const o = n, g = bt({
894
+ const o = n, b = bt({
886
895
  id: "",
887
896
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
888
897
  items: []
889
898
  }), m = j(), s = l;
890
899
  return at(() => {
891
- o.purchaseOrder && (console.log("props", o.purchaseOrder), g.items = o.purchaseOrder.items.map((f) => ({
900
+ o.purchaseOrder && (console.log("props", o.purchaseOrder), b.items = o.purchaseOrder.items.map((f) => ({
892
901
  id: f.id,
893
902
  sku: f.sku,
894
903
  measurement: f.measurement,
895
904
  amount: f.quantity ?? { amount: 1, precision: 0 }
896
905
  })));
897
- }), (f, i) => {
898
- const a = Q("FmTable"), h = Q("FmButton"), u = Q("FmForm");
899
- return _(), ue(u, {
906
+ }), (f, u) => {
907
+ const a = Q("FmTable"), h = Q("FmButton"), i = Q("FmForm");
908
+ return _(), ue(i, {
900
909
  ref_key: "formRef",
901
910
  ref: m,
902
911
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
903
912
  onValidationFailed: console.log,
904
- onValidationSuccess: i[1] || (i[1] = () => o.confirm(g))
913
+ onValidationSuccess: u[1] || (u[1] = () => o.confirm(b))
905
914
  }, {
906
915
  default: de(() => [
907
- i[2] || (i[2] = r("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
916
+ u[2] || (u[2] = r("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
908
917
  r("div", er, [
909
918
  r("div", tr, [
910
919
  E(a, {
911
920
  "column-defs": [
912
921
  {
913
922
  header: "Code",
914
- cell: (y) => {
915
- const t = o.purchaseOrder.items.find((v) => v.id === y.row.original.id || v.sku._id === y.row.original.sku._id);
923
+ cell: (p) => {
924
+ const t = o.purchaseOrder.items.find((v) => v.id === p.row.original.id || v.sku._id === p.row.original.sku._id);
916
925
  return N(
917
- p(Xe).FmTooltip,
926
+ y(Xe).FmTooltip,
918
927
  {
919
928
  content: t.code,
920
929
  placement: "top",
@@ -933,10 +942,10 @@ const Ct = {
933
942
  },
934
943
  {
935
944
  header: "Name",
936
- cell: (y) => {
937
- const t = o.purchaseOrder.items.find((v) => v.id === y.row.original.id || v.sku._id === y.row.original.sku._id);
945
+ cell: (p) => {
946
+ const t = o.purchaseOrder.items.find((v) => v.id === p.row.original.id || v.sku._id === p.row.original.sku._id);
938
947
  return N(
939
- p(Xe).FmTooltip,
948
+ y(Xe).FmTooltip,
940
949
  {
941
950
  content: t.name,
942
951
  placement: "top",
@@ -955,39 +964,39 @@ const Ct = {
955
964
  },
956
965
  {
957
966
  header: "Amount",
958
- cell: (y) => {
959
- const t = y.row.original, v = o.purchaseOrder.items.find((w) => w.id === t.id || w.sku._id === t.sku._id), O = t.amount ?? {
967
+ cell: (p) => {
968
+ const t = p.row.original, v = o.purchaseOrder.items.find((w) => w.id === t.id || w.sku._id === t.sku._id), D = t.amount ?? {
960
969
  amount: 1,
961
970
  precision: 0
962
971
  };
963
- return N(Nt, {
972
+ return N(qt, {
964
973
  style: {
965
974
  flex: "1 1 0%"
966
975
  },
967
976
  modelValue: {
968
- amount: O,
977
+ amount: D,
969
978
  measurement: t.measurement ?? null
970
979
  },
971
980
  key: t.id ?? t.sku._id,
972
981
  unit: t.sku.unit,
973
982
  "onUpdate:modelValue": (w) => {
974
983
  if (!w) return;
975
- const q = g.items.find((I) => I.id === t.id || I.sku._id === t.sku._id);
976
- q && (q.amount = w.amount);
984
+ const A = b.items.find((I) => I.id === t.id || I.sku._id === t.sku._id);
985
+ A && (A.amount = w.amount);
977
986
  },
978
987
  disableUnit: !0,
979
988
  rules: [
980
- p(qt)(
981
- +p(le)({ amount: 0, precision: 0 })
989
+ y(Nt)(
990
+ +y(le)({ amount: 0, precision: 0 })
982
991
  ),
983
- p(At)(+p(le)(v.quantity))
992
+ y(At)(+y(le)(v.quantity))
984
993
  ],
985
994
  applyDefaultRules: !0
986
995
  });
987
996
  }
988
997
  }
989
998
  ],
990
- "row-data": g.items,
999
+ "row-data": b.items,
991
1000
  "hide-footer": !0
992
1001
  }, null, 8, ["column-defs", "row-data"])
993
1002
  ])
@@ -1005,7 +1014,7 @@ const Ct = {
1005
1014
  label: "Cancel",
1006
1015
  size: "md",
1007
1016
  variant: "secondary",
1008
- onClick: i[0] || (i[0] = () => s("update:show", !1))
1017
+ onClick: u[0] || (u[0] = () => s("update:show", !1))
1009
1018
  })
1010
1019
  ])
1011
1020
  ]),
@@ -1017,52 +1026,57 @@ const Ct = {
1017
1026
  submitRequest: {
1018
1027
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
1019
1028
  color: "primary",
1020
- buttonVariant: re.Primary
1029
+ buttonVariant: ee.Primary
1021
1030
  },
1022
1031
  confirmDraft: {
1023
1032
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
1024
1033
  color: "primary",
1025
- buttonVariant: re.Primary
1034
+ buttonVariant: ee.Primary
1026
1035
  },
1027
1036
  cancelDraft: {
1028
1037
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
1029
1038
  color: "system-error-300",
1030
- buttonVariant: re.Destructive
1039
+ buttonVariant: ee.Destructive
1031
1040
  },
1032
1041
  approveDraft: {
1033
1042
  translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
1034
1043
  color: "primary",
1035
- buttonVariant: re.Primary
1044
+ buttonVariant: ee.Primary
1036
1045
  },
1037
1046
  rejectDraft: {
1038
1047
  translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
1039
1048
  color: "system-error-300",
1040
- buttonVariant: re.Destructive
1049
+ buttonVariant: ee.Destructive
1041
1050
  },
1042
1051
  approveRequest: {
1043
1052
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
1044
1053
  color: "primary",
1045
- buttonVariant: re.Primary
1054
+ buttonVariant: ee.Primary
1046
1055
  },
1047
1056
  processRequest: {
1048
1057
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
1049
1058
  color: "primary",
1050
- buttonVariant: re.Primary
1059
+ buttonVariant: ee.Primary
1051
1060
  },
1052
1061
  receiveStock: {
1053
1062
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
1054
1063
  color: "primary",
1055
- buttonVariant: re.Primary
1064
+ buttonVariant: ee.Primary
1056
1065
  },
1057
1066
  completeReceive: {
1058
1067
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
1059
1068
  color: "primary",
1060
- buttonVariant: re.Plain
1069
+ buttonVariant: ee.Plain
1061
1070
  },
1062
1071
  rejectRequest: {
1063
1072
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
1064
1073
  color: "system-error-300",
1065
- buttonVariant: re.Destructive
1074
+ buttonVariant: ee.Destructive
1075
+ },
1076
+ closeRequest: {
1077
+ translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
1078
+ color: "system-error-300",
1079
+ buttonVariant: ee.Destructive
1066
1080
  }
1067
1081
  };
1068
1082
  function ar() {
@@ -1090,16 +1104,16 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1090
1104
  }, Rr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xr = { class: "fm-typo-en-body-lg-600" }, Or = {
1091
1105
  key: 3,
1092
1106
  class: "flex flex-col gap-4"
1093
- }, kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dr = { class: "fm-typo-en-body-lg-600" }, Nr = {
1107
+ }, kr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Dr = { class: "fm-typo-en-body-lg-600" }, qr = {
1094
1108
  key: 4,
1095
1109
  class: "flex flex-col gap-4"
1096
- }, qr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ar = { class: "fm-typo-en-body-lg-600" }, Tr = {
1110
+ }, Nr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ar = { class: "fm-typo-en-body-lg-600" }, Tr = {
1097
1111
  key: 0,
1098
1112
  class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16 flex flex-col gap-8"
1099
- }, Pr = { class: "flex gap-8 items-center" }, $r = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Cr = { class: "flex flex-col gap-8" }, Ir = { class: "flex gap-8 items-center" }, Fr = { class: "flex-1 fm-typo-en-body-lg-600" }, Er = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Br = { class: "flex w-full gap-4" }, Ur = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Lr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Vr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Mr = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, jr = {
1113
+ }, Pr = { class: "flex gap-8 items-center" }, $r = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, Cr = { class: "flex flex-col gap-8" }, Ir = { class: "flex gap-8 items-center" }, Fr = { class: "flex-1 fm-typo-en-body-lg-600" }, Er = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary flex flex-col gap-4" }, Br = { class: "flex w-full gap-4" }, Ur = { class: "basis-1/2 shrink-0 grow fm-typo-en-body-lg-400 line-clamp-2" }, Lr = { class: "fm-typo-en-body-lg-600 line-clamp-2" }, Vr = { class: "flex w-full gap-4 fm-typo-en-body-sm-400" }, Mr = { class: "grow fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-1" }, Kr = {
1100
1114
  key: 0,
1101
1115
  class: "line-clamp-1 fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1102
- }, Kr = { class: "py-8" }, zr = { class: "flex justify-end gap-4 items-center" }, Gr = { class: "fm-typo-en-body-lg-600" }, Hr = {
1116
+ }, jr = { class: "py-8" }, zr = { class: "flex justify-end gap-4 items-center" }, Gr = { class: "fm-typo-en-body-lg-600" }, Hr = {
1103
1117
  key: 1,
1104
1118
  class: "flex-1 xs:w-screen xs:max-w-full"
1105
1119
  }, Qr = {
@@ -1120,7 +1134,7 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1120
1134
  }, ls = { class: "flex-1 flex flex-col items-center" }, is = {
1121
1135
  class: "py-12 flex flex-col gap-4 flex-1",
1122
1136
  name: "delivery details"
1123
- }, us = { class: "flex flex-col gap-8" }, ds = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ms = { class: "flex flex-col gap-4" }, fs = { class: "flex gap-8 xs:flex-col" }, Ds = /* @__PURE__ */ Ne({
1137
+ }, us = { class: "flex flex-col gap-8" }, ds = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ms = { class: "flex flex-col gap-4" }, fs = { class: "flex gap-8 xs:flex-col" }, Ds = /* @__PURE__ */ qe({
1124
1138
  __name: "TransferDetails",
1125
1139
  props: {
1126
1140
  poRequest: {},
@@ -1134,7 +1148,7 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1134
1148
  },
1135
1149
  emits: ["update:show", "submitted"],
1136
1150
  setup(n, { emit: l }) {
1137
- const o = n, g = l, m = Le(), s = Ve(), f = Me(), i = Dt(), a = me(), h = Ue(), u = G(
1151
+ const o = n, b = l, m = Le(), s = Ve(), f = Me(), u = Dt(), a = me(), h = Ue(), i = G(
1138
1152
  () => {
1139
1153
  var e, c;
1140
1154
  return {
@@ -1142,47 +1156,48 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1142
1156
  name: ((c = h.sessionUser.value) == null ? void 0 : c.displayName) ?? ""
1143
1157
  };
1144
1158
  }
1145
- ), y = ar(), { t } = ot(), v = G(
1159
+ ), p = ar(), { t } = ot(), v = G(
1146
1160
  () => {
1147
- var e, c, b, P;
1148
- return ((c = (e = o.purchaseOrder) == null ? void 0 : e.supplier) == null ? void 0 : c.internal) === "restaurant" || ((P = (b = o.purchaseOrder) == null ? void 0 : b.supplier) == null ? void 0 : P.internal) === "warehouse" ? he.TRANSFER : he.PURCHASE;
1161
+ var e, c, g, k;
1162
+ return ((c = (e = o.purchaseOrder) == null ? void 0 : e.supplier) == null ? void 0 : c.internal) === "restaurant" || ((k = (g = o.purchaseOrder) == null ? void 0 : g.supplier) == null ? void 0 : k.internal) === "warehouse" ? he.TRANSFER : he.PURCHASE;
1149
1163
  }
1150
- ), O = G(() => {
1151
- var e, c, b;
1152
- return v.value === he.TRANSFER && ((e = o.transferToDbName) == null ? void 0 : e.startsWith("restaurant")) && ((b = (c = o.purchaseOrder) == null ? void 0 : c.supplier) == null ? void 0 : b.internal) === "restaurant";
1153
- }), w = j(!1), q = j(""), I = j(!0), W = qe(), J = Tt(W.getWorkflowConfig), ae = lt(), ne = G(() => {
1164
+ ), D = G(() => {
1165
+ var e, c, g;
1166
+ return v.value === he.TRANSFER && ((e = o.transferToDbName) == null ? void 0 : e.startsWith("restaurant")) && ((g = (c = o.purchaseOrder) == null ? void 0 : c.supplier) == null ? void 0 : g.internal) === "restaurant";
1167
+ }), w = j(!1), A = j(""), I = j(!0), W = Ne(), J = Tt(W.getWorkflowConfig), ae = lt(), ne = G(() => {
1154
1168
  if (!o.purchaseOrder)
1155
1169
  return [];
1156
1170
  const e = J.result.value;
1157
1171
  if (e.state === Ze.loading)
1158
1172
  return [];
1159
1173
  const c = {
1160
- user: u.value,
1174
+ user: i.value,
1161
1175
  executedAt: a.locations.computeFirst(
1162
- (b) => {
1163
- var P;
1164
- return b.dbName === ((P = a._currentLocation) == null ? void 0 : P.dbName) ? b : null;
1176
+ (k) => {
1177
+ var U;
1178
+ return k.dbName === ((U = a._currentLocation) == null ? void 0 : U.dbName) ? k : null;
1165
1179
  }
1166
1180
  ),
1167
1181
  purchaseOrderRequest: o.poRequest,
1168
1182
  purchaseOrder: o.purchaseOrder
1169
1183
  };
1170
- return e.state === Ze.error ? (console.error("Error fetching workflow config:", e.error), Ce.getAvailableActions({
1184
+ let g = [];
1185
+ return e.state === Ze.error ? (console.error("Error fetching workflow config:", e.error), g = Ce.getAvailableActions({
1171
1186
  ...c,
1172
1187
  purchaseOrderConfig: Ce.getDefaultConfig()
1173
1188
  }).actions.filter(
1174
- (b) => (
1189
+ (k) => (
1175
1190
  // TODO: create receiveStock & processRequest dialog
1176
1191
  // to create their payload
1177
- b !== D.enum.receiveStock && b !== D.enum.processRequest
1192
+ k !== x.enum.receiveStock && k !== x.enum.processRequest && k !== x.enum.closeRequest
1178
1193
  )
1179
- )) : Ce.getAvailableActions({
1194
+ )) : g = Ce.getAvailableActions({
1180
1195
  ...c,
1181
1196
  purchaseOrderConfig: e.data
1182
1197
  }).actions.filter(
1183
- (b) => b !== D.enum.receiveStock && b !== D.enum.processRequest
1184
- );
1185
- }), ee = kt(o, "show"), oe = G(() => [
1198
+ (k) => k !== x.enum.receiveStock && k !== x.enum.processRequest && k !== x.enum.closeRequest
1199
+ ), o.scope === "approval" && (g = g.filter((k) => k !== x.enum.completeReceive)), g;
1200
+ }), te = kt(o, "show"), oe = G(() => [
1186
1201
  {
1187
1202
  label: t("inventory.transfer.receiveRequest.details.overview"),
1188
1203
  value: "overview"
@@ -1198,44 +1213,47 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1198
1213
  e && (ie.value = oe.value[0]);
1199
1214
  }
1200
1215
  );
1201
- async function Ae(e, c, b, P, K) {
1202
- return new Promise((V, Y) => {
1216
+ async function Ae(e, c, g, k, U) {
1217
+ return new Promise((M, Y) => {
1203
1218
  m.open({
1204
1219
  closeButton: !1,
1205
- title: P.title,
1206
- message: P.message,
1207
- primaryActions: P.primaryActions,
1220
+ title: k.title,
1221
+ message: k.message,
1222
+ primaryActions: k.primaryActions,
1208
1223
  secondaryActions: { text: "No", close: !1 }
1209
1224
  }).onPrimary(async () => {
1210
- var d, A, U, H;
1225
+ var d, T, L, H;
1211
1226
  try {
1212
1227
  await ae({
1213
1228
  operate: {
1214
- operation: b,
1229
+ operation: g,
1215
1230
  doc: e,
1216
1231
  options: c
1217
1232
  },
1218
1233
  operateV2: {
1219
1234
  _id: ((d = o.purchaseOrder) == null ? void 0 : d._id) ?? "",
1220
- _rev: ((A = o.purchaseOrder) == null ? void 0 : A._rev) ?? "",
1221
- action: b
1235
+ _rev: ((T = o.purchaseOrder) == null ? void 0 : T._rev) ?? "",
1236
+ action: g,
1237
+ payload: {
1238
+ fulfillment: c.fulfillment
1239
+ }
1222
1240
  // add payload if action is receiveStock or processRequest
1223
1241
  },
1224
- transferTo: (H = (U = o.poRequest) == null ? void 0 : U.to) == null ? void 0 : H.dbName
1225
- }).delayed(1e3), V("submitted");
1242
+ transferTo: (H = (L = o.poRequest) == null ? void 0 : L.to) == null ? void 0 : H.dbName
1243
+ }).delayed(1e3), M("submitted");
1226
1244
  } catch (C) {
1227
1245
  Y(C);
1228
1246
  }
1229
1247
  }).onSecondary(() => {
1230
- V("cancelled");
1231
- for (let d = 0; d < K + 2; d++)
1248
+ M("cancelled");
1249
+ for (let d = 0; d < U + 2; d++)
1232
1250
  m.close();
1233
1251
  }).onClose(() => {
1234
1252
  });
1235
1253
  });
1236
1254
  }
1237
1255
  async function be(e) {
1238
- if (e === D.enum.receiveStock)
1256
+ if (e === x.enum.receiveStock)
1239
1257
  return;
1240
1258
  const c = ct[e];
1241
1259
  if (!c) {
@@ -1246,16 +1264,16 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1246
1264
  });
1247
1265
  return;
1248
1266
  }
1249
- const { successMessage: b } = c;
1267
+ const { successMessage: g } = c;
1250
1268
  if (o.purchaseOrder) {
1251
- q.value = `${e}`, w.value = !0, I.value = !1;
1252
- const P = {};
1253
- let K = 0;
1254
- if ((e === D.enum.confirmDraft || // auto receive for warehouse to warehouse
1255
- e === D.enum.completeReceive) && f.autoReceiveWarehouse)
1256
- P.autoReceive = !0;
1257
- else if (e === D.enum.approveRequest && f.acceptRequireFulfillment) {
1258
- const V = await new Promise((Y, d) => {
1269
+ A.value = `${e}`, w.value = !0, I.value = !1;
1270
+ const k = {};
1271
+ let U = 0;
1272
+ if ((e === x.enum.confirmDraft || // auto receive for warehouse to warehouse
1273
+ e === x.enum.completeReceive) && f.autoReceiveWarehouse)
1274
+ k.autoReceive = !0;
1275
+ else if (e === x.enum.approveRequest && f.acceptRequireFulfillment) {
1276
+ const M = await new Promise((Y, d) => {
1259
1277
  m.open({
1260
1278
  closeButton: !1,
1261
1279
  title: "Confirm transfer amount",
@@ -1263,50 +1281,50 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1263
1281
  dialogComponentProps: {
1264
1282
  purchaseOrder: o.purchaseOrder,
1265
1283
  confirm: Y,
1266
- "onUpdate:show": (A) => {
1267
- A || (q.value = "", w.value = !1, I.value = !0, K++, m.close()), d("cancelled");
1284
+ "onUpdate:show": (T) => {
1285
+ T || (A.value = "", w.value = !1, I.value = !0, U++, m.close()), d("cancelled");
1268
1286
  }
1269
1287
  }
1270
1288
  });
1271
1289
  });
1272
- P.fulfillment = V;
1290
+ k.fulfillment = M;
1273
1291
  }
1274
1292
  try {
1275
1293
  await Ae(
1276
1294
  o.purchaseOrder,
1277
- P,
1295
+ k,
1278
1296
  e,
1279
1297
  c,
1280
- K
1298
+ U
1281
1299
  ) === "submitted" && (s.open({
1282
1300
  title: "Success",
1283
- message: b,
1301
+ message: g,
1284
1302
  type: "success"
1285
- }), g("update:show", !1), g("submitted"));
1286
- } catch (V) {
1303
+ }), b("update:show", !1), b("submitted"));
1304
+ } catch (M) {
1287
1305
  s.open({
1288
1306
  title: "Something went wrong",
1289
1307
  message: "Please try again.",
1290
1308
  type: "error"
1291
- }), console.error("Error when submitting PO operation", e, o.purchaseOrder, V);
1309
+ }), console.error("Error when submitting PO operation", e, o.purchaseOrder, M);
1292
1310
  } finally {
1293
- q.value = "", w.value = !1, I.value = !0;
1311
+ A.value = "", w.value = !1, I.value = !0;
1294
1312
  }
1295
1313
  }
1296
1314
  }
1297
1315
  const Te = G(() => {
1298
1316
  var e, c;
1299
1317
  return ((e = o.purchaseOrder) == null ? void 0 : e.status) === se.enum.RECEIVING || ((c = o.purchaseOrder) == null ? void 0 : c.status) === se.enum.COMPLETE;
1300
- }), x = G(() => {
1301
- var V, Y, d;
1302
- const b = (((V = o.purchaseOrder) == null ? void 0 : V.deliveryOrder) ?? []).flatMap((A) => A.received ?? []).reduce(
1303
- (A, U) => {
1304
- const H = A[U.sku._id] ?? [];
1305
- return A[U.sku._id] = [...H, U], A;
1318
+ }), O = G(() => {
1319
+ var M, Y, d;
1320
+ const g = (((M = o.purchaseOrder) == null ? void 0 : M.deliveryOrder) ?? []).flatMap((T) => T.received ?? []).reduce(
1321
+ (T, L) => {
1322
+ const H = T[L.sku._id] ?? [];
1323
+ return T[L.sku._id] = [...H, L], T;
1306
1324
  },
1307
1325
  {}
1308
- ), P = Object.entries(b).reduce(
1309
- (A, [U, H]) => {
1326
+ ), k = Object.entries(g).reduce(
1327
+ (T, [L, H]) => {
1310
1328
  const C = H.reduce((X, F) => {
1311
1329
  const ce = yt(
1312
1330
  X,
@@ -1314,16 +1332,16 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1314
1332
  );
1315
1333
  return Fe(ce, F.amount);
1316
1334
  }, ke(0));
1317
- return A[U] = C, A;
1335
+ return T[L] = C, T;
1318
1336
  },
1319
1337
  {}
1320
- ), K = ((Y = o.purchaseOrder) == null ? void 0 : Y.items) ?? [];
1321
- for (const A of K)
1322
- P[d = A.sku._id] ?? (P[d] = ke(0));
1323
- return P;
1338
+ ), U = ((Y = o.purchaseOrder) == null ? void 0 : Y.items) ?? [];
1339
+ for (const T of U)
1340
+ k[d = T.sku._id] ?? (k[d] = ke(0));
1341
+ return k;
1324
1342
  }), S = G(() => {
1325
- var V, Y;
1326
- const e = ((V = o.purchaseOrder) == null ? void 0 : V.deliveryOrder) ?? [], c = ((Y = o.purchaseOrder) == null ? void 0 : Y.deliveryFullfillment) ?? [], b = [
1343
+ var M, Y;
1344
+ const e = ((M = o.purchaseOrder) == null ? void 0 : M.deliveryOrder) ?? [], c = ((Y = o.purchaseOrder) == null ? void 0 : Y.deliveryFullfillment) ?? [], g = [
1327
1345
  ...e.map((d) => ({
1328
1346
  createdAt: d.createdAt,
1329
1347
  type: "grn",
@@ -1335,13 +1353,13 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1335
1353
  doc: d
1336
1354
  }))
1337
1355
  ];
1338
- b.reverse().sort((d, A) => d.createdAt.localeCompare(A.createdAt));
1339
- function P(d) {
1356
+ g.reverse().sort((d, T) => d.createdAt.localeCompare(T.createdAt));
1357
+ function k(d) {
1340
1358
  var H, C, X, F, ce, ge, _e, we, $;
1341
- const A = c.findIndex((T) => T.id === d.fullfillmentId), U = [
1342
- (C = (H = c[A]) == null ? void 0 : H.netSuite) != null && C.refNo ? {
1359
+ const T = c.findIndex((P) => P.id === d.fullfillmentId), L = [
1360
+ (C = (H = c[T]) == null ? void 0 : H.netSuite) != null && C.refNo ? {
1343
1361
  label: "Fulfillment's ref no. (Netsuite)",
1344
- values: [(F = (X = c[A]) == null ? void 0 : X.netSuite) == null ? void 0 : F.refNo]
1362
+ values: [(F = (X = c[T]) == null ? void 0 : X.netSuite) == null ? void 0 : F.refNo]
1345
1363
  } : null,
1346
1364
  (ce = d == null ? void 0 : d.netSuite) != null && ce.refNo ? {
1347
1365
  label: "Netsuite ref no.",
@@ -1368,8 +1386,8 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1368
1386
  },
1369
1387
  {
1370
1388
  label: "Received items",
1371
- values: d.received.map((T) => {
1372
- var M;
1389
+ values: d.received.map((P) => {
1390
+ var K;
1373
1391
  return N("div", [
1374
1392
  N(
1375
1393
  "div",
@@ -1388,14 +1406,14 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1388
1406
  {
1389
1407
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
1390
1408
  },
1391
- `${T.sku.name}`
1409
+ `${P.sku.name}`
1392
1410
  ),
1393
1411
  N(
1394
1412
  "span",
1395
1413
  {
1396
1414
  class: "fm-typo-en-body-md-400"
1397
1415
  },
1398
- `${T.sku.code} `
1416
+ `${P.sku.code} `
1399
1417
  )
1400
1418
  ]
1401
1419
  ),
@@ -1416,14 +1434,14 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1416
1434
  {
1417
1435
  class: "fm-typo-en-body-lg-600 self-end"
1418
1436
  },
1419
- le(T.amount, !1)
1437
+ le(P.amount, !1)
1420
1438
  ),
1421
1439
  N(
1422
1440
  "span",
1423
1441
  {
1424
1442
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
1425
1443
  },
1426
- ((M = T.measurement) == null ? void 0 : M.abbrev) ?? T.sku.unit.abbrev
1444
+ ((K = P.measurement) == null ? void 0 : K.abbrev) ?? P.sku.unit.abbrev
1427
1445
  )
1428
1446
  ]
1429
1447
  ),
@@ -1432,7 +1450,7 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1432
1450
  {
1433
1451
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1434
1452
  },
1435
- `${T.cost ? `(${xe(T.cost)})` : ""}`
1453
+ `${P.cost ? `(${xe(P.cost)})` : ""}`
1436
1454
  )
1437
1455
  ]
1438
1456
  )
@@ -1449,24 +1467,24 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1449
1467
  label: "Remark",
1450
1468
  values: [d.remark]
1451
1469
  } : null,
1452
- A > -1 ? {
1470
+ T > -1 ? {
1453
1471
  label: "Fulfilment's sequence",
1454
- values: [`${A + 1}`]
1472
+ values: [`${T + 1}`]
1455
1473
  } : null,
1456
- ...U
1457
- ].filter((T) => T)
1474
+ ...L
1475
+ ].filter((P) => P)
1458
1476
  };
1459
1477
  }
1460
- function K(d) {
1461
- var U, H;
1462
- const A = c.findIndex((C) => C.id === d.id);
1478
+ function U(d) {
1479
+ var L, H;
1480
+ const T = c.findIndex((C) => C.id === d.id);
1463
1481
  return {
1464
1482
  header: "Fulfillment",
1465
1483
  date: Pe(new Date(d.createdAt)),
1466
1484
  info: [
1467
1485
  {
1468
1486
  label: "Sequence",
1469
- values: [String(A + 1)]
1487
+ values: [String(T + 1)]
1470
1488
  },
1471
1489
  {
1472
1490
  label: "Receiveable items",
@@ -1543,19 +1561,19 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1543
1561
  ]);
1544
1562
  })
1545
1563
  },
1546
- (U = d.netSuite) != null && U.refNo ? {
1564
+ (L = d.netSuite) != null && L.refNo ? {
1547
1565
  label: "Ref no. (Netsuite)",
1548
1566
  values: [(H = d.netSuite) == null ? void 0 : H.refNo]
1549
1567
  } : null
1550
1568
  ].filter((C) => C)
1551
1569
  };
1552
1570
  }
1553
- return b.map((d) => {
1571
+ return g.map((d) => {
1554
1572
  switch (d.type) {
1555
1573
  case "grn":
1556
- return P(d.doc);
1574
+ return k(d.doc);
1557
1575
  case "fulfillment":
1558
- return K(d.doc);
1576
+ return U(d.doc);
1559
1577
  }
1560
1578
  });
1561
1579
  }), B = G(() => {
@@ -1564,18 +1582,18 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1564
1582
  ...ke(0),
1565
1583
  currency: Je()
1566
1584
  };
1567
- return ((c = o.purchaseOrder) == null ? void 0 : c.items.reduce((b, P) => ({
1568
- ...Fe(b, P.totalCost ?? e),
1585
+ return ((c = o.purchaseOrder) == null ? void 0 : c.items.reduce((g, k) => ({
1586
+ ...Fe(g, k.totalCost ?? e),
1569
1587
  currency: Je()
1570
1588
  }), e)) ?? e;
1571
1589
  });
1572
1590
  return (e, c) => {
1573
1591
  var C, X;
1574
- const b = Q("FmButtonGroup"), P = Q("FmChip"), K = Q("FmMenuDivider"), V = Q("FmCard"), Y = Q("FmIcon"), d = Q("FmTooltip"), A = Q("FmSpacer"), U = Q("FmButton"), H = Q("FmSideSheet");
1592
+ const g = Q("FmButtonGroup"), k = Q("FmChip"), U = Q("FmMenuDivider"), M = Q("FmCard"), Y = Q("FmIcon"), d = Q("FmTooltip"), T = Q("FmSpacer"), L = Q("FmButton"), H = Q("FmSideSheet");
1575
1593
  return _(), ue(H, {
1576
- header: p(t)("inventory.transfer.receiveRequest.details.title") + ((C = e.purchaseOrder) != null && C.seqNumber ? ` #${(X = e.purchaseOrder) == null ? void 0 : X.seqNumber}` : ""),
1577
- modelValue: p(ee),
1578
- "onUpdate:modelValue": c[4] || (c[4] = (F) => _t(ee) ? ee.value = F : null),
1594
+ header: y(t)("inventory.transfer.receiveRequest.details.title") + ((C = e.purchaseOrder) != null && C.seqNumber ? ` #${(X = e.purchaseOrder) == null ? void 0 : X.seqNumber}` : ""),
1595
+ modelValue: y(te),
1596
+ "onUpdate:modelValue": c[4] || (c[4] = (F) => _t(te) ? te.value = F : null),
1579
1597
  "dismiss-away": I.value,
1580
1598
  "close-button": "",
1581
1599
  "max-width": 600
@@ -1585,97 +1603,98 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1585
1603
  return [
1586
1604
  r("div", nr, [
1587
1605
  r("div", null, [
1588
- E(b, {
1606
+ E(g, {
1589
1607
  items: oe.value,
1590
1608
  modelValue: ie.value,
1591
1609
  "onUpdate:modelValue": c[0] || (c[0] = ($) => ie.value = $)
1592
1610
  }, null, 8, ["items", "modelValue"])
1593
1611
  ]),
1594
- ie.value.value === "overview" ? (_(), k(te, { key: 0 }, [
1612
+ ie.value.value === "overview" ? (_(), q(re, { key: 0 }, [
1595
1613
  r("div", null, [
1596
- E(V, {
1614
+ E(M, {
1597
1615
  variant: "outlined",
1598
1616
  class: "flex flex-col gap-8 px-12 py-16"
1599
1617
  }, {
1600
1618
  default: de(() => {
1601
- var $, T, M, fe, pe, Re, je, Ke, ze, Ge, He, Qe;
1619
+ var $, P, K, fe, pe, Re, Ke, je, ze, Ge, He, Qe;
1602
1620
  return [
1603
1621
  r("div", or, [
1604
- r("div", cr, R(p(t)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1622
+ r("div", cr, R(y(t)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
1605
1623
  r("div", null, [
1606
- E(P, {
1607
- label: p(t)(`inventory.transfer.status.${($ = e.purchaseOrder) == null ? void 0 : $.status}`),
1608
- class: Oe(`fm-status-badge fm-status-badge-${(M = (T = e.purchaseOrder) == null ? void 0 : T.status) == null ? void 0 : M.toLocaleLowerCase("en-us")}`),
1624
+ E(k, {
1625
+ label: y(t)(`inventory.transfer.status.${($ = e.purchaseOrder) == null ? void 0 : $.status}`),
1626
+ class: Oe(`fm-status-badge fm-status-badge-${(K = (P = e.purchaseOrder) == null ? void 0 : P.status) == null ? void 0 : K.toLocaleLowerCase("en-us")}`),
1609
1627
  compact: ""
1610
1628
  }, null, 8, ["label", "class"])
1611
1629
  ])
1612
1630
  ]),
1613
- E(K),
1631
+ E(U),
1614
1632
  r("div", lr, [
1615
1633
  r("div", ir, [
1616
1634
  r("div", ur, [
1617
- r("div", dr, R(p(t)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1635
+ r("div", dr, R(y(t)("inventory.transfer.receiveRequest.details.createdAt")), 1)
1618
1636
  ]),
1619
- r("div", mr, R(p(De)(((fe = e.purchaseOrder) == null ? void 0 : fe._id) ?? "")), 1)
1637
+ r("div", mr, R(y(De)(((fe = e.purchaseOrder) == null ? void 0 : fe._id) ?? "")), 1)
1620
1638
  ]),
1621
- (pe = e.purchaseOrder) != null && pe.effectiveAt ? (_(), k("div", fr, [
1622
- r("div", pr, R(p(t)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1623
- r("div", yr, R(p(st)(new Date((Re = e.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1624
- ])) : L("", !0),
1639
+ (pe = e.purchaseOrder) != null && pe.effectiveAt ? (_(), q("div", fr, [
1640
+ r("div", pr, R(y(t)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
1641
+ r("div", yr, R(y(st)(new Date((Re = e.purchaseOrder) == null ? void 0 : Re.effectiveAt))), 1)
1642
+ ])) : V("", !0),
1625
1643
  r("div", vr, [
1626
- r("div", hr, R(p(t)("inventory.transfer.receiveRequest.details.type.title")), 1),
1627
- r("div", br, R(p(t)(
1644
+ r("div", hr, R(y(t)("inventory.transfer.receiveRequest.details.type.title")), 1),
1645
+ r("div", br, R(y(t)(
1628
1646
  `inventory.transfer.receiveRequest.details.type.${v.value.toLocaleLowerCase("en-US")}`
1629
1647
  )), 1)
1630
1648
  ]),
1631
- (Ke = (je = e.purchaseOrder) == null ? void 0 : je.supplier) != null && Ke.name ? (_(), k("div", gr, [
1632
- r("div", _r, R(p(t)("inventory.transfer.receiveRequest.details.from")), 1),
1649
+ (je = (Ke = e.purchaseOrder) == null ? void 0 : Ke.supplier) != null && je.name ? (_(), q("div", gr, [
1650
+ r("div", _r, R(y(t)("inventory.transfer.receiveRequest.details.from")), 1),
1633
1651
  r("div", wr, R((Ge = (ze = e.purchaseOrder) == null ? void 0 : ze.supplier) == null ? void 0 : Ge.name), 1)
1634
- ])) : L("", !0),
1635
- e.transferTo ? (_(), k("div", Sr, [
1636
- r("div", Rr, R(p(t)("inventory.transfer.receiveRequest.details.to")), 1),
1652
+ ])) : V("", !0),
1653
+ e.transferTo ? (_(), q("div", Sr, [
1654
+ r("div", Rr, R(y(t)("inventory.transfer.receiveRequest.details.to")), 1),
1637
1655
  r("div", xr, R(e.transferTo), 1)
1638
- ])) : L("", !0),
1639
- (He = e.purchaseOrder) != null && He.ref ? (_(), k("div", Or, [
1640
- r("div", kr, R(p(t)("inventory.transfer.receiveRequest.details.reference")), 1),
1656
+ ])) : V("", !0),
1657
+ (He = e.purchaseOrder) != null && He.ref ? (_(), q("div", Or, [
1658
+ r("div", kr, R(y(t)("inventory.transfer.receiveRequest.details.reference")), 1),
1641
1659
  r("div", Dr, R(e.purchaseOrder.ref), 1)
1642
- ])) : L("", !0),
1643
- (Qe = e.purchaseOrder) != null && Qe.remark ? (_(), k("div", Nr, [
1644
- r("div", qr, R(p(t)("inventory.transfer.receiveRequest.details.remark")), 1),
1660
+ ])) : V("", !0),
1661
+ (Qe = e.purchaseOrder) != null && Qe.remark ? (_(), q("div", qr, [
1662
+ r("div", Nr, R(y(t)("inventory.transfer.receiveRequest.details.remark")), 1),
1645
1663
  r("div", Ar, R(e.purchaseOrder.remark), 1)
1646
- ])) : L("", !0)
1664
+ ])) : V("", !0)
1647
1665
  ])
1648
1666
  ];
1649
1667
  }),
1650
1668
  _: 1
1651
1669
  })
1652
1670
  ]),
1653
- p(i).isNetSuiteEnabled && !O.value ? (_(), k("div", Tr, [
1671
+ y(u).isNetSuiteEnabled && !D.value ? (_(), q("div", Tr, [
1654
1672
  r("div", Pr, [
1655
1673
  c[5] || (c[5] = r("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1656
1674
  r("div", null, [
1657
1675
  E(Zt, {
1658
1676
  "po-request": e.poRequest,
1659
1677
  "purchase-order": e.purchaseOrder,
1660
- "is-transfer-between-outlets": O.value
1661
- }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets"])
1678
+ "is-transfer-between-outlets": D.value,
1679
+ scope: e.scope
1680
+ }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
1662
1681
  ])
1663
1682
  ]),
1664
- E(K),
1683
+ E(U),
1665
1684
  E(Jt, {
1666
1685
  "po-request": e.poRequest,
1667
1686
  "purchase-order": e.purchaseOrder,
1668
1687
  "transfer-type": v.value,
1669
1688
  "transfer-to-db-name": e.transferToDbName,
1670
- "is-transfer-between-outlets": O.value,
1689
+ "is-transfer-between-outlets": D.value,
1671
1690
  scope: e.scope
1672
1691
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
1673
- ])) : L("", !0),
1692
+ ])) : V("", !0),
1674
1693
  r("div", $r, [
1675
1694
  r("div", Cr, [
1676
1695
  r("div", Ir, [
1677
1696
  r("span", Fr, [
1678
- $e(R(Te.value ? p(t)("inventory.transfer.receiveRequest.details.receivedItems") : p(t)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1697
+ $e(R(Te.value ? y(t)("inventory.transfer.receiveRequest.details.receivedItems") : y(t)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
1679
1698
  (ce = (F = e.purchaseOrder) == null ? void 0 : F.netSuite) != null && ce.missingItems && ((_e = (ge = e.purchaseOrder) == null ? void 0 : ge.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (_(), ue(d, {
1680
1699
  key: 0,
1681
1700
  variant: "rich",
@@ -1683,10 +1702,10 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1683
1702
  "z-index": 51
1684
1703
  }, {
1685
1704
  content: de(() => {
1686
- var $, T;
1705
+ var $, P;
1687
1706
  return [
1688
1707
  r("div", Er, [
1689
- (_(!0), k(te, null, ye((T = ($ = e.purchaseOrder) == null ? void 0 : $.netSuite) == null ? void 0 : T.missingItems, (M, fe) => (_(), k("div", {
1708
+ (_(!0), q(re, null, ye((P = ($ = e.purchaseOrder) == null ? void 0 : $.netSuite) == null ? void 0 : P.missingItems, (K, fe) => (_(), q("div", {
1690
1709
  class: "flex justify-center align-middle",
1691
1710
  key: fe
1692
1711
  }, [
@@ -1694,7 +1713,7 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1694
1713
  name: "arrow_right",
1695
1714
  size: "sm"
1696
1715
  }),
1697
- $e(" " + R(`(${M.netSuiteId}) ${M.name}: ${M.reason}`), 1)
1716
+ $e(" " + R(`(${K.netSuiteId}) ${K.name}: ${K.reason}`), 1)
1698
1717
  ]))), 128))
1699
1718
  ])
1700
1719
  ];
@@ -1707,48 +1726,48 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1707
1726
  })
1708
1727
  ]),
1709
1728
  _: 1
1710
- })) : L("", !0)
1729
+ })) : V("", !0)
1711
1730
  ])
1712
1731
  ]),
1713
- E(K),
1714
- (_(!0), k(te, null, ye(((we = e.purchaseOrder) == null ? void 0 : we.items) ?? [], ($) => {
1715
- var T;
1716
- return _(), k("div", {
1732
+ E(U),
1733
+ (_(!0), q(re, null, ye(((we = e.purchaseOrder) == null ? void 0 : we.items) ?? [], ($) => {
1734
+ var P;
1735
+ return _(), q("div", {
1717
1736
  key: $.code,
1718
1737
  class: "flex flex-col"
1719
1738
  }, [
1720
1739
  r("div", Br, [
1721
1740
  r("div", Ur, R($.name), 1),
1722
- r("div", Lr, R(p(le)(x.value[$.sku._id], !1)) + "/" + R(p(nt)($.quantity, $.sku.unit, $.measurement)), 1)
1741
+ r("div", Lr, R(y(le)(O.value[$.sku._id], !1)) + "/" + R(y(nt)($.quantity, $.sku.unit, $.measurement)), 1)
1723
1742
  ]),
1724
1743
  r("div", Vr, [
1725
1744
  r("div", Mr, R($.code), 1),
1726
- (T = $.totalCost) != null && T.amount && p(f).enableTotalCost ? (_(), k("div", jr, " (" + R(p(xe)($.totalCost)) + ") ", 1)) : L("", !0)
1745
+ (P = $.totalCost) != null && P.amount && y(f).enableTotalCost ? (_(), q("div", Kr, " (" + R(y(xe)($.totalCost)) + ") ", 1)) : V("", !0)
1727
1746
  ])
1728
1747
  ]);
1729
1748
  }), 128)),
1730
- +p(le)(B.value) ? (_(), k(te, { key: 0 }, [
1731
- r("div", Kr, [
1732
- E(K)
1749
+ +y(le)(B.value) ? (_(), q(re, { key: 0 }, [
1750
+ r("div", jr, [
1751
+ E(U)
1733
1752
  ]),
1734
1753
  r("div", zr, [
1735
1754
  c[6] || (c[6] = r("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
1736
- r("div", Gr, R(p(xe)(B.value)), 1)
1755
+ r("div", Gr, R(y(xe)(B.value)), 1)
1737
1756
  ])
1738
- ], 64)) : L("", !0)
1757
+ ], 64)) : V("", !0)
1739
1758
  ])
1740
1759
  ])
1741
- ], 64)) : ie.value.value === "deliveryHistory" ? (_(), k("div", Hr, [
1742
- S.value.length ? (_(), k("div", Xr, [
1743
- (_(!0), k(te, null, ye(S.value, ($, T) => (_(), k(te, { key: T }, [
1760
+ ], 64)) : ie.value.value === "deliveryHistory" ? (_(), q("div", Hr, [
1761
+ S.value.length ? (_(), q("div", Xr, [
1762
+ (_(!0), q(re, null, ye(S.value, ($, P) => (_(), q(re, { key: P }, [
1744
1763
  r("div", Zr, [
1745
1764
  r("div", es, [
1746
1765
  r("div", ts, [
1747
1766
  r("div", {
1748
1767
  class: Oe([
1749
1768
  {
1750
- "bg-fm-color-primary": T !== 0,
1751
- "bg-white": T === 0
1769
+ "bg-fm-color-primary": P !== 0,
1770
+ "bg-white": P === 0
1752
1771
  },
1753
1772
  "w-[2px] h-full"
1754
1773
  ])
@@ -1759,8 +1778,8 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1759
1778
  r("div", {
1760
1779
  class: Oe([
1761
1780
  {
1762
- "bg-fm-color-primary": T < S.value.length - 1,
1763
- "bg-white": T >= S.value.length - 1
1781
+ "bg-fm-color-primary": P < S.value.length - 1,
1782
+ "bg-white": P >= S.value.length - 1
1764
1783
  },
1765
1784
  "w-[2px] h-full"
1766
1785
  ])
@@ -1778,8 +1797,8 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1778
1797
  r("div", {
1779
1798
  class: Oe([
1780
1799
  {
1781
- "bg-fm-color-primary": T < S.value.length - 1,
1782
- "bg-white": T >= S.value.length - 1
1800
+ "bg-fm-color-primary": P < S.value.length - 1,
1801
+ "bg-white": P >= S.value.length - 1
1783
1802
  },
1784
1803
  "w-[2px] h-full"
1785
1804
  ])
@@ -1787,23 +1806,23 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1787
1806
  ])
1788
1807
  ]),
1789
1808
  r("div", is, [
1790
- E(V, {
1809
+ E(M, {
1791
1810
  variant: "outlined",
1792
1811
  class: "py-12 px-16"
1793
1812
  }, {
1794
1813
  default: de(() => [
1795
1814
  r("div", us, [
1796
- (_(!0), k(te, null, ye($.info, (M, fe) => (_(), k("div", {
1815
+ (_(!0), q(re, null, ye($.info, (K, fe) => (_(), q("div", {
1797
1816
  key: fe,
1798
1817
  class: "flex flex-col gap-4"
1799
1818
  }, [
1800
- r("div", ds, R(M == null ? void 0 : M.label), 1),
1819
+ r("div", ds, R(K == null ? void 0 : K.label), 1),
1801
1820
  r("div", ms, [
1802
- (_(!0), k(te, null, ye(M == null ? void 0 : M.values, (pe, Re) => (_(), k("div", {
1821
+ (_(!0), q(re, null, ye(K == null ? void 0 : K.values, (pe, Re) => (_(), q("div", {
1803
1822
  key: Re,
1804
1823
  class: "fm-typo-en-body-lg-600"
1805
1824
  }, [
1806
- typeof pe == "string" ? (_(), k(te, { key: 0 }, [
1825
+ typeof pe == "string" ? (_(), q(re, { key: 0 }, [
1807
1826
  $e(R(pe), 1)
1808
1827
  ], 64)) : (_(), ue(wt(pe), { key: 1 }))
1809
1828
  ]))), 128))
@@ -1816,51 +1835,51 @@ const nr = { class: "flex flex-col gap-16 w-full h-full" }, or = { class: "flex
1816
1835
  ])
1817
1836
  ])
1818
1837
  ], 64))), 128))
1819
- ])) : (_(), k("div", Qr, [
1820
- E(A),
1838
+ ])) : (_(), q("div", Qr, [
1839
+ E(T),
1821
1840
  r("div", null, [
1822
1841
  r("img", {
1823
- src: p(Ot),
1842
+ src: y(Ot),
1824
1843
  alt: "List is empty"
1825
1844
  }, null, 8, Yr)
1826
1845
  ]),
1827
- r("div", Wr, R(p(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1828
- r("div", Jr, R(p(t)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
1829
- E(A),
1830
- E(A)
1846
+ r("div", Wr, R(y(t)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
1847
+ r("div", Jr, R(y(t)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
1848
+ E(T),
1849
+ E(T)
1831
1850
  ]))
1832
- ])) : L("", !0)
1851
+ ])) : V("", !0)
1833
1852
  ])
1834
1853
  ];
1835
1854
  }),
1836
1855
  "side-sheet-footer": de(() => [
1837
1856
  r("div", fs, [
1838
- (_(!0), k(te, null, ye(ne.value, (F) => (_(), ue(U, {
1857
+ (_(!0), q(re, null, ye(ne.value, (F) => (_(), ue(L, {
1839
1858
  key: F,
1840
- label: p(t)(p(et)[F].translationKey),
1859
+ label: y(t)(y(et)[F].translationKey),
1841
1860
  onClick: (ce) => be(F),
1842
- loading: q.value === F,
1843
- disabled: q.value !== F && w.value,
1844
- variant: p(et)[F].buttonVariant
1861
+ loading: A.value === F,
1862
+ disabled: A.value !== F && w.value,
1863
+ variant: y(et)[F].buttonVariant
1845
1864
  }, null, 8, ["label", "onClick", "loading", "disabled", "variant"]))), 128)),
1846
- p(y).ableToMarkReceived(e.purchaseOrder) && !ne.value.includes("completeReceive") ? (_(), ue(U, {
1865
+ y(p).ableToMarkReceived(e.purchaseOrder) && !ne.value.includes("completeReceive") ? (_(), ue(L, {
1847
1866
  key: 0,
1848
- label: p(t)("inventory.transfer.receiveRequest.actions.completeReceive"),
1867
+ label: y(t)("inventory.transfer.receiveRequest.actions.completeReceive"),
1849
1868
  onClick: c[1] || (c[1] = (F) => be("completeReceive")),
1850
- loading: q.value === "completeReceive",
1851
- disabled: q.value !== "completeReceive" && w.value
1852
- }, null, 8, ["label", "loading", "disabled"])) : L("", !0),
1853
- p(y).ableToMarkApproved(e.purchaseOrder) && e.canApprove && !ne.value.includes("approveRequest") ? (_(), ue(U, {
1869
+ loading: A.value === "completeReceive",
1870
+ disabled: A.value !== "completeReceive" && w.value
1871
+ }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
1872
+ y(p).ableToMarkApproved(e.purchaseOrder) && e.canApprove && !ne.value.includes("approveRequest") ? (_(), ue(L, {
1854
1873
  key: 1,
1855
- label: p(t)("inventory.transfer.approval.actions.approveRequest"),
1874
+ label: y(t)("inventory.transfer.approval.actions.approveRequest"),
1856
1875
  onClick: c[2] || (c[2] = (F) => be("approveRequest")),
1857
- loading: q.value === "approveRequest",
1858
- disabled: q.value !== "approveRequest" && w.value
1859
- }, null, 8, ["label", "loading", "disabled"])) : L("", !0),
1860
- E(U, {
1861
- label: p(t)("common.close"),
1876
+ loading: A.value === "approveRequest",
1877
+ disabled: A.value !== "approveRequest" && w.value
1878
+ }, null, 8, ["label", "loading", "disabled"])) : V("", !0),
1879
+ E(L, {
1880
+ label: y(t)("common.close"),
1862
1881
  variant: "tertiary",
1863
- onClick: c[3] || (c[3] = (F) => g("update:show", !1))
1882
+ onClick: c[3] || (c[3] = (F) => b("update:show", !1))
1864
1883
  }, null, 8, ["label"])
1865
1884
  ])
1866
1885
  ]),
@@ -1875,5 +1894,5 @@ export {
1875
1894
  Os as a,
1876
1895
  ks as b,
1877
1896
  Pt as g,
1878
- qe as u
1897
+ Ne as u
1879
1898
  };