@feedmepos/mf-inventory-portal 1.6.2 → 1.7.0-dev.0

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 (101) hide show
  1. package/dist/{App-C61RakQ7.js → App-DaAOxELy.js} +4 -4
  2. package/dist/{ApprovalView-Cc1iYZqD.js → ApprovalView-CxJ79rW7.js} +8 -8
  3. package/dist/{BindingsDialog-Chd2EdfO.js → BindingsDialog-CZhCQoLO.js} +2 -2
  4. package/dist/{BindingsPicker-CXXnZKq5.js → BindingsPicker-BWRMxgYR.js} +2 -2
  5. package/dist/{BindingsTable-C5migJtC.js → BindingsTable-fvBa1dHb.js} +3 -3
  6. package/dist/{BulkReceiveRequestView-9MSE2YVv.js → BulkReceiveRequestView-Bq7_r-qY.js} +19 -19
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CKM48Ktp.js +126 -0
  8. package/dist/{ClosingDraftView-C4XBYgez.js → ClosingDraftView-DdMr571D.js} +204 -203
  9. package/dist/{ClosingHistoryView-C_OtcjwH.js → ClosingHistoryView-BIpPvvzQ.js} +5 -5
  10. package/dist/{ClosingTemplateView-BZpuwhWe.js → ClosingTemplateView-IlV4hRZ7.js} +14 -14
  11. package/dist/{DefaultView-Dnub2r0C.js → DefaultView-TKUUG9_5.js} +2 -2
  12. package/dist/{DeliveryOrderPrintPreview-U8g2O_pt.js → DeliveryOrderPrintPreview-DTjC7-Op.js} +2 -2
  13. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-D3tETd4M.js → EmailDialog.vue_vue_type_script_setup_true_lang-DeFiuGtR.js} +23 -23
  14. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DPVkPshX.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js} +1 -1
  15. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CCl3KLFs.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CzHFzHXg.js} +2 -2
  16. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiMEAtPb.js +118 -0
  17. package/dist/{FmMultiselectDialog-BplRH37N.js → FmMultiselectDialog-BdXOoS6z.js} +2 -2
  18. package/dist/{FmMultiselectDialog-DX3xMRs8.js → FmMultiselectDialog-D_4f9sXH.js} +1 -1
  19. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-fKDQGIyW.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js} +5 -5
  20. package/dist/{ImportView-BYQcNVFt.js → ImportView-BnL6y68X.js} +51 -51
  21. package/dist/{IngredientBindedItem.vue_vue_type_script_setup_true_lang-Bj3Bgpix.js → IngredientBindedItem.vue_vue_type_script_setup_true_lang-g-g6qaNU.js} +1 -1
  22. package/dist/{IngredientGroupView-B52_Gj1M.js → IngredientGroupView-Du0iICme.js} +5 -5
  23. package/dist/{IngredientsView-dp1q1202.js → IngredientsView-m2Rtn_F_.js} +15 -15
  24. package/dist/{IntegrationExplorerView-CFDjUZ1x.js → IntegrationExplorerView-J5BtpWN_.js} +352 -352
  25. package/dist/{IntegrationView-WxvHYqrr.js → IntegrationView-BMQj8wg-.js} +13 -13
  26. package/dist/{InventoryBindingForm-CgsJGTLO.js → InventoryBindingForm-D_KFXokV.js} +1 -1
  27. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-DoDwQAGq.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang-B7GjOoZh.js} +5 -5
  28. package/dist/{InventoryBindingSummary-CJPi-O24.js → InventoryBindingSummary-9TWMG5bm.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-6WGw2Tnv.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYXtIoll.js} +1 -1
  30. package/dist/{PremiumBadge.vue_vue_type_script_setup_true_lang-D8iVxQQI.js → PremiumBadge.vue_vue_type_script_setup_true_lang-CGJ_uWzF.js} +1 -1
  31. package/dist/ProductionView-CI07S6oW.js +1330 -0
  32. package/dist/{PublishView-DQxvMoL9.js → PublishView-CWMdUnaY.js} +3 -3
  33. package/dist/{PurchaseOrderPrintPreview-YN89wJJe.js → PurchaseOrderPrintPreview-B5XJcf8G.js} +2 -2
  34. package/dist/{ReceiveRequestView-Dld-AD3X.js → ReceiveRequestView-st3jdG9W.js} +13 -13
  35. package/dist/{RecipeView-DTeYl1vN.js → RecipeView-D9ZVbmtm.js} +17 -17
  36. package/dist/{SettingsView-ZKDeU7-t.js → SettingsView-CUS0aMbf.js} +4 -4
  37. package/dist/{StockView-iWDV-4Em.js → StockView-Co4DOixF.js} +55 -54
  38. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DKQR-Oe-.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Dt6XECIc.js} +1 -1
  39. package/dist/{SupplierView-DIFYaNh0.js → SupplierView-DXw6V-uS.js} +12 -12
  40. package/dist/{SurchargeView-Dg744-lq.js → SurchargeView-C-Bg7UsR.js} +6 -6
  41. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-a1NAKsHT.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js} +2 -2
  42. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BiMBRYQP.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-D7NrX7HR.js} +1 -1
  43. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BNb64xXp.js → TransferDetails.vue_vue_type_script_setup_true_lang-D9Fl_xAx.js} +1315 -1315
  44. package/dist/{TransferTemplateView-OKkFfbJr.js → TransferTemplateView-CP7ia82t.js} +20 -20
  45. package/dist/{UnitCostHistoryView-BQD8QfVO.js → UnitCostHistoryView-xe5q6105.js} +4 -4
  46. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DrZ0DaVk.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-_Eax2wkO.js} +4 -4
  47. package/dist/{UnitView-WB01UGKV.js → UnitView-1e6MQ-Vu.js} +7 -7
  48. package/dist/{WarehouseView-xzBYaKJc.js → WarehouseView-DXB6Ygwb.js} +5 -5
  49. package/dist/{WastageTemplateView-HQpsfs5m.js → WastageTemplateView-CWGNtaZJ.js} +14 -14
  50. package/dist/api/production.d.ts +29 -0
  51. package/dist/{app-jwcH8Mn8.js → app-DXqwG4b3.js} +1930 -1854
  52. package/dist/app.js +1 -1
  53. package/dist/{closing-template-nSKzJbXQ.js → closing-template-CCY6fg4v.js} +1 -1
  54. package/dist/{date2-CcBFYPpF.js → date2-BWfUJajP.js} +1 -1
  55. package/dist/{dayjs.min-CArZjoIW.js → dayjs.min-BqAOh_2L.js} +1 -1
  56. package/dist/{decimal-kAd3KrAk.js → decimal-DmkQg2_J.js} +2 -2
  57. package/dist/{defineDeepModel-DW3GGnCB.js → defineDeepModel-D9smHIGg.js} +1 -1
  58. package/dist/{duplicate-template-Dju7ozO-.js → duplicate-template-Ebdaehmw.js} +1 -1
  59. package/dist/{feature-Dwlpa3ga.js → feature-CD2ndvWN.js} +2 -2
  60. package/dist/{format-time-from-id-C8qHJtCE.js → format-time-from-id-BtUh8UMO.js} +1 -1
  61. package/dist/{format-unit-display-DW_s2GAu.js → format-unit-display-DLoTr1Hz.js} +12 -12
  62. package/dist/{import-export.helper-BLEUR_2a.js → import-export.helper-DYgr7Lvo.js} +49 -49
  63. package/dist/{index-DX29MkLw.js → index-CnuWmvgF.js} +1 -1
  64. package/dist/{index-CQqLXfqq.js → index-DmdqVO9N.js} +3 -3
  65. package/dist/{index-DeMIqTWp.js → index-z_cku6cd.js} +1 -1
  66. package/dist/inventory-core-dart.default-CEnDozvp.js +22707 -0
  67. package/dist/{jszip.min-UvNpneu6.js → jszip.min-DKMvkIMM.js} +220 -220
  68. package/dist/{lz-string-BJjf0Fvk.js → lz-string-BH6J5xxX.js} +1 -1
  69. package/dist/{netsuite-ojatCiHQ.js → netsuite-kR1AFzO9.js} +2 -2
  70. package/dist/{number-PbBeNwvZ.js → number-CRrcUtSg.js} +3 -3
  71. package/dist/{predefined-templates-C11X8192.js → predefined-templates-DbAHazbJ.js} +1 -1
  72. package/dist/{purchase-order-template-CMQsOjp6.js → purchase-order-template-DoEJEwqG.js} +1 -1
  73. package/dist/{recalculationUtils-DOIaJCEk.js → recalculationUtils-hk2PE0q1.js} +1 -1
  74. package/dist/router/name.d.ts +1 -0
  75. package/dist/{rules-iqyXkujx.js → rules-BPXgi6ZE.js} +2 -2
  76. package/dist/stock-CJAv4fTu.js +75 -0
  77. package/dist/{stock-BhMYoMNR.js → stock-qAhTEKrH.js} +1 -1
  78. package/dist/{supplier-XEzdhDaU.js → supplier-BvzIGpwW.js} +2 -2
  79. package/dist/{surcharge-Ors_mdMv.js → surcharge-BhLHJ3gK.js} +1 -1
  80. package/dist/tsconfig.app.tsbuildinfo +1 -1
  81. package/dist/{uom-rules-BQohyyG-.js → uom-rules-B1s74P9M.js} +1 -1
  82. package/dist/{use-ingredient-select-dialog-DJ-u5t4P.js → use-ingredient-select-dialog-aAPbd5cS.js} +2 -2
  83. package/dist/{use-inventory-binding-dialog-D3W-HnQ8.js → use-inventory-binding-dialog-CTjQzuV7.js} +2 -2
  84. package/dist/{use-template-enabled-locations-DVF4RYya.js → use-template-enabled-locations-Brw80-tj.js} +2 -2
  85. package/dist/{use-transfer-locations-vRfZN9tb.js → use-transfer-locations-BF7CKYpr.js} +2 -2
  86. package/dist/{useHrmPermission-z87O-oAT.js → useHrmPermission-Csjov-cy.js} +1 -1
  87. package/dist/{useNavigationMenu-DMRHryMp.js → useNavigationMenu-D8BERWXB.js} +12 -7
  88. package/dist/useSseClient-Cen-cw5C.js +453 -0
  89. package/dist/views/closing-draft/helpers/get-calculated-total.helper.spec.d.ts +1 -0
  90. package/dist/views/production/ProductionBindingsCell.vue.d.ts +29 -0
  91. package/dist/views/production/ProductionCompletionDialog.vue.d.ts +32 -0
  92. package/dist/views/production/ProductionDetailSheet.vue.d.ts +38 -0
  93. package/dist/views/production/ProductionDuplicateDialog.vue.d.ts +280 -0
  94. package/dist/views/production/ProductionPrepareBuilder.vue.d.ts +6 -0
  95. package/dist/views/production/ProductionView.vue.d.ts +2 -0
  96. package/dist/{vue-i18n-nOka-XyP.js → vue-i18n-lC_mdXT4.js} +176 -176
  97. package/dist/{xlsx.util-DDX-Y6FY.js → xlsx.util-DxgWqaTd.js} +3 -3
  98. package/package.json +5 -5
  99. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BgR0wjB0.js +0 -237
  100. package/dist/inventory-core-dart.default-BOlwkIOh.js +0 -18716
  101. package/dist/useSseClient-6AYDEsLw.js +0 -524
@@ -1,122 +1,122 @@
1
- import { defineComponent as qe, ref as X, watch as Ge, nextTick as us, openBlock as l, createBlock as me, Teleport as ds, createElementBlock as h, withModifiers as ms, createElementVNode as e, normalizeClass as Ue, toDisplayString as x, createCommentVNode as F, unref as _, withDirectives as ps, vModelText as fs, toRaw as vs, shallowRef as Vt, onUnmounted as ys, triggerRef as bs, computed as j, readonly as hs, h as Y, reactive as gs, onMounted as Wt, resolveComponent as re, withCtx as ie, createVNode as V, Fragment as Ce, renderList as Ee, createTextVNode as ze, renderSlot as _s, isRef as Ss, resolveDynamicComponent as xs } from "vue";
2
- import { f as ks, h as Os, r as ws, s as Qt } from "./predefined-templates-C11X8192.js";
3
- import { f as st, p as $s } from "./format-time-from-id-C8qHJtCE.js";
1
+ import { defineComponent as qe, ref as Z, watch as Ge, nextTick as us, openBlock as l, createBlock as me, Teleport as ds, createElementBlock as h, withModifiers as ms, createElementVNode as e, normalizeClass as Ue, toDisplayString as x, createCommentVNode as I, unref as _, withDirectives as ps, vModelText as fs, toRaw as vs, shallowRef as Vt, onUnmounted as ys, triggerRef as bs, computed as j, readonly as hs, h as Y, reactive as gs, onMounted as Wt, resolveComponent as re, withCtx as ce, createVNode as L, Fragment as Ce, renderList as Ee, createTextVNode as ze, renderSlot as _s, isRef as Ss, resolveDynamicComponent as xs } from "vue";
2
+ import { f as ks, h as Os, r as ws, s as Qt } from "./predefined-templates-DbAHazbJ.js";
3
+ import { f as st, p as $s } from "./format-time-from-id-BtUh8UMO.js";
4
4
  import { c as Lt } from "./component-kqxARxvM.js";
5
5
  import { D as Pe, R as Se } from "./row-action.enum-DQ9bJ_uv.js";
6
- import { G as Je, m as Cs, u as Me, U as q, _ as ut, V as ve, a as kt, $ as Ut, a0 as Ds, a1 as Rs, E as Ns, c as Yt, s as Ot, q as De, L as Mt, a2 as Jt, r as et, C as Fe, w as Ae, B as at } from "./app-jwcH8Mn8.js";
7
- import { h as wt, t as As, d as Ts, a as tt } from "./date2-CcBFYPpF.js";
8
- import { j as Ps, c as Is, a as xe, t as Ke, d as ot } from "./number-PbBeNwvZ.js";
9
- import { F as Ze, c as Fs, a as vt } from "./inventory-core-dart.default-BOlwkIOh.js";
10
- import { L as Es } from "./lz-string-BJjf0Fvk.js";
6
+ import { G as Je, m as Cs, u as Me, U as V, _ as ut, V as ve, a as kt, $ as Ut, a0 as Ds, a1 as Rs, E as Ns, c as Yt, s as Ot, q as De, L as Mt, a2 as Jt, r as et, C as Fe, w as Ae, B as at } from "./app-DXqwG4b3.js";
7
+ import { h as wt, t as As, d as Ts, a as tt } from "./date2-BWfUJajP.js";
8
+ import { j as Ps, c as Is, a as xe, t as Ke, d as ot } from "./number-CRrcUtSg.js";
9
+ import { F as Ze, a as Fs, b as vt } from "./inventory-core-dart.default-CEnDozvp.js";
10
+ import { L as Es } from "./lz-string-BH6J5xxX.js";
11
11
  import { useI18n as dt, useCoreStore as mt } from "@feedmepos/mf-common";
12
- import { u as pt, a as $t, S as Le } from "./netsuite-ojatCiHQ.js";
12
+ import { u as pt, a as $t, S as Le } from "./netsuite-kR1AFzO9.js";
13
13
  import { useDialog as ft, useSnackbar as Qe, components as lt, FmButtonVariant as Ve, useProxiedModel as qs } from "@feedmepos/ui-library";
14
14
  import { F as We } from "./FmAdminBadge-DjnBAgyv.js";
15
- import { u as He } from "./feature-Dwlpa3ga.js";
15
+ import { u as He } from "./feature-CD2ndvWN.js";
16
16
  import { _ as Vs } from "./empty-placeholder-B0QU467o.js";
17
- import { a as Ls, b as Us, f as it } from "./format-unit-display-DW_s2GAu.js";
18
- import { u as Ye, _ as Ms } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-a1NAKsHT.js";
19
- import { _ as js, a as Bs, b as zs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-fKDQGIyW.js";
17
+ import { a as Ls, b as Us, f as it } from "./format-unit-display-DLoTr1Hz.js";
18
+ import { u as Ye, _ as Ms } from "./SystemTrailDialog.vue_vue_type_script_setup_true_lang-D6_M-pbk.js";
19
+ import { _ as js, a as Bs, b as zs } from "./FmUnitInput.vue_vue_type_script_setup_true_lang-D_MOm5kW.js";
20
20
  import { u as Ks, R as jt } from "./usePromise-CbVUCxhj.js";
21
- import { d as Hs } from "./index-CQqLXfqq.js";
22
- import { i as Gs } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-DPVkPshX.js";
21
+ import { d as Hs } from "./index-DmdqVO9N.js";
22
+ import { i as Gs } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-NtqJm53P.js";
23
23
  import { F as Bt } from "./form-mode.enum-BKiNVH6A.js";
24
- import { u as Xt } from "./supplier-XEzdhDaU.js";
25
- import { u as Ws } from "./surcharge-Ors_mdMv.js";
26
- import { F as Qs } from "./decimal-kAd3KrAk.js";
27
- import { d as Zt } from "./defineDeepModel-DW3GGnCB.js";
28
- import { u as Ys } from "./vue-i18n-nOka-XyP.js";
29
- import { u as Js } from "./useHrmPermission-z87O-oAT.js";
24
+ import { u as Xt } from "./supplier-BvzIGpwW.js";
25
+ import { u as Ws } from "./surcharge-BhLHJ3gK.js";
26
+ import { F as Qs } from "./decimal-DmkQg2_J.js";
27
+ import { d as Zt } from "./defineDeepModel-D9smHIGg.js";
28
+ import { u as Ys } from "./vue-i18n-lC_mdXT4.js";
29
+ import { u as Js } from "./useHrmPermission-Csjov-cy.js";
30
30
  function es(b, s) {
31
31
  return s.reduce(
32
- (c, f) => {
33
- const u = f.received.find((v) => v.sku._id === b._id);
34
- return u && (c = Ps(c, u.amount)), c;
32
+ (c, v) => {
33
+ const d = v.received.find((p) => p.sku._id === b._id);
34
+ return d && (c = Ps(c, d.amount)), c;
35
35
  },
36
36
  Qs.toPrecision(Is(0), b.unit.precision)
37
37
  );
38
38
  }
39
39
  function Xs(b) {
40
- var ge, H, N, ne, I, R, K;
41
- const { po: s, currentLocation: o, business: c, fulfilling: f, por: u } = b, v = o.doc.profile || {}, { name: t, address: n, regNo: d, legalName: S } = v, w = {
42
- name: t || o.name || "",
43
- legalName: S || void 0,
44
- registrationNumber: d || void 0,
45
- line1: (n == null ? void 0 : n.line1) || "",
46
- line2: (n == null ? void 0 : n.line2) || void 0,
47
- postcode: (n == null ? void 0 : n.postcode) || "",
48
- city: (n == null ? void 0 : n.city) || "",
49
- state: (n == null ? void 0 : n.state) || "",
50
- country: (n == null ? void 0 : n.country) || ""
51
- }, C = {
40
+ var ge, H, R, ne, P, C, K;
41
+ const { po: s, currentLocation: n, business: c, fulfilling: v, por: d } = b, p = n.doc.profile || {}, { name: t, address: o, regNo: u, legalName: k } = p, $ = {
42
+ name: t || n.name || "",
43
+ legalName: k || void 0,
44
+ registrationNumber: u || void 0,
45
+ line1: (o == null ? void 0 : o.line1) || "",
46
+ line2: (o == null ? void 0 : o.line2) || void 0,
47
+ postcode: (o == null ? void 0 : o.postcode) || "",
48
+ city: (o == null ? void 0 : o.city) || "",
49
+ state: (o == null ? void 0 : o.state) || "",
50
+ country: (o == null ? void 0 : o.country) || ""
51
+ }, D = {
52
52
  name: s.supplier.name,
53
53
  phoneNumber: s.supplier.phoneNumber || void 0,
54
54
  registrationNumber: s.supplier.registrationNumber || void 0,
55
55
  line1: ((ge = s.supplier.address) == null ? void 0 : ge.line1) || "",
56
56
  line2: ((H = s.supplier.address) == null ? void 0 : H.line2) || void 0,
57
- postcode: ((N = s.supplier.address) == null ? void 0 : N.postcode) || "",
57
+ postcode: ((R = s.supplier.address) == null ? void 0 : R.postcode) || "",
58
58
  city: ((ne = s.supplier.address) == null ? void 0 : ne.city) || "",
59
- state: ((I = s.supplier.address) == null ? void 0 : I.state) || "",
60
- country: ((R = s.supplier.address) == null ? void 0 : R.country) || ""
61
- }, D = s.items.filter((T) => T.sku).map((T) => {
59
+ state: ((P = s.supplier.address) == null ? void 0 : P.state) || "",
60
+ country: ((C = s.supplier.address) == null ? void 0 : C.country) || ""
61
+ }, T = s.items.filter((N) => N.sku).map((N) => {
62
62
  var pe;
63
- const { sku: J, measurement: be } = T, ye = xe(
64
- es(T.sku, s.deliveryOrder || []),
63
+ const { sku: X, measurement: be } = N, ye = xe(
64
+ es(N.sku, s.deliveryOrder || []),
65
65
  !1
66
66
  );
67
67
  return {
68
- code: J.code,
69
- description: J.name,
70
- quantity: xe(T.quantity, !1),
71
- unit: (be == null ? void 0 : be.abbrev) || ((pe = J.unit) == null ? void 0 : pe.abbrev) || "",
68
+ code: X.code,
69
+ description: X.name,
70
+ quantity: xe(N.quantity, !1),
71
+ unit: (be == null ? void 0 : be.abbrev) || ((pe = X.unit) == null ? void 0 : pe.abbrev) || "",
72
72
  received: ye,
73
- unitCost: T.totalCost ? `${T.totalCost.currency} ${Ze.toFormatString({
74
- value: T.quantity.amount === 0 ? Ze.fromNumber(0) : Ze.divide([T.totalCost, T.quantity])
73
+ unitCost: N.totalCost ? `${N.totalCost.currency} ${Ze.toFormatString({
74
+ value: N.quantity.amount === 0 ? Ze.fromNumber(0) : Ze.divide([N.totalCost, N.quantity])
75
75
  })}` : void 0,
76
- cost: T.totalCost ? `${T.totalCost.currency} ${Ze.toFormatString({
77
- value: T.totalCost
76
+ cost: N.totalCost ? `${N.totalCost.currency} ${Ze.toFormatString({
77
+ value: N.totalCost
78
78
  })}` : void 0
79
79
  };
80
- }), $ = (s.deliveryOrder || []).map((T) => ({
81
- createdAt: wt(new Date(T.createdAt)),
82
- ref: T.deliveryOrderNumber,
83
- remark: T.remark || "",
84
- items: (T.received || []).map((J) => {
85
- var be, ye, pe, fe, p;
80
+ }), S = (s.deliveryOrder || []).map((N) => ({
81
+ createdAt: wt(new Date(N.createdAt)),
82
+ ref: N.deliveryOrderNumber,
83
+ remark: N.remark || "",
84
+ items: (N.received || []).map((X) => {
85
+ var be, ye, pe, fe, f;
86
86
  return {
87
- code: ((be = J.sku) == null ? void 0 : be.code) || "",
88
- description: ((ye = J.sku) == null ? void 0 : ye.name) || "",
89
- quantity: xe(J.amount),
90
- unit: ((pe = J.measurement) == null ? void 0 : pe.abbrev) || ((p = (fe = J.sku) == null ? void 0 : fe.unit) == null ? void 0 : p.abbrev) || ""
87
+ code: ((be = X.sku) == null ? void 0 : be.code) || "",
88
+ description: ((ye = X.sku) == null ? void 0 : ye.name) || "",
89
+ quantity: xe(X.amount),
90
+ unit: ((pe = X.measurement) == null ? void 0 : pe.abbrev) || ((f = (fe = X.sku) == null ? void 0 : fe.unit) == null ? void 0 : f.abbrev) || ""
91
91
  };
92
92
  })
93
93
  }));
94
- let M = Je.Enum.purchaseOrder, A = "Inventory Receive Note";
95
- if (s.supplier.internal ? (A = "Inventory Transfer Note", M = Je.Enum.transferOrder) : (A = "Purchase Order", M = Je.Enum.purchaseOrder), (K = u == null ? void 0 : u.from) != null && K.dbName) {
96
- const T = u.from.dbName;
97
- o.dbName === T || (A = "Inventory Receive Note", M = Je.Enum.goodsReceivedNote);
94
+ let F = Je.Enum.purchaseOrder, E = "Inventory Receive Note";
95
+ if (s.supplier.internal ? (E = "Inventory Transfer Note", F = Je.Enum.transferOrder) : (E = "Purchase Order", F = Je.Enum.purchaseOrder), (K = d == null ? void 0 : d.from) != null && K.dbName) {
96
+ const N = d.from.dbName;
97
+ n.dbName === N || (E = "Inventory Receive Note", F = Je.Enum.goodsReceivedNote);
98
98
  }
99
99
  const z = {
100
- title: A,
100
+ title: E,
101
101
  businessName: c == null ? void 0 : c.name,
102
102
  logo: c == null ? void 0 : c.thumbnail,
103
103
  orderNumber: s.seqNumber.toString(),
104
104
  createdAt: st(s._id),
105
105
  ref: s.ref || "",
106
106
  remark: s.remark || "",
107
- buyer: w,
108
- supplier: C,
109
- items: D,
107
+ buyer: $,
108
+ supplier: D,
109
+ items: T,
110
110
  status: s.status,
111
- deliveryOrders: $
112
- }, ce = f && (s.deliveryFullfillment || []).length > 0;
113
- return ce && (M = Je.Enum.deliveryOrder), { printData: z, templateType: M, isDeliveryPrint: ce };
111
+ deliveryOrders: S
112
+ }, ae = v && (s.deliveryFullfillment || []).length > 0;
113
+ return ae && (F = Je.Enum.deliveryOrder), { printData: z, templateType: F, isDeliveryPrint: ae };
114
114
  }
115
115
  function ts(b) {
116
- var S;
117
- const { printData: s, templateType: o } = Xs(b), f = ks().getTemplateByType(o), u = !!((S = f == null ? void 0 : f.blocks) != null && S.length), v = Os(o), t = u ? f.blocks : v.blocks, n = u ? f.name : v.name, d = !u;
116
+ var k;
117
+ const { printData: s, templateType: n } = Xs(b), v = ks().getTemplateByType(n), d = !!((k = v == null ? void 0 : v.blocks) != null && k.length), p = Os(n), t = d ? v.blocks : p.blocks, o = d ? v.name : p.name, u = !d;
118
118
  try {
119
- const w = ws(t, s), C = w.match(/<style>([\s\S]*?)<\/style>/), D = C ? `<style>${C[1]}</style>` : "", $ = w.replace(/<style>[\s\S]*?<\/style>/, "");
119
+ const $ = ws(t, s), D = $.match(/<style>([\s\S]*?)<\/style>/), T = D ? `<style>${D[1]}</style>` : "", S = $.replace(/<style>[\s\S]*?<\/style>/, "");
120
120
  return {
121
121
  html: `<!DOCTYPE html>
122
122
  <html>
@@ -130,12 +130,12 @@ function ts(b) {
130
130
  }
131
131
  * { box-sizing: border-box; margin: 0; padding: 0; }
132
132
  </style>
133
- ${D}
133
+ ${T}
134
134
  </head>
135
- <body>${$}</body>
135
+ <body>${S}</body>
136
136
  </html>`,
137
- templateName: n,
138
- isDefault: d
137
+ templateName: o,
138
+ isDefault: u
139
139
  };
140
140
  } catch {
141
141
  return alert("Failed to render print template. Please try recreating the template."), null;
@@ -154,32 +154,32 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
154
154
  },
155
155
  emits: ["update:modelValue"],
156
156
  setup(b, { emit: s }) {
157
- const o = b, c = s, f = X(null);
158
- function u() {
157
+ const n = b, c = s, v = Z(null);
158
+ function d() {
159
159
  c("update:modelValue", !1);
160
160
  }
161
- function v() {
162
- var n, d;
161
+ function p() {
162
+ var o, u;
163
163
  try {
164
- (d = (n = f.value) == null ? void 0 : n.contentWindow) == null || d.print();
164
+ (u = (o = v.value) == null ? void 0 : o.contentWindow) == null || u.print();
165
165
  } catch {
166
166
  alert("Failed to trigger print.");
167
167
  }
168
168
  }
169
169
  Ge(
170
- () => o.modelValue,
171
- async (n) => {
172
- n && (await us(), t(), setTimeout(() => {
173
- v();
170
+ () => n.modelValue,
171
+ async (o) => {
172
+ o && (await us(), t(), setTimeout(() => {
173
+ p();
174
174
  }, 300));
175
175
  }
176
176
  );
177
177
  function t() {
178
- var w;
179
- const n = f.value;
180
- if (!n) return;
181
- const d = Qt(o.html), S = n.contentDocument || ((w = n.contentWindow) == null ? void 0 : w.document);
182
- S && (S.open(), S.write(`
178
+ var $;
179
+ const o = v.value;
180
+ if (!o) return;
181
+ const u = Qt(n.html), k = o.contentDocument || (($ = o.contentWindow) == null ? void 0 : $.document);
182
+ k && (k.open(), k.write(`
183
183
  <!DOCTYPE html>
184
184
  <html>
185
185
  <head>
@@ -235,70 +235,70 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
235
235
  </head>
236
236
  <body>
237
237
  <div class="print-container">
238
- ${d}
238
+ ${u}
239
239
  </div>
240
240
  </body>
241
241
  </html>
242
- `), S.close());
242
+ `), k.close());
243
243
  }
244
- return (n, d) => (l(), me(ds, { to: "body" }, [
245
- n.modelValue ? (l(), h("div", {
244
+ return (o, u) => (l(), me(ds, { to: "body" }, [
245
+ o.modelValue ? (l(), h("div", {
246
246
  key: 0,
247
247
  class: "fixed inset-0 z-[9999] bg-black/50 flex justify-center items-center",
248
- onClick: ms(u, ["self"])
248
+ onClick: ms(d, ["self"])
249
249
  }, [
250
250
  e("div", Zs, [
251
251
  e("div", er, [
252
252
  e("div", tr, [
253
- d[0] || (d[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
254
- n.templateName ? (l(), h("span", {
253
+ u[0] || (u[0] = e("span", { class: "text-base font-semibold text-gray-700" }, "Print Preview", -1)),
254
+ o.templateName ? (l(), h("span", {
255
255
  key: 0,
256
- class: Ue(["text-xs font-medium px-2 py-0.5 rounded", n.isDefault ? "text-gray-500 bg-gray-100" : "text-blue-700 bg-blue-50"])
257
- }, x(n.templateName), 3)) : F("", !0),
258
- n.isDefault ? (l(), h("span", sr, "Default")) : F("", !0)
256
+ class: Ue(["text-xs font-medium px-2 py-0.5 rounded", o.isDefault ? "text-gray-500 bg-gray-100" : "text-blue-700 bg-blue-50"])
257
+ }, x(o.templateName), 3)) : I("", !0),
258
+ o.isDefault ? (l(), h("span", sr, "Default")) : I("", !0)
259
259
  ]),
260
260
  e("div", { class: "flex gap-2 items-center" }, [
261
261
  e("button", {
262
262
  class: "px-8 py-1.5 bg-blue-500 text-white border-none rounded text-sm cursor-pointer hover:bg-blue-700",
263
- onClick: v
263
+ onClick: p
264
264
  }, " Print "),
265
265
  e("button", {
266
266
  class: "px-2.5 py-1 bg-transparent border border-gray-300 rounded text-xl leading-none cursor-pointer text-gray-500 hover:bg-gray-100",
267
- onClick: u
267
+ onClick: d
268
268
  }, " × ")
269
269
  ])
270
270
  ]),
271
271
  e("div", rr, [
272
272
  e("iframe", {
273
273
  ref_key: "iframeRef",
274
- ref: f,
274
+ ref: v,
275
275
  class: "w-full h-full border-none",
276
276
  sandbox: "allow-same-origin allow-modals"
277
277
  }, null, 512)
278
278
  ])
279
279
  ])
280
- ])) : F("", !0)
280
+ ])) : I("", !0)
281
281
  ]));
282
282
  }
283
283
  }), or = Cs((b, s) => {
284
- const o = Me();
284
+ const n = Me();
285
285
  return {
286
286
  async getShipments({
287
287
  start: c,
288
- end: f
288
+ end: v
289
289
  }) {
290
- const u = o.currentLocationDBName, v = `${b.inventoryBackendUrl}/${u}/shipments`;
291
- return await s.get(`${v}?start=${c}&end=${f}`);
290
+ const d = n.currentLocationDBName, p = `${b.inventoryBackendUrl}/${d}/shipments`;
291
+ return await s.get(`${p}?start=${c}&end=${v}`);
292
292
  },
293
293
  async getShipmentsByIds(c) {
294
294
  if (c.length === 0)
295
295
  return [];
296
- const f = o.currentLocationDBName, u = `${b.inventoryBackendUrl}/${f}/shipments/get`;
297
- return await s.post(u, { shipmentIds: c });
296
+ const v = n.currentLocationDBName, d = `${b.inventoryBackendUrl}/${v}/shipments/get`;
297
+ return await s.post(d, { shipmentIds: c });
298
298
  }
299
299
  };
300
300
  }), ss = {
301
- [q.enum.confirmDraft]: {
301
+ [V.enum.confirmDraft]: {
302
302
  primaryActions: {
303
303
  text: "Confirm draft",
304
304
  close: !0
@@ -307,7 +307,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
307
307
  message: "Purchase order cannot be changed after confirm draft.",
308
308
  successMessage: "Purchase order draft has been confirmed"
309
309
  },
310
- [q.enum.cancelDraft]: {
310
+ [V.enum.cancelDraft]: {
311
311
  primaryActions: {
312
312
  text: "Cancel draft",
313
313
  close: !0,
@@ -317,7 +317,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
317
317
  message: "Purchase order cannot be changed after cancelled draft.",
318
318
  successMessage: "Purchase order draft has been cancelled"
319
319
  },
320
- [q.enum.approveDraft]: {
320
+ [V.enum.approveDraft]: {
321
321
  primaryActions: {
322
322
  text: "Approve draft",
323
323
  close: !0
@@ -326,7 +326,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
326
326
  message: "Purchase order request will be accepted.",
327
327
  successMessage: "Purchase order has been approved"
328
328
  },
329
- [q.enum.rejectDraft]: {
329
+ [V.enum.rejectDraft]: {
330
330
  primaryActions: {
331
331
  text: "Reject draft",
332
332
  close: !0
@@ -335,7 +335,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
335
335
  message: "Purchase order request will be rejected. You may provide an optional reason for rejection.",
336
336
  successMessage: "Purchase order has been rejected"
337
337
  },
338
- [q.enum.submitRequest]: {
338
+ [V.enum.submitRequest]: {
339
339
  primaryActions: {
340
340
  text: "Submit request",
341
341
  close: !0
@@ -344,7 +344,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
344
344
  message: "Purchase order cannot be changed after confirm draft.",
345
345
  successMessage: "Purchase order draft has been submitted"
346
346
  },
347
- [q.enum.completeReceive]: {
347
+ [V.enum.completeReceive]: {
348
348
  primaryActions: {
349
349
  text: "Mark received",
350
350
  close: !0
@@ -353,7 +353,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
353
353
  message: "Purchase order cannot be changed after it has complete receiving.",
354
354
  successMessage: "Purchase order has been marked as received"
355
355
  },
356
- [q.enum.approveRequest]: {
356
+ [V.enum.approveRequest]: {
357
357
  primaryActions: {
358
358
  text: "Accept request",
359
359
  close: !0
@@ -362,7 +362,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
362
362
  message: "Transfer out request will be accepted.",
363
363
  successMessage: "Transfer out request has been approved"
364
364
  },
365
- [q.enum.rejectRequest]: {
365
+ [V.enum.rejectRequest]: {
366
366
  primaryActions: {
367
367
  text: "Reject request",
368
368
  close: !0,
@@ -372,7 +372,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
372
372
  message: "Purchase order will be rejected.",
373
373
  successMessage: "Purchase order has been rejected"
374
374
  },
375
- [q.enum.processRequest]: {
375
+ [V.enum.processRequest]: {
376
376
  primaryActions: {
377
377
  text: "Process request",
378
378
  close: !0,
@@ -393,19 +393,19 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
393
393
  onChange: { type: Function }
394
394
  },
395
395
  setup(b) {
396
- const s = b, { t: o } = dt(), c = X("");
397
- Ge(c, (u) => {
398
- var v;
399
- (v = s.onChange) == null || v.call(s, u ?? "");
396
+ const s = b, { t: n } = dt(), c = Z("");
397
+ Ge(c, (d) => {
398
+ var p;
399
+ (p = s.onChange) == null || p.call(s, d ?? "");
400
400
  });
401
- function f() {
401
+ function v() {
402
402
  c.value = "";
403
403
  }
404
- return (u, v) => (l(), h("div", nr, [
405
- s.message ? (l(), h("div", ar, x(s.message), 1)) : F("", !0),
406
- e("label", lr, x(_(o)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + x(_(o)("inventory.common.optional")) + ")", 1),
404
+ return (d, p) => (l(), h("div", nr, [
405
+ s.message ? (l(), h("div", ar, x(s.message), 1)) : I("", !0),
406
+ e("label", lr, x(_(n)("inventory.transfer.receiveRequest.details.rejectionReason")) + " (" + x(_(n)("inventory.common.optional")) + ")", 1),
407
407
  ps(e("textarea", {
408
- "onUpdate:modelValue": v[0] || (v[0] = (t) => c.value = t),
408
+ "onUpdate:modelValue": p[0] || (p[0] = (t) => c.value = t),
409
409
  rows: "4",
410
410
  class: "w-full mt-2 p-2 border rounded"
411
411
  }, null, 512), [
@@ -415,7 +415,7 @@ const Zs = { class: "w-[95vw] h-[95vh] bg-white rounded-lg flex flex-col shadow-
415
415
  e("button", {
416
416
  type: "button",
417
417
  class: "fm-btn fm-btn-tertiary",
418
- onClick: f
418
+ onClick: v
419
419
  }, "Clear")
420
420
  ])
421
421
  ]));
@@ -436,37 +436,37 @@ function _t(b) {
436
436
  receivedMap: b
437
437
  });
438
438
  }
439
- function St(b, s, o) {
439
+ function St(b, s, n) {
440
440
  if (!ve.safeParse(b).success)
441
441
  throw new Error(`Invalid purchase order status: ${b}`);
442
442
  const c = ve.parse(b);
443
443
  return ut.orderStatusCombination({
444
444
  status: c,
445
445
  isPOPartialReceive: s,
446
- isPOOverReceive: o
446
+ isPOOverReceive: n
447
447
  });
448
448
  }
449
449
  function os() {
450
- const b = Me(), s = Ye(), o = He();
451
- async function c(u, v) {
450
+ const b = Me(), s = Ye(), n = He();
451
+ async function c(d, p) {
452
452
  const t = b.currentLocationDBName;
453
- return u.doc.supplier.internal && u.operation === q.enum.confirmDraft && (u.operation = q.enum.submitRequest), await s.processPurchaseOrder(u, v || t);
453
+ return d.doc.supplier.internal && d.operation === V.enum.confirmDraft && (d.operation = V.enum.submitRequest), await s.processPurchaseOrder(d, p || t);
454
454
  }
455
- async function f(u, v) {
455
+ async function v(d, p) {
456
456
  const t = b.currentLocationDBName;
457
- return await s.processPurchaseOrderV2(u, v || t);
457
+ return await s.processPurchaseOrderV2(d, p || t);
458
458
  }
459
- return (u) => o.useOperatePurchaseOrderV2 ? f(u.operateV2, u.transferTo) : c(u.operate, u.transferTo);
459
+ return (d) => n.useOperatePurchaseOrderV2 ? v(d.operateV2, d.transferTo) : c(d.operate, d.transferTo);
460
460
  }
461
461
  function Be(b) {
462
462
  const s = vs(b);
463
463
  if (Array.isArray(s))
464
464
  return s.map(Be);
465
465
  if (s !== null && typeof s == "object") {
466
- const o = {};
466
+ const n = {};
467
467
  for (const c in s)
468
- Object.prototype.hasOwnProperty.call(s, c) && (o[c] = Be(s[c]));
469
- return o;
468
+ Object.prototype.hasOwnProperty.call(s, c) && (n[c] = Be(s[c]));
469
+ return n;
470
470
  }
471
471
  return s;
472
472
  }
@@ -484,119 +484,119 @@ function zt(b) {
484
484
  doc: b.doc
485
485
  };
486
486
  }
487
- function Kt(b, s, o, c, f) {
488
- const u = Be(b.suppliers ?? []), v = Be(s.allLocations ?? []).map(zt), t = s._currentLocation ? zt(Be(s._currentLocation)) : null, n = o.inventory ? [Be(o.inventory)] : [], d = c.state.setting ? Be(c.state.setting) : null, S = Be(f.surcharges ?? []);
487
+ function Kt(b, s, n, c, v) {
488
+ const d = Be(b.suppliers ?? []), p = Be(s.allLocations ?? []).map(zt), t = s._currentLocation ? zt(Be(s._currentLocation)) : null, o = n.inventory ? [Be(n.inventory)] : [], u = c.state.setting ? Be(c.state.setting) : null, k = Be(v.surcharges ?? []);
489
489
  return {
490
- suppliers: u,
491
- locations: v,
490
+ suppliers: d,
491
+ locations: p,
492
492
  currentLocation: t,
493
- inventoryDoc: n,
494
- netSuiteSetting: d,
495
- surcharges: S
493
+ inventoryDoc: o,
494
+ netSuiteSetting: u,
495
+ surcharges: k
496
496
  };
497
497
  }
498
498
  function ns() {
499
- const b = Xt(), s = Me(), o = kt(), c = pt(), f = Ws(), u = Kt(
499
+ const b = Xt(), s = Me(), n = kt(), c = pt(), v = Ws(), d = Kt(
500
500
  b,
501
501
  s,
502
- o,
502
+ n,
503
503
  c,
504
- f
505
- ), v = Vt(Fs({ env: u }));
506
- v.value.setUsePartialUpdates(!0);
507
- const t = Vt(v.value.state()), n = (C) => {
508
- t.value = v.value.state();
504
+ v
505
+ ), p = Vt(Fs({ env: d }));
506
+ p.value.setUsePartialUpdates(!0);
507
+ const t = Vt(p.value.state()), o = (D) => {
508
+ t.value = p.value.state();
509
509
  };
510
- v.value.addListener(n);
511
- const d = (C, D, $) => {
512
- switch (C) {
510
+ p.value.addListener(o);
511
+ const u = (D, T, S) => {
512
+ switch (D) {
513
513
  case yt.set:
514
- Ut(t.value, D, $);
514
+ Ut(t.value, T, S);
515
515
  break;
516
516
  case yt.add:
517
- Rs(t.value, D, $);
517
+ Rs(t.value, T, S);
518
518
  break;
519
519
  case yt.delete:
520
- Ds(t.value, D);
520
+ Ds(t.value, T);
521
521
  break;
522
522
  default:
523
- console.warn(`Unknown partial update operation: ${C}, falling back to 'set'`), Ut(t.value, D, $);
523
+ console.warn(`Unknown partial update operation: ${D}, falling back to 'set'`), Ut(t.value, T, S);
524
524
  }
525
- D !== "remark" && D !== "ref" && bs(t);
525
+ T !== "remark" && T !== "ref" && bs(t);
526
526
  };
527
- v.value.addPartialListener(d);
528
- function S() {
529
- const C = Kt(
527
+ p.value.addPartialListener(u);
528
+ function k() {
529
+ const D = Kt(
530
530
  b,
531
531
  s,
532
- o,
532
+ n,
533
533
  c,
534
- f
534
+ v
535
535
  );
536
- v.value.updateFullEnv(C), t.value = v.value.state();
536
+ p.value.updateFullEnv(D), t.value = p.value.state();
537
537
  }
538
538
  Ge(
539
539
  [
540
540
  () => b.suppliers,
541
541
  () => s.allLocations,
542
542
  () => s._currentLocation,
543
- () => o.inventory,
543
+ () => n.inventory,
544
544
  () => c.state.setting,
545
- () => f.surcharges
545
+ () => v.surcharges
546
546
  ],
547
547
  () => {
548
- S();
548
+ k();
549
549
  },
550
550
  { deep: !0 }
551
551
  ), ys(() => {
552
- v.value.removeListener(n), v.value.removePartialListener(d);
552
+ p.value.removeListener(o), p.value.removePartialListener(u);
553
553
  });
554
- function w(C) {
555
- var D;
556
- if (C != null && C._id) {
557
- v.value.loadPurchaseOrder(C);
554
+ function $(D) {
555
+ var T;
556
+ if (D != null && D._id) {
557
+ p.value.loadPurchaseOrder(D);
558
558
  return;
559
559
  }
560
560
  if (!He().mustUsePoTemplate) {
561
- v.value.init();
561
+ p.value.init();
562
562
  return;
563
563
  }
564
- C != null && C.template && ((D = C.templateDoc) != null && D.purchaseOrder) ? (C.items = C.templateDoc.purchaseOrder.items, v.value.initFromTemplate(C)) : v.value.initOutletToOutlet();
564
+ D != null && D.template && ((T = D.templateDoc) != null && T.purchaseOrder) ? (D.items = D.templateDoc.purchaseOrder.items, p.value.initFromTemplate(D)) : p.value.initOutletToOutlet();
565
565
  }
566
566
  return {
567
- controller: v,
567
+ controller: p,
568
568
  state: t,
569
- init: w
569
+ init: $
570
570
  };
571
571
  }
572
572
  var xt = /* @__PURE__ */ ((b) => (b.RECEIVE_REQUEST = "receive/request", b.APPROVAL = "approval", b))(xt || {});
573
- const Xe = X(), bt = X(), ht = X();
573
+ const Xe = Z(), bt = Z(), ht = Z();
574
574
  function zl(b, s) {
575
- const o = ft(), c = Me(), f = He(), u = Xt(), v = mt(), t = Ls(), n = Us(), d = X(!1), S = Qe(), w = Ye(), C = or(), D = X(new Array()), $ = X(new Array()), M = X(
575
+ const n = ft(), c = Me(), v = He(), d = Xt(), p = mt(), t = Ls(), o = Us(), u = Z(!1), k = Qe(), $ = Ye(), D = or(), T = Z(new Array()), S = Z(new Array()), F = Z(
576
576
  s != null && s.startDate && (s != null && s.endDate) ? s : Gs()
577
- ), A = j(() => {
578
- const p = new Date(M.value.startDate), i = new Date(M.value.endDate);
577
+ ), E = j(() => {
578
+ const f = new Date(F.value.startDate), i = new Date(F.value.endDate);
579
579
  return {
580
- start: As(p).toISOString(),
580
+ start: As(f).toISOString(),
581
581
  end: Ts(i).toISOString()
582
582
  };
583
- }), Z = X(new Array()), z = Ns(), ce = X(null);
584
- async function ge(p) {
585
- function i(U) {
583
+ }), J = Z(new Array()), z = Ns(), ae = Z(null);
584
+ async function ge(f) {
585
+ function i(M) {
586
586
  const G = {
587
587
  mode: Bt.CREATE,
588
- modelValue: p || void 0,
588
+ modelValue: f || void 0,
589
589
  show: !0,
590
- "onUpdate:show"(le) {
591
- Xe.value.show = le;
590
+ "onUpdate:show"(ie) {
591
+ Xe.value.show = ie;
592
592
  },
593
- templateId: U,
594
- lastClosingDate: ce.value
593
+ templateId: M,
594
+ lastClosingDate: ae.value
595
595
  };
596
596
  Xe.value = G;
597
597
  }
598
- let k;
599
- f.mustUsePoTemplate && !(p != null && p.template) ? o.open({
598
+ let O;
599
+ v.mustUsePoTemplate && !(f != null && f.template) ? n.open({
600
600
  title: "Create transfer",
601
601
  message: "",
602
602
  primaryActions: {
@@ -609,230 +609,230 @@ function zl(b, s) {
609
609
  close: !0
610
610
  }
611
611
  }).onPrimary(async () => {
612
- k = await t.getTemplateId(), k && i(k);
612
+ O = await t.getTemplateId(), O && i(O);
613
613
  }).onSecondary(() => {
614
614
  i(void 0);
615
- }) : i(k);
615
+ }) : i(O);
616
616
  }
617
- function H(p) {
617
+ function H(f) {
618
618
  const i = {
619
619
  mode: Bt.UPDATE,
620
- modelValue: Yt(p),
620
+ modelValue: Yt(f),
621
621
  show: !0,
622
- "onUpdate:show"(k) {
623
- Xe.value.show = k;
622
+ "onUpdate:show"(O) {
623
+ Xe.value.show = O;
624
624
  },
625
- lastClosingDate: ce.value
625
+ lastClosingDate: ae.value
626
626
  };
627
627
  Xe.value = i;
628
628
  }
629
- function N(p) {
630
- if (!v.currentBusiness.value) return;
629
+ function R(f) {
630
+ if (!p.currentBusiness.value) return;
631
631
  const i = c.currentLocation;
632
632
  if (i.type === "restaurant") {
633
633
  const ee = c.locationRestaurantFromCore(i.doc._id);
634
634
  ee !== null && (i.doc = ee);
635
635
  }
636
- const k = ts({
637
- po: p,
636
+ const O = ts({
637
+ po: f,
638
638
  currentLocation: i,
639
- business: v.currentBusiness.value,
639
+ business: p.currentBusiness.value,
640
640
  fulfilling: b === "approval",
641
- por: p.request
641
+ por: f.request
642
642
  });
643
- if (!k) return;
644
- const U = Qt(k.html), G = u.supplierById[p.supplier._id], le = {
643
+ if (!O) return;
644
+ const M = Qt(O.html), G = d.supplierById[f.supplier._id], ie = {
645
645
  recipientName: G.name,
646
646
  email: (G == null ? void 0 : G.email) ?? "",
647
- business: v.currentBusiness.value,
648
- modelValue: U,
647
+ business: p.currentBusiness.value,
648
+ modelValue: M,
649
649
  show: !0,
650
650
  "onUpdate:show"(ee) {
651
651
  bt.value.show = ee;
652
652
  }
653
653
  };
654
- bt.value = le;
654
+ bt.value = ie;
655
655
  }
656
656
  async function ne() {
657
- D.value = [], $.value = [], d.value = !0;
657
+ T.value = [], S.value = [], u.value = !0;
658
658
  try {
659
- const p = await w.getPurchaseOrders(A.value);
660
- D.value = p.sort((ee, ke) => ke._id.localeCompare(ee._id));
661
- const i = p.flatMap((ee) => ee.shipmentIds || []).filter(Boolean), k = i.length > 0 ? await C.getShipmentsByIds(i) : [];
662
- $.value = k;
663
- const U = await z.readCurrentLocationLastClosing(!0), G = U == null ? void 0 : U._id;
664
- G && (ce.value = $s(G)), await f.awaitFeatureLoaded(() => f.mustUsePoTemplate) && await n.fetchTemplates();
665
- const le = D.value.map((ee) => {
659
+ const f = await $.getPurchaseOrders(E.value);
660
+ T.value = f.sort((ee, ke) => ke._id.localeCompare(ee._id));
661
+ const i = f.flatMap((ee) => ee.shipmentIds || []).filter(Boolean), O = i.length > 0 ? await D.getShipmentsByIds(i) : [];
662
+ S.value = O;
663
+ const M = await z.readCurrentLocationLastClosing(!0), G = M == null ? void 0 : M._id;
664
+ G && (ae.value = $s(G)), await v.awaitFeatureLoaded(() => v.mustUsePoTemplate) && await o.fetchTemplates();
665
+ const ie = T.value.map((ee) => {
666
666
  var ke;
667
667
  return ((ke = ee.request) == null ? void 0 : ke.id) ?? "";
668
668
  }).filter((ee) => ee);
669
- Z.value = await w.readRequestByIds(le);
669
+ J.value = await $.readRequestByIds(ie);
670
670
  } catch {
671
- S.open({
671
+ k.open({
672
672
  title: "Something went wrong",
673
673
  message: "Error at fetching purchase orders",
674
674
  type: "error"
675
675
  });
676
676
  } finally {
677
- d.value = !1;
677
+ u.value = !1;
678
678
  }
679
679
  }
680
- async function I() {
681
- Z.value = [], d.value = !0;
680
+ async function P() {
681
+ J.value = [], u.value = !0;
682
682
  try {
683
- Z.value = await w.readRequests(
683
+ J.value = await $.readRequests(
684
684
  void 0,
685
- A.value.start,
686
- A.value.end
687
- ).then((p) => p.reverse());
685
+ E.value.start,
686
+ E.value.end
687
+ ).then((f) => f.reverse());
688
688
  } catch {
689
- S.open({
689
+ k.open({
690
690
  title: "Something went wrong",
691
691
  message: "Error at fetching purchase requests",
692
692
  type: "error"
693
693
  });
694
694
  } finally {
695
- d.value = !1;
695
+ u.value = !1;
696
696
  }
697
697
  }
698
- function R() {
698
+ function C() {
699
699
  switch (b) {
700
700
  case "receive/request":
701
701
  return ne();
702
702
  case "approval":
703
- return I();
703
+ return P();
704
704
  }
705
705
  }
706
- function K(p, i) {
707
- M.value = {
708
- startDate: p,
706
+ function K(f, i) {
707
+ F.value = {
708
+ startDate: f,
709
709
  endDate: i
710
- }, R();
710
+ }, C();
711
711
  }
712
- c.watchLocation(async (p) => {
713
- if (!p) {
714
- D.value = [];
712
+ c.watchLocation(async (f) => {
713
+ if (!f) {
714
+ T.value = [];
715
715
  return;
716
716
  }
717
- await R();
717
+ await C();
718
718
  });
719
- const T = X(), J = X(Math.random().toString());
720
- async function be(p, i) {
721
- const k = Math.random().toString();
722
- J.value = k, i ?? (i = Z.value.computeFirst(
723
- (ee) => ee.purchaseOrderId === p._id ? ee : null
719
+ const N = Z(), X = Z(Math.random().toString());
720
+ async function be(f, i) {
721
+ const O = Math.random().toString();
722
+ X.value = O, i ?? (i = J.value.computeFirst(
723
+ (ee) => ee.purchaseOrderId === f._id ? ee : null
724
724
  ) ?? void 0);
725
- const U = b === "receive/request" ? c.currentLocation : i == null ? void 0 : i.to, G = b === "approval", le = {
725
+ const M = b === "receive/request" ? c.currentLocation : i == null ? void 0 : i.to, G = b === "approval", ie = {
726
726
  poRequest: i,
727
727
  purchaseOrder: {
728
- ...p,
729
- status: G && (i != null && i.rejectedAt) ? ve.Enum.REJECT : p.status
728
+ ...f,
729
+ status: G && (i != null && i.rejectedAt) ? ve.Enum.REJECT : f.status
730
730
  },
731
- transferTo: U == null ? void 0 : U.name,
732
- transferToDbName: U == null ? void 0 : U.dbName,
731
+ transferTo: M == null ? void 0 : M.name,
732
+ transferToDbName: M == null ? void 0 : M.dbName,
733
733
  show: !0,
734
734
  canResubmit: !1,
735
735
  canApprove: G,
736
736
  "onUpdate:show"(ee) {
737
- T.value.show = ee;
737
+ N.value.show = ee;
738
738
  },
739
739
  scope: b,
740
- receivedMap: ct(p) ?? {},
741
- shipments: $.value
740
+ receivedMap: ct(f) ?? {},
741
+ shipments: S.value
742
742
  };
743
- T.value = le;
743
+ N.value = ie;
744
744
  }
745
- async function ye(p, i, k, U, G) {
746
- const le = os();
747
- d.value = !0;
745
+ async function ye(f, i, O, M, G) {
746
+ const ie = os();
747
+ u.value = !0;
748
748
  try {
749
- await le({
749
+ await ie({
750
750
  operate: {
751
751
  operation: i,
752
- doc: p,
752
+ doc: f,
753
753
  options: (
754
754
  // auto receive for supplier to warehouse
755
- (i === q.enum.confirmDraft || // auto receive for warehouse to warehouse
756
- i === q.enum.completeReceive) && f.autoReceiveWarehouse ? {
755
+ (i === V.enum.confirmDraft || // auto receive for warehouse to warehouse
756
+ i === V.enum.completeReceive) && v.autoReceiveWarehouse ? {
757
757
  autoReceive: !0
758
758
  } : void 0
759
759
  )
760
760
  },
761
761
  operateV2: {
762
- _id: p._id,
763
- _rev: p._rev ?? "",
764
- action: i === q.enum.submitRequest ? q.enum.confirmDraft : i,
762
+ _id: f._id,
763
+ _rev: f._rev ?? "",
764
+ action: i === V.enum.submitRequest ? V.enum.confirmDraft : i,
765
765
  payloads: G ?? []
766
766
  },
767
- transferTo: U
768
- }), await new Promise((ae) => setTimeout(ae, 1e3));
767
+ transferTo: M
768
+ }), await new Promise((le) => setTimeout(le, 1e3));
769
769
  const ke = Me().currentLocationDBName.startsWith("restaurant_");
770
- i === q.enum.confirmDraft && p.effectiveAt && ke ? S.open({
770
+ i === V.enum.confirmDraft && f.effectiveAt && ke ? k.open({
771
771
  title: "Success",
772
- message: `${k}. The backdate will be reflected once your POS has received this change.`,
772
+ message: `${O}. The backdate will be reflected once your POS has received this change.`,
773
773
  type: "success"
774
- }) : S.open({
774
+ }) : k.open({
775
775
  title: "Success",
776
- message: k,
776
+ message: O,
777
777
  type: "success"
778
778
  });
779
779
  } catch (ee) {
780
- S.open({
780
+ k.open({
781
781
  title: "Something went wrong",
782
782
  message: ee instanceof Error ? ee.message : "Please try again.",
783
783
  type: "error"
784
- }), console.error("Error when submitting PO operation", i, p, ee);
784
+ }), console.error("Error when submitting PO operation", i, f, ee);
785
785
  } finally {
786
- d.value = !1, R();
786
+ u.value = !1, C();
787
787
  }
788
788
  }
789
- async function pe(p, i, k) {
790
- const U = ss[i];
791
- if (!U) {
792
- S.open({
789
+ async function pe(f, i, O) {
790
+ const M = ss[i];
791
+ if (!M) {
792
+ k.open({
793
793
  title: "Something went wrong",
794
794
  message: `Cannot process order: ${Ot(i)}`,
795
795
  type: "error"
796
796
  });
797
797
  return;
798
798
  }
799
- const { successMessage: G, ...le } = U;
800
- if (i === q.enum.rejectDraft) {
801
- let ae = "";
802
- o.open({
803
- title: le.title,
804
- message: le.message,
805
- primaryActions: le.primaryActions,
799
+ const { successMessage: G, ...ie } = M;
800
+ if (i === V.enum.rejectDraft) {
801
+ let le = "";
802
+ n.open({
803
+ title: ie.title,
804
+ message: ie.message,
805
+ primaryActions: ie.primaryActions,
806
806
  contentComponent: rs,
807
807
  contentComponentProps: {
808
- message: le.message,
809
- onChange: (r) => ae = r
808
+ message: ie.message,
809
+ onChange: (r) => le = r
810
810
  }
811
811
  }).onPrimary(() => {
812
812
  const r = [];
813
813
  r.push({
814
814
  action: "rejectDraft",
815
815
  payload: {
816
- rejectReason: ae
816
+ rejectReason: le
817
817
  }
818
- }), ye(p, i, G, k, r);
818
+ }), ye(f, i, G, O, r);
819
819
  });
820
820
  return;
821
821
  }
822
822
  const ee = [], ke = ns();
823
- ke.init(p), (i === q.enum.confirmDraft || i === q.enum.submitRequest) && ee.push({
823
+ ke.init(f), (i === V.enum.confirmDraft || i === V.enum.submitRequest) && ee.push({
824
824
  action: "confirmDraft",
825
825
  payload: ke.controller.value.toConfirmDraftData(De())
826
- }), o.open({
827
- title: le.title,
828
- message: le.message,
829
- primaryActions: le.primaryActions
826
+ }), n.open({
827
+ title: ie.title,
828
+ message: ie.message,
829
+ primaryActions: ie.primaryActions
830
830
  }).onPrimary(() => {
831
- ye(p, i, G, k, ee);
831
+ ye(f, i, G, O, ee);
832
832
  });
833
833
  }
834
834
  async function fe() {
835
- o.open({
835
+ n.open({
836
836
  title: "Upload Transfer",
837
837
  primaryActions: {
838
838
  text: "Xilnex transfer note",
@@ -843,46 +843,46 @@ function zl(b, s) {
843
843
  close: !0
844
844
  }
845
845
  }).onPrimary(() => {
846
- const p = {
846
+ const f = {
847
847
  show: !0,
848
848
  "onUpdate:show"(i) {
849
849
  ht.value.show = i;
850
850
  }
851
851
  };
852
- ht.value = p;
852
+ ht.value = f;
853
853
  });
854
854
  }
855
855
  return {
856
- purchaseOrders: D,
857
- shipments: $,
858
- purchaseRequests: Z,
856
+ purchaseOrders: T,
857
+ shipments: S,
858
+ purchaseRequests: J,
859
859
  updateDateRange: K,
860
- fetchData: R,
861
- loading: d,
860
+ fetchData: C,
861
+ loading: u,
862
862
  transferDialogProps: Xe,
863
863
  promptCreateTransferDialog: ge,
864
864
  promptUpdateTransferDialog: H,
865
- transferDetailsProps: T,
865
+ transferDetailsProps: N,
866
866
  promptShowTransferDetails: be,
867
867
  submitAction: pe,
868
868
  xilnexImportDialogProps: ht,
869
869
  promptUploadTransferDialog: fe,
870
870
  emailDialogProps: bt,
871
- promptEmailDialog: N
871
+ promptEmailDialog: R
872
872
  };
873
873
  }
874
874
  function cr(b) {
875
- const { po: s, currentLocation: o, business: c, fulfilling: f, por: u } = b, { name: v, address: t, regNo: n, legalName: d } = o.doc.profile, S = {
876
- name: v,
877
- legalName: d,
878
- registrationNumber: n,
875
+ const { po: s, currentLocation: n, business: c, fulfilling: v, por: d } = b, { name: p, address: t, regNo: o, legalName: u } = n.doc.profile, k = {
876
+ name: p,
877
+ legalName: u,
878
+ registrationNumber: o,
879
879
  line1: t == null ? void 0 : t.line1,
880
880
  line2: t == null ? void 0 : t.line2,
881
881
  postcode: t == null ? void 0 : t.postcode,
882
882
  city: t == null ? void 0 : t.city,
883
883
  state: t == null ? void 0 : t.state,
884
884
  country: t == null ? void 0 : t.country
885
- }, w = {
885
+ }, $ = {
886
886
  name: s.supplier.name,
887
887
  phoneNumber: s.supplier.phoneNumber,
888
888
  registrationNumber: s.supplier.registrationNumber,
@@ -892,123 +892,123 @@ function cr(b) {
892
892
  city: s.supplier.address.city,
893
893
  state: s.supplier.address.state,
894
894
  country: s.supplier.address.country
895
- }, C = s.items.map((H) => {
896
- const { sku: N, measurement: ne } = H, I = xe(
895
+ }, D = s.items.map((H) => {
896
+ const { sku: R, measurement: ne } = H, P = xe(
897
897
  es(H.sku, s.deliveryOrder || []),
898
898
  !1
899
899
  );
900
900
  return {
901
- code: N.code,
902
- description: N.name,
901
+ code: R.code,
902
+ description: R.name,
903
903
  quantity: xe(H.quantity, !1),
904
- unit: (ne == null ? void 0 : ne.abbrev) || N.unit.abbrev,
905
- received: I,
904
+ unit: (ne == null ? void 0 : ne.abbrev) || R.unit.abbrev,
905
+ received: P,
906
906
  cost: H.totalCost ? `${H.totalCost.currency} ${Ze.toFormatString({
907
907
  value: H.totalCost
908
908
  })}` : void 0
909
909
  };
910
- }), D = s.deliveryOrder.map((H) => ({
910
+ }), T = s.deliveryOrder.map((H) => ({
911
911
  createdAt: wt(new Date(H.createdAt)),
912
912
  ref: H.deliveryOrderNumber,
913
913
  remark: H.remark || "",
914
- items: H.received.map((N) => {
914
+ items: H.received.map((R) => {
915
915
  var ne;
916
916
  return {
917
- code: N.sku.code,
918
- description: N.sku.name,
919
- quantity: xe(N.amount),
920
- unit: ((ne = N.measurement) == null ? void 0 : ne.abbrev) || N.sku.unit.abbrev
917
+ code: R.sku.code,
918
+ description: R.sku.name,
919
+ quantity: xe(R.amount),
920
+ unit: ((ne = R.measurement) == null ? void 0 : ne.abbrev) || R.sku.unit.abbrev
921
921
  };
922
922
  })
923
- })), $ = [
923
+ })), S = [
924
924
  // Production
925
925
  "67ca5d2c80bd0e001c5bf5bc",
926
926
  // Dev
927
927
  "6880b36a3054c5001db19218"
928
928
  ];
929
- let M = "Inventory Receive Note";
930
- if (s.supplier.internal ? (M = "Inventory Transfer Note", $.includes((c == null ? void 0 : c._id) || "") && (M = "Stock Request")) : M = "Purchase Order", u) {
931
- const H = u.from.dbName;
932
- o.dbName === H || (M = "Inventory Receive Note");
929
+ let F = "Inventory Receive Note";
930
+ if (s.supplier.internal ? (F = "Inventory Transfer Note", S.includes((c == null ? void 0 : c._id) || "") && (F = "Stock Request")) : F = "Purchase Order", d) {
931
+ const H = d.from.dbName;
932
+ n.dbName === H || (F = "Inventory Receive Note");
933
933
  }
934
- const Z = {
935
- title: M,
934
+ const J = {
935
+ title: F,
936
936
  businessName: c == null ? void 0 : c.name,
937
937
  logo: c == null ? void 0 : c.thumbnail,
938
938
  orderNumber: s.seqNumber.toString(),
939
939
  createdAt: st(s._id),
940
940
  ref: s.ref || "",
941
941
  remark: s.remark || "",
942
- buyer: S,
943
- supplier: w,
944
- items: C,
942
+ buyer: k,
943
+ supplier: $,
944
+ items: D,
945
945
  status: s.status,
946
- deliveryOrders: D
947
- }, z = new URL(window.location.href), ce = f && (s.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
948
- z.pathname = z.hostname.includes("portal.feedme") ? `/inventory/${ce}` : `/${ce}`;
949
- const ge = Es.compressToEncodedURIComponent(JSON.stringify(Z));
946
+ deliveryOrders: T
947
+ }, z = new URL(window.location.href), ae = v && (s.deliveryFullfillment || []).length > 0 ? "receive-request/delivery-print-preview" : "receive-request/print-preview";
948
+ z.pathname = z.hostname.includes("portal.feedme") ? `/inventory/${ae}` : `/${ae}`;
949
+ const ge = Es.compressToEncodedURIComponent(JSON.stringify(J));
950
950
  z.searchParams.append("data", ge), window.open(z.href, "_blank", "noreferrer");
951
951
  }
952
952
  const je = {
953
953
  submitRequest: {
954
954
  translationKey: "inventory.transfer.receiveRequest.actions.submitRequest",
955
955
  color: "text-fm-color-typo-primary",
956
- value: q.enum.submitRequest
956
+ value: V.enum.submitRequest
957
957
  },
958
958
  confirmDraft: {
959
959
  translationKey: "inventory.transfer.receiveRequest.actions.confirmDraft",
960
960
  color: "text-fm-color-typo-primary",
961
- value: q.enum.confirmDraft
961
+ value: V.enum.confirmDraft
962
962
  },
963
963
  cancelDraft: {
964
964
  translationKey: "inventory.transfer.receiveRequest.actions.cancelDraft",
965
965
  color: "text-fm-color-typo-error",
966
- value: q.enum.cancelDraft
966
+ value: V.enum.cancelDraft
967
967
  },
968
968
  approveRequest: {
969
969
  translationKey: "inventory.transfer.receiveRequest.actions.approveRequest",
970
970
  color: "text-fm-color-typo-primary",
971
- value: q.enum.approveRequest
971
+ value: V.enum.approveRequest
972
972
  },
973
973
  rejectRequest: {
974
974
  translationKey: "inventory.transfer.receiveRequest.actions.rejectRequest",
975
975
  color: "text-fm-color-typo-error",
976
- value: q.enum.rejectRequest
976
+ value: V.enum.rejectRequest
977
977
  },
978
978
  processRequest: {
979
979
  translationKey: "inventory.transfer.receiveRequest.actions.processRequest",
980
980
  color: "text-fm-color-typo-primary",
981
- value: q.enum.processRequest
981
+ value: V.enum.processRequest
982
982
  },
983
983
  receiveStock: {
984
984
  translationKey: "inventory.transfer.receiveRequest.actions.receiveStock",
985
985
  color: "text-fm-color-typo-primary",
986
- value: q.enum.receiveStock
986
+ value: V.enum.receiveStock
987
987
  },
988
988
  completeReceive: {
989
989
  translationKey: "inventory.transfer.receiveRequest.actions.completeReceive",
990
990
  color: "text-fm-color-typo-primary",
991
- value: q.enum.completeReceive
991
+ value: V.enum.completeReceive
992
992
  },
993
993
  closeRequest: {
994
994
  translationKey: "inventory.transfer.receiveRequest.actions.closeRequest",
995
995
  color: "system-error-300",
996
- value: q.enum.closeRequest
996
+ value: V.enum.closeRequest
997
997
  },
998
998
  approveDraft: {
999
999
  translationKey: "inventory.transfer.receiveRequest.actions.approveDraft",
1000
1000
  color: "text-fm-color-typo-primary",
1001
- value: q.enum.approveDraft
1001
+ value: V.enum.approveDraft
1002
1002
  },
1003
1003
  rejectDraft: {
1004
1004
  translationKey: "inventory.transfer.receiveRequest.actions.rejectDraft",
1005
1005
  color: "text-fm-color-typo-error",
1006
- value: q.enum.rejectDraft
1006
+ value: V.enum.rejectDraft
1007
1007
  },
1008
1008
  returnStock: {
1009
1009
  translationKey: "inventory.transfer.receiveRequest.actions.returnStock",
1010
1010
  color: "text-fm-color-typo-primary",
1011
- value: q.enum.returnStock
1011
+ value: V.enum.returnStock
1012
1012
  }
1013
1013
  };
1014
1014
  function as() {
@@ -1022,12 +1022,12 @@ function as() {
1022
1022
  ableToMarkApproved(s) {
1023
1023
  return !(!s || (s == null ? void 0 : s.status) !== ve.enum.REQUESTING);
1024
1024
  },
1025
- ableToCreateFulfillment(s, o) {
1026
- var u, v;
1027
- if (!b.acceptRequireFulfillment || !s || !o || s.status !== ve.enum.PROCESSING || !o.processedAt)
1025
+ ableToCreateFulfillment(s, n) {
1026
+ var d, p;
1027
+ if (!b.acceptRequireFulfillment || !s || !n || s.status !== ve.enum.PROCESSING || !n.processedAt)
1028
1028
  return !1;
1029
- const c = (u = o == null ? void 0 : o.from) == null ? void 0 : u.dbName, f = (v = o == null ? void 0 : o.to) == null ? void 0 : v.dbName;
1030
- return !(c.startsWith("restaurant_") && f.startsWith("restaurant_"));
1029
+ const c = (d = n == null ? void 0 : n.from) == null ? void 0 : d.dbName, v = (p = n == null ? void 0 : n.to) == null ? void 0 : p.dbName;
1030
+ return !(c.startsWith("restaurant_") && v.startsWith("restaurant_"));
1031
1031
  }
1032
1032
  };
1033
1033
  }
@@ -1042,45 +1042,45 @@ function ls() {
1042
1042
  hasOrderDraftPermission: hs(s)
1043
1043
  };
1044
1044
  }
1045
- function Kl(b, s, o) {
1046
- const c = Me(), f = pt(), u = mt(), v = as(), { t } = dt(), { hasOrderDraftPermission: n } = ls(), d = He(), S = j(
1047
- () => d.enablePrintTemplate ? [Pe[Se.PrintCustom]] : []
1048
- ), w = j(
1049
- () => d.enablePurchaseOrderEmail ? [Pe[Se.Email]] : []
1045
+ function Kl(b, s, n) {
1046
+ const c = Me(), v = pt(), d = mt(), p = as(), { t } = dt(), { hasOrderDraftPermission: o } = ls(), u = He(), k = j(
1047
+ () => u.enablePrintTemplate ? [Pe[Se.PrintCustom]] : []
1048
+ ), $ = j(
1049
+ () => u.enablePurchaseOrderEmail ? [Pe[Se.Email]] : []
1050
1050
  );
1051
- function C(N) {
1052
- switch (N.status) {
1051
+ function D(R) {
1052
+ switch (R.status) {
1053
1053
  case "DRAFT":
1054
1054
  return [
1055
1055
  Pe[Se.Update],
1056
1056
  Pe[Se.Details],
1057
- N.supplier.internal === "restaurant" || N.supplier.internal === "warehouse" ? je[q.enum.submitRequest] : je[q.enum.confirmDraft],
1058
- je[q.enum.cancelDraft]
1057
+ R.supplier.internal === "restaurant" || R.supplier.internal === "warehouse" ? je[V.enum.submitRequest] : je[V.enum.confirmDraft],
1058
+ je[V.enum.cancelDraft]
1059
1059
  ];
1060
1060
  case "RECEIVING":
1061
1061
  return [
1062
- ...v.ableToMarkReceived(N) ? [je[q.enum.completeReceive]] : [],
1062
+ ...p.ableToMarkReceived(R) ? [je[V.enum.completeReceive]] : [],
1063
1063
  Pe[Se.Details],
1064
1064
  Pe[Se.Print],
1065
- ...S.value,
1066
- ...w.value
1065
+ ...k.value,
1066
+ ...$.value
1067
1067
  ];
1068
1068
  case "PENDING_APPROVAL": {
1069
- const I = [Pe[Se.Details]];
1070
- return n.value && I.push(
1069
+ const P = [Pe[Se.Details]];
1070
+ return o.value && P.push(
1071
1071
  Pe[Se.Update],
1072
- je[q.enum.approveDraft],
1073
- je[q.enum.rejectDraft]
1074
- ), I;
1072
+ je[V.enum.approveDraft],
1073
+ je[V.enum.rejectDraft]
1074
+ ), P;
1075
1075
  }
1076
1076
  case "REQUESTING":
1077
1077
  return b === "receive/request" ? [
1078
1078
  Pe[Se.Details],
1079
1079
  Pe[Se.Print],
1080
- ...S.value
1080
+ ...k.value
1081
1081
  ] : [
1082
- je[q.enum.approveRequest],
1083
- je[q.enum.rejectRequest],
1082
+ je[V.enum.approveRequest],
1083
+ je[V.enum.rejectRequest],
1084
1084
  Pe[Se.Details]
1085
1085
  // DefaultRowActions[RowActionEnum.Print]
1086
1086
  ];
@@ -1088,7 +1088,7 @@ function Kl(b, s, o) {
1088
1088
  return [
1089
1089
  Pe[Se.Details],
1090
1090
  Pe[Se.Print],
1091
- ...S.value
1091
+ ...k.value
1092
1092
  ];
1093
1093
  case "COMPLETE":
1094
1094
  case "CANCEL":
@@ -1096,57 +1096,57 @@ function Kl(b, s, o) {
1096
1096
  return [
1097
1097
  Pe[Se.Details],
1098
1098
  Pe[Se.Print],
1099
- ...S.value
1099
+ ...k.value
1100
1100
  ];
1101
1101
  }
1102
1102
  }
1103
- function D(N) {
1104
- return Object.values(q.enum).includes(N);
1103
+ function T(R) {
1104
+ return Object.values(V.enum).includes(R);
1105
1105
  }
1106
- async function $(N, ne, I) {
1107
- var K, T, J, be, ye, pe, fe;
1108
- const R = Yt(ne);
1109
- if (N === Se.Print || N === Se.PrintCustom) {
1110
- const p = (I == null ? void 0 : I.toInventoryLocation) ?? c.currentLocation;
1111
- if (p.type === "restaurant") {
1112
- const k = c.locationRestaurantFromCore(p.doc._id);
1113
- k !== null && (p.doc = k);
1106
+ async function S(R, ne, P) {
1107
+ var K, N, X, be, ye, pe, fe;
1108
+ const C = Yt(ne);
1109
+ if (R === Se.Print || R === Se.PrintCustom) {
1110
+ const f = (P == null ? void 0 : P.toInventoryLocation) ?? c.currentLocation;
1111
+ if (f.type === "restaurant") {
1112
+ const O = c.locationRestaurantFromCore(f.doc._id);
1113
+ O !== null && (f.doc = O);
1114
1114
  }
1115
- ((K = I == null ? void 0 : I.netSuite) != null && K.refNo || (T = R.netSuite) != null && T.refNo) && (R.ref = [((J = I == null ? void 0 : I.netSuite) == null ? void 0 : J.refNo) || ((be = R.netSuite) == null ? void 0 : be.refNo)].filter((k) => k).join(" "));
1115
+ ((K = P == null ? void 0 : P.netSuite) != null && K.refNo || (N = C.netSuite) != null && N.refNo) && (C.ref = [((X = P == null ? void 0 : P.netSuite) == null ? void 0 : X.refNo) || ((be = C.netSuite) == null ? void 0 : be.refNo)].filter((O) => O).join(" "));
1116
1116
  const i = {
1117
- po: R,
1118
- currentLocation: p,
1119
- business: u.currentBusiness.value,
1117
+ po: C,
1118
+ currentLocation: f,
1119
+ business: d.currentBusiness.value,
1120
1120
  fulfilling: b === "approval",
1121
- por: I
1121
+ por: P
1122
1122
  };
1123
- if (N === Se.PrintCustom) {
1124
- const k = ts(i);
1125
- k && (ce.value = k.html, ge.value = k.templateName, H.value = k.isDefault, z.value = !0);
1123
+ if (R === Se.PrintCustom) {
1124
+ const O = ts(i);
1125
+ O && (ae.value = O.html, ge.value = O.templateName, H.value = O.isDefault, z.value = !0);
1126
1126
  } else
1127
1127
  cr(i);
1128
1128
  return;
1129
1129
  }
1130
- if (N === Se.Details) {
1131
- s.promptShowTransferDetails(R, I);
1130
+ if (R === Se.Details) {
1131
+ s.promptShowTransferDetails(C, P);
1132
1132
  return;
1133
1133
  }
1134
- if (N === Se.Update) {
1135
- (ye = s.promptUpdateTransferDialog) == null || ye.call(s, R);
1134
+ if (R === Se.Update) {
1135
+ (ye = s.promptUpdateTransferDialog) == null || ye.call(s, C);
1136
1136
  return;
1137
1137
  }
1138
- if (N === Se.Email) {
1139
- (pe = s.promptEmailDialog) == null || pe.call(s, R);
1138
+ if (R === Se.Email) {
1139
+ (pe = s.promptEmailDialog) == null || pe.call(s, C);
1140
1140
  return;
1141
1141
  }
1142
- if (D(N)) {
1143
- s.submitAction(ne, N, (fe = I == null ? void 0 : I.to) == null ? void 0 : fe.dbName);
1142
+ if (T(R)) {
1143
+ s.submitAction(ne, R, (fe = P == null ? void 0 : P.to) == null ? void 0 : fe.dbName);
1144
1144
  return;
1145
1145
  }
1146
1146
  }
1147
- function M() {
1147
+ function F() {
1148
1148
  var ne;
1149
- const N = [
1149
+ const R = [
1150
1150
  {
1151
1151
  accessorKey: "seqNumber",
1152
1152
  header: () => t("inventory.transfer.table.seqNo"),
@@ -1157,8 +1157,8 @@ function Kl(b, s, o) {
1157
1157
  {
1158
1158
  accessorKey: "_id",
1159
1159
  header: () => t("inventory.transfer.table.createdAt"),
1160
- cell(I) {
1161
- return st(`${I.getValue()}`);
1160
+ cell(P) {
1161
+ return st(`${P.getValue()}`);
1162
1162
  },
1163
1163
  enableSorting: !0
1164
1164
  },
@@ -1171,11 +1171,11 @@ function Kl(b, s, o) {
1171
1171
  {
1172
1172
  accessorKey: "items.length",
1173
1173
  header: () => t("inventory.transfer.table.noOfItems"),
1174
- cell: (I) => {
1175
- const R = I.row.original.version || "1", K = I.getValue();
1174
+ cell: (P) => {
1175
+ const C = P.row.original.version || "1", K = P.getValue();
1176
1176
  return Y("div", { class: "flex items-center gap-2" }, [
1177
1177
  K,
1178
- R !== "1" ? Y(
1178
+ C !== "1" ? Y(
1179
1179
  "div",
1180
1180
  { class: "py-3" },
1181
1181
  Y(
@@ -1185,7 +1185,7 @@ function Kl(b, s, o) {
1185
1185
  {
1186
1186
  class: ["fm-status-badge", "fm-status-badge-draft"].join(" ")
1187
1187
  },
1188
- `v${R}`
1188
+ `v${C}`
1189
1189
  )
1190
1190
  )
1191
1191
  ) : null
@@ -1202,12 +1202,12 @@ function Kl(b, s, o) {
1202
1202
  enableSorting: !1,
1203
1203
  size: "auto"
1204
1204
  },
1205
- ...(ne = u.sessionUser.value) != null && ne.role.isAdmin ? [
1205
+ ...(ne = d.sessionUser.value) != null && ne.role.isAdmin ? [
1206
1206
  {
1207
1207
  id: "statusForAdmin",
1208
1208
  header: () => Y(We, {}, () => `${t("inventory.transfer.table.status")}`),
1209
- cell(I) {
1210
- return I.row.original.status;
1209
+ cell(P) {
1210
+ return P.row.original.status;
1211
1211
  },
1212
1212
  enableSorting: !0,
1213
1213
  size: 200
@@ -1216,17 +1216,17 @@ function Kl(b, s, o) {
1216
1216
  {
1217
1217
  accessorKey: "status",
1218
1218
  header: () => t("inventory.transfer.table.status"),
1219
- cell(I) {
1220
- const R = I.getValue(), K = ct(I.row.original), { partial: T, over: J } = _t(K), be = St(R ?? "", T, J);
1221
- let ye = t(`inventory.transfer.status.${be}`), pe = `${R ?? ""}`.toLocaleLowerCase("en-us");
1219
+ cell(P) {
1220
+ const C = P.getValue(), K = ct(P.row.original), { partial: N, over: X } = _t(K), be = St(C ?? "", N, X);
1221
+ let ye = t(`inventory.transfer.status.${be}`), pe = `${C ?? ""}`.toLocaleLowerCase("en-us");
1222
1222
  be === ve.enum.CLOSE && (ye = `${t(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), be === "PARTIAL_RECEIVED" && pe === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (pe = ve.enum.RECEIVING.toLocaleLowerCase("en-us"));
1223
1223
  let fe = null;
1224
- const p = o.value.find((i) => i.ref === I.row.original._id);
1225
- if (p != null && p.milestones && p.milestones.length > 0) {
1226
- const i = p.milestones[p.milestones.length - 1];
1224
+ const f = n.value.find((i) => i.ref === P.row.original._id);
1225
+ if (f != null && f.milestones && f.milestones.length > 0) {
1226
+ const i = f.milestones[f.milestones.length - 1];
1227
1227
  if (i.estimatedTime) {
1228
- const k = new Date(i.estimatedTime), U = k.getDate().toString().padStart(2, "0");
1229
- fe = `${k.toLocaleString("en-US", { month: "short" })} ${U}`;
1228
+ const O = new Date(i.estimatedTime), M = O.getDate().toString().padStart(2, "0");
1229
+ fe = `${O.toLocaleString("en-US", { month: "short" })} ${M}`;
1230
1230
  }
1231
1231
  }
1232
1232
  return Y(
@@ -1244,7 +1244,7 @@ function Kl(b, s, o) {
1244
1244
  class: [
1245
1245
  "fm-status-badge",
1246
1246
  `fm-status-badge-${pe}`,
1247
- J && "fm-status-badge-error"
1247
+ X && "fm-status-badge-error"
1248
1248
  ].filter(Boolean).join(" ")
1249
1249
  },
1250
1250
  `${ye}`
@@ -1278,9 +1278,9 @@ function Kl(b, s, o) {
1278
1278
  },
1279
1279
  {
1280
1280
  id: "action",
1281
- cell(I) {
1282
- const R = I.row.original, K = C(R);
1283
- return Lt(K, (T) => $(T, R));
1281
+ cell(P) {
1282
+ const C = P.row.original, K = D(C);
1283
+ return Lt(K, (N) => S(N, C));
1284
1284
  },
1285
1285
  enableSorting: !1,
1286
1286
  size: 40,
@@ -1290,19 +1290,19 @@ function Kl(b, s, o) {
1290
1290
  }
1291
1291
  }
1292
1292
  ];
1293
- if (f.isEnabled) {
1294
- const I = [
1293
+ if (v.isEnabled) {
1294
+ const P = [
1295
1295
  {
1296
1296
  id: "netsuiteTransferOrder",
1297
- accessorFn: (R) => {
1297
+ accessorFn: (C) => {
1298
1298
  var K;
1299
- return (K = R.netSuite) != null && K.id ? `${R.netSuite.refNo} (${R.netSuite.id})` : "N/A";
1299
+ return (K = C.netSuite) != null && K.id ? `${C.netSuite.refNo} (${C.netSuite.id})` : "N/A";
1300
1300
  },
1301
1301
  header: () => "NetSuite Order (ID)",
1302
- cell(R) {
1303
- var T;
1304
- const K = R.row.original;
1305
- return (T = K.netSuite) != null && T.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
1302
+ cell(C) {
1303
+ var N;
1304
+ const K = C.row.original;
1305
+ return (N = K.netSuite) != null && N.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
1306
1306
  },
1307
1307
  enableSorting: !1,
1308
1308
  size: 200,
@@ -1313,14 +1313,14 @@ function Kl(b, s, o) {
1313
1313
  },
1314
1314
  {
1315
1315
  id: "netsuiteTransactionNumber",
1316
- accessorFn: (R) => {
1317
- var K, T;
1318
- return ((T = (K = R.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : T.transactionnumber) ?? "N/A";
1316
+ accessorFn: (C) => {
1317
+ var K, N;
1318
+ return ((N = (K = C.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
1319
1319
  },
1320
1320
  header: () => "NetSuite Transaction No.",
1321
- cell(R) {
1322
- var T, J;
1323
- return ((J = (T = R.row.original.netSuite) == null ? void 0 : T.additionalInfo) == null ? void 0 : J.transactionnumber) ?? "N/A";
1321
+ cell(C) {
1322
+ var N, X;
1323
+ return ((X = (N = C.row.original.netSuite) == null ? void 0 : N.additionalInfo) == null ? void 0 : X.transactionnumber) ?? "N/A";
1324
1324
  },
1325
1325
  enableSorting: !1,
1326
1326
  size: 200,
@@ -1330,13 +1330,13 @@ function Kl(b, s, o) {
1330
1330
  }
1331
1331
  }
1332
1332
  ];
1333
- N.splice(N.length - 1, 0, ...I);
1333
+ R.splice(R.length - 1, 0, ...P);
1334
1334
  }
1335
- return N;
1335
+ return R;
1336
1336
  }
1337
- function A() {
1337
+ function E() {
1338
1338
  var ne;
1339
- const N = [
1339
+ const R = [
1340
1340
  {
1341
1341
  accessorKey: "purchaseOrder.seqNumber",
1342
1342
  header: () => t("inventory.transfer.table.seqNo"),
@@ -1347,8 +1347,8 @@ function Kl(b, s, o) {
1347
1347
  {
1348
1348
  accessorKey: "purchaseOrder._id",
1349
1349
  header: () => t("inventory.transfer.table.createdAt"),
1350
- cell(I) {
1351
- return st(`${I.getValue()}`);
1350
+ cell(P) {
1351
+ return st(`${P.getValue()}`);
1352
1352
  },
1353
1353
  enableSorting: !0
1354
1354
  },
@@ -1369,12 +1369,12 @@ function Kl(b, s, o) {
1369
1369
  enableSorting: !1,
1370
1370
  size: "auto"
1371
1371
  },
1372
- ...(ne = u.sessionUser.value) != null && ne.role.isAdmin ? [
1372
+ ...(ne = d.sessionUser.value) != null && ne.role.isAdmin ? [
1373
1373
  {
1374
1374
  id: "statusForAdmin",
1375
1375
  header: () => Y(We, {}, () => `${t("inventory.transfer.table.status")}`),
1376
- cell(I) {
1377
- return I.row.original.status;
1376
+ cell(P) {
1377
+ return P.row.original.status;
1378
1378
  },
1379
1379
  enableSorting: !0,
1380
1380
  size: 200
@@ -1383,16 +1383,16 @@ function Kl(b, s, o) {
1383
1383
  {
1384
1384
  accessorKey: "purchaseOrder.status",
1385
1385
  header: () => t("inventory.transfer.table.status"),
1386
- cell(I) {
1387
- const R = I.row.original, K = I.getValue();
1388
- if (!R.purchaseOrder)
1386
+ cell(P) {
1387
+ const C = P.row.original, K = P.getValue();
1388
+ if (!C.purchaseOrder)
1389
1389
  return Y(lt.FmChip, {
1390
1390
  label: "N/A",
1391
1391
  compact: !0
1392
1392
  });
1393
- const T = ct(R.purchaseOrder), { partial: J, over: be } = _t(T), ye = St(K ?? "", J, be);
1393
+ const N = ct(C.purchaseOrder), { partial: X, over: be } = _t(N), ye = St(K ?? "", X, be);
1394
1394
  let pe = t(`inventory.transfer.status.${ye}`), fe = `${K ?? ""}`.toLocaleLowerCase("en-us");
1395
- return ye === ve.enum.CLOSE && (pe = `${t(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), ye === "PARTIAL_RECEIVED" && fe === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (fe = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), R.rejectedAt && (pe = t("inventory.transfer.status.REJECT"), fe = ve.enum.REJECT.toLocaleLowerCase("en-us")), Y(
1395
+ return ye === ve.enum.CLOSE && (pe = `${t(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), ye === "PARTIAL_RECEIVED" && fe === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (fe = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), C.rejectedAt && (pe = t("inventory.transfer.status.REJECT"), fe = ve.enum.REJECT.toLocaleLowerCase("en-us")), Y(
1396
1396
  "div",
1397
1397
  {
1398
1398
  class: "flex"
@@ -1414,14 +1414,14 @@ function Kl(b, s, o) {
1414
1414
  },
1415
1415
  {
1416
1416
  id: "action",
1417
- cell(I) {
1418
- const R = I.row.original, T = (R.purchaseOrder ? C(R.purchaseOrder) : []).map((J) => J.value === Se.Print ? {
1419
- ...J,
1417
+ cell(P) {
1418
+ const C = P.row.original, N = (C.purchaseOrder ? D(C.purchaseOrder) : []).map((X) => X.value === Se.Print ? {
1419
+ ...X,
1420
1420
  translationKey: "inventory.transfer.receiveRequest.details.printDeliveryOrder"
1421
- } : J);
1421
+ } : X);
1422
1422
  return Lt(
1423
- T,
1424
- (J) => R.purchaseOrder ? $(J, R.purchaseOrder, R) : void 0
1423
+ N,
1424
+ (X) => C.purchaseOrder ? S(X, C.purchaseOrder, C) : void 0
1425
1425
  );
1426
1426
  },
1427
1427
  enableSorting: !1,
@@ -1432,19 +1432,19 @@ function Kl(b, s, o) {
1432
1432
  }
1433
1433
  }
1434
1434
  ];
1435
- if (f.isEnabled) {
1436
- const I = [
1435
+ if (v.isEnabled) {
1436
+ const P = [
1437
1437
  {
1438
1438
  id: "netsuiteTransferOrder",
1439
- accessorFn: (R) => {
1439
+ accessorFn: (C) => {
1440
1440
  var K;
1441
- return (K = R.netSuite) != null && K.id ? `${R.netSuite.refNo} (${R.netSuite.id})` : "N/A";
1441
+ return (K = C.netSuite) != null && K.id ? `${C.netSuite.refNo} (${C.netSuite.id})` : "N/A";
1442
1442
  },
1443
1443
  header: () => "NetSuite Order (ID)",
1444
- cell(R) {
1445
- var T;
1446
- const K = R.row.original;
1447
- return (T = K.netSuite) != null && T.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
1444
+ cell(C) {
1445
+ var N;
1446
+ const K = C.row.original;
1447
+ return (N = K.netSuite) != null && N.id ? `${K.netSuite.refNo} (${K.netSuite.id})` : "N/A";
1448
1448
  },
1449
1449
  enableSorting: !1,
1450
1450
  size: 200,
@@ -1455,14 +1455,14 @@ function Kl(b, s, o) {
1455
1455
  },
1456
1456
  {
1457
1457
  id: "netsuiteTransactionNumber",
1458
- accessorFn: (R) => {
1459
- var K, T;
1460
- return ((T = (K = R.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : T.transactionnumber) ?? "N/A";
1458
+ accessorFn: (C) => {
1459
+ var K, N;
1460
+ return ((N = (K = C.netSuite) == null ? void 0 : K.additionalInfo) == null ? void 0 : N.transactionnumber) ?? "N/A";
1461
1461
  },
1462
1462
  header: () => "NetSuite Transaction No.",
1463
- cell(R) {
1464
- var T, J;
1465
- return ((J = (T = R.row.original.netSuite) == null ? void 0 : T.additionalInfo) == null ? void 0 : J.transactionnumber) ?? "N/A";
1463
+ cell(C) {
1464
+ var N, X;
1465
+ return ((X = (N = C.row.original.netSuite) == null ? void 0 : N.additionalInfo) == null ? void 0 : X.transactionnumber) ?? "N/A";
1466
1466
  },
1467
1467
  enableSorting: !1,
1468
1468
  size: 200,
@@ -1472,15 +1472,15 @@ function Kl(b, s, o) {
1472
1472
  }
1473
1473
  }
1474
1474
  ];
1475
- N.splice(N.length - 2, 0, ...I);
1475
+ R.splice(R.length - 2, 0, ...P);
1476
1476
  }
1477
- return N;
1477
+ return R;
1478
1478
  }
1479
- const Z = j(() => b === "receive/request" ? M() : A()), z = X(!1), ce = X(""), ge = X(""), H = X(!1);
1479
+ const J = j(() => b === "receive/request" ? F() : E()), z = Z(!1), ae = Z(""), ge = Z(""), H = Z(!1);
1480
1480
  return {
1481
- columnDefs: Z,
1481
+ columnDefs: J,
1482
1482
  showCustomPrintDialog: z,
1483
- customPrintHtml: ce,
1483
+ customPrintHtml: ae,
1484
1484
  customPrintTemplateName: ge,
1485
1485
  customPrintIsDefault: H
1486
1486
  };
@@ -1493,43 +1493,43 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1493
1493
  },
1494
1494
  emits: ["update:show"],
1495
1495
  setup(b, { emit: s }) {
1496
- const o = b, c = gs({
1496
+ const n = b, c = gs({
1497
1497
  id: "",
1498
1498
  createdAt: (/* @__PURE__ */ new Date()).toISOString(),
1499
1499
  items: []
1500
- }), f = X(), u = s;
1500
+ }), v = Z(), d = s, p = (o) => o != null && o !== "";
1501
1501
  Wt(() => {
1502
- o.purchaseOrder && (c.items = o.purchaseOrder.items.map((t) => ({
1503
- id: t.id,
1504
- sku: t.sku,
1505
- measurement: t.measurement,
1506
- amount: t.quantity ?? { amount: 1, precision: 0 }
1502
+ n.purchaseOrder && (c.items = n.purchaseOrder.items.map((o) => ({
1503
+ id: o.id,
1504
+ sku: o.sku,
1505
+ measurement: o.measurement,
1506
+ amount: o.quantity ?? { amount: 1, precision: 0 }
1507
1507
  })));
1508
1508
  });
1509
- const v = j(() => c.items.length <= 10);
1510
- return (t, n) => {
1511
- const d = re("FmTable"), S = re("FmButton"), w = re("FmForm");
1512
- return l(), me(w, {
1509
+ const t = j(() => c.items.length <= 10);
1510
+ return (o, u) => {
1511
+ const k = re("FmTable"), $ = re("FmButton"), D = re("FmForm");
1512
+ return l(), me(D, {
1513
1513
  ref_key: "formRef",
1514
- ref: f,
1514
+ ref: v,
1515
1515
  class: "bg-white flex flex-col gap-32 rounded-3xl p-24 w-[800px]",
1516
1516
  onValidationFailed: console.log,
1517
- onValidationSuccess: n[1] || (n[1] = () => o.confirm(c))
1517
+ onValidationSuccess: u[1] || (u[1] = () => n.confirm(c))
1518
1518
  }, {
1519
- default: ie(() => [
1520
- n[2] || (n[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
1519
+ default: ce(() => [
1520
+ u[2] || (u[2] = e("div", { class: "fm-typo-en-title-sm-600" }, "Confirm the transfer amount", -1)),
1521
1521
  e("div", ur, [
1522
1522
  e("div", dr, [
1523
- V(d, {
1523
+ L(k, {
1524
1524
  "column-defs": [
1525
1525
  {
1526
1526
  header: "Code",
1527
- cell: (C) => {
1528
- const D = o.purchaseOrder.items.find(($) => $.id === C.row.original.id || $.sku._id === C.row.original.sku._id);
1527
+ cell: (T) => {
1528
+ const S = n.purchaseOrder.items.find((F) => p(T.row.original.id) ? F.id === T.row.original.id : F.sku._id === T.row.original.sku._id);
1529
1529
  return Y(
1530
1530
  _(lt).FmTooltip,
1531
1531
  {
1532
- content: D.code,
1532
+ content: S.code,
1533
1533
  placement: "top",
1534
1534
  variant: "plain",
1535
1535
  zIndex: 50
@@ -1539,19 +1539,19 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1539
1539
  {
1540
1540
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
1541
1541
  },
1542
- D.code
1542
+ S.code
1543
1543
  )
1544
1544
  );
1545
1545
  }
1546
1546
  },
1547
1547
  {
1548
1548
  header: "Name",
1549
- cell: (C) => {
1550
- const D = o.purchaseOrder.items.find(($) => $.id === C.row.original.id || $.sku._id === C.row.original.sku._id);
1549
+ cell: (T) => {
1550
+ const S = n.purchaseOrder.items.find((F) => p(T.row.original.id) ? F.id === T.row.original.id : F.sku._id === T.row.original.sku._id);
1551
1551
  return Y(
1552
1552
  _(lt).FmTooltip,
1553
1553
  {
1554
- content: D.name,
1554
+ content: S.name,
1555
1555
  placement: "top",
1556
1556
  variant: "plain",
1557
1557
  zIndex: 50
@@ -1561,15 +1561,15 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1561
1561
  {
1562
1562
  class: "flex-auto line-clamp-2 text-ellipsis break-all"
1563
1563
  },
1564
- D.name
1564
+ S.name
1565
1565
  )
1566
1566
  );
1567
1567
  }
1568
1568
  },
1569
1569
  {
1570
1570
  header: "Amount",
1571
- cell: (C) => {
1572
- const D = C.row.original, $ = o.purchaseOrder.items.find((A) => A.id === D.id || A.sku._id === D.sku._id), M = D.amount ?? {
1571
+ cell: (T) => {
1572
+ const S = T.row.original, F = n.purchaseOrder.items.find((J) => p(S.id) ? J.id === S.id : J.sku._id === S.sku._id), E = S.amount ?? {
1573
1573
  amount: 1,
1574
1574
  precision: 0
1575
1575
  };
@@ -1578,22 +1578,22 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1578
1578
  flex: "1 1 0%"
1579
1579
  },
1580
1580
  modelValue: {
1581
- amount: M,
1582
- measurement: D.measurement ?? null
1581
+ amount: E,
1582
+ measurement: S.measurement ?? null
1583
1583
  },
1584
- key: D.id ?? D.sku._id,
1585
- unit: D.sku.unit,
1586
- "onUpdate:modelValue": (A) => {
1587
- if (!A) return;
1588
- const Z = c.items.find((z) => z.id === D.id || z.sku._id === D.sku._id);
1589
- Z && (Z.amount = A.amount);
1584
+ key: p(S.id) ? S.id : S.sku._id,
1585
+ unit: S.sku.unit,
1586
+ "onUpdate:modelValue": (J) => {
1587
+ if (!J) return;
1588
+ const z = c.items.find((ae) => p(S.id) ? ae.id === S.id : ae.sku._id === S.sku._id);
1589
+ z && (z.amount = J.amount);
1590
1590
  },
1591
1591
  disableUnit: !0,
1592
1592
  rules: [
1593
1593
  _(Bs)(
1594
1594
  +_(xe)({ amount: 0, precision: 0 })
1595
1595
  ),
1596
- _(zs)(+_(xe)($.quantity))
1596
+ _(zs)(+_(xe)(F.quantity))
1597
1597
  ],
1598
1598
  applyDefaultRules: !0
1599
1599
  });
@@ -1601,24 +1601,24 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1601
1601
  }
1602
1602
  ],
1603
1603
  "row-data": c.items,
1604
- "hide-footer": v.value
1604
+ "hide-footer": t.value
1605
1605
  }, null, 8, ["column-defs", "row-data", "hide-footer"])
1606
1606
  ])
1607
1607
  ]),
1608
1608
  e("div", mr, [
1609
- V(S, {
1609
+ L($, {
1610
1610
  class: "px-16",
1611
1611
  label: "Confirm",
1612
1612
  size: "md",
1613
1613
  variant: "primary",
1614
1614
  type: "submit"
1615
1615
  }),
1616
- V(S, {
1616
+ L($, {
1617
1617
  class: "px-16",
1618
1618
  label: "Cancel",
1619
1619
  size: "md",
1620
1620
  variant: "secondary",
1621
- onClick: n[0] || (n[0] = () => u("update:show", !1))
1621
+ onClick: u[0] || (u[0] = () => d("update:show", !1))
1622
1622
  })
1623
1623
  ])
1624
1624
  ]),
@@ -1699,16 +1699,16 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1699
1699
  scope: {}
1700
1700
  },
1701
1701
  setup(b) {
1702
- const s = b, o = pt(), c = Qe(), f = ft(), u = X(!1);
1702
+ const s = b, n = pt(), c = Qe(), v = ft(), d = Z(!1);
1703
1703
  j(() => {
1704
- var S, w, C, D;
1704
+ var k, $, D, T;
1705
1705
  let t = !0;
1706
- o.isEnabled || (t = !1);
1707
- const n = s.purchaseOrder, d = s.poRequest;
1708
- return n && ((S = n == null ? void 0 : n.supplier) != null && S.internal ? (!d && n.status == ve.enum.DRAFT && (t = !1), d && !((w = d == null ? void 0 : d.netSuite) != null && w.id) && (t = !1), s.isTransferBetweenOutlets && (t = !1)) : ((n == null ? void 0 : n.status) !== ve.enum.REQUESTING && n.supplier.internal && (t = !1), !d && !((C = n == null ? void 0 : n.netSuite) != null && C.id) && (t = !1), !d && ((D = n == null ? void 0 : n.netSuite) != null && D.id) && (n == null ? void 0 : n.status) == ve.enum.REQUESTING && (t = !1))), t;
1706
+ n.isEnabled || (t = !1);
1707
+ const o = s.purchaseOrder, u = s.poRequest;
1708
+ return o && ((k = o == null ? void 0 : o.supplier) != null && k.internal ? (!u && o.status == ve.enum.DRAFT && (t = !1), u && !(($ = u == null ? void 0 : u.netSuite) != null && $.id) && (t = !1), s.isTransferBetweenOutlets && (t = !1)) : ((o == null ? void 0 : o.status) !== ve.enum.REQUESTING && o.supplier.internal && (t = !1), !u && !((D = o == null ? void 0 : o.netSuite) != null && D.id) && (t = !1), !u && ((T = o == null ? void 0 : o.netSuite) != null && T.id) && (o == null ? void 0 : o.status) == ve.enum.REQUESTING && (t = !1))), t;
1709
1709
  });
1710
- async function v() {
1711
- u.value || f.open({
1710
+ async function p() {
1711
+ d.value || v.open({
1712
1712
  title: "Sync with NetSuite",
1713
1713
  contentComponent: Y("div", [
1714
1714
  Y("p", "Are you sure you want to sync now?"),
@@ -1726,37 +1726,37 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1726
1726
  },
1727
1727
  secondaryActions: { text: "Not now", close: !0 }
1728
1728
  }).onPrimary(async () => {
1729
- var t, n, d, S, w, C, D;
1729
+ var t, o, u, k, $, D, T;
1730
1730
  try {
1731
- u.value = !0;
1732
- const $ = ((t = s.purchaseOrder) == null ? void 0 : t._id) || ((n = s.poRequest) == null ? void 0 : n.purchaseOrderId) || "", M = (d = s.poRequest) == null ? void 0 : d.to.dbName;
1733
- await o.syncPurchaseOrder({
1734
- purchaseOrderId: $,
1735
- locationId: s.scope === "approval" ? M : void 0,
1736
- netsuiteId: ((w = (S = s.purchaseOrder) == null ? void 0 : S.netSuite) == null ? void 0 : w.id) || ((D = (C = s.poRequest) == null ? void 0 : C.netSuite) == null ? void 0 : D.id)
1731
+ d.value = !0;
1732
+ const S = ((t = s.purchaseOrder) == null ? void 0 : t._id) || ((o = s.poRequest) == null ? void 0 : o.purchaseOrderId) || "", F = (u = s.poRequest) == null ? void 0 : u.to.dbName;
1733
+ await n.syncPurchaseOrder({
1734
+ purchaseOrderId: S,
1735
+ locationId: s.scope === "approval" ? F : void 0,
1736
+ netsuiteId: (($ = (k = s.purchaseOrder) == null ? void 0 : k.netSuite) == null ? void 0 : $.id) || ((T = (D = s.poRequest) == null ? void 0 : D.netSuite) == null ? void 0 : T.id)
1737
1737
  }), c.open({
1738
1738
  title: "Sync with NetSuite",
1739
1739
  message: "Requested to sync with NetSuite. Please wait a moment.",
1740
1740
  type: "success"
1741
- }), await new Promise((A) => setTimeout(A, 5e3)), u.value = !1;
1742
- } catch ($) {
1743
- console.log("Failed to sync with NetSuite", $), c.open({
1741
+ }), await new Promise((E) => setTimeout(E, 5e3)), d.value = !1;
1742
+ } catch (S) {
1743
+ console.log("Failed to sync with NetSuite", S), c.open({
1744
1744
  title: "Error",
1745
1745
  message: "Failed to sync with NetSuite",
1746
1746
  type: "error"
1747
- }), u.value = !1;
1747
+ }), d.value = !1;
1748
1748
  }
1749
1749
  });
1750
1750
  }
1751
- return (t, n) => {
1752
- const d = re("FmButton");
1751
+ return (t, o) => {
1752
+ const u = re("FmButton");
1753
1753
  return l(), h("div", fr, [
1754
- V(d, {
1754
+ L(u, {
1755
1755
  "prepend-icon": "sync",
1756
1756
  variant: "secondary",
1757
1757
  label: "Sync",
1758
- loading: u.value,
1759
- onClick: v,
1758
+ loading: d.value,
1759
+ onClick: p,
1760
1760
  "text-color": "primary",
1761
1761
  "bg-color": "transparent",
1762
1762
  "border-color": "primary"
@@ -1790,59 +1790,59 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1790
1790
  scope: {}
1791
1791
  },
1792
1792
  setup(b) {
1793
- const s = b, o = pt(), c = Ye(), f = X(s.poRequest);
1793
+ const s = b, n = pt(), c = Ye(), v = Z(s.poRequest);
1794
1794
  Wt(async () => {
1795
- var n;
1796
- if (!s.poRequest && ((n = s.purchaseOrder) != null && n._id)) {
1797
- const d = await c.getLatestPurchaseOrderRequest(s.purchaseOrder._id);
1798
- f.value = d;
1795
+ var o;
1796
+ if (!s.poRequest && ((o = s.purchaseOrder) != null && o._id)) {
1797
+ const u = await c.getLatestPurchaseOrderRequest(s.purchaseOrder._id);
1798
+ v.value = u;
1799
1799
  }
1800
1800
  });
1801
- const u = j(
1801
+ const d = j(
1802
1802
  () => {
1803
- var n, d, S, w, C, D;
1804
- return o.getSubsidiaryFullName(
1805
- ((S = (d = (n = s.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : d.subsidiary) == null ? void 0 : S.id) || ((D = (C = (w = s.poRequest) == null ? void 0 : w.netSuite) == null ? void 0 : C.subsidiary) == null ? void 0 : D.id)
1803
+ var o, u, k, $, D, T;
1804
+ return n.getSubsidiaryFullName(
1805
+ ((k = (u = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) == null ? void 0 : u.subsidiary) == null ? void 0 : k.id) || ((T = (D = ($ = s.poRequest) == null ? void 0 : $.netSuite) == null ? void 0 : D.subsidiary) == null ? void 0 : T.id)
1806
1806
  ).fullName;
1807
1807
  }
1808
- ), v = j(() => {
1809
- var n, d, S, w, C, D, $, M, A, Z, z, ce;
1810
- return (S = (d = (n = s.purchaseOrder) == null ? void 0 : n.netSuite) == null ? void 0 : d.additionalInfo) != null && S.transactionnumber ? (D = (C = (w = s.purchaseOrder) == null ? void 0 : w.netSuite) == null ? void 0 : C.additionalInfo) == null ? void 0 : D.transactionnumber : (A = (M = ($ = f.value) == null ? void 0 : $.netSuite) == null ? void 0 : M.additionalInfo) != null && A.transactionnumber ? (ce = (z = (Z = f.value) == null ? void 0 : Z.netSuite) == null ? void 0 : z.additionalInfo) == null ? void 0 : ce.transactionnumber : null;
1808
+ ), p = j(() => {
1809
+ var o, u, k, $, D, T, S, F, E, J, z, ae;
1810
+ return (k = (u = (o = s.purchaseOrder) == null ? void 0 : o.netSuite) == null ? void 0 : u.additionalInfo) != null && k.transactionnumber ? (T = (D = ($ = s.purchaseOrder) == null ? void 0 : $.netSuite) == null ? void 0 : D.additionalInfo) == null ? void 0 : T.transactionnumber : (E = (F = (S = v.value) == null ? void 0 : S.netSuite) == null ? void 0 : F.additionalInfo) != null && E.transactionnumber ? (ae = (z = (J = v.value) == null ? void 0 : J.netSuite) == null ? void 0 : z.additionalInfo) == null ? void 0 : ae.transactionnumber : null;
1811
1811
  }), t = j(() => {
1812
- var n, d, S, w, C, D;
1813
- return (d = (n = s.purchaseOrder) == null ? void 0 : n.deliveryFullfillment) != null && d.length && ((w = (S = s.purchaseOrder) == null ? void 0 : S.deliveryFullfillment) == null ? void 0 : w.length) > 0 ? (D = (C = s.purchaseOrder) == null ? void 0 : C.deliveryFullfillment) == null ? void 0 : D.map(($) => {
1814
- var M;
1815
- return (M = $.netSuite) == null ? void 0 : M.refNo;
1812
+ var o, u, k, $, D, T;
1813
+ return (u = (o = s.purchaseOrder) == null ? void 0 : o.deliveryFullfillment) != null && u.length && (($ = (k = s.purchaseOrder) == null ? void 0 : k.deliveryFullfillment) == null ? void 0 : $.length) > 0 ? (T = (D = s.purchaseOrder) == null ? void 0 : D.deliveryFullfillment) == null ? void 0 : T.map((S) => {
1814
+ var F;
1815
+ return (F = S.netSuite) == null ? void 0 : F.refNo;
1816
1816
  }).join(", ") : "N/A";
1817
1817
  });
1818
- return (n, d) => {
1819
- var S, w, C, D, $, M, A, Z, z, ce, ge, H, N, ne, I, R;
1820
- return _(o).isEnabled ? (l(), h("div", yr, [
1818
+ return (o, u) => {
1819
+ var k, $, D, T, S, F, E, J, z, ae, ge, H, R, ne, P, C;
1820
+ return _(n).isEnabled ? (l(), h("div", yr, [
1821
1821
  e("div", br, [
1822
- d[0] || (d[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1823
- e("div", hr, x(u.value || "N/A"), 1)
1822
+ u[0] || (u[0] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, "NetSuite subsidiary", -1)),
1823
+ e("div", hr, x(d.value || "N/A"), 1)
1824
1824
  ]),
1825
- !n.isTransferBetweenOutlets && n.scope === _(xt).RECEIVE_REQUEST ? (l(), h("div", gr, [
1826
- e("div", _r, " NetSuite " + x((w = (S = n.purchaseOrder) == null ? void 0 : S.netSuite) != null && w.recordType ? _(Jt)((D = (C = n.purchaseOrder) == null ? void 0 : C.netSuite) == null ? void 0 : D.recordType) : n.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1825
+ !o.isTransferBetweenOutlets && o.scope === _(xt).RECEIVE_REQUEST ? (l(), h("div", gr, [
1826
+ e("div", _r, " NetSuite " + x(($ = (k = o.purchaseOrder) == null ? void 0 : k.netSuite) != null && $.recordType ? _(Jt)((T = (D = o.purchaseOrder) == null ? void 0 : D.netSuite) == null ? void 0 : T.recordType) : o.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1827
1827
  e("div", Sr, [
1828
- (M = ($ = n.purchaseOrder) == null ? void 0 : $.netSuite) != null && M.id ? (l(), h("span", xr, x((Z = (A = n.purchaseOrder) == null ? void 0 : A.netSuite) == null ? void 0 : Z.refNo) + " (" + x((ce = (z = n.purchaseOrder) == null ? void 0 : z.netSuite) == null ? void 0 : ce.id) + ") ", 1)) : (l(), h("span", kr, "N/A"))
1828
+ (F = (S = o.purchaseOrder) == null ? void 0 : S.netSuite) != null && F.id ? (l(), h("span", xr, x((J = (E = o.purchaseOrder) == null ? void 0 : E.netSuite) == null ? void 0 : J.refNo) + " (" + x((ae = (z = o.purchaseOrder) == null ? void 0 : z.netSuite) == null ? void 0 : ae.id) + ") ", 1)) : (l(), h("span", kr, "N/A"))
1829
1829
  ])
1830
- ])) : F("", !0),
1831
- !n.isTransferBetweenOutlets && f.value || n.scope === _(xt).APPROVAL ? (l(), h("div", Or, [
1832
- e("div", wr, " (Request) NetSuite " + x(n.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1830
+ ])) : I("", !0),
1831
+ !o.isTransferBetweenOutlets && v.value || o.scope === _(xt).APPROVAL ? (l(), h("div", Or, [
1832
+ e("div", wr, " (Request) NetSuite " + x(o.transferType === _(et).enum.purchase ? "Purchase Order" : "Transfer Order") + " (ID) ", 1),
1833
1833
  e("div", $r, [
1834
- (H = (ge = f.value) == null ? void 0 : ge.netSuite) != null && H.id ? (l(), h("span", Cr, x((ne = (N = f.value) == null ? void 0 : N.netSuite) == null ? void 0 : ne.refNo) + " (" + x((R = (I = f.value) == null ? void 0 : I.netSuite) == null ? void 0 : R.id) + ") ", 1)) : (l(), h("span", Dr, "N/A"))
1834
+ (H = (ge = v.value) == null ? void 0 : ge.netSuite) != null && H.id ? (l(), h("span", Cr, x((ne = (R = v.value) == null ? void 0 : R.netSuite) == null ? void 0 : ne.refNo) + " (" + x((C = (P = v.value) == null ? void 0 : P.netSuite) == null ? void 0 : C.id) + ") ", 1)) : (l(), h("span", Dr, "N/A"))
1835
1835
  ])
1836
- ])) : F("", !0),
1837
- v.value ? (l(), h("div", Rr, [
1838
- d[1] || (d[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1839
- e("div", Nr, x(v.value), 1)
1840
- ])) : F("", !0),
1841
- _(o).isEnabled && n.transferType === _(et).enum.transfer && !n.isTransferBetweenOutlets ? (l(), h("div", Ar, [
1842
- d[2] || (d[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1836
+ ])) : I("", !0),
1837
+ p.value ? (l(), h("div", Rr, [
1838
+ u[1] || (u[1] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite Transaction Number ", -1)),
1839
+ e("div", Nr, x(p.value), 1)
1840
+ ])) : I("", !0),
1841
+ _(n).isEnabled && o.transferType === _(et).enum.transfer && !o.isTransferBetweenOutlets ? (l(), h("div", Ar, [
1842
+ u[2] || (u[2] = e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " NetSuite fulfillment IDs ", -1)),
1843
1843
  e("div", Tr, x(t.value), 1)
1844
- ])) : F("", !0)
1845
- ])) : F("", !0);
1844
+ ])) : I("", !0)
1845
+ ])) : I("", !0);
1846
1846
  };
1847
1847
  }
1848
1848
  }), Ir = { class: "flex flex-row-reverse" }, Fr = /* @__PURE__ */ qe({
@@ -1852,37 +1852,37 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1852
1852
  purchaseOrderId: {}
1853
1853
  },
1854
1854
  setup(b) {
1855
- const s = Qe(), o = $t();
1856
- async function c(f, u) {
1857
- const v = [];
1858
- if (f && v.push(`body.message:*${f}*`), u) {
1859
- const S = u.replace(/:/g, "\\:");
1860
- v.push(`${S}`);
1855
+ const s = Qe(), n = $t();
1856
+ async function c(v, d) {
1857
+ const p = [];
1858
+ if (v && p.push(`body.message:*${v}*`), d) {
1859
+ const k = d.replace(/:/g, "\\:");
1860
+ p.push(`${k}`);
1861
1861
  }
1862
- if (v.length === 0) {
1862
+ if (p.length === 0) {
1863
1863
  s.open({
1864
1864
  message: "Cannot open logs without valid filters.",
1865
1865
  type: "error"
1866
1866
  });
1867
1867
  return;
1868
1868
  }
1869
- const n = `attributes.pod:netsuite* AND (${v.join(" OR ")})`, { url: d } = await o.getSyncLogs(n);
1869
+ const o = `attributes.pod:netsuite* AND (${p.join(" OR ")})`, { url: u } = await n.getSyncLogs(o);
1870
1870
  s.open(
1871
1871
  {
1872
1872
  message: "Opening NetSuite logs...",
1873
1873
  type: "info"
1874
1874
  },
1875
1875
  800
1876
- ), await new Promise((S) => setTimeout(S, 800)), window.open(d, "_blank");
1876
+ ), await new Promise((k) => setTimeout(k, 800)), window.open(u, "_blank");
1877
1877
  }
1878
- return (f, u) => {
1879
- const v = re("FmButton");
1878
+ return (v, d) => {
1879
+ const p = re("FmButton");
1880
1880
  return l(), h("div", Ir, [
1881
- V(v, {
1881
+ L(p, {
1882
1882
  "prepend-icon": "history",
1883
1883
  variant: "secondary",
1884
1884
  label: "Logs",
1885
- onClick: u[0] || (u[0] = (t) => c(f.netsuiteId, f.purchaseOrderId)),
1885
+ onClick: d[0] || (d[0] = (t) => c(v.netsuiteId, v.purchaseOrderId)),
1886
1886
  "text-color": "primary",
1887
1887
  "bg-color": "transparent",
1888
1888
  "border-color": "primary"
@@ -1906,39 +1906,39 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1906
1906
  purchaseOrderId: {}
1907
1907
  },
1908
1908
  setup(b) {
1909
- const s = b, o = $t(), c = X(!1), f = Me(), u = X(!0), v = X(!1), t = X(!1), n = X(!1), d = X(null), S = X([]);
1910
- async function w() {
1911
- if (!d.value) {
1909
+ const s = b, n = $t(), c = Z(!1), v = Me(), d = Z(!0), p = Z(!1), t = Z(!1), o = Z(!1), u = Z(null), k = Z([]);
1910
+ async function $() {
1911
+ if (!u.value) {
1912
1912
  c.value = !0;
1913
1913
  try {
1914
- u.value = !0;
1915
- const M = await o.getMoreInfo(
1916
- f.currentLocation.dbName,
1914
+ d.value = !0;
1915
+ const F = await n.getMoreInfo(
1916
+ v.currentLocation.dbName,
1917
1917
  s.purchaseOrderId
1918
1918
  );
1919
- d.value = M, v.value = !1;
1919
+ u.value = F, p.value = !1;
1920
1920
  } catch {
1921
- v.value = !0;
1921
+ p.value = !0;
1922
1922
  } finally {
1923
- u.value = !1;
1923
+ d.value = !1;
1924
1924
  }
1925
- await C();
1925
+ await D();
1926
1926
  }
1927
1927
  }
1928
- async function C() {
1929
- if (!(S.value.length > 0))
1928
+ async function D() {
1929
+ if (!(k.value.length > 0))
1930
1930
  try {
1931
1931
  t.value = !0;
1932
- const M = await o.getChangeLogs(s.netsuiteId);
1933
- S.value = M, n.value = !1;
1932
+ const F = await n.getChangeLogs(s.netsuiteId);
1933
+ k.value = F, o.value = !1;
1934
1934
  } catch {
1935
- n.value = !0;
1935
+ o.value = !0;
1936
1936
  } finally {
1937
1937
  t.value = !1;
1938
1938
  }
1939
1939
  }
1940
- function D(M) {
1941
- switch (M) {
1940
+ function T(F) {
1941
+ switch (F) {
1942
1942
  case Le.Create:
1943
1943
  return "text-green-600 bg-green-100";
1944
1944
  case Le.Set:
@@ -1951,8 +1951,8 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1951
1951
  return "text-gray-600 bg-gray-100";
1952
1952
  }
1953
1953
  }
1954
- function $(M) {
1955
- return new Date(M).toLocaleDateString("en-US", {
1954
+ function S(F) {
1955
+ return new Date(F).toLocaleDateString("en-US", {
1956
1956
  year: "numeric",
1957
1957
  month: "short",
1958
1958
  day: "numeric",
@@ -1960,64 +1960,64 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
1960
1960
  minute: "2-digit"
1961
1961
  });
1962
1962
  }
1963
- return (M, A) => {
1964
- const Z = re("FmButton"), z = re("FmLabel"), ce = re("FmCircularProgress"), ge = re("FmIcon"), H = re("FmDialog");
1963
+ return (F, E) => {
1964
+ const J = re("FmButton"), z = re("FmLabel"), ae = re("FmCircularProgress"), ge = re("FmIcon"), H = re("FmDialog");
1965
1965
  return l(), h("div", Er, [
1966
- V(H, {
1966
+ L(H, {
1967
1967
  modelValue: c.value,
1968
- "onUpdate:modelValue": A[2] || (A[2] = (N) => c.value = N),
1968
+ "onUpdate:modelValue": E[2] || (E[2] = (R) => c.value = R),
1969
1969
  overlay: !0,
1970
1970
  "max-width": 800
1971
1971
  }, {
1972
- "dialog-button": ie(() => [
1973
- V(Z, {
1972
+ "dialog-button": ce(() => [
1973
+ L(J, {
1974
1974
  "prepend-icon": "info",
1975
1975
  variant: "secondary",
1976
1976
  label: "Latest Info",
1977
- onClick: A[0] || (A[0] = (N) => w()),
1977
+ onClick: E[0] || (E[0] = (R) => $()),
1978
1978
  "text-color": "primary",
1979
1979
  "bg-color": "transparent",
1980
1980
  "border-color": "primary"
1981
1981
  })
1982
1982
  ]),
1983
- "dialog-header": ie(() => A[3] || (A[3] = [
1983
+ "dialog-header": ce(() => E[3] || (E[3] = [
1984
1984
  e("div", null, "NetSuite latest info", -1)
1985
1985
  ])),
1986
- default: ie(() => [
1987
- u.value ? (l(), h("div", qr, "Loading...")) : (l(), h("div", Vr, [
1988
- v.value ? (l(), h("p", ro, "Something went wrong.")) : (l(), h(Ce, { key: 0 }, [
1986
+ default: ce(() => [
1987
+ d.value ? (l(), h("div", qr, "Loading...")) : (l(), h("div", Vr, [
1988
+ p.value ? (l(), h("p", ro, "Something went wrong.")) : (l(), h(Ce, { key: 0 }, [
1989
1989
  e("div", Lr, [
1990
- A[4] || (A[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
1991
- (l(!0), h(Ce, null, Ee(d.value, (N, ne) => (l(), h("div", {
1990
+ E[4] || (E[4] = e("h3", { class: "fm-typo-en-body-lg-600 mb-4" }, "NetSuite Order Details", -1)),
1991
+ (l(!0), h(Ce, null, Ee(u.value, (R, ne) => (l(), h("div", {
1992
1992
  key: ne,
1993
1993
  class: "mb-2"
1994
1994
  }, [
1995
1995
  e("div", null, [
1996
- V(z, {
1996
+ L(z, {
1997
1997
  label: _(Ot)(ne)
1998
1998
  }, null, 8, ["label"]),
1999
1999
  e("div", Ur, [
2000
- Array.isArray(N) ? (l(), h("span", Mr, x(N.length > 0 ? N.join(", ") : "N/A"), 1)) : (l(), h("span", jr, x(N), 1))
2000
+ Array.isArray(R) ? (l(), h("span", Mr, x(R.length > 0 ? R.join(", ") : "N/A"), 1)) : (l(), h("span", jr, x(R), 1))
2001
2001
  ])
2002
2002
  ])
2003
2003
  ]))), 128))
2004
2004
  ]),
2005
2005
  t.value ? (l(), h("div", Br, [
2006
- A[5] || (A[5] = e("span", null, "Change Log Loading...", -1)),
2007
- V(ce, { size: "md" })
2008
- ])) : F("", !0),
2009
- !t.value && S.value.length > 0 ? (l(), h("div", zr, [
2006
+ E[5] || (E[5] = e("span", null, "Change Log Loading...", -1)),
2007
+ L(ae, { size: "md" })
2008
+ ])) : I("", !0),
2009
+ !t.value && k.value.length > 0 ? (l(), h("div", zr, [
2010
2010
  e("h3", Kr, [
2011
- V(ge, {
2011
+ L(ge, {
2012
2012
  name: "error",
2013
2013
  color: "#ff9500",
2014
2014
  size: "sm"
2015
2015
  }),
2016
- A[6] || (A[6] = ze(" Change Logs "))
2016
+ E[6] || (E[6] = ze(" Change Logs "))
2017
2017
  ]),
2018
2018
  e("div", Hr, [
2019
2019
  e("table", Gr, [
2020
- A[7] || (A[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
2020
+ E[7] || (E[7] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
2021
2021
  e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
2022
2022
  e("th", {
2023
2023
  class: "text-left p-3 fm-typo-en-body-md-600",
@@ -2034,38 +2034,38 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2034
2034
  ])
2035
2035
  ], -1)),
2036
2036
  e("tbody", null, [
2037
- (l(!0), h(Ce, null, Ee(S.value, (N, ne) => (l(), h("tr", {
2037
+ (l(!0), h(Ce, null, Ee(k.value, (R, ne) => (l(), h("tr", {
2038
2038
  key: ne,
2039
2039
  class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
2040
2040
  }, [
2041
- e("td", Wr, x($(N._dateiso8601)), 1),
2042
- e("td", Qr, x(N._rolename), 1),
2043
- e("td", Yr, x(N._employeename), 1),
2044
- e("td", Jr, x(N._contextname), 1),
2041
+ e("td", Wr, x(S(R._dateiso8601)), 1),
2042
+ e("td", Qr, x(R._rolename), 1),
2043
+ e("td", Yr, x(R._employeename), 1),
2044
+ e("td", Jr, x(R._contextname), 1),
2045
2045
  e("td", {
2046
- class: Ue(`p-3 fm-typo-en-body-sm-600 ${D(Number(N.type) - 1)}`)
2047
- }, x(_(Le)[Number(N.type) - 1]), 3),
2048
- e("td", Xr, x(N.lineid || ""), 1),
2049
- e("td", Zr, x(N._fieldname), 1),
2050
- e("td", eo, x(N.oldvalue || ""), 1),
2051
- e("td", to, x(N.newvalue || ""), 1)
2046
+ class: Ue(`p-3 fm-typo-en-body-sm-600 ${T(Number(R.type) - 1)}`)
2047
+ }, x(_(Le)[Number(R.type) - 1]), 3),
2048
+ e("td", Xr, x(R.lineid || ""), 1),
2049
+ e("td", Zr, x(R._fieldname), 1),
2050
+ e("td", eo, x(R.oldvalue || ""), 1),
2051
+ e("td", to, x(R.newvalue || ""), 1)
2052
2052
  ]))), 128))
2053
2053
  ])
2054
2054
  ])
2055
2055
  ])
2056
- ])) : (l(), h("div", so, A[8] || (A[8] = [
2056
+ ])) : (l(), h("div", so, E[8] || (E[8] = [
2057
2057
  e("p", null, "No change logs available.", -1)
2058
2058
  ])))
2059
2059
  ], 64))
2060
2060
  ]))
2061
2061
  ]),
2062
- "dialog-footer": ie(() => [
2063
- V(Z, {
2062
+ "dialog-footer": ce(() => [
2063
+ L(J, {
2064
2064
  class: "ml-auto sm:w-full xs:w-full",
2065
2065
  label: "Close",
2066
2066
  size: "md",
2067
2067
  variant: "primary",
2068
- onClick: A[1] || (A[1] = (N) => c.value = !1)
2068
+ onClick: E[1] || (E[1] = (R) => c.value = !1)
2069
2069
  })
2070
2070
  ]),
2071
2071
  _: 1
@@ -2086,58 +2086,58 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2086
2086
  scope: {}
2087
2087
  },
2088
2088
  setup(b) {
2089
- const s = b, o = Hs(), c = j(() => o.isNetSuiteEnabled);
2090
- return (f, u) => {
2091
- var t, n;
2092
- const v = re("FmMenuDivider");
2089
+ const s = b, n = Hs(), c = j(() => n.isNetSuiteEnabled);
2090
+ return (v, d) => {
2091
+ var t, o;
2092
+ const p = re("FmMenuDivider");
2093
2093
  return c.value ? (l(), h("div", no, [
2094
2094
  e("div", ao, [
2095
- u[0] || (u[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
2095
+ d[0] || (d[0] = e("span", { class: "flex-1 fm-typo-en-body-lg-600" }, "NetSuite Info", -1)),
2096
2096
  e("div", lo, [
2097
2097
  e("div", io, [
2098
- (n = (t = s.purchaseOrder) == null ? void 0 : t.netSuite) != null && n.id ? (l(), me(We, { key: 0 }, {
2099
- default: ie(() => {
2100
- var d, S, w;
2098
+ (o = (t = s.purchaseOrder) == null ? void 0 : t.netSuite) != null && o.id ? (l(), me(We, { key: 0 }, {
2099
+ default: ce(() => {
2100
+ var u, k, $;
2101
2101
  return [
2102
- V(oo, {
2103
- "netsuite-id": (S = (d = f.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : S.id,
2104
- "purchase-order-id": (w = f.purchaseOrder) == null ? void 0 : w._id
2102
+ L(oo, {
2103
+ "netsuite-id": (k = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : k.id,
2104
+ "purchase-order-id": ($ = v.purchaseOrder) == null ? void 0 : $._id
2105
2105
  }, null, 8, ["netsuite-id", "purchase-order-id"])
2106
2106
  ];
2107
2107
  }),
2108
2108
  _: 1
2109
- })) : F("", !0),
2110
- V(We, null, {
2111
- default: ie(() => {
2112
- var d, S, w;
2109
+ })) : I("", !0),
2110
+ L(We, null, {
2111
+ default: ce(() => {
2112
+ var u, k, $;
2113
2113
  return [
2114
- V(Fr, {
2115
- "netsuite-id": (S = (d = f.purchaseOrder) == null ? void 0 : d.netSuite) == null ? void 0 : S.id,
2116
- "purchase-order-id": (w = f.purchaseOrder) == null ? void 0 : w._id
2114
+ L(Fr, {
2115
+ "netsuite-id": (k = (u = v.purchaseOrder) == null ? void 0 : u.netSuite) == null ? void 0 : k.id,
2116
+ "purchase-order-id": ($ = v.purchaseOrder) == null ? void 0 : $._id
2117
2117
  }, null, 8, ["netsuite-id", "purchase-order-id"])
2118
2118
  ];
2119
2119
  }),
2120
2120
  _: 1
2121
2121
  }),
2122
- V(vr, {
2123
- "po-request": f.poRequest,
2124
- "purchase-order": f.purchaseOrder,
2122
+ L(vr, {
2123
+ "po-request": v.poRequest,
2124
+ "purchase-order": v.purchaseOrder,
2125
2125
  "is-transfer-between-outlets": !c.value,
2126
- scope: f.scope
2126
+ scope: v.scope
2127
2127
  }, null, 8, ["po-request", "purchase-order", "is-transfer-between-outlets", "scope"])
2128
2128
  ])
2129
2129
  ])
2130
2130
  ]),
2131
- V(v),
2132
- V(Pr, {
2133
- "po-request": f.poRequest,
2134
- "purchase-order": f.purchaseOrder,
2135
- "transfer-type": f.transferType,
2136
- "transfer-to-db-name": f.transferToDbName,
2131
+ L(p),
2132
+ L(Pr, {
2133
+ "po-request": v.poRequest,
2134
+ "purchase-order": v.purchaseOrder,
2135
+ "transfer-type": v.transferType,
2136
+ "transfer-to-db-name": v.transferToDbName,
2137
2137
  "is-transfer-between-outlets": !c.value,
2138
- scope: f.scope
2138
+ scope: v.scope
2139
2139
  }, null, 8, ["po-request", "purchase-order", "transfer-type", "transfer-to-db-name", "is-transfer-between-outlets", "scope"])
2140
- ])) : F("", !0);
2140
+ ])) : I("", !0);
2141
2141
  };
2142
2142
  }
2143
2143
  }), uo = ["open"], mo = { class: "fm-typo-en-body-sm-600 cursor-pointer select-none" }, Ht = /* @__PURE__ */ qe({
@@ -2151,11 +2151,11 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2151
2151
  },
2152
2152
  setup(b) {
2153
2153
  const s = b;
2154
- return (o, c) => (l(), me(We, {
2154
+ return (n, c) => (l(), me(We, {
2155
2155
  selectable: s.selectable,
2156
2156
  class: Ue(s.class)
2157
2157
  }, {
2158
- default: ie(() => [
2158
+ default: ce(() => [
2159
2159
  e("details", {
2160
2160
  open: s.open,
2161
2161
  class: "w-full"
@@ -2164,7 +2164,7 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2164
2164
  e("div", {
2165
2165
  class: Ue(["mt-4 flex flex-col gap-2", s.contentClass])
2166
2166
  }, [
2167
- _s(o.$slots, "default")
2167
+ _s(n.$slots, "default")
2168
2168
  ], 2)
2169
2169
  ], 8, uo)
2170
2170
  ]),
@@ -2174,31 +2174,31 @@ const ur = { class: "border border-fm-color-neutral-gray-200 fm-corner-radius-lg
2174
2174
  });
2175
2175
  function is(b) {
2176
2176
  if (!(b != null && b.itemsAtSubmission)) return [];
2177
- const s = b.version === Fe.enum[2], o = new Set(b.itemsAtSubmission.map((c) => s ? c.id : c.sku._id));
2177
+ const s = b.version === Fe.enum[2], n = new Set(b.itemsAtSubmission.map((c) => s ? c.id : c.sku._id));
2178
2178
  return b.items.filter((c) => {
2179
- const f = s ? c.id : c.sku._id;
2180
- return !o.has(f);
2179
+ const v = s ? c.id : c.sku._id;
2180
+ return !n.has(v);
2181
2181
  });
2182
2182
  }
2183
2183
  function cs(b, s) {
2184
- var u;
2184
+ var d;
2185
2185
  if (!b || s.length === 0) return {};
2186
- const o = b.version === Fe.enum[2], c = new Set(s.map((v) => o ? v.id : v.sku._id)), f = {};
2187
- for (const v of b.deliveryOrder ?? [])
2188
- for (const t of v.received ?? []) {
2189
- const n = o ? t.id : t.sku._id;
2190
- n && c.has(n) && (f[n] = (f[n] ?? 0) + (((u = t.amount) == null ? void 0 : u.amount) ?? 0));
2186
+ const n = b.version === Fe.enum[2], c = new Set(s.map((p) => n ? p.id : p.sku._id)), v = {};
2187
+ for (const p of b.deliveryOrder ?? [])
2188
+ for (const t of p.received ?? []) {
2189
+ const o = n ? t.id : t.sku._id;
2190
+ o && c.has(o) && (v[o] = (v[o] ?? 0) + (((d = t.amount) == null ? void 0 : d.amount) ?? 0));
2191
2191
  }
2192
2192
  return s.reduce(
2193
- (v, t) => {
2194
- var C, D;
2195
- const n = (o ? t.id : t.sku._id) ?? "", d = ((C = t.quantity) == null ? void 0 : C.amount) ?? 0, S = f[n] ?? 0, w = ((D = t.quantity) == null ? void 0 : D.precision) ?? 0;
2196
- return v[n] = {
2197
- key: n,
2198
- total: { amount: d, precision: w },
2199
- received: { amount: S, precision: w },
2200
- remaining: { amount: d - S, precision: w }
2201
- }, v;
2193
+ (p, t) => {
2194
+ var D, T;
2195
+ const o = (n ? t.id : t.sku._id) ?? "", u = ((D = t.quantity) == null ? void 0 : D.amount) ?? 0, k = v[o] ?? 0, $ = ((T = t.quantity) == null ? void 0 : T.precision) ?? 0;
2196
+ return p[o] = {
2197
+ key: o,
2198
+ total: { amount: u, precision: $ },
2199
+ received: { amount: k, precision: $ },
2200
+ remaining: { amount: u - k, precision: $ }
2201
+ }, p;
2202
2202
  },
2203
2203
  {}
2204
2204
  );
@@ -2230,227 +2230,227 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2230
2230
  },
2231
2231
  emits: ["submitted"],
2232
2232
  setup(b, { emit: s }) {
2233
- const { t: o } = Ys(), c = He(), f = Qe(), u = X(!1), v = kt(), t = b, n = s, d = Zt("deliveryOrder"), S = Ye(), w = j(
2233
+ const { t: n } = Ys(), c = He(), v = Qe(), d = Z(!1), p = kt(), t = b, o = s, u = Zt("deliveryOrder"), k = Ye(), $ = j(
2234
2234
  () => {
2235
- var p;
2236
- return ((p = t.purchaseOrder.deliveryFullfillment) == null ? void 0 : p.findIndex(
2235
+ var f;
2236
+ return ((f = t.purchaseOrder.deliveryFullfillment) == null ? void 0 : f.findIndex(
2237
2237
  (i) => t.deliveryOrder.fullfillmentId && i.id === t.deliveryOrder.fullfillmentId
2238
2238
  )) ?? -1;
2239
2239
  }
2240
- ), C = c.enablePurchaseOrderReceiveWithCustomCost, D = c.enablePortalDeliveryOrderWrite, $ = X({}), M = j(
2240
+ ), D = c.enablePurchaseOrderReceiveWithCustomCost, T = c.enablePortalDeliveryOrderWrite, S = Z({}), F = j(
2241
2241
  () => (t.purchaseOrder.itemsAtSubmission ?? t.purchaseOrder.items).length
2242
- ), A = j(() => is(t.purchaseOrder)), Z = j(
2243
- () => cs(t.purchaseOrder, A.value)
2242
+ ), E = j(() => is(t.purchaseOrder)), J = j(
2243
+ () => cs(t.purchaseOrder, E.value)
2244
2244
  ), z = j(
2245
2245
  () => t.purchaseOrder.items.map(
2246
- (p, i) => j({
2246
+ (f, i) => j({
2247
2247
  get: () => {
2248
- var U;
2249
- const k = (U = d.received[i]) == null ? void 0 : U.amount;
2250
- return k ? +xe(k) : 0;
2248
+ var M;
2249
+ const O = (M = u.received[i]) == null ? void 0 : M.amount;
2250
+ return O ? +xe(O) : 0;
2251
2251
  },
2252
- set: (k) => {
2253
- d.received[i].amount = Ke(k, 2);
2252
+ set: (O) => {
2253
+ u.received[i].amount = Ke(O, 2);
2254
2254
  }
2255
2255
  })
2256
2256
  )
2257
- ), ce = j(
2257
+ ), ae = j(
2258
2258
  () => t.purchaseOrder.items.map(
2259
- (p, i) => j({
2259
+ (f, i) => j({
2260
2260
  get: () => {
2261
- var U;
2262
- const k = (U = d.received[i]) == null ? void 0 : U.cost;
2263
- return k ? +xe(k) : 0;
2261
+ var M;
2262
+ const O = (M = u.received[i]) == null ? void 0 : M.cost;
2263
+ return O ? +xe(O) : 0;
2264
2264
  },
2265
- set: (k) => {
2266
- d.received[i].cost = {
2265
+ set: (O) => {
2266
+ u.received[i].cost = {
2267
2267
  currency: De(),
2268
- ...Ke(k, 4)
2268
+ ...Ke(O, 4)
2269
2269
  };
2270
2270
  }
2271
2271
  })
2272
2272
  )
2273
2273
  );
2274
- function ge(p) {
2275
- var k;
2276
- const i = !$.value[p];
2277
- if ($.value[p] = i, i) {
2278
- const U = (k = d.received[p]) == null ? void 0 : k.cost;
2279
- d.received[p].cost = U ? { ...U, precision: 4 } : { currency: De(), amount: 0, precision: 4 };
2274
+ function ge(f) {
2275
+ var O;
2276
+ const i = !S.value[f];
2277
+ if (S.value[f] = i, i) {
2278
+ const M = (O = u.received[f]) == null ? void 0 : O.cost;
2279
+ u.received[f].cost = M ? { ...M, precision: 4 } : { currency: De(), amount: 0, precision: 4 };
2280
2280
  } else
2281
- delete d.received[p].cost;
2281
+ delete u.received[f].cost;
2282
2282
  }
2283
- const H = X([]), N = j(
2284
- () => v.skus.filter((p) => !p.isInactive).map((p) => ({ label: `${p.name} (${p.code})`, value: p._id }))
2283
+ const H = Z([]), R = j(
2284
+ () => p.skus.filter((f) => !f.isInactive).map((f) => ({ label: `${f.name} (${f.code})`, value: f._id }))
2285
2285
  );
2286
2286
  function ne() {
2287
- H.value.push({ skuId: null, costEnabled: !1 }), d.received.push({
2287
+ H.value.push({ skuId: null, costEnabled: !1 }), u.received.push({
2288
2288
  sku: null,
2289
2289
  amount: Ae.fromNumber(0),
2290
2290
  measurement: null
2291
2291
  });
2292
2292
  }
2293
- function I(p) {
2294
- H.value.splice(p, 1), d.received.splice(M.value + p, 1);
2293
+ function P(f) {
2294
+ H.value.splice(f, 1), u.received.splice(F.value + f, 1);
2295
2295
  }
2296
- function R(p, i) {
2297
- H.value[p].skuId = i;
2298
- const k = i ? v.skuById[i] : null;
2299
- d.received[M.value + p].sku = k;
2296
+ function C(f, i) {
2297
+ H.value[f].skuId = i;
2298
+ const O = i ? p.skuById[i] : null;
2299
+ u.received[F.value + f].sku = O;
2300
2300
  }
2301
- function K(p, i) {
2302
- var le, ee;
2303
- const k = (le = t.receivedInfoMap) == null ? void 0 : le[i.sku._id], U = k ? `${o("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: k.received })} / ${it(i.quantity, i.sku.unit, i.measurement)}` : void 0;
2304
- return (((ee = z.value[p]) == null ? void 0 : ee.value) ?? 0) > 0 ? U : U ? `${U} · ${nt}` : nt;
2301
+ function K(f, i) {
2302
+ var ie, ee;
2303
+ const O = (ie = t.receivedInfoMap) == null ? void 0 : ie[i.sku._id], M = O ? `${n("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: O.received })} / ${it(i.quantity, i.sku.unit, i.measurement)}` : void 0;
2304
+ return (((ee = z.value[f]) == null ? void 0 : ee.value) ?? 0) > 0 ? M : M ? `${M} · ${nt}` : nt;
2305
2305
  }
2306
- function T(p, i) {
2307
- var le;
2308
- const U = (((le = J.value[i]) == null ? void 0 : le.value) ?? 0) <= 0;
2306
+ function N(f, i) {
2307
+ var ie;
2308
+ const M = (((ie = X.value[i]) == null ? void 0 : ie.value) ?? 0) <= 0;
2309
2309
  let G;
2310
- if (p.skuId && Z.value[p.skuId]) {
2311
- const ee = Z.value[p.skuId], ke = Ae.toFormatString({ value: ee.received });
2312
- G = `${o("inventory.transfer.receiveRequest.details.received")} ${ke}`;
2310
+ if (f.skuId && J.value[f.skuId]) {
2311
+ const ee = J.value[f.skuId], ke = Ae.toFormatString({ value: ee.received });
2312
+ G = `${n("inventory.transfer.receiveRequest.details.received")} ${ke}`;
2313
2313
  }
2314
- return U ? G ? `${G} · ${nt}` : nt : G;
2314
+ return M ? G ? `${G} · ${nt}` : nt : G;
2315
2315
  }
2316
- const J = j(
2317
- () => H.value.map((p, i) => {
2318
- const k = M.value + i;
2316
+ const X = j(
2317
+ () => H.value.map((f, i) => {
2318
+ const O = F.value + i;
2319
2319
  return j({
2320
2320
  get: () => {
2321
2321
  var G;
2322
- const U = (G = d.received[k]) == null ? void 0 : G.amount;
2323
- return U ? +xe(U) : 0;
2322
+ const M = (G = u.received[O]) == null ? void 0 : G.amount;
2323
+ return M ? +xe(M) : 0;
2324
2324
  },
2325
- set: (U) => {
2326
- d.received[k].amount = Ke(U, 2);
2325
+ set: (M) => {
2326
+ u.received[O].amount = Ke(M, 2);
2327
2327
  }
2328
2328
  });
2329
2329
  })
2330
2330
  ), be = j(
2331
- () => H.value.map((p, i) => {
2332
- const k = M.value + i;
2331
+ () => H.value.map((f, i) => {
2332
+ const O = F.value + i;
2333
2333
  return j({
2334
2334
  get: () => {
2335
2335
  var G;
2336
- const U = (G = d.received[k]) == null ? void 0 : G.cost;
2337
- return U ? +xe(U) : 0;
2336
+ const M = (G = u.received[O]) == null ? void 0 : G.cost;
2337
+ return M ? +xe(M) : 0;
2338
2338
  },
2339
- set: (U) => {
2340
- d.received[k].cost = {
2339
+ set: (M) => {
2340
+ u.received[O].cost = {
2341
2341
  currency: De(),
2342
- ...Ke(U, 4)
2342
+ ...Ke(M, 4)
2343
2343
  };
2344
2344
  }
2345
2345
  });
2346
2346
  })
2347
2347
  );
2348
- function ye(p) {
2349
- const i = H.value[p], k = M.value + p;
2350
- i.costEnabled = !i.costEnabled, i.costEnabled ? d.received[k].cost = { currency: De(), amount: 0, precision: 4 } : delete d.received[k].cost;
2348
+ function ye(f) {
2349
+ const i = H.value[f], O = F.value + f;
2350
+ i.costEnabled = !i.costEnabled, i.costEnabled ? u.received[O].cost = { currency: De(), amount: 0, precision: 4 } : delete u.received[O].cost;
2351
2351
  }
2352
2352
  Ge(
2353
- () => u.value,
2354
- (p) => {
2355
- var ke, ae, r;
2356
- if (!p) {
2357
- H.value = [], $.value = {};
2353
+ () => d.value,
2354
+ (f) => {
2355
+ var ke, le, r;
2356
+ if (!f) {
2357
+ H.value = [], S.value = {};
2358
2358
  return;
2359
2359
  }
2360
- const i = t.purchaseOrder.itemsAtSubmission ?? t.purchaseOrder.items, k = new Set(i.map((a) => a.sku._id)), U = {}, G = [];
2360
+ const i = t.purchaseOrder.itemsAtSubmission ?? t.purchaseOrder.items, O = new Set(i.map((a) => a.sku._id)), M = {}, G = [];
2361
2361
  for (const a of t.deliveryOrder.received ?? []) {
2362
- const O = (ke = a.sku) == null ? void 0 : ke._id;
2363
- O && (k.has(O) ? U[O] = a : G.push(a));
2362
+ const w = (ke = a.sku) == null ? void 0 : ke._id;
2363
+ w && (O.has(w) ? M[w] = a : G.push(a));
2364
2364
  }
2365
- d.received = i.map((a) => {
2366
- const O = U[a.sku._id];
2367
- return O ? { ...O } : {
2365
+ u.received = i.map((a) => {
2366
+ const w = M[a.sku._id];
2367
+ return w ? { ...w } : {
2368
2368
  sku: a.sku,
2369
2369
  amount: Ae.fromNumber(0),
2370
2370
  measurement: a.measurement ?? null
2371
2371
  };
2372
2372
  });
2373
- const le = {};
2373
+ const ie = {};
2374
2374
  for (let a = 0; a < i.length; a++)
2375
- (ae = U[i[a].sku._id]) != null && ae.cost && (le[a] = !0);
2376
- $.value = le, H.value = [];
2377
- const ee = A.value;
2375
+ (le = M[i[a].sku._id]) != null && le.cost && (ie[a] = !0);
2376
+ S.value = ie, H.value = [];
2377
+ const ee = E.value;
2378
2378
  for (const a of G) {
2379
- const O = ee.find((E) => {
2379
+ const w = ee.find((q) => {
2380
2380
  var W;
2381
- return E.sku._id === ((W = a.sku) == null ? void 0 : W._id);
2381
+ return q.sku._id === ((W = a.sku) == null ? void 0 : W._id);
2382
2382
  });
2383
2383
  H.value.push({
2384
2384
  skuId: ((r = a.sku) == null ? void 0 : r._id) ?? null,
2385
2385
  costEnabled: !!a.cost,
2386
2386
  locked: !0,
2387
2387
  quantityLocked: !0,
2388
- historyItem: O
2389
- }), d.received.push({ ...a });
2388
+ historyItem: w
2389
+ }), u.received.push({ ...a });
2390
2390
  }
2391
2391
  if (ee.length) {
2392
- const a = new Set(G.map((O) => {
2393
- var E;
2394
- return (E = O.sku) == null ? void 0 : E._id;
2392
+ const a = new Set(G.map((w) => {
2393
+ var q;
2394
+ return (q = w.sku) == null ? void 0 : q._id;
2395
2395
  }));
2396
- for (const O of ee)
2397
- a.has(O.sku._id) || (H.value.push({
2398
- skuId: O.sku._id,
2396
+ for (const w of ee)
2397
+ a.has(w.sku._id) || (H.value.push({
2398
+ skuId: w.sku._id,
2399
2399
  costEnabled: !1,
2400
2400
  locked: !0,
2401
- historyItem: O
2402
- }), d.received.push({
2403
- sku: O.sku,
2401
+ historyItem: w
2402
+ }), u.received.push({
2403
+ sku: w.sku,
2404
2404
  amount: Ae.fromNumber(0),
2405
- measurement: O.measurement ?? null
2405
+ measurement: w.measurement ?? null
2406
2406
  }));
2407
2407
  }
2408
2408
  }
2409
2409
  );
2410
- const pe = X(!1);
2410
+ const pe = Z(!1);
2411
2411
  function fe() {
2412
- pe.value = !0, S.updateDeliveryOrder({
2412
+ pe.value = !0, k.updateDeliveryOrder({
2413
2413
  deliveryOrder: {
2414
2414
  ...t.deliveryOrder,
2415
- ...d
2415
+ ...u
2416
2416
  },
2417
2417
  purchaseOrderId: t.purchaseOrder._id,
2418
2418
  purchaseOrderRev: t.purchaseOrder._rev
2419
2419
  }).then(() => {
2420
- f.open(
2420
+ v.open(
2421
2421
  {
2422
2422
  title: "Success",
2423
2423
  message: `PO# ${t.purchaseOrder.seqNumber} Changes have been saved`,
2424
2424
  type: "success"
2425
2425
  },
2426
2426
  1e4
2427
- ), u.value = !1, n("submitted");
2427
+ ), d.value = !1, o("submitted");
2428
2428
  }).finally(() => {
2429
2429
  pe.value = !1;
2430
2430
  });
2431
2431
  }
2432
- return (p, i) => {
2433
- const k = re("FmButton"), U = re("FmStepperField"), G = re("FmSwitch"), le = re("FmSelect"), ee = re("FmTextField"), ke = re("FmDialog");
2432
+ return (f, i) => {
2433
+ const O = re("FmButton"), M = re("FmStepperField"), G = re("FmSwitch"), ie = re("FmSelect"), ee = re("FmTextField"), ke = re("FmDialog");
2434
2434
  return l(), me(ke, {
2435
- modelValue: u.value,
2436
- "onUpdate:modelValue": i[1] || (i[1] = (ae) => u.value = ae),
2435
+ modelValue: d.value,
2436
+ "onUpdate:modelValue": i[1] || (i[1] = (le) => d.value = le),
2437
2437
  overlay: !0,
2438
2438
  "min-width": 800
2439
2439
  }, {
2440
- "dialog-button": ie(() => [
2441
- _(D) ? (l(), me(k, {
2440
+ "dialog-button": ce(() => [
2441
+ _(T) ? (l(), me(O, {
2442
2442
  key: 0,
2443
2443
  variant: "plain",
2444
2444
  label: "Edit",
2445
2445
  size: "md",
2446
2446
  "prepend-icon": "edit"
2447
- })) : F("", !0)
2447
+ })) : I("", !0)
2448
2448
  ]),
2449
- "dialog-header": ie(() => [
2449
+ "dialog-header": ce(() => [
2450
2450
  e("div", null, "Received on " + x(_(tt)(t.deliveryOrder.createdAt)), 1)
2451
2451
  ]),
2452
- "dialog-footer": ie(() => [
2453
- V(k, {
2452
+ "dialog-footer": ce(() => [
2453
+ L(O, {
2454
2454
  class: "ml-auto",
2455
2455
  label: "Apply changes",
2456
2456
  size: "md",
@@ -2460,7 +2460,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2460
2460
  onClick: fe
2461
2461
  }, null, 8, ["disabled", "loading"])
2462
2462
  ]),
2463
- default: ie(() => [
2463
+ default: ce(() => [
2464
2464
  e("div", po, [
2465
2465
  e("div", fo, [
2466
2466
  i[2] || (i[2] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Adjustment date", -1)),
@@ -2468,51 +2468,51 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2468
2468
  ]),
2469
2469
  e("div", yo, [
2470
2470
  i[4] || (i[4] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
2471
- (l(!0), h(Ce, null, Ee(t.purchaseOrder.items, (ae, r) => {
2471
+ (l(!0), h(Ce, null, Ee(t.purchaseOrder.items, (le, r) => {
2472
2472
  var a;
2473
2473
  return l(), h("div", { key: r }, [
2474
2474
  e("div", bo, [
2475
2475
  e("div", ho, [
2476
- e("span", go, x(ae.sku.name), 1),
2477
- e("span", _o, x(ae.sku.code), 1)
2476
+ e("span", go, x(le.sku.name), 1),
2477
+ e("span", _o, x(le.sku.code), 1)
2478
2478
  ]),
2479
2479
  e("div", So, [
2480
- V(U, {
2480
+ L(M, {
2481
2481
  label: "Receive Quantity",
2482
2482
  modelValue: z.value[r].value,
2483
- "onUpdate:modelValue": (O) => z.value[r].value = O,
2484
- "append-text": ((a = ae.measurement) == null ? void 0 : a.abbrev) ?? ae.sku.unit.abbrev,
2485
- "helper-text": K(r, ae)
2483
+ "onUpdate:modelValue": (w) => z.value[r].value = w,
2484
+ "append-text": ((a = le.measurement) == null ? void 0 : a.abbrev) ?? le.sku.unit.abbrev,
2485
+ "helper-text": K(r, le)
2486
2486
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
2487
- _(C) ? (l(), h("div", xo, [
2488
- V(G, {
2489
- "model-value": $.value[r],
2490
- "onUpdate:modelValue": (O) => ge(r),
2487
+ _(D) ? (l(), h("div", xo, [
2488
+ L(G, {
2489
+ "model-value": S.value[r],
2490
+ "onUpdate:modelValue": (w) => ge(r),
2491
2491
  size: "sm"
2492
2492
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2493
2493
  i[3] || (i[3] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
2494
- ])) : F("", !0),
2495
- _(C) && $.value[r] ? (l(), me(U, {
2494
+ ])) : I("", !0),
2495
+ _(D) && S.value[r] ? (l(), me(M, {
2496
2496
  key: 1,
2497
- modelValue: ce.value[r].value,
2498
- "onUpdate:modelValue": (O) => ce.value[r].value = O,
2497
+ modelValue: ae.value[r].value,
2498
+ "onUpdate:modelValue": (w) => ae.value[r].value = w,
2499
2499
  label: "Total Cost",
2500
2500
  step: 1e-4,
2501
2501
  min: 0,
2502
2502
  placeholder: "0.0000",
2503
2503
  size: "sm",
2504
2504
  "append-text": _(De)()
2505
- }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : F("", !0)
2505
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
2506
2506
  ])
2507
2507
  ]),
2508
- r < t.purchaseOrder.items.length - 1 ? (l(), h("div", ko)) : F("", !0)
2508
+ r < t.purchaseOrder.items.length - 1 ? (l(), h("div", ko)) : I("", !0)
2509
2509
  ]);
2510
2510
  }), 128))
2511
2511
  ]),
2512
2512
  e("div", Oo, [
2513
2513
  e("div", wo, [
2514
2514
  i[5] || (i[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
2515
- V(k, {
2515
+ L(O, {
2516
2516
  variant: "tertiary",
2517
2517
  label: "Add item",
2518
2518
  "prepend-icon": "add",
@@ -2520,71 +2520,71 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2520
2520
  onClick: ne
2521
2521
  })
2522
2522
  ]),
2523
- H.value.length === 0 ? (l(), h("div", $o, " No extra items added ")) : F("", !0),
2524
- (l(!0), h(Ce, null, Ee(H.value, (ae, r) => {
2525
- var a, O;
2523
+ H.value.length === 0 ? (l(), h("div", $o, " No extra items added ")) : I("", !0),
2524
+ (l(!0), h(Ce, null, Ee(H.value, (le, r) => {
2525
+ var a, w;
2526
2526
  return l(), h("div", { key: r }, [
2527
2527
  e("div", Co, [
2528
2528
  e("div", Do, [
2529
- V(le, {
2530
- "model-value": ae.skuId,
2531
- "onUpdate:modelValue": (E) => R(r, E),
2529
+ L(ie, {
2530
+ "model-value": le.skuId,
2531
+ "onUpdate:modelValue": (q) => C(r, q),
2532
2532
  label: "Ingredient",
2533
- items: N.value,
2533
+ items: R.value,
2534
2534
  searchable: "",
2535
2535
  searchTarget: "label",
2536
2536
  placeholder: "Select ingredient",
2537
- disabled: ae.locked
2537
+ disabled: le.locked
2538
2538
  }, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
2539
2539
  ]),
2540
2540
  e("div", Ro, [
2541
- V(U, {
2541
+ L(M, {
2542
2542
  label: "Receive Quantity",
2543
- modelValue: J.value[r].value,
2544
- "onUpdate:modelValue": (E) => J.value[r].value = E,
2545
- "append-text": ae.skuId ? ((O = (a = _(v).skuById[ae.skuId]) == null ? void 0 : a.unit) == null ? void 0 : O.abbrev) ?? "" : "",
2546
- "helper-text": T(ae, r),
2547
- disabled: ae.quantityLocked || !ae.skuId
2543
+ modelValue: X.value[r].value,
2544
+ "onUpdate:modelValue": (q) => X.value[r].value = q,
2545
+ "append-text": le.skuId ? ((w = (a = _(p).skuById[le.skuId]) == null ? void 0 : a.unit) == null ? void 0 : w.abbrev) ?? "" : "",
2546
+ "helper-text": N(le, r),
2547
+ disabled: le.quantityLocked || !le.skuId
2548
2548
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text", "disabled"]),
2549
- _(C) ? (l(), h("div", No, [
2550
- V(G, {
2551
- "model-value": ae.costEnabled,
2552
- "onUpdate:modelValue": (E) => ye(r),
2549
+ _(D) ? (l(), h("div", No, [
2550
+ L(G, {
2551
+ "model-value": le.costEnabled,
2552
+ "onUpdate:modelValue": (q) => ye(r),
2553
2553
  size: "sm"
2554
2554
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
2555
2555
  i[6] || (i[6] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
2556
- ])) : F("", !0),
2557
- _(C) && ae.costEnabled ? (l(), me(U, {
2556
+ ])) : I("", !0),
2557
+ _(D) && le.costEnabled ? (l(), me(M, {
2558
2558
  key: 1,
2559
2559
  modelValue: be.value[r].value,
2560
- "onUpdate:modelValue": (E) => be.value[r].value = E,
2560
+ "onUpdate:modelValue": (q) => be.value[r].value = q,
2561
2561
  label: "Total Cost",
2562
2562
  step: 1e-4,
2563
2563
  min: 0,
2564
2564
  placeholder: "0.0000",
2565
2565
  size: "sm",
2566
2566
  "append-text": _(De)()
2567
- }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : F("", !0)
2567
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
2568
2568
  ]),
2569
- ae.locked ? F("", !0) : (l(), me(k, {
2569
+ le.locked ? I("", !0) : (l(), me(O, {
2570
2570
  key: 0,
2571
2571
  variant: "tertiary",
2572
2572
  "prepend-icon": "delete",
2573
2573
  size: "md",
2574
2574
  class: "mt-6",
2575
- onClick: (E) => I(r)
2575
+ onClick: (q) => P(r)
2576
2576
  }, null, 8, ["onClick"]))
2577
2577
  ]),
2578
- r < H.value.length - 1 ? (l(), h("div", Ao)) : F("", !0)
2578
+ r < H.value.length - 1 ? (l(), h("div", Ao)) : I("", !0)
2579
2579
  ]);
2580
2580
  }), 128))
2581
2581
  ]),
2582
2582
  e("div", To, [
2583
2583
  i[7] || (i[7] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
2584
2584
  e("div", Po, [
2585
- V(ee, {
2586
- modelValue: _(d).deliveryOrderNumber,
2587
- "onUpdate:modelValue": i[0] || (i[0] = (ae) => _(d).deliveryOrderNumber = ae),
2585
+ L(ee, {
2586
+ modelValue: _(u).deliveryOrderNumber,
2587
+ "onUpdate:modelValue": i[0] || (i[0] = (le) => _(u).deliveryOrderNumber = le),
2588
2588
  size: "md",
2589
2589
  placeholder: t.deliveryOrder.deliveryOrderNumber
2590
2590
  }, null, 8, ["modelValue", "placeholder"])
@@ -2594,10 +2594,10 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2594
2594
  i[8] || (i[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
2595
2595
  e("div", Fo, x(t.deliveryOrder.remark || "N/A"), 1)
2596
2596
  ]),
2597
- w.value >= 0 ? (l(), h("div", Eo, [
2597
+ $.value >= 0 ? (l(), h("div", Eo, [
2598
2598
  i[9] || (i[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Fulfilment's sequence", -1)),
2599
- e("div", qo, x(w.value + 1), 1)
2600
- ])) : F("", !0)
2599
+ e("div", qo, x($.value + 1), 1)
2600
+ ])) : I("", !0)
2601
2601
  ])
2602
2602
  ]),
2603
2603
  _: 1
@@ -2643,48 +2643,48 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2643
2643
  },
2644
2644
  emits: ["submitted"],
2645
2645
  setup(b, { emit: s }) {
2646
- var oe, P, ue;
2647
- const { t: o } = dt(), c = X(!1), f = mt(), u = b, v = s, t = Zt("", {
2646
+ var oe, A, ue;
2647
+ const { t: n } = dt(), c = Z(!1), v = mt(), d = b, p = s, t = Zt("", {
2648
2648
  default: {
2649
2649
  deliveryOrderNumber: "",
2650
2650
  remark: "",
2651
- received: (u.purchaseOrder.itemsAtSubmission ?? u.purchaseOrder.items).map((y) => ({
2651
+ received: (d.purchaseOrder.itemsAtSubmission ?? d.purchaseOrder.items).map((y) => ({
2652
2652
  sku: y.sku,
2653
2653
  amount: Ae.fromNumber(0),
2654
2654
  measurement: y.measurement
2655
2655
  })),
2656
2656
  createdBy: {
2657
- id: ((oe = f.sessionUser.value) == null ? void 0 : oe.id) || "",
2658
- name: ((P = f.sessionUser.value) == null ? void 0 : P.displayName) || ""
2657
+ id: ((oe = v.sessionUser.value) == null ? void 0 : oe.id) || "",
2658
+ name: ((A = v.sessionUser.value) == null ? void 0 : A.displayName) || ""
2659
2659
  },
2660
2660
  createdAt: ""
2661
2661
  }
2662
- }), n = Ye(), d = ft(), S = He(), w = kt(), C = ((ue = u.purchaseOrder) == null ? void 0 : ue.supplier.internal) != null, D = C && S.enablePOSTransferRequireFulfillment, $ = S.enablePortalDeliveryOrderWrite && (u.purchaseOrder.status === ve.Enum.RECEIVING || u.purchaseOrder.status === ve.Enum.COMPLETE) && (C ? !D : !0), M = S.enablePurchaseOrderReceiveWithCustomCost, A = S.enableBackdateReceive, Z = X({}), z = j(
2663
- () => u.purchaseOrder.itemsAtSubmission ?? u.purchaseOrder.items
2664
- ), ce = j(() => is(u.purchaseOrder)), ge = j(
2665
- () => cs(u.purchaseOrder, ce.value)
2662
+ }), o = Ye(), u = ft(), k = He(), $ = kt(), D = ((ue = d.purchaseOrder) == null ? void 0 : ue.supplier.internal) != null, T = D && k.enablePOSTransferRequireFulfillment, S = k.enablePortalDeliveryOrderWrite && (d.purchaseOrder.status === ve.Enum.RECEIVING || d.purchaseOrder.status === ve.Enum.COMPLETE) && (D ? !T : !0), F = k.enablePurchaseOrderReceiveWithCustomCost, E = k.enableBackdateReceive, J = Z({}), z = j(
2663
+ () => d.purchaseOrder.itemsAtSubmission ?? d.purchaseOrder.items
2664
+ ), ae = j(() => is(d.purchaseOrder)), ge = j(
2665
+ () => cs(d.purchaseOrder, ae.value)
2666
2666
  ), H = j(
2667
2667
  () => {
2668
2668
  var y;
2669
- return (((y = u.purchaseOrder) == null ? void 0 : y.version) ?? Fe.enum[1]) === Fe.enum[2];
2669
+ return (((y = d.purchaseOrder) == null ? void 0 : y.version) ?? Fe.enum[1]) === Fe.enum[2];
2670
2670
  }
2671
2671
  );
2672
- function N(y) {
2672
+ function R(y) {
2673
2673
  return (H.value ? y.id : y.sku._id) ?? null;
2674
2674
  }
2675
- const ne = Qe(), I = j({
2675
+ const ne = Qe(), P = j({
2676
2676
  get() {
2677
2677
  if (!t.createdAt) return "";
2678
- const y = new Date(t.createdAt), m = y.getFullYear(), g = String(y.getMonth() + 1).padStart(2, "0"), L = String(y.getDate()).padStart(2, "0");
2679
- return `${m}-${g}-${L}`;
2678
+ const y = new Date(t.createdAt), m = y.getFullYear(), g = String(y.getMonth() + 1).padStart(2, "0"), U = String(y.getDate()).padStart(2, "0");
2679
+ return `${m}-${g}-${U}`;
2680
2680
  },
2681
2681
  set(y) {
2682
2682
  if (y) {
2683
- const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, L, B] = y.split("-");
2684
- m.setFullYear(parseInt(g)), m.setMonth(parseInt(L) - 1), m.setDate(parseInt(B)), t.createdAt = m.toISOString();
2683
+ const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, U, B] = y.split("-");
2684
+ m.setFullYear(parseInt(g)), m.setMonth(parseInt(U) - 1), m.setDate(parseInt(B)), t.createdAt = m.toISOString();
2685
2685
  }
2686
2686
  }
2687
- }), R = j({
2687
+ }), C = j({
2688
2688
  get() {
2689
2689
  if (!t.createdAt) return "";
2690
2690
  const y = new Date(t.createdAt), m = String(y.getHours()).padStart(2, "0"), g = String(y.getMinutes()).padStart(2, "0");
@@ -2692,50 +2692,50 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2692
2692
  },
2693
2693
  set(y) {
2694
2694
  if (y) {
2695
- const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, L] = y.split(":");
2696
- m.setHours(parseInt(g)), m.setMinutes(parseInt(L)), t.createdAt = m.toISOString();
2695
+ const m = t.createdAt ? new Date(t.createdAt) : /* @__PURE__ */ new Date(), [g, U] = y.split(":");
2696
+ m.setHours(parseInt(g)), m.setMinutes(parseInt(U)), t.createdAt = m.toISOString();
2697
2697
  }
2698
2698
  }
2699
2699
  }), K = j(() => {
2700
- const y = at(u.purchaseOrder._id);
2700
+ const y = at(d.purchaseOrder._id);
2701
2701
  if (!y) return "";
2702
- const m = new Date(y), g = m.getFullYear(), L = String(m.getMonth() + 1).padStart(2, "0"), B = String(m.getDate()).padStart(2, "0");
2703
- return `${g}-${L}-${B}`;
2704
- }), T = j(() => {
2705
- const y = at(u.purchaseOrder._id);
2702
+ const m = new Date(y), g = m.getFullYear(), U = String(m.getMonth() + 1).padStart(2, "0"), B = String(m.getDate()).padStart(2, "0");
2703
+ return `${g}-${U}-${B}`;
2704
+ }), N = j(() => {
2705
+ const y = at(d.purchaseOrder._id);
2706
2706
  return y ? new Date(y) : null;
2707
- }), J = j(() => {
2708
- if (!I.value || !R.value || !T.value) return null;
2709
- if (/* @__PURE__ */ new Date(`${I.value}T${R.value}:00`) < T.value) {
2710
- const m = K.value, g = T.value.getHours(), L = T.value.getMinutes(), B = g >= 12 ? "PM" : "AM", _e = g % 12 || 12, $e = `${String(_e).padStart(2, "0")}:${String(L).padStart(2, "0")} ${B}`;
2707
+ }), X = j(() => {
2708
+ if (!P.value || !C.value || !N.value) return null;
2709
+ if (/* @__PURE__ */ new Date(`${P.value}T${C.value}:00`) < N.value) {
2710
+ const m = K.value, g = N.value.getHours(), U = N.value.getMinutes(), B = g >= 12 ? "PM" : "AM", _e = g % 12 || 12, $e = `${String(_e).padStart(2, "0")}:${String(U).padStart(2, "0")} ${B}`;
2711
2711
  return `Delivery date & time cannot be earlier than order creation (${m} ${$e})`;
2712
2712
  }
2713
2713
  return null;
2714
- }), be = j(() => J.value || k.value.some((m) => !m.skuId) ? !1 : t.received.some((m) => {
2714
+ }), be = j(() => X.value || O.value.some((m) => !m.skuId) ? !1 : t.received.some((m) => {
2715
2715
  const g = m.amount;
2716
2716
  return g ? +xe(g) > 0 : !1;
2717
2717
  }));
2718
2718
  function ye(y) {
2719
2719
  var g;
2720
- const m = (g = u.receivedInfoMap[y.sku._id]) == null ? void 0 : g.received;
2721
- return `${o("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: m })} / ${it(y.quantity, y.sku.unit, y.measurement)}`;
2720
+ const m = (g = d.receivedInfoMap[y.sku._id]) == null ? void 0 : g.received;
2721
+ return `${n("inventory.transfer.receiveRequest.details.received")} ${Ae.toFormatString({ value: m })} / ${it(y.quantity, y.sku.unit, y.measurement)}`;
2722
2722
  }
2723
2723
  function pe() {
2724
2724
  t.createdAt = "";
2725
2725
  }
2726
2726
  const fe = j(() => z.value.map((y, m) => j({
2727
2727
  get: () => {
2728
- var L;
2729
- const g = (L = t.received[m]) == null ? void 0 : L.amount;
2728
+ var U;
2729
+ const g = (U = t.received[m]) == null ? void 0 : U.amount;
2730
2730
  return g ? +xe(g) : 0;
2731
2731
  },
2732
2732
  set: (g) => {
2733
2733
  t.received[m].amount = Ke(g, 2);
2734
2734
  }
2735
2735
  })));
2736
- function p(y) {
2737
- const m = !Z.value[y];
2738
- if (Z.value[y] = m, m) {
2736
+ function f(y) {
2737
+ const m = !J.value[y];
2738
+ if (J.value[y] = m, m) {
2739
2739
  const g = z.value[y];
2740
2740
  g.totalCost ? t.received[y].cost = {
2741
2741
  currency: g.totalCost.currency,
@@ -2752,8 +2752,8 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2752
2752
  }
2753
2753
  const i = j(() => z.value.map((y, m) => j({
2754
2754
  get: () => {
2755
- var L;
2756
- const g = (L = t.received[m]) == null ? void 0 : L.cost;
2755
+ var U;
2756
+ const g = (U = t.received[m]) == null ? void 0 : U.cost;
2757
2757
  return g ? +xe(g) : 0;
2758
2758
  },
2759
2759
  set: (g) => {
@@ -2762,71 +2762,71 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2762
2762
  ...Ke(g, 4)
2763
2763
  };
2764
2764
  }
2765
- }))), k = X([]), U = j(
2766
- () => w.skus.filter((y) => !y.isInactive).map((y) => ({ label: `${y.name} (${y.code})`, value: y._id }))
2765
+ }))), O = Z([]), M = j(
2766
+ () => $.skus.filter((y) => !y.isInactive).map((y) => ({ label: `${y.name} (${y.code})`, value: y._id }))
2767
2767
  ), G = j(() => z.value.length);
2768
- function le() {
2769
- k.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), t.received.push({
2768
+ function ie() {
2769
+ O.value.push({ skuId: null, stableKey: null, costEnabled: !1 }), t.received.push({
2770
2770
  sku: null,
2771
2771
  amount: Ae.fromNumber(0),
2772
2772
  measurement: null
2773
2773
  });
2774
2774
  }
2775
2775
  function ee(y) {
2776
- k.value.splice(y, 1), t.received.splice(G.value + y, 1);
2776
+ O.value.splice(y, 1), t.received.splice(G.value + y, 1);
2777
2777
  }
2778
2778
  function ke(y, m) {
2779
- k.value[y].skuId = m;
2780
- const g = m ? w.skuById[m] : null;
2779
+ O.value[y].skuId = m;
2780
+ const g = m ? $.skuById[m] : null;
2781
2781
  t.received[G.value + y].sku = g;
2782
2782
  }
2783
- function ae(y) {
2783
+ function le(y) {
2784
2784
  const m = y.stableKey;
2785
2785
  if (m && ge.value[m]) {
2786
- const g = ge.value[m], L = Ae.toFormatString({ value: g.received });
2787
- return `${o("inventory.transfer.receiveRequest.details.received")} ${L}`;
2786
+ const g = ge.value[m], U = Ae.toFormatString({ value: g.received });
2787
+ return `${n("inventory.transfer.receiveRequest.details.received")} ${U}`;
2788
2788
  }
2789
2789
  }
2790
2790
  const r = j(
2791
- () => k.value.map((y, m) => {
2791
+ () => O.value.map((y, m) => {
2792
2792
  const g = G.value + m;
2793
2793
  return j({
2794
2794
  get: () => {
2795
2795
  var B;
2796
- const L = (B = t.received[g]) == null ? void 0 : B.amount;
2797
- return L ? +xe(L) : 0;
2796
+ const U = (B = t.received[g]) == null ? void 0 : B.amount;
2797
+ return U ? +xe(U) : 0;
2798
2798
  },
2799
- set: (L) => {
2800
- t.received[g].amount = Ke(L, 2);
2799
+ set: (U) => {
2800
+ t.received[g].amount = Ke(U, 2);
2801
2801
  }
2802
2802
  });
2803
2803
  })
2804
2804
  ), a = j(
2805
- () => k.value.map((y, m) => {
2805
+ () => O.value.map((y, m) => {
2806
2806
  const g = G.value + m;
2807
2807
  return j({
2808
2808
  get: () => {
2809
2809
  var B;
2810
- const L = (B = t.received[g]) == null ? void 0 : B.cost;
2811
- return L ? +xe(L) : 0;
2810
+ const U = (B = t.received[g]) == null ? void 0 : B.cost;
2811
+ return U ? +xe(U) : 0;
2812
2812
  },
2813
- set: (L) => {
2813
+ set: (U) => {
2814
2814
  t.received[g].cost = {
2815
2815
  currency: De(),
2816
- ...Ke(L, 4)
2816
+ ...Ke(U, 4)
2817
2817
  };
2818
2818
  }
2819
2819
  });
2820
2820
  })
2821
2821
  );
2822
- function O(y) {
2823
- const m = k.value[y], g = G.value + y;
2822
+ function w(y) {
2823
+ const m = O.value[y], g = G.value + y;
2824
2824
  m.costEnabled = !m.costEnabled, m.costEnabled ? t.received[g].cost = { currency: De(), amount: 0, precision: 4 } : delete t.received[g].cost;
2825
2825
  }
2826
- function E() {
2827
- d.open({
2826
+ function q() {
2827
+ u.open({
2828
2828
  title: "Confirm Create Delivery Order",
2829
- message: `Are you sure you want to create delivery order for PO# ${u.purchaseOrder.seqNumber}?`,
2829
+ message: `Are you sure you want to create delivery order for PO# ${d.purchaseOrder.seqNumber}?`,
2830
2830
  primaryActions: {
2831
2831
  text: "Create",
2832
2832
  close: !0,
@@ -2838,22 +2838,22 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2838
2838
  }
2839
2839
  }).onPrimary(() => Q());
2840
2840
  }
2841
- const W = X(!1);
2841
+ const W = Z(!1);
2842
2842
  function Q() {
2843
- W.value = !0, n.createDeliveryOrder({
2843
+ W.value = !0, o.createDeliveryOrder({
2844
2844
  deliveryOrder: t,
2845
- purchaseOrderId: u.purchaseOrder._id,
2846
- purchaseOrderRev: u.purchaseOrder._rev,
2845
+ purchaseOrderId: d.purchaseOrder._id,
2846
+ purchaseOrderRev: d.purchaseOrder._rev,
2847
2847
  currency: De()
2848
2848
  }).then(() => {
2849
2849
  ne.open(
2850
2850
  {
2851
2851
  title: "Success",
2852
- message: `New delivery order created for PO# ${u.purchaseOrder.seqNumber}`,
2852
+ message: `New delivery order created for PO# ${d.purchaseOrder.seqNumber}`,
2853
2853
  type: "success"
2854
2854
  },
2855
2855
  1e4
2856
- ), c.value = !1, v("submitted");
2856
+ ), c.value = !1, p("submitted");
2857
2857
  }).finally(() => {
2858
2858
  W.value = !1;
2859
2859
  });
@@ -2861,9 +2861,9 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2861
2861
  return Ge(
2862
2862
  () => c.value,
2863
2863
  (y) => {
2864
- var L;
2864
+ var U;
2865
2865
  if (!y) {
2866
- k.value = [], t.received = z.value.map((B) => ({
2866
+ O.value = [], t.received = z.value.map((B) => ({
2867
2867
  sku: B.sku,
2868
2868
  amount: Ae.fromNumber(0),
2869
2869
  measurement: B.measurement
@@ -2872,14 +2872,14 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2872
2872
  }
2873
2873
  const m = z.value;
2874
2874
  for (let B = 0; B < m.length; B++) {
2875
- const _e = m[B], te = (((L = u.purchaseOrder) == null ? void 0 : L.version) ?? Fe.enum[1]) === Fe.enum[2] ? _e.id : _e.sku._id, he = u.receivedMap[te], we = +xe(_e.quantity), Re = he ? +xe(he.received) : 0;
2875
+ const _e = m[B], te = (((U = d.purchaseOrder) == null ? void 0 : U.version) ?? Fe.enum[1]) === Fe.enum[2] ? _e.id : _e.sku._id, he = d.receivedMap[te], we = +xe(_e.quantity), Re = he ? +xe(he.received) : 0;
2876
2876
  fe.value[B].value = Math.max(0, we - Re);
2877
2877
  }
2878
- const g = ce.value;
2878
+ const g = ae.value;
2879
2879
  if (g.length) {
2880
2880
  for (const B of g) {
2881
- const _e = N(B);
2882
- k.value.push({
2881
+ const _e = R(B);
2882
+ O.value.push({
2883
2883
  skuId: B.sku._id,
2884
2884
  stableKey: _e,
2885
2885
  costEnabled: !1,
@@ -2893,7 +2893,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2893
2893
  });
2894
2894
  }
2895
2895
  for (let B = 0; B < g.length; B++) {
2896
- const _e = N(g[B]), $e = _e ? ge.value[_e] : void 0;
2896
+ const _e = R(g[B]), $e = _e ? ge.value[_e] : void 0;
2897
2897
  if ($e) {
2898
2898
  const te = Math.pow(10, $e.remaining.precision ?? 2);
2899
2899
  r.value[B].value = Math.max(0, $e.remaining.amount / te);
@@ -2902,82 +2902,82 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2902
2902
  }
2903
2903
  }
2904
2904
  ), (y, m) => {
2905
- const g = re("FmButton"), L = re("FmDatePicker"), B = re("FmTimePicker"), _e = re("FmIcon"), $e = re("FmStepperField"), te = re("FmSwitch"), he = re("FmSelect"), we = re("FmTextField"), Re = re("FmDialog");
2905
+ const g = re("FmButton"), U = re("FmDatePicker"), B = re("FmTimePicker"), _e = re("FmIcon"), $e = re("FmStepperField"), te = re("FmSwitch"), he = re("FmSelect"), we = re("FmTextField"), Re = re("FmDialog");
2906
2906
  return l(), me(Re, {
2907
2907
  modelValue: c.value,
2908
2908
  "onUpdate:modelValue": m[4] || (m[4] = (Ne) => c.value = Ne),
2909
2909
  overlay: !0,
2910
2910
  "min-width": 800
2911
2911
  }, {
2912
- "dialog-button": ie(() => [
2913
- _($) ? (l(), me(g, {
2912
+ "dialog-button": ce(() => [
2913
+ _(S) ? (l(), me(g, {
2914
2914
  key: 0,
2915
2915
  variant: "primary",
2916
2916
  label: "Create",
2917
2917
  size: "md",
2918
2918
  "prepend-icon": "add",
2919
2919
  class: "w-full"
2920
- })) : F("", !0)
2920
+ })) : I("", !0)
2921
2921
  ]),
2922
- "dialog-header": ie(() => [
2923
- e("div", null, "Order #" + x(u.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
2922
+ "dialog-header": ce(() => [
2923
+ e("div", null, "Order #" + x(d.purchaseOrder.seqNumber) + " (New Delivery Order)", 1)
2924
2924
  ]),
2925
- "dialog-footer": ie(() => [
2926
- V(g, {
2925
+ "dialog-footer": ce(() => [
2926
+ L(g, {
2927
2927
  class: "ml-auto",
2928
2928
  label: "Create",
2929
2929
  size: "md",
2930
2930
  variant: "destructive",
2931
2931
  disabled: !be.value || W.value,
2932
2932
  loading: W.value,
2933
- onClick: E
2933
+ onClick: q
2934
2934
  }, null, 8, ["disabled", "loading"])
2935
2935
  ]),
2936
- default: ie(() => {
2936
+ default: ce(() => {
2937
2937
  var Ne;
2938
2938
  return [
2939
2939
  e("div", Lo, [
2940
2940
  e("div", Uo, [
2941
2941
  m[5] || (m[5] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Received by", -1)),
2942
- e("div", Mo, x((Ne = _(f).sessionUser.value) == null ? void 0 : Ne.displayName), 1)
2942
+ e("div", Mo, x((Ne = _(v).sessionUser.value) == null ? void 0 : Ne.displayName), 1)
2943
2943
  ]),
2944
- _(A) ? (l(), h("div", jo, [
2944
+ _(E) ? (l(), h("div", jo, [
2945
2945
  e("div", Bo, [
2946
2946
  e("div", zo, [
2947
2947
  m[6] || (m[6] = ze(" Delivery Date & Time ")),
2948
- !I.value && !R.value ? (l(), h("div", Ko, " Leave blank to use current date & time ")) : F("", !0)
2948
+ !P.value && !C.value ? (l(), h("div", Ko, " Leave blank to use current date & time ")) : I("", !0)
2949
2949
  ]),
2950
- I.value || R.value ? (l(), me(g, {
2950
+ P.value || C.value ? (l(), me(g, {
2951
2951
  key: 0,
2952
2952
  variant: "tertiary",
2953
2953
  label: "Clear",
2954
2954
  "prepend-icon": "close",
2955
2955
  onClick: pe
2956
- })) : F("", !0)
2956
+ })) : I("", !0)
2957
2957
  ]),
2958
2958
  e("div", Ho, [
2959
2959
  e("div", Go, [
2960
- V(L, {
2961
- modelValue: I.value,
2962
- "onUpdate:modelValue": m[0] || (m[0] = (de) => I.value = de)
2960
+ L(U, {
2961
+ modelValue: P.value,
2962
+ "onUpdate:modelValue": m[0] || (m[0] = (de) => P.value = de)
2963
2963
  }, null, 8, ["modelValue"])
2964
2964
  ]),
2965
2965
  e("div", Wo, [
2966
- V(B, {
2967
- modelValue: R.value,
2968
- "onUpdate:modelValue": m[1] || (m[1] = (de) => R.value = de)
2966
+ L(B, {
2967
+ modelValue: C.value,
2968
+ "onUpdate:modelValue": m[1] || (m[1] = (de) => C.value = de)
2969
2969
  }, null, 8, ["modelValue"])
2970
2970
  ])
2971
2971
  ]),
2972
- J.value ? (l(), h("div", Qo, [
2973
- V(_e, {
2972
+ X.value ? (l(), h("div", Qo, [
2973
+ L(_e, {
2974
2974
  name: "error",
2975
2975
  class: "inline-block mr-1",
2976
2976
  size: "sm"
2977
2977
  }),
2978
- e("div", Yo, x(J.value), 1)
2979
- ])) : F("", !0)
2980
- ])) : F("", !0),
2978
+ e("div", Yo, x(X.value), 1)
2979
+ ])) : I("", !0)
2980
+ ])) : I("", !0),
2981
2981
  e("div", Jo, [
2982
2982
  m[8] || (m[8] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, " Items going to receive ", -1)),
2983
2983
  (l(!0), h(Ce, null, Ee(z.value, (de, se) => {
@@ -2989,23 +2989,23 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
2989
2989
  e("span", tn, x(de.sku.code), 1)
2990
2990
  ]),
2991
2991
  e("div", sn, [
2992
- V($e, {
2992
+ L($e, {
2993
2993
  label: "Receive Quantity",
2994
2994
  modelValue: fe.value[se].value,
2995
2995
  "onUpdate:modelValue": (Te) => fe.value[se].value = Te,
2996
2996
  "helper-text": ye(de),
2997
2997
  "append-text": ((Oe = de.measurement) == null ? void 0 : Oe.abbrev) ?? de.sku.unit.abbrev
2998
2998
  }, null, 8, ["modelValue", "onUpdate:modelValue", "helper-text", "append-text"]),
2999
- fe.value[se].value <= 0 ? (l(), h("div", rn, x(Gt))) : F("", !0),
3000
- _(M) ? (l(), h("div", on, [
3001
- V(te, {
3002
- "model-value": Z.value[se],
3003
- "onUpdate:modelValue": (Te) => p(se),
2999
+ fe.value[se].value <= 0 ? (l(), h("div", rn, x(Gt))) : I("", !0),
3000
+ _(F) ? (l(), h("div", on, [
3001
+ L(te, {
3002
+ "model-value": J.value[se],
3003
+ "onUpdate:modelValue": (Te) => f(se),
3004
3004
  size: "sm"
3005
3005
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
3006
3006
  m[7] || (m[7] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
3007
- ])) : F("", !0),
3008
- _(M) && Z.value[se] ? (l(), me($e, {
3007
+ ])) : I("", !0),
3008
+ _(F) && J.value[se] ? (l(), me($e, {
3009
3009
  key: 2,
3010
3010
  modelValue: i.value[se].value,
3011
3011
  "onUpdate:modelValue": (Te) => i.value[se].value = Te,
@@ -3015,35 +3015,35 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3015
3015
  placeholder: "0.0000",
3016
3016
  size: "sm",
3017
3017
  "append-text": _(De)()
3018
- }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : F("", !0)
3018
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
3019
3019
  ])
3020
3020
  ]),
3021
- se < z.value.length - 1 ? (l(), h("div", nn)) : F("", !0)
3021
+ se < z.value.length - 1 ? (l(), h("div", nn)) : I("", !0)
3022
3022
  ]);
3023
3023
  }), 128))
3024
3024
  ]),
3025
3025
  e("div", an, [
3026
3026
  e("div", ln, [
3027
3027
  m[9] || (m[9] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Extra items", -1)),
3028
- V(g, {
3028
+ L(g, {
3029
3029
  variant: "tertiary",
3030
3030
  label: "Add item",
3031
3031
  "prepend-icon": "add",
3032
3032
  size: "md",
3033
- onClick: le
3033
+ onClick: ie
3034
3034
  })
3035
3035
  ]),
3036
- k.value.length === 0 ? (l(), h("div", cn, " No extra items added ")) : F("", !0),
3037
- (l(!0), h(Ce, null, Ee(k.value, (de, se) => {
3036
+ O.value.length === 0 ? (l(), h("div", cn, " No extra items added ")) : I("", !0),
3037
+ (l(!0), h(Ce, null, Ee(O.value, (de, se) => {
3038
3038
  var Oe, Te;
3039
3039
  return l(), h("div", { key: se }, [
3040
3040
  e("div", un, [
3041
3041
  e("div", dn, [
3042
- V(he, {
3042
+ L(he, {
3043
3043
  "model-value": de.skuId,
3044
3044
  "onUpdate:modelValue": (Ie) => ke(se, Ie),
3045
3045
  label: "Ingredient",
3046
- items: U.value,
3046
+ items: M.value,
3047
3047
  searchable: "",
3048
3048
  searchTarget: "label",
3049
3049
  placeholder: "Select ingredient",
@@ -3051,23 +3051,23 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3051
3051
  }, null, 8, ["model-value", "onUpdate:modelValue", "items", "disabled"])
3052
3052
  ]),
3053
3053
  e("div", mn, [
3054
- V($e, {
3054
+ L($e, {
3055
3055
  label: "Receive Quantity",
3056
3056
  modelValue: r.value[se].value,
3057
3057
  "onUpdate:modelValue": (Ie) => r.value[se].value = Ie,
3058
- "append-text": de.skuId ? ((Te = (Oe = _(w).skuById[de.skuId]) == null ? void 0 : Oe.unit) == null ? void 0 : Te.abbrev) ?? "" : "",
3059
- "helper-text": ae(de)
3058
+ "append-text": de.skuId ? ((Te = (Oe = _($).skuById[de.skuId]) == null ? void 0 : Oe.unit) == null ? void 0 : Te.abbrev) ?? "" : "",
3059
+ "helper-text": le(de)
3060
3060
  }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text", "helper-text"]),
3061
- r.value[se].value <= 0 ? (l(), h("div", pn, x(Gt))) : F("", !0),
3062
- _(M) ? (l(), h("div", fn, [
3063
- V(te, {
3061
+ r.value[se].value <= 0 ? (l(), h("div", pn, x(Gt))) : I("", !0),
3062
+ _(F) ? (l(), h("div", fn, [
3063
+ L(te, {
3064
3064
  "model-value": de.costEnabled,
3065
- "onUpdate:modelValue": (Ie) => O(se),
3065
+ "onUpdate:modelValue": (Ie) => w(se),
3066
3066
  size: "sm"
3067
3067
  }, null, 8, ["model-value", "onUpdate:modelValue"]),
3068
3068
  m[10] || (m[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Override cost ", -1))
3069
- ])) : F("", !0),
3070
- _(M) && de.costEnabled ? (l(), me($e, {
3069
+ ])) : I("", !0),
3070
+ _(F) && de.costEnabled ? (l(), me($e, {
3071
3071
  key: 2,
3072
3072
  modelValue: a.value[se].value,
3073
3073
  "onUpdate:modelValue": (Ie) => a.value[se].value = Ie,
@@ -3077,9 +3077,9 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3077
3077
  placeholder: "0.0000",
3078
3078
  size: "sm",
3079
3079
  "append-text": _(De)()
3080
- }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : F("", !0)
3080
+ }, null, 8, ["modelValue", "onUpdate:modelValue", "append-text"])) : I("", !0)
3081
3081
  ]),
3082
- de.historyItem ? F("", !0) : (l(), me(g, {
3082
+ de.historyItem ? I("", !0) : (l(), me(g, {
3083
3083
  key: 0,
3084
3084
  variant: "tertiary",
3085
3085
  "prepend-icon": "delete",
@@ -3088,14 +3088,14 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3088
3088
  onClick: (Ie) => ee(se)
3089
3089
  }, null, 8, ["onClick"]))
3090
3090
  ]),
3091
- se < k.value.length - 1 ? (l(), h("div", vn)) : F("", !0)
3091
+ se < O.value.length - 1 ? (l(), h("div", vn)) : I("", !0)
3092
3092
  ]);
3093
3093
  }), 128))
3094
3094
  ]),
3095
3095
  e("div", yn, [
3096
3096
  m[11] || (m[11] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Delivery order no.", -1)),
3097
3097
  e("div", bn, [
3098
- V(we, {
3098
+ L(we, {
3099
3099
  modelValue: _(t).deliveryOrderNumber,
3100
3100
  "onUpdate:modelValue": m[2] || (m[2] = (de) => _(t).deliveryOrderNumber = de),
3101
3101
  size: "md"
@@ -3105,7 +3105,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3105
3105
  e("div", hn, [
3106
3106
  m[12] || (m[12] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Remark", -1)),
3107
3107
  e("div", gn, [
3108
- V(we, {
3108
+ L(we, {
3109
3109
  modelValue: _(t).remark,
3110
3110
  "onUpdate:modelValue": m[3] || (m[3] = (de) => _(t).remark = de),
3111
3111
  size: "md"
@@ -3134,21 +3134,21 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3134
3134
  netsuiteId: {}
3135
3135
  },
3136
3136
  setup(b) {
3137
- const s = b, o = $t(), c = X(!1), f = X(!1), u = X(!1), v = X([]);
3137
+ const s = b, n = $t(), c = Z(!1), v = Z(!1), d = Z(!1), p = Z([]);
3138
3138
  async function t() {
3139
- if (!(v.value.length > 0))
3139
+ if (!(p.value.length > 0))
3140
3140
  try {
3141
- f.value = !0;
3142
- const S = await o.getChangeLogs(s.netsuiteId);
3143
- v.value = S, u.value = !1;
3141
+ v.value = !0;
3142
+ const k = await n.getChangeLogs(s.netsuiteId);
3143
+ p.value = k, d.value = !1;
3144
3144
  } catch {
3145
- u.value = !0;
3145
+ d.value = !0;
3146
3146
  } finally {
3147
- f.value = !1;
3147
+ v.value = !1;
3148
3148
  }
3149
3149
  }
3150
- function n(S) {
3151
- switch (S) {
3150
+ function o(k) {
3151
+ switch (k) {
3152
3152
  case Le.Create:
3153
3153
  return "text-green-600 bg-green-100";
3154
3154
  case Le.Set:
@@ -3161,8 +3161,8 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3161
3161
  return "text-gray-600 bg-gray-100";
3162
3162
  }
3163
3163
  }
3164
- function d(S) {
3165
- return new Date(S).toLocaleDateString("en-US", {
3164
+ function u(k) {
3165
+ return new Date(k).toLocaleDateString("en-US", {
3166
3166
  year: "numeric",
3167
3167
  month: "short",
3168
3168
  day: "numeric",
@@ -3170,46 +3170,46 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3170
3170
  minute: "2-digit"
3171
3171
  });
3172
3172
  }
3173
- return (S, w) => {
3174
- const C = re("FmButton"), D = re("FmCircularProgress"), $ = re("FmIcon"), M = re("FmDialog");
3173
+ return (k, $) => {
3174
+ const D = re("FmButton"), T = re("FmCircularProgress"), S = re("FmIcon"), F = re("FmDialog");
3175
3175
  return l(), h("div", Sn, [
3176
- V(M, {
3176
+ L(F, {
3177
3177
  modelValue: c.value,
3178
- "onUpdate:modelValue": w[2] || (w[2] = (A) => c.value = A),
3178
+ "onUpdate:modelValue": $[2] || ($[2] = (E) => c.value = E),
3179
3179
  overlay: !0,
3180
3180
  "max-width": 800
3181
3181
  }, {
3182
- "dialog-button": ie(() => [
3183
- V(C, {
3182
+ "dialog-button": ce(() => [
3183
+ L(D, {
3184
3184
  "prepend-icon": "info",
3185
3185
  variant: "secondary",
3186
3186
  label: "NetSuite",
3187
- onClick: w[0] || (w[0] = (A) => t()),
3187
+ onClick: $[0] || ($[0] = (E) => t()),
3188
3188
  "text-color": "primary",
3189
3189
  "bg-color": "transparent",
3190
3190
  "border-color": "primary"
3191
3191
  })
3192
3192
  ]),
3193
- "dialog-header": ie(() => w[3] || (w[3] = [
3193
+ "dialog-header": ce(() => $[3] || ($[3] = [
3194
3194
  e("div", null, "NetSuite info", -1)
3195
3195
  ])),
3196
- default: ie(() => [
3197
- f.value ? (l(), h("div", xn, [
3198
- w[4] || (w[4] = e("span", null, "Change Log Loading...", -1)),
3199
- V(D, { size: "md" })
3200
- ])) : F("", !0),
3201
- !f.value && v.value.length > 0 ? (l(), h("div", kn, [
3196
+ default: ce(() => [
3197
+ v.value ? (l(), h("div", xn, [
3198
+ $[4] || ($[4] = e("span", null, "Change Log Loading...", -1)),
3199
+ L(T, { size: "md" })
3200
+ ])) : I("", !0),
3201
+ !v.value && p.value.length > 0 ? (l(), h("div", kn, [
3202
3202
  e("h3", On, [
3203
- V($, {
3203
+ L(S, {
3204
3204
  name: "error",
3205
3205
  color: "#ff9500",
3206
3206
  size: "sm"
3207
3207
  }),
3208
- w[5] || (w[5] = ze(" Change Logs "))
3208
+ $[5] || ($[5] = ze(" Change Logs "))
3209
3209
  ]),
3210
3210
  e("div", wn, [
3211
3211
  e("table", $n, [
3212
- w[6] || (w[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
3212
+ $[6] || ($[6] = e("thead", { class: "bg-fm-color-neutral-gray-50" }, [
3213
3213
  e("tr", { class: "border-b border-fm-color-neutral-gray-200" }, [
3214
3214
  e("th", {
3215
3215
  class: "text-left p-3 fm-typo-en-body-md-600",
@@ -3226,36 +3226,36 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3226
3226
  ])
3227
3227
  ], -1)),
3228
3228
  e("tbody", null, [
3229
- (l(!0), h(Ce, null, Ee(v.value, (A, Z) => (l(), h("tr", {
3230
- key: Z,
3229
+ (l(!0), h(Ce, null, Ee(p.value, (E, J) => (l(), h("tr", {
3230
+ key: J,
3231
3231
  class: "border-b border-fm-color-neutral-gray-200 last:border-b-0"
3232
3232
  }, [
3233
- e("td", Cn, x(d(A._dateiso8601)), 1),
3234
- e("td", Dn, x(A._rolename), 1),
3235
- e("td", Rn, x(A._employeename), 1),
3236
- e("td", Nn, x(A._contextname), 1),
3233
+ e("td", Cn, x(u(E._dateiso8601)), 1),
3234
+ e("td", Dn, x(E._rolename), 1),
3235
+ e("td", Rn, x(E._employeename), 1),
3236
+ e("td", Nn, x(E._contextname), 1),
3237
3237
  e("td", {
3238
- class: Ue(`p-3 fm-typo-en-body-sm-600 ${n(Number(A.type) - 1)}`)
3239
- }, x(_(Le)[Number(A.type) - 1]), 3),
3240
- e("td", An, x(A.lineid || ""), 1),
3241
- e("td", Tn, x(A._fieldname), 1),
3242
- e("td", Pn, x(A.oldvalue || ""), 1),
3243
- e("td", In, x(A.newvalue || ""), 1)
3238
+ class: Ue(`p-3 fm-typo-en-body-sm-600 ${o(Number(E.type) - 1)}`)
3239
+ }, x(_(Le)[Number(E.type) - 1]), 3),
3240
+ e("td", An, x(E.lineid || ""), 1),
3241
+ e("td", Tn, x(E._fieldname), 1),
3242
+ e("td", Pn, x(E.oldvalue || ""), 1),
3243
+ e("td", In, x(E.newvalue || ""), 1)
3244
3244
  ]))), 128))
3245
3245
  ])
3246
3246
  ])
3247
3247
  ])
3248
- ])) : (l(), h("div", Fn, w[7] || (w[7] = [
3248
+ ])) : (l(), h("div", Fn, $[7] || ($[7] = [
3249
3249
  e("p", null, "No change logs available.", -1)
3250
3250
  ])))
3251
3251
  ]),
3252
- "dialog-footer": ie(() => [
3253
- V(C, {
3252
+ "dialog-footer": ce(() => [
3253
+ L(D, {
3254
3254
  class: "ml-auto sm:w-full xs:w-full",
3255
3255
  label: "Close",
3256
3256
  size: "md",
3257
3257
  variant: "primary",
3258
- onClick: w[1] || (w[1] = (A) => c.value = !1)
3258
+ onClick: $[1] || ($[1] = (E) => c.value = !1)
3259
3259
  })
3260
3260
  ]),
3261
3261
  _: 1
@@ -3339,68 +3339,68 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3339
3339
  },
3340
3340
  emits: ["update:show", "submitted"],
3341
3341
  setup(b, { emit: s }) {
3342
- const o = b, c = s, f = ft(), u = Qe(), v = He(), t = Me(), n = mt(), { hasOrderDraftPermission: d } = ls(), S = ns();
3343
- function w(r) {
3344
- const a = r.isCustomCost, O = r.totalCost;
3345
- return a != null ? a === !0 : O != null;
3342
+ const n = b, c = s, v = ft(), d = Qe(), p = He(), t = Me(), o = mt(), { hasOrderDraftPermission: u } = ls(), k = ns();
3343
+ function $(r) {
3344
+ const a = r.isCustomCost, w = r.totalCost;
3345
+ return a != null ? a === !0 : w != null;
3346
3346
  }
3347
3347
  Ge(
3348
- () => o.purchaseOrder,
3348
+ () => n.purchaseOrder,
3349
3349
  (r) => {
3350
- S.init(r);
3350
+ k.init(r);
3351
3351
  },
3352
3352
  { immediate: !0 }
3353
3353
  );
3354
- const C = j(
3354
+ const D = j(
3355
3355
  () => {
3356
3356
  var r, a;
3357
3357
  return {
3358
- id: ((r = n.sessionUser.value) == null ? void 0 : r.id) ?? "",
3359
- name: ((a = n.sessionUser.value) == null ? void 0 : a.displayName) ?? ""
3358
+ id: ((r = o.sessionUser.value) == null ? void 0 : r.id) ?? "",
3359
+ name: ((a = o.sessionUser.value) == null ? void 0 : a.displayName) ?? ""
3360
3360
  };
3361
3361
  }
3362
- ), D = as(), { t: $ } = dt(), M = j(
3362
+ ), T = as(), { t: S } = dt(), F = j(
3363
3363
  () => {
3364
- var r, a, O, E;
3365
- return ((a = (r = o.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : a.internal) === "restaurant" || ((E = (O = o.purchaseOrder) == null ? void 0 : O.supplier) == null ? void 0 : E.internal) === "warehouse" ? et.enum.transfer : et.enum.purchase;
3364
+ var r, a, w, q;
3365
+ return ((a = (r = n.purchaseOrder) == null ? void 0 : r.supplier) == null ? void 0 : a.internal) === "restaurant" || ((q = (w = n.purchaseOrder) == null ? void 0 : w.supplier) == null ? void 0 : q.internal) === "warehouse" ? et.enum.transfer : et.enum.purchase;
3366
3366
  }
3367
- ), A = j(() => {
3368
- var O;
3369
- const r = (O = o.shipments) == null ? void 0 : O.find((E) => {
3367
+ ), E = j(() => {
3368
+ var w;
3369
+ const r = (w = n.shipments) == null ? void 0 : w.find((q) => {
3370
3370
  var W;
3371
- return E.ref === ((W = o.purchaseOrder) == null ? void 0 : W._id);
3371
+ return q.ref === ((W = n.purchaseOrder) == null ? void 0 : W._id);
3372
3372
  });
3373
3373
  let a = null;
3374
3374
  if (r != null && r.milestones && r.milestones.length > 0) {
3375
- const E = r.milestones[r.milestones.length - 1];
3376
- if (E.estimatedTime) {
3377
- const W = new Date(E.estimatedTime), Q = W.getDate().toString().padStart(2, "0");
3375
+ const q = r.milestones[r.milestones.length - 1];
3376
+ if (q.estimatedTime) {
3377
+ const W = new Date(q.estimatedTime), Q = W.getDate().toString().padStart(2, "0");
3378
3378
  a = `${W.toLocaleString("en-US", { month: "short" })} ${Q}`;
3379
3379
  }
3380
3380
  }
3381
3381
  return a;
3382
- }), Z = X(!1), z = X(""), ce = X(!0), ge = Ye(), H = Ks(ge.getWorkflowConfig), N = os(), ne = [
3383
- q.enum.receiveStock,
3384
- q.enum.processRequest,
3385
- q.enum.closeRequest
3386
- ], I = j(() => {
3387
- if (!o.purchaseOrder)
3382
+ }), J = Z(!1), z = Z(""), ae = Z(!0), ge = Ye(), H = Ks(ge.getWorkflowConfig), R = os(), ne = [
3383
+ V.enum.receiveStock,
3384
+ V.enum.processRequest,
3385
+ V.enum.closeRequest
3386
+ ], P = j(() => {
3387
+ if (!n.purchaseOrder)
3388
3388
  return [];
3389
3389
  const r = H.result.value;
3390
3390
  if (r.state === jt.loading)
3391
3391
  return [];
3392
3392
  const a = {
3393
- user: C.value,
3393
+ user: D.value,
3394
3394
  executedAt: t.locations.computeFirst(
3395
3395
  (oe) => {
3396
- var P;
3397
- return oe.dbName === ((P = t._currentLocation) == null ? void 0 : P.dbName) ? oe : null;
3396
+ var A;
3397
+ return oe.dbName === ((A = t._currentLocation) == null ? void 0 : A.dbName) ? oe : null;
3398
3398
  }
3399
3399
  ),
3400
- purchaseOrderRequest: o.poRequest,
3401
- purchaseOrder: o.purchaseOrder
3402
- }, O = v.useOperatePurchaseOrderV2, E = v.poWorkflowAllowToMarkCompleted, W = [...ne];
3403
- O && !E && W.push(q.enum.completeReceive);
3400
+ purchaseOrderRequest: n.poRequest,
3401
+ purchaseOrder: n.purchaseOrder
3402
+ }, w = p.useOperatePurchaseOrderV2, q = p.poWorkflowAllowToMarkCompleted, W = [...ne];
3403
+ w && !q && W.push(V.enum.completeReceive);
3404
3404
  let Q = [];
3405
3405
  try {
3406
3406
  r.state === jt.error ? (console.error("Error fetching workflow config:", r.error), Q = vt.getAvailableActions({
@@ -3413,26 +3413,26 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3413
3413
  } catch (oe) {
3414
3414
  console.error("Error getting available actions:", oe);
3415
3415
  }
3416
- return o.scope === "approval" && (Q = Q.filter((oe) => oe !== q.enum.completeReceive)), d.value || (Q = Q.filter(
3417
- (oe) => oe !== q.enum.approveDraft && oe !== q.enum.rejectDraft
3416
+ return n.scope === "approval" && (Q = Q.filter((oe) => oe !== V.enum.completeReceive)), u.value || (Q = Q.filter(
3417
+ (oe) => oe !== V.enum.approveDraft && oe !== V.enum.rejectDraft
3418
3418
  )), Q;
3419
- }), R = qs(o, "show"), K = j(() => [
3419
+ }), C = qs(n, "show"), K = j(() => [
3420
3420
  {
3421
- label: $("inventory.transfer.receiveRequest.details.overview"),
3421
+ label: S("inventory.transfer.receiveRequest.details.overview"),
3422
3422
  value: "overview"
3423
3423
  },
3424
3424
  {
3425
- label: $("inventory.transfer.receiveRequest.details.deliveryHistory"),
3425
+ label: S("inventory.transfer.receiveRequest.details.deliveryHistory"),
3426
3426
  value: "deliveryHistory"
3427
3427
  }
3428
- ]), T = X(K.value[0]);
3428
+ ]), N = Z(K.value[0]);
3429
3429
  Ge(
3430
- () => o.show,
3430
+ () => n.show,
3431
3431
  (r) => {
3432
- r && (T.value = K.value[0]);
3432
+ r && (N.value = K.value[0]);
3433
3433
  }
3434
3434
  );
3435
- function J(r) {
3435
+ function X(r) {
3436
3436
  return r.map((a) => ({
3437
3437
  ...a,
3438
3438
  amount: {
@@ -3441,28 +3441,28 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3441
3441
  }
3442
3442
  }));
3443
3443
  }
3444
- async function be(r, a, O, E, W) {
3444
+ async function be(r, a, w, q, W) {
3445
3445
  return new Promise((Q, oe) => {
3446
- const P = {
3446
+ const A = {
3447
3447
  closeButton: !1,
3448
- title: E.title,
3449
- message: E.message,
3450
- primaryActions: E.primaryActions,
3448
+ title: q.title,
3449
+ message: q.message,
3450
+ primaryActions: q.primaryActions,
3451
3451
  secondaryActions: { text: "No", close: !1 }
3452
3452
  };
3453
3453
  let ue = a.rejectReason ?? "";
3454
- O === q.enum.rejectDraft && (P.contentComponent = rs, P.contentComponentProps = {
3455
- message: E.message,
3454
+ w === V.enum.rejectDraft && (A.contentComponent = rs, A.contentComponentProps = {
3455
+ message: q.message,
3456
3456
  onChange: (y) => {
3457
3457
  ue = y ?? "";
3458
3458
  }
3459
- }), f.open(P).onPrimary(async () => {
3460
- var m, g, L, B;
3459
+ }), v.open(A).onPrimary(async () => {
3460
+ var m, g, U, B;
3461
3461
  const y = [];
3462
- O === q.enum.confirmDraft || O === q.enum.submitRequest ? y.push({
3462
+ w === V.enum.confirmDraft || w === V.enum.submitRequest ? y.push({
3463
3463
  action: "confirmDraft",
3464
- payload: S.controller.value.toConfirmDraftData(De())
3465
- }) : O === q.enum.approveRequest ? (y.push({
3464
+ payload: k.controller.value.toConfirmDraftData(De())
3465
+ }) : w === V.enum.approveRequest ? (y.push({
3466
3466
  action: "approveRequest",
3467
3467
  payload: null
3468
3468
  }), a.fulfillment && y.push({
@@ -3471,45 +3471,45 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3471
3471
  fulfillmentId: "",
3472
3472
  deliveryOrderNumber: "",
3473
3473
  deliveryRemark: null,
3474
- items: J(a.fulfillment.items),
3475
- createdBy: C.value
3474
+ items: X(a.fulfillment.items),
3475
+ createdBy: D.value
3476
3476
  }
3477
- })) : O === q.enum.processRequest ? a.fulfillment && y.push({
3477
+ })) : w === V.enum.processRequest ? a.fulfillment && y.push({
3478
3478
  action: "processRequest",
3479
3479
  payload: {
3480
3480
  fulfillmentId: "",
3481
3481
  deliveryOrderNumber: "",
3482
3482
  deliveryRemark: null,
3483
- items: J(a.fulfillment.items),
3484
- createdBy: C.value
3483
+ items: X(a.fulfillment.items),
3484
+ createdBy: D.value
3485
3485
  }
3486
- }) : O === q.enum.rejectRequest ? y.push({
3486
+ }) : w === V.enum.rejectRequest ? y.push({
3487
3487
  action: "rejectRequest",
3488
3488
  payload: null
3489
- }) : O === q.enum.closeRequest ? y.push({
3489
+ }) : w === V.enum.closeRequest ? y.push({
3490
3490
  action: "closeRequest",
3491
3491
  payload: null
3492
- }) : O === q.enum.rejectDraft && y.push({
3492
+ }) : w === V.enum.rejectDraft && y.push({
3493
3493
  action: "rejectDraft",
3494
3494
  payload: {
3495
3495
  rejectReason: ue ?? ""
3496
3496
  }
3497
3497
  });
3498
3498
  try {
3499
- await N({
3499
+ await R({
3500
3500
  operate: {
3501
- operation: O,
3501
+ operation: w,
3502
3502
  doc: r,
3503
3503
  options: a
3504
3504
  },
3505
3505
  operateV2: {
3506
- _id: ((m = o.purchaseOrder) == null ? void 0 : m._id) ?? "",
3507
- _rev: ((g = o.purchaseOrder) == null ? void 0 : g._rev) ?? "",
3508
- action: O === q.enum.submitRequest ? q.enum.confirmDraft : O,
3506
+ _id: ((m = n.purchaseOrder) == null ? void 0 : m._id) ?? "",
3507
+ _rev: ((g = n.purchaseOrder) == null ? void 0 : g._rev) ?? "",
3508
+ action: w === V.enum.submitRequest ? V.enum.confirmDraft : w,
3509
3509
  payloads: y
3510
3510
  // add payload if action is receiveStock or processRequest
3511
3511
  },
3512
- transferTo: (B = (L = o.poRequest) == null ? void 0 : L.to) == null ? void 0 : B.dbName
3512
+ transferTo: (B = (U = n.poRequest) == null ? void 0 : U.to) == null ? void 0 : B.dbName
3513
3513
  }).delayed(1e3), Q("submitted");
3514
3514
  } catch (_e) {
3515
3515
  oe(_e);
@@ -3517,138 +3517,138 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3517
3517
  }).onSecondary(() => {
3518
3518
  Q("cancelled");
3519
3519
  for (let y = 0; y < W + 2; y++)
3520
- f.close();
3520
+ v.close();
3521
3521
  }).onClose(() => {
3522
3522
  });
3523
3523
  });
3524
3524
  }
3525
3525
  async function ye(r) {
3526
- var W, Q, oe, P;
3527
- if (r === q.enum.receiveStock)
3526
+ var W, Q, oe, A;
3527
+ if (r === V.enum.receiveStock)
3528
3528
  return;
3529
3529
  const a = ss[r];
3530
3530
  if (!a) {
3531
- u.open({
3531
+ d.open({
3532
3532
  title: "Something went wrong",
3533
3533
  message: `Cannot process order: ${Ot(r)}`,
3534
3534
  type: "error"
3535
3535
  });
3536
3536
  return;
3537
3537
  }
3538
- const { successMessage: O, ...E } = a;
3539
- if (o.purchaseOrder) {
3540
- z.value = `${r}`, Z.value = !0, ce.value = !1;
3538
+ const { successMessage: w, ...q } = a;
3539
+ if (n.purchaseOrder) {
3540
+ z.value = `${r}`, J.value = !0, ae.value = !1;
3541
3541
  const ue = {};
3542
3542
  let y = 0;
3543
- if ((r === q.enum.confirmDraft || // auto receive for warehouse to warehouse
3544
- r === q.enum.completeReceive) && v.autoReceiveWarehouse)
3543
+ if ((r === V.enum.confirmDraft || // auto receive for warehouse to warehouse
3544
+ r === V.enum.completeReceive) && p.autoReceiveWarehouse)
3545
3545
  ue.autoReceive = !0;
3546
- else if ((r === q.enum.approveRequest || r === q.enum.processRequest) && v.acceptRequireFulfillment) {
3547
- const m = (Q = (W = o.poRequest) == null ? void 0 : W.from) == null ? void 0 : Q.dbName, g = (P = (oe = o.poRequest) == null ? void 0 : oe.to) == null ? void 0 : P.dbName;
3546
+ else if ((r === V.enum.approveRequest || r === V.enum.processRequest) && p.acceptRequireFulfillment) {
3547
+ const m = (Q = (W = n.poRequest) == null ? void 0 : W.from) == null ? void 0 : Q.dbName, g = (A = (oe = n.poRequest) == null ? void 0 : oe.to) == null ? void 0 : A.dbName;
3548
3548
  if (m && g && (m.startsWith("warehouse_") || g.startsWith("warehouse_"))) {
3549
- const L = await new Promise((B, _e) => {
3550
- f.open({
3549
+ const U = await new Promise((B, _e) => {
3550
+ v.open({
3551
3551
  closeButton: !1,
3552
3552
  title: "Confirm transfer amount",
3553
3553
  dialogComponent: pr,
3554
3554
  dialogComponentProps: {
3555
- purchaseOrder: o.purchaseOrder,
3555
+ purchaseOrder: n.purchaseOrder,
3556
3556
  confirm: B,
3557
3557
  "onUpdate:show": ($e) => {
3558
- $e || (z.value = "", Z.value = !1, ce.value = !0, y++, f.close()), _e("cancelled");
3558
+ $e || (z.value = "", J.value = !1, ae.value = !0, y++, v.close()), _e("cancelled");
3559
3559
  }
3560
3560
  }
3561
3561
  });
3562
3562
  });
3563
- ue.fulfillment = L;
3563
+ ue.fulfillment = U;
3564
3564
  }
3565
3565
  }
3566
3566
  try {
3567
3567
  await be(
3568
- o.purchaseOrder,
3568
+ n.purchaseOrder,
3569
3569
  ue,
3570
3570
  r,
3571
3571
  a,
3572
3572
  y
3573
- ) === "submitted" && (u.open({
3573
+ ) === "submitted" && (d.open({
3574
3574
  title: "Success",
3575
- message: O,
3575
+ message: w,
3576
3576
  type: "success"
3577
3577
  }), c("update:show", !1), c("submitted"));
3578
3578
  } catch (m) {
3579
- u.open({
3579
+ d.open({
3580
3580
  title: "Something went wrong",
3581
3581
  message: m instanceof Error ? m.message : "Please try again.",
3582
3582
  type: "error"
3583
- }), console.error("Error when submitting PO operation", r, o.purchaseOrder, m);
3583
+ }), console.error("Error when submitting PO operation", r, n.purchaseOrder, m);
3584
3584
  } finally {
3585
- z.value = "", Z.value = !1, ce.value = !0;
3585
+ z.value = "", J.value = !1, ae.value = !0;
3586
3586
  }
3587
3587
  }
3588
3588
  }
3589
3589
  const pe = j(() => {
3590
3590
  var r, a;
3591
- return ((r = o.purchaseOrder) == null ? void 0 : r.status) === ve.enum.RECEIVING || ((a = o.purchaseOrder) == null ? void 0 : a.status) === ve.enum.COMPLETE;
3592
- }), fe = j(() => o.purchaseOrder ? ct(o.purchaseOrder) : {}), p = j(() => {
3593
- const r = o.purchaseOrder;
3591
+ return ((r = n.purchaseOrder) == null ? void 0 : r.status) === ve.enum.RECEIVING || ((a = n.purchaseOrder) == null ? void 0 : a.status) === ve.enum.COMPLETE;
3592
+ }), fe = j(() => n.purchaseOrder ? ct(n.purchaseOrder) : {}), f = j(() => {
3593
+ const r = n.purchaseOrder;
3594
3594
  if (!r) return { status: "", statusClass: "" };
3595
- const { partial: a, over: O } = _t(fe.value), E = St(r.status, a, O);
3596
- let W = $(`inventory.transfer.status.${E}`), Q = `${r.status}`.toLocaleLowerCase("en-us");
3597
- return E === ve.enum.CLOSE && (W = `${$(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), E === "PARTIAL_RECEIVED" && Q === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (Q = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), {
3595
+ const { partial: a, over: w } = _t(fe.value), q = St(r.status, a, w);
3596
+ let W = S(`inventory.transfer.status.${q}`), Q = `${r.status}`.toLocaleLowerCase("en-us");
3597
+ return q === ve.enum.CLOSE && (W = `${S(`inventory.transfer.status.${ve.enum.COMPLETE}`)}`), q === "PARTIAL_RECEIVED" && Q === ve.enum.PROCESSING.toLocaleLowerCase("en-us") && (Q = ve.enum.RECEIVING.toLocaleLowerCase("en-us")), {
3598
3598
  status: W,
3599
3599
  statusClass: `fm-status-badge fm-status-badge-${Q}`
3600
3600
  };
3601
3601
  }), i = j(() => {
3602
3602
  var Q, oe;
3603
- const r = ((Q = o.purchaseOrder) == null ? void 0 : Q.deliveryOrder) ?? [], a = ((oe = o.purchaseOrder) == null ? void 0 : oe.deliveryFullfillment) ?? [], O = [
3604
- ...r.map((P) => ({
3605
- createdAt: P.createdAt,
3603
+ const r = ((Q = n.purchaseOrder) == null ? void 0 : Q.deliveryOrder) ?? [], a = ((oe = n.purchaseOrder) == null ? void 0 : oe.deliveryFullfillment) ?? [], w = [
3604
+ ...r.map((A) => ({
3605
+ createdAt: A.createdAt,
3606
3606
  type: "grn",
3607
- doc: P
3607
+ doc: A
3608
3608
  })),
3609
- ...a.map((P) => ({
3610
- createdAt: P.createdAt,
3609
+ ...a.map((A) => ({
3610
+ createdAt: A.createdAt,
3611
3611
  type: "fulfillment",
3612
- doc: P
3612
+ doc: A
3613
3613
  }))
3614
3614
  ];
3615
- O.reverse().sort((P, ue) => P.createdAt.localeCompare(ue.createdAt));
3616
- function E(P) {
3617
- var m, g, L, B, _e, $e, te, he, we, Re, Ne, de;
3618
- const ue = a.findIndex((se) => se.id === P.fullfillmentId), y = [
3615
+ w.reverse().sort((A, ue) => A.createdAt.localeCompare(ue.createdAt));
3616
+ function q(A) {
3617
+ var m, g, U, B, _e, $e, te, he, we, Re, Ne, de;
3618
+ const ue = a.findIndex((se) => se.id === A.fullfillmentId), y = [
3619
3619
  (g = (m = a[ue]) == null ? void 0 : m.netSuite) != null && g.id ? {
3620
3620
  label: "Fulfillment's ref no. (Netsuite)",
3621
3621
  values: [
3622
- `${((B = (L = a[ue]) == null ? void 0 : L.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${(($e = (_e = a[ue]) == null ? void 0 : _e.netSuite) == null ? void 0 : $e.id) ?? "-"})`
3622
+ `${((B = (U = a[ue]) == null ? void 0 : U.netSuite) == null ? void 0 : B.refNo) ?? "N/A"} (${(($e = (_e = a[ue]) == null ? void 0 : _e.netSuite) == null ? void 0 : $e.id) ?? "-"})`
3623
3623
  ]
3624
3624
  } : null,
3625
- (te = P == null ? void 0 : P.netSuite) != null && te.id ? {
3625
+ (te = A == null ? void 0 : A.netSuite) != null && te.id ? {
3626
3626
  label: "Netsuite ref no.",
3627
- values: [`${((he = P == null ? void 0 : P.netSuite) == null ? void 0 : he.refNo) ?? "N/A"} (${((we = P == null ? void 0 : P.netSuite) == null ? void 0 : we.id) ?? "-"})`]
3627
+ values: [`${((he = A == null ? void 0 : A.netSuite) == null ? void 0 : he.refNo) ?? "N/A"} (${((we = A == null ? void 0 : A.netSuite) == null ? void 0 : we.id) ?? "-"})`]
3628
3628
  } : null,
3629
- (Re = P == null ? void 0 : P.netSuite) != null && Re.recordType ? {
3629
+ (Re = A == null ? void 0 : A.netSuite) != null && Re.recordType ? {
3630
3630
  label: "Netsuite Type",
3631
- values: [Jt((Ne = P == null ? void 0 : P.netSuite) == null ? void 0 : Ne.recordType)]
3631
+ values: [Jt((Ne = A == null ? void 0 : A.netSuite) == null ? void 0 : Ne.recordType)]
3632
3632
  } : null
3633
3633
  ];
3634
3634
  return {
3635
3635
  header: "Received",
3636
- deliveryOrder: P,
3637
- date: tt(new Date(P.createdAt)),
3636
+ deliveryOrder: A,
3637
+ date: tt(new Date(A.createdAt)),
3638
3638
  info: [
3639
3639
  {
3640
3640
  label: "Adjustment date",
3641
3641
  values: [
3642
- P.adjustment ? tt(new Date(at(P.adjustment))) : "-"
3642
+ A.adjustment ? tt(new Date(at(A.adjustment))) : "-"
3643
3643
  ]
3644
3644
  },
3645
3645
  {
3646
3646
  label: "Received by",
3647
- values: [(de = P.createdBy) == null ? void 0 : de.name]
3647
+ values: [(de = A.createdBy) == null ? void 0 : de.name]
3648
3648
  },
3649
3649
  {
3650
3650
  label: "Received items",
3651
- values: P.received.map((se) => {
3651
+ values: A.received.map((se) => {
3652
3652
  var Oe;
3653
3653
  return Y("div", [
3654
3654
  Y(
@@ -3723,11 +3723,11 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3723
3723
  },
3724
3724
  {
3725
3725
  label: "Delivery order no.",
3726
- values: [P.deliveryOrderNumber || "N/A"]
3726
+ values: [A.deliveryOrderNumber || "N/A"]
3727
3727
  },
3728
3728
  {
3729
3729
  label: "Remark",
3730
- values: [P.remark || "N/A"]
3730
+ values: [A.remark || "N/A"]
3731
3731
  },
3732
3732
  ue > -1 ? {
3733
3733
  label: "Fulfilment's sequence",
@@ -3737,12 +3737,12 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3737
3737
  ].filter((se) => !!se)
3738
3738
  };
3739
3739
  }
3740
- function W(P) {
3740
+ function W(A) {
3741
3741
  var y, m, g;
3742
- const ue = a.findIndex((L) => L.id === P.id);
3742
+ const ue = a.findIndex((U) => U.id === A.id);
3743
3743
  return {
3744
3744
  header: "Fulfillment",
3745
- date: tt(new Date(P.createdAt)),
3745
+ date: tt(new Date(A.createdAt)),
3746
3746
  info: [
3747
3747
  {
3748
3748
  label: "Sequence",
@@ -3750,7 +3750,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3750
3750
  },
3751
3751
  {
3752
3752
  label: "Receiveable items",
3753
- values: P.items.map((L) => {
3753
+ values: A.items.map((U) => {
3754
3754
  var B;
3755
3755
  return Y("div", [
3756
3756
  Y(
@@ -3770,14 +3770,14 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3770
3770
  {
3771
3771
  class: "fm-typo-en-body-lg-800 basis-1/2 shrink-0 grow"
3772
3772
  },
3773
- `${L.sku.name}`
3773
+ `${U.sku.name}`
3774
3774
  ),
3775
3775
  Y(
3776
3776
  "span",
3777
3777
  {
3778
3778
  class: "fm-typo-en-body-md-400"
3779
3779
  },
3780
- `${L.sku.code} `
3780
+ `${U.sku.code} `
3781
3781
  )
3782
3782
  ]
3783
3783
  ),
@@ -3798,14 +3798,14 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3798
3798
  {
3799
3799
  class: "fm-typo-en-body-lg-600 self-end"
3800
3800
  },
3801
- xe(L.amount, !1)
3801
+ xe(U.amount, !1)
3802
3802
  ),
3803
3803
  Y(
3804
3804
  "span",
3805
3805
  {
3806
3806
  class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary"
3807
3807
  },
3808
- ((B = L.measurement) == null ? void 0 : B.abbrev) ?? L.sku.unit.abbrev
3808
+ ((B = U.measurement) == null ? void 0 : B.abbrev) ?? U.sku.unit.abbrev
3809
3809
  )
3810
3810
  ]
3811
3811
  ),
@@ -3814,7 +3814,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3814
3814
  {
3815
3815
  class: "flex self-end fm-typo-en-body-md-400 text-fm-color-typo-secondary"
3816
3816
  },
3817
- `${L.cost ? `(${ot(L.cost)})` : ""}`
3817
+ `${U.cost ? `(${ot(U.cost)})` : ""}`
3818
3818
  )
3819
3819
  ]
3820
3820
  )
@@ -3823,100 +3823,100 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3823
3823
  ]);
3824
3824
  })
3825
3825
  },
3826
- (y = P.netSuite) != null && y.refNo ? {
3826
+ (y = A.netSuite) != null && y.refNo ? {
3827
3827
  label: "Netsuite Ref no. (ID)",
3828
- values: [`${(m = P.netSuite) == null ? void 0 : m.refNo} (${((g = P.netSuite) == null ? void 0 : g.id) ?? "-"})`]
3828
+ values: [`${(m = A.netSuite) == null ? void 0 : m.refNo} (${((g = A.netSuite) == null ? void 0 : g.id) ?? "-"})`]
3829
3829
  } : null
3830
- ].filter((L) => !!L)
3830
+ ].filter((U) => !!U)
3831
3831
  };
3832
3832
  }
3833
- return O.map(
3834
- (P) => P.type === "grn" ? E(P.doc) : W(P.doc)
3833
+ return w.map(
3834
+ (A) => A.type === "grn" ? q(A.doc) : W(A.doc)
3835
3835
  );
3836
3836
  });
3837
- function k(r) {
3837
+ function O(r) {
3838
3838
  var Q;
3839
- const O = (((Q = o.purchaseOrder) == null ? void 0 : Q.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, E = o.receivedMap[O], W = G(r);
3840
- return E ? `<span class="${W} fm-typo-en-body-lg-600">${Ae.toFormatString({ value: E.received })}</span>/${it(r.quantity, r.sku.unit, r.measurement)}` : `<span class="fm-typo-en-body-lg-600">-</span>/${it(r.quantity, r.sku.unit, r.measurement)}`;
3839
+ const w = (((Q = n.purchaseOrder) == null ? void 0 : Q.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, q = n.receivedMap[w], W = G(r);
3840
+ return q ? `<span class="${W} fm-typo-en-body-lg-600">${Ae.toFormatString({ value: q.received })}</span>/${it(r.quantity, r.sku.unit, r.measurement)}` : `<span class="fm-typo-en-body-lg-600">-</span>/${it(r.quantity, r.sku.unit, r.measurement)}`;
3841
3841
  }
3842
- function U(r) {
3843
- const a = o.purchaseOrder;
3842
+ function M(r) {
3843
+ const a = n.purchaseOrder;
3844
3844
  if (!(a != null && a.itemsAtSubmission)) return !1;
3845
- const O = a.version === Fe.enum[2], E = O ? r.id : r.sku._id;
3846
- return E == null ? !1 : !a.itemsAtSubmission.some((W) => (O ? W.id : W.sku._id) === E);
3845
+ const w = a.version === Fe.enum[2], q = w ? r.id : r.sku._id;
3846
+ return q == null ? !1 : !a.itemsAtSubmission.some((W) => (w ? W.id : W.sku._id) === q);
3847
3847
  }
3848
3848
  function G(r) {
3849
3849
  var ue;
3850
- const O = (((ue = o.purchaseOrder) == null ? void 0 : ue.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, E = o.receivedMap[O], { isPartialReceive: W, isNoReceive: Q, isOverReceive: oe, isFullReceive: P } = ir(E);
3851
- return Q ? "text-fm-color-typo-tertiary" : W ? "text-fm-color-system-warning-300" : oe ? "text-fm-color-system-error-300" : P ? "text-fm-color-system-success-300" : "";
3850
+ const w = (((ue = n.purchaseOrder) == null ? void 0 : ue.version) ?? Fe.enum[1]) === Fe.enum[2] ? r.id : r.sku._id, q = n.receivedMap[w], { isPartialReceive: W, isNoReceive: Q, isOverReceive: oe, isFullReceive: A } = ir(q);
3851
+ return Q ? "text-fm-color-typo-tertiary" : W ? "text-fm-color-system-warning-300" : oe ? "text-fm-color-system-error-300" : A ? "text-fm-color-system-success-300" : "";
3852
3852
  }
3853
- const le = j(() => {
3854
- var r, a, O;
3855
- return (r = o.purchaseOrder) != null && r.itemsAtSubmission ? ((a = o.purchaseOrder) == null ? void 0 : a.version) === Fe.enum[2] ? o.purchaseOrder.items.reduce((E, W) => {
3856
- var oe, P;
3857
- const Q = (P = (oe = o.purchaseOrder) == null ? void 0 : oe.itemsAtSubmission) == null ? void 0 : P.find(
3853
+ const ie = j(() => {
3854
+ var r, a, w;
3855
+ return (r = n.purchaseOrder) != null && r.itemsAtSubmission ? ((a = n.purchaseOrder) == null ? void 0 : a.version) === Fe.enum[2] ? n.purchaseOrder.items.reduce((q, W) => {
3856
+ var oe, A;
3857
+ const Q = (A = (oe = n.purchaseOrder) == null ? void 0 : oe.itemsAtSubmission) == null ? void 0 : A.find(
3858
3858
  (ue) => ue.id === W.id
3859
3859
  );
3860
- return Q && Q.quantity !== W.quantity && E.set(W.sku.code, {
3860
+ return Q && Q.quantity !== W.quantity && q.set(W.sku.code, {
3861
3861
  originalAmount: Number(Ae.toFormatString({ value: Q.quantity })),
3862
3862
  newAmount: Number(Ae.toFormatString({ value: W.quantity }))
3863
- }), E;
3864
- }, /* @__PURE__ */ new Map()) : (O = o.purchaseOrder) == null ? void 0 : O.items.reduce((E, W) => {
3863
+ }), q;
3864
+ }, /* @__PURE__ */ new Map()) : (w = n.purchaseOrder) == null ? void 0 : w.items.reduce((q, W) => {
3865
3865
  var ue, y;
3866
- const Q = (y = (ue = o.purchaseOrder) == null ? void 0 : ue.itemsAtSubmission) == null ? void 0 : y.find(
3866
+ const Q = (y = (ue = n.purchaseOrder) == null ? void 0 : ue.itemsAtSubmission) == null ? void 0 : y.find(
3867
3867
  (m) => m.sku._id === W.sku._id
3868
- ), oe = Q ? Number(Ae.toFormatString({ value: Q.quantity })) : 0, P = Number(Ae.toFormatString({ value: W.quantity }));
3869
- return Q && oe !== P && E.set(W.sku.code, {
3868
+ ), oe = Q ? Number(Ae.toFormatString({ value: Q.quantity })) : 0, A = Number(Ae.toFormatString({ value: W.quantity }));
3869
+ return Q && oe !== A && q.set(W.sku.code, {
3870
3870
  originalAmount: oe,
3871
- newAmount: P
3872
- }), E;
3871
+ newAmount: A
3872
+ }), q;
3873
3873
  }, /* @__PURE__ */ new Map()) : /* @__PURE__ */ new Map();
3874
3874
  }), ee = (r) => {
3875
- var O, E;
3876
- const a = le.value;
3877
- return ((O = o.purchaseOrder) == null ? void 0 : O.version) === Fe.enum[2] ? a.has(r.id) : a.has((E = r.sku) == null ? void 0 : E.code);
3875
+ var w, q;
3876
+ const a = ie.value;
3877
+ return ((w = n.purchaseOrder) == null ? void 0 : w.version) === Fe.enum[2] ? a.has(r.id) : a.has((q = r.sku) == null ? void 0 : q.code);
3878
3878
  }, ke = (r) => {
3879
- var O, E;
3880
- const a = le.value;
3881
- return ((O = o.purchaseOrder) == null ? void 0 : O.version) === Fe.enum[2] ? a.get(r.id) : a.get((E = r.sku) == null ? void 0 : E.code);
3882
- }, ae = j(() => {
3883
- const r = o.purchaseOrder;
3879
+ var w, q;
3880
+ const a = ie.value;
3881
+ return ((w = n.purchaseOrder) == null ? void 0 : w.version) === Fe.enum[2] ? a.get(r.id) : a.get((q = r.sku) == null ? void 0 : q.code);
3882
+ }, le = j(() => {
3883
+ const r = n.purchaseOrder;
3884
3884
  if (!r) return "";
3885
- const a = r.actionChangelogs ?? [], O = a.length ? a[a.length - 1] : null;
3886
- if (O && O.action === "rejectDraft") {
3887
- const E = O.remarks ?? "";
3888
- return E && E.toString().trim() !== "" ? E.toString() : "-";
3885
+ const a = r.actionChangelogs ?? [], w = a.length ? a[a.length - 1] : null;
3886
+ if (w && w.action === "rejectDraft") {
3887
+ const q = w.remarks ?? "";
3888
+ return q && q.toString().trim() !== "" ? q.toString() : "-";
3889
3889
  }
3890
3890
  return "";
3891
3891
  });
3892
3892
  return (r, a) => {
3893
- const O = re("FmButton"), E = re("FmButtonGroup"), W = re("FmChip"), Q = re("FmIcon"), oe = re("FmMenuDivider"), P = re("FmCard"), ue = re("FmTooltip"), y = re("FmSpacer"), m = re("FmSideSheet");
3893
+ const w = re("FmButton"), q = re("FmButtonGroup"), W = re("FmChip"), Q = re("FmIcon"), oe = re("FmMenuDivider"), A = re("FmCard"), ue = re("FmTooltip"), y = re("FmSpacer"), m = re("FmSideSheet");
3894
3894
  return l(), me(m, {
3895
- modelValue: _(R),
3896
- "onUpdate:modelValue": a[8] || (a[8] = (g) => Ss(R) ? R.value = g : null),
3897
- "dismiss-away": ce.value,
3895
+ modelValue: _(C),
3896
+ "onUpdate:modelValue": a[8] || (a[8] = (g) => Ss(C) ? C.value = g : null),
3897
+ "dismiss-away": ae.value,
3898
3898
  "max-width": 600,
3899
3899
  "close-button": !1
3900
3900
  }, {
3901
- "side-sheet-header": ie(() => {
3902
- var g, L;
3901
+ "side-sheet-header": ce(() => {
3902
+ var g, U;
3903
3903
  return [
3904
3904
  e("div", qn, [
3905
3905
  e("div", Vn, [
3906
- e("div", Ln, x(_($)("inventory.transfer.receiveRequest.details.title") + ((g = r.purchaseOrder) != null && g.seqNumber ? ` #${(L = r.purchaseOrder) == null ? void 0 : L.seqNumber}` : "")), 1),
3907
- V(O, {
3906
+ e("div", Ln, x(_(S)("inventory.transfer.receiveRequest.details.title") + ((g = r.purchaseOrder) != null && g.seqNumber ? ` #${(U = r.purchaseOrder) == null ? void 0 : U.seqNumber}` : "")), 1),
3907
+ L(w, {
3908
3908
  class: "ml-auto -m-2",
3909
3909
  variant: "tertiary",
3910
3910
  "prepend-icon": "close",
3911
3911
  onClick: a[0] || (a[0] = (B) => c("update:show", !1))
3912
3912
  })
3913
3913
  ]),
3914
- V(E, {
3914
+ L(q, {
3915
3915
  items: K.value,
3916
- modelValue: T.value,
3917
- "onUpdate:modelValue": a[1] || (a[1] = (B) => T.value = B)
3916
+ modelValue: N.value,
3917
+ "onUpdate:modelValue": a[1] || (a[1] = (B) => N.value = B)
3918
3918
  }, null, 8, ["items", "modelValue"]),
3919
- r.purchaseOrder && T.value.value === "deliveryHistory" ? (l(), me(_n, {
3919
+ r.purchaseOrder && N.value.value === "deliveryHistory" ? (l(), me(_n, {
3920
3920
  key: 0,
3921
3921
  "purchase-order": r.purchaseOrder,
3922
3922
  "received-info-map": fe.value,
@@ -3924,112 +3924,112 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
3924
3924
  onSubmitted: a[2] || (a[2] = () => {
3925
3925
  c("update:show", !1), c("submitted");
3926
3926
  })
3927
- }, null, 8, ["purchase-order", "received-info-map", "received-map"])) : F("", !0)
3927
+ }, null, 8, ["purchase-order", "received-info-map", "received-map"])) : I("", !0)
3928
3928
  ])
3929
3929
  ];
3930
3930
  }),
3931
- default: ie(() => {
3932
- var g, L, B, _e, $e;
3931
+ default: ce(() => {
3932
+ var g, U, B, _e, $e;
3933
3933
  return [
3934
3934
  e("div", Un, [
3935
- T.value.value === "overview" ? (l(), h(Ce, { key: 0 }, [
3935
+ N.value.value === "overview" ? (l(), h(Ce, { key: 0 }, [
3936
3936
  e("div", null, [
3937
- V(P, {
3937
+ L(A, {
3938
3938
  variant: "outlined",
3939
3939
  class: "flex flex-col gap-8 px-12 py-16"
3940
3940
  }, {
3941
- default: ie(() => {
3941
+ default: ce(() => {
3942
3942
  var te, he, we, Re, Ne, de, se, Oe, Te, Ie;
3943
3943
  return [
3944
3944
  e("div", Mn, [
3945
- e("div", jn, x(_($)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
3945
+ e("div", jn, x(_(S)("inventory.transfer.receiveRequest.details.requestSummary")), 1),
3946
3946
  e("div", Bn, [
3947
- V(W, {
3948
- label: p.value.status,
3949
- class: Ue(p.value.statusClass),
3947
+ L(W, {
3948
+ label: f.value.status,
3949
+ class: Ue(f.value.statusClass),
3950
3950
  compact: ""
3951
3951
  }, null, 8, ["label", "class"]),
3952
- A.value ? (l(), h("div", zn, [
3953
- V(Q, {
3952
+ E.value ? (l(), h("div", zn, [
3953
+ L(Q, {
3954
3954
  name: "local_shipping",
3955
3955
  color: "#666666"
3956
3956
  }),
3957
- e("span", Kn, x(A.value), 1)
3958
- ])) : F("", !0)
3957
+ e("span", Kn, x(E.value), 1)
3958
+ ])) : I("", !0)
3959
3959
  ])
3960
3960
  ]),
3961
- V(oe),
3961
+ L(oe),
3962
3962
  e("div", Hn, [
3963
- V(Ht, { title: "Debug Info" }, {
3964
- default: ie(() => {
3963
+ L(Ht, { title: "Debug Info" }, {
3964
+ default: ce(() => {
3965
3965
  var rt, Ct, Dt, Rt, Nt, At, Tt, Pt, It, Ft, Et, qt;
3966
3966
  return [
3967
3967
  (rt = r.purchaseOrder) != null && rt._id ? (l(), h("div", Gn, [
3968
3968
  a[9] || (a[9] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order ID ", -1)),
3969
3969
  e("span", Wn, x((Ct = r.purchaseOrder) == null ? void 0 : Ct._id), 1)
3970
- ])) : F("", !0),
3970
+ ])) : I("", !0),
3971
3971
  (Dt = r.purchaseOrder) != null && Dt.status ? (l(), h("div", Qn, [
3972
3972
  a[10] || (a[10] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Purchase Order Status ", -1)),
3973
3973
  e("span", Yn, x((Rt = r.purchaseOrder) == null ? void 0 : Rt.status), 1)
3974
- ])) : F("", !0),
3974
+ ])) : I("", !0),
3975
3975
  (At = (Nt = r.purchaseOrder) == null ? void 0 : Nt.supplier) != null && At._id ? (l(), h("div", Jn, [
3976
3976
  a[11] || (a[11] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Source Location ID ", -1)),
3977
3977
  e("span", Xn, x(((Pt = (Tt = r.purchaseOrder) == null ? void 0 : Tt.supplier) == null ? void 0 : Pt.internal) != null ? `${(Ft = (It = r.purchaseOrder) == null ? void 0 : It.supplier) == null ? void 0 : Ft.internal}_` : "") + x((qt = (Et = r.purchaseOrder) == null ? void 0 : Et.supplier) == null ? void 0 : qt._id), 1)
3978
- ])) : F("", !0),
3978
+ ])) : I("", !0),
3979
3979
  r.transferToDbName ? (l(), h("div", Zn, [
3980
3980
  a[12] || (a[12] = e("span", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, " Destination Location ID ", -1)),
3981
3981
  e("span", ea, x(r.transferToDbName), 1)
3982
- ])) : F("", !0)
3982
+ ])) : I("", !0)
3983
3983
  ];
3984
3984
  }),
3985
3985
  _: 1
3986
3986
  }),
3987
3987
  e("div", ta, [
3988
3988
  e("div", sa, [
3989
- e("div", ra, x(_($)("inventory.transfer.receiveRequest.details.createdAt")), 1)
3989
+ e("div", ra, x(_(S)("inventory.transfer.receiveRequest.details.createdAt")), 1)
3990
3990
  ]),
3991
3991
  e("div", oa, x(_(st)(((te = r.purchaseOrder) == null ? void 0 : te._id) ?? "")), 1)
3992
3992
  ]),
3993
3993
  (he = r.purchaseOrder) != null && he.effectiveAt ? (l(), h("div", na, [
3994
- e("div", aa, x(_($)("inventory.transfer.receiveRequest.details.date")), 1),
3994
+ e("div", aa, x(_(S)("inventory.transfer.receiveRequest.details.date")), 1),
3995
3995
  e("div", la, x(_(wt)(new Date((we = r.purchaseOrder) == null ? void 0 : we.effectiveAt))), 1)
3996
- ])) : F("", !0),
3996
+ ])) : I("", !0),
3997
3997
  e("div", ia, [
3998
- e("div", ca, x(_($)("inventory.transfer.receiveRequest.details.type.title")), 1),
3999
- e("div", ua, x(_($)(
4000
- `inventory.transfer.receiveRequest.details.type.${M.value.toLocaleLowerCase("en-US")}`
3998
+ e("div", ca, x(_(S)("inventory.transfer.receiveRequest.details.type.title")), 1),
3999
+ e("div", ua, x(_(S)(
4000
+ `inventory.transfer.receiveRequest.details.type.${F.value.toLocaleLowerCase("en-US")}`
4001
4001
  )), 1)
4002
4002
  ]),
4003
4003
  (Ne = (Re = r.purchaseOrder) == null ? void 0 : Re.supplier) != null && Ne.name ? (l(), h("div", da, [
4004
- e("div", ma, x(_($)("inventory.transfer.receiveRequest.details.from")), 1),
4004
+ e("div", ma, x(_(S)("inventory.transfer.receiveRequest.details.from")), 1),
4005
4005
  e("div", pa, x((se = (de = r.purchaseOrder) == null ? void 0 : de.supplier) == null ? void 0 : se.name), 1)
4006
- ])) : F("", !0),
4006
+ ])) : I("", !0),
4007
4007
  r.transferTo ? (l(), h("div", fa, [
4008
- e("div", va, x(_($)("inventory.transfer.receiveRequest.details.to")), 1),
4008
+ e("div", va, x(_(S)("inventory.transfer.receiveRequest.details.to")), 1),
4009
4009
  e("div", ya, x(r.transferTo), 1)
4010
- ])) : F("", !0),
4010
+ ])) : I("", !0),
4011
4011
  (Oe = r.purchaseOrder) != null && Oe.ref ? (l(), h("div", ba, [
4012
- e("div", ha, x(_($)("inventory.transfer.receiveRequest.details.reference")), 1),
4012
+ e("div", ha, x(_(S)("inventory.transfer.receiveRequest.details.reference")), 1),
4013
4013
  e("div", ga, x(r.purchaseOrder.ref), 1)
4014
- ])) : F("", !0),
4014
+ ])) : I("", !0),
4015
4015
  (Te = r.purchaseOrder) != null && Te.remark ? (l(), h("div", _a, [
4016
- e("div", Sa, x(_($)("inventory.transfer.receiveRequest.details.remark")), 1),
4016
+ e("div", Sa, x(_(S)("inventory.transfer.receiveRequest.details.remark")), 1),
4017
4017
  e("div", xa, x(r.purchaseOrder.remark), 1)
4018
- ])) : F("", !0),
4019
- ((Ie = r.purchaseOrder) == null ? void 0 : Ie.status) === _(ve).enum.DRAFT && ae.value ? (l(), h("div", ka, [
4020
- e("div", Oa, x(_($)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
4021
- e("div", wa, x(ae.value !== "" ? ae.value : "-"), 1)
4022
- ])) : F("", !0)
4018
+ ])) : I("", !0),
4019
+ ((Ie = r.purchaseOrder) == null ? void 0 : Ie.status) === _(ve).enum.DRAFT && le.value ? (l(), h("div", ka, [
4020
+ e("div", Oa, x(_(S)("inventory.transfer.receiveRequest.details.rejectionReason")), 1),
4021
+ e("div", wa, x(le.value !== "" ? le.value : "-"), 1)
4022
+ ])) : I("", !0)
4023
4023
  ])
4024
4024
  ];
4025
4025
  }),
4026
4026
  _: 1
4027
4027
  })
4028
4028
  ]),
4029
- V(co, {
4029
+ L(co, {
4030
4030
  "po-request": r.poRequest,
4031
4031
  purchaseOrder: r.purchaseOrder,
4032
- transferType: M.value,
4032
+ transferType: F.value,
4033
4033
  transferToDbName: r.transferToDbName,
4034
4034
  scope: r.scope
4035
4035
  }, null, 8, ["po-request", "purchaseOrder", "transferType", "transferToDbName", "scope"]),
@@ -4037,14 +4037,14 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4037
4037
  e("div", Ca, [
4038
4038
  e("div", Da, [
4039
4039
  e("span", Ra, [
4040
- ze(x(pe.value ? _($)("inventory.transfer.receiveRequest.details.receivedItems") : _($)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
4041
- (L = (g = r.purchaseOrder) == null ? void 0 : g.netSuite) != null && L.missingItems && ((_e = (B = r.purchaseOrder) == null ? void 0 : B.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (l(), me(ue, {
4040
+ ze(x(pe.value ? _(S)("inventory.transfer.receiveRequest.details.receivedItems") : _(S)("inventory.transfer.receiveRequest.details.requestedItems")) + " ", 1),
4041
+ (U = (g = r.purchaseOrder) == null ? void 0 : g.netSuite) != null && U.missingItems && ((_e = (B = r.purchaseOrder) == null ? void 0 : B.netSuite) == null ? void 0 : _e.missingItems.length) > 0 ? (l(), me(ue, {
4042
4042
  key: 0,
4043
4043
  variant: "rich",
4044
4044
  placement: "top",
4045
4045
  "z-index": 51
4046
4046
  }, {
4047
- content: ie(() => {
4047
+ content: ce(() => {
4048
4048
  var te, he;
4049
4049
  return [
4050
4050
  e("div", Na, [
@@ -4052,7 +4052,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4052
4052
  class: "flex justify-center align-middle",
4053
4053
  key: Re
4054
4054
  }, [
4055
- V(Q, {
4055
+ L(Q, {
4056
4056
  name: "arrow_right",
4057
4057
  size: "sm"
4058
4058
  }),
@@ -4061,18 +4061,18 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4061
4061
  ])
4062
4062
  ];
4063
4063
  }),
4064
- default: ie(() => [
4065
- V(Q, {
4064
+ default: ce(() => [
4065
+ L(Q, {
4066
4066
  name: "error",
4067
4067
  color: "#ff2c2c",
4068
4068
  size: "sm"
4069
4069
  })
4070
4070
  ]),
4071
4071
  _: 1
4072
- })) : F("", !0)
4072
+ })) : I("", !0)
4073
4073
  ])
4074
4074
  ]),
4075
- V(oe),
4075
+ L(oe),
4076
4076
  (l(!0), h(Ce, null, Ee((($e = r.purchaseOrder) == null ? void 0 : $e.items) ?? [], (te, he) => {
4077
4077
  var we;
4078
4078
  return l(), h("div", {
@@ -4082,31 +4082,31 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4082
4082
  e("div", Aa, [
4083
4083
  e("div", Ta, [
4084
4084
  ze(x(te.name) + " ", 1),
4085
- U(te) ? (l(), me(ue, {
4085
+ M(te) ? (l(), me(ue, {
4086
4086
  key: 0,
4087
4087
  variant: "rich",
4088
4088
  placement: "top",
4089
4089
  "z-index": 51
4090
4090
  }, {
4091
- content: ie(() => a[13] || (a[13] = [
4091
+ content: ce(() => a[13] || (a[13] = [
4092
4092
  e("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Extra item (added during delivery) ", -1)
4093
4093
  ])),
4094
- default: ie(() => [
4095
- V(Q, {
4094
+ default: ce(() => [
4095
+ L(Q, {
4096
4096
  name: "add_circle",
4097
4097
  color: "#6b7280",
4098
4098
  size: "sm"
4099
4099
  })
4100
4100
  ]),
4101
4101
  _: 1
4102
- })) : F("", !0),
4102
+ })) : I("", !0),
4103
4103
  ee(te) ? (l(), me(ue, {
4104
4104
  key: 1,
4105
4105
  variant: "rich",
4106
4106
  placement: "top",
4107
4107
  "z-index": 51
4108
4108
  }, {
4109
- content: ie(() => {
4109
+ content: ce(() => {
4110
4110
  var Re, Ne;
4111
4111
  return [
4112
4112
  e("div", Pa, [
@@ -4116,51 +4116,51 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4116
4116
  ])
4117
4117
  ];
4118
4118
  }),
4119
- default: ie(() => [
4120
- V(Q, {
4119
+ default: ce(() => [
4120
+ L(Q, {
4121
4121
  name: "error",
4122
4122
  color: "#ff9500",
4123
4123
  size: "sm"
4124
4124
  })
4125
4125
  ]),
4126
4126
  _: 2
4127
- }, 1024)) : F("", !0)
4127
+ }, 1024)) : I("", !0)
4128
4128
  ]),
4129
4129
  e("div", Ia, [
4130
4130
  e("span", {
4131
- innerHTML: k(te)
4131
+ innerHTML: O(te)
4132
4132
  }, null, 8, Fa)
4133
4133
  ])
4134
4134
  ]),
4135
4135
  e("div", Ea, [
4136
4136
  e("div", qa, x(te.code), 1),
4137
- _(v).enableTotalCost ? (l(), h("div", Va, [
4137
+ _(p).enableTotalCost ? (l(), h("div", Va, [
4138
4138
  e("span", La, x(_(ot)(
4139
- (we = te.totalCost) != null && we.amount ? te.totalCost : _(S).controller.value.getItemCost(te, _(De)()).cost
4139
+ (we = te.totalCost) != null && we.amount ? te.totalCost : _(k).controller.value.getItemCost(te, _(De)()).cost
4140
4140
  )), 1),
4141
- w(te) ? F("", !0) : (l(), h("span", Ua, [
4141
+ $(te) ? I("", !0) : (l(), h("span", Ua, [
4142
4142
  a[15] || (a[15] = e("span", { class: "w-1.5 h-1.5 rounded-full bg-gray-400" }, null, -1)),
4143
- ze(" " + x(_($)("inventory.transfer.form.items.autoCalculated")), 1)
4143
+ ze(" " + x(_(S)("inventory.transfer.form.items.autoCalculated")), 1)
4144
4144
  ]))
4145
- ])) : F("", !0)
4145
+ ])) : I("", !0)
4146
4146
  ])
4147
4147
  ]);
4148
4148
  }), 128)),
4149
- +_(xe)(_(S).controller.value.getTotalCosts()) ? (l(), h(Ce, { key: 0 }, [
4149
+ +_(xe)(_(k).controller.value.getTotalCosts()) ? (l(), h(Ce, { key: 0 }, [
4150
4150
  e("div", Ma, [
4151
- V(oe)
4151
+ L(oe)
4152
4152
  ]),
4153
4153
  e("div", ja, [
4154
4154
  a[16] || (a[16] = e("div", { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, "Total:", -1)),
4155
4155
  e("div", Ba, x(_(De)()) + " " + x(_(ot)({
4156
- ..._(S).controller.value.getTotalCosts(),
4156
+ ..._(k).controller.value.getTotalCosts(),
4157
4157
  currency: _(De)()
4158
4158
  }).replace(/[^0-9.,]/g, "")), 1)
4159
4159
  ])
4160
- ], 64)) : F("", !0)
4160
+ ], 64)) : I("", !0)
4161
4161
  ])
4162
4162
  ])
4163
- ], 64)) : T.value.value === "deliveryHistory" ? (l(), h("div", za, [
4163
+ ], 64)) : N.value.value === "deliveryHistory" ? (l(), h("div", za, [
4164
4164
  i.value.length ? (l(), h("div", Qa, [
4165
4165
  (l(!0), h(Ce, null, Ee(i.value, (te, he) => {
4166
4166
  var we, Re, Ne, de, se;
@@ -4184,7 +4184,7 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4184
4184
  name: "local_shipping",
4185
4185
  outline: "",
4186
4186
  color: "#ffffff"
4187
- })) : F("", !0)
4187
+ })) : I("", !0)
4188
4188
  ]),
4189
4189
  e("div", el, [
4190
4190
  e("div", {
@@ -4212,27 +4212,27 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4212
4212
  onSubmitted: a[3] || (a[3] = () => {
4213
4213
  c("update:show", !1), c("submitted");
4214
4214
  })
4215
- }, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : F("", !0),
4215
+ }, null, 8, ["deliveryOrder", "purchaseOrder", "received-info-map"])) : I("", !0),
4216
4216
  (Re = (we = te.deliveryOrder) == null ? void 0 : we.netSuite) != null && Re.id ? (l(), me(Ht, {
4217
4217
  key: 1,
4218
4218
  title: "Admin",
4219
4219
  class: "min-w-[140px]"
4220
4220
  }, {
4221
- default: ie(() => {
4221
+ default: ce(() => {
4222
4222
  var Oe, Te;
4223
4223
  return [
4224
- V(En, {
4224
+ L(En, {
4225
4225
  "netsuite-id": (Te = (Oe = te.deliveryOrder) == null ? void 0 : Oe.netSuite) == null ? void 0 : Te.id
4226
4226
  }, null, 8, ["netsuite-id"])
4227
4227
  ];
4228
4228
  }),
4229
4229
  _: 2
4230
- }, 1024)) : F("", !0),
4230
+ }, 1024)) : I("", !0),
4231
4231
  r.purchaseOrder && ((Ne = te.deliveryOrder) != null && Ne.id) ? (l(), me(Ms, {
4232
4232
  key: 2,
4233
4233
  "purchase-order-id": (de = r.purchaseOrder) == null ? void 0 : de._id,
4234
4234
  "delivery-order-id": (se = te.deliveryOrder) == null ? void 0 : se.id
4235
- }, null, 8, ["purchase-order-id", "delivery-order-id"])) : F("", !0)
4235
+ }, null, 8, ["purchase-order-id", "delivery-order-id"])) : I("", !0)
4236
4236
  ])
4237
4237
  ])
4238
4238
  ]),
@@ -4251,11 +4251,11 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4251
4251
  ])
4252
4252
  ]),
4253
4253
  e("div", cl, [
4254
- V(P, {
4254
+ L(A, {
4255
4255
  variant: "outlined",
4256
4256
  class: "py-12 px-16"
4257
4257
  }, {
4258
- default: ie(() => [
4258
+ default: ce(() => [
4259
4259
  e("div", ul, [
4260
4260
  (l(!0), h(Ce, null, Ee(te.info, (Oe, Te) => (l(), h("div", {
4261
4261
  key: Te,
@@ -4282,57 +4282,57 @@ const po = { class: "flex flex-col gap-3" }, fo = { class: "flex flex-col gap-4"
4282
4282
  ], 64);
4283
4283
  }), 128))
4284
4284
  ])) : (l(), h("div", Ka, [
4285
- V(y),
4285
+ L(y),
4286
4286
  e("div", null, [
4287
4287
  e("img", {
4288
4288
  src: _(Vs),
4289
4289
  alt: "List is empty"
4290
4290
  }, null, 8, Ha)
4291
4291
  ]),
4292
- e("div", Ga, x(_($)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
4293
- e("div", Wa, x(_($)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
4294
- V(y),
4295
- V(y)
4292
+ e("div", Ga, x(_(S)("inventory.transfer.receiveRequest.details.noRecordsFound")), 1),
4293
+ e("div", Wa, x(_(S)("inventory.transfer.receiveRequest.details.trackDeliveryMessage")), 1),
4294
+ L(y),
4295
+ L(y)
4296
4296
  ]))
4297
- ])) : F("", !0)
4297
+ ])) : I("", !0)
4298
4298
  ])
4299
4299
  ];
4300
4300
  }),
4301
- "side-sheet-footer": ie(() => [
4301
+ "side-sheet-footer": ce(() => [
4302
4302
  e("div", pl, [
4303
- (l(!0), h(Ce, null, Ee(I.value, (g) => (l(), h(Ce, null, [
4304
- _(gt)[g].available != !1 ? (l(), me(O, {
4303
+ (l(!0), h(Ce, null, Ee(P.value, (g) => (l(), h(Ce, null, [
4304
+ _(gt)[g].available != !1 ? (l(), me(w, {
4305
4305
  key: g,
4306
- label: _($)(_(gt)[g].translationKey),
4307
- onClick: (L) => ye(g),
4306
+ label: _(S)(_(gt)[g].translationKey),
4307
+ onClick: (U) => ye(g),
4308
4308
  loading: z.value === g,
4309
- disabled: z.value !== g && Z.value,
4309
+ disabled: z.value !== g && J.value,
4310
4310
  variant: _(gt)[g].buttonVariant
4311
- }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : F("", !0)
4311
+ }, null, 8, ["label", "onClick", "loading", "disabled", "variant"])) : I("", !0)
4312
4312
  ], 64))), 256)),
4313
- _(D).ableToMarkReceived(r.purchaseOrder) && !I.value.includes("completeReceive") ? (l(), me(O, {
4313
+ _(T).ableToMarkReceived(r.purchaseOrder) && !P.value.includes("completeReceive") ? (l(), me(w, {
4314
4314
  key: 0,
4315
- label: _($)("inventory.transfer.receiveRequest.actions.completeReceive"),
4315
+ label: _(S)("inventory.transfer.receiveRequest.actions.completeReceive"),
4316
4316
  onClick: a[4] || (a[4] = (g) => ye("completeReceive")),
4317
4317
  loading: z.value === "completeReceive",
4318
- disabled: z.value !== "completeReceive" && Z.value
4319
- }, null, 8, ["label", "loading", "disabled"])) : F("", !0),
4320
- _(D).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !I.value.includes("approveRequest") ? (l(), me(O, {
4318
+ disabled: z.value !== "completeReceive" && J.value
4319
+ }, null, 8, ["label", "loading", "disabled"])) : I("", !0),
4320
+ _(T).ableToMarkApproved(r.purchaseOrder) && r.canApprove && !P.value.includes("approveRequest") ? (l(), me(w, {
4321
4321
  key: 1,
4322
- label: _($)("inventory.transfer.approval.actions.approveRequest"),
4322
+ label: _(S)("inventory.transfer.approval.actions.approveRequest"),
4323
4323
  onClick: a[5] || (a[5] = (g) => ye("approveRequest")),
4324
4324
  loading: z.value === "approveRequest",
4325
- disabled: z.value !== "approveRequest" && Z.value
4326
- }, null, 8, ["label", "loading", "disabled"])) : F("", !0),
4327
- _(D).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && o.scope === "approval" ? (l(), me(O, {
4325
+ disabled: z.value !== "approveRequest" && J.value
4326
+ }, null, 8, ["label", "loading", "disabled"])) : I("", !0),
4327
+ _(T).ableToCreateFulfillment(r.purchaseOrder, r.poRequest) && n.scope === "approval" ? (l(), me(w, {
4328
4328
  key: 2,
4329
- label: _($)("inventory.transfer.receiveRequest.actions.processRequest"),
4329
+ label: _(S)("inventory.transfer.receiveRequest.actions.processRequest"),
4330
4330
  onClick: a[6] || (a[6] = (g) => ye("processRequest")),
4331
4331
  loading: z.value === "processRequest",
4332
- disabled: z.value !== "processRequest" && Z.value
4333
- }, null, 8, ["label", "loading", "disabled"])) : F("", !0),
4334
- V(O, {
4335
- label: _($)("common.close"),
4332
+ disabled: z.value !== "processRequest" && J.value
4333
+ }, null, 8, ["label", "loading", "disabled"])) : I("", !0),
4334
+ L(w, {
4335
+ label: _(S)("common.close"),
4336
4336
  variant: "tertiary",
4337
4337
  onClick: a[7] || (a[7] = (g) => c("update:show", !1))
4338
4338
  }, null, 8, ["label"])