@feedmepos/mf-inventory-portal 1.2.48 → 1.2.49

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 (70) hide show
  1. package/dist/{App-DPGaFV4B.js → App-w_Dbl-jn.js} +3 -3
  2. package/dist/{ApprovalView-833HS5kH.js → ApprovalView-CuOM9Ych.js} +5 -5
  3. package/dist/{BindingsDialog-ChODu5A1.js → BindingsDialog-DkMSnr51.js} +2 -2
  4. package/dist/{BindingsPicker-DvX4GyKv.js → BindingsPicker-DrXdWUTh.js} +2 -2
  5. package/dist/{BindingsTable-DNAiQ3jC.js → BindingsTable-Bj0eBYdU.js} +3 -3
  6. package/dist/{ClosingDraftView-BNmLpJEn.js → ClosingDraftView-D1oohB8Y.js} +9 -9
  7. package/dist/{ClosingHistoryView-BWCsFzL4.js → ClosingHistoryView-BCYNhLDg.js} +3 -3
  8. package/dist/{ClosingTemplateView-oZwROzRq.js → ClosingTemplateView-DIvZkCgT.js} +14 -14
  9. package/dist/{DeliveryOrderPrintPreview-CgF6Ah_t.js → DeliveryOrderPrintPreview-C83_a-LI.js} +1 -1
  10. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-COu3S25S.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Bmas1qkC.js} +4 -4
  11. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Br-AzVal.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js} +2 -2
  12. package/dist/{FmMultiselectDialog-nOXJfHcT.js → FmMultiselectDialog-BtvZkE6p.js} +1 -1
  13. package/dist/{FmMultiselectDialog-BcnuMvBx.js → FmMultiselectDialog-IU5C9o_F.js} +2 -2
  14. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-B0TLNBD_.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js} +3 -3
  15. package/dist/{ImportView-DiCAaSmP.js → ImportView-CRdvYxW3.js} +6 -6
  16. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-CjzJ3O5a.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-D6J1wcU6.js} +1 -1
  17. package/dist/{IngredientGroupView-DJ_gq48z.js → IngredientGroupView-DCdnjh-f.js} +5 -5
  18. package/dist/{IngredientsView-B2tdcbaR.js → IngredientsView-DhZadYV8.js} +14 -14
  19. package/dist/{IntegrationView-siGNamS4.js → IntegrationView-B_D6Sgj-.js} +12 -12
  20. package/dist/{InventoryBindingForm-CMH2losI.js → InventoryBindingForm-CM47I9t9.js} +1 -1
  21. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-D68w7k0f.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-BYKUWI9e.js} +4 -4
  22. package/dist/{InventoryBindingSummary-DAGsx_Mo.js → InventoryBindingSummary-BSuJMrFU.js} +1 -1
  23. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cyl5cUO6.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-9TTwcC8s.js} +1 -1
  24. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-CNze8ZJ7.js → PremiumBadge.vue_vue_type_script_setup_true_lang-D2vWMBZF.js} +2 -2
  25. package/dist/{PublishView-D1AKbuKs.js → PublishView-DxhE5g9_.js} +3 -3
  26. package/dist/{PurchaseOrderPrintPreview-BzGcJK1f.js → PurchaseOrderPrintPreview-BzIwRI7z.js} +1 -1
  27. package/dist/{ReceiveRequestView-hvDCU729.js → ReceiveRequestView-C5wqi0jE.js} +18 -18
  28. package/dist/{RecipeView-BcnjGf_a.js → RecipeView-Azx2MoPR.js} +8 -8
  29. package/dist/{StockView-DdgYT4_P.js → StockView-D51RBHWQ.js} +15 -15
  30. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DRPzgTm4.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-R0yauCbz.js} +1 -1
  31. package/dist/{SupplierView-LRNOgWQk.js → SupplierView-BeHjJ0xJ.js} +11 -11
  32. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-CQJJ3XRC.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js} +2 -2
  33. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-KBs8Dq8C.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-cPIomfPb.js} +1 -1
  34. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-bP-1-mLN.js → TransferDetails.vue_vue_type_script_setup_true_lang-BZR_EozX.js} +994 -995
  35. package/dist/{TransferTemplateView-Dp2W2doS.js → TransferTemplateView-BwdhVKO4.js} +15 -15
  36. package/dist/{UnitView-N5l93VfY.js → UnitView-BT23dBtV.js} +6 -6
  37. package/dist/{WarehouseView-D7FGBKUP.js → WarehouseView-PWigQlHk.js} +5 -5
  38. package/dist/{WastageTemplateView-BmSNPRPI.js → WastageTemplateView-BGO19Pux.js} +14 -14
  39. package/dist/{app-CfCaSzjl.js → app-C0a15lwm.js} +23036 -14497
  40. package/dist/app.d.ts +1133 -0
  41. package/dist/app.js +1 -1
  42. package/dist/{closing-template-CJ4VCKvB.js → closing-template-C9jSN68K.js} +1 -1
  43. package/dist/{date2-BcmOfaME.js → date2-DND2dkpu.js} +1 -1
  44. package/dist/{dayjs.min-CiFpY16f.js → dayjs.min-CvewwBuM.js} +1 -1
  45. package/dist/{decimal-DtLL5qsA.js → decimal-C11049RC.js} +2 -2
  46. package/dist/{defineDeepModel-DBV1M6fx.js → defineDeepModel-BYmk9G2K.js} +1 -1
  47. package/dist/{duplicate-template-DjhY01M8.js → duplicate-template-CJLrmGdo.js} +1 -1
  48. package/dist/{feature-0OR7WTHu.js → feature-D2GGGVQh.js} +1411 -1262
  49. package/dist/{format-time-from-id-DATUhiz_.js → format-time-from-id-DuUqVP8F.js} +1 -1
  50. package/dist/{format-unit-display-9qQdeD4R.js → format-unit-display-BwBGMuCk.js} +10 -10
  51. package/dist/{import-export.helper-isWO7OKw.js → import-export.helper-ejk_vT2V.js} +5 -5
  52. package/dist/{index-CG0HXAUt.js → index-C9F5LU0v.js} +3 -3
  53. package/dist/{index-YLMXpUuG.js → index-Cy-YW3O0.js} +1 -1
  54. package/dist/{index-BvtrCC8o.js → index-D65a-5cn.js} +1 -1
  55. package/dist/locales/ja/common.json +7 -0
  56. package/dist/{lodash-D1GaTimh.js → lodash-DNLSknxF.js} +1 -1
  57. package/dist/{netsuite-C3C6Uju7.js → netsuite-TqUeqkqw.js} +3 -3
  58. package/dist/{purchase-order-template-C8k-zHLA.js → purchase-order-template-C7J9I7o4.js} +1 -1
  59. package/dist/{rules-DCfupVMX.js → rules-DQNuaKK6.js} +3 -3
  60. package/dist/{stock-AXiQCAeU.js → stock-1aynIWpi.js} +3 -3
  61. package/dist/{stock-BwYeYuFG.js → stock-bYU0NTHD.js} +1 -1
  62. package/dist/{supplier-p9r9OqFz.js → supplier-B72SAF3j.js} +2 -2
  63. package/dist/tsconfig.app.tsbuildinfo +1 -1
  64. package/dist/{use-ingredient-select-dialog-Cpmsu92V.js → use-ingredient-select-dialog-DO20RWUv.js} +2 -2
  65. package/dist/{use-inventory-binding-dialog-BPm1TXkw.js → use-inventory-binding-dialog-R2VQakMR.js} +2 -2
  66. package/dist/{use-template-enabled-locations-2-Batk5Jq7.js → use-template-enabled-locations-2-C7L_vyIF.js} +2 -2
  67. package/dist/{vue-i18n-Xu3ISvbS.js → vue-i18n-BLzLoy1U.js} +401 -401
  68. package/dist/{xlsx-DTdVIUTe.js → xlsx-DZcSBj-s.js} +1 -1
  69. package/dist/{xlsx.util-twnxgS4l.js → xlsx.util-DMCjqrHn.js} +1 -1
  70. package/package.json +2 -2
@@ -1,40 +1,40 @@
1
- import { p as $t, f as We } from "./format-time-from-id-DATUhiz_.js";
2
- import { ref as J, computed as Y, h as L, defineComponent as $e, reactive as Ct, onMounted as yt, resolveComponent as H, openBlock as i, createBlock as re, withCtx as Z, createElementVNode as e, createVNode as D, unref as v, createElementBlock as _, toDisplayString as y, createCommentVNode as U, Fragment as ue, renderList as xe, createTextVNode as ke, normalizeClass as Me, watch as Rt, isRef as kt, resolveDynamicComponent as Dt } from "vue";
1
+ import { p as Ct, f as We } from "./format-time-from-id-DuUqVP8F.js";
2
+ import { ref as J, computed as Y, h as L, defineComponent as $e, reactive as Rt, onMounted as yt, resolveComponent as H, openBlock as l, createBlock as re, withCtx as ee, createElementVNode as e, createVNode as D, unref as v, createElementBlock as h, toDisplayString as y, createCommentVNode as U, Fragment as de, renderList as xe, createTextVNode as ke, normalizeClass as Me, watch as kt, isRef as Dt, resolveDynamicComponent as At } from "vue";
3
3
  import { c as mt } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-cfFHDIwQ.js";
4
4
  import { R as ye, D as Se } from "./row-action.enum-BcW_L_nE.js";
5
- import { o as At, u as De, W as M, X as Ze, M as te, D as Nt, c as vt, v as it, Y as ht, t as Ge, J as Ce, A as Ye, s as Ie, B as Te } from "./app-CfCaSzjl.js";
6
- import { l as bt, d as gt, a as he, t as Qe, e as Ke } from "./rules-DCfupVMX.js";
7
- import { F as Ft } from "./decimal-DtLL5qsA.js";
8
- import { t as Tt, c as It, h as _t, a as He } from "./date2-BcmOfaME.js";
9
- import { u as Ue, F as Pt, a as st } from "./feature-0OR7WTHu.js";
5
+ import { o as Nt, u as De, W as M, X as Ze, M as se, D as Ft, c as vt, v as it, Y as bt, t as Ge, J as Ce, A as Ye, s as qe, B as Pe } from "./app-C0a15lwm.js";
6
+ import { l as ht, d as gt, a as he, t as Qe, e as Ke } from "./rules-DQNuaKK6.js";
7
+ import { F as Tt } from "./decimal-C11049RC.js";
8
+ import { t as It, c as Pt, h as _t, a as He } from "./date2-DND2dkpu.js";
9
+ import { u as Ue, F as qt, a as st } from "./feature-D2GGGVQh.js";
10
10
  import { useCoreStore as ct, useI18n as ut } from "@feedmepos/mf-common";
11
- import { u as et, a as dt, S as we } from "./netsuite-C3C6Uju7.js";
12
- import { useDialog as tt, useSnackbar as Be, components as Je, FmButtonVariant as be, useProxiedModel as qt } from "@feedmepos/ui-library";
13
- import { F as Pe } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
14
- import { E as Vt } from "./empty-placeholder-wf6-BWE8.js";
15
- import { u as Et, a as Lt, f as Mt } from "./format-unit-display-9qQdeD4R.js";
16
- import { u as je, _ as Ut } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-CQJJ3XRC.js";
17
- import { _ as Bt, a as jt, b as zt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-B0TLNBD_.js";
18
- import { u as Kt, R as pt } from "./usePromise-CbVUCxhj.js";
19
- import { c as Gt } from "./index-CG0HXAUt.js";
20
- import { i as Ht } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Br-AzVal.js";
11
+ import { u as et, a as dt, S as we } from "./netsuite-TqUeqkqw.js";
12
+ import { useDialog as tt, useSnackbar as Be, components as Je, FmButtonVariant as ge, useProxiedModel as Vt } from "@feedmepos/ui-library";
13
+ import { F as Ve } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-CWZkVCAj.js";
14
+ import { E as Et } from "./empty-placeholder-wf6-BWE8.js";
15
+ import { u as Lt, a as Mt, f as Ut } from "./format-unit-display-BwBGMuCk.js";
16
+ import { u as je, _ as Bt } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-DG1p3Rim.js";
17
+ import { _ as jt, a as zt, b as Kt } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-BN9OeQF3.js";
18
+ import { u as Gt, R as pt } from "./usePromise-CbVUCxhj.js";
19
+ import { c as Ht } from "./index-C9F5LU0v.js";
20
+ import { i as Wt } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CQ_Er40u.js";
21
21
  import { F as ft } from "./form-mode.enum-BKiNVH6A.js";
22
- import { d as St } from "./defineDeepModel-DBV1M6fx.js";
23
- import { u as Wt } from "./vue-i18n-Xu3ISvbS.js";
24
- const Yt = At((C, a) => {
22
+ import { d as St } from "./defineDeepModel-BYmk9G2K.js";
23
+ import { u as Yt } from "./vue-i18n-BLzLoy1U.js";
24
+ const Qt = Nt((C, a) => {
25
25
  const o = De();
26
26
  return {
27
27
  async getShipments({
28
28
  start: f,
29
- end: h
29
+ end: b
30
30
  }) {
31
- const n = o.currentLocationDBName, g = `${C.inventoryBackendUrl}/${n}/shipments`;
32
- return await a.get(`${g}?start=${f}&end=${h}`);
31
+ const n = o.currentLocationDBName, A = `${C.inventoryBackendUrl}/${n}/shipments`;
32
+ return await a.get(`${A}?start=${f}&end=${b}`);
33
33
  },
34
34
  async getShipmentsByIds(f) {
35
35
  if (f.length === 0)
36
36
  return [];
37
- const h = o.currentLocationDBName, n = `${C.inventoryBackendUrl}/${h}/shipments/get`;
37
+ const b = o.currentLocationDBName, n = `${C.inventoryBackendUrl}/${b}/shipments/get`;
38
38
  return await a.post(n, { shipmentIds: f });
39
39
  }
40
40
  };
@@ -111,7 +111,7 @@ function Xe(C) {
111
111
  purchaseOrder: C
112
112
  });
113
113
  }
114
- function Qt(C) {
114
+ function Jt(C) {
115
115
  return Ze.validatePOItemReceivedStatus({
116
116
  dto: C
117
117
  });
@@ -122,9 +122,9 @@ function nt(C) {
122
122
  });
123
123
  }
124
124
  function at(C, a, o) {
125
- if (!te.safeParse(C).success)
125
+ if (!se.safeParse(C).success)
126
126
  throw new Error(`Invalid purchase order status: ${C}`);
127
- const f = te.parse(C);
127
+ const f = se.parse(C);
128
128
  return Ze.orderStatusCombination({
129
129
  status: f,
130
130
  isPOPartialReceive: a,
@@ -133,46 +133,46 @@ function at(C, a, o) {
133
133
  }
134
134
  function Ot() {
135
135
  const C = De(), a = je(), o = Ue();
136
- async function f(n, g) {
137
- const s = C.currentLocationDBName;
138
- return n.doc.supplier.internal && n.operation === M.enum.confirmDraft && (n.operation = M.enum.submitRequest), await a.processPurchaseOrder(n, g || s);
136
+ async function f(n, A) {
137
+ const t = C.currentLocationDBName;
138
+ return n.doc.supplier.internal && n.operation === M.enum.confirmDraft && (n.operation = M.enum.submitRequest), await a.processPurchaseOrder(n, A || t);
139
139
  }
140
- async function h(n, g) {
141
- const s = C.currentLocationDBName;
142
- return await a.processPurchaseOrderV2(n, g || s);
140
+ async function b(n, A) {
141
+ const t = C.currentLocationDBName;
142
+ return await a.processPurchaseOrderV2(n, A || t);
143
143
  }
144
- return (n) => o.useOperatePurchaseOrderV2 ? h(n.operateV2, n.transferTo) : f(n.operate, n.transferTo);
144
+ return (n) => o.useOperatePurchaseOrderV2 ? b(n.operateV2, n.transferTo) : f(n.operate, n.transferTo);
145
145
  }
146
146
  var lt = /* @__PURE__ */ ((C) => (C.RECEIVE_REQUEST = "receive/request", C.APPROVAL = "approval", C))(lt || {});
147
147
  const ze = J(), rt = J();
148
148
  function Yn(C, a) {
149
- const o = tt(), f = De(), h = Ue();
149
+ const o = tt(), f = De(), b = Ue();
150
150
  et();
151
- const n = Et(), g = Lt(), s = J(!1), c = Be(), O = je(), w = Yt(), d = J(new Array()), T = J(new Array()), S = J(
152
- a != null && a.startDate && (a != null && a.endDate) ? a : Ht()
153
- ), A = Y(() => {
154
- const B = new Date(S.value.startDate), q = new Date(S.value.endDate);
151
+ const n = Lt(), A = Mt(), t = J(!1), c = Be(), S = je(), x = Qt(), u = J(new Array()), I = J(new Array()), N = J(
152
+ a != null && a.startDate && (a != null && a.endDate) ? a : Wt()
153
+ ), w = Y(() => {
154
+ const B = new Date(N.value.startDate), q = new Date(N.value.endDate);
155
155
  return {
156
- start: Tt(B).toISOString(),
157
- end: It(q).toISOString()
156
+ start: It(B).toISOString(),
157
+ end: Pt(q).toISOString()
158
158
  };
159
- }), l = J(new Array()), t = Nt(), b = J(null);
160
- async function u(B) {
159
+ }), O = J(new Array()), r = Ft(), d = J(null);
160
+ async function i(B) {
161
161
  function q(k) {
162
- const x = {
162
+ const _ = {
163
163
  mode: ft.CREATE,
164
164
  modelValue: B || void 0,
165
165
  show: !0,
166
- "onUpdate:show"(N) {
167
- ze.value.show = N;
166
+ "onUpdate:show"(F) {
167
+ ze.value.show = F;
168
168
  },
169
169
  templateId: k,
170
- lastClosingDate: b.value
170
+ lastClosingDate: d.value
171
171
  };
172
- ze.value = x;
172
+ ze.value = _;
173
173
  }
174
174
  let oe;
175
- h.mustUsePoTemplate && !(B != null && B.template) ? o.open({
175
+ b.mustUsePoTemplate && !(B != null && B.template) ? o.open({
176
176
  title: "Create transfer",
177
177
  message: "",
178
178
  primaryActions: {
@@ -190,7 +190,7 @@ function Yn(C, a) {
190
190
  q(void 0);
191
191
  }) : q(oe);
192
192
  }
193
- function $(B) {
193
+ function g(B) {
194
194
  const q = {
195
195
  mode: ft.UPDATE,
196
196
  modelValue: vt(B),
@@ -198,24 +198,24 @@ function Yn(C, a) {
198
198
  "onUpdate:show"(oe) {
199
199
  ze.value.show = oe;
200
200
  },
201
- lastClosingDate: b.value
201
+ lastClosingDate: d.value
202
202
  };
203
203
  ze.value = q;
204
204
  }
205
- async function I() {
206
- d.value = [], T.value = [], s.value = !0;
205
+ async function $() {
206
+ u.value = [], I.value = [], t.value = !0;
207
207
  try {
208
- const B = await O.getPurchaseOrders(A.value);
209
- d.value = B.sort((W, ie) => ie._id.localeCompare(W._id));
210
- const q = B.flatMap((W) => W.shipmentIds || []).filter(Boolean), oe = q.length > 0 ? await w.getShipmentsByIds(q) : [];
211
- T.value = oe;
212
- const k = await t.readCurrentLocationLastClosing(!0), x = k == null ? void 0 : k._id;
213
- x && (b.value = $t(x)), await h.awaitFeatureLoaded(() => h.mustUsePoTemplate) && await g.fetchTemplates();
214
- const N = d.value.map((W) => {
215
- var ie;
216
- return ((ie = W.request) == null ? void 0 : ie.id) ?? "";
208
+ const B = await S.getPurchaseOrders(w.value);
209
+ u.value = B.sort((W, ce) => ce._id.localeCompare(W._id));
210
+ const q = B.flatMap((W) => W.shipmentIds || []).filter(Boolean), oe = q.length > 0 ? await x.getShipmentsByIds(q) : [];
211
+ I.value = oe;
212
+ const k = await r.readCurrentLocationLastClosing(!0), _ = k == null ? void 0 : k._id;
213
+ _ && (d.value = Ct(_)), await b.awaitFeatureLoaded(() => b.mustUsePoTemplate) && await A.fetchTemplates();
214
+ const F = u.value.map((W) => {
215
+ var ce;
216
+ return ((ce = W.request) == null ? void 0 : ce.id) ?? "";
217
217
  }).filter((W) => W);
218
- l.value = await O.readRequestByIds(N);
218
+ O.value = await S.readRequestByIds(F);
219
219
  } catch {
220
220
  c.open({
221
221
  title: "Something went wrong",
@@ -223,16 +223,16 @@ function Yn(C, a) {
223
223
  type: "error"
224
224
  });
225
225
  } finally {
226
- s.value = !1;
226
+ t.value = !1;
227
227
  }
228
228
  }
229
- async function z() {
230
- l.value = [], s.value = !0;
229
+ async function K() {
230
+ O.value = [], t.value = !0;
231
231
  try {
232
- l.value = await O.readRequests(
232
+ O.value = await S.readRequests(
233
233
  void 0,
234
- A.value.start,
235
- A.value.end
234
+ w.value.start,
235
+ w.value.end
236
236
  ).then((B) => B.reverse());
237
237
  } catch {
238
238
  c.open({
@@ -241,68 +241,68 @@ function Yn(C, a) {
241
241
  type: "error"
242
242
  });
243
243
  } finally {
244
- s.value = !1;
244
+ t.value = !1;
245
245
  }
246
246
  }
247
247
  function R() {
248
248
  switch (C) {
249
249
  case "receive/request":
250
- return I();
250
+ return $();
251
251
  case "approval":
252
- return z();
252
+ return K();
253
253
  }
254
254
  }
255
- function Q(B, q) {
256
- S.value = {
255
+ function X(B, q) {
256
+ N.value = {
257
257
  startDate: B,
258
258
  endDate: q
259
259
  }, R();
260
260
  }
261
261
  f.watchLocation(async (B) => {
262
262
  if (!B) {
263
- d.value = [];
263
+ u.value = [];
264
264
  return;
265
265
  }
266
266
  await R();
267
267
  });
268
- const K = J(), se = J(Math.random().toString());
269
- async function ge(B, q) {
268
+ const j = J(), Q = J(Math.random().toString());
269
+ async function ve(B, q) {
270
270
  const oe = Math.random().toString();
271
- se.value = oe, q ?? (q = l.value.computeFirst(
271
+ Q.value = oe, q ?? (q = O.value.computeFirst(
272
272
  (W) => W.purchaseOrderId === B._id ? W : null
273
273
  ) ?? void 0);
274
- const k = C === "receive/request" ? f.currentLocation : q == null ? void 0 : q.to, x = C === "approval", N = {
274
+ const k = C === "receive/request" ? f.currentLocation : q == null ? void 0 : q.to, _ = C === "approval", F = {
275
275
  poRequest: q,
276
276
  purchaseOrder: {
277
277
  ...B,
278
- status: x && (q != null && q.rejectedAt) ? te.Enum.REJECT : B.status
278
+ status: _ && (q != null && q.rejectedAt) ? se.Enum.REJECT : B.status
279
279
  },
280
280
  transferTo: k == null ? void 0 : k.name,
281
281
  transferToDbName: k == null ? void 0 : k.dbName,
282
282
  show: !0,
283
283
  canResubmit: !1,
284
- canApprove: x,
284
+ canApprove: _,
285
285
  "onUpdate:show"(W) {
286
- K.value.show = W;
286
+ j.value.show = W;
287
287
  },
288
288
  scope: C,
289
289
  receivedMap: Xe(B) ?? {},
290
- shipments: T.value
290
+ shipments: I.value
291
291
  };
292
- K.value = N;
292
+ j.value = F;
293
293
  }
294
- async function de(B, q, oe, k) {
295
- const x = Ot();
296
- s.value = !0;
294
+ async function ie(B, q, oe, k) {
295
+ const _ = Ot();
296
+ t.value = !0;
297
297
  try {
298
- await x({
298
+ await _({
299
299
  operate: {
300
300
  operation: q,
301
301
  doc: B,
302
302
  options: (
303
303
  // auto receive for supplier to warehouse
304
304
  (q === M.enum.confirmDraft || // auto receive for warehouse to warehouse
305
- q === M.enum.completeReceive) && h.autoReceiveWarehouse ? {
305
+ q === M.enum.completeReceive) && b.autoReceiveWarehouse ? {
306
306
  autoReceive: !0
307
307
  } : void 0
308
308
  )
@@ -314,7 +314,7 @@ function Yn(C, a) {
314
314
  payloads: []
315
315
  },
316
316
  transferTo: k
317
- }), await new Promise((ie) => setTimeout(ie, 1e3));
317
+ }), await new Promise((ce) => setTimeout(ce, 1e3));
318
318
  const W = De().currentLocationDBName.startsWith("restaurant_");
319
319
  q === M.enum.confirmDraft && B.effectiveAt && W ? c.open({
320
320
  title: "Success",
@@ -325,17 +325,17 @@ function Yn(C, a) {
325
325
  message: oe,
326
326
  type: "success"
327
327
  });
328
- } catch (N) {
328
+ } catch (F) {
329
329
  c.open({
330
330
  title: "Something went wrong",
331
331
  message: "Please try again.",
332
332
  type: "error"
333
- }), console.error("Error when submitting PO operation", q, B, N);
333
+ }), console.error("Error when submitting PO operation", q, B, F);
334
334
  } finally {
335
- s.value = !1, R();
335
+ t.value = !1, R();
336
336
  }
337
337
  }
338
- async function qe(B, q, oe) {
338
+ async function Ae(B, q, oe) {
339
339
  const k = xt[q];
340
340
  if (!k) {
341
341
  c.open({
@@ -345,16 +345,16 @@ function Yn(C, a) {
345
345
  });
346
346
  return;
347
347
  }
348
- const { successMessage: x, ...N } = k;
348
+ const { successMessage: _, ...F } = k;
349
349
  o.open({
350
- title: N.title,
351
- message: N.message,
352
- primaryActions: N.primaryActions
350
+ title: F.title,
351
+ message: F.message,
352
+ primaryActions: F.primaryActions
353
353
  }).onPrimary(() => {
354
- de(B, q, x, oe);
354
+ ie(B, q, _, oe);
355
355
  });
356
356
  }
357
- async function Ve() {
357
+ async function Ne() {
358
358
  o.open({
359
359
  title: "Upload Transfer",
360
360
  primaryActions: {
@@ -376,43 +376,43 @@ function Yn(C, a) {
376
376
  });
377
377
  }
378
378
  return {
379
- purchaseOrders: d,
380
- shipments: T,
381
- purchaseRequests: l,
382
- updateDateRange: Q,
379
+ purchaseOrders: u,
380
+ shipments: I,
381
+ purchaseRequests: O,
382
+ updateDateRange: X,
383
383
  fetchData: R,
384
- loading: s,
384
+ loading: t,
385
385
  transferDialogProps: ze,
386
- promptCreateTransferDialog: u,
387
- promptUpdateTransferDialog: $,
388
- transferDetailsProps: K,
389
- promptShowTransferDetails: ge,
390
- submitAction: qe,
386
+ promptCreateTransferDialog: i,
387
+ promptUpdateTransferDialog: g,
388
+ transferDetailsProps: j,
389
+ promptShowTransferDetails: ve,
390
+ submitAction: Ae,
391
391
  xilnexImportDialogProps: rt,
392
- promptUploadTransferDialog: Ve
392
+ promptUploadTransferDialog: Ne
393
393
  };
394
394
  }
395
- function Jt(C, a) {
395
+ function Xt(C, a) {
396
396
  return a.reduce(
397
- (f, h) => {
398
- const n = h.received.find((g) => g.sku._id === C._id);
399
- return n && (f = bt(f, n.amount)), f;
397
+ (f, b) => {
398
+ const n = b.received.find((A) => A.sku._id === C._id);
399
+ return n && (f = ht(f, n.amount)), f;
400
400
  },
401
- Ft.toPrecision(gt(0), C.unit.precision)
401
+ Tt.toPrecision(gt(0), C.unit.precision)
402
402
  );
403
403
  }
404
- function Xt(C) {
405
- const { po: a, currentLocation: o, business: f, fulfilling: h, por: n } = C, { name: g, address: s, regNo: c, legalName: O } = o.doc.profile, w = {
406
- name: g,
407
- legalName: O,
404
+ function Zt(C) {
405
+ const { po: a, currentLocation: o, business: f, fulfilling: b, por: n } = C, { name: A, address: t, regNo: c, legalName: S } = o.doc.profile, x = {
406
+ name: A,
407
+ legalName: S,
408
408
  registrationNumber: c,
409
- line1: s == null ? void 0 : s.line1,
410
- line2: s == null ? void 0 : s.line2,
411
- postcode: s == null ? void 0 : s.postcode,
412
- city: s == null ? void 0 : s.city,
413
- state: s == null ? void 0 : s.state,
414
- country: s == null ? void 0 : s.country
415
- }, d = {
409
+ line1: t == null ? void 0 : t.line1,
410
+ line2: t == null ? void 0 : t.line2,
411
+ postcode: t == null ? void 0 : t.postcode,
412
+ city: t == null ? void 0 : t.city,
413
+ state: t == null ? void 0 : t.state,
414
+ country: t == null ? void 0 : t.country
415
+ }, u = {
416
416
  name: a.supplier.name,
417
417
  phoneNumber: a.supplier.phoneNumber,
418
418
  registrationNumber: a.supplier.registrationNumber,
@@ -422,60 +422,60 @@ function Xt(C) {
422
422
  city: a.supplier.address.city,
423
423
  state: a.supplier.address.state,
424
424
  country: a.supplier.address.country
425
- }, T = a.items.map((I) => {
426
- const { sku: z, measurement: R } = I, Q = he(
427
- Jt(I.sku, a.deliveryOrder || []),
425
+ }, I = a.items.map(($) => {
426
+ const { sku: K, measurement: R } = $, X = he(
427
+ Xt($.sku, a.deliveryOrder || []),
428
428
  !1
429
429
  );
430
430
  return {
431
- code: z.code,
432
- description: z.name,
433
- quantity: he(I.quantity, !1),
434
- unit: (R == null ? void 0 : R.abbrev) || z.unit.abbrev,
435
- received: Q,
436
- cost: I.totalCost ? `${I.totalCost.currency} ${Pt.toFormatString({
437
- value: I.totalCost
431
+ code: K.code,
432
+ description: K.name,
433
+ quantity: he($.quantity, !1),
434
+ unit: (R == null ? void 0 : R.abbrev) || K.unit.abbrev,
435
+ received: X,
436
+ cost: $.totalCost ? `${$.totalCost.currency} ${qt.toFormatString({
437
+ value: $.totalCost
438
438
  })}` : void 0
439
439
  };
440
- }), S = a.deliveryOrder.map((I) => ({
441
- createdAt: _t(new Date(I.createdAt)),
442
- ref: I.deliveryOrderNumber,
443
- remark: I.remark || "",
444
- items: I.received.map((z) => {
440
+ }), N = a.deliveryOrder.map(($) => ({
441
+ createdAt: _t(new Date($.createdAt)),
442
+ ref: $.deliveryOrderNumber,
443
+ remark: $.remark || "",
444
+ items: $.received.map((K) => {
445
445
  var R;
446
446
  return {
447
- code: z.sku.code,
448
- description: z.sku.name,
449
- quantity: he(z.amount),
450
- unit: ((R = z.measurement) == null ? void 0 : R.abbrev) || z.sku.unit.abbrev
447
+ code: K.sku.code,
448
+ description: K.sku.name,
449
+ quantity: he(K.amount),
450
+ unit: ((R = K.measurement) == null ? void 0 : R.abbrev) || K.sku.unit.abbrev
451
451
  };
452
452
  })
453
- })), A = [
453
+ })), w = [
454
454
  // Production
455
455
  "67ca5d2c80bd0e001c5bf5bc",
456
456
  // Dev
457
457
  "6880b36a3054c5001db19218"
458
458
  ];
459
- let l = "Inventory Receive Note";
460
- if (a.supplier.internal ? (l = "Inventory Transfer Note", A.includes((f == null ? void 0 : f._id) || "") && (l = "Stock Request")) : l = "Purchase Order", n) {
461
- const I = n.from.dbName;
462
- o.dbName === I || (l = "Inventory Receive Note");
459
+ let O = "Inventory Receive Note";
460
+ if (a.supplier.internal ? (O = "Inventory Transfer Note", w.includes((f == null ? void 0 : f._id) || "") && (O = "Stock Request")) : O = "Purchase Order", n) {
461
+ const $ = n.from.dbName;
462
+ o.dbName === $ || (O = "Inventory Receive Note");
463
463
  }
464
- const b = {
465
- title: l,
464
+ const d = {
465
+ title: O,
466
466
  businessName: f == null ? void 0 : f.name,
467
467
  logo: f == null ? void 0 : f.thumbnail,
468
468
  orderNumber: a.seqNumber.toString(),
469
469
  createdAt: We(a._id),
470
470
  ref: a.ref || "",
471
471
  remark: a.remark || "",
472
- buyer: w,
473
- supplier: d,
474
- items: T,
472
+ buyer: x,
473
+ supplier: u,
474
+ items: I,
475
475
  status: a.status,
476
- deliveryOrders: S
477
- }, u = new URL(window.location.href), $ = h && (a.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
478
- u.pathname = u.hostname.includes("portal.feedme") ? `/inventory/${$}` : `/${$}`, u.searchParams.append("data", JSON.stringify(b)), window.open(u.href, "_blank", "noreferrer");
476
+ deliveryOrders: N
477
+ }, i = new URL(window.location.href), g = b && (a.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
478
+ i.pathname = i.hostname.includes("portal.feedme") ? `/inventory/${g}` : `/${g}`, i.searchParams.append("data", JSON.stringify(d)), window.open(i.href, "_blank", "noreferrer");
479
479
  }
480
480
  const Le = {
481
481
  submitRequest: {
@@ -539,20 +539,40 @@ const Le = {
539
539
  value: M.enum.returnStock
540
540
  }
541
541
  };
542
+ function wt() {
543
+ const C = Ue();
544
+ return {
545
+ ableToMarkReceived(a) {
546
+ if (!a || a.status !== se.enum.RECEIVING || C.useOperatePurchaseOrderV2) return !1;
547
+ const f = De().currentLocationDBName;
548
+ return `${a.supplier.internal}_${a.supplier._id}` !== f;
549
+ },
550
+ ableToMarkApproved(a) {
551
+ return !(!a || (a == null ? void 0 : a.status) !== se.enum.REQUESTING);
552
+ },
553
+ ableToCreateFulfillment(a, o) {
554
+ var n, A;
555
+ if (!C.acceptRequireFulfillment || !a || !o || a.status !== se.enum.PROCESSING || !o.processedAt)
556
+ return !1;
557
+ const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, b = (A = o == null ? void 0 : o.to) == null ? void 0 : A.dbName;
558
+ return !(f.startsWith("restaurant_") && b.startsWith("restaurant_"));
559
+ }
560
+ };
561
+ }
542
562
  function Qn(C, a, o) {
543
- const f = De(), h = et(), n = ct(), { t: g } = ut();
544
- function s(S) {
545
- switch (S.status) {
563
+ const f = De(), b = et(), n = ct(), A = wt(), { t } = ut();
564
+ function c(w) {
565
+ switch (w.status) {
546
566
  case "DRAFT":
547
567
  return [
548
568
  Se[ye.Update],
549
569
  Se[ye.Details],
550
- S.supplier.internal === "restaurant" || S.supplier.internal === "warehouse" ? Le[M.enum.submitRequest] : Le[M.enum.confirmDraft],
570
+ w.supplier.internal === "restaurant" || w.supplier.internal === "warehouse" ? Le[M.enum.submitRequest] : Le[M.enum.confirmDraft],
551
571
  Le[M.enum.cancelDraft]
552
572
  ];
553
573
  case "RECEIVING":
554
574
  return [
555
- Le[M.enum.completeReceive],
575
+ ...A.ableToMarkReceived(w) ? [Le[M.enum.completeReceive]] : [],
556
576
  Se[ye.Details],
557
577
  Se[ye.Print]
558
578
  ];
@@ -571,82 +591,82 @@ function Qn(C, a, o) {
571
591
  return [Se[ye.Details], Se[ye.Print]];
572
592
  }
573
593
  }
574
- function c(S) {
575
- return Object.values(M.enum).includes(S);
594
+ function S(w) {
595
+ return Object.values(M.enum).includes(w);
576
596
  }
577
- async function O(S, A, l) {
578
- var b, u, $, I, z, R;
579
- const t = vt(A);
580
- if (S === ye.Print) {
581
- const Q = (l == null ? void 0 : l.toInventoryLocation) ?? f.currentLocation;
582
- if (Q.type === "restaurant") {
583
- const K = f.locationRestaurantFromCore(Q.doc._id);
584
- K !== null && (Q.doc = K);
597
+ async function x(w, O, r) {
598
+ var i, g, $, K, R, X;
599
+ const d = vt(O);
600
+ if (w === ye.Print) {
601
+ const j = (r == null ? void 0 : r.toInventoryLocation) ?? f.currentLocation;
602
+ if (j.type === "restaurant") {
603
+ const Q = f.locationRestaurantFromCore(j.doc._id);
604
+ Q !== null && (j.doc = Q);
585
605
  }
586
- ((b = l == null ? void 0 : l.netSuite) != null && b.refNo || (u = t.netSuite) != null && u.refNo) && (t.ref = [(($ = l == null ? void 0 : l.netSuite) == null ? void 0 : $.refNo) || ((I = t.netSuite) == null ? void 0 : I.refNo)].filter((K) => K).join(" ")), Xt({
587
- po: t,
588
- currentLocation: Q,
606
+ ((i = r == null ? void 0 : r.netSuite) != null && i.refNo || (g = d.netSuite) != null && g.refNo) && (d.ref = [(($ = r == null ? void 0 : r.netSuite) == null ? void 0 : $.refNo) || ((K = d.netSuite) == null ? void 0 : K.refNo)].filter((Q) => Q).join(" ")), Zt({
607
+ po: d,
608
+ currentLocation: j,
589
609
  business: n.currentBusiness.value,
590
610
  fulfilling: C === "approval",
591
- por: l
611
+ por: r
592
612
  });
593
613
  return;
594
614
  }
595
- if (S === ye.Details) {
596
- a.promptShowTransferDetails(t, l);
615
+ if (w === ye.Details) {
616
+ a.promptShowTransferDetails(d, r);
597
617
  return;
598
618
  }
599
- if (S === ye.Update) {
600
- (z = a.promptUpdateTransferDialog) == null || z.call(a, t);
619
+ if (w === ye.Update) {
620
+ (R = a.promptUpdateTransferDialog) == null || R.call(a, d);
601
621
  return;
602
622
  }
603
- if (c(S)) {
604
- a.submitAction(A, S, (R = l == null ? void 0 : l.to) == null ? void 0 : R.dbName);
623
+ if (S(w)) {
624
+ a.submitAction(O, w, (X = r == null ? void 0 : r.to) == null ? void 0 : X.dbName);
605
625
  return;
606
626
  }
607
627
  }
608
- function w() {
609
- var A;
610
- const S = [
628
+ function u() {
629
+ var O;
630
+ const w = [
611
631
  {
612
632
  accessorKey: "seqNumber",
613
- header: () => g("inventory.transfer.table.seqNo"),
633
+ header: () => t("inventory.transfer.table.seqNo"),
614
634
  enableSorting: !0,
615
635
  size: 80,
616
636
  sortUndefined: "last"
617
637
  },
618
638
  {
619
639
  accessorKey: "_id",
620
- header: () => g("inventory.transfer.table.createdAt"),
621
- cell(l) {
622
- return We(`${l.getValue()}`);
640
+ header: () => t("inventory.transfer.table.createdAt"),
641
+ cell(r) {
642
+ return We(`${r.getValue()}`);
623
643
  },
624
644
  enableSorting: !0
625
645
  },
626
646
  {
627
647
  accessorKey: "supplier.name",
628
- header: () => g("inventory.transfer.table.transferFrom"),
648
+ header: () => t("inventory.transfer.table.transferFrom"),
629
649
  enableSorting: !0,
630
650
  size: 200
631
651
  },
632
652
  {
633
653
  accessorKey: "items.length",
634
- header: () => g("inventory.transfer.table.noOfItems"),
635
- cell: (l) => {
636
- const t = l.row.original.version || "1", b = l.getValue();
654
+ header: () => t("inventory.transfer.table.noOfItems"),
655
+ cell: (r) => {
656
+ const d = r.row.original.version || "1", i = r.getValue();
637
657
  return L("div", { class: "flex items-center gap-2" }, [
638
- b,
639
- t !== "1" ? L(
658
+ i,
659
+ d !== "1" ? L(
640
660
  "div",
641
661
  { class: "py-3" },
642
662
  L(
643
- Pe,
663
+ Ve,
644
664
  L(
645
665
  "div",
646
666
  {
647
667
  class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
648
668
  },
649
- `v${t}`
669
+ `v${d}`
650
670
  )
651
671
  )
652
672
  ) : null
@@ -659,16 +679,16 @@ function Qn(C, a, o) {
659
679
  },
660
680
  {
661
681
  accessorKey: "ref",
662
- header: () => g("inventory.transfer.table.reference"),
682
+ header: () => t("inventory.transfer.table.reference"),
663
683
  enableSorting: !1,
664
684
  size: "auto"
665
685
  },
666
- ...(A = n.sessionUser.value) != null && A.role.isAdmin ? [
686
+ ...(O = n.sessionUser.value) != null && O.role.isAdmin ? [
667
687
  {
668
688
  id: "statusForAdmin",
669
- header: () => L(Pe, {}, () => `${g("inventory.transfer.table.status")}`),
670
- cell(l) {
671
- return l.row.original.status;
689
+ header: () => L(Ve, {}, () => `${t("inventory.transfer.table.status")}`),
690
+ cell(r) {
691
+ return r.row.original.status;
672
692
  },
673
693
  enableSorting: !0,
674
694
  size: 200
@@ -676,18 +696,18 @@ function Qn(C, a, o) {
676
696
  ] : [],
677
697
  {
678
698
  accessorKey: "status",
679
- header: () => g("inventory.transfer.table.status"),
680
- cell(l) {
681
- const t = l.getValue(), b = Xe(l.row.original), { partial: u, over: $ } = nt(b), I = at(t ?? "", u, $);
682
- let z = g(`inventory.transfer.status.${I}`), R = `${t ?? ""}`.toLocaleLowerCase("en-us");
683
- I === te.enum.CLOSE && (z = `${g(`inventory.transfer.status.${te.enum.COMPLETE}`)}`), I === "PARTIAL_RECEIVED" && R === te.enum.PROCESSING.toLocaleLowerCase("en-us") && (R = te.enum.RECEIVING.toLocaleLowerCase("en-us"));
684
- let Q = null;
685
- const K = o.value.find((se) => se.ref === l.row.original._id);
686
- if (K != null && K.milestones && K.milestones.length > 0) {
687
- const se = K.milestones[K.milestones.length - 1];
688
- if (se.estimatedTime) {
689
- const ge = new Date(se.estimatedTime), de = ge.getDate().toString().padStart(2, "0");
690
- Q = `${ge.toLocaleString("en-US", { month: "short" })} ${de}`;
699
+ header: () => t("inventory.transfer.table.status"),
700
+ cell(r) {
701
+ const d = r.getValue(), i = Xe(r.row.original), { partial: g, over: $ } = nt(i), K = at(d ?? "", g, $);
702
+ let R = t(`inventory.transfer.status.${K}`), X = `${d ?? ""}`.toLocaleLowerCase("en-us");
703
+ K === se.enum.CLOSE && (R = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), K === "PARTIAL_RECEIVED" && X === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (X = se.enum.RECEIVING.toLocaleLowerCase("en-us"));
704
+ let j = null;
705
+ const Q = o.value.find((ve) => ve.ref === r.row.original._id);
706
+ if (Q != null && Q.milestones && Q.milestones.length > 0) {
707
+ const ve = Q.milestones[Q.milestones.length - 1];
708
+ if (ve.estimatedTime) {
709
+ const ie = new Date(ve.estimatedTime), Ae = ie.getDate().toString().padStart(2, "0");
710
+ j = `${ie.toLocaleString("en-US", { month: "short" })} ${Ae}`;
691
711
  }
692
712
  }
693
713
  return L(
@@ -704,14 +724,14 @@ function Qn(C, a, o) {
704
724
  {
705
725
  class: [
706
726
  "fm-status-badge",
707
- `fm-status-badge-${R}`,
727
+ `fm-status-badge-${X}`,
708
728
  $ && "fm-status-badge-error"
709
729
  ].filter(Boolean).join(" ")
710
730
  },
711
- `${z}`
731
+ `${R}`
712
732
  )
713
733
  ),
714
- ...Q ? [
734
+ ...j ? [
715
735
  L(
716
736
  "div",
717
737
  {
@@ -726,7 +746,7 @@ function Qn(C, a, o) {
726
746
  L(
727
747
  "span",
728
748
  { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" },
729
- Q
749
+ j
730
750
  )
731
751
  ]
732
752
  )
@@ -739,9 +759,9 @@ function Qn(C, a, o) {
739
759
  },
740
760
  {
741
761
  id: "action",
742
- cell(l) {
743
- const t = l.row.original, b = s(t);
744
- return mt(b, (u) => O(u, t));
762
+ cell(r) {
763
+ const d = r.row.original, i = c(d);
764
+ return mt(i, (g) => x(g, d));
745
765
  },
746
766
  enableSorting: !1,
747
767
  size: 40,
@@ -751,19 +771,19 @@ function Qn(C, a, o) {
751
771
  }
752
772
  }
753
773
  ];
754
- if (h.isEnabled) {
755
- const l = [
774
+ if (b.isEnabled) {
775
+ const r = [
756
776
  {
757
777
  id: "netsuiteTransferOrder",
758
- accessorFn: (t) => {
759
- var b;
760
- return (b = t.netSuite) != null && b.id ? `${t.netSuite.refNo} (${t.netSuite.id})` : "N/A";
778
+ accessorFn: (d) => {
779
+ var i;
780
+ return (i = d.netSuite) != null && i.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
761
781
  },
762
782
  header: () => "NetSuite Order (ID)",
763
- cell(t) {
764
- var u;
765
- const b = t.row.original;
766
- return (u = b.netSuite) != null && u.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
783
+ cell(d) {
784
+ var g;
785
+ const i = d.row.original;
786
+ return (g = i.netSuite) != null && g.id ? `${i.netSuite.refNo} (${i.netSuite.id})` : "N/A";
767
787
  },
768
788
  enableSorting: !1,
769
789
  size: 200,
@@ -774,14 +794,14 @@ function Qn(C, a, o) {
774
794
  },
775
795
  {
776
796
  id: "netsuiteTransactionNumber",
777
- accessorFn: (t) => {
778
- var b, u;
779
- return ((u = (b = t.netSuite) == null ? void 0 : b.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
797
+ accessorFn: (d) => {
798
+ var i, g;
799
+ return ((g = (i = d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber) ?? "N/A";
780
800
  },
781
801
  header: () => "NetSuite Transaction No.",
782
- cell(t) {
783
- var u, $;
784
- return (($ = (u = t.row.original.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
802
+ cell(d) {
803
+ var g, $;
804
+ return (($ = (g = d.row.original.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
785
805
  },
786
806
  enableSorting: !1,
787
807
  size: 200,
@@ -791,51 +811,51 @@ function Qn(C, a, o) {
791
811
  }
792
812
  }
793
813
  ];
794
- S.splice(S.length - 1, 0, ...l);
814
+ w.splice(w.length - 1, 0, ...r);
795
815
  }
796
- return S;
816
+ return w;
797
817
  }
798
- function d() {
799
- var A;
800
- const S = [
818
+ function I() {
819
+ var O;
820
+ const w = [
801
821
  {
802
822
  accessorKey: "purchaseOrder.seqNumber",
803
- header: () => g("inventory.transfer.table.seqNo"),
823
+ header: () => t("inventory.transfer.table.seqNo"),
804
824
  enableSorting: !0,
805
825
  size: 80,
806
826
  sortUndefined: "last"
807
827
  },
808
828
  {
809
829
  accessorKey: "purchaseOrder._id",
810
- header: () => g("inventory.transfer.table.createdAt"),
811
- cell(l) {
812
- return We(`${l.getValue()}`);
830
+ header: () => t("inventory.transfer.table.createdAt"),
831
+ cell(r) {
832
+ return We(`${r.getValue()}`);
813
833
  },
814
834
  enableSorting: !0
815
835
  },
816
836
  {
817
837
  accessorKey: "to.name",
818
- header: () => g("inventory.transfer.table.transferTo"),
838
+ header: () => t("inventory.transfer.table.transferTo"),
819
839
  enableSorting: !1,
820
840
  size: 200
821
841
  },
822
842
  {
823
843
  accessorKey: "purchaseOrder.items.length",
824
- header: () => g("inventory.transfer.table.noOfItems"),
844
+ header: () => t("inventory.transfer.table.noOfItems"),
825
845
  enableSorting: !1
826
846
  },
827
847
  {
828
848
  accessorKey: "purchaseOrder.ref",
829
- header: () => g("inventory.transfer.table.reference"),
849
+ header: () => t("inventory.transfer.table.reference"),
830
850
  enableSorting: !1,
831
851
  size: "auto"
832
852
  },
833
- ...(A = n.sessionUser.value) != null && A.role.isAdmin ? [
853
+ ...(O = n.sessionUser.value) != null && O.role.isAdmin ? [
834
854
  {
835
855
  id: "statusForAdmin",
836
- header: () => L(Pe, {}, () => `${g("inventory.transfer.table.status")}`),
837
- cell(l) {
838
- return l.row.original.status;
856
+ header: () => L(Ve, {}, () => `${t("inventory.transfer.table.status")}`),
857
+ cell(r) {
858
+ return r.row.original.status;
839
859
  },
840
860
  enableSorting: !0,
841
861
  size: 200
@@ -843,17 +863,17 @@ function Qn(C, a, o) {
843
863
  ] : [],
844
864
  {
845
865
  accessorKey: "purchaseOrder.status",
846
- header: () => g("inventory.transfer.table.status"),
847
- cell(l) {
848
- const t = l.row.original, b = l.getValue();
849
- if (!t.purchaseOrder)
866
+ header: () => t("inventory.transfer.table.status"),
867
+ cell(r) {
868
+ const d = r.row.original, i = r.getValue();
869
+ if (!d.purchaseOrder)
850
870
  return L(Je.FmChip, {
851
871
  label: "N/A",
852
872
  compact: !0
853
873
  });
854
- const u = Xe(t.purchaseOrder), { partial: $, over: I } = nt(u), z = at(b ?? "", $, I);
855
- let R = g(`inventory.transfer.status.${z}`), Q = `${b ?? ""}`.toLocaleLowerCase("en-us");
856
- return z === te.enum.CLOSE && (R = `${g(`inventory.transfer.status.${te.enum.COMPLETE}`)}`), z === "PARTIAL_RECEIVED" && Q === te.enum.PROCESSING.toLocaleLowerCase("en-us") && (Q = te.enum.RECEIVING.toLocaleLowerCase("en-us")), t.rejectedAt && (R = g("inventory.transfer.status.REJECT"), Q = te.enum.REJECT.toLocaleLowerCase("en-us")), L(
874
+ const g = Xe(d.purchaseOrder), { partial: $, over: K } = nt(g), R = at(i ?? "", $, K);
875
+ let X = t(`inventory.transfer.status.${R}`), j = `${i ?? ""}`.toLocaleLowerCase("en-us");
876
+ return R === se.enum.CLOSE && (X = `${t(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), R === "PARTIAL_RECEIVED" && j === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (j = se.enum.RECEIVING.toLocaleLowerCase("en-us")), d.rejectedAt && (X = t("inventory.transfer.status.REJECT"), j = se.enum.REJECT.toLocaleLowerCase("en-us")), L(
857
877
  "div",
858
878
  {
859
879
  class: "flex"
@@ -863,11 +883,11 @@ function Qn(C, a, o) {
863
883
  {
864
884
  class: [
865
885
  "fm-status-badge",
866
- `fm-status-badge-${Q}`,
867
- I && "fm-status-badge-error"
886
+ `fm-status-badge-${j}`,
887
+ K && "fm-status-badge-error"
868
888
  ].filter(Boolean).join(" ")
869
889
  },
870
- `${R}`
890
+ `${X}`
871
891
  )
872
892
  );
873
893
  },
@@ -875,14 +895,14 @@ function Qn(C, a, o) {
875
895
  },
876
896
  {
877
897
  id: "action",
878
- cell(l) {
879
- const t = l.row.original, u = (t.purchaseOrder ? s(t.purchaseOrder) : []).map(($) => $.value === ye.Print ? {
898
+ cell(r) {
899
+ const d = r.row.original, g = (d.purchaseOrder ? c(d.purchaseOrder) : []).map(($) => $.value === ye.Print ? {
880
900
  ...$,
881
901
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
882
902
  } : $);
883
903
  return mt(
884
- u,
885
- ($) => t.purchaseOrder ? O($, t.purchaseOrder, t) : void 0
904
+ g,
905
+ ($) => d.purchaseOrder ? x($, d.purchaseOrder, d) : void 0
886
906
  );
887
907
  },
888
908
  enableSorting: !1,
@@ -893,19 +913,19 @@ function Qn(C, a, o) {
893
913
  }
894
914
  }
895
915
  ];
896
- if (h.isEnabled) {
897
- const l = [
916
+ if (b.isEnabled) {
917
+ const r = [
898
918
  {
899
919
  id: "netsuiteTransferOrder",
900
- accessorFn: (t) => {
901
- var b;
902
- return (b = t.netSuite) != null && b.id ? `${t.netSuite.refNo} (${t.netSuite.id})` : "N/A";
920
+ accessorFn: (d) => {
921
+ var i;
922
+ return (i = d.netSuite) != null && i.id ? `${d.netSuite.refNo} (${d.netSuite.id})` : "N/A";
903
923
  },
904
924
  header: () => "NetSuite Order (ID)",
905
- cell(t) {
906
- var u;
907
- const b = t.row.original;
908
- return (u = b.netSuite) != null && u.id ? `${b.netSuite.refNo} (${b.netSuite.id})` : "N/A";
925
+ cell(d) {
926
+ var g;
927
+ const i = d.row.original;
928
+ return (g = i.netSuite) != null && g.id ? `${i.netSuite.refNo} (${i.netSuite.id})` : "N/A";
909
929
  },
910
930
  enableSorting: !1,
911
931
  size: 200,
@@ -916,14 +936,14 @@ function Qn(C, a, o) {
916
936
  },
917
937
  {
918
938
  id: "netsuiteTransactionNumber",
919
- accessorFn: (t) => {
920
- var b, u;
921
- return ((u = (b = t.netSuite) == null ? void 0 : b.additionalInfo) == null ? void 0 : u.transactionnumber) ?? "N/A";
939
+ accessorFn: (d) => {
940
+ var i, g;
941
+ return ((g = (i = d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber) ?? "N/A";
922
942
  },
923
943
  header: () => "NetSuite Transaction No.",
924
- cell(t) {
925
- var u, $;
926
- return (($ = (u = t.row.original.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
944
+ cell(d) {
945
+ var g, $;
946
+ return (($ = (g = d.row.original.netSuite) == null ? void 0 : g.additionalInfo) == null ? void 0 : $.transactionnumber) ?? "N/A";
927
947
  },
928
948
  enableSorting: !1,
929
949
  size: 200,
@@ -933,15 +953,15 @@ function Qn(C, a, o) {
933
953
  }
934
954
  }
935
955
  ];
936
- S.splice(S.length - 2, 0, ...l);
956
+ w.splice(w.length - 2, 0, ...r);
937
957
  }
938
- return S;
958
+ return w;
939
959
  }
940
960
  return {
941
- columnDefs: Y(() => C === "receive/request" ? w() : d())
961
+ columnDefs: Y(() => C === "receive/request" ? u() : I())
942
962
  };
943
963
  }
944
- const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, es = { class: "flex flex-col gap-8" }, ts = { class: "flex w-full justify-end gap-16" }, ss = /* @__PURE__ */ $e({
964
+ const es = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg p-16" }, ts = { class: "flex flex-col gap-8" }, ss = { class: "flex w-full justify-end gap-16" }, rs = /* @__PURE__ */ $e({
945
965
  __name: "FulfillmentForm",
946
966
  props: {
947
967
  purchaseOrder: {},
@@ -949,43 +969,43 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
949
969
  },
950
970
  emits: ["update:show"],
951
971
  setup(C, { emit: a }) {
952
- const o = C, f = Ct({
972
+ const o = C, f = Rt({
953
973
  id: "",
954
974
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
955
975
  items: []
956
- }), h = J(), n = a;
976
+ }), b = J(), n = a;
957
977
  yt(() => {
958
- o.purchaseOrder && (f.items = o.purchaseOrder.items.map((s) => ({
959
- id: s.id,
960
- sku: s.sku,
961
- measurement: s.measurement,
962
- amount: s.quantity ?? { amount: 1, precision: 0 }
978
+ o.purchaseOrder && (f.items = o.purchaseOrder.items.map((t) => ({
979
+ id: t.id,
980
+ sku: t.sku,
981
+ measurement: t.measurement,
982
+ amount: t.quantity ?? { amount: 1, precision: 0 }
963
983
  })));
964
984
  });
965
- const g = Y(() => f.items.length <= 10);
966
- return (s, c) => {
967
- const O = H("FmTable"), w = H("FmButton"), d = H("FmForm");
968
- return i(), re(d, {
985
+ const A = Y(() => f.items.length <= 10);
986
+ return (t, c) => {
987
+ const S = H("FmTable"), x = H("FmButton"), u = H("FmForm");
988
+ return l(), re(u, {
969
989
  ref_key: "formRef",
970
- ref: h,
990
+ ref: b,
971
991
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
972
992
  onValidationFailed: console.log,
973
993
  onValidationSuccess: c[1] || (c[1] = () => o.confirm(f))
974
994
  }, {
975
- default: Z(() => [
995
+ default: ee(() => [
976
996
  c[2] || (c[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
977
- e("div", Zt, [
978
- e("div", es, [
979
- D(O, {
997
+ e("div", es, [
998
+ e("div", ts, [
999
+ D(S, {
980
1000
  "column-defs": [
981
1001
  {
982
1002
  header: "Code",
983
- cell: (T) => {
984
- const S = o.purchaseOrder.items.find((A) => A.id === T.row.original.id || A.sku._id === T.row.original.sku._id);
1003
+ cell: (I) => {
1004
+ const N = o.purchaseOrder.items.find((w) => w.id === I.row.original.id || w.sku._id === I.row.original.sku._id);
985
1005
  return L(
986
1006
  v(Je).FmTooltip,
987
1007
  {
988
- content: S.code,
1008
+ content: N.code,
989
1009
  placement: "top",
990
1010
  variant: "plain",
991
1011
  zIndex: 50
@@ -995,19 +1015,19 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
995
1015
  {
996
1016
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
997
1017
  },
998
- S.code
1018
+ N.code
999
1019
  )
1000
1020
  );
1001
1021
  }
1002
1022
  },
1003
1023
  {
1004
1024
  header: "Name",
1005
- cell: (T) => {
1006
- const S = o.purchaseOrder.items.find((A) => A.id === T.row.original.id || A.sku._id === T.row.original.sku._id);
1025
+ cell: (I) => {
1026
+ const N = o.purchaseOrder.items.find((w) => w.id === I.row.original.id || w.sku._id === I.row.original.sku._id);
1007
1027
  return L(
1008
1028
  v(Je).FmTooltip,
1009
1029
  {
1010
- content: S.name,
1030
+ content: N.name,
1011
1031
  placement: "top",
1012
1032
  variant: "plain",
1013
1033
  zIndex: 50
@@ -1017,39 +1037,39 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1017
1037
  {
1018
1038
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
1019
1039
  },
1020
- S.name
1040
+ N.name
1021
1041
  )
1022
1042
  );
1023
1043
  }
1024
1044
  },
1025
1045
  {
1026
1046
  header: "Amount",
1027
- cell: (T) => {
1028
- const S = T.row.original, A = o.purchaseOrder.items.find((t) => t.id === S.id || t.sku._id === S.sku._id), l = S.amount ?? {
1047
+ cell: (I) => {
1048
+ const N = I.row.original, w = o.purchaseOrder.items.find((r) => r.id === N.id || r.sku._id === N.sku._id), O = N.amount ?? {
1029
1049
  amount: 1,
1030
1050
  precision: 0
1031
1051
  };
1032
- return L(Bt, {
1052
+ return L(jt, {
1033
1053
  style: {
1034
1054
  flex: "1 1 0%"
1035
1055
  },
1036
1056
  modelValue: {
1037
- amount: l,
1038
- measurement: S.measurement ?? null
1057
+ amount: O,
1058
+ measurement: N.measurement ?? null
1039
1059
  },
1040
- key: S.id ?? S.sku._id,
1041
- unit: S.sku.unit,
1042
- "onUpdate:modelValue": (t) => {
1043
- if (!t) return;
1044
- const b = f.items.find((u) => u.id === S.id || u.sku._id === S.sku._id);
1045
- b && (b.amount = t.amount);
1060
+ key: N.id ?? N.sku._id,
1061
+ unit: N.sku.unit,
1062
+ "onUpdate:modelValue": (r) => {
1063
+ if (!r) return;
1064
+ const d = f.items.find((i) => i.id === N.id || i.sku._id === N.sku._id);
1065
+ d && (d.amount = r.amount);
1046
1066
  },
1047
1067
  disableUnit: !0,
1048
1068
  rules: [
1049
- v(jt)(
1069
+ v(zt)(
1050
1070
  +v(he)({ amount: 0, precision: 0 })
1051
1071
  ),
1052
- v(zt)(+v(he)(A.quantity))
1072
+ v(Kt)(+v(he)(w.quantity))
1053
1073
  ],
1054
1074
  applyDefaultRules: !0
1055
1075
  });
@@ -1057,19 +1077,19 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1057
1077
  }
1058
1078
  ],
1059
1079
  "row-data": f.items,
1060
- "hide-footer": g.value
1080
+ "hide-footer": A.value
1061
1081
  }, null, 8, ["column-defs", "row-data", "hide-footer"])
1062
1082
  ])
1063
1083
  ]),
1064
- e("div", ts, [
1065
- D(w, {
1084
+ e("div", ss, [
1085
+ D(x, {
1066
1086
  class: "px-16",
1067
1087
  label: "Confirm",
1068
1088
  size: "md",
1069
1089
  variant: "primary",
1070
1090
  type: "submit"
1071
1091
  }),
1072
- D(w, {
1092
+ D(x, {
1073
1093
  class: "px-16",
1074
1094
  label: "Cancel",
1075
1095
  size: "md",
@@ -1086,88 +1106,67 @@ const Zt = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1086
1106
  submitRequest: {
1087
1107
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
1088
1108
  color: "primary",
1089
- buttonVariant: be.Primary
1109
+ buttonVariant: ge.Primary
1090
1110
  },
1091
1111
  confirmDraft: {
1092
1112
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
1093
1113
  color: "primary",
1094
- buttonVariant: be.Primary
1114
+ buttonVariant: ge.Primary
1095
1115
  },
1096
1116
  cancelDraft: {
1097
1117
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
1098
1118
  color: "system-error-300",
1099
- buttonVariant: be.Destructive
1119
+ buttonVariant: ge.Destructive
1100
1120
  },
1101
1121
  approveDraft: {
1102
1122
  translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
1103
1123
  color: "primary",
1104
- buttonVariant: be.Primary
1124
+ buttonVariant: ge.Primary
1105
1125
  },
1106
1126
  rejectDraft: {
1107
1127
  translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
1108
1128
  color: "system-error-300",
1109
- buttonVariant: be.Destructive
1129
+ buttonVariant: ge.Destructive
1110
1130
  },
1111
1131
  approveRequest: {
1112
1132
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
1113
1133
  color: "primary",
1114
- buttonVariant: be.Primary
1134
+ buttonVariant: ge.Primary
1115
1135
  },
1116
1136
  processRequest: {
1117
1137
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
1118
1138
  color: "primary",
1119
- buttonVariant: be.Primary
1139
+ buttonVariant: ge.Primary
1120
1140
  },
1121
1141
  receiveStock: {
1122
1142
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
1123
1143
  color: "primary",
1124
- buttonVariant: be.Primary,
1144
+ buttonVariant: ge.Primary,
1125
1145
  available: !1
1126
1146
  },
1127
1147
  completeReceive: {
1128
1148
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
1129
1149
  color: "primary",
1130
- buttonVariant: be.Plain
1150
+ buttonVariant: ge.Plain
1131
1151
  },
1132
1152
  rejectRequest: {
1133
1153
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
1134
1154
  color: "system-error-300",
1135
- buttonVariant: be.Destructive
1155
+ buttonVariant: ge.Destructive
1136
1156
  },
1137
1157
  closeRequest: {
1138
1158
  translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
1139
1159
  color: "system-error-300",
1140
- buttonVariant: be.Destructive,
1160
+ buttonVariant: ge.Destructive,
1141
1161
  available: !1
1142
1162
  },
1143
1163
  returnStock: {
1144
1164
  translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
1145
1165
  color: "primary",
1146
- buttonVariant: be.Primary,
1166
+ buttonVariant: ge.Primary,
1147
1167
  available: !1
1148
1168
  }
1149
- };
1150
- function rs() {
1151
- const C = Ue();
1152
- return {
1153
- ableToMarkReceived(a) {
1154
- if (!a || a.status !== te.enum.RECEIVING || C.useOperatePurchaseOrderV2) return !1;
1155
- const f = De().currentLocationDBName;
1156
- return `${a.supplier.internal}_${a.supplier._id}` !== f;
1157
- },
1158
- ableToMarkApproved(a) {
1159
- return !(!a || (a == null ? void 0 : a.status) !== te.enum.REQUESTING);
1160
- },
1161
- ableToCreateFulfillment(a, o) {
1162
- var n, g;
1163
- if (!C.acceptRequireFulfillment || !a || !o || a.status !== te.enum.PROCESSING || !o.processedAt)
1164
- return !1;
1165
- const f = (n = o == null ? void 0 : o.from) == null ? void 0 : n.dbName, h = (g = o == null ? void 0 : o.to) == null ? void 0 : g.dbName;
1166
- return !(f.startsWith("restaurant_") && h.startsWith("restaurant_"));
1167
- }
1168
- };
1169
- }
1170
- const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1169
+ }, os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1171
1170
  __name: "NetSuiteSync",
1172
1171
  props: {
1173
1172
  poRequest: {},
@@ -1176,16 +1175,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1176
1175
  scope: {}
1177
1176
  },
1178
1177
  setup(C) {
1179
- const a = C, o = et(), f = Be(), h = tt(), n = J(!1);
1178
+ const a = C, o = et(), f = Be(), b = tt(), n = J(!1);
1180
1179
  Y(() => {
1181
- var w, d, T, S;
1182
- let s = !0;
1183
- o.isEnabled || (s = !1);
1184
- const c = a.purchaseOrder, O = a.poRequest;
1185
- return c && ((w = c == null ? void 0 : c.supplier) != null && w.internal ? (!O && c.status == te.enum.DRAFT && (s = !1), O && !((d = O == null ? void 0 : O.netSuite) != null && d.id) && (s = !1), a.isTransferBetweenOutlets && (s = !1)) : ((c == null ? void 0 : c.status) !== te.enum.REQUESTING && c.supplier.internal && (s = !1), !O && !((T = c == null ? void 0 : c.netSuite) != null && T.id) && (s = !1), !O && ((S = c == null ? void 0 : c.netSuite) != null && S.id) && (c == null ? void 0 : c.status) == te.enum.REQUESTING && (s = !1))), s;
1180
+ var x, u, I, N;
1181
+ let t = !0;
1182
+ o.isEnabled || (t = !1);
1183
+ const c = a.purchaseOrder, S = a.poRequest;
1184
+ return c && ((x = c == null ? void 0 : c.supplier) != null && x.internal ? (!S && c.status == se.enum.DRAFT && (t = !1), S && !((u = S == null ? void 0 : S.netSuite) != null && u.id) && (t = !1), a.isTransferBetweenOutlets && (t = !1)) : ((c == null ? void 0 : c.status) !== se.enum.REQUESTING && c.supplier.internal && (t = !1), !S && !((I = c == null ? void 0 : c.netSuite) != null && I.id) && (t = !1), !S && ((N = c == null ? void 0 : c.netSuite) != null && N.id) && (c == null ? void 0 : c.status) == se.enum.REQUESTING && (t = !1))), t;
1186
1185
  });
1187
- async function g() {
1188
- n.value || h.open({
1186
+ async function A() {
1187
+ n.value || b.open({
1189
1188
  title: "Sync with NetSuite",
1190
1189
  contentComponent: L("div", [
1191
1190
  L("p", "Are you sure you want to sync now?"),
@@ -1203,18 +1202,18 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1203
1202
  },
1204
1203
  secondaryActions: { text: "Not now", close: !0 }
1205
1204
  }).onPrimary(async () => {
1206
- var s, c, O;
1205
+ var t, c, S;
1207
1206
  try {
1208
1207
  n.value = !0;
1209
- const w = ((s = a.purchaseOrder) == null ? void 0 : s._id) || ((c = a.poRequest) == null ? void 0 : c.purchaseOrderId) || "", d = (O = a.poRequest) == null ? void 0 : O.to.dbName;
1208
+ const x = ((t = a.purchaseOrder) == null ? void 0 : t._id) || ((c = a.poRequest) == null ? void 0 : c.purchaseOrderId) || "", u = (S = a.poRequest) == null ? void 0 : S.to.dbName;
1210
1209
  await o.syncPurchaseOrder(
1211
- w,
1212
- a.scope === "approval" ? d : void 0
1210
+ x,
1211
+ a.scope === "approval" ? u : void 0
1213
1212
  ), f.open({
1214
1213
  title: "Sync with NetSuite",
1215
1214
  message: "Requested to sync with NetSuite. Please wait a moment.",
1216
1215
  type: "success"
1217
- }), await new Promise((T) => setTimeout(T, 5e3)), n.value = !1;
1216
+ }), await new Promise((I) => setTimeout(I, 5e3)), n.value = !1;
1218
1217
  } catch {
1219
1218
  f.open({
1220
1219
  title: "Error",
@@ -1224,15 +1223,15 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1224
1223
  }
1225
1224
  });
1226
1225
  }
1227
- return (s, c) => {
1228
- const O = H("FmButton");
1229
- return i(), _("div", os, [
1230
- D(O, {
1226
+ return (t, c) => {
1227
+ const S = H("FmButton");
1228
+ return l(), h("div", os, [
1229
+ D(S, {
1231
1230
  "prepend-icon": "sync",
1232
1231
  variant: "secondary",
1233
1232
  label: "Sync",
1234
1233
  loading: n.value,
1235
- onClick: g,
1234
+ onClick: A,
1236
1235
  "text-color": "primary",
1237
1236
  "bg-color": "transparent",
1238
1237
  "border-color": "primary"
@@ -1249,7 +1248,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1249
1248
  }, us = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ds = { class: "fm-typo-en-body-lg-600" }, ms = { key: 0 }, ps = { key: 1 }, fs = {
1250
1249
  key: 1,
1251
1250
  class: "flex flex-col gap-4"
1252
- }, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vs = { class: "fm-typo-en-body-lg-600" }, hs = { key: 0 }, bs = { key: 1 }, gs = {
1251
+ }, ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, vs = { class: "fm-typo-en-body-lg-600" }, bs = { key: 0 }, hs = { key: 1 }, gs = {
1253
1252
  key: 2,
1254
1253
  class: "flex flex-col gap-4"
1255
1254
  }, _s = { class: "fm-typo-en-body-lg-600" }, Ss = {
@@ -1266,57 +1265,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1266
1265
  scope: {}
1267
1266
  },
1268
1267
  setup(C) {
1269
- const a = C, o = et(), f = je(), h = J(a.poRequest);
1268
+ const a = C, o = et(), f = je(), b = J(a.poRequest);
1270
1269
  yt(async () => {
1271
1270
  var c;
1272
1271
  if (!a.poRequest && ((c = a.purchaseOrder) != null && c._id)) {
1273
- const O = await f.getLatestPurchaseOrderRequest(a.purchaseOrder._id);
1274
- h.value = O;
1272
+ const S = await f.getLatestPurchaseOrderRequest(a.purchaseOrder._id);
1273
+ b.value = S;
1275
1274
  }
1276
1275
  });
1277
1276
  const n = Y(
1278
1277
  () => {
1279
- var c, O, w, d, T, S;
1278
+ var c, S, x, u, I, N;
1280
1279
  return o.getSubsidiaryFullName(
1281
- ((w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.subsidiary) == null ? void 0 : w.id) || ((S = (T = (d = a.poRequest) == null ? void 0 : d.netSuite) == null ? void 0 : T.subsidiary) == null ? void 0 : S.id)
1280
+ ((x = (S = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : S.subsidiary) == null ? void 0 : x.id) || ((N = (I = (u = a.poRequest) == null ? void 0 : u.netSuite) == null ? void 0 : I.subsidiary) == null ? void 0 : N.id)
1282
1281
  ).fullName;
1283
1282
  }
1284
- ), g = Y(() => {
1285
- var c, O, w, d, T, S, A, l, t, b, u, $;
1286
- return (w = (O = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : O.additionalInfo) != null && w.transactionnumber ? (S = (T = (d = a.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : T.additionalInfo) == null ? void 0 : S.transactionnumber : (t = (l = (A = h.value) == null ? void 0 : A.netSuite) == null ? void 0 : l.additionalInfo) != null && t.transactionnumber ? ($ = (u = (b = h.value) == null ? void 0 : b.netSuite) == null ? void 0 : u.additionalInfo) == null ? void 0 : $.transactionnumber : null;
1287
- }), s = Y(() => {
1288
- var c, O, w, d, T, S;
1289
- return (O = (c = a.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) != null && O.length && ((d = (w = a.purchaseOrder) == null ? void 0 : w.deliveryFullfillment) == null ? void 0 : d.length) > 0 ? (S = (T = a.purchaseOrder) == null ? void 0 : T.deliveryFullfillment) == null ? void 0 : S.map((A) => {
1290
- var l;
1291
- return (l = A.netSuite) == null ? void 0 : l.refNo;
1283
+ ), A = Y(() => {
1284
+ var c, S, x, u, I, N, w, O, r, d, i, g;
1285
+ return (x = (S = (c = a.purchaseOrder) == null ? void 0 : c.netSuite) == null ? void 0 : S.additionalInfo) != null && x.transactionnumber ? (N = (I = (u = a.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : I.additionalInfo) == null ? void 0 : N.transactionnumber : (r = (O = (w = b.value) == null ? void 0 : w.netSuite) == null ? void 0 : O.additionalInfo) != null && r.transactionnumber ? (g = (i = (d = b.value) == null ? void 0 : d.netSuite) == null ? void 0 : i.additionalInfo) == null ? void 0 : g.transactionnumber : null;
1286
+ }), t = Y(() => {
1287
+ var c, S, x, u, I, N;
1288
+ return (S = (c = a.purchaseOrder) == null ? void 0 : c.deliveryFullfillment) != null && S.length && ((u = (x = a.purchaseOrder) == null ? void 0 : x.deliveryFullfillment) == null ? void 0 : u.length) > 0 ? (N = (I = a.purchaseOrder) == null ? void 0 : I.deliveryFullfillment) == null ? void 0 : N.map((w) => {
1289
+ var O;
1290
+ return (O = w.netSuite) == null ? void 0 : O.refNo;
1292
1291
  }).join(", ") : "N/A";
1293
1292
  });
1294
- return (c, O) => {
1295
- var w, d, T, S, A, l, t, b, u, $, I, z, R, Q, K, se;
1296
- return v(o).isEnabled ? (i(), _("div", as, [
1293
+ return (c, S) => {
1294
+ var x, u, I, N, w, O, r, d, i, g, $, K, R, X, j, Q;
1295
+ return v(o).isEnabled ? (l(), h("div", as, [
1297
1296
  e("div", ls, [
1298
- O[0] || (O[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1297
+ S[0] || (S[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1299
1298
  e("div", is, y(n.value || "N/A"), 1)
1300
1299
  ]),
1301
- !c.isTransferBetweenOutlets && c.scope === v(lt).RECEIVE_REQUEST ? (i(), _("div", cs, [
1302
- e("div", us, " NetSuite " + y((d = (w = c.purchaseOrder) == null ? void 0 : w.netSuite) != null && d.recordType ? v(ht)((S = (T = c.purchaseOrder) == null ? void 0 : T.netSuite) == null ? void 0 : S.recordType) : c.transferType === v(Ge).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1300
+ !c.isTransferBetweenOutlets && c.scope === v(lt).RECEIVE_REQUEST ? (l(), h("div", cs, [
1301
+ e("div", us, " NetSuite " + y((u = (x = c.purchaseOrder) == null ? void 0 : x.netSuite) != null && u.recordType ? v(bt)((N = (I = c.purchaseOrder) == null ? void 0 : I.netSuite) == null ? void 0 : N.recordType) : c.transferType === v(Ge).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1303
1302
  e("div", ds, [
1304
- (l = (A = c.purchaseOrder) == null ? void 0 : A.netSuite) != null && l.id ? (i(), _("span", ms, y((b = (t = c.purchaseOrder) == null ? void 0 : t.netSuite) == null ? void 0 : b.refNo) + " (" + y(($ = (u = c.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : $.id) + ") ", 1)) : (i(), _("span", ps, "N/A"))
1303
+ (O = (w = c.purchaseOrder) == null ? void 0 : w.netSuite) != null && O.id ? (l(), h("span", ms, y((d = (r = c.purchaseOrder) == null ? void 0 : r.netSuite) == null ? void 0 : d.refNo) + " (" + y((g = (i = c.purchaseOrder) == null ? void 0 : i.netSuite) == null ? void 0 : g.id) + ") ", 1)) : (l(), h("span", ps, "N/A"))
1305
1304
  ])
1306
1305
  ])) : U("", !0),
1307
- !c.isTransferBetweenOutlets && h.value || c.scope === v(lt).APPROVAL ? (i(), _("div", fs, [
1306
+ !c.isTransferBetweenOutlets && b.value || c.scope === v(lt).APPROVAL ? (l(), h("div", fs, [
1308
1307
  e("div", ys, " (Request) NetSuite " + y(c.transferType === v(Ge).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1309
1308
  e("div", vs, [
1310
- (z = (I = h.value) == null ? void 0 : I.netSuite) != null && z.id ? (i(), _("span", hs, y((Q = (R = h.value) == null ? void 0 : R.netSuite) == null ? void 0 : Q.refNo) + " (" + y((se = (K = h.value) == null ? void 0 : K.netSuite) == null ? void 0 : se.id) + ") ", 1)) : (i(), _("span", bs, "N/A"))
1309
+ (K = ($ = b.value) == null ? void 0 : $.netSuite) != null && K.id ? (l(), h("span", bs, y((X = (R = b.value) == null ? void 0 : R.netSuite) == null ? void 0 : X.refNo) + " (" + y((Q = (j = b.value) == null ? void 0 : j.netSuite) == null ? void 0 : Q.id) + ") ", 1)) : (l(), h("span", hs, "N/A"))
1311
1310
  ])
1312
1311
  ])) : U("", !0),
1313
- g.value ? (i(), _("div", gs, [
1314
- O[1] || (O[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1315
- e("div", _s, y(g.value), 1)
1312
+ A.value ? (l(), h("div", gs, [
1313
+ S[1] || (S[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1314
+ e("div", _s, y(A.value), 1)
1316
1315
  ])) : U("", !0),
1317
- v(o).isEnabled && c.transferType === v(Ge).enum.transfer && !c.isTransferBetweenOutlets ? (i(), _("div", Ss, [
1318
- O[2] || (O[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1319
- e("div", xs, y(s.value), 1)
1316
+ v(o).isEnabled && c.transferType === v(Ge).enum.transfer && !c.isTransferBetweenOutlets ? (l(), h("div", Ss, [
1317
+ S[2] || (S[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1318
+ e("div", xs, y(t.value), 1)
1320
1319
  ])) : U("", !0)
1321
1320
  ])) : U("", !0);
1322
1321
  };
@@ -1329,36 +1328,36 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1329
1328
  },
1330
1329
  setup(C) {
1331
1330
  const a = Be(), o = dt();
1332
- async function f(h, n) {
1333
- const g = [];
1334
- if (h && g.push(`body.message:*${h}*`), n) {
1335
- const w = n.replace(/:/g, "\\:");
1336
- g.push(`${w}`);
1331
+ async function f(b, n) {
1332
+ const A = [];
1333
+ if (b && A.push(`body.message:*${b}*`), n) {
1334
+ const x = n.replace(/:/g, "\\:");
1335
+ A.push(`${x}`);
1337
1336
  }
1338
- if (g.length === 0) {
1337
+ if (A.length === 0) {
1339
1338
  a.open({
1340
1339
  message: "Cannot open logs without valid filters.",
1341
1340
  type: "error"
1342
1341
  });
1343
1342
  return;
1344
1343
  }
1345
- const c = `attributes.pod:netsuite* AND (${g.join(" OR ")})`, { url: O } = await o.getSyncLogs(c);
1344
+ const c = `attributes.pod:netsuite* AND (${A.join(" OR ")})`, { url: S } = await o.getSyncLogs(c);
1346
1345
  a.open(
1347
1346
  {
1348
1347
  message: "Opening NetSuite logs...",
1349
1348
  type: "info"
1350
1349
  },
1351
1350
  800
1352
- ), await new Promise((w) => setTimeout(w, 800)), window.open(O, "_blank");
1351
+ ), await new Promise((x) => setTimeout(x, 800)), window.open(S, "_blank");
1353
1352
  }
1354
- return (h, n) => {
1355
- const g = H("FmButton");
1356
- return i(), _("div", ws, [
1357
- D(g, {
1353
+ return (b, n) => {
1354
+ const A = H("FmButton");
1355
+ return l(), h("div", ws, [
1356
+ D(A, {
1358
1357
  "prepend-icon": "history",
1359
1358
  variant: "secondary",
1360
1359
  label: "Logs",
1361
- onClick: n[0] || (n[0] = (s) => f(h.netsuiteId, h.purchaseOrderId)),
1360
+ onClick: n[0] || (n[0] = (t) => f(b.netsuiteId, b.purchaseOrderId)),
1362
1361
  "text-color": "primary",
1363
1362
  "bg-color": "transparent",
1364
1363
  "border-color": "primary"
@@ -1382,39 +1381,39 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1382
1381
  purchaseOrderId: {}
1383
1382
  },
1384
1383
  setup(C) {
1385
- const a = C, o = dt(), f = J(!1), h = De(), n = J(!0), g = J(!1), s = J(!1), c = J(!1), O = J(null), w = J([]);
1386
- async function d() {
1387
- if (!O.value) {
1384
+ const a = C, o = dt(), f = J(!1), b = De(), n = J(!0), A = J(!1), t = J(!1), c = J(!1), S = J(null), x = J([]);
1385
+ async function u() {
1386
+ if (!S.value) {
1388
1387
  f.value = !0;
1389
1388
  try {
1390
1389
  n.value = !0;
1391
- const l = await o.getMoreInfo(
1392
- h.currentLocation.dbName,
1390
+ const O = await o.getMoreInfo(
1391
+ b.currentLocation.dbName,
1393
1392
  a.purchaseOrderId
1394
1393
  );
1395
- O.value = l, g.value = !1;
1394
+ S.value = O, A.value = !1;
1396
1395
  } catch {
1397
- g.value = !0;
1396
+ A.value = !0;
1398
1397
  } finally {
1399
1398
  n.value = !1;
1400
1399
  }
1401
- await T();
1400
+ await I();
1402
1401
  }
1403
1402
  }
1404
- async function T() {
1405
- if (!(w.value.length > 0))
1403
+ async function I() {
1404
+ if (!(x.value.length > 0))
1406
1405
  try {
1407
- s.value = !0;
1408
- const l = await o.getChangeLogs(a.netsuiteId);
1409
- w.value = l, c.value = !1;
1406
+ t.value = !0;
1407
+ const O = await o.getChangeLogs(a.netsuiteId);
1408
+ x.value = O, c.value = !1;
1410
1409
  } catch {
1411
1410
  c.value = !0;
1412
1411
  } finally {
1413
- s.value = !1;
1412
+ t.value = !1;
1414
1413
  }
1415
1414
  }
1416
- function S(l) {
1417
- switch (l) {
1415
+ function N(O) {
1416
+ switch (O) {
1418
1417
  case we.Create:
1419
1418
  return "text-green-600 bg-green-100";
1420
1419
  case we.Set:
@@ -1427,8 +1426,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1427
1426
  return "text-gray-600 bg-gray-100";
1428
1427
  }
1429
1428
  }
1430
- function A(l) {
1431
- return new Date(l).toLocaleDateString("en-US", {
1429
+ function w(O) {
1430
+ return new Date(O).toLocaleDateString("en-US", {
1432
1431
  year: "numeric",
1433
1432
  month: "short",
1434
1433
  day: "numeric",
@@ -1436,64 +1435,64 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1436
1435
  minute: "2-digit"
1437
1436
  });
1438
1437
  }
1439
- return (l, t) => {
1440
- const b = H("FmButton"), u = H("FmLabel"), $ = H("FmCircularProgress"), I = H("FmIcon"), z = H("FmDialog");
1441
- return i(), _("div", Cs, [
1442
- D(z, {
1438
+ return (O, r) => {
1439
+ const d = H("FmButton"), i = H("FmLabel"), g = H("FmCircularProgress"), $ = H("FmIcon"), K = H("FmDialog");
1440
+ return l(), h("div", Cs, [
1441
+ D(K, {
1443
1442
  modelValue: f.value,
1444
- "onUpdate:modelValue": t[2] || (t[2] = (R) => f.value = R),
1443
+ "onUpdate:modelValue": r[2] || (r[2] = (R) => f.value = R),
1445
1444
  overlay: !0,
1446
1445
  "max-width": 800
1447
1446
  }, {
1448
- "dialog-button": Z(() => [
1449
- D(b, {
1447
+ "dialog-button": ee(() => [
1448
+ D(d, {
1450
1449
  "prepend-icon": "info",
1451
1450
  variant: "secondary",
1452
1451
  label: "Latest Info",
1453
- onClick: t[0] || (t[0] = (R) => d()),
1452
+ onClick: r[0] || (r[0] = (R) => u()),
1454
1453
  "text-color": "primary",
1455
1454
  "bg-color": "transparent",
1456
1455
  "border-color": "primary"
1457
1456
  })
1458
1457
  ]),
1459
- "dialog-header": Z(() => t[3] || (t[3] = [
1458
+ "dialog-header": ee(() => r[3] || (r[3] = [
1460
1459
  e("div", null, "NetSuite latest info", -1)
1461
1460
  ])),
1462
- default: Z(() => [
1463
- n.value ? (i(), _("div", Rs, "Loading...")) : (i(), _("div", ks, [
1464
- g.value ? (i(), _("p", Hs, "Something went wrong.")) : (i(), _(ue, { key: 0 }, [
1461
+ default: ee(() => [
1462
+ n.value ? (l(), h("div", Rs, "Loading...")) : (l(), h("div", ks, [
1463
+ A.value ? (l(), h("p", Hs, "Something went wrong.")) : (l(), h(de, { key: 0 }, [
1465
1464
  e("div", Ds, [
1466
- t[4] || (t[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
1467
- (i(!0), _(ue, null, xe(O.value, (R, Q) => (i(), _("div", {
1468
- key: Q,
1465
+ r[4] || (r[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
1466
+ (l(!0), h(de, null, xe(S.value, (R, X) => (l(), h("div", {
1467
+ key: X,
1469
1468
  class: "mb-2"
1470
1469
  }, [
1471
1470
  e("div", null, [
1472
- D(u, {
1473
- label: v(it)(Q)
1471
+ D(i, {
1472
+ label: v(it)(X)
1474
1473
  }, null, 8, ["label"]),
1475
1474
  e("div", As, [
1476
- Array.isArray(R) ? (i(), _("span", Ns, y(R.length > 0 ? R.join(", ") : "N/A"), 1)) : (i(), _("span", Fs, y(R), 1))
1475
+ Array.isArray(R) ? (l(), h("span", Ns, y(R.length > 0 ? R.join(", ") : "N/A"), 1)) : (l(), h("span", Fs, y(R), 1))
1477
1476
  ])
1478
1477
  ])
1479
1478
  ]))), 128))
1480
1479
  ]),
1481
- s.value ? (i(), _("div", Ts, [
1482
- t[5] || (t[5] = e("span", null, "Change Log Loading...", -1)),
1483
- D($, { size: "md" })
1480
+ t.value ? (l(), h("div", Ts, [
1481
+ r[5] || (r[5] = e("span", null, "Change Log Loading...", -1)),
1482
+ D(g, { size: "md" })
1484
1483
  ])) : U("", !0),
1485
- !s.value && w.value.length > 0 ? (i(), _("div", Is, [
1484
+ !t.value && x.value.length > 0 ? (l(), h("div", Is, [
1486
1485
  e("h3", Ps, [
1487
- D(I, {
1486
+ D($, {
1488
1487
  name: "error",
1489
1488
  color: "#ff9500",
1490
1489
  size: "sm"
1491
1490
  }),
1492
- t[6] || (t[6] = ke(" Change Logs "))
1491
+ r[6] || (r[6] = ke(" Change Logs "))
1493
1492
  ]),
1494
1493
  e("div", qs, [
1495
1494
  e("table", Vs, [
1496
- t[7] || (t[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
1495
+ r[7] || (r[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
1497
1496
  e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
1498
1497
  e("th", {
1499
1498
  class: "text-left p-3 fm-typo-en-body-md-600",
@@ -1510,16 +1509,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1510
1509
  ])
1511
1510
  ], -1)),
1512
1511
  e("tbody", null, [
1513
- (i(!0), _(ue, null, xe(w.value, (R, Q) => (i(), _("tr", {
1514
- key: Q,
1512
+ (l(!0), h(de, null, xe(x.value, (R, X) => (l(), h("tr", {
1513
+ key: X,
1515
1514
  class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
1516
1515
  }, [
1517
- e("td", Es, y(A(R._dateiso8601)), 1),
1516
+ e("td", Es, y(w(R._dateiso8601)), 1),
1518
1517
  e("td", Ls, y(R._rolename), 1),
1519
1518
  e("td", Ms, y(R._employeename), 1),
1520
1519
  e("td", Us, y(R._contextname), 1),
1521
1520
  e("td", {
1522
- class: Me(`p-3 fm-typo-en-body-sm-600 ${S(Number(R.type) - 1)}`)
1521
+ class: Me(`p-3 fm-typo-en-body-sm-600 ${N(Number(R.type) - 1)}`)
1523
1522
  }, y(v(we)[Number(R.type) - 1]), 3),
1524
1523
  e("td", Bs, y(R.lineid || ""), 1),
1525
1524
  e("td", js, y(R._fieldname), 1),
@@ -1529,19 +1528,19 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1529
1528
  ])
1530
1529
  ])
1531
1530
  ])
1532
- ])) : (i(), _("div", Gs, t[8] || (t[8] = [
1531
+ ])) : (l(), h("div", Gs, r[8] || (r[8] = [
1533
1532
  e("p", null, "No change logs available.", -1)
1534
1533
  ])))
1535
1534
  ], 64))
1536
1535
  ]))
1537
1536
  ]),
1538
- "dialog-footer": Z(() => [
1539
- D(b, {
1537
+ "dialog-footer": ee(() => [
1538
+ D(d, {
1540
1539
  class: "ml-auto sm:w-full xs:w-full",
1541
1540
  label: "Close",
1542
1541
  size: "md",
1543
1542
  variant: "primary",
1544
- onClick: t[1] || (t[1] = (R) => f.value = !1)
1543
+ onClick: r[1] || (r[1] = (R) => f.value = !1)
1545
1544
  })
1546
1545
  ]),
1547
1546
  _: 1
@@ -1562,56 +1561,56 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1562
1561
  scope: {}
1563
1562
  },
1564
1563
  setup(C) {
1565
- const a = C, o = Gt(), f = Y(() => o.isNetSuiteEnabled);
1566
- return (h, n) => {
1567
- var s, c;
1568
- const g = H("FmMenuDivider");
1569
- return f.value ? (i(), _("div", Ys, [
1564
+ const a = C, o = Ht(), f = Y(() => o.isNetSuiteEnabled);
1565
+ return (b, n) => {
1566
+ var t, c;
1567
+ const A = H("FmMenuDivider");
1568
+ return f.value ? (l(), h("div", Ys, [
1570
1569
  e("div", Qs, [
1571
1570
  n[0] || (n[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
1572
1571
  e("div", Js, [
1573
1572
  e("div", Xs, [
1574
- (c = (s = a.purchaseOrder) == null ? void 0 : s.netSuite) != null && c.id ? (i(), re(Pe, { key: 0 }, {
1575
- default: Z(() => {
1576
- var O, w, d;
1573
+ (c = (t = a.purchaseOrder) == null ? void 0 : t.netSuite) != null && c.id ? (l(), re(Ve, { key: 0 }, {
1574
+ default: ee(() => {
1575
+ var S, x, u;
1577
1576
  return [
1578
1577
  D(Ws, {
1579
- "netsuite-id": (w = (O = h.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
1580
- "purchase-order-id": (d = h.purchaseOrder) == null ? void 0 : d._id
1578
+ "netsuite-id": (x = (S = b.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : x.id,
1579
+ "purchase-order-id": (u = b.purchaseOrder) == null ? void 0 : u._id
1581
1580
  }, null, 8, ["netsuite-id", "purchase-order-id"])
1582
1581
  ];
1583
1582
  }),
1584
1583
  _: 1
1585
1584
  })) : U("", !0),
1586
- D(Pe, null, {
1587
- default: Z(() => {
1588
- var O, w, d;
1585
+ D(Ve, null, {
1586
+ default: ee(() => {
1587
+ var S, x, u;
1589
1588
  return [
1590
1589
  D($s, {
1591
- "netsuite-id": (w = (O = h.purchaseOrder) == null ? void 0 : O.netSuite) == null ? void 0 : w.id,
1592
- "purchase-order-id": (d = h.purchaseOrder) == null ? void 0 : d._id
1590
+ "netsuite-id": (x = (S = b.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : x.id,
1591
+ "purchase-order-id": (u = b.purchaseOrder) == null ? void 0 : u._id
1593
1592
  }, null, 8, ["netsuite-id", "purchase-order-id"])
1594
1593
  ];
1595
1594
  }),
1596
1595
  _: 1
1597
1596
  }),
1598
1597
  D(ns, {
1599
- "po-request": h.poRequest,
1600
- "purchase-order": h.purchaseOrder,
1598
+ "po-request": b.poRequest,
1599
+ "purchase-order": b.purchaseOrder,
1601
1600
  "is-transfer-between-outlets": !f.value,
1602
- scope: h.scope
1601
+ scope: b.scope
1603
1602
  }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
1604
1603
  ])
1605
1604
  ])
1606
1605
  ]),
1607
- D(g),
1606
+ D(A),
1608
1607
  D(Os, {
1609
- "po-request": h.poRequest,
1610
- "purchase-order": h.purchaseOrder,
1611
- "transfer-type": h.transferType,
1612
- "transfer-to-db-name": h.transferToDbName,
1608
+ "po-request": b.poRequest,
1609
+ "purchase-order": b.purchaseOrder,
1610
+ "transfer-type": b.transferType,
1611
+ "transfer-to-db-name": b.transferToDbName,
1613
1612
  "is-transfer-between-outlets": !f.value,
1614
- scope: h.scope
1613
+ scope: b.scope
1615
1614
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
1616
1615
  ])) : U("", !0);
1617
1616
  };
@@ -1625,7 +1624,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1625
1624
  }, mr = { class: "flex flex-col gap-4" }, pr = { class: "flex flex-col gap-4" }, fr = { class: "flex flex-col gap-4" }, yr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, vr = {
1626
1625
  key: 0,
1627
1626
  class: "flex flex-col gap-4"
1628
- }, hr = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, br = /* @__PURE__ */ $e({
1627
+ }, br = { class: "flex flex-col gap-4 fm-typo-en-body-lg-600" }, hr = /* @__PURE__ */ $e({
1629
1628
  __name: "EditForm",
1630
1629
  props: {
1631
1630
  purchaseOrder: {},
@@ -1633,57 +1632,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1633
1632
  },
1634
1633
  emits: ["submitted"],
1635
1634
  setup(C, { emit: a }) {
1636
- Wt();
1637
- const o = Ue(), f = Be(), h = J(!1), n = C, g = a, s = St("deliveryOrder"), c = je(), O = Y(
1635
+ Yt();
1636
+ const o = Ue(), f = Be(), b = J(!1), n = C, A = a, t = St("deliveryOrder"), c = je(), S = Y(
1638
1637
  () => {
1639
- var b;
1640
- return ((b = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : b.findIndex(
1641
- (u) => n.deliveryOrder.fullfillmentId && u.id === n.deliveryOrder.fullfillmentId
1638
+ var d;
1639
+ return ((d = n.purchaseOrder.deliveryFullfillment) == null ? void 0 : d.findIndex(
1640
+ (i) => n.deliveryOrder.fullfillmentId && i.id === n.deliveryOrder.fullfillmentId
1642
1641
  )) ?? -1;
1643
1642
  }
1644
- ), w = o.enablePurchaseOrderReceiveWithCustomCost, d = o.enablePortalDeliveryOrderWrite, T = J({}), S = Y(() => n.purchaseOrder.items.map((b, u) => Y({
1643
+ ), x = o.enablePurchaseOrderReceiveWithCustomCost, u = o.enablePortalDeliveryOrderWrite, I = J({}), N = Y(() => n.purchaseOrder.items.map((d, i) => Y({
1645
1644
  get: () => {
1646
- var I;
1647
- const $ = (I = s.received[u]) == null ? void 0 : I.cost;
1648
- return $ ? +he($) : 0;
1645
+ var $;
1646
+ const g = ($ = t.received[i]) == null ? void 0 : $.cost;
1647
+ return g ? +he(g) : 0;
1649
1648
  },
1650
- set: ($) => {
1651
- s.received[u].cost = {
1649
+ set: (g) => {
1650
+ t.received[i].cost = {
1652
1651
  currency: Ce(),
1653
- ...Qe($, 4)
1652
+ ...Qe(g, 4)
1654
1653
  };
1655
1654
  }
1656
- }))), A = Y(() => n.deliveryOrder.received.map((b, u) => Y({
1655
+ }))), w = Y(() => n.deliveryOrder.received.map((d, i) => Y({
1657
1656
  get: () => {
1658
- var I;
1659
- const $ = (I = s.received[u]) == null ? void 0 : I.amount;
1660
- return $ ? +he($) : 0;
1657
+ var $;
1658
+ const g = ($ = t.received[i]) == null ? void 0 : $.amount;
1659
+ return g ? +he(g) : 0;
1661
1660
  },
1662
- set: ($) => {
1663
- s.received[u].amount = Qe($, 2);
1661
+ set: (g) => {
1662
+ t.received[i].amount = Qe(g, 2);
1664
1663
  }
1665
1664
  })));
1666
- function l(b) {
1667
- const u = !T.value[b];
1668
- if (T.value[b] = u, u) {
1669
- const $ = n.deliveryOrder.received[b];
1670
- $.cost ? s.received[b].cost = {
1671
- currency: $.cost.currency,
1672
- amount: $.cost.amount,
1673
- precision: $.cost.precision
1674
- } : s.received[b].cost = {
1665
+ function O(d) {
1666
+ const i = !I.value[d];
1667
+ if (I.value[d] = i, i) {
1668
+ const g = n.deliveryOrder.received[d];
1669
+ g.cost ? t.received[d].cost = {
1670
+ currency: g.cost.currency,
1671
+ amount: g.cost.amount,
1672
+ precision: g.cost.precision
1673
+ } : t.received[d].cost = {
1675
1674
  currency: Ce(),
1676
1675
  amount: 0,
1677
1676
  precision: 4
1678
1677
  };
1679
1678
  } else
1680
- delete s.received[b].cost;
1679
+ delete t.received[d].cost;
1681
1680
  }
1682
- function t() {
1681
+ function r() {
1683
1682
  c.updateDeliveryOrder({
1684
1683
  deliveryOrder: {
1685
1684
  ...n.deliveryOrder,
1686
- ...s
1685
+ ...t
1687
1686
  },
1688
1687
  purchaseOrderId: n.purchaseOrder._id,
1689
1688
  purchaseOrderRev: n.purchaseOrder._rev
@@ -1695,18 +1694,18 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1695
1694
  type: "success"
1696
1695
  },
1697
1696
  1e4
1698
- ), h.value = !1, g("submitted");
1697
+ ), b.value = !1, A("submitted");
1699
1698
  });
1700
1699
  }
1701
- return (b, u) => {
1702
- const $ = H("FmButton"), I = H("FmStepperField"), z = H("FmSwitch"), R = H("FmTextField"), Q = H("FmDialog");
1703
- return i(), re(Q, {
1704
- modelValue: h.value,
1705
- "onUpdate:modelValue": u[1] || (u[1] = (K) => h.value = K),
1700
+ return (d, i) => {
1701
+ const g = H("FmButton"), $ = H("FmStepperField"), K = H("FmSwitch"), R = H("FmTextField"), X = H("FmDialog");
1702
+ return l(), re(X, {
1703
+ modelValue: b.value,
1704
+ "onUpdate:modelValue": i[1] || (i[1] = (j) => b.value = j),
1706
1705
  overlay: !0
1707
1706
  }, {
1708
- "dialog-button": Z(() => [
1709
- v(d) ? (i(), re($, {
1707
+ "dialog-button": ee(() => [
1708
+ v(u) ? (l(), re(g, {
1710
1709
  key: 0,
1711
1710
  variant: "plain",
1712
1711
  label: "Edit",
@@ -1714,56 +1713,56 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1714
1713
  "prepend-icon": "edit"
1715
1714
  })) : U("", !0)
1716
1715
  ]),
1717
- "dialog-header": Z(() => [
1716
+ "dialog-header": ee(() => [
1718
1717
  e("div", null, "Received on " + y(v(He)(n.deliveryOrder.createdAt)), 1)
1719
1718
  ]),
1720
- "dialog-footer": Z(() => [
1721
- D($, {
1719
+ "dialog-footer": ee(() => [
1720
+ D(g, {
1722
1721
  class: "ml-auto",
1723
1722
  label: "Apply changes",
1724
1723
  size: "md",
1725
1724
  variant: "destructive",
1726
- onClick: t
1725
+ onClick: r
1727
1726
  })
1728
1727
  ]),
1729
- default: Z(() => [
1728
+ default: ee(() => [
1730
1729
  e("div", null, [
1731
1730
  e("div", er, [
1732
1731
  e("div", tr, [
1733
- u[2] || (u[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
1732
+ i[2] || (i[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
1734
1733
  e("div", sr, y(n.deliveryOrder.adjustment ? v(He)(new Date(v(Ye)(n.deliveryOrder.adjustment))) : "-"), 1)
1735
1734
  ]),
1736
1735
  e("div", rr, [
1737
- u[4] || (u[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
1738
- (i(!0), _(ue, null, xe(n.deliveryOrder.received, (K, se) => {
1739
- var ge;
1740
- return i(), _("div", { key: se }, [
1736
+ i[4] || (i[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received items", -1)),
1737
+ (l(!0), h(de, null, xe(n.deliveryOrder.received, (j, Q) => {
1738
+ var ve;
1739
+ return l(), h("div", { key: Q }, [
1741
1740
  e("div", or, [
1742
1741
  e("div", nr, [
1743
- e("span", ar, y(K.sku.name), 1),
1744
- e("span", lr, y(K.sku.code), 1)
1742
+ e("span", ar, y(j.sku.name), 1),
1743
+ e("span", lr, y(j.sku.code), 1)
1745
1744
  ]),
1746
1745
  e("div", ir, [
1747
- D(I, {
1746
+ D($, {
1748
1747
  label: "Receive Quantity",
1749
- modelValue: A.value[se].value,
1750
- "onUpdate:modelValue": (de) => A.value[se].value = de,
1748
+ modelValue: w.value[Q].value,
1749
+ "onUpdate:modelValue": (ie) => w.value[Q].value = ie,
1751
1750
  min: 0,
1752
- "append-text": ((ge = K.measurement) == null ? void 0 : ge.abbrev) ?? K.sku.unit.abbrev
1751
+ "append-text": ((ve = j.measurement) == null ? void 0 : ve.abbrev) ?? j.sku.unit.abbrev
1753
1752
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"]),
1754
- e("div", cr, y(`${K.cost ? `${v(Ke)(K.cost)}` : ""}`), 1),
1755
- v(w) ? (i(), _("div", ur, [
1756
- D(z, {
1757
- "model-value": T.value[se],
1758
- "onUpdate:modelValue": (de) => l(se),
1753
+ e("div", cr, y(`${j.cost ? `${v(Ke)(j.cost)}` : ""}`), 1),
1754
+ v(x) ? (l(), h("div", ur, [
1755
+ D(K, {
1756
+ "model-value": I.value[Q],
1757
+ "onUpdate:modelValue": (ie) => O(Q),
1759
1758
  size: "sm"
1760
1759
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
1761
- u[3] || (u[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
1760
+ i[3] || (i[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
1762
1761
  ])) : U("", !0),
1763
- v(w) && T.value[se] ? (i(), re(I, {
1762
+ v(x) && I.value[Q] ? (l(), re($, {
1764
1763
  key: 1,
1765
- modelValue: S.value[se].value,
1766
- "onUpdate:modelValue": (de) => S.value[se].value = de,
1764
+ modelValue: N.value[Q].value,
1765
+ "onUpdate:modelValue": (ie) => N.value[Q].value = ie,
1767
1766
  label: "Total Cost",
1768
1767
  step: 1e-4,
1769
1768
  min: 0,
@@ -1773,28 +1772,28 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1773
1772
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : U("", !0)
1774
1773
  ])
1775
1774
  ]),
1776
- se < n.purchaseOrder.items.length - 1 ? (i(), _("div", dr)) : U("", !0)
1775
+ Q < n.purchaseOrder.items.length - 1 ? (l(), h("div", dr)) : U("", !0)
1777
1776
  ]);
1778
1777
  }), 128))
1779
1778
  ]),
1780
1779
  e("div", mr, [
1781
- u[5] || (u[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
1780
+ i[5] || (i[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
1782
1781
  e("div", pr, [
1783
1782
  D(R, {
1784
- modelValue: v(s).deliveryOrderNumber,
1785
- "onUpdate:modelValue": u[0] || (u[0] = (K) => v(s).deliveryOrderNumber = K),
1783
+ modelValue: v(t).deliveryOrderNumber,
1784
+ "onUpdate:modelValue": i[0] || (i[0] = (j) => v(t).deliveryOrderNumber = j),
1786
1785
  size: "md",
1787
1786
  placeholder: n.deliveryOrder.deliveryOrderNumber
1788
1787
  }, null, 8, ["modelValue", "placeholder"])
1789
1788
  ])
1790
1789
  ]),
1791
1790
  e("div", fr, [
1792
- u[6] || (u[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
1791
+ i[6] || (i[6] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
1793
1792
  e("div", yr, y(n.deliveryOrder.remark || "N/A"), 1)
1794
1793
  ]),
1795
- O.value >= 0 ? (i(), _("div", vr, [
1796
- u[7] || (u[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
1797
- e("div", hr, y(O.value + 1), 1)
1794
+ S.value >= 0 ? (l(), h("div", vr, [
1795
+ i[7] || (i[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Fulfilment's sequence ", -1)),
1796
+ e("div", br, y(S.value + 1), 1)
1798
1797
  ])) : U("", !0)
1799
1798
  ])
1800
1799
  ])
@@ -1827,109 +1826,109 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1827
1826
  emits: ["submitted"],
1828
1827
  setup(C, { emit: a }) {
1829
1828
  var B, q, oe;
1830
- const { t: o } = ut(), f = J(!1), h = ct(), n = C, g = a, s = St("", {
1829
+ const { t: o } = ut(), f = J(!1), b = ct(), n = C, A = a, t = St("", {
1831
1830
  default: {
1832
1831
  deliveryOrderNumber: "",
1833
1832
  remark: "",
1834
1833
  received: n.purchaseOrder.items.map((k) => ({
1835
1834
  sku: k.sku,
1836
- amount: Ie.fromNumber(0),
1835
+ amount: qe.fromNumber(0),
1837
1836
  measurement: k.measurement
1838
1837
  })),
1839
1838
  createdBy: {
1840
- id: ((B = h.sessionUser.value) == null ? void 0 : B.id) || "",
1841
- name: ((q = h.sessionUser.value) == null ? void 0 : q.displayName) || ""
1839
+ id: ((B = b.sessionUser.value) == null ? void 0 : B.id) || "",
1840
+ name: ((q = b.sessionUser.value) == null ? void 0 : q.displayName) || ""
1842
1841
  },
1843
1842
  createdAt: ""
1844
1843
  }
1845
- }), c = je(), O = tt(), w = Ue(), d = ((oe = n.purchaseOrder) == null ? void 0 : oe.supplier.internal) != null, T = d && w.enablePOSTransferRequireFulfillment, S = w.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === te.Enum.RECEIVING || n.purchaseOrder.status === te.Enum.COMPLETE) && (d ? !T : !0), A = w.enablePurchaseOrderReceiveWithCustomCost, l = w.enableBackdateReceive, t = J({}), b = Be(), u = Y({
1844
+ }), c = je(), S = tt(), x = Ue(), u = ((oe = n.purchaseOrder) == null ? void 0 : oe.supplier.internal) != null, I = u && x.enablePOSTransferRequireFulfillment, N = x.enablePortalDeliveryOrderWrite && (n.purchaseOrder.status === se.Enum.RECEIVING || n.purchaseOrder.status === se.Enum.COMPLETE) && (u ? !I : !0), w = x.enablePurchaseOrderReceiveWithCustomCost, O = x.enableBackdateReceive, r = J({}), d = Be(), i = Y({
1846
1845
  get() {
1847
- if (!s.createdAt) return "";
1848
- const k = new Date(s.createdAt), x = k.getFullYear(), N = String(k.getMonth() + 1).padStart(2, "0"), W = String(k.getDate()).padStart(2, "0");
1849
- return `${x}-${N}-${W}`;
1846
+ if (!t.createdAt) return "";
1847
+ const k = new Date(t.createdAt), _ = k.getFullYear(), F = String(k.getMonth() + 1).padStart(2, "0"), W = String(k.getDate()).padStart(2, "0");
1848
+ return `${_}-${F}-${W}`;
1850
1849
  },
1851
1850
  set(k) {
1852
1851
  if (k) {
1853
- const x = s.createdAt ? new Date(s.createdAt) : /* @__PURE__ */ new Date(), [N, W, ie] = k.split("-");
1854
- x.setFullYear(parseInt(N)), x.setMonth(parseInt(W) - 1), x.setDate(parseInt(ie)), s.createdAt = x.toISOString();
1852
+ const _ = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [F, W, ce] = k.split("-");
1853
+ _.setFullYear(parseInt(F)), _.setMonth(parseInt(W) - 1), _.setDate(parseInt(ce)), t.createdAt = _.toISOString();
1855
1854
  }
1856
1855
  }
1857
- }), $ = Y({
1856
+ }), g = Y({
1858
1857
  get() {
1859
- if (!s.createdAt) return "";
1860
- const k = new Date(s.createdAt), x = String(k.getHours()).padStart(2, "0"), N = String(k.getMinutes()).padStart(2, "0");
1861
- return `${x}:${N}`;
1858
+ if (!t.createdAt) return "";
1859
+ const k = new Date(t.createdAt), _ = String(k.getHours()).padStart(2, "0"), F = String(k.getMinutes()).padStart(2, "0");
1860
+ return `${_}:${F}`;
1862
1861
  },
1863
1862
  set(k) {
1864
1863
  if (k) {
1865
- const x = s.createdAt ? new Date(s.createdAt) : /* @__PURE__ */ new Date(), [N, W] = k.split(":");
1866
- x.setHours(parseInt(N)), x.setMinutes(parseInt(W)), s.createdAt = x.toISOString();
1864
+ const _ = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [F, W] = k.split(":");
1865
+ _.setHours(parseInt(F)), _.setMinutes(parseInt(W)), t.createdAt = _.toISOString();
1867
1866
  }
1868
1867
  }
1869
- }), I = Y(() => {
1868
+ }), $ = Y(() => {
1870
1869
  const k = Ye(n.purchaseOrder._id);
1871
1870
  if (!k) return "";
1872
- const x = new Date(k), N = x.getFullYear(), W = String(x.getMonth() + 1).padStart(2, "0"), ie = String(x.getDate()).padStart(2, "0");
1873
- return `${N}-${W}-${ie}`;
1874
- }), z = Y(() => {
1871
+ const _ = new Date(k), F = _.getFullYear(), W = String(_.getMonth() + 1).padStart(2, "0"), ce = String(_.getDate()).padStart(2, "0");
1872
+ return `${F}-${W}-${ce}`;
1873
+ }), K = Y(() => {
1875
1874
  const k = Ye(n.purchaseOrder._id);
1876
1875
  return k ? new Date(k) : null;
1877
1876
  }), R = Y(() => {
1878
- if (!u.value || !$.value || !z.value) return null;
1879
- if (/* @__PURE__ */ new Date(`${u.value}T${$.value}:00`) < z.value) {
1880
- const x = I.value, N = z.value.getHours(), W = z.value.getMinutes(), ie = N >= 12 ? "PM" : "AM", r = N % 12 || 12, m = `${String(r).padStart(2, "0")}:${String(W).padStart(2, "0")} ${ie}`;
1881
- return `Delivery date & time cannot be earlier than order creation (${x} ${m})`;
1877
+ if (!i.value || !g.value || !K.value) return null;
1878
+ if (/* @__PURE__ */ new Date(`${i.value}T${g.value}:00`) < K.value) {
1879
+ const _ = $.value, F = K.value.getHours(), W = K.value.getMinutes(), ce = F >= 12 ? "PM" : "AM", s = F % 12 || 12, m = `${String(s).padStart(2, "0")}:${String(W).padStart(2, "0")} ${ce}`;
1880
+ return `Delivery date & time cannot be earlier than order creation (${_} ${m})`;
1882
1881
  }
1883
1882
  return null;
1884
- }), Q = Y(() => R.value ? !1 : s.received.some((x) => {
1885
- const N = x.amount;
1886
- return N ? +he(N) > 0 : !1;
1883
+ }), X = Y(() => R.value ? !1 : t.received.some((_) => {
1884
+ const F = _.amount;
1885
+ return F ? +he(F) > 0 : !1;
1887
1886
  }));
1888
- function K() {
1889
- s.createdAt = "";
1887
+ function j() {
1888
+ t.createdAt = "";
1890
1889
  }
1891
- const se = Y(() => n.purchaseOrder.items.map((k, x) => Y({
1890
+ const Q = Y(() => n.purchaseOrder.items.map((k, _) => Y({
1892
1891
  get: () => {
1893
1892
  var W;
1894
- const N = (W = s.received[x]) == null ? void 0 : W.amount;
1895
- return N ? +he(N) : 0;
1893
+ const F = (W = t.received[_]) == null ? void 0 : W.amount;
1894
+ return F ? +he(F) : 0;
1896
1895
  },
1897
- set: (N) => {
1898
- s.received[x].amount = Qe(N, 2);
1896
+ set: (F) => {
1897
+ t.received[_].amount = Qe(F, 2);
1899
1898
  }
1900
1899
  })));
1901
- function ge(k) {
1902
- const x = !t.value[k];
1903
- if (t.value[k] = x, x) {
1904
- const N = n.purchaseOrder.items[k];
1905
- N.totalCost ? s.received[k].cost = {
1906
- currency: N.totalCost.currency,
1907
- amount: N.totalCost.amount,
1900
+ function ve(k) {
1901
+ const _ = !r.value[k];
1902
+ if (r.value[k] = _, _) {
1903
+ const F = n.purchaseOrder.items[k];
1904
+ F.totalCost ? t.received[k].cost = {
1905
+ currency: F.totalCost.currency,
1906
+ amount: F.totalCost.amount,
1908
1907
  precision: 4
1909
1908
  // Standardize to 4 decimals
1910
- } : s.received[k].cost = {
1909
+ } : t.received[k].cost = {
1911
1910
  currency: Ce(),
1912
1911
  amount: 0,
1913
1912
  precision: 4
1914
1913
  };
1915
1914
  } else
1916
- delete s.received[k].cost;
1915
+ delete t.received[k].cost;
1917
1916
  }
1918
- const de = Y(() => n.purchaseOrder.items.map((k, x) => Y({
1917
+ const ie = Y(() => n.purchaseOrder.items.map((k, _) => Y({
1919
1918
  get: () => {
1920
1919
  var W;
1921
- const N = (W = s.received[x]) == null ? void 0 : W.cost;
1922
- return N ? +he(N) : 0;
1920
+ const F = (W = t.received[_]) == null ? void 0 : W.cost;
1921
+ return F ? +he(F) : 0;
1923
1922
  },
1924
- set: (N) => {
1925
- s.received[x].cost = {
1923
+ set: (F) => {
1924
+ t.received[_].cost = {
1926
1925
  currency: Ce(),
1927
- ...Qe(N, 4)
1926
+ ...Qe(F, 4)
1928
1927
  };
1929
1928
  }
1930
1929
  })));
1931
- function qe() {
1932
- O.open({
1930
+ function Ae() {
1931
+ S.open({
1933
1932
  title: "Confirm Create Delivery Order",
1934
1933
  message: `Are you sure you want to create delivery order for PO# ${n.purchaseOrder.seqNumber}?`,
1935
1934
  primaryActions: {
@@ -1941,35 +1940,35 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1941
1940
  text: "Cancel",
1942
1941
  close: !0
1943
1942
  }
1944
- }).onPrimary(() => Ve());
1943
+ }).onPrimary(() => Ne());
1945
1944
  }
1946
- function Ve() {
1945
+ function Ne() {
1947
1946
  c.createDeliveryOrder({
1948
- deliveryOrder: s,
1947
+ deliveryOrder: t,
1949
1948
  purchaseOrderId: n.purchaseOrder._id,
1950
1949
  purchaseOrderRev: n.purchaseOrder._rev,
1951
1950
  currency: Ce()
1952
1951
  }).then(() => {
1953
- b.open(
1952
+ d.open(
1954
1953
  {
1955
1954
  title: "Success",
1956
1955
  message: `New delivery order created for PO# ${n.purchaseOrder.seqNumber}`,
1957
1956
  type: "success"
1958
1957
  },
1959
1958
  1e4
1960
- ), f.value = !1, g("submitted");
1959
+ ), f.value = !1, A("submitted");
1961
1960
  });
1962
1961
  }
1963
- return (k, x) => {
1964
- const N = H("FmButton"), W = H("FmDatePicker"), ie = H("FmTimePicker"), r = H("FmIcon"), m = H("FmStepperField"), V = H("FmSwitch"), E = H("FmTextField"), G = H("FmDialog");
1965
- return i(), re(G, {
1962
+ return (k, _) => {
1963
+ const F = H("FmButton"), W = H("FmDatePicker"), ce = H("FmTimePicker"), s = H("FmIcon"), m = H("FmStepperField"), V = H("FmSwitch"), E = H("FmTextField"), G = H("FmDialog");
1964
+ return l(), re(G, {
1966
1965
  modelValue: f.value,
1967
- "onUpdate:modelValue": x[4] || (x[4] = (F) => f.value = F),
1966
+ "onUpdate:modelValue": _[4] || (_[4] = (T) => f.value = T),
1968
1967
  overlay: !0,
1969
1968
  "min-width": 800
1970
1969
  }, {
1971
- "dialog-button": Z(() => [
1972
- v(S) ? (i(), re(N, {
1970
+ "dialog-button": ee(() => [
1971
+ v(N) ? (l(), re(F, {
1973
1972
  key: 0,
1974
1973
  variant: "primary",
1975
1974
  label: "Create",
@@ -1978,57 +1977,57 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
1978
1977
  class: "w-full"
1979
1978
  })) : U("", !0)
1980
1979
  ]),
1981
- "dialog-header": Z(() => [
1980
+ "dialog-header": ee(() => [
1982
1981
  e("div", null, "Order #" + y(n.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
1983
1982
  ]),
1984
- "dialog-footer": Z(() => [
1985
- D(N, {
1983
+ "dialog-footer": ee(() => [
1984
+ D(F, {
1986
1985
  class: "ml-auto",
1987
1986
  label: "Create",
1988
1987
  size: "md",
1989
1988
  variant: "destructive",
1990
- disabled: !Q.value,
1991
- onClick: qe
1989
+ disabled: !X.value,
1990
+ onClick: Ae
1992
1991
  }, null, 8, ["disabled"])
1993
1992
  ]),
1994
- default: Z(() => {
1995
- var F;
1993
+ default: ee(() => {
1994
+ var T;
1996
1995
  return [
1997
1996
  e("div", gr, [
1998
1997
  e("div", _r, [
1999
- x[5] || (x[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
2000
- e("div", Sr, y((F = v(h).sessionUser.value) == null ? void 0 : F.displayName), 1)
1998
+ _[5] || (_[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
1999
+ e("div", Sr, y((T = v(b).sessionUser.value) == null ? void 0 : T.displayName), 1)
2001
2000
  ]),
2002
- v(l) ? (i(), _("div", xr, [
2001
+ v(O) ? (l(), h("div", xr, [
2003
2002
  e("div", Or, [
2004
2003
  e("div", wr, [
2005
- x[6] || (x[6] = ke(" Delivery Date & Time ")),
2006
- !u.value && !$.value ? (i(), _("div", $r, " Leave blank to use current date & time ")) : U("", !0)
2004
+ _[6] || (_[6] = ke(" Delivery Date & Time ")),
2005
+ !i.value && !g.value ? (l(), h("div", $r, " Leave blank to use current date & time ")) : U("", !0)
2007
2006
  ]),
2008
- u.value || $.value ? (i(), re(N, {
2007
+ i.value || g.value ? (l(), re(F, {
2009
2008
  key: 0,
2010
2009
  variant: "tertiary",
2011
2010
  label: "Clear",
2012
2011
  "prepend-icon": "close",
2013
- onClick: K
2012
+ onClick: j
2014
2013
  })) : U("", !0)
2015
2014
  ]),
2016
2015
  e("div", Cr, [
2017
2016
  e("div", Rr, [
2018
2017
  D(W, {
2019
- modelValue: u.value,
2020
- "onUpdate:modelValue": x[0] || (x[0] = (j) => u.value = j)
2018
+ modelValue: i.value,
2019
+ "onUpdate:modelValue": _[0] || (_[0] = (z) => i.value = z)
2021
2020
  }, null, 8, ["modelValue"])
2022
2021
  ]),
2023
2022
  e("div", kr, [
2024
- D(ie, {
2025
- modelValue: $.value,
2026
- "onUpdate:modelValue": x[1] || (x[1] = (j) => $.value = j)
2023
+ D(ce, {
2024
+ modelValue: g.value,
2025
+ "onUpdate:modelValue": _[1] || (_[1] = (z) => g.value = z)
2027
2026
  }, null, 8, ["modelValue"])
2028
2027
  ])
2029
2028
  ]),
2030
- R.value ? (i(), _("div", Dr, [
2031
- D(r, {
2029
+ R.value ? (l(), h("div", Dr, [
2030
+ D(s, {
2032
2031
  name: "error",
2033
2032
  class: "inline-block mr-1",
2034
2033
  size: "sm"
@@ -2037,40 +2036,40 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2037
2036
  ])) : U("", !0)
2038
2037
  ])) : U("", !0),
2039
2038
  e("div", Nr, [
2040
- x[8] || (x[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
2041
- (i(!0), _(ue, null, xe(n.purchaseOrder.items, (j, p) => {
2042
- var X, ae, ne;
2043
- return i(), _("div", { key: p }, [
2039
+ _[8] || (_[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
2040
+ (l(!0), h(de, null, xe(n.purchaseOrder.items, (z, p) => {
2041
+ var Z, ae, ne;
2042
+ return l(), h("div", { key: p }, [
2044
2043
  e("div", Fr, [
2045
2044
  e("div", Tr, [
2046
- e("span", Ir, y(j.sku.name), 1),
2047
- e("span", Pr, y(j.sku.code), 1)
2045
+ e("span", Ir, y(z.sku.name), 1),
2046
+ e("span", Pr, y(z.sku.code), 1)
2048
2047
  ]),
2049
2048
  e("div", qr, [
2050
2049
  D(m, {
2051
2050
  label: "Receive Quantity",
2052
- modelValue: se.value[p].value,
2053
- "onUpdate:modelValue": (P) => se.value[p].value = P,
2054
- "helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(Ie).toFormatString(
2051
+ modelValue: Q.value[p].value,
2052
+ "onUpdate:modelValue": (P) => Q.value[p].value = P,
2053
+ "helper-text": `${v(o)("inventory.transfer.receiveRequest.details.received")} ${v(qe).toFormatString(
2055
2054
  {
2056
- value: (X = k.receivedInfoMap[j.sku._id]) == null ? void 0 : X.received
2055
+ value: (Z = k.receivedInfoMap[z.sku._id]) == null ? void 0 : Z.received
2057
2056
  }
2058
- )} ${((ae = j.measurement) == null ? void 0 : ae.abbrev) ?? j.sku.unit.abbrev}`,
2057
+ )} ${((ae = z.measurement) == null ? void 0 : ae.abbrev) ?? z.sku.unit.abbrev}`,
2059
2058
  min: 0,
2060
- "append-text": ((ne = j.measurement) == null ? void 0 : ne.abbrev) ?? j.sku.unit.abbrev
2059
+ "append-text": ((ne = z.measurement) == null ? void 0 : ne.abbrev) ?? z.sku.unit.abbrev
2061
2060
  }, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
2062
- v(A) ? (i(), _("div", Vr, [
2061
+ v(w) ? (l(), h("div", Vr, [
2063
2062
  D(V, {
2064
- "model-value": t.value[p],
2065
- "onUpdate:modelValue": (P) => ge(p),
2063
+ "model-value": r.value[p],
2064
+ "onUpdate:modelValue": (P) => ve(p),
2066
2065
  size: "sm"
2067
2066
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2068
- x[7] || (x[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
2067
+ _[7] || (_[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
2069
2068
  ])) : U("", !0),
2070
- v(A) && t.value[p] ? (i(), re(m, {
2069
+ v(w) && r.value[p] ? (l(), re(m, {
2071
2070
  key: 1,
2072
- modelValue: de.value[p].value,
2073
- "onUpdate:modelValue": (P) => de.value[p].value = P,
2071
+ modelValue: ie.value[p].value,
2072
+ "onUpdate:modelValue": (P) => ie.value[p].value = P,
2074
2073
  label: "Total Cost",
2075
2074
  step: 1e-4,
2076
2075
  min: 0,
@@ -2080,26 +2079,26 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2080
2079
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : U("", !0)
2081
2080
  ])
2082
2081
  ]),
2083
- p < n.purchaseOrder.items.length - 1 ? (i(), _("div", Er)) : U("", !0)
2082
+ p < n.purchaseOrder.items.length - 1 ? (l(), h("div", Er)) : U("", !0)
2084
2083
  ]);
2085
2084
  }), 128))
2086
2085
  ]),
2087
2086
  e("div", Lr, [
2088
- x[9] || (x[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
2087
+ _[9] || (_[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
2089
2088
  e("div", Mr, [
2090
2089
  D(E, {
2091
- modelValue: v(s).deliveryOrderNumber,
2092
- "onUpdate:modelValue": x[2] || (x[2] = (j) => v(s).deliveryOrderNumber = j),
2090
+ modelValue: v(t).deliveryOrderNumber,
2091
+ "onUpdate:modelValue": _[2] || (_[2] = (z) => v(t).deliveryOrderNumber = z),
2093
2092
  size: "md"
2094
2093
  }, null, 8, ["modelValue"])
2095
2094
  ])
2096
2095
  ]),
2097
2096
  e("div", Ur, [
2098
- x[10] || (x[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
2097
+ _[10] || (_[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
2099
2098
  e("div", Br, [
2100
2099
  D(E, {
2101
- modelValue: v(s).remark,
2102
- "onUpdate:modelValue": x[3] || (x[3] = (j) => v(s).remark = j),
2100
+ modelValue: v(t).remark,
2101
+ "onUpdate:modelValue": _[3] || (_[3] = (z) => v(t).remark = z),
2103
2102
  size: "md"
2104
2103
  }, null, 8, ["modelValue"])
2105
2104
  ])
@@ -2126,21 +2125,21 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2126
2125
  netsuiteId: {}
2127
2126
  },
2128
2127
  setup(C) {
2129
- const a = C, o = dt(), f = J(!1), h = J(!1), n = J(!1), g = J([]);
2130
- async function s() {
2131
- if (!(g.value.length > 0))
2128
+ const a = C, o = dt(), f = J(!1), b = J(!1), n = J(!1), A = J([]);
2129
+ async function t() {
2130
+ if (!(A.value.length > 0))
2132
2131
  try {
2133
- h.value = !0;
2134
- const w = await o.getChangeLogs(a.netsuiteId);
2135
- g.value = w, n.value = !1;
2132
+ b.value = !0;
2133
+ const x = await o.getChangeLogs(a.netsuiteId);
2134
+ A.value = x, n.value = !1;
2136
2135
  } catch {
2137
2136
  n.value = !0;
2138
2137
  } finally {
2139
- h.value = !1;
2138
+ b.value = !1;
2140
2139
  }
2141
2140
  }
2142
- function c(w) {
2143
- switch (w) {
2141
+ function c(x) {
2142
+ switch (x) {
2144
2143
  case we.Create:
2145
2144
  return "text-green-600 bg-green-100";
2146
2145
  case we.Set:
@@ -2153,8 +2152,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2153
2152
  return "text-gray-600 bg-gray-100";
2154
2153
  }
2155
2154
  }
2156
- function O(w) {
2157
- return new Date(w).toLocaleDateString("en-US", {
2155
+ function S(x) {
2156
+ return new Date(x).toLocaleDateString("en-US", {
2158
2157
  year: "numeric",
2159
2158
  month: "short",
2160
2159
  day: "numeric",
@@ -2162,46 +2161,46 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2162
2161
  minute: "2-digit"
2163
2162
  });
2164
2163
  }
2165
- return (w, d) => {
2166
- const T = H("FmButton"), S = H("FmCircularProgress"), A = H("FmIcon"), l = H("FmDialog");
2167
- return i(), _("div", zr, [
2168
- D(l, {
2164
+ return (x, u) => {
2165
+ const I = H("FmButton"), N = H("FmCircularProgress"), w = H("FmIcon"), O = H("FmDialog");
2166
+ return l(), h("div", zr, [
2167
+ D(O, {
2169
2168
  modelValue: f.value,
2170
- "onUpdate:modelValue": d[2] || (d[2] = (t) => f.value = t),
2169
+ "onUpdate:modelValue": u[2] || (u[2] = (r) => f.value = r),
2171
2170
  overlay: !0,
2172
2171
  "max-width": 800
2173
2172
  }, {
2174
- "dialog-button": Z(() => [
2175
- D(T, {
2173
+ "dialog-button": ee(() => [
2174
+ D(I, {
2176
2175
  "prepend-icon": "info",
2177
2176
  variant: "secondary",
2178
2177
  label: "NetSuite",
2179
- onClick: d[0] || (d[0] = (t) => s()),
2178
+ onClick: u[0] || (u[0] = (r) => t()),
2180
2179
  "text-color": "primary",
2181
2180
  "bg-color": "transparent",
2182
2181
  "border-color": "primary"
2183
2182
  })
2184
2183
  ]),
2185
- "dialog-header": Z(() => d[3] || (d[3] = [
2184
+ "dialog-header": ee(() => u[3] || (u[3] = [
2186
2185
  e("div", null, "NetSuite info", -1)
2187
2186
  ])),
2188
- default: Z(() => [
2189
- h.value ? (i(), _("div", Kr, [
2190
- d[4] || (d[4] = e("span", null, "Change Log Loading...", -1)),
2191
- D(S, { size: "md" })
2187
+ default: ee(() => [
2188
+ b.value ? (l(), h("div", Kr, [
2189
+ u[4] || (u[4] = e("span", null, "Change Log Loading...", -1)),
2190
+ D(N, { size: "md" })
2192
2191
  ])) : U("", !0),
2193
- !h.value && g.value.length > 0 ? (i(), _("div", Gr, [
2192
+ !b.value && A.value.length > 0 ? (l(), h("div", Gr, [
2194
2193
  e("h3", Hr, [
2195
- D(A, {
2194
+ D(w, {
2196
2195
  name: "error",
2197
2196
  color: "#ff9500",
2198
2197
  size: "sm"
2199
2198
  }),
2200
- d[5] || (d[5] = ke(" Change Logs "))
2199
+ u[5] || (u[5] = ke(" Change Logs "))
2201
2200
  ]),
2202
2201
  e("div", Wr, [
2203
2202
  e("table", Yr, [
2204
- d[6] || (d[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
2203
+ u[6] || (u[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
2205
2204
  e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
2206
2205
  e("th", {
2207
2206
  class: "text-left p-3 fm-typo-en-body-md-600",
@@ -2218,36 +2217,36 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2218
2217
  ])
2219
2218
  ], -1)),
2220
2219
  e("tbody", null, [
2221
- (i(!0), _(ue, null, xe(g.value, (t, b) => (i(), _("tr", {
2222
- key: b,
2220
+ (l(!0), h(de, null, xe(A.value, (r, d) => (l(), h("tr", {
2221
+ key: d,
2223
2222
  class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
2224
2223
  }, [
2225
- e("td", Qr, y(O(t._dateiso8601)), 1),
2226
- e("td", Jr, y(t._rolename), 1),
2227
- e("td", Xr, y(t._employeename), 1),
2228
- e("td", Zr, y(t._contextname), 1),
2224
+ e("td", Qr, y(S(r._dateiso8601)), 1),
2225
+ e("td", Jr, y(r._rolename), 1),
2226
+ e("td", Xr, y(r._employeename), 1),
2227
+ e("td", Zr, y(r._contextname), 1),
2229
2228
  e("td", {
2230
- class: Me(`p-3 fm-typo-en-body-sm-600 ${c(Number(t.type) - 1)}`)
2231
- }, y(v(we)[Number(t.type) - 1]), 3),
2232
- e("td", eo, y(t.lineid || ""), 1),
2233
- e("td", to, y(t._fieldname), 1),
2234
- e("td", so, y(t.oldvalue || ""), 1),
2235
- e("td", ro, y(t.newvalue || ""), 1)
2229
+ class: Me(`p-3 fm-typo-en-body-sm-600 ${c(Number(r.type) - 1)}`)
2230
+ }, y(v(we)[Number(r.type) - 1]), 3),
2231
+ e("td", eo, y(r.lineid || ""), 1),
2232
+ e("td", to, y(r._fieldname), 1),
2233
+ e("td", so, y(r.oldvalue || ""), 1),
2234
+ e("td", ro, y(r.newvalue || ""), 1)
2236
2235
  ]))), 128))
2237
2236
  ])
2238
2237
  ])
2239
2238
  ])
2240
- ])) : (i(), _("div", oo, d[7] || (d[7] = [
2239
+ ])) : (l(), h("div", oo, u[7] || (u[7] = [
2241
2240
  e("p", null, "No change logs available.", -1)
2242
2241
  ])))
2243
2242
  ]),
2244
- "dialog-footer": Z(() => [
2245
- D(T, {
2243
+ "dialog-footer": ee(() => [
2244
+ D(I, {
2246
2245
  class: "ml-auto sm:w-full xs:w-full",
2247
2246
  label: "Close",
2248
2247
  size: "md",
2249
2248
  variant: "primary",
2250
- onClick: d[1] || (d[1] = (t) => f.value = !1)
2249
+ onClick: u[1] || (u[1] = (r) => f.value = !1)
2251
2250
  })
2252
2251
  ]),
2253
2252
  _: 1
@@ -2258,7 +2257,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2258
2257
  }), ao = { class: "flex flex-col w-full gap-3" }, lo = { class: "flex" }, io = { class: "fm-typo-en-title-md-600 text-fm-color-typo-primary" }, co = { class: "flex flex-col gap-16 w-full h-full" }, uo = { class: "flex justify-between" }, mo = { class: "fm-typo-en-body-lg-600" }, po = { class: "flex gap-2" }, fo = {
2259
2258
  key: 0,
2260
2259
  class: "flex items-center gap-1"
2261
- }, yo = { class: "fm-typo-en-body-md-400" }, vo = { class: "flex flex-col gap-8" }, ho = { class: "flex flex-col gap-4" }, bo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, go = { class: "flex gap-1" }, _o = { class: "fm-typo-en-body-lg-600" }, So = {
2260
+ }, yo = { class: "fm-typo-en-body-md-400" }, vo = { class: "flex flex-col gap-8" }, bo = { class: "flex flex-col gap-4" }, ho = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, go = { class: "flex gap-1" }, _o = { class: "fm-typo-en-body-lg-600" }, So = {
2262
2261
  key: 0,
2263
2262
  class: "flex flex-col gap-4"
2264
2263
  }, xo = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Oo = { class: "fm-typo-en-body-lg-600" }, wo = { class: "flex flex-col gap-4" }, $o = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Co = { class: "fm-typo-en-body-lg-600" }, Ro = {
@@ -2291,7 +2290,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2291
2290
  }, un = { class: "flex-1 flex flex-col items-center" }, dn = { class: "h-40 w-40 bg-fm-color-primary rounded-full flex items-center justify-center" }, mn = { class: "flex-1 flex flex-col items-center" }, pn = { class: "flex w-full items-center gap-4" }, fn = {
2292
2291
  class: "py-12 flex flex-col gap-4",
2293
2292
  name: "received-at header"
2294
- }, yn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, hn = { class: "ml-auto flex gap-1" }, bn = { class: "flex gap-12 content-stretch" }, gn = {
2293
+ }, yn = { class: "fm-typo-en-body-lg-400" }, vn = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, bn = { class: "ml-auto flex gap-1" }, hn = { class: "flex gap-12 content-stretch" }, gn = {
2295
2294
  class: "flex flex-col w-40",
2296
2295
  name: "circles"
2297
2296
  }, _n = { class: "flex-1 flex flex-col items-center" }, Sn = {
@@ -2313,86 +2312,86 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2313
2312
  },
2314
2313
  emits: ["update:show", "submitted"],
2315
2314
  setup(C, { emit: a }) {
2316
- const o = C, f = a, h = tt(), n = Be(), g = Ue(), s = De(), c = ct(), O = Y(
2315
+ const o = C, f = a, b = tt(), n = Be(), A = Ue(), t = De(), c = ct(), S = Y(
2317
2316
  () => {
2318
- var r, m;
2317
+ var s, m;
2319
2318
  return {
2320
- id: ((r = c.sessionUser.value) == null ? void 0 : r.id) ?? "",
2319
+ id: ((s = c.sessionUser.value) == null ? void 0 : s.id) ?? "",
2321
2320
  name: ((m = c.sessionUser.value) == null ? void 0 : m.displayName) ?? ""
2322
2321
  };
2323
2322
  }
2324
- ), w = rs(), { t: d } = ut(), T = Y(
2323
+ ), x = wt(), { t: u } = ut(), I = Y(
2325
2324
  () => {
2326
- var r, m, V, E;
2327
- return ((m = (r = o.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : m.internal) === "restaurant" || ((E = (V = o.purchaseOrder) == null ? void 0 : V.supplier) == null ? void 0 : E.internal) === "warehouse" ? Ge.enum.transfer : Ge.enum.purchase;
2325
+ var s, m, V, E;
2326
+ return ((m = (s = o.purchaseOrder) == null ? void 0 : s.supplier) == null ? void 0 : m.internal) === "restaurant" || ((E = (V = o.purchaseOrder) == null ? void 0 : V.supplier) == null ? void 0 : E.internal) === "warehouse" ? Ge.enum.transfer : Ge.enum.purchase;
2328
2327
  }
2329
- ), S = Y(() => {
2328
+ ), N = Y(() => {
2330
2329
  var V;
2331
- const r = (V = o.shipments) == null ? void 0 : V.find((E) => {
2330
+ const s = (V = o.shipments) == null ? void 0 : V.find((E) => {
2332
2331
  var G;
2333
2332
  return E.ref === ((G = o.purchaseOrder) == null ? void 0 : G._id);
2334
2333
  });
2335
2334
  let m = null;
2336
- if (r != null && r.milestones && r.milestones.length > 0) {
2337
- const E = r.milestones[r.milestones.length - 1];
2335
+ if (s != null && s.milestones && s.milestones.length > 0) {
2336
+ const E = s.milestones[s.milestones.length - 1];
2338
2337
  if (E.estimatedTime) {
2339
- const G = new Date(E.estimatedTime), F = G.getDate().toString().padStart(2, "0");
2340
- m = `${G.toLocaleString("en-US", { month: "short" })} ${F}`;
2338
+ const G = new Date(E.estimatedTime), T = G.getDate().toString().padStart(2, "0");
2339
+ m = `${G.toLocaleString("en-US", { month: "short" })} ${T}`;
2341
2340
  }
2342
2341
  }
2343
2342
  return m;
2344
- }), A = J(!1), l = J(""), t = J(!0), b = je(), u = Kt(b.getWorkflowConfig), $ = Ot(), I = [
2343
+ }), w = J(!1), O = J(""), r = J(!0), d = je(), i = Gt(d.getWorkflowConfig), g = Ot(), $ = [
2345
2344
  M.enum.receiveStock,
2346
2345
  M.enum.processRequest,
2347
2346
  M.enum.closeRequest
2348
- ], z = Y(() => {
2347
+ ], K = Y(() => {
2349
2348
  if (!o.purchaseOrder)
2350
2349
  return [];
2351
- const r = u.result.value;
2352
- if (r.state === pt.loading)
2350
+ const s = i.result.value;
2351
+ if (s.state === pt.loading)
2353
2352
  return [];
2354
2353
  const m = {
2355
- user: O.value,
2356
- executedAt: s.locations.computeFirst(
2357
- (F) => {
2358
- var j;
2359
- return F.dbName === ((j = s._currentLocation) == null ? void 0 : j.dbName) ? F : null;
2354
+ user: S.value,
2355
+ executedAt: t.locations.computeFirst(
2356
+ (T) => {
2357
+ var z;
2358
+ return T.dbName === ((z = t._currentLocation) == null ? void 0 : z.dbName) ? T : null;
2360
2359
  }
2361
2360
  ),
2362
2361
  purchaseOrderRequest: o.poRequest,
2363
2362
  purchaseOrder: o.purchaseOrder
2364
- }, E = g.useOperatePurchaseOrderV2 ? [...I, M.enum.completeReceive] : I;
2363
+ }, E = A.useOperatePurchaseOrderV2 ? [...$, M.enum.completeReceive] : $;
2365
2364
  let G = [];
2366
2365
  try {
2367
- r.state === pt.error ? (console.error("Error fetching workflow config:", r.error), G = st.getAvailableActions({
2366
+ s.state === pt.error ? (console.error("Error fetching workflow config:", s.error), G = st.getAvailableActions({
2368
2367
  ...m,
2369
2368
  orderConfig: st.getDefaultConfig()
2370
- }).actions.filter((F) => !E.includes(F))) : G = st.getAvailableActions({
2369
+ }).actions.filter((T) => !E.includes(T))) : G = st.getAvailableActions({
2371
2370
  ...m,
2372
- orderConfig: r.data
2373
- }).actions.filter((F) => !E.includes(F));
2374
- } catch (F) {
2375
- console.error("Error getting available actions:", F);
2371
+ orderConfig: s.data
2372
+ }).actions.filter((T) => !E.includes(T));
2373
+ } catch (T) {
2374
+ console.error("Error getting available actions:", T);
2376
2375
  }
2377
- return o.scope === "approval" && (G = G.filter((F) => F !== M.enum.completeReceive)), G;
2378
- }), R = qt(o, "show"), Q = Y(() => [
2376
+ return o.scope === "approval" && (G = G.filter((T) => T !== M.enum.completeReceive)), G;
2377
+ }), R = Vt(o, "show"), X = Y(() => [
2379
2378
  {
2380
- label: d("inventory.transfer.receiveRequest.details.overview"),
2379
+ label: u("inventory.transfer.receiveRequest.details.overview"),
2381
2380
  value: "overview"
2382
2381
  },
2383
2382
  {
2384
- label: d("inventory.transfer.receiveRequest.details.deliveryHistory"),
2383
+ label: u("inventory.transfer.receiveRequest.details.deliveryHistory"),
2385
2384
  value: "deliveryHistory"
2386
2385
  }
2387
- ]), K = J(Q.value[0]);
2388
- Rt(
2386
+ ]), j = J(X.value[0]);
2387
+ kt(
2389
2388
  () => o.show,
2390
- (r) => {
2391
- r && (K.value = Q.value[0]);
2389
+ (s) => {
2390
+ s && (j.value = X.value[0]);
2392
2391
  }
2393
2392
  );
2394
- function se(r) {
2395
- return r.map((m) => ({
2393
+ function Q(s) {
2394
+ return s.map((m) => ({
2396
2395
  ...m,
2397
2396
  amount: {
2398
2397
  ...m.amount,
@@ -2400,16 +2399,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2400
2399
  }
2401
2400
  }));
2402
2401
  }
2403
- async function ge(r, m, V, E, G) {
2404
- return new Promise((F, j) => {
2405
- h.open({
2402
+ async function ve(s, m, V, E, G) {
2403
+ return new Promise((T, z) => {
2404
+ b.open({
2406
2405
  closeButton: !1,
2407
2406
  title: E.title,
2408
2407
  message: E.message,
2409
2408
  primaryActions: E.primaryActions,
2410
2409
  secondaryActions: { text: "No", close: !1 }
2411
2410
  }).onPrimary(async () => {
2412
- var X, ae, ne, P;
2411
+ var Z, ae, ne, P;
2413
2412
  const p = [];
2414
2413
  V === M.enum.approveRequest ? (p.push({
2415
2414
  action: "approveRequest",
@@ -2420,8 +2419,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2420
2419
  fulfillmentId: "",
2421
2420
  deliveryOrderNumber: "",
2422
2421
  deliveryRemark: null,
2423
- items: se(m.fulfillment.items),
2424
- createdBy: O.value
2422
+ items: Q(m.fulfillment.items),
2423
+ createdBy: S.value
2425
2424
  }
2426
2425
  })) : V === M.enum.processRequest ? m.fulfillment && p.push({
2427
2426
  action: "processRequest",
@@ -2429,8 +2428,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2429
2428
  fulfillmentId: "",
2430
2429
  deliveryOrderNumber: "",
2431
2430
  deliveryRemark: null,
2432
- items: se(m.fulfillment.items),
2433
- createdBy: O.value
2431
+ items: Q(m.fulfillment.items),
2432
+ createdBy: S.value
2434
2433
  }
2435
2434
  }) : V === M.enum.rejectRequest ? p.push({
2436
2435
  action: "rejectRequest",
@@ -2440,78 +2439,78 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2440
2439
  payload: null
2441
2440
  });
2442
2441
  try {
2443
- await $({
2442
+ await g({
2444
2443
  operate: {
2445
2444
  operation: V,
2446
- doc: r,
2445
+ doc: s,
2447
2446
  options: m
2448
2447
  },
2449
2448
  operateV2: {
2450
- _id: ((X = o.purchaseOrder) == null ? void 0 : X._id) ?? "",
2449
+ _id: ((Z = o.purchaseOrder) == null ? void 0 : Z._id) ?? "",
2451
2450
  _rev: ((ae = o.purchaseOrder) == null ? void 0 : ae._rev) ?? "",
2452
2451
  action: V,
2453
2452
  payloads: p
2454
2453
  // add payload if action is receiveStock or processRequest
2455
2454
  },
2456
2455
  transferTo: (P = (ne = o.poRequest) == null ? void 0 : ne.to) == null ? void 0 : P.dbName
2457
- }).delayed(1e3), F("submitted");
2456
+ }).delayed(1e3), T("submitted");
2458
2457
  } catch (me) {
2459
- j(me);
2458
+ z(me);
2460
2459
  }
2461
2460
  }).onSecondary(() => {
2462
- F("cancelled");
2461
+ T("cancelled");
2463
2462
  for (let p = 0; p < G + 2; p++)
2464
- h.close();
2463
+ b.close();
2465
2464
  }).onClose(() => {
2466
2465
  });
2467
2466
  });
2468
2467
  }
2469
- async function de(r) {
2470
- var G, F, j, p;
2471
- if (r === M.enum.receiveStock)
2468
+ async function ie(s) {
2469
+ var G, T, z, p;
2470
+ if (s === M.enum.receiveStock)
2472
2471
  return;
2473
- const m = xt[r];
2472
+ const m = xt[s];
2474
2473
  if (!m) {
2475
2474
  n.open({
2476
2475
  title: "Something went wrong",
2477
- message: `Cannot process order: ${it(r)}`,
2476
+ message: `Cannot process order: ${it(s)}`,
2478
2477
  type: "error"
2479
2478
  });
2480
2479
  return;
2481
2480
  }
2482
2481
  const { successMessage: V, ...E } = m;
2483
2482
  if (o.purchaseOrder) {
2484
- l.value = `${r}`, A.value = !0, t.value = !1;
2485
- const X = {};
2483
+ O.value = `${s}`, w.value = !0, r.value = !1;
2484
+ const Z = {};
2486
2485
  let ae = 0;
2487
- if ((r === M.enum.confirmDraft || // auto receive for warehouse to warehouse
2488
- r === M.enum.completeReceive) && g.autoReceiveWarehouse)
2489
- X.autoReceive = !0;
2490
- else if ((r === M.enum.approveRequest || r === M.enum.processRequest) && g.acceptRequireFulfillment) {
2491
- const ne = (F = (G = o.poRequest) == null ? void 0 : G.from) == null ? void 0 : F.dbName, P = (p = (j = o.poRequest) == null ? void 0 : j.to) == null ? void 0 : p.dbName;
2486
+ if ((s === M.enum.confirmDraft || // auto receive for warehouse to warehouse
2487
+ s === M.enum.completeReceive) && A.autoReceiveWarehouse)
2488
+ Z.autoReceive = !0;
2489
+ else if ((s === M.enum.approveRequest || s === M.enum.processRequest) && A.acceptRequireFulfillment) {
2490
+ const ne = (T = (G = o.poRequest) == null ? void 0 : G.from) == null ? void 0 : T.dbName, P = (p = (z = o.poRequest) == null ? void 0 : z.to) == null ? void 0 : p.dbName;
2492
2491
  if (ne && P && (ne.startsWith("warehouse_") || P.startsWith("warehouse_"))) {
2493
- const me = await new Promise((Oe, Ae) => {
2494
- h.open({
2492
+ const me = await new Promise((Oe, Fe) => {
2493
+ b.open({
2495
2494
  closeButton: !1,
2496
2495
  title: "Confirm transfer amount",
2497
- dialogComponent: ss,
2496
+ dialogComponent: rs,
2498
2497
  dialogComponentProps: {
2499
2498
  purchaseOrder: o.purchaseOrder,
2500
2499
  confirm: Oe,
2501
- "onUpdate:show": (Ne) => {
2502
- Ne || (l.value = "", A.value = !1, t.value = !0, ae++, h.close()), Ae("cancelled");
2500
+ "onUpdate:show": (Te) => {
2501
+ Te || (O.value = "", w.value = !1, r.value = !0, ae++, b.close()), Fe("cancelled");
2503
2502
  }
2504
2503
  }
2505
2504
  });
2506
2505
  });
2507
- X.fulfillment = me;
2506
+ Z.fulfillment = me;
2508
2507
  }
2509
2508
  }
2510
2509
  try {
2511
- await ge(
2510
+ await ve(
2512
2511
  o.purchaseOrder,
2513
- X,
2514
- r,
2512
+ Z,
2513
+ s,
2515
2514
  m,
2516
2515
  ae
2517
2516
  ) === "submitted" && (n.open({
@@ -2524,28 +2523,28 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2524
2523
  title: "Something went wrong",
2525
2524
  message: "Please try again.",
2526
2525
  type: "error"
2527
- }), console.error("Error when submitting PO operation", r, o.purchaseOrder, ne);
2526
+ }), console.error("Error when submitting PO operation", s, o.purchaseOrder, ne);
2528
2527
  } finally {
2529
- l.value = "", A.value = !1, t.value = !0;
2528
+ O.value = "", w.value = !1, r.value = !0;
2530
2529
  }
2531
2530
  }
2532
2531
  }
2533
- const qe = Y(() => {
2534
- var r, m;
2535
- return ((r = o.purchaseOrder) == null ? void 0 : r.status) === te.enum.RECEIVING || ((m = o.purchaseOrder) == null ? void 0 : m.status) === te.enum.COMPLETE;
2536
- }), Ve = Y(() => o.purchaseOrder ? Xe(o.purchaseOrder) : {}), B = Y(() => {
2537
- const r = o.purchaseOrder;
2538
- if (!r) return { status: "", statusClass: "" };
2539
- const { partial: m, over: V } = nt(Ve.value), E = at(r.status, m, V);
2540
- let G = d(`inventory.transfer.status.${E}`), F = `${r.status}`.toLocaleLowerCase("en-us");
2541
- return E === te.enum.CLOSE && (G = `${d(`inventory.transfer.status.${te.enum.COMPLETE}`)}`), E === "PARTIAL_RECEIVED" && F === te.enum.PROCESSING.toLocaleLowerCase("en-us") && (F = te.enum.RECEIVING.toLocaleLowerCase("en-us")), {
2532
+ const Ae = Y(() => {
2533
+ var s, m;
2534
+ return ((s = o.purchaseOrder) == null ? void 0 : s.status) === se.enum.RECEIVING || ((m = o.purchaseOrder) == null ? void 0 : m.status) === se.enum.COMPLETE;
2535
+ }), Ne = Y(() => o.purchaseOrder ? Xe(o.purchaseOrder) : {}), B = Y(() => {
2536
+ const s = o.purchaseOrder;
2537
+ if (!s) return { status: "", statusClass: "" };
2538
+ const { partial: m, over: V } = nt(Ne.value), E = at(s.status, m, V);
2539
+ let G = u(`inventory.transfer.status.${E}`), T = `${s.status}`.toLocaleLowerCase("en-us");
2540
+ return E === se.enum.CLOSE && (G = `${u(`inventory.transfer.status.${se.enum.COMPLETE}`)}`), E === "PARTIAL_RECEIVED" && T === se.enum.PROCESSING.toLocaleLowerCase("en-us") && (T = se.enum.RECEIVING.toLocaleLowerCase("en-us")), {
2542
2541
  status: G,
2543
- statusClass: `fm-status-badge fm-status-badge-${F}`
2542
+ statusClass: `fm-status-badge fm-status-badge-${T}`
2544
2543
  };
2545
2544
  }), q = Y(() => {
2546
- var F, j;
2547
- const r = ((F = o.purchaseOrder) == null ? void 0 : F.deliveryOrder) ?? [], m = ((j = o.purchaseOrder) == null ? void 0 : j.deliveryFullfillment) ?? [], V = [
2548
- ...r.map((p) => ({
2545
+ var T, z;
2546
+ const s = ((T = o.purchaseOrder) == null ? void 0 : T.deliveryOrder) ?? [], m = ((z = o.purchaseOrder) == null ? void 0 : z.deliveryFullfillment) ?? [], V = [
2547
+ ...s.map((p) => ({
2549
2548
  createdAt: p.createdAt,
2550
2549
  type: "grn",
2551
2550
  doc: p
@@ -2556,23 +2555,23 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2556
2555
  doc: p
2557
2556
  }))
2558
2557
  ];
2559
- V.reverse().sort((p, X) => p.createdAt.localeCompare(X.createdAt));
2558
+ V.reverse().sort((p, Z) => p.createdAt.localeCompare(Z.createdAt));
2560
2559
  function E(p) {
2561
- var ne, P, me, Oe, Ae, Ne, ee, le, pe, ve, _e, Re;
2562
- const X = m.findIndex((ce) => ce.id === p.fullfillmentId), ae = [
2563
- (P = (ne = m[X]) == null ? void 0 : ne.netSuite) != null && P.id ? {
2560
+ var ne, P, me, Oe, Fe, Te, te, le, pe, be, _e, Re;
2561
+ const Z = m.findIndex((ue) => ue.id === p.fullfillmentId), ae = [
2562
+ (P = (ne = m[Z]) == null ? void 0 : ne.netSuite) != null && P.id ? {
2564
2563
  label: "Fulfillment's ref no. (Netsuite)",
2565
2564
  values: [
2566
- `${((Oe = (me = m[X]) == null ? void 0 : me.netSuite) == null ? void 0 : Oe.refNo) ?? "N/A"} (${((Ne = (Ae = m[X]) == null ? void 0 : Ae.netSuite) == null ? void 0 : Ne.id) ?? "-"})`
2565
+ `${((Oe = (me = m[Z]) == null ? void 0 : me.netSuite) == null ? void 0 : Oe.refNo) ?? "N/A"} (${((Te = (Fe = m[Z]) == null ? void 0 : Fe.netSuite) == null ? void 0 : Te.id) ?? "-"})`
2567
2566
  ]
2568
2567
  } : null,
2569
- (ee = p == null ? void 0 : p.netSuite) != null && ee.id ? {
2568
+ (te = p == null ? void 0 : p.netSuite) != null && te.id ? {
2570
2569
  label: "Netsuite ref no.",
2571
2570
  values: [`${((le = p == null ? void 0 : p.netSuite) == null ? void 0 : le.refNo) ?? "N/A"} (${((pe = p == null ? void 0 : p.netSuite) == null ? void 0 : pe.id) ?? "-"})`]
2572
2571
  } : null,
2573
- (ve = p == null ? void 0 : p.netSuite) != null && ve.recordType ? {
2572
+ (be = p == null ? void 0 : p.netSuite) != null && be.recordType ? {
2574
2573
  label: "Netsuite Type",
2575
- values: [ht((_e = p == null ? void 0 : p.netSuite) == null ? void 0 : _e.recordType)]
2574
+ values: [bt((_e = p == null ? void 0 : p.netSuite) == null ? void 0 : _e.recordType)]
2576
2575
  } : null
2577
2576
  ];
2578
2577
  return {
@@ -2592,7 +2591,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2592
2591
  },
2593
2592
  {
2594
2593
  label: "Received items",
2595
- values: p.received.map((ce) => {
2594
+ values: p.received.map((ue) => {
2596
2595
  var fe;
2597
2596
  return L("div", [
2598
2597
  L(
@@ -2612,14 +2611,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2612
2611
  {
2613
2612
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
2614
2613
  },
2615
- `${ce.sku.name}`
2614
+ `${ue.sku.name}`
2616
2615
  ),
2617
2616
  L(
2618
2617
  "span",
2619
2618
  {
2620
2619
  class: "fm-typo-en-body-md-400"
2621
2620
  },
2622
- `${ce.sku.code} `
2621
+ `${ue.sku.code} `
2623
2622
  )
2624
2623
  ]
2625
2624
  ),
@@ -2640,14 +2639,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2640
2639
  {
2641
2640
  class: "fm-typo-en-body-lg-600 self-end"
2642
2641
  },
2643
- he(ce.amount, !1)
2642
+ he(ue.amount, !1)
2644
2643
  ),
2645
2644
  L(
2646
2645
  "span",
2647
2646
  {
2648
2647
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
2649
2648
  },
2650
- ((fe = ce.measurement) == null ? void 0 : fe.abbrev) ?? ce.sku.unit.abbrev
2649
+ ((fe = ue.measurement) == null ? void 0 : fe.abbrev) ?? ue.sku.unit.abbrev
2651
2650
  )
2652
2651
  ]
2653
2652
  ),
@@ -2656,7 +2655,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2656
2655
  {
2657
2656
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
2658
2657
  },
2659
- `${ce.cost ? `(${Ke(ce.cost)})` : ""}`
2658
+ `${ue.cost ? `(${Ke(ue.cost)})` : ""}`
2660
2659
  )
2661
2660
  ]
2662
2661
  )
@@ -2673,24 +2672,24 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2673
2672
  label: "Remark",
2674
2673
  values: [p.remark || "N/A"]
2675
2674
  },
2676
- X > -1 ? {
2675
+ Z > -1 ? {
2677
2676
  label: "Fulfilment's sequence",
2678
- values: [`${X + 1}`]
2677
+ values: [`${Z + 1}`]
2679
2678
  } : null,
2680
2679
  ...ae
2681
- ].filter((ce) => !!ce)
2680
+ ].filter((ue) => !!ue)
2682
2681
  };
2683
2682
  }
2684
2683
  function G(p) {
2685
2684
  var ae, ne;
2686
- const X = m.findIndex((P) => P.id === p.id);
2685
+ const Z = m.findIndex((P) => P.id === p.id);
2687
2686
  return {
2688
2687
  header: "Fulfillment",
2689
2688
  date: He(new Date(p.createdAt)),
2690
2689
  info: [
2691
2690
  {
2692
2691
  label: "Sequence",
2693
- values: [String(X + 1)]
2692
+ values: [String(Z + 1)]
2694
2693
  },
2695
2694
  {
2696
2695
  label: "Receiveable items",
@@ -2784,70 +2783,70 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2784
2783
  });
2785
2784
  }), oe = Y(() => {
2786
2785
  var m;
2787
- const r = {
2786
+ const s = {
2788
2787
  ...gt(0),
2789
2788
  currency: Ce()
2790
2789
  };
2791
2790
  return ((m = o.purchaseOrder) == null ? void 0 : m.items.reduce((V, E) => ({
2792
- ...bt(V, E.totalCost ?? r),
2791
+ ...ht(V, E.totalCost ?? s),
2793
2792
  currency: Ce()
2794
- }), r)) ?? r;
2793
+ }), s)) ?? s;
2795
2794
  });
2796
- function k(r) {
2797
- var F;
2798
- const V = (((F = o.purchaseOrder) == null ? void 0 : F.version) ?? Te.enum[1]) === Te.enum[2] ? r.id : r.sku._id, E = o.receivedMap[V];
2799
- return `<span class="${x(r)} fm-typo-en-body-lg-600">${Ie.toFormatString({ value: E.received })}</span>/${Mt(r.quantity, r.sku.unit, r.measurement)}`;
2795
+ function k(s) {
2796
+ var T;
2797
+ const V = (((T = o.purchaseOrder) == null ? void 0 : T.version) ?? Pe.enum[1]) === Pe.enum[2] ? s.id : s.sku._id, E = o.receivedMap[V];
2798
+ return `<span class="${_(s)} fm-typo-en-body-lg-600">${qe.toFormatString({ value: E.received })}</span>/${Ut(s.quantity, s.sku.unit, s.measurement)}`;
2800
2799
  }
2801
- function x(r) {
2802
- var X;
2803
- const V = (((X = o.purchaseOrder) == null ? void 0 : X.version) ?? Te.enum[1]) === Te.enum[2] ? r.id : r.sku._id, E = o.receivedMap[V], { isPartialReceive: G, isNoReceive: F, isOverReceive: j, isFullReceive: p } = Qt(E);
2804
- return F ? "text-fm-color-typo-tertiary" : G ? "text-fm-color-system-warning-300" : j ? "text-fm-color-system-error-300" : p ? "text-fm-color-system-success-300" : "";
2800
+ function _(s) {
2801
+ var Z;
2802
+ const V = (((Z = o.purchaseOrder) == null ? void 0 : Z.version) ?? Pe.enum[1]) === Pe.enum[2] ? s.id : s.sku._id, E = o.receivedMap[V], { isPartialReceive: G, isNoReceive: T, isOverReceive: z, isFullReceive: p } = Jt(E);
2803
+ return T ? "text-fm-color-typo-tertiary" : G ? "text-fm-color-system-warning-300" : z ? "text-fm-color-system-error-300" : p ? "text-fm-color-system-success-300" : "";
2805
2804
  }
2806
- const N = Y(() => {
2807
- var r, m, V;
2808
- return (r = o.purchaseOrder) != null && r.itemsAtSubmission ? ((m = o.purchaseOrder) == null ? void 0 : m.version) === Te.enum[2] ? o.purchaseOrder.items.reduce((E, G) => {
2809
- var j, p;
2810
- const F = (p = (j = o.purchaseOrder) == null ? void 0 : j.itemsAtSubmission) == null ? void 0 : p.find(
2811
- (X) => X.id === G.id
2805
+ const F = Y(() => {
2806
+ var s, m, V;
2807
+ return (s = o.purchaseOrder) != null && s.itemsAtSubmission ? ((m = o.purchaseOrder) == null ? void 0 : m.version) === Pe.enum[2] ? o.purchaseOrder.items.reduce((E, G) => {
2808
+ var z, p;
2809
+ const T = (p = (z = o.purchaseOrder) == null ? void 0 : z.itemsAtSubmission) == null ? void 0 : p.find(
2810
+ (Z) => Z.id === G.id
2812
2811
  );
2813
- return F && F.quantity !== G.quantity && E.set(G.sku.code, {
2814
- originalAmount: Number(Ie.toFormatString({ value: F.quantity })),
2815
- newAmount: Number(Ie.toFormatString({ value: G.quantity }))
2812
+ return T && T.quantity !== G.quantity && E.set(G.sku.code, {
2813
+ originalAmount: Number(qe.toFormatString({ value: T.quantity })),
2814
+ newAmount: Number(qe.toFormatString({ value: G.quantity }))
2816
2815
  }), E;
2817
2816
  }, /* @__PURE__ */ new Map()) : (V = o.purchaseOrder) == null ? void 0 : V.items.reduce((E, G) => {
2818
- var X, ae;
2819
- const F = (ae = (X = o.purchaseOrder) == null ? void 0 : X.itemsAtSubmission) == null ? void 0 : ae.find(
2817
+ var Z, ae;
2818
+ const T = (ae = (Z = o.purchaseOrder) == null ? void 0 : Z.itemsAtSubmission) == null ? void 0 : ae.find(
2820
2819
  (ne) => ne.sku._id === G.sku._id
2821
- ), j = F ? Number(Ie.toFormatString({ value: F.quantity })) : 0, p = Number(Ie.toFormatString({ value: G.quantity }));
2822
- return F && j !== p && E.set(G.sku.code, {
2823
- originalAmount: j,
2820
+ ), z = T ? Number(qe.toFormatString({ value: T.quantity })) : 0, p = Number(qe.toFormatString({ value: G.quantity }));
2821
+ return T && z !== p && E.set(G.sku.code, {
2822
+ originalAmount: z,
2824
2823
  newAmount: p
2825
2824
  }), E;
2826
2825
  }, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
2827
- }), W = (r) => {
2826
+ }), W = (s) => {
2828
2827
  var V, E;
2829
- const m = N.value;
2830
- return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Te.enum[2] ? m.has(r.id) : m.has((E = r.sku) == null ? void 0 : E.code);
2831
- }, ie = (r) => {
2828
+ const m = F.value;
2829
+ return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Pe.enum[2] ? m.has(s.id) : m.has((E = s.sku) == null ? void 0 : E.code);
2830
+ }, ce = (s) => {
2832
2831
  var V, E;
2833
- const m = N.value;
2834
- return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Te.enum[2] ? m.get(r.id) : m.get((E = r.sku) == null ? void 0 : E.code);
2832
+ const m = F.value;
2833
+ return ((V = o.purchaseOrder) == null ? void 0 : V.version) === Pe.enum[2] ? m.get(s.id) : m.get((E = s.sku) == null ? void 0 : E.code);
2835
2834
  };
2836
- return (r, m) => {
2837
- const V = H("FmButton"), E = H("FmButtonGroup"), G = H("FmChip"), F = H("FmIcon"), j = H("FmMenuDivider"), p = H("FmCard"), X = H("FmTooltip"), ae = H("FmSpacer"), ne = H("FmSideSheet");
2838
- return i(), re(ne, {
2835
+ return (s, m) => {
2836
+ const V = H("FmButton"), E = H("FmButtonGroup"), G = H("FmChip"), T = H("FmIcon"), z = H("FmMenuDivider"), p = H("FmCard"), Z = H("FmTooltip"), ae = H("FmSpacer"), ne = H("FmSideSheet");
2837
+ return l(), re(ne, {
2839
2838
  modelValue: v(R),
2840
- "onUpdate:modelValue": m[8] || (m[8] = (P) => kt(R) ? R.value = P : null),
2841
- "dismiss-away": t.value,
2839
+ "onUpdate:modelValue": m[8] || (m[8] = (P) => Dt(R) ? R.value = P : null),
2840
+ "dismiss-away": r.value,
2842
2841
  "max-width": 600,
2843
2842
  "close-button": !1
2844
2843
  }, {
2845
- "side-sheet-header": Z(() => {
2844
+ "side-sheet-header": ee(() => {
2846
2845
  var P, me;
2847
2846
  return [
2848
2847
  e("div", ao, [
2849
2848
  e("div", lo, [
2850
- e("div", io, y(v(d)("inventory.transfer.receiveRequest.details.title") + ((P = r.purchaseOrder) != null && P.seqNumber ? ` #${(me = r.purchaseOrder) == null ? void 0 : me.seqNumber}` : "")), 1),
2849
+ e("div", io, y(v(u)("inventory.transfer.receiveRequest.details.title") + ((P = s.purchaseOrder) != null && P.seqNumber ? ` #${(me = s.purchaseOrder) == null ? void 0 : me.seqNumber}` : "")), 1),
2851
2850
  D(V, {
2852
2851
  class: "ml-auto -m-2",
2853
2852
  variant: "tertiary",
@@ -2856,14 +2855,14 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2856
2855
  })
2857
2856
  ]),
2858
2857
  D(E, {
2859
- items: Q.value,
2860
- modelValue: K.value,
2861
- "onUpdate:modelValue": m[1] || (m[1] = (Oe) => K.value = Oe)
2858
+ items: X.value,
2859
+ modelValue: j.value,
2860
+ "onUpdate:modelValue": m[1] || (m[1] = (Oe) => j.value = Oe)
2862
2861
  }, null, 8, ["items", "modelValue"]),
2863
- r.purchaseOrder && K.value.value === "deliveryHistory" ? (i(), re(jr, {
2862
+ s.purchaseOrder && j.value.value === "deliveryHistory" ? (l(), re(jr, {
2864
2863
  key: 0,
2865
- "purchase-order": r.purchaseOrder,
2866
- "received-info-map": Ve.value,
2864
+ "purchase-order": s.purchaseOrder,
2865
+ "received-info-map": Ne.value,
2867
2866
  onSubmitted: m[2] || (m[2] = () => {
2868
2867
  f("update:show", !1), f("submitted");
2869
2868
  })
@@ -2871,24 +2870,24 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2871
2870
  ])
2872
2871
  ];
2873
2872
  }),
2874
- default: Z(() => {
2875
- var P, me, Oe, Ae, Ne;
2873
+ default: ee(() => {
2874
+ var P, me, Oe, Fe, Te;
2876
2875
  return [
2877
2876
  e("div", co, [
2878
- K.value.value === "overview" ? (i(), _(ue, { key: 0 }, [
2877
+ j.value.value === "overview" ? (l(), h(de, { key: 0 }, [
2879
2878
  e("div", null, [
2880
2879
  D(p, {
2881
2880
  variant: "outlined",
2882
2881
  class: "flex flex-col gap-8 px-12 py-16"
2883
2882
  }, {
2884
- default: Z(() => {
2885
- var ee, le, pe, ve, _e, Re, ce, fe, Fe;
2883
+ default: ee(() => {
2884
+ var te, le, pe, be, _e, Re, ue, fe, Ie;
2886
2885
  return [
2887
2886
  e("div", uo, [
2888
- e("div", mo, y(v(d)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
2887
+ e("div", mo, y(v(u)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
2889
2888
  e("div", po, [
2890
- D(Pe, null, {
2891
- default: Z(() => {
2889
+ D(Ve, null, {
2890
+ default: ee(() => {
2892
2891
  var Ee;
2893
2892
  return [
2894
2893
  ke(y((Ee = o.purchaseOrder) == null ? void 0 : Ee.status), 1)
@@ -2901,48 +2900,48 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2901
2900
  class: Me(B.value.statusClass),
2902
2901
  compact: ""
2903
2902
  }, null, 8, ["label", "class"]),
2904
- S.value ? (i(), _("div", fo, [
2905
- D(F, {
2903
+ N.value ? (l(), h("div", fo, [
2904
+ D(T, {
2906
2905
  name: "local_shipping",
2907
2906
  color: "#666666"
2908
2907
  }),
2909
- e("span", yo, y(S.value), 1)
2908
+ e("span", yo, y(N.value), 1)
2910
2909
  ])) : U("", !0)
2911
2910
  ])
2912
2911
  ]),
2913
- D(j),
2912
+ D(z),
2914
2913
  e("div", vo, [
2915
- e("div", ho, [
2916
- e("div", bo, [
2917
- e("div", go, y(v(d)("inventory.transfer.receiveRequest.details.createdAt")), 1)
2914
+ e("div", bo, [
2915
+ e("div", ho, [
2916
+ e("div", go, y(v(u)("inventory.transfer.receiveRequest.details.createdAt")), 1)
2918
2917
  ]),
2919
- e("div", _o, y(v(We)(((ee = r.purchaseOrder) == null ? void 0 : ee._id) ?? "")), 1)
2918
+ e("div", _o, y(v(We)(((te = s.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
2920
2919
  ]),
2921
- (le = r.purchaseOrder) != null && le.effectiveAt ? (i(), _("div", So, [
2922
- e("div", xo, y(v(d)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
2923
- e("div", Oo, y(v(_t)(new Date((pe = r.purchaseOrder) == null ? void 0 : pe.effectiveAt))), 1)
2920
+ (le = s.purchaseOrder) != null && le.effectiveAt ? (l(), h("div", So, [
2921
+ e("div", xo, y(v(u)("inventory.transfer.receiveRequest.details.backdatedTo")), 1),
2922
+ e("div", Oo, y(v(_t)(new Date((pe = s.purchaseOrder) == null ? void 0 : pe.effectiveAt))), 1)
2924
2923
  ])) : U("", !0),
2925
2924
  e("div", wo, [
2926
- e("div", $o, y(v(d)("inventory.transfer.receiveRequest.details.type.title")), 1),
2927
- e("div", Co, y(v(d)(
2928
- `inventory.transfer.receiveRequest.details.type.${T.value.toLocaleLowerCase("en-US")}`
2925
+ e("div", $o, y(v(u)("inventory.transfer.receiveRequest.details.type.title")), 1),
2926
+ e("div", Co, y(v(u)(
2927
+ `inventory.transfer.receiveRequest.details.type.${I.value.toLocaleLowerCase("en-US")}`
2929
2928
  )), 1)
2930
2929
  ]),
2931
- (_e = (ve = r.purchaseOrder) == null ? void 0 : ve.supplier) != null && _e.name ? (i(), _("div", Ro, [
2932
- e("div", ko, y(v(d)("inventory.transfer.receiveRequest.details.from")), 1),
2933
- e("div", Do, y((ce = (Re = r.purchaseOrder) == null ? void 0 : Re.supplier) == null ? void 0 : ce.name), 1)
2930
+ (_e = (be = s.purchaseOrder) == null ? void 0 : be.supplier) != null && _e.name ? (l(), h("div", Ro, [
2931
+ e("div", ko, y(v(u)("inventory.transfer.receiveRequest.details.from")), 1),
2932
+ e("div", Do, y((ue = (Re = s.purchaseOrder) == null ? void 0 : Re.supplier) == null ? void 0 : ue.name), 1)
2934
2933
  ])) : U("", !0),
2935
- r.transferTo ? (i(), _("div", Ao, [
2936
- e("div", No, y(v(d)("inventory.transfer.receiveRequest.details.to")), 1),
2937
- e("div", Fo, y(r.transferTo), 1)
2934
+ s.transferTo ? (l(), h("div", Ao, [
2935
+ e("div", No, y(v(u)("inventory.transfer.receiveRequest.details.to")), 1),
2936
+ e("div", Fo, y(s.transferTo), 1)
2938
2937
  ])) : U("", !0),
2939
- (fe = r.purchaseOrder) != null && fe.ref ? (i(), _("div", To, [
2940
- e("div", Io, y(v(d)("inventory.transfer.receiveRequest.details.reference")), 1),
2941
- e("div", Po, y(r.purchaseOrder.ref), 1)
2938
+ (fe = s.purchaseOrder) != null && fe.ref ? (l(), h("div", To, [
2939
+ e("div", Io, y(v(u)("inventory.transfer.receiveRequest.details.reference")), 1),
2940
+ e("div", Po, y(s.purchaseOrder.ref), 1)
2942
2941
  ])) : U("", !0),
2943
- (Fe = r.purchaseOrder) != null && Fe.remark ? (i(), _("div", qo, [
2944
- e("div", Vo, y(v(d)("inventory.transfer.receiveRequest.details.remark")), 1),
2945
- e("div", Eo, y(r.purchaseOrder.remark), 1)
2942
+ (Ie = s.purchaseOrder) != null && Ie.remark ? (l(), h("div", qo, [
2943
+ e("div", Vo, y(v(u)("inventory.transfer.receiveRequest.details.remark")), 1),
2944
+ e("div", Eo, y(s.purchaseOrder.remark), 1)
2946
2945
  ])) : U("", !0)
2947
2946
  ])
2948
2947
  ];
@@ -2951,32 +2950,32 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2951
2950
  })
2952
2951
  ]),
2953
2952
  D(Zs, {
2954
- "po-request": r.poRequest,
2955
- purchaseOrder: r.purchaseOrder,
2956
- transferType: T.value,
2957
- transferToDbName: r.transferToDbName,
2958
- scope: r.scope
2953
+ "po-request": s.poRequest,
2954
+ purchaseOrder: s.purchaseOrder,
2955
+ transferType: I.value,
2956
+ transferToDbName: s.transferToDbName,
2957
+ scope: s.scope
2959
2958
  }, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
2960
2959
  e("div", Lo, [
2961
2960
  e("div", Mo, [
2962
2961
  e("div", Uo, [
2963
2962
  e("span", Bo, [
2964
- ke(y(qe.value ? v(d)("inventory.transfer.receiveRequest.details.receivedItems") : v(d)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2965
- (me = (P = r.purchaseOrder) == null ? void 0 : P.netSuite) != null && me.missingItems && ((Ae = (Oe = r.purchaseOrder) == null ? void 0 : Oe.netSuite) == null ? void 0 : Ae.missingItems.length) > 0 ? (i(), re(X, {
2963
+ ke(y(Ae.value ? v(u)("inventory.transfer.receiveRequest.details.receivedItems") : v(u)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
2964
+ (me = (P = s.purchaseOrder) == null ? void 0 : P.netSuite) != null && me.missingItems && ((Fe = (Oe = s.purchaseOrder) == null ? void 0 : Oe.netSuite) == null ? void 0 : Fe.missingItems.length) > 0 ? (l(), re(Z, {
2966
2965
  key: 0,
2967
2966
  variant: "rich",
2968
2967
  placement: "top",
2969
2968
  "z-index": 51
2970
2969
  }, {
2971
- content: Z(() => {
2972
- var ee, le;
2970
+ content: ee(() => {
2971
+ var te, le;
2973
2972
  return [
2974
2973
  e("div", jo, [
2975
- (i(!0), _(ue, null, xe((le = (ee = r.purchaseOrder) == null ? void 0 : ee.netSuite) == null ? void 0 : le.missingItems, (pe, ve) => (i(), _("div", {
2974
+ (l(!0), h(de, null, xe((le = (te = s.purchaseOrder) == null ? void 0 : te.netSuite) == null ? void 0 : le.missingItems, (pe, be) => (l(), h("div", {
2976
2975
  class: "flex justify-center align-middle",
2977
- key: ve
2976
+ key: be
2978
2977
  }, [
2979
- D(F, {
2978
+ D(T, {
2980
2979
  name: "arrow_right",
2981
2980
  size: "sm"
2982
2981
  }),
@@ -2985,8 +2984,8 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2985
2984
  ])
2986
2985
  ];
2987
2986
  }),
2988
- default: Z(() => [
2989
- D(F, {
2987
+ default: ee(() => [
2988
+ D(T, {
2990
2989
  name: "error",
2991
2990
  color: "#ff2c2c",
2992
2991
  size: "sm"
@@ -2996,34 +2995,34 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
2996
2995
  })) : U("", !0)
2997
2996
  ])
2998
2997
  ]),
2999
- D(j),
3000
- (i(!0), _(ue, null, xe(((Ne = r.purchaseOrder) == null ? void 0 : Ne.items) ?? [], (ee, le) => {
2998
+ D(z),
2999
+ (l(!0), h(de, null, xe(((Te = s.purchaseOrder) == null ? void 0 : Te.items) ?? [], (te, le) => {
3001
3000
  var pe;
3002
- return i(), _("div", {
3001
+ return l(), h("div", {
3003
3002
  key: le,
3004
3003
  class: "flex flex-col"
3005
3004
  }, [
3006
3005
  e("div", zo, [
3007
3006
  e("div", Ko, [
3008
- ke(y(ee.name) + " ", 1),
3009
- W(ee) ? (i(), re(X, {
3007
+ ke(y(te.name) + " ", 1),
3008
+ W(te) ? (l(), re(Z, {
3010
3009
  key: 0,
3011
3010
  variant: "rich",
3012
3011
  placement: "top",
3013
3012
  "z-index": 51
3014
3013
  }, {
3015
- content: Z(() => {
3016
- var ve, _e;
3014
+ content: ee(() => {
3015
+ var be, _e;
3017
3016
  return [
3018
3017
  e("div", Go, [
3019
3018
  m[9] || (m[9] = e("div", { class: "font-semibold" }, "Submission changes", -1)),
3020
- e("div", null, "Original Amount: " + y((ve = ie(ee)) == null ? void 0 : ve.originalAmount), 1),
3021
- e("div", null, " New Amount: " + y((_e = ie(ee)) == null ? void 0 : _e.newAmount), 1)
3019
+ e("div", null, "Original Amount: " + y((be = ce(te)) == null ? void 0 : be.originalAmount), 1),
3020
+ e("div", null, " New Amount: " + y((_e = ce(te)) == null ? void 0 : _e.newAmount), 1)
3022
3021
  ])
3023
3022
  ];
3024
3023
  }),
3025
- default: Z(() => [
3026
- D(F, {
3024
+ default: ee(() => [
3025
+ D(T, {
3027
3026
  name: "error",
3028
3027
  color: "#ff9500",
3029
3028
  size: "sm"
@@ -3034,19 +3033,19 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3034
3033
  ]),
3035
3034
  e("div", Ho, [
3036
3035
  e("span", {
3037
- innerHTML: k(ee)
3036
+ innerHTML: k(te)
3038
3037
  }, null, 8, Wo)
3039
3038
  ])
3040
3039
  ]),
3041
3040
  e("div", Yo, [
3042
- e("div", Qo, y(ee.code), 1),
3043
- (pe = ee.totalCost) != null && pe.amount && v(g).enableTotalCost ? (i(), _("div", Jo, " (" + y(v(Ke)(ee.totalCost)) + ") ", 1)) : U("", !0)
3041
+ e("div", Qo, y(te.code), 1),
3042
+ (pe = te.totalCost) != null && pe.amount && v(A).enableTotalCost ? (l(), h("div", Jo, " (" + y(v(Ke)(te.totalCost)) + ") ", 1)) : U("", !0)
3044
3043
  ])
3045
3044
  ]);
3046
3045
  }), 128)),
3047
- +v(he)(oe.value) ? (i(), _(ue, { key: 0 }, [
3046
+ +v(he)(oe.value) ? (l(), h(de, { key: 0 }, [
3048
3047
  e("div", Xo, [
3049
- D(j)
3048
+ D(z)
3050
3049
  ]),
3051
3050
  e("div", Zo, [
3052
3051
  m[10] || (m[10] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
@@ -3055,11 +3054,11 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3055
3054
  ], 64)) : U("", !0)
3056
3055
  ])
3057
3056
  ])
3058
- ], 64)) : K.value.value === "deliveryHistory" ? (i(), _("div", tn, [
3059
- q.value.length ? (i(), _("div", an, [
3060
- (i(!0), _(ue, null, xe(q.value, (ee, le) => {
3061
- var pe, ve, _e, Re, ce;
3062
- return i(), _(ue, { key: le }, [
3057
+ ], 64)) : j.value.value === "deliveryHistory" ? (l(), h("div", tn, [
3058
+ q.value.length ? (l(), h("div", an, [
3059
+ (l(!0), h(de, null, xe(q.value, (te, le) => {
3060
+ var pe, be, _e, Re, ue;
3061
+ return l(), h(de, { key: le }, [
3063
3062
  e("div", ln, [
3064
3063
  e("div", cn, [
3065
3064
  e("div", un, [
@@ -3074,7 +3073,7 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3074
3073
  }, null, 2)
3075
3074
  ]),
3076
3075
  e("div", dn, [
3077
- ee.header === "Received" ? (i(), re(F, {
3076
+ te.header === "Received" ? (l(), re(T, {
3078
3077
  key: 0,
3079
3078
  name: "local_shipping",
3080
3079
  outline: "",
@@ -3095,38 +3094,38 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3095
3094
  ]),
3096
3095
  e("div", pn, [
3097
3096
  e("div", fn, [
3098
- e("div", yn, y(ee.header), 1),
3099
- e("div", vn, y(ee.date), 1)
3097
+ e("div", yn, y(te.header), 1),
3098
+ e("div", vn, y(te.date), 1)
3100
3099
  ]),
3101
- e("div", hn, [
3102
- ee.header === "Received" && ee.deliveryOrder && r.purchaseOrder ? (i(), re(br, {
3100
+ e("div", bn, [
3101
+ te.header === "Received" && te.deliveryOrder && s.purchaseOrder ? (l(), re(hr, {
3103
3102
  key: 0,
3104
- deliveryOrder: ee.deliveryOrder,
3105
- purchaseOrder: r.purchaseOrder,
3103
+ deliveryOrder: te.deliveryOrder,
3104
+ purchaseOrder: s.purchaseOrder,
3106
3105
  onSubmitted: m[3] || (m[3] = () => {
3107
3106
  f("update:show", !1), f("submitted");
3108
3107
  })
3109
3108
  }, null, 8, ["deliveryOrder", "purchaseOrder"])) : U("", !0),
3110
- (ve = (pe = ee.deliveryOrder) == null ? void 0 : pe.netSuite) != null && ve.id ? (i(), re(Pe, { key: 1 }, {
3111
- default: Z(() => {
3112
- var fe, Fe;
3109
+ (be = (pe = te.deliveryOrder) == null ? void 0 : pe.netSuite) != null && be.id ? (l(), re(Ve, { key: 1 }, {
3110
+ default: ee(() => {
3111
+ var fe, Ie;
3113
3112
  return [
3114
3113
  D(no, {
3115
- "netsuite-id": (Fe = (fe = ee.deliveryOrder) == null ? void 0 : fe.netSuite) == null ? void 0 : Fe.id
3114
+ "netsuite-id": (Ie = (fe = te.deliveryOrder) == null ? void 0 : fe.netSuite) == null ? void 0 : Ie.id
3116
3115
  }, null, 8, ["netsuite-id"])
3117
3116
  ];
3118
3117
  }),
3119
3118
  _: 2
3120
3119
  }, 1024)) : U("", !0),
3121
- r.purchaseOrder && ((_e = ee.deliveryOrder) != null && _e.id) ? (i(), re(Ut, {
3120
+ s.purchaseOrder && ((_e = te.deliveryOrder) != null && _e.id) ? (l(), re(Bt, {
3122
3121
  key: 2,
3123
- "purchase-order-id": (Re = r.purchaseOrder) == null ? void 0 : Re._id,
3124
- "delivery-order-id": (ce = ee.deliveryOrder) == null ? void 0 : ce.id
3122
+ "purchase-order-id": (Re = s.purchaseOrder) == null ? void 0 : Re._id,
3123
+ "delivery-order-id": (ue = te.deliveryOrder) == null ? void 0 : ue.id
3125
3124
  }, null, 8, ["purchase-order-id", "delivery-order-id"])) : U("", !0)
3126
3125
  ])
3127
3126
  ])
3128
3127
  ]),
3129
- e("div", bn, [
3128
+ e("div", hn, [
3130
3129
  e("div", gn, [
3131
3130
  e("div", _n, [
3132
3131
  e("div", {
@@ -3145,21 +3144,21 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3145
3144
  variant: "outlined",
3146
3145
  class: "py-12 px-16"
3147
3146
  }, {
3148
- default: Z(() => [
3147
+ default: ee(() => [
3149
3148
  e("div", xn, [
3150
- (i(!0), _(ue, null, xe(ee.info, (fe, Fe) => (i(), _("div", {
3151
- key: Fe,
3149
+ (l(!0), h(de, null, xe(te.info, (fe, Ie) => (l(), h("div", {
3150
+ key: Ie,
3152
3151
  class: "flex flex-col gap-4"
3153
3152
  }, [
3154
3153
  e("div", On, y(fe == null ? void 0 : fe.label), 1),
3155
3154
  e("div", wn, [
3156
- (i(!0), _(ue, null, xe(fe == null ? void 0 : fe.values, (Ee, wt) => (i(), _("div", {
3157
- key: wt,
3155
+ (l(!0), h(de, null, xe(fe == null ? void 0 : fe.values, (Ee, $t) => (l(), h("div", {
3156
+ key: $t,
3158
3157
  class: "fm-typo-en-body-lg-600"
3159
3158
  }, [
3160
- typeof Ee == "string" ? (i(), _(ue, { key: 0 }, [
3159
+ typeof Ee == "string" ? (l(), h(de, { key: 0 }, [
3161
3160
  ke(y(Ee), 1)
3162
- ], 64)) : (i(), re(Dt(Ee), { key: 1 }))
3161
+ ], 64)) : (l(), re(At(Ee), { key: 1 }))
3163
3162
  ]))), 128))
3164
3163
  ])
3165
3164
  ]))), 128))
@@ -3171,16 +3170,16 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3171
3170
  ])
3172
3171
  ], 64);
3173
3172
  }), 128))
3174
- ])) : (i(), _("div", sn, [
3173
+ ])) : (l(), h("div", sn, [
3175
3174
  D(ae),
3176
3175
  e("div", null, [
3177
3176
  e("img", {
3178
- src: v(Vt),
3177
+ src: v(Et),
3179
3178
  alt: "List is empty"
3180
3179
  }, null, 8, rn)
3181
3180
  ]),
3182
- e("div", on, y(v(d)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
3183
- e("div", nn, y(v(d)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
3181
+ e("div", on, y(v(u)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
3182
+ e("div", nn, y(v(u)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
3184
3183
  D(ae),
3185
3184
  D(ae)
3186
3185
  ]))
@@ -3188,41 +3187,41 @@ const os = { class: "flex flex-row-reverse" }, ns = /* @__PURE__ */ $e({
3188
3187
  ])
3189
3188
  ];
3190
3189
  }),
3191
- "side-sheet-footer": Z(() => [
3190
+ "side-sheet-footer": ee(() => [
3192
3191
  e("div", $n, [
3193
- (i(!0), _(ue, null, xe(z.value, (P) => (i(), _(ue, null, [
3194
- v(ot)[P].available != !1 ? (i(), re(V, {
3192
+ (l(!0), h(de, null, xe(K.value, (P) => (l(), h(de, null, [
3193
+ v(ot)[P].available != !1 ? (l(), re(V, {
3195
3194
  key: P,
3196
- label: v(d)(v(ot)[P].translationKey),
3197
- onClick: (me) => de(P),
3198
- loading: l.value === P,
3199
- disabled: l.value !== P && A.value,
3195
+ label: v(u)(v(ot)[P].translationKey),
3196
+ onClick: (me) => ie(P),
3197
+ loading: O.value === P,
3198
+ disabled: O.value !== P && w.value,
3200
3199
  variant: v(ot)[P].buttonVariant
3201
3200
  }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : U("", !0)
3202
3201
  ], 64))), 256)),
3203
- v(w).ableToMarkReceived(r.purchaseOrder) && !z.value.includes("completeReceive") ? (i(), re(V, {
3202
+ v(x).ableToMarkReceived(s.purchaseOrder) && !K.value.includes("completeReceive") ? (l(), re(V, {
3204
3203
  key: 0,
3205
- label: v(d)("inventory.transfer.receiveRequest.actions.completeReceive"),
3206
- onClick: m[4] || (m[4] = (P) => de("completeReceive")),
3207
- loading: l.value === "completeReceive",
3208
- disabled: l.value !== "completeReceive" && A.value
3204
+ label: v(u)("inventory.transfer.receiveRequest.actions.completeReceive"),
3205
+ onClick: m[4] || (m[4] = (P) => ie("completeReceive")),
3206
+ loading: O.value === "completeReceive",
3207
+ disabled: O.value !== "completeReceive" && w.value
3209
3208
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
3210
- v(w).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !z.value.includes("approveRequest") ? (i(), re(V, {
3209
+ v(x).ableToMarkApproved(s.purchaseOrder) && s.canApprove && !K.value.includes("approveRequest") ? (l(), re(V, {
3211
3210
  key: 1,
3212
- label: v(d)("inventory.transfer.approval.actions.approveRequest"),
3213
- onClick: m[5] || (m[5] = (P) => de("approveRequest")),
3214
- loading: l.value === "approveRequest",
3215
- disabled: l.value !== "approveRequest" && A.value
3211
+ label: v(u)("inventory.transfer.approval.actions.approveRequest"),
3212
+ onClick: m[5] || (m[5] = (P) => ie("approveRequest")),
3213
+ loading: O.value === "approveRequest",
3214
+ disabled: O.value !== "approveRequest" && w.value
3216
3215
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
3217
- v(w).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && o.scope === "approval" ? (i(), re(V, {
3216
+ v(x).ableToCreateFulfillment(s.purchaseOrder, s.poRequest) && o.scope === "approval" ? (l(), re(V, {
3218
3217
  key: 2,
3219
- label: v(d)("inventory.transfer.receiveRequest.actions.processRequest"),
3220
- onClick: m[6] || (m[6] = (P) => de("processRequest")),
3221
- loading: l.value === "processRequest",
3222
- disabled: l.value !== "processRequest" && A.value
3218
+ label: v(u)("inventory.transfer.receiveRequest.actions.processRequest"),
3219
+ onClick: m[6] || (m[6] = (P) => ie("processRequest")),
3220
+ loading: O.value === "processRequest",
3221
+ disabled: O.value !== "processRequest" && w.value
3223
3222
  }, null, 8, ["label", "loading", "disabled"])) : U("", !0),
3224
3223
  D(V, {
3225
- label: v(d)("common.close"),
3224
+ label: v(u)("common.close"),
3226
3225
  variant: "tertiary",
3227
3226
  onClick: m[7] || (m[7] = (P) => f("update:show", !1))
3228
3227
  }, null, 8, ["label"])
@@ -3237,6 +3236,6 @@ export {
3237
3236
  lt as P,
3238
3237
  Jn as _,
3239
3238
  Qn as a,
3240
- Jt as g,
3239
+ Xt as g,
3241
3240
  Yn as u
3242
3241
  };