@feedmepos/mf-inventory-portal 1.8.0-dev.3 → 1.8.0-dev.5

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 (133) hide show
  1. package/dist/App-DEbWEOwe.js +1537 -0
  2. package/dist/{ApprovalView-hV1msz5Y.js → ApprovalView-BEnYHIlU.js} +9 -9
  3. package/dist/{BindingsDialog-BX1Lopf0.js → BindingsDialog-CJVkMoBS.js} +2 -2
  4. package/dist/{BindingsPicker-BNKW8-XY.js → BindingsPicker-CX9o-xdQ.js} +2 -2
  5. package/dist/{BindingsTable-DiLDsL83.js → BindingsTable-Cil4LJ7l.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-oQh6kFLc.js → BulkReceiveRequestView-DYEc2jPw.js} +21 -22
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BaMcGU-x.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DoAv2mHA.js} +1 -1
  8. package/dist/{ClosingDraftView-sgLoaSf4.js → ClosingDraftView-Bz94Iejf.js} +20 -20
  9. package/dist/{ClosingHistoryView-BnE9HrzA.js → ClosingHistoryView-B479Y-mH.js} +5 -5
  10. package/dist/{ClosingTemplateView-BD3Pa11r.js → ClosingTemplateView-F_nx43n6.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DlbyxkMQ.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DddYGHxQ.js} +1 -1
  12. package/dist/{DefaultView-CuzvVkfE.js → DefaultView-CkZOl0ov.js} +5 -5
  13. package/dist/{DeliveryOrderPrintPreview-w-1aAOY1.js → DeliveryOrderPrintPreview-BJEpwAX6.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-CxD12Qct.js → EmailDialog.vue_vue_type_script_setup_true_lang-BW988AoC.js} +29 -30
  15. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js → FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Izn-hTjK.js} +107 -118
  16. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js} +1 -1
  17. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CAXnmdUy.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ci81xTbl.js} +2 -2
  18. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NhOdW33O.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnaHTAUZ.js} +2 -2
  19. package/dist/{FmMultiselectDialog-CULwA_hi.js → FmMultiselectDialog-BE8BlO6_.js} +2 -2
  20. package/dist/FmMultiselectDialog-COKgBmPZ.js +123 -0
  21. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-CI3Y9kDl.js → FmUnitInput.vue_vue_type_script_setup_true_lang-BQHd3NjM.js} +6 -6
  22. package/dist/ImportView-Crb_yrNb.js +1291 -0
  23. package/dist/{IngredientsView-pzpP6oXT.js → IngredientsView-lDypeR4c.js} +34 -35
  24. package/dist/{IntegrationExplorerView-C5aAhB6e.js → IntegrationExplorerView-DgOFGj7H.js} +4 -4
  25. package/dist/{IntegrationView-Bqun7nX0.js → IntegrationView-0sbjINo5.js} +973 -974
  26. package/dist/{InventoryBindingForm-r_Ua1C4a.js → InventoryBindingForm-BhyrjIXJ.js} +1 -1
  27. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-KCz_BQ6T.js +472 -0
  28. package/dist/{InventoryBindingSummary-BQuZLohR.js → InventoryBindingSummary-CsfNKd1r.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7r-QcJdU.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C32OoIBz.js} +1 -1
  30. package/dist/{ProductionRunDetailView-95fu_CfH.js → ProductionRunDetailView-BxbDtGMo.js} +4 -4
  31. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-CdOca1tV.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BdJVvwSP.js} +9 -9
  32. package/dist/{ProductionRunView-DIjor_Ix.js → ProductionRunView-CJhNEIzT.js} +3 -3
  33. package/dist/{PublishView-DYObyHQq.js → PublishView-vkt6-D6P.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-C0jCmI9L.js → PurchaseOrderPrintPreview-25dHfVKp.js} +2 -2
  35. package/dist/{ReceiveRequestView-i7ibPfIE.js → ReceiveRequestView-BO4Z2dZu.js} +15 -16
  36. package/dist/RecipeView-B_AE7QQv.js +3428 -0
  37. package/dist/{SettingsView-CdBloj9k.js → SettingsView-qTUvQCuu.js} +163 -168
  38. package/dist/{StockView-g_6eJ62R.js → StockView-yh6qkYUS.js} +269 -270
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C1rKc7MA.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn_fx9qG.js} +1 -1
  40. package/dist/{SupplierView-DkYp_Frj.js → SupplierView-Dqzu1Bvh.js} +14 -14
  41. package/dist/{SurchargeView-CfkV4Y3y.js → SurchargeView-CDosn36c.js} +7 -7
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-2MtN1p5t.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DZ3Gdlp9.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CYMjKXq4.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CWoh2FqQ.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-D0zNr_vQ.js → TransferDetails.vue_vue_type_script_setup_true_lang-BtjKnIwf.js} +867 -844
  45. package/dist/{TransferTemplateView-Ne2gYUSn.js → TransferTemplateView-fDZcC9i4.js} +22 -23
  46. package/dist/{UnitCostHistoryView-Db0_otOb.js → UnitCostHistoryView-CmTTIXAp.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BzO1lq7j.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZihCM0T.js} +4 -4
  48. package/dist/{UnitView-CiCeQ63i.js → UnitView-BTx59sFK.js} +8 -8
  49. package/dist/{WarehouseView-BcuJSOMF.js → WarehouseView-BIFe08FJ.js} +8 -8
  50. package/dist/{WastageTemplateView-CPQmtOKQ.js → WastageTemplateView-B_oJqm0_.js} +15 -15
  51. package/dist/api/feature-flags.d.ts +2 -0
  52. package/dist/api/license.d.ts +0 -2
  53. package/dist/{app-DqJp3dcI.js → app-DyEvx3Em.js} +1628 -1817
  54. package/dist/app.d.ts +0 -150
  55. package/dist/app.js +1 -1
  56. package/dist/{closing-template-BNlgZviN.js → closing-template-FgcLy4RT.js} +1 -1
  57. package/dist/components/FeatureCapabilityBadge.vue.d.ts +1 -1
  58. package/dist/{date2-Ci7521dn.js → date2-Rv4IwT9a.js} +1 -1
  59. package/dist/{dayjs.min-Cyp32v4J.js → dayjs.min-DOq1QM_M.js} +1 -1
  60. package/dist/{decimal-BGdm5R3A.js → decimal-7vA05AaD.js} +2 -2
  61. package/dist/{defineDeepModel-B2cJ-rtd.js → defineDeepModel-22Md2SKY.js} +1 -1
  62. package/dist/{duplicate-template-By5WeKZ0.js → duplicate-template-D2tjCY7C.js} +1 -1
  63. package/dist/{core-Js7d-3Pv.js → feature-BMTKl6PK.js} +732 -389
  64. package/dist/feature-flags/core.d.ts +3 -2
  65. package/dist/feature-flags/portal-feature-catalog.d.ts +0 -5
  66. package/dist/feature-flags/vue.d.ts +2 -0
  67. package/dist/{format-time-from-id-Q8C2P96H.js → format-time-from-id-DXhm_Ji1.js} +1 -1
  68. package/dist/{format-unit-display-CICrmm8r.js → format-unit-display-DxWLjFPz.js} +13 -13
  69. package/dist/helper/menu-usage-module.d.ts +1 -1
  70. package/dist/{id-to-date-DeN5x0LR.js → id-to-date-VKlOL3mN.js} +1 -1
  71. package/dist/{import-export.helper-BOTQWxr6.js → import-export.helper-BiF5aKUp.js} +28 -28
  72. package/dist/{index-BbbqCCfp.js → index-DEl_gZn0.js} +3 -3
  73. package/dist/{index-tCYhLCKP.js → index-DdtsVAcv.js} +1 -1
  74. package/dist/{index-Cxm3Sgfv.js → index-DoBWE4Ci.js} +1 -1
  75. package/dist/{lz-string-Dy4Pg8mh.js → lz-string-BwQj8QRN.js} +1 -1
  76. package/dist/{netsuite-BaJjkDM8.js → netsuite-s1S33-lP.js} +2 -2
  77. package/dist/{number-CB36d2PQ.js → number-BmKjsNrc.js} +3 -3
  78. package/dist/{predefined-templates-DLm93Bpx.js → predefined-templates-BZ2KqNix.js} +1 -1
  79. package/dist/{purchase-order-template-CDhn9ZIF.js → purchase-order-template-CINU4my1.js} +1 -1
  80. package/dist/{recalculationUtils-Cqvefakh.js → recalculationUtils-R5tFu_ts.js} +1 -1
  81. package/dist/router/name.d.ts +0 -1
  82. package/dist/{row-action.enum-NTfVmGY8.js → row-action.enum-ePO-Py0V.js} +1 -1
  83. package/dist/{rules-C8dfM84-.js → rules-BZrZVzw7.js} +2 -2
  84. package/dist/{stock-BGB0Siue.js → stock-C2HOKq0k.js} +8 -8
  85. package/dist/{stock-Qu5IiN2_.js → stock-Ce1UvAZ3.js} +1 -1
  86. package/dist/stores/feature.d.ts +10 -9
  87. package/dist/stores/inventory.d.ts +0 -47
  88. package/dist/stores/supplier.d.ts +1 -1
  89. package/dist/style.css +1 -1
  90. package/dist/{supplier-CZdNOSMN.js → supplier-DgT66emI.js} +17 -17
  91. package/dist/{surcharge-Cm40oJvU.js → surcharge-CsVMuzPM.js} +1 -1
  92. package/dist/tsconfig.app.tsbuildinfo +1 -1
  93. package/dist/{uom-rules-L-IW4Nwk.js → uom-rules-CR1XukyM.js} +1 -1
  94. package/dist/{use-ingredient-select-dialog-B2TDVJM6.js → use-ingredient-select-dialog-CJkG4hEX.js} +2 -2
  95. package/dist/use-inventory-binding-dialog-B36kPj4V.js +113 -0
  96. package/dist/{use-template-enabled-locations-DYAPMvo9.js → use-template-enabled-locations-Boa9QLPV.js} +2 -2
  97. package/dist/{use-transfer-locations-w-9tymYS.js → use-transfer-locations-BxOygSUg.js} +2 -2
  98. package/dist/{useHrmPermission-BFCIo5sA.js → useHrmPermission-DLHAqbLV.js} +1 -1
  99. package/dist/{useNavigationMenu-BPHAH5sJ.js → useNavigationMenu-D6abZMGz.js} +102 -109
  100. package/dist/{useSseClient-CWjRacRs.js → useSseClient-C7pff-EW.js} +1 -1
  101. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  102. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  103. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  104. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  105. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
  106. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  107. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  108. package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
  109. package/dist/{vue-i18n-S4YQ9w6a.js → vue-i18n-CpOOFhVU.js} +219 -219
  110. package/dist/{xlsx.util-CP8_VajN.js → xlsx.util-xwI5tVz6.js} +2 -2
  111. package/package.json +5 -5
  112. package/dist/App-DRXADP0k.js +0 -1498
  113. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-Bp8bjDU1.js +0 -58
  114. package/dist/FmMultiselectDialog-BqZgHP8s.js +0 -77
  115. package/dist/ImportView-DqQG673_.js +0 -1302
  116. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-DfvNUu80.js +0 -51
  117. package/dist/IngredientGroupView-CyngKxPo.js +0 -1000
  118. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CYDuu4kU.js +0 -563
  119. package/dist/RecipeView-C5VO7yr3.js +0 -3625
  120. package/dist/feature-fG7d73oi.js +0 -371
  121. package/dist/index-Dqf27vLH.js +0 -841
  122. package/dist/random-CSbEbElR.js +0 -10
  123. package/dist/use-inventory-binding-dialog-BJ00hl5f.js +0 -152
  124. package/dist/usePromise-CbVUCxhj.js +0 -29
  125. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
  126. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  127. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  128. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  129. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  130. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
  131. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  132. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  133. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
@@ -1,34 +1,33 @@
1
- import { defineComponent as pe, createElementBlock as q, openBlock as j, createElementVNode as e, createVNode as y, toDisplayString as f, unref as s, ref as Y, h as be, computed as T, watch as Fe, resolveComponent as D, createBlock as ne, isRef as Pe, withCtx as M, Fragment as ue, renderList as ve, createCommentVNode as se, normalizeClass as He, reactive as _t, mergeModels as st, useModel as jt, onMounted as Xe, createTextVNode as me, normalizeStyle as kt, watchEffect as Vt, renderSlot as at, onUnmounted as Ct, Teleport as Bt, normalizeProps as rt, mergeProps as ze } from "vue";
1
+ import { defineComponent as pe, createElementBlock as q, openBlock as j, createElementVNode as e, createVNode as y, toDisplayString as m, unref as s, ref as Y, h as be, computed as T, watch as Fe, resolveComponent as D, createBlock as ne, isRef as Pe, withCtx as M, Fragment as ue, renderList as ve, createCommentVNode as se, normalizeClass as He, reactive as _t, mergeModels as st, useModel as jt, onMounted as Xe, createTextVNode as me, normalizeStyle as kt, watchEffect as Vt, renderSlot as at, onUnmounted as Ct, Teleport as Bt, normalizeProps as rt, mergeProps as ze } from "vue";
2
2
  import { u as Dt, _ as Mt } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { u as Se, c as Re, a as Ne, F as lt, t as It, E as ie, s as Ht, d as Tt, B as Et, w as oe, h as Ce, i as it, e as ut, L as ge, M as Be } from "./app-DqJp3dcI.js";
4
- import { u as Oe } from "./stock-BGB0Siue.js";
3
+ import { u as Se, c as Re, a as Ne, F as lt, t as It, E as ie, s as Ht, d as Tt, B as Et, w as oe, h as Ce, i as it, e as ut, L as ge, M as Be } from "./app-DyEvx3Em.js";
4
+ import { u as Oe } from "./stock-C2HOKq0k.js";
5
5
  import { c as Ut } from "./component-BmLAdDiY.js";
6
- import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-BzO1lq7j.js";
7
- import { _ as Ke, S as Ge, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C1rKc7MA.js";
8
- import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-CMoQKl_a.js";
6
+ import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-DZihCM0T.js";
7
+ import { _ as Ke, S as We, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Cn_fx9qG.js";
8
+ import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-Izn-hTjK.js";
9
9
  import { useI18n as ye, useCoreStore as Je } from "@feedmepos/mf-common";
10
- import { u as gt, i as Te } from "./id-to-date-DeN5x0LR.js";
10
+ import { u as gt, i as Te } from "./id-to-date-VKlOL3mN.js";
11
11
  import { useSnackbar as we, useDialog as Le, useProxiedModel as Ye, useBreakpoints as Nt } from "@feedmepos/ui-library";
12
12
  import { defineStore as Ot } from "pinia";
13
13
  import { F as Qe } from "./FmAdminBadge-DlplQOHb.js";
14
- import { g as $e, a as he, e as Lt, t as Ee, c as xe, f as Yt, h as ct, i as xt, j as Ze, d as Me, k as zt } from "./number-CB36d2PQ.js";
15
- import { u as Ae } from "./stock-Qu5IiN2_.js";
16
- import { c as Ue, A as Gt, M as Wt, R as Kt } from "./rules-C8dfM84-.js";
17
- import { u as qt } from "./use-inventory-binding-dialog-BJ00hl5f.js";
18
- import { a as St } from "./FmMultiselectDialog-CULwA_hi.js";
19
- import { d as ke } from "./dayjs.min-Cyp32v4J.js";
20
- import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-7r-QcJdU.js";
21
- import { g as Jt } from "./decimal-BGdm5R3A.js";
22
- import { b as Qt, d as Zt, f as wt, t as dt, a as mt, p as eo, n as to, c as oo } from "./date2-Ci7521dn.js";
23
- import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BqCh_vTP.js";
14
+ import { g as $e, a as he, e as Lt, t as Ee, c as xe, f as Yt, h as ct, i as xt, j as Ze, d as Me, k as zt } from "./number-BmKjsNrc.js";
15
+ import { u as Ae } from "./stock-Ce1UvAZ3.js";
16
+ import { c as Ue, A as Wt, M as Gt, R as Kt } from "./rules-BZrZVzw7.js";
17
+ import { u as qt } from "./use-inventory-binding-dialog-B36kPj4V.js";
18
+ import { a as St } from "./FmMultiselectDialog-BE8BlO6_.js";
19
+ import { d as ke } from "./dayjs.min-DOq1QM_M.js";
20
+ import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-C32OoIBz.js";
21
+ import { g as Jt } from "./decimal-7vA05AaD.js";
22
+ import { b as Qt, d as Zt, f as wt, t as dt, a as mt, p as eo, n as to, c as oo } from "./date2-Rv4IwT9a.js";
23
+ import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-CoUWxHlj.js";
24
24
  import { _ as so } from "./empty-placeholder-B0QU467o.js";
25
- import { F as _e } from "./core-Js7d-3Pv.js";
26
- import { useFeatureStore as ao } from "./feature-fG7d73oi.js";
27
- import { u as At } from "./useHrmPermission-BFCIo5sA.js";
25
+ import { F as _e, u as ao } from "./feature-BMTKl6PK.js";
26
+ import { u as At } from "./useHrmPermission-DLHAqbLV.js";
28
27
  import { _ as ro, F as ft } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
29
- import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-NhOdW33O.js";
30
- import { u as io } from "./useSseClient-CWjRacRs.js";
31
- import { u as uo } from "./netsuite-BaJjkDM8.js";
28
+ import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CnaHTAUZ.js";
29
+ import { u as io } from "./useSseClient-C7pff-EW.js";
30
+ import { u as uo } from "./netsuite-s1S33-lP.js";
32
31
  import { P as co, J as mo } from "./app-C39bYJmq.js";
33
32
  var Ie = /* @__PURE__ */ ((A) => (A.History = "History", A.Convert = "Convert", A.Adjust = "Adjust", A))(Ie || {});
34
33
  const fo = [
@@ -62,7 +61,7 @@ const fo = [
62
61
  setup(A) {
63
62
  const { t: c } = ye();
64
63
  return (k, _) => (j(), q("div", po, [
65
- e("div", yo, f(s(c)("inventory.stock.prediction.daysRemaining")), 1),
64
+ e("div", yo, m(s(c)("inventory.stock.prediction.daysRemaining")), 1),
66
65
  y(qe, {
67
66
  tier: "standard",
68
67
  category: "beta"
@@ -70,7 +69,7 @@ const fo = [
70
69
  ]));
71
70
  }
72
71
  }), Ft = Ot("stockActions", () => {
73
- const A = Y(!1), c = Se(), k = Oe(), _ = gt(), w = we(), V = Le(), { t: d } = ye();
72
+ const A = Y(!1), c = Se(), k = Oe(), _ = gt(), w = we(), V = Le(), { t: f } = ye();
74
73
  async function r() {
75
74
  if (c._currentLocation) {
76
75
  A.value = !0;
@@ -78,8 +77,8 @@ const fo = [
78
77
  await k.readStockBalance(), await k.readProductBalance(), await _.readStockEstimateBalance();
79
78
  } catch {
80
79
  w.open({
81
- title: d("inventory.stock.error.title"),
82
- message: d("inventory.stock.error.message"),
80
+ title: f("inventory.stock.error.title"),
81
+ message: f("inventory.stock.error.message"),
83
82
  type: "error"
84
83
  });
85
84
  } finally {
@@ -92,8 +91,8 @@ const fo = [
92
91
  var $, E, N;
93
92
  if (!!!((E = ($ = g.convert) == null ? void 0 : $.inventoryBindings) != null && E.length)) {
94
93
  V.open({
95
- title: d("inventory.stock.error.convert.title"),
96
- message: d("inventory.stock.error.convert.message")
94
+ title: f("inventory.stock.error.convert.title"),
95
+ message: f("inventory.stock.error.convert.message")
97
96
  });
98
97
  return;
99
98
  }
@@ -178,8 +177,8 @@ function ko() {
178
177
  {
179
178
  id: "UOM",
180
179
  header: () => _("inventory.stock.balance"),
181
- cell(d) {
182
- const r = d.row.original, b = {
180
+ cell(f) {
181
+ const r = f.row.original, b = {
183
182
  unit: r.unit,
184
183
  sku: r,
185
184
  amount: r.balance,
@@ -193,8 +192,8 @@ function ko() {
193
192
  {
194
193
  accessorKey: "isInactive",
195
194
  header: () => be(Qe, {}, () => `${_("inventory.ingredient.status.title")}`),
196
- cell(d) {
197
- const r = d.row.original.isInactive;
195
+ cell(f) {
196
+ const r = f.row.original.isInactive;
198
197
  return be(
199
198
  "span",
200
199
  {
@@ -215,15 +214,15 @@ function ko() {
215
214
  header: () => be(_o),
216
215
  enableSorting: !0,
217
216
  sortUndefined: "last",
218
- cell(d) {
217
+ cell(f) {
219
218
  var B, v;
220
- const r = d.row.original.day, b = d.row.original.operator, R = (B = d.row.original.thresholds) == null ? void 0 : B.low, C = (v = d.row.original.thresholds) == null ? void 0 : v.mid;
219
+ const r = f.row.original.day, b = f.row.original.operator, R = (B = f.row.original.thresholds) == null ? void 0 : B.low, C = (v = f.row.original.thresholds) == null ? void 0 : v.mid;
221
220
  if (typeof r != "number" || typeof R != "number" || typeof C != "number")
222
221
  return be(Ke, {
223
222
  days: r,
224
223
  operator: b
225
224
  });
226
- const l = r <= R ? Ge.low : r <= C ? Ge.mid : Ge.high;
225
+ const l = r <= R ? We.low : r <= C ? We.mid : We.high;
227
226
  return be(Ke, {
228
227
  days: r,
229
228
  level: l
@@ -233,11 +232,11 @@ function ko() {
233
232
  },
234
233
  {
235
234
  id: "action",
236
- cell(d) {
235
+ cell(f) {
237
236
  var r;
238
237
  return Ut(
239
238
  ((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ? fo : vo,
240
- (b) => c.onActionMenu(b, d.row.original)
239
+ (b) => c.onActionMenu(b, f.row.original)
241
240
  );
242
241
  },
243
242
  enableSorting: !1,
@@ -296,11 +295,11 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
296
295
  },
297
296
  emits: ["update:show", "submitted"],
298
297
  setup(A, { expose: c, emit: k }) {
299
- const _ = A, w = k, V = qt(), d = Ne(), r = Ae(), b = we(), { t: R } = ye(), C = Y(0), l = Y(null), a = T(() => d.skus), B = T(
298
+ const _ = A, w = k, V = qt(), f = Ne(), r = Ae(), b = we(), { t: R } = ye(), C = Y(0), l = Y(null), a = T(() => f.skus), B = T(
300
299
  () => {
301
300
  var x, F;
302
301
  return (((F = (x = _.sku) == null ? void 0 : x.convert) == null ? void 0 : F.inventoryBindings) ?? []).filter(
303
- (G) => G.type === lt.enum.SKU
302
+ (W) => W.type === lt.enum.SKU
304
303
  );
305
304
  }
306
305
  ), v = T({
@@ -328,37 +327,37 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
328
327
  const F = (I = _.sku.convert) != null && I.measurement ? _.sku.unit.measurements.find((u) => {
329
328
  var h;
330
329
  return u.id === ((h = _.sku.convert) == null ? void 0 : h.measurement);
331
- }) ?? null : null, G = $e(_.sku.unit, F), H = Yt(+x);
332
- return vt(H).isInteger().max(G).error ? "Precision cannot be more than " + G : !0;
330
+ }) ?? null : null, W = $e(_.sku.unit, F), H = Yt(+x);
331
+ return vt(H).isInteger().max(W).error ? "Precision cannot be more than " + W : !0;
333
332
  }
334
333
  const $ = T(
335
334
  () => {
336
335
  var x, F;
337
- return (x = _.sku.convert) != null && x.measurement ? (F = _.sku.unit.measurements.find((G) => {
336
+ return (x = _.sku.convert) != null && x.measurement ? (F = _.sku.unit.measurements.find((W) => {
338
337
  var H;
339
- return G.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
338
+ return W.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
340
339
  })) == null ? void 0 : F.abbrev : _.sku.unit.abbrev;
341
340
  }
342
341
  ), E = T(() => {
343
342
  var H, J;
344
343
  const F = It({
345
344
  bindings: ((H = _.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
346
- skus: d.skus,
347
- skuGroups: d.skuGroups,
348
- recipes: d.recipes
345
+ skus: f.skus,
346
+ skuGroups: [],
347
+ recipes: f.recipes
349
348
  }).inventoryBindings.filter((I) => "success" in I && I.success).map((I) => I).map((I) => I.binding);
350
349
  return (J = l.value ?? F) == null ? void 0 : J.map((I) => {
351
- var ee, ae, Q, W, te;
352
- const u = d.skus.find((le) => le._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = u == null ? void 0 : u.unit) == null ? void 0 : ae.abbrev), p = (Q = _.sku.convert) != null && Q.measurement ? _.sku.unit.measurements.find((le) => {
350
+ var ee, ae, Q, G, te;
351
+ const u = f.skus.find((le) => le._id === I.id), h = ((ee = I.measurement) == null ? void 0 : ee.abbrev) ?? ((ae = u == null ? void 0 : u.unit) == null ? void 0 : ae.abbrev), p = (Q = _.sku.convert) != null && Q.measurement ? _.sku.unit.measurements.find((le) => {
353
352
  var ce;
354
353
  return le.id === ((ce = _.sku.convert) == null ? void 0 : ce.measurement);
355
- }) ?? null : null, m = $e(_.sku.unit, p), i = n(`${C.value}`) === !0 ? he(
354
+ }) ?? null : null, d = $e(_.sku.unit, p), i = n(`${C.value}`) === !0 ? he(
356
355
  Lt(
357
356
  I.amount,
358
- Ee(+C.value, m)
357
+ Ee(+C.value, d)
359
358
  ),
360
359
  !1
361
- ) : "0", S = (te = (W = l.value) == null ? void 0 : W.find((le) => le.id === (u == null ? void 0 : u._id))) == null ? void 0 : te.amount, P = S ? he(S, !1) : null;
360
+ ) : "0", S = (te = (G = l.value) == null ? void 0 : G.find((le) => le.id === (u == null ? void 0 : u._id))) == null ? void 0 : te.amount, P = S ? he(S, !1) : null;
362
361
  return {
363
362
  sku: u,
364
363
  convertAmount: P ?? i,
@@ -381,7 +380,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
381
380
  }
382
381
  });
383
382
  const O = Ye(_, "show");
384
- async function L(x, F, G) {
383
+ async function L(x, F, W) {
385
384
  g.value = !0;
386
385
  try {
387
386
  await r.convertSku({
@@ -389,7 +388,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
389
388
  {
390
389
  doc: x,
391
390
  amount: F,
392
- overrides: G == null ? void 0 : G.map((H) => ({
391
+ overrides: W == null ? void 0 : W.map((H) => ({
393
392
  ...H,
394
393
  amount: {
395
394
  ...H.amount,
@@ -410,29 +409,29 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
410
409
  g.value = !1;
411
410
  }
412
411
  }
413
- function X(x, F, G) {
412
+ function X(x, F, W) {
414
413
  const H = +F;
415
- let J = G;
416
- F.length > 0 && isFinite(H) ? J = G.map((I) => (I.id !== x || (I.amount = xe(H)), I)) : J = G.map((I) => (I.id !== x || (I.amount = { amount: 0, precision: 0 }), I)), l.value = J;
414
+ let J = W;
415
+ F.length > 0 && isFinite(H) ? J = W.map((I) => (I.id !== x || (I.amount = xe(H)), I)) : J = W.map((I) => (I.id !== x || (I.amount = { amount: 0, precision: 0 }), I)), l.value = J;
417
416
  }
418
417
  function z(x) {
419
- const F = a.value.find((G) => G._id === x);
418
+ const F = a.value.find((W) => W._id === x);
420
419
  return F ? bt(F.unit, !0) : [];
421
420
  }
422
421
  function K(x, F) {
423
- const G = z(x), H = G.find((J) => J.value === F) ?? G.find((J) => J.value === null);
422
+ const W = z(x), H = W.find((J) => J.value === F) ?? W.find((J) => J.value === null);
424
423
  return H ? {
425
424
  ...H,
426
425
  label: H.abbrev
427
426
  } : null;
428
427
  }
429
- function U(x, F, G) {
428
+ function U(x, F, W) {
430
429
  let H;
431
430
  if (F === null)
432
- H = G.map((J) => (J.id !== x || (J.measurement = null), J)) ?? [];
431
+ H = W.map((J) => (J.id !== x || (J.measurement = null), J)) ?? [];
433
432
  else {
434
433
  const J = a.value.find((I) => I._id === x);
435
- H = G.map((I) => {
434
+ H = W.map((I) => {
436
435
  var u, h;
437
436
  return I.id !== x || (I.measurement = (h = (u = J == null ? void 0 : J.unit) == null ? void 0 : u.measurements) == null ? void 0 : h.find((p) => p.id === F)), I;
438
437
  }) ?? [];
@@ -440,8 +439,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
440
439
  l.value = H;
441
440
  }
442
441
  function Z(x, F) {
443
- const G = F.filter((H) => H.id !== x);
444
- l.value = G;
442
+ const W = F.filter((H) => H.id !== x);
443
+ l.value = W;
445
444
  }
446
445
  function re() {
447
446
  const x = (l.value ?? []).map((F) => ({
@@ -460,8 +459,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
460
459
  x || (l.value = null, C.value = 0);
461
460
  }
462
461
  ), (x, F) => {
463
- const G = D("FmTextField"), H = D("FmForm"), J = D("FmCard"), I = D("FmSwitch"), u = D("FmFormGroup"), h = D("FmSelect"), p = D("FmButton"), m = D("FmSideSheet");
464
- return j(), ne(m, {
462
+ const W = D("FmTextField"), H = D("FmForm"), J = D("FmCard"), I = D("FmSwitch"), u = D("FmFormGroup"), h = D("FmSelect"), p = D("FmButton"), d = D("FmSideSheet");
463
+ return j(), ne(d, {
465
464
  "dismiss-away": "",
466
465
  modelValue: s(O),
467
466
  "onUpdate:modelValue": F[3] || (F[3] = (i) => Pe(O) ? O.value = i : null),
@@ -469,7 +468,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
469
468
  }, {
470
469
  "side-sheet-header": M(() => [
471
470
  e("div", bo, [
472
- e("div", go, f(s(R)("inventory.stock.convert.title", { name: x.sku.name })), 1)
471
+ e("div", go, m(s(R)("inventory.stock.convert.title", { name: x.sku.name })), 1)
473
472
  ])
474
473
  ]),
475
474
  default: M(() => [
@@ -480,7 +479,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
480
479
  onValidationSuccess: o
481
480
  }, {
482
481
  default: M(() => [
483
- y(G, {
482
+ y(W, {
484
483
  disabled: g.value,
485
484
  "model-value": C.value,
486
485
  "onUpdate:modelValue": F[0] || (F[0] = (i) => C.value = i),
@@ -498,15 +497,15 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
498
497
  }, {
499
498
  default: M(() => [
500
499
  e("div", So, [
501
- e("div", wo, f(s(R)("inventory.stock.convert.deductionSummary")), 1),
500
+ e("div", wo, m(s(R)("inventory.stock.convert.deductionSummary")), 1),
502
501
  (j(!0), q(ue, null, ve(E.value, (i) => {
503
502
  var S, P;
504
503
  return j(), q("div", {
505
504
  key: (S = i.sku) == null ? void 0 : S._id,
506
505
  class: "flex items-center"
507
506
  }, [
508
- e("div", Ao, f((P = i.sku) == null ? void 0 : P.name), 1),
509
- e("div", Fo, " -" + f(i.convertAmount) + " " + f(i.abbrev), 1)
507
+ e("div", Ao, m((P = i.sku) == null ? void 0 : P.name), 1),
508
+ e("div", Fo, " -" + m(i.convertAmount) + " " + m(i.abbrev), 1)
510
509
  ]);
511
510
  }), 128))
512
511
  ])
@@ -526,16 +525,16 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
526
525
  v.value ? (j(), q(ue, { key: 0 }, [
527
526
  y(u, {
528
527
  modelValue: l.value,
529
- rules: [s(Gt)(1, "Must have at least one ingredient binding")]
528
+ rules: [s(Wt)(1, "Must have at least one ingredient binding")]
530
529
  }, null, 8, ["modelValue", "rules"]),
531
530
  e("div", jo, [
532
- e("div", Vo, f(s(R)("inventory.stock.convert.ingredients")), 1),
531
+ e("div", Vo, m(s(R)("inventory.stock.convert.ingredients")), 1),
533
532
  (j(!0), q(ue, null, ve(l.value, (i) => (j(), ne(u, {
534
533
  key: i.id,
535
534
  disabled: g.value,
536
535
  modelValue: +s(he)(i.amount ?? { amount: 1, precision: 0 }),
537
536
  rules: [
538
- s(Wt)(
537
+ s(Gt)(
539
538
  a.value.find((S) => S._id === i.id).unit,
540
539
  i.measurement
541
540
  ),
@@ -546,8 +545,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
546
545
  var P, ee, ae;
547
546
  return [
548
547
  e("div", Co, [
549
- e("div", Bo, f((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
550
- y(G, {
548
+ e("div", Bo, m((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
549
+ y(W, {
551
550
  class: "xs:col-span-2",
552
551
  disabled: g.value,
553
552
  modelValue: +s(he)(
@@ -619,7 +618,7 @@ function De(A, c) {
619
618
  function pt(A, c) {
620
619
  return Ee(Math.abs(A), c);
621
620
  }
622
- const We = {
621
+ const Ge = {
623
622
  [ie.enum.DAMAGE]: {
624
623
  label: "Damage",
625
624
  toAdjustmentAmount: De
@@ -656,8 +655,8 @@ const We = {
656
655
  },
657
656
  emits: ["update:modelValue", "click:delete"],
658
657
  setup(A, { emit: c }) {
659
- const k = A, _ = c, { t: w } = ye(), V = Oe(), d = T(
660
- () => Object.keys(We).map((t) => ({
658
+ const k = A, _ = c, { t: w } = ye(), V = Oe(), f = T(
659
+ () => Object.keys(Ge).map((t) => ({
661
660
  label: Ht(t),
662
661
  value: t
663
662
  }))
@@ -671,7 +670,7 @@ const We = {
671
670
  };
672
671
  n.type = t;
673
672
  const $ = ct(k.modelValue.amount);
674
- n.amount = We[n.type].toAdjustmentAmount(
673
+ n.amount = Ge[n.type].toAdjustmentAmount(
675
674
  +he($),
676
675
  $.precision
677
676
  ), _("update:modelValue", n);
@@ -685,7 +684,7 @@ const We = {
685
684
  const n = {
686
685
  ...k.modelValue
687
686
  }, $ = xe(t);
688
- n.amount = We[b.value].toAdjustmentAmount(
687
+ n.amount = Ge[b.value].toAdjustmentAmount(
689
688
  t,
690
689
  $.precision
691
690
  ), _("update:modelValue", n);
@@ -735,8 +734,8 @@ const We = {
735
734
  default: M(() => [
736
735
  e("div", Io, [
737
736
  e("div", Ho, [
738
- e("div", To, f(t.modelValue.doc.name), 1),
739
- e("div", Eo, f(t.modelValue.doc.code), 1)
737
+ e("div", To, m(t.modelValue.doc.name), 1),
738
+ e("div", Eo, m(t.modelValue.doc.code), 1)
740
739
  ]),
741
740
  y($, {
742
741
  variant: "tertiary",
@@ -748,7 +747,7 @@ const We = {
748
747
  disabled: t.disabled,
749
748
  class: "col-span-2",
750
749
  label: "Type",
751
- items: d.value,
750
+ items: f.value,
752
751
  modelValue: b.value,
753
752
  "onUpdate:modelValue": n[1] || (n[1] = (L) => b.value = L),
754
753
  rules: [s(Kt)()],
@@ -781,18 +780,18 @@ const We = {
781
780
  "label-mark": "optional"
782
781
  }, null, 8, ["disabled", "modelValue"]),
783
782
  e("div", Uo, [
784
- e("div", Po, f(s(w)("inventory.stock.stock_adjustment.stockAfter")), 1),
783
+ e("div", Po, m(s(w)("inventory.stock.stock_adjustment.stockAfter")), 1),
785
784
  e("div", {
786
785
  class: He(["fm-typo-en-body-lg-600", o.value ? "text-red-700" : "text-green-700"])
787
- }, f(g.value), 3),
788
- t.isBackdate ? (j(), q("div", Ro, f(s(w)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : se("", !0)
786
+ }, m(g.value), 3),
787
+ t.isBackdate ? (j(), q("div", Ro, m(s(w)("inventory.stock.stock_adjustment.backdatePreviewWarning")), 1)) : se("", !0)
789
788
  ])
790
789
  ]),
791
790
  _: 1
792
791
  });
793
792
  };
794
793
  }
795
- }), No = { class: "flex items-center" }, Oo = { class: "fm-typo-en-title-md-800" }, Lo = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-sm-800 flex-1" }, zo = { class: "flex gap-8" }, Go = /* @__PURE__ */ pe({
794
+ }), No = { class: "flex items-center" }, Oo = { class: "fm-typo-en-title-md-800" }, Lo = { class: "flex items-center" }, Yo = { class: "fm-typo-en-title-sm-800 flex-1" }, zo = { class: "flex gap-8" }, Wo = /* @__PURE__ */ pe({
796
795
  __name: "AdjustSkuDialog",
797
796
  props: {
798
797
  stock: {},
@@ -800,7 +799,7 @@ const We = {
800
799
  },
801
800
  emits: ["update:show", "submitted"],
802
801
  setup(A, { expose: c, emit: k }) {
803
- const _ = A, w = k, V = Ne(), d = Le(), r = Ae(), b = we(), R = Y(!1), { t: C } = ye();
802
+ const _ = A, w = k, V = Ne(), f = Le(), r = Ae(), b = we(), R = Y(!1), { t: C } = ye();
804
803
  function l() {
805
804
  g(Re(v));
806
805
  }
@@ -874,7 +873,7 @@ const We = {
874
873
  sublabel: E.code,
875
874
  value: E._id
876
875
  })), $ = n.filter((E) => v.adjustments.find((N) => N.doc._id === E.value)).map((E) => E.value);
877
- d.open({
876
+ f.open({
878
877
  title: "Select ingredients",
879
878
  contentComponent: St,
880
879
  contentComponentProps: {
@@ -919,7 +918,7 @@ const We = {
919
918
  }, {
920
919
  "side-sheet-header": M(() => [
921
920
  e("div", No, [
922
- e("div", Oo, f(s(C)("inventory.stock.adjust.title")), 1)
921
+ e("div", Oo, m(s(C)("inventory.stock.adjust.title")), 1)
923
922
  ])
924
923
  ]),
925
924
  default: M(() => [
@@ -936,7 +935,7 @@ const We = {
936
935
  "onUpdate:modelValue": $[0] || ($[0] = (X) => v.remark = X)
937
936
  }, null, 8, ["label", "modelValue"]),
938
937
  e("div", Lo, [
939
- e("div", Yo, f(s(C)("inventory.stock.adjust.adjustedItems")), 1),
938
+ e("div", Yo, m(s(C)("inventory.stock.adjust.adjustedItems")), 1),
940
939
  y(N, {
941
940
  "prepend-icon": "add",
942
941
  variant: "tertiary",
@@ -970,7 +969,7 @@ const We = {
970
969
  }, 8, ["modelValue"]);
971
970
  };
972
971
  }
973
- }), Wo = { class: "flex items-center w-full gap-8" }, Ko = { class: "fm-typo-en-title-md-800 flex-1" }, qo = {
972
+ }), Go = { class: "flex items-center w-full gap-8" }, Ko = { class: "fm-typo-en-title-md-800 flex-1" }, qo = {
974
973
  key: 0,
975
974
  class: "flex flex-col gap-4"
976
975
  }, Xo = { class: "fm-typo-en-body-md-600" }, Jo = { class: "flex gap-8 items-start" }, Qo = { class: "flex-1 min-w-0" }, Zo = { class: "flex-1 min-w-0" }, en = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tn = { class: "flex items-center" }, on = { class: "fm-typo-en-title-sm-800 flex-1" }, nn = { class: "flex gap-8" }, yt = 14, sn = /* @__PURE__ */ pe({
@@ -980,7 +979,7 @@ const We = {
980
979
  },
981
980
  emits: ["update:show", "submitted"],
982
981
  setup(A, { emit: c }) {
983
- const k = A, _ = c, { t: w } = ye(), V = Ne(), d = Ae(), r = Le(), b = we(), R = Ye(k, "show"), C = Y(!1), l = _t({
982
+ const k = A, _ = c, { t: w } = ye(), V = Ne(), f = Ae(), r = Le(), b = we(), R = Ye(k, "show"), C = Y(!1), l = _t({
984
983
  remark: "",
985
984
  effectiveAt: /* @__PURE__ */ new Date(),
986
985
  adjustments: []
@@ -1069,10 +1068,10 @@ const We = {
1069
1068
  C.value = !0;
1070
1069
  try {
1071
1070
  const K = l.adjustments.map(
1072
- ({ doc: Z, remark: re, type: x, amount: F, measurement: G }) => ({
1071
+ ({ doc: Z, remark: re, type: x, amount: F, measurement: W }) => ({
1073
1072
  id: Z._id,
1074
1073
  amount: F,
1075
- measurement: G,
1074
+ measurement: W,
1076
1075
  remark: re,
1077
1076
  doc: Z,
1078
1077
  type: x
@@ -1082,7 +1081,7 @@ const We = {
1082
1081
  adjustments: K,
1083
1082
  ...a.value ? { effectiveAt: l.effectiveAt.toISOString() } : {}
1084
1083
  };
1085
- await d.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
1084
+ await f.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
1086
1085
  } catch (K) {
1087
1086
  b.open({
1088
1087
  title: w("inventory.stock.adjust.error.title"),
@@ -1094,7 +1093,7 @@ const We = {
1094
1093
  }
1095
1094
  }
1096
1095
  return (K, U) => {
1097
- const Z = D("FmTextarea"), re = D("FmSwitch"), x = D("FmDatePicker"), F = D("FmTimePicker"), G = D("FmFormGroup"), H = D("FmButton"), J = D("FmForm"), I = D("FmSideSheet");
1096
+ const Z = D("FmTextarea"), re = D("FmSwitch"), x = D("FmDatePicker"), F = D("FmTimePicker"), W = D("FmFormGroup"), H = D("FmButton"), J = D("FmForm"), I = D("FmSideSheet");
1098
1097
  return j(), ne(I, {
1099
1098
  modelValue: s(R),
1100
1099
  "onUpdate:modelValue": U[6] || (U[6] = (u) => Pe(R) ? R.value = u : null),
@@ -1103,8 +1102,8 @@ const We = {
1103
1102
  onAfterEnter: N
1104
1103
  }, {
1105
1104
  "side-sheet-header": M(() => [
1106
- e("div", Wo, [
1107
- e("div", Ko, f(s(w)("inventory.stock.stock_adjustment.title")), 1)
1105
+ e("div", Go, [
1106
+ e("div", Ko, m(s(w)("inventory.stock.stock_adjustment.title")), 1)
1108
1107
  ])
1109
1108
  ]),
1110
1109
  default: M(() => [
@@ -1130,7 +1129,7 @@ const We = {
1130
1129
  labelPlacement: "right"
1131
1130
  }, null, 8, ["model-value", "label", "sublabel"]),
1132
1131
  a.value ? (j(), q("div", qo, [
1133
- e("label", Xo, f(s(w)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1132
+ e("label", Xo, m(s(w)("inventory.stock.stock_adjustment.effectiveAt")), 1),
1134
1133
  e("div", Jo, [
1135
1134
  e("div", Qo, [
1136
1135
  y(x, {
@@ -1149,14 +1148,14 @@ const We = {
1149
1148
  }, null, 8, ["modelValue"])
1150
1149
  ])
1151
1150
  ]),
1152
- y(G, {
1151
+ y(W, {
1153
1152
  "model-value": o.value,
1154
1153
  rules: n.value
1155
1154
  }, null, 8, ["model-value", "rules"]),
1156
- e("div", en, f(s(w)("inventory.stock.stock_adjustment.immediateHint")), 1)
1155
+ e("div", en, m(s(w)("inventory.stock.stock_adjustment.immediateHint")), 1)
1157
1156
  ])) : se("", !0),
1158
1157
  e("div", tn, [
1159
- e("div", on, f(s(w)("inventory.stock.adjust.adjustedItems")), 1),
1158
+ e("div", on, m(s(w)("inventory.stock.adjust.adjustedItems")), 1),
1160
1159
  y(H, {
1161
1160
  "prepend-icon": "add",
1162
1161
  variant: "tertiary",
@@ -1200,19 +1199,19 @@ const We = {
1200
1199
  }), an = Tt((A, c) => ({
1201
1200
  // TODO: remove once latest inventory backend has been push
1202
1201
  async findBillsByBusinessId(k, _, w) {
1203
- const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, d = {
1202
+ const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, f = {
1204
1203
  // type: TYPE.bill,
1205
1204
  type: "bill",
1206
1205
  restaurantIds: _,
1207
1206
  ids: w
1208
1207
  };
1209
- return await c.post(V, d);
1208
+ return await c.post(V, f);
1210
1209
  },
1211
1210
  async findBillsById(k) {
1212
- const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`, d = {
1211
+ const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`, f = {
1213
1212
  ids: k
1214
1213
  };
1215
- return await c.post(V, d);
1214
+ return await c.post(V, f);
1216
1215
  }
1217
1216
  })), rn = {
1218
1217
  key: 0,
@@ -1227,15 +1226,15 @@ const We = {
1227
1226
  }),
1228
1227
  emits: /* @__PURE__ */ st(["refreshHistory"], ["update:modelValue"]),
1229
1228
  setup(A, { emit: c }) {
1230
- const k = A, _ = c, w = Ae(), V = jt(A, "modelValue"), d = Y(!1), r = Y(!1), b = Y(!1), R = Y({
1229
+ const k = A, _ = c, w = Ae(), V = jt(A, "modelValue"), f = Y(!1), r = Y(!1), b = Y(!1), R = Y({
1231
1230
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1232
1231
  skus: []
1233
1232
  }), C = Y();
1234
1233
  Xe(async () => {
1235
- d.value = !0;
1234
+ f.value = !0;
1236
1235
  const o = await w.readSingleAdjustment(k.adjustmentId);
1237
1236
  if (!o) throw new Error("Adjustment not found");
1238
- R.value = o, d.value = !1;
1237
+ R.value = o, f.value = !1;
1239
1238
  });
1240
1239
  async function l() {
1241
1240
  var t, n;
@@ -1336,7 +1335,7 @@ const We = {
1336
1335
  ])
1337
1336
  ]),
1338
1337
  default: M(() => [
1339
- d.value ? (j(), q("div", rn)) : (j(), ne(N, {
1338
+ f.value ? (j(), q("div", rn)) : (j(), ne(N, {
1340
1339
  key: 1,
1341
1340
  ref_key: "formRef",
1342
1341
  ref: C,
@@ -1352,7 +1351,7 @@ const We = {
1352
1351
  e("p", ln, [
1353
1352
  t[6] || (t[6] = e("b", null, "Date:", -1)),
1354
1353
  t[7] || (t[7] = e("br", null, null, -1)),
1355
- me(" " + f(s(Qt)(s(Et)(R.value._id))), 1)
1354
+ me(" " + m(s(Qt)(s(Et)(R.value._id))), 1)
1356
1355
  ]),
1357
1356
  e("div", un, [
1358
1357
  (j(!0), q(ue, null, ve(R.value.skus, (z, K) => (j(), q(ue, { key: K }, [
@@ -1363,17 +1362,17 @@ const We = {
1363
1362
  }, {
1364
1363
  default: M(() => [
1365
1364
  e("div", cn, [
1366
- e("span", dn, f(z.sku.code), 1),
1367
- e("span", null, f(z.sku.name), 1)
1365
+ e("span", dn, m(z.sku.code), 1),
1366
+ e("span", null, m(z.sku.name), 1)
1368
1367
  ]),
1369
1368
  t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1370
1369
  e("div", mn, [
1371
1370
  t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1372
- e("span", null, f(U.type), 1)
1371
+ e("span", null, m(U.type), 1)
1373
1372
  ]),
1374
1373
  e("div", fn, [
1375
1374
  t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1376
- e("span", null, f(s(_e).toFormatString({ value: U.amount })) + " " + f(v(z, U)), 1)
1375
+ e("span", null, m(s(_e).toFormatString({ value: U.amount })) + " " + m(v(z, U)), 1)
1377
1376
  ]),
1378
1377
  y($, {
1379
1378
  "max-fraction-digits": s($e)(z.sku.unit),
@@ -1399,7 +1398,7 @@ const We = {
1399
1398
  e("div", vn, [
1400
1399
  t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1401
1400
  t[11] || (t[11] = e("span", { class: "text-fm-color-system-warning-400 fm-typo-en-body-sm-400" }, "* It's an estimate for your reference, as it didn't include all the reversals related to this adjustment", -1)),
1402
- me(" " + f(g(
1401
+ me(" " + m(g(
1403
1402
  U.amount,
1404
1403
  s(_e).fromNumber(
1405
1404
  a({
@@ -1408,7 +1407,7 @@ const We = {
1408
1407
  unit: z.sku.unit
1409
1408
  }).value
1410
1409
  )
1411
- )) + " " + f(v(z, U)), 1)
1410
+ )) + " " + m(v(z, U)), 1)
1412
1411
  ])
1413
1412
  ]),
1414
1413
  _: 2
@@ -1464,7 +1463,7 @@ const We = {
1464
1463
  const v = [...a].filter((g) => new Date(g.snapshotAt) <= new Date(l)).sort((g, o) => new Date(o.snapshotAt).getTime() - new Date(g.snapshotAt).getTime());
1465
1464
  return v.length > 0 ? v[0].cost : null;
1466
1465
  }
1467
- const _ = Y(!1), w = Y(), V = Y(null), d = T(() => V.value === null ? "unset" : _.value ? `${V.value}px` : "0px");
1466
+ const _ = Y(!1), w = Y(), V = Y(null), f = T(() => V.value === null ? "unset" : _.value ? `${V.value}px` : "0px");
1468
1467
  Xe(() => {
1469
1468
  var C;
1470
1469
  V.value = ((C = w.value) == null ? void 0 : C.scrollHeight) || 0;
@@ -1552,7 +1551,7 @@ const We = {
1552
1551
  class: "flex items-center cursor-pointer mb-1",
1553
1552
  onClick: l[0] || (l[0] = (g) => _.value = !_.value)
1554
1553
  }, [
1555
- e("div", hn, f(C.record.date), 1),
1554
+ e("div", hn, m(C.record.date), 1),
1556
1555
  y(a, {
1557
1556
  name: _.value ? "expand_more" : "expand_less",
1558
1557
  color: "#777777",
@@ -1564,21 +1563,21 @@ const We = {
1564
1563
  class: "flex flex-row py-1",
1565
1564
  style: { "font-size": "0.8rem" }
1566
1565
  }, [
1567
- e("div", bn, f(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1566
+ e("div", bn, m(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1568
1567
  e("div", {
1569
1568
  class: He({
1570
1569
  "text-fm-color-typo-error": g.startsWith("-"),
1571
1570
  "text-fm-color-typo-success": !g.startsWith("-"),
1572
1571
  "ml-auto": !0
1573
1572
  })
1574
- }, f(g), 3)
1573
+ }, m(g), 3)
1575
1574
  ]))), 128)),
1576
1575
  e("div", {
1577
1576
  ref_key: "detailRef",
1578
1577
  ref: w,
1579
1578
  style: kt({
1580
1579
  fontSize: "0.8rem",
1581
- maxHeight: d.value,
1580
+ maxHeight: f.value,
1582
1581
  overflow: "hidden",
1583
1582
  transition: "max-height 0.2s ease-out"
1584
1583
  })
@@ -1588,7 +1587,7 @@ const We = {
1588
1587
  key: g.time,
1589
1588
  class: "flex gap-1 w-full"
1590
1589
  }, [
1591
- e("div", xn, f(g.time), 1),
1590
+ e("div", xn, m(g.time), 1),
1592
1591
  e("div", Sn, [
1593
1592
  (j(!0), q(ue, null, ve(g.adjustments, (o) => {
1594
1593
  var t;
@@ -1597,7 +1596,7 @@ const We = {
1597
1596
  class: "flex gap-1"
1598
1597
  }, [
1599
1598
  e("div", wn, [
1600
- me(f(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1599
+ me(m(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1601
1600
  o.backdateFrom ? (j(), ne(B, {
1602
1601
  key: 0,
1603
1602
  variant: "plain",
@@ -1605,7 +1604,7 @@ const We = {
1605
1604
  "z-index": 50
1606
1605
  }, {
1607
1606
  content: M(() => [
1608
- e("div", An, f(s(b)("inventory.stock.record.backdate", [
1607
+ e("div", An, m(s(b)("inventory.stock.record.backdate", [
1609
1608
  s(wt)(new Date(o.backdateFrom))
1610
1609
  ])), 1)
1611
1610
  ]),
@@ -1618,10 +1617,10 @@ const We = {
1618
1617
  ]),
1619
1618
  _: 2
1620
1619
  }, 1024)) : se("", !0),
1621
- o.billRemark ? (j(), q("span", Fn, " # " + f(o.billRemark), 1)) : se("", !0),
1622
- o.billRemark && o.remark ? (j(), q("span", $n, " (" + f(o.remark) + ") ", 1)) : se("", !0),
1623
- !o.billRemark && o.reason ? (j(), q("span", jn, " (" + f(o.reason) + ") ", 1)) : se("", !0),
1624
- !o.billRemark && o.remark ? (j(), q("span", Vn, " # " + f(o.remark), 1)) : se("", !0),
1620
+ o.billRemark ? (j(), q("span", Fn, " # " + m(o.billRemark), 1)) : se("", !0),
1621
+ o.billRemark && o.remark ? (j(), q("span", $n, " (" + m(o.remark) + ") ", 1)) : se("", !0),
1622
+ !o.billRemark && o.reason ? (j(), q("span", jn, " (" + m(o.reason) + ") ", 1)) : se("", !0),
1623
+ !o.billRemark && o.remark ? (j(), q("span", Vn, " # " + m(o.remark), 1)) : se("", !0),
1625
1624
  (t = o.createdBy) != null && t.name ? (j(), ne(B, {
1626
1625
  key: 5,
1627
1626
  variant: "plain",
@@ -1629,7 +1628,7 @@ const We = {
1629
1628
  "z-index": 50
1630
1629
  }, {
1631
1630
  content: M(() => [
1632
- me(f(s(b)("inventory.stock.record.createdBy", [o.createdBy.name])), 1)
1631
+ me(m(s(b)("inventory.stock.record.createdBy", [o.createdBy.name])), 1)
1633
1632
  ]),
1634
1633
  default: M(() => [
1635
1634
  e("span", Cn, [
@@ -1638,12 +1637,12 @@ const We = {
1638
1637
  size: "sm",
1639
1638
  color: "primary"
1640
1639
  }),
1641
- me(" " + f(o.createdBy.name), 1)
1640
+ me(" " + m(o.createdBy.name), 1)
1642
1641
  ])
1643
1642
  ]),
1644
1643
  _: 2
1645
1644
  }, 1024)) : se("", !0),
1646
- o.name === s(ie).Enum.CLOSING ? (j(), q("span", Bn, " Actual Balance: " + f(o.toBalance) + " " + f(o.baseUnit), 1)) : se("", !0)
1645
+ o.name === s(ie).Enum.CLOSING ? (j(), q("span", Bn, " Actual Balance: " + m(o.toBalance) + " " + m(o.baseUnit), 1)) : se("", !0)
1647
1646
  ]),
1648
1647
  e("div", {
1649
1648
  class: He({
@@ -1651,13 +1650,13 @@ const We = {
1651
1650
  "text-fm-color-typo-success": !o.amount.startsWith("-"),
1652
1651
  "ml-auto": !0
1653
1652
  })
1654
- }, f(o.amount), 3),
1653
+ }, m(o.amount), 3),
1655
1654
  o.name === s(ie).Enum.WASTAGE ? (j(), ne(_n, {
1656
1655
  key: 0,
1657
1656
  adjustmentId: o.adjustmentId,
1658
1657
  onRefreshHistory: l[1] || (l[1] = (n) => C.$emit("refreshHistory"))
1659
1658
  }, null, 8, ["adjustmentId"])) : se("", !0),
1660
- o.cost ? (j(), q("div", Dn, " (" + f(s(Me)(o.cost, !1, o.cost.precision)) + ") ", 1)) : se("", !0)
1659
+ o.cost ? (j(), q("div", Dn, " (" + m(s(Me)(o.cost, !1, o.cost.precision)) + ") ", 1)) : se("", !0)
1661
1660
  ]);
1662
1661
  }), 128))
1663
1662
  ])
@@ -1673,33 +1672,33 @@ const We = {
1673
1672
  function In(A, c) {
1674
1673
  var V;
1675
1674
  const k = Object.keys(ie.enum).reduce(
1676
- (d, r) => (d[r] = { amount: 0, precision: 0 }, d),
1675
+ (f, r) => (f[r] = { amount: 0, precision: 0 }, f),
1677
1676
  {}
1678
1677
  );
1679
1678
  if (!c)
1680
1679
  return Object.entries(k).reduce(
1681
- (d, [r]) => (d[r] = oe.fromNumber(0), d),
1680
+ (f, [r]) => (f[r] = oe.fromNumber(0), f),
1682
1681
  {}
1683
1682
  );
1684
- const w = A.flatMap((d) => {
1683
+ const w = A.flatMap((f) => {
1685
1684
  var r;
1686
- return ((r = d.skus) == null ? void 0 : r.filter((b) => b.sku._id === c._id)) ?? [];
1687
- }).flatMap((d) => d.amounts);
1688
- for (const d of w) {
1689
- const r = d.measurement ? oe.multiply([d.measurement.conversion, d.amount]) : d.amount;
1690
- k[V = d.type] ?? (k[V] = { amount: 0, precision: 0 }), k[d.type] = oe.add([r, k[d.type]]);
1685
+ return ((r = f.skus) == null ? void 0 : r.filter((b) => b.sku._id === c._id)) ?? [];
1686
+ }).flatMap((f) => f.amounts);
1687
+ for (const f of w) {
1688
+ const r = f.measurement ? oe.multiply([f.measurement.conversion, f.amount]) : f.amount;
1689
+ k[V = f.type] ?? (k[V] = { amount: 0, precision: 0 }), k[f.type] = oe.add([r, k[f.type]]);
1691
1690
  }
1692
1691
  return Object.entries(k).reduce(
1693
- (d, [r, b]) => {
1692
+ (f, [r, b]) => {
1694
1693
  const R = {
1695
1694
  ...b,
1696
1695
  amount: Math.abs(b.amount)
1697
1696
  };
1698
- return d[r] = /// comment, because without it formatter makes code uglier
1697
+ return f[r] = /// comment, because without it formatter makes code uglier
1699
1698
  `${oe.toFormatString({
1700
1699
  value: R,
1701
1700
  precision: 4
1702
- })} ${c.unit.abbrev}`, d;
1701
+ })} ${c.unit.abbrev}`, f;
1703
1702
  },
1704
1703
  {}
1705
1704
  );
@@ -1709,15 +1708,15 @@ function Hn(A, c) {
1709
1708
  return null;
1710
1709
  let k = null;
1711
1710
  const w = A.flatMap((V) => {
1712
- var d;
1713
- return ((d = V.skus) == null ? void 0 : d.filter((r) => r.sku._id === c._id)) ?? [];
1711
+ var f;
1712
+ return ((f = V.skus) == null ? void 0 : f.filter((r) => r.sku._id === c._id)) ?? [];
1714
1713
  }).flatMap((V) => {
1715
- var d;
1716
- return !V.history || ((d = V.history) == null ? void 0 : d.length) === 0 ? [] : V.history[0];
1714
+ var f;
1715
+ return !V.history || ((f = V.history) == null ? void 0 : f.length) === 0 ? [] : V.history[0];
1717
1716
  });
1718
1717
  for (const V of w) {
1719
- const d = V.amounts;
1720
- for (const r of d) {
1718
+ const f = V.amounts;
1719
+ for (const r of f) {
1721
1720
  if (r.type !== ie.Enum.SALES)
1722
1721
  continue;
1723
1722
  const b = r.measurement ? oe.multiply([r.measurement.conversion, r.amount]) : r.amount;
@@ -1735,10 +1734,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1735
1734
  }, On = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Ln = {
1736
1735
  key: 1,
1737
1736
  class: "flex flex-col gap-12"
1738
- }, Yn = { class: "pb-16" }, zn = { class: "fm-typo-cn-body-lg-600" }, Gn = {
1737
+ }, Yn = { class: "pb-16" }, zn = { class: "fm-typo-cn-body-lg-600" }, Wn = {
1739
1738
  class: "grid gap-12 fm-typo-en-body-md-400",
1740
1739
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1741
- }, Wn = { class: "flex flex-col gap-1" }, Kn = { class: "text-fm-color-typo-secondary" }, qn = { class: "font-bold" }, Xn = { class: "flex flex-col gap-1" }, Jn = { class: "text-fm-color-typo-secondary flex" }, Qn = { class: "font-bold" }, Zn = { class: "flex flex-col gap-1" }, es = { class: "text-fm-color-typo-secondary" }, ts = { class: "font-bold" }, os = { class: "flex flex-col gap-1" }, ns = { class: "text-fm-color-typo-secondary" }, ss = { class: "font-bold" }, as = { class: "flex flex-col gap-1" }, rs = { class: "text-fm-color-typo-secondary" }, ls = { class: "font-bold" }, is = { class: "flex flex-col gap-1" }, us = { class: "text-fm-color-typo-secondary" }, cs = { class: "font-bold" }, ds = { class: "flex flex-col gap-1" }, ms = { class: "text-fm-color-typo-secondary" }, fs = { class: "font-bold" }, vs = { class: "flex flex-col gap-1" }, ps = { class: "text-fm-color-typo-secondary" }, ys = { class: "font-bold" }, _s = { class: "flex flex-col gap-1" }, ks = { class: "text-fm-color-typo-secondary" }, hs = { class: "font-bold" }, bs = {
1740
+ }, Gn = { class: "flex flex-col gap-1" }, Kn = { class: "text-fm-color-typo-secondary" }, qn = { class: "font-bold" }, Xn = { class: "flex flex-col gap-1" }, Jn = { class: "text-fm-color-typo-secondary flex" }, Qn = { class: "font-bold" }, Zn = { class: "flex flex-col gap-1" }, es = { class: "text-fm-color-typo-secondary" }, ts = { class: "font-bold" }, os = { class: "flex flex-col gap-1" }, ns = { class: "text-fm-color-typo-secondary" }, ss = { class: "font-bold" }, as = { class: "flex flex-col gap-1" }, rs = { class: "text-fm-color-typo-secondary" }, ls = { class: "font-bold" }, is = { class: "flex flex-col gap-1" }, us = { class: "text-fm-color-typo-secondary" }, cs = { class: "font-bold" }, ds = { class: "flex flex-col gap-1" }, ms = { class: "text-fm-color-typo-secondary" }, fs = { class: "font-bold" }, vs = { class: "flex flex-col gap-1" }, ps = { class: "text-fm-color-typo-secondary" }, ys = { class: "font-bold" }, _s = { class: "flex flex-col gap-1" }, ks = { class: "text-fm-color-typo-secondary" }, hs = { class: "font-bold" }, bs = {
1742
1741
  key: 0,
1743
1742
  class: "flex flex-col gap-8"
1744
1743
  }, gs = { class: "flex" }, xs = { class: "flex-1 flex flex-col gap-1" }, Ss = { class: "flex items-center gap-8" }, ws = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, As = { class: "font-bold" }, Fs = { class: "flex-1 flex flex-col gap-1" }, $s = { class: "flex items-center gap-8" }, js = { class: "flex gap-1 items-center text-fm-color-typo-secondary" }, Vs = { class: "flex flex-col gap-1" }, Cs = { class: "font-bold" }, Bs = {
@@ -1752,7 +1751,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1752
1751
  },
1753
1752
  emits: ["update:show"],
1754
1753
  setup(A) {
1755
- const c = Je(), k = Oe(), _ = Ae(), w = an(), V = Se(), d = ao(), { t: r } = ye(), b = A, R = Y(!1), C = we(), l = Y("adjustment"), a = Y([
1754
+ const c = Je(), k = Oe(), _ = Ae(), w = an(), V = Se(), f = ao(), { t: r } = ye(), b = A, R = Y(!1), C = we(), l = Y("adjustment"), a = Y([
1756
1755
  { label: "Adjustment (Default)", value: "adjustment" }
1757
1756
  ]), B = Y([]), v = Y(no(0));
1758
1757
  async function g() {
@@ -1780,18 +1779,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1780
1779
  }
1781
1780
  function E(u, h) {
1782
1781
  const p = u.reduce(
1783
- (m, i) => {
1782
+ (d, i) => {
1784
1783
  const S = i.effectiveAt ?? Te(i._id);
1785
1784
  if (!S)
1786
- return m;
1785
+ return d;
1787
1786
  const P = $(new Date(S), h);
1788
- return m[P] ?? (m[P] = []), m[P].push(i), m;
1787
+ return d[P] ?? (d[P] = []), d[P].push(i), d;
1789
1788
  },
1790
1789
  {}
1791
1790
  );
1792
- return Object.keys(p).map((m) => ({
1793
- date: m,
1794
- adjustments: p[m]
1791
+ return Object.keys(p).map((d) => ({
1792
+ date: d,
1793
+ adjustments: p[d]
1795
1794
  }));
1796
1795
  }
1797
1796
  async function N() {
@@ -1802,10 +1801,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1802
1801
  );
1803
1802
  o.value = u;
1804
1803
  const h = u.filter(({ ref: p }) => p == null ? void 0 : p.startsWith("bill_")).map(({ ref: p }) => p);
1805
- await O(h), t.value = E(u, "day").map(({ date: p, adjustments: m }) => ({
1804
+ await O(h), t.value = E(u, "day").map(({ date: p, adjustments: d }) => ({
1806
1805
  date: p,
1807
- adjustments: m,
1808
- adjustmentsByTime: E(m, "minute")
1806
+ adjustments: d,
1807
+ adjustmentsByTime: E(d, "minute")
1809
1808
  }));
1810
1809
  try {
1811
1810
  const p = await _.readUnitCostHistory(
@@ -1814,18 +1813,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1814
1813
  mt(new Date(v.value.endDate)).toISOString()
1815
1814
  );
1816
1815
  B.value = p;
1817
- const m = /* @__PURE__ */ new Set();
1816
+ const d = /* @__PURE__ */ new Set();
1818
1817
  p.forEach((S) => {
1819
- m.add(S.mechanism);
1818
+ d.add(S.mechanism);
1820
1819
  });
1821
1820
  const i = [{ label: "Default", value: "adjustment" }];
1822
- m.has(ge.Enum.weightedAverage) && i.push({
1821
+ d.has(ge.Enum.weightedAverage) && i.push({
1823
1822
  label: "Weighted Average (Beta)",
1824
1823
  value: ge.Enum.weightedAverage
1825
- }), m.has(ge.Enum.netsuite) && i.push({ label: "NetSuite (Beta)", value: ge.Enum.netsuite }), m.has(ge.Enum["netsuite-average"]) && i.push({
1824
+ }), d.has(ge.Enum.netsuite) && i.push({ label: "NetSuite (Beta)", value: ge.Enum.netsuite }), d.has(ge.Enum["netsuite-average"]) && i.push({
1826
1825
  label: "NetSuite Average (Beta)",
1827
1826
  value: ge.Enum["netsuite-average"]
1828
- }), a.value = i, !m.has(l.value) && l.value !== "adjustment" && (l.value = "adjustment");
1827
+ }), a.value = i, !d.has(l.value) && l.value !== "adjustment" && (l.value = "adjustment");
1829
1828
  } catch (p) {
1830
1829
  console.error("Failed to fetch unit cost history:", p);
1831
1830
  }
@@ -1834,8 +1833,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1834
1833
  u.length && (n.value = await w.findBillsById(u).catch((h) => {
1835
1834
  var i;
1836
1835
  console.error("Error on using latest bill API, retrying using legacy api", h);
1837
- const p = ((i = c.currentBusiness.value) == null ? void 0 : i._id) ?? "", m = V.currentLocation.doc._id;
1838
- return w.findBillsByBusinessId(p, [m], u);
1836
+ const p = ((i = c.currentBusiness.value) == null ? void 0 : i._id) ?? "", d = V.currentLocation.doc._id;
1837
+ return w.findBillsByBusinessId(p, [d], u);
1839
1838
  }));
1840
1839
  }
1841
1840
  const L = T(() => {
@@ -1847,8 +1846,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1847
1846
  }), z = T(() => {
1848
1847
  const u = [...o.value].computeFirst((p) => {
1849
1848
  var i, S;
1850
- const m = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1851
- return m == null ? void 0 : m.fromBalance;
1849
+ const d = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1850
+ return d == null ? void 0 : d.fromBalance;
1852
1851
  }) ?? {
1853
1852
  amount: 0,
1854
1853
  precision: 0
@@ -1860,8 +1859,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1860
1859
  }), K = T(() => {
1861
1860
  const u = [...o.value].reverse().computeFirst((p) => {
1862
1861
  var i, S;
1863
- const m = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1864
- return m == null ? void 0 : m.toBalance;
1862
+ const d = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1863
+ return d == null ? void 0 : d.toBalance;
1865
1864
  }) ?? {
1866
1865
  amount: 0,
1867
1866
  precision: 0
@@ -1869,20 +1868,20 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1869
1868
  return h ? `${oe.toFormatString({ value: u, precision: 4 })} ${h.unit.abbrev}` : "";
1870
1869
  }), U = T(() => {
1871
1870
  var p;
1872
- const h = o.value.flatMap((m) => {
1871
+ const h = o.value.flatMap((d) => {
1873
1872
  var i;
1874
- return ((i = m.skus) == null ? void 0 : i.flatMap((S) => S.amounts)) ?? [];
1875
- }).filter((m) => m.amount.amount < 0).reduce(
1876
- (m, i) => {
1873
+ return ((i = d.skus) == null ? void 0 : i.flatMap((S) => S.amounts)) ?? [];
1874
+ }).filter((d) => d.amount.amount < 0).reduce(
1875
+ (d, i) => {
1877
1876
  const S = i.cost;
1878
- if (!S) return m;
1877
+ if (!S) return d;
1879
1878
  const P = {
1880
- ...zt(m, Math.max(m.precision, S.precision)),
1879
+ ...zt(d, Math.max(d.precision, S.precision)),
1881
1880
  currency: S.currency
1882
1881
  };
1883
1882
  return {
1884
1883
  ...Ze(P, S),
1885
- currency: m.currency
1884
+ currency: d.currency
1886
1885
  };
1887
1886
  },
1888
1887
  {
@@ -1908,60 +1907,60 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1908
1907
  (S) => S.mechanism === l.value && S.skuId === b.sku._id
1909
1908
  );
1910
1909
  if (p.length === 0) return null;
1911
- const m = p.find((S) => {
1910
+ const d = p.find((S) => {
1912
1911
  const P = S.meta;
1913
1912
  return (P == null ? void 0 : P.adjustmentId) === u;
1914
1913
  });
1915
- if (m) return m.cost;
1914
+ if (d) return d.cost;
1916
1915
  const i = [...p].filter((S) => new Date(S.snapshotAt) <= new Date(h)).sort((S, P) => new Date(P.snapshotAt).getTime() - new Date(S.snapshotAt).getTime());
1917
1916
  return i.length > 0 ? i[0].cost : null;
1918
1917
  }
1919
1918
  const F = T(() => {
1920
- var m, i, S, P, ee, ae;
1919
+ var d, i, S, P, ee, ae;
1921
1920
  const u = [...o.value].reverse().find((Q) => {
1922
- var W, te;
1923
- return (te = (W = Q.skus) == null ? void 0 : W.find) == null ? void 0 : te.call(W, (le) => le.sku._id === b.sku._id);
1921
+ var G, te;
1922
+ return (te = (G = Q.skus) == null ? void 0 : G.find) == null ? void 0 : te.call(G, (le) => le.sku._id === b.sku._id);
1924
1923
  });
1925
1924
  if (!u) return "No data";
1926
- const h = (m = u.skus) == null ? void 0 : m.find((Q) => Q.sku._id === b.sku._id);
1925
+ const h = (d = u.skus) == null ? void 0 : d.find((Q) => Q.sku._id === b.sku._id);
1927
1926
  if (!h) return "No data";
1928
1927
  const p = h.toBalance;
1929
1928
  if (l.value === "adjustment") {
1930
- const Q = [...h.amounts].reverse()[0], W = {
1929
+ const Q = [...h.amounts].reverse()[0], G = {
1931
1930
  amount: ((i = Q.cost) == null ? void 0 : i.amount) ?? 0,
1932
1931
  precision: ((S = Q.cost) == null ? void 0 : S.precision) ?? 0
1933
- }, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([W, te]);
1932
+ }, te = Q.amount, le = te.amount == 0 ? oe.fromNumber(0) : oe.divide([G, te]);
1934
1933
  return {
1935
1934
  ...oe.multiply([le, p]),
1936
1935
  currency: ((P = Q.cost) == null ? void 0 : P.currency) || Ce(((ee = c.currentCountry) == null ? void 0 : ee.value) ?? it)
1937
1936
  };
1938
1937
  } else {
1939
- const Q = u.effectiveAt ?? Te(u._id), W = x(
1938
+ const Q = u.effectiveAt ?? Te(u._id), G = x(
1940
1939
  u._id,
1941
1940
  Q ?? (/* @__PURE__ */ new Date()).toISOString()
1942
1941
  );
1943
- if (!W) return "No data";
1944
- const te = oe.fromDinero(W);
1942
+ if (!G) return "No data";
1943
+ const te = oe.fromDinero(G);
1945
1944
  return {
1946
1945
  ...oe.multiply([te, p]),
1947
- currency: W.currency || Ce(((ae = c.currentCountry) == null ? void 0 : ae.value) ?? it)
1946
+ currency: G.currency || Ce(((ae = c.currentCountry) == null ? void 0 : ae.value) ?? it)
1948
1947
  };
1949
1948
  }
1950
- }), G = T(() => {
1949
+ }), W = T(() => {
1951
1950
  var p;
1952
- const u = [...o.value].reverse().computeFirst((m) => {
1951
+ const u = [...o.value].reverse().computeFirst((d) => {
1953
1952
  var S, P;
1954
- const i = (P = (S = m.skus) == null ? void 0 : S.find) == null ? void 0 : P.call(S, (ee) => ee.sku._id === b.sku._id);
1953
+ const i = (P = (S = d.skus) == null ? void 0 : S.find) == null ? void 0 : P.call(S, (ee) => ee.sku._id === b.sku._id);
1955
1954
  return i == null ? void 0 : i.toCostBalances;
1956
1955
  });
1957
- return !u || u.some((m) => m.cost == null) ? "No data" : {
1958
- ...u.reduce((m, i) => oe.add([m, oe.fromDinero(i.cost)]), {
1956
+ return !u || u.some((d) => d.cost == null) ? "No data" : {
1957
+ ...u.reduce((d, i) => oe.add([d, oe.fromDinero(i.cost)]), {
1959
1958
  amount: 0,
1960
1959
  precision: 0
1961
1960
  }),
1962
1961
  currency: Ce((p = c.currentCountry) == null ? void 0 : p.value)
1963
1962
  };
1964
- }), H = T(() => b.sku.valuation === ut.Enum.FIFO ? G.value : F.value);
1963
+ }), H = T(() => b.sku.valuation === ut.Enum.FIFO ? W.value : F.value);
1965
1964
  function J() {
1966
1965
  const { startDate: u, endDate: h } = to(v.value);
1967
1966
  u !== null && h !== null && (v.value = {
@@ -1971,7 +1970,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1971
1970
  }
1972
1971
  const I = Ye(b, "show");
1973
1972
  return (u, h) => {
1974
- const p = D("FmButton"), m = D("FmField"), i = D("FmDateRangePicker"), S = D("FmSpacer"), P = D("FmCircularProgress"), ee = D("FmIcon"), ae = D("FmTooltip"), Q = D("FmMenuDivider"), W = D("FmChip"), te = D("FmSelect"), le = D("FmCardSection"), ce = D("FmCard"), je = D("FmSideSheet");
1973
+ const p = D("FmButton"), d = D("FmField"), i = D("FmDateRangePicker"), S = D("FmSpacer"), P = D("FmCircularProgress"), ee = D("FmIcon"), ae = D("FmTooltip"), Q = D("FmMenuDivider"), G = D("FmChip"), te = D("FmSelect"), le = D("FmCardSection"), ce = D("FmCard"), je = D("FmSideSheet");
1975
1974
  return j(), ne(je, {
1976
1975
  "dismiss-away": "",
1977
1976
  modelValue: s(I),
@@ -1981,7 +1980,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1981
1980
  }, {
1982
1981
  "side-sheet-header": M(() => [
1983
1982
  e("div", Tn, [
1984
- e("div", En, f(s(r)("inventory.stock.history.title", [u.sku.name])), 1),
1983
+ e("div", En, m(s(r)("inventory.stock.history.title", [u.sku.name])), 1),
1985
1984
  y(p, {
1986
1985
  variant: "tertiary",
1987
1986
  "prepend-icon": "close",
@@ -2004,12 +2003,12 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2004
2003
  "z-index": 50
2005
2004
  }, {
2006
2005
  "trigger-button": M(({ opened: de }) => [
2007
- y(m, {
2006
+ y(d, {
2008
2007
  "prepend-icon": "calendar_month",
2009
2008
  focused: de
2010
2009
  }, {
2011
2010
  default: M(() => [
2012
- me(f(v.value.startDate) + " - " + f(v.value.endDate), 1)
2011
+ me(m(v.value.startDate) + " - " + m(v.value.endDate), 1)
2013
2012
  ]),
2014
2013
  _: 2
2015
2014
  }, 1032, ["focused"])
@@ -2031,7 +2030,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2031
2030
  R.value ? (j(), q("div", Nn, [
2032
2031
  y(S),
2033
2032
  y(P, { size: "xl" }),
2034
- e("div", On, f(s(r)("inventory.stock.history.loading")), 1),
2033
+ e("div", On, m(s(r)("inventory.stock.history.loading")), 1),
2035
2034
  y(S),
2036
2035
  y(S)
2037
2036
  ])) : t.value && ((fe = t.value) == null ? void 0 : fe.length) > 0 ? (j(), q("div", Ln, [
@@ -2040,16 +2039,16 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2040
2039
  y(le, { class: "flex flex-col gap-4" }, {
2041
2040
  default: M(() => [
2042
2041
  e("div", Yn, [
2043
- e("div", zn, f(s(r)("inventory.stock.history.summary.title")), 1)
2042
+ e("div", zn, m(s(r)("inventory.stock.history.summary.title")), 1)
2044
2043
  ]),
2045
- e("div", Gn, [
2046
- e("div", Wn, [
2047
- e("div", Kn, f(s(r)("inventory.stock.history.summary.totalPurchase")), 1),
2048
- e("div", qn, f(L.value.PURCHASE), 1)
2044
+ e("div", Wn, [
2045
+ e("div", Gn, [
2046
+ e("div", Kn, m(s(r)("inventory.stock.history.summary.totalPurchase")), 1),
2047
+ e("div", qn, m(L.value.PURCHASE), 1)
2049
2048
  ]),
2050
2049
  e("div", Xn, [
2051
2050
  e("div", Jn, [
2052
- me(f(s(r)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2051
+ me(m(s(r)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2053
2052
  X.value != null ? (j(), ne(ae, {
2054
2053
  key: 0,
2055
2054
  variant: "plain",
@@ -2066,44 +2065,44 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2066
2065
  _: 1
2067
2066
  }, 8, ["content"])) : se("", !0)
2068
2067
  ]),
2069
- e("div", Qn, f(L.value.SALES), 1)
2068
+ e("div", Qn, m(L.value.SALES), 1)
2070
2069
  ]),
2071
2070
  e("div", Zn, [
2072
- e("div", es, f(s(r)("inventory.stock.history.summary.totalLose")), 1),
2073
- e("div", ts, f(L.value.LOSE), 1)
2071
+ e("div", es, m(s(r)("inventory.stock.history.summary.totalLose")), 1),
2072
+ e("div", ts, m(L.value.LOSE), 1)
2074
2073
  ]),
2075
2074
  e("div", os, [
2076
- e("div", ns, f(s(r)("inventory.stock.history.summary.totalRequest")), 1),
2077
- e("div", ss, f(L.value.REQUEST), 1)
2075
+ e("div", ns, m(s(r)("inventory.stock.history.summary.totalRequest")), 1),
2076
+ e("div", ss, m(L.value.REQUEST), 1)
2078
2077
  ]),
2079
2078
  e("div", as, [
2080
- e("div", rs, f(s(r)("inventory.stock.history.summary.totalReceive")), 1),
2081
- e("div", ls, f(L.value.RECEIVE), 1)
2079
+ e("div", rs, m(s(r)("inventory.stock.history.summary.totalReceive")), 1),
2080
+ e("div", ls, m(L.value.RECEIVE), 1)
2082
2081
  ]),
2083
2082
  e("div", is, [
2084
- e("div", us, f(s(r)("inventory.stock.history.summary.totalConvert")), 1),
2085
- e("div", cs, f(L.value.CONVERT), 1)
2083
+ e("div", us, m(s(r)("inventory.stock.history.summary.totalConvert")), 1),
2084
+ e("div", cs, m(L.value.CONVERT), 1)
2086
2085
  ]),
2087
2086
  e("div", ds, [
2088
- e("div", ms, f(s(r)("inventory.stock.history.summary.totalDamage")), 1),
2089
- e("div", fs, f(L.value.DAMAGE), 1)
2087
+ e("div", ms, m(s(r)("inventory.stock.history.summary.totalDamage")), 1),
2088
+ e("div", fs, m(L.value.DAMAGE), 1)
2090
2089
  ]),
2091
2090
  e("div", vs, [
2092
- e("div", ps, f(s(r)("inventory.stock.history.summary.openingBalance")), 1),
2093
- e("div", ys, f(z.value), 1)
2091
+ e("div", ps, m(s(r)("inventory.stock.history.summary.openingBalance")), 1),
2092
+ e("div", ys, m(z.value), 1)
2094
2093
  ]),
2095
2094
  e("div", _s, [
2096
- e("div", ks, f(s(r)("inventory.stock.history.summary.lastStockBalance")), 1),
2097
- e("div", hs, f(K.value), 1)
2095
+ e("div", ks, m(s(r)("inventory.stock.history.summary.lastStockBalance")), 1),
2096
+ e("div", hs, m(K.value), 1)
2098
2097
  ])
2099
2098
  ]),
2100
- s(d).enableTotalCost ? (j(), q("div", bs, [
2099
+ s(f).enableTotalCost ? (j(), q("div", bs, [
2101
2100
  y(Q, { class: "w-full" }),
2102
2101
  e("div", gs, [
2103
2102
  e("div", xs, [
2104
2103
  e("div", Ss, [
2105
2104
  e("div", ws, [
2106
- me(f(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
2105
+ me(m(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
2107
2106
  y(ae, {
2108
2107
  variant: "plain",
2109
2108
  placement: "top",
@@ -2127,17 +2126,17 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2127
2126
  ]),
2128
2127
  e("div", As, [
2129
2128
  u.sku.valuation === s(ut).Enum.FIFO ? (j(), q(ue, { key: 0 }, [
2130
- y(W, {
2129
+ y(G, {
2131
2130
  label: "FIFO",
2132
2131
  compact: ""
2133
2132
  }),
2134
- me(" " + f(typeof H.value != "string" ? s(Me)(
2133
+ me(" " + m(typeof H.value != "string" ? s(Me)(
2135
2134
  H.value,
2136
2135
  !1,
2137
2136
  H.value.precision
2138
2137
  ) : H.value), 1)
2139
2138
  ], 64)) : (j(), q(ue, { key: 1 }, [
2140
- me(f(typeof H.value != "string" ? s(Me)(
2139
+ me(m(typeof H.value != "string" ? s(Me)(
2141
2140
  H.value,
2142
2141
  !1,
2143
2142
  H.value.precision
@@ -2156,14 +2155,14 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2156
2155
  e("div", Fs, [
2157
2156
  e("div", $s, [
2158
2157
  e("div", js, [
2159
- me(f(s(r)("inventory.stock.history.costSold")) + " ", 1),
2158
+ me(m(s(r)("inventory.stock.history.costSold")) + " ", 1),
2160
2159
  y(ae, {
2161
2160
  variant: "plain",
2162
2161
  placement: "top",
2163
2162
  "z-index": 50
2164
2163
  }, {
2165
2164
  content: M(() => [
2166
- e("div", Vs, f(s(r)("inventory.stock.history.costSoldTooltip")), 1)
2165
+ e("div", Vs, m(s(r)("inventory.stock.history.costSoldTooltip")), 1)
2167
2166
  ]),
2168
2167
  default: M(() => [
2169
2168
  y(ee, {
@@ -2180,7 +2179,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2180
2179
  "feature-key": "total-cost"
2181
2180
  })
2182
2181
  ]),
2183
- e("div", Cs, f(U.value), 1)
2182
+ e("div", Cs, m(U.value), 1)
2184
2183
  ])
2185
2184
  ])
2186
2185
  ])) : se("", !0)
@@ -2212,8 +2211,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2212
2211
  alt: "List is empty"
2213
2212
  }, null, 8, Ds)
2214
2213
  ]),
2215
- e("div", Ms, f(s(r)("inventory.stock.history.noRecords")), 1),
2216
- e("div", Is, f(s(r)("inventory.stock.history.changeDateRange")), 1),
2214
+ e("div", Ms, m(s(r)("inventory.stock.history.noRecords")), 1),
2215
+ e("div", Is, m(s(r)("inventory.stock.history.changeDateRange")), 1),
2217
2216
  y(S),
2218
2217
  y(S)
2219
2218
  ]))
@@ -2244,7 +2243,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2244
2243
  });
2245
2244
  function Es(A) {
2246
2245
  const c = io(), k = Se(), _ = Y(!1), w = Y(null), V = Y(null);
2247
- let d = null, r = !1, b = !1;
2246
+ let f = null, r = !1, b = !1;
2248
2247
  function R() {
2249
2248
  if (b) return;
2250
2249
  const a = k.currentLocationDBName;
@@ -2257,7 +2256,7 @@ function Es(A) {
2257
2256
  B,
2258
2257
  C
2259
2258
  );
2260
- d = v, g.then((o) => {
2259
+ f = v, g.then((o) => {
2261
2260
  o != null && o.initialState && C(o.initialState);
2262
2261
  }).catch((o) => {
2263
2262
  console.error("Failed to fetch refresh-balance initial state", o);
@@ -2288,7 +2287,7 @@ function Es(A) {
2288
2287
  }
2289
2288
  }
2290
2289
  function l() {
2291
- d && (d(), d = null), b = !1, r = !1, _.value = !1, w.value = null;
2290
+ f && (f(), f = null), b = !1, r = !1, _.value = !1, w.value = null;
2292
2291
  }
2293
2292
  return Ct(() => {
2294
2293
  l();
@@ -2303,10 +2302,10 @@ function Es(A) {
2303
2302
  const Us = {
2304
2303
  key: 0,
2305
2304
  class: "flex items-center gap-1"
2306
- }, Ps = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rs = { class: "flex flex-col gap-8" }, Ns = { class: "flex flex-col" }, Os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, xa = /* @__PURE__ */ pe({
2305
+ }, Ps = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Rs = { class: "flex flex-col gap-8" }, Ns = { class: "flex flex-col" }, Os = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ls = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary line-clamp-1" }, ga = /* @__PURE__ */ pe({
2307
2306
  __name: "StockView",
2308
2307
  setup(A) {
2309
- const { t: c } = ye(), k = Ne(), _ = Se(), w = Oe(), V = Ft(), d = Ae(), r = gt(), b = uo(), { columnDefs: R } = ko(), C = Je(), { hasPermission: l } = At(
2308
+ const { t: c } = ye(), k = Ne(), _ = Se(), w = Oe(), V = Ft(), f = Ae(), r = gt(), b = uo(), { columnDefs: R } = ko(), C = Je(), { hasPermission: l } = At(
2310
2309
  T(() => [
2311
2310
  {
2312
2311
  action: Be.Action.manage,
@@ -2340,12 +2339,12 @@ const Us = {
2340
2339
  }), O = T(() => n.value || t.value);
2341
2340
  async function L() {
2342
2341
  E();
2343
- const p = c("inventory.stock.stock_balance.refreshBalanceDescription"), m = $.value ? `${p}
2342
+ const p = c("inventory.stock.stock_balance.refreshBalanceDescription"), d = $.value ? `${p}
2344
2343
 
2345
2344
  Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2346
2345
  B.open({
2347
2346
  title: c("inventory.stock.stock_balance.refreshBalance"),
2348
- message: m,
2347
+ message: d,
2349
2348
  closeButton: !0,
2350
2349
  primaryActions: {
2351
2350
  text: c("common.confirm"),
@@ -2363,7 +2362,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2363
2362
  if (!t.value) {
2364
2363
  t.value = !0;
2365
2364
  try {
2366
- await d.recalculation.refreshCurrentBalances();
2365
+ await f.recalculation.refreshCurrentBalances();
2367
2366
  } catch (i) {
2368
2367
  console.log("Failed to queue refresh balan22ce", typeof i);
2369
2368
  const S = typeof i == "object" ? JSON.stringify(i) : String(i);
@@ -2413,7 +2412,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2413
2412
  ]
2414
2413
  }), U = T(() => {
2415
2414
  var i, S, P;
2416
- const p = K.value ? co.build(K.value) : null, m = [];
2415
+ const p = K.value ? co.build(K.value) : null, d = [];
2417
2416
  for (const ee of k.skus) {
2418
2417
  let ae = !0;
2419
2418
  if (b.isEnabled && re.value && g.value && ae && (ae = g.value.has(ee._id)), p && ae && (ae = mo(
@@ -2423,14 +2422,14 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2423
2422
  p
2424
2423
  )), ae) {
2425
2424
  const Q = ee.trackingMeasurement;
2426
- let W = (S = (i = w.stockBalance.skus) == null ? void 0 : i.find(
2425
+ let G = (S = (i = w.stockBalance.skus) == null ? void 0 : i.find(
2427
2426
  (ce) => ce.id === ee._id
2428
2427
  )) == null ? void 0 : S.balance, te = r.inventoryForecast.skus.find(
2429
2428
  (ce) => ce.id === ee._id
2430
2429
  );
2431
2430
  const le = {
2432
2431
  ...ee,
2433
- balance: W ?? {
2432
+ balance: G ?? {
2434
2433
  amount: 0,
2435
2434
  precision: 0
2436
2435
  },
@@ -2438,11 +2437,11 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2438
2437
  day: (te == null ? void 0 : te.depletionDays) ?? void 0,
2439
2438
  trackingUnitAbbrev: Q ? ((P = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : P.abbrev) ?? "" : ee.unit.abbrev
2440
2439
  };
2441
- m.push(le);
2440
+ d.push(le);
2442
2441
  }
2443
2442
  }
2444
- return m;
2445
- }), Z = Y(""), re = Y(!0), { breakpoints: x } = Nt(), F = T(() => x.value.xs || x.value.sm), G = T(() => F.value ? 10 : 20), H = Dt(), J = T(() => {
2443
+ return d;
2444
+ }), Z = Y(""), re = Y(!0), { breakpoints: x } = Nt(), F = T(() => x.value.xs || x.value.sm), W = T(() => F.value ? 10 : 20), H = Dt(), J = T(() => {
2446
2445
  const p = [
2447
2446
  {
2448
2447
  label: c("inventory.stock.stock_balance.refreshBalance"),
@@ -2479,7 +2478,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2479
2478
  return u();
2480
2479
  }
2481
2480
  }
2482
- return (p, m) => {
2481
+ return (p, d) => {
2483
2482
  const i = D("FmSwitch"), S = D("FmTable");
2484
2483
  return j(), ne(Mt, {
2485
2484
  title: s(c)("inventory.stock.title"),
@@ -2502,22 +2501,22 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2502
2501
  searchable: "",
2503
2502
  "change-location": "",
2504
2503
  search: Z.value,
2505
- "onUpdate:search": m[1] || (m[1] = (W) => Z.value = W),
2504
+ "onUpdate:search": d[1] || (d[1] = (G) => Z.value = G),
2506
2505
  "hide-filter-options": !0,
2507
2506
  filterable: "",
2508
2507
  "filter-attributes": z.value,
2509
2508
  filter: K.value,
2510
- "onUpdate:filter": m[2] || (m[2] = (W) => K.value = W)
2509
+ "onUpdate:filter": d[2] || (d[2] = (G) => K.value = G)
2511
2510
  }, {
2512
2511
  default: M(() => [
2513
2512
  s(b).isEnabled ? (j(), q("div", Us, [
2514
- e("span", Ps, f(s(c)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2513
+ e("span", Ps, m(s(c)("inventory.integration.netsuite.subsidiaryHierarchy.filtering")), 1),
2515
2514
  y(Rt),
2516
2515
  y(Qe, null, {
2517
2516
  default: M(() => [
2518
2517
  y(i, {
2519
2518
  modelValue: re.value,
2520
- "onUpdate:modelValue": m[0] || (m[0] = (W) => re.value = W)
2519
+ "onUpdate:modelValue": d[0] || (d[0] = (G) => re.value = G)
2521
2520
  }, null, 8, ["modelValue"])
2522
2521
  ]),
2523
2522
  _: 1
@@ -2533,12 +2532,12 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2533
2532
  "search-value": Z.value,
2534
2533
  loading: o.value || s(n) || !s(_)._currentLocation,
2535
2534
  key: (P = s(_)._currentLocation) == null ? void 0 : P.dbName,
2536
- onRowClick: m[3] || (m[3] = (W) => s(V).showSkuHistory(W.original)),
2537
- "page-size": G.value
2535
+ onRowClick: d[3] || (d[3] = (G) => s(V).showSkuHistory(G.original)),
2536
+ "page-size": W.value
2538
2537
  }, {
2539
- "list-row": M((W) => [
2538
+ "list-row": M((G) => [
2540
2539
  y(ro, {
2541
- row: W,
2540
+ row: G,
2542
2541
  onRowClick: s(V).showSkuHistory
2543
2542
  }, {
2544
2543
  default: M((te) => {
@@ -2561,16 +2560,16 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2561
2560
  ]),
2562
2561
  e("div", null, [
2563
2562
  y(Ke, {
2564
- days: W.original.day
2563
+ days: G.original.day
2565
2564
  }, null, 8, ["days"])
2566
2565
  ]),
2567
2566
  e("div", null, [
2568
2567
  y(ht, {
2569
2568
  class: "xs:w-[160px]",
2570
- unit: W.original.unit,
2571
- sku: W.original,
2572
- amount: W.original.balance,
2573
- "default-tracking-measurement": W.original.trackingMeasurement ?? void 0
2569
+ unit: G.original.unit,
2570
+ sku: G.original,
2571
+ amount: G.original.balance,
2572
+ "default-tracking-measurement": G.original.trackingMeasurement ?? void 0
2574
2573
  }, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
2575
2574
  ])
2576
2575
  ])
@@ -2585,8 +2584,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2585
2584
  (j(), ne(Bt, { to: "body" }, [
2586
2585
  (ee = s(V).stockHistoryProps) != null && ee.sku ? (j(), ne(Hs, rt(ze({ key: 0 }, s(V).stockHistoryProps)), null, 16)) : se("", !0),
2587
2586
  (ae = s(V).convertSkuDialogProps) != null && ae.sku ? (j(), ne(Mo, rt(ze({ key: 1 }, s(V).convertSkuDialogProps)), null, 16)) : se("", !0),
2588
- (Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(Go, ze({ key: 2 }, s(V).adjustSkuDialogProps, {
2589
- onSubmitted: m[4] || (m[4] = (W) => X())
2587
+ (Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(Wo, ze({ key: 2 }, s(V).adjustSkuDialogProps, {
2588
+ onSubmitted: d[4] || (d[4] = (G) => X())
2590
2589
  }), null, 16)) : se("", !0),
2591
2590
  y(Ts, {
2592
2591
  permission: {
@@ -2598,8 +2597,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2598
2597
  I.value ? (j(), ne(sn, {
2599
2598
  key: 0,
2600
2599
  show: I.value,
2601
- "onUpdate:show": m[5] || (m[5] = (W) => I.value = W),
2602
- onSubmitted: m[6] || (m[6] = (W) => X())
2600
+ "onUpdate:show": d[5] || (d[5] = (G) => I.value = G),
2601
+ onSubmitted: d[6] || (d[6] = (G) => X())
2603
2602
  }, null, 8, ["show"])) : se("", !0)
2604
2603
  ]),
2605
2604
  _: 1
@@ -2613,5 +2612,5 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2613
2612
  }
2614
2613
  });
2615
2614
  export {
2616
- xa as default
2615
+ ga as default
2617
2616
  };