@feedmepos/mf-inventory-portal 1.8.0-dev.4 → 1.8.0-dev.6

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 (129) hide show
  1. package/dist/{App-FeJnwZme.js → App-B8DzC8Td.js} +609 -558
  2. package/dist/{ApprovalView-Eo-cGWyA.js → ApprovalView-DwHtlnLK.js} +9 -9
  3. package/dist/{BindingsDialog-DkjuXydb.js → BindingsDialog-COSQ6XVU.js} +2 -2
  4. package/dist/{BindingsPicker-DUOQcOlj.js → BindingsPicker-vn2GwOb7.js} +2 -2
  5. package/dist/{BindingsTable-CoDdU5xh.js → BindingsTable-B3-YXiPU.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-BGh8fbEX.js → BulkReceiveRequestView-LUAuL39I.js} +19 -19
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-CStISRqy.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-Bq2bBCHH.js} +1 -1
  8. package/dist/{ClosingDraftView-Cwnhrv5P.js → ClosingDraftView-BKgjXfss.js} +20 -20
  9. package/dist/{ClosingHistoryView-oHf77Lal.js → ClosingHistoryView-BI_zufKI.js} +5 -5
  10. package/dist/{ClosingTemplateView-1P8J1vAn.js → ClosingTemplateView-CNNgkrX0.js} +18 -18
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuEPaqQK.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DGxUjcQc.js} +1 -1
  12. package/dist/{DefaultView-3Z8aVFSU.js → DefaultView-D9ldG5wf.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-uT_e3Suw.js → DeliveryOrderPrintPreview-CnvuZat5.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BCgnXxEi.js → EmailDialog.vue_vue_type_script_setup_true_lang-s0eDfL8g.js} +23 -23
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-2t_ajTtF.js +297 -0
  16. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BlKpGdCx.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Bo4aCSFL.js} +1 -1
  17. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DKkxn1J-.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-BhhKFtnX.js} +2 -2
  18. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-dOXDST-E.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dx8b6nGn.js} +2 -2
  19. package/dist/FmMultiselectDialog-Coxul96n.js +123 -0
  20. package/dist/{FmMultiselectDialog-DRxZAkcu.js → FmMultiselectDialog-zaOH0oB9.js} +2 -2
  21. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-DRSzQqVJ.js → FmUnitInput.vue_vue_type_script_setup_true_lang-B0xT-sP9.js} +6 -6
  22. package/dist/ImportView-CuRogJ1u.js +1291 -0
  23. package/dist/{IngredientsView-N9U7tdI_.js → IngredientsView-BnEJ1QAk.js} +34 -35
  24. package/dist/{IntegrationExplorerView-CjmeGQ14.js → IntegrationExplorerView-DB-7hXUE.js} +4 -4
  25. package/dist/{IntegrationView-DAdpmuxx.js → IntegrationView-CBGPi1xL.js} +973 -974
  26. package/dist/{InventoryBindingForm-CAj3MurI.js → InventoryBindingForm-eggGypKW.js} +1 -1
  27. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CvQ82oaY.js +472 -0
  28. package/dist/{InventoryBindingSummary-B-1OBUdw.js → InventoryBindingSummary-DegINJdx.js} +1 -1
  29. package/dist/{NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUYYEuW3.js → NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYq61C5M.js} +1 -1
  30. package/dist/{ProductionRunDetailView-eFvl8-By.js → ProductionRunDetailView-6uJmjwAg.js} +4 -4
  31. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-DaC7e4qS.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-Dcd3sV5C.js} +9 -9
  32. package/dist/{ProductionRunView-C_NJJKLr.js → ProductionRunView-CiypqoQT.js} +3 -3
  33. package/dist/{PublishView-BglAEkzU.js → PublishView-DEyODScT.js} +3 -3
  34. package/dist/{PurchaseOrderPrintPreview-BTF9ikpQ.js → PurchaseOrderPrintPreview-DjsD8HaB.js} +2 -2
  35. package/dist/{ReceiveRequestView-BUvehG10.js → ReceiveRequestView-DGWA-SOC.js} +13 -13
  36. package/dist/RecipeView-CO5kxazA.js +3428 -0
  37. package/dist/{SettingsView-DRR86cHo.js → SettingsView-9uq0QYht.js} +164 -168
  38. package/dist/{StockView-D1oEnbZp.js → StockView-YKfyjTE1.js} +267 -267
  39. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxU92-io.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C8q3IBMg.js} +1 -1
  40. package/dist/{SupplierView-D68wz0-g.js → SupplierView-D62RB87K.js} +14 -14
  41. package/dist/{SurchargeView-Cw9rTw2h.js → SurchargeView-DY4xuPN0.js} +7 -7
  42. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-Az-a1Dsp.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C27rA7Z_.js} +2 -2
  43. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-C-sxbacO.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BhhvJtAf.js} +1 -1
  44. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-CsHfLaCv.js → TransferDetails.vue_vue_type_script_setup_true_lang-cvgA7DlK.js} +690 -666
  45. package/dist/{TransferTemplateView-CHPJMjYC.js → TransferTemplateView-DZk-6Z-1.js} +20 -20
  46. package/dist/{UnitCostHistoryView-DM8OzWhe.js → UnitCostHistoryView-C-aNhP72.js} +4 -4
  47. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-DpwK5mFH.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-D655ehgk.js} +4 -4
  48. package/dist/{UnitView-90uR-ZzQ.js → UnitView-h2n8XNZr.js} +8 -8
  49. package/dist/{WarehouseView-Bulg6Vac.js → WarehouseView-gPPmrhxB.js} +8 -8
  50. package/dist/{WastageTemplateView-BmAHnnwm.js → WastageTemplateView-7bp-1vTP.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-Ccdgbe4f.js → app-_FoXoYBy.js} +1640 -1829
  54. package/dist/app.d.ts +0 -150
  55. package/dist/app.js +1 -1
  56. package/dist/{closing-template-DuBZxoXx.js → closing-template-D8bk-LUW.js} +1 -1
  57. package/dist/{date2-IBrLdtni.js → date2-DE0h0f1Z.js} +1 -1
  58. package/dist/{dayjs.min-DEkq-Hpp.js → dayjs.min-DxnjPhAT.js} +1 -1
  59. package/dist/{decimal-g6jRdlSk.js → decimal-D9ZB4atK.js} +2 -2
  60. package/dist/{defineDeepModel-P5a5Ffpn.js → defineDeepModel-pn4B1f06.js} +1 -1
  61. package/dist/{duplicate-template-Do8s80ei.js → duplicate-template-DS-mr3MQ.js} +1 -1
  62. package/dist/{feature-ChVm5JED.js → feature-D0aaeyga.js} +1999 -3092
  63. package/dist/feature-flags/portal-feature-catalog.d.ts +0 -2
  64. package/dist/{format-time-from-id-BgbBOII7.js → format-time-from-id-CbFUj3BY.js} +1 -1
  65. package/dist/{format-unit-display-hSXy2iu6.js → format-unit-display-DulZiawi.js} +13 -13
  66. package/dist/helper/menu-usage-module.d.ts +1 -1
  67. package/dist/{id-to-date-DlGYysU8.js → id-to-date-CLCvDHvP.js} +1 -1
  68. package/dist/{import-export.helper-LrZhiz2W.js → import-export.helper-Ce1hr39u.js} +6 -6
  69. package/dist/{index-DCiNwlw2.js → index-DDw8ryXI.js} +1 -1
  70. package/dist/{index-DsOmtywr.js → index-DpxJ3TzB.js} +1 -1
  71. package/dist/{index-BTNJ1fk2.js → index-DrkUq9y6.js} +3 -3
  72. package/dist/{lz-string-DRuyjE9G.js → lz-string-BakfyAq0.js} +1 -1
  73. package/dist/{netsuite-B6y8GZCP.js → netsuite-Cn2W-lOV.js} +2 -2
  74. package/dist/{number-Besn-1-5.js → number-B2-Gbof3.js} +3 -3
  75. package/dist/{predefined-templates-D92mN_2S.js → predefined-templates-DmITBHzs.js} +1 -1
  76. package/dist/{purchase-order-template-hvq2pfWx.js → purchase-order-template-BfP6Sy0k.js} +1 -1
  77. package/dist/{recalculationUtils-BlZR5O2G.js → recalculationUtils-BRe2QPvC.js} +1 -1
  78. package/dist/router/name.d.ts +0 -1
  79. package/dist/{row-action.enum-R2bi3eAv.js → row-action.enum-CxzHcy4A.js} +1 -1
  80. package/dist/{rules-DzwoRKUS.js → rules-CjqBvFGt.js} +2 -2
  81. package/dist/{stock-Cq37EARQ.js → stock-BT50AgTx.js} +8 -8
  82. package/dist/{stock-oJqnUrtt.js → stock-CjFjkezq.js} +1 -1
  83. package/dist/stores/feature.d.ts +9 -9
  84. package/dist/stores/inventory.d.ts +0 -47
  85. package/dist/stores/supplier.d.ts +1 -1
  86. package/dist/style.css +1 -1
  87. package/dist/{supplier-DtdwvcPr.js → supplier-wmjWWKaf.js} +2 -2
  88. package/dist/{surcharge-CjdJGIsM.js → surcharge-CQC6Fa7Q.js} +1 -1
  89. package/dist/tsconfig.app.tsbuildinfo +1 -1
  90. package/dist/{uom-rules-BqPn_GoZ.js → uom-rules-CUQleOt4.js} +1 -1
  91. package/dist/{use-ingredient-select-dialog-0hRCj6Fu.js → use-ingredient-select-dialog-7VVHmM7s.js} +2 -2
  92. package/dist/use-inventory-binding-dialog-C8m7iwRG.js +113 -0
  93. package/dist/{use-template-enabled-locations-8ZfTj4YB.js → use-template-enabled-locations-CRgTVDMh.js} +2 -2
  94. package/dist/{use-transfer-locations-BGS1EBEt.js → use-transfer-locations-Bs0PotVA.js} +2 -2
  95. package/dist/{useHrmPermission-BcQ2KPD-.js → useHrmPermission-DcAzZ0CT.js} +1 -1
  96. package/dist/{useNavigationMenu-DImtns81.js → useNavigationMenu-CtihCeyC.js} +65 -74
  97. package/dist/{useSseClient-DPSFFVci.js → useSseClient-CizgYCQI.js} +1 -1
  98. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  99. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  100. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  101. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  102. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
  103. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  104. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  105. package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
  106. package/dist/{vue-i18n-DTyGIjTI.js → vue-i18n-DpTQ6ev1.js} +258 -258
  107. package/dist/{xlsx.util-CK9Lnq3Q.js → xlsx.util-CPC0Dkyo.js} +2 -2
  108. package/package.json +2 -2
  109. package/dist/DeprecateSoonWarningDialog.vue_vue_type_script_setup_true_lang-D_vmtZDZ.js +0 -58
  110. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-D-RzUmqA.js +0 -81
  111. package/dist/FmMultiselectDialog-C8uYx8rr.js +0 -77
  112. package/dist/ImportView-Qigtf3ik.js +0 -1302
  113. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-B8PJeYrP.js +0 -51
  114. package/dist/IngredientGroupView-RNYZLkQu.js +0 -1000
  115. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-3pYuu62C.js +0 -563
  116. package/dist/RecipeView-DO5-jgwh.js +0 -3624
  117. package/dist/feature-flags/premium-flags.spec.d.ts +0 -1
  118. package/dist/random-CSbEbElR.js +0 -10
  119. package/dist/use-inventory-binding-dialog-BLRcIC1u.js +0 -152
  120. package/dist/usePromise-CbVUCxhj.js +0 -29
  121. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
  122. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  123. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  124. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  125. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  126. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
  127. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  128. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  129. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
@@ -1,33 +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-Ccdgbe4f.js";
4
- import { u as Oe } from "./stock-Cq37EARQ.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-_FoXoYBy.js";
4
+ import { u as Oe } from "./stock-BT50AgTx.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-DpwK5mFH.js";
7
- import { _ as Ke, S as Ge, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CxU92-io.js";
8
- import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-D-RzUmqA.js";
6
+ import { _ as ht, o as Pt } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-D655ehgk.js";
7
+ import { _ as Ke, S as We, g as bt, a as Rt } from "./SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-C8q3IBMg.js";
8
+ import { a as qe } from "./FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-2t_ajTtF.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-DlGYysU8.js";
10
+ import { u as gt, i as Te } from "./id-to-date-CLCvDHvP.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-Besn-1-5.js";
15
- import { u as Ae } from "./stock-oJqnUrtt.js";
16
- import { c as Ue, A as Gt, M as Wt, R as Kt } from "./rules-DzwoRKUS.js";
17
- import { u as qt } from "./use-inventory-binding-dialog-BLRcIC1u.js";
18
- import { a as St } from "./FmMultiselectDialog-DRxZAkcu.js";
19
- import { d as ke } from "./dayjs.min-DEkq-Hpp.js";
20
- import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CUYYEuW3.js";
21
- import { g as Jt } from "./decimal-g6jRdlSk.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-IBrLdtni.js";
23
- import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BlKpGdCx.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-B2-Gbof3.js";
15
+ import { u as Ae } from "./stock-CjFjkezq.js";
16
+ import { c as Ue, A as Wt, M as Gt, R as Kt } from "./rules-CjqBvFGt.js";
17
+ import { u as qt } from "./use-inventory-binding-dialog-C8m7iwRG.js";
18
+ import { a as St } from "./FmMultiselectDialog-zaOH0oB9.js";
19
+ import { d as ke } from "./dayjs.min-DxnjPhAT.js";
20
+ import { _ as Xt } from "./NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DYq61C5M.js";
21
+ import { g as Jt } from "./decimal-D9ZB4atK.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-DE0h0f1Z.js";
23
+ import { i as no } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-Bo4aCSFL.js";
24
24
  import { _ as so } from "./empty-placeholder-B0QU467o.js";
25
- import { F as _e, u as ao } from "./feature-ChVm5JED.js";
26
- import { u as At } from "./useHrmPermission-BcQ2KPD-.js";
25
+ import { F as _e, u as ao } from "./feature-D0aaeyga.js";
26
+ import { u as At } from "./useHrmPermission-DcAzZ0CT.js";
27
27
  import { _ as ro, F as ft } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
28
- import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-dOXDST-E.js";
29
- import { u as io } from "./useSseClient-DPSFFVci.js";
30
- import { u as uo } from "./netsuite-B6y8GZCP.js";
28
+ import { _ as lo } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-Dx8b6nGn.js";
29
+ import { u as io } from "./useSseClient-CizgYCQI.js";
30
+ import { u as uo } from "./netsuite-Cn2W-lOV.js";
31
31
  import { P as co, J as mo } from "./app-C39bYJmq.js";
32
32
  var Ie = /* @__PURE__ */ ((A) => (A.History = "History", A.Convert = "Convert", A.Adjust = "Adjust", A))(Ie || {});
33
33
  const fo = [
@@ -61,7 +61,7 @@ const fo = [
61
61
  setup(A) {
62
62
  const { t: c } = ye();
63
63
  return (k, _) => (j(), q("div", po, [
64
- e("div", yo, f(s(c)("inventory.stock.prediction.daysRemaining")), 1),
64
+ e("div", yo, m(s(c)("inventory.stock.prediction.daysRemaining")), 1),
65
65
  y(qe, {
66
66
  tier: "standard",
67
67
  category: "beta"
@@ -69,7 +69,7 @@ const fo = [
69
69
  ]));
70
70
  }
71
71
  }), Ft = Ot("stockActions", () => {
72
- 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();
73
73
  async function r() {
74
74
  if (c._currentLocation) {
75
75
  A.value = !0;
@@ -77,8 +77,8 @@ const fo = [
77
77
  await k.readStockBalance(), await k.readProductBalance(), await _.readStockEstimateBalance();
78
78
  } catch {
79
79
  w.open({
80
- title: d("inventory.stock.error.title"),
81
- message: d("inventory.stock.error.message"),
80
+ title: f("inventory.stock.error.title"),
81
+ message: f("inventory.stock.error.message"),
82
82
  type: "error"
83
83
  });
84
84
  } finally {
@@ -91,8 +91,8 @@ const fo = [
91
91
  var $, E, N;
92
92
  if (!!!((E = ($ = g.convert) == null ? void 0 : $.inventoryBindings) != null && E.length)) {
93
93
  V.open({
94
- title: d("inventory.stock.error.convert.title"),
95
- message: d("inventory.stock.error.convert.message")
94
+ title: f("inventory.stock.error.convert.title"),
95
+ message: f("inventory.stock.error.convert.message")
96
96
  });
97
97
  return;
98
98
  }
@@ -177,8 +177,8 @@ function ko() {
177
177
  {
178
178
  id: "UOM",
179
179
  header: () => _("inventory.stock.balance"),
180
- cell(d) {
181
- const r = d.row.original, b = {
180
+ cell(f) {
181
+ const r = f.row.original, b = {
182
182
  unit: r.unit,
183
183
  sku: r,
184
184
  amount: r.balance,
@@ -192,8 +192,8 @@ function ko() {
192
192
  {
193
193
  accessorKey: "isInactive",
194
194
  header: () => be(Qe, {}, () => `${_("inventory.ingredient.status.title")}`),
195
- cell(d) {
196
- const r = d.row.original.isInactive;
195
+ cell(f) {
196
+ const r = f.row.original.isInactive;
197
197
  return be(
198
198
  "span",
199
199
  {
@@ -214,15 +214,15 @@ function ko() {
214
214
  header: () => be(_o),
215
215
  enableSorting: !0,
216
216
  sortUndefined: "last",
217
- cell(d) {
217
+ cell(f) {
218
218
  var B, v;
219
- 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;
220
220
  if (typeof r != "number" || typeof R != "number" || typeof C != "number")
221
221
  return be(Ke, {
222
222
  days: r,
223
223
  operator: b
224
224
  });
225
- 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;
226
226
  return be(Ke, {
227
227
  days: r,
228
228
  level: l
@@ -232,11 +232,11 @@ function ko() {
232
232
  },
233
233
  {
234
234
  id: "action",
235
- cell(d) {
235
+ cell(f) {
236
236
  var r;
237
237
  return Ut(
238
238
  ((r = A._currentLocation) == null ? void 0 : r.type) === "restaurant" ? fo : vo,
239
- (b) => c.onActionMenu(b, d.row.original)
239
+ (b) => c.onActionMenu(b, f.row.original)
240
240
  );
241
241
  },
242
242
  enableSorting: !1,
@@ -295,11 +295,11 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
295
295
  },
296
296
  emits: ["update:show", "submitted"],
297
297
  setup(A, { expose: c, emit: k }) {
298
- 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(
299
299
  () => {
300
300
  var x, F;
301
301
  return (((F = (x = _.sku) == null ? void 0 : x.convert) == null ? void 0 : F.inventoryBindings) ?? []).filter(
302
- (G) => G.type === lt.enum.SKU
302
+ (W) => W.type === lt.enum.SKU
303
303
  );
304
304
  }
305
305
  ), v = T({
@@ -327,37 +327,37 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
327
327
  const F = (I = _.sku.convert) != null && I.measurement ? _.sku.unit.measurements.find((u) => {
328
328
  var h;
329
329
  return u.id === ((h = _.sku.convert) == null ? void 0 : h.measurement);
330
- }) ?? null : null, G = $e(_.sku.unit, F), H = Yt(+x);
331
- 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;
332
332
  }
333
333
  const $ = T(
334
334
  () => {
335
335
  var x, F;
336
- 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) => {
337
337
  var H;
338
- return G.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
338
+ return W.id === ((H = _.sku.convert) == null ? void 0 : H.measurement);
339
339
  })) == null ? void 0 : F.abbrev : _.sku.unit.abbrev;
340
340
  }
341
341
  ), E = T(() => {
342
342
  var H, J;
343
343
  const F = It({
344
344
  bindings: ((H = _.sku.convert) == null ? void 0 : H.inventoryBindings) ?? [],
345
- skus: d.skus,
346
- skuGroups: d.skuGroups,
347
- recipes: d.recipes
345
+ skus: f.skus,
346
+ skuGroups: [],
347
+ recipes: f.recipes
348
348
  }).inventoryBindings.filter((I) => "success" in I && I.success).map((I) => I).map((I) => I.binding);
349
349
  return (J = l.value ?? F) == null ? void 0 : J.map((I) => {
350
- var ee, ae, Q, W, te;
351
- 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) => {
352
352
  var ce;
353
353
  return le.id === ((ce = _.sku.convert) == null ? void 0 : ce.measurement);
354
- }) ?? 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(
355
355
  Lt(
356
356
  I.amount,
357
- Ee(+C.value, m)
357
+ Ee(+C.value, d)
358
358
  ),
359
359
  !1
360
- ) : "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;
361
361
  return {
362
362
  sku: u,
363
363
  convertAmount: P ?? i,
@@ -380,7 +380,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
380
380
  }
381
381
  });
382
382
  const O = Ye(_, "show");
383
- async function L(x, F, G) {
383
+ async function L(x, F, W) {
384
384
  g.value = !0;
385
385
  try {
386
386
  await r.convertSku({
@@ -388,7 +388,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
388
388
  {
389
389
  doc: x,
390
390
  amount: F,
391
- overrides: G == null ? void 0 : G.map((H) => ({
391
+ overrides: W == null ? void 0 : W.map((H) => ({
392
392
  ...H,
393
393
  amount: {
394
394
  ...H.amount,
@@ -409,29 +409,29 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
409
409
  g.value = !1;
410
410
  }
411
411
  }
412
- function X(x, F, G) {
412
+ function X(x, F, W) {
413
413
  const H = +F;
414
- let J = G;
415
- 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;
416
416
  }
417
417
  function z(x) {
418
- const F = a.value.find((G) => G._id === x);
418
+ const F = a.value.find((W) => W._id === x);
419
419
  return F ? bt(F.unit, !0) : [];
420
420
  }
421
421
  function K(x, F) {
422
- 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);
423
423
  return H ? {
424
424
  ...H,
425
425
  label: H.abbrev
426
426
  } : null;
427
427
  }
428
- function U(x, F, G) {
428
+ function U(x, F, W) {
429
429
  let H;
430
430
  if (F === null)
431
- H = G.map((J) => (J.id !== x || (J.measurement = null), J)) ?? [];
431
+ H = W.map((J) => (J.id !== x || (J.measurement = null), J)) ?? [];
432
432
  else {
433
433
  const J = a.value.find((I) => I._id === x);
434
- H = G.map((I) => {
434
+ H = W.map((I) => {
435
435
  var u, h;
436
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;
437
437
  }) ?? [];
@@ -439,8 +439,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
439
439
  l.value = H;
440
440
  }
441
441
  function Z(x, F) {
442
- const G = F.filter((H) => H.id !== x);
443
- l.value = G;
442
+ const W = F.filter((H) => H.id !== x);
443
+ l.value = W;
444
444
  }
445
445
  function re() {
446
446
  const x = (l.value ?? []).map((F) => ({
@@ -459,8 +459,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
459
459
  x || (l.value = null, C.value = 0);
460
460
  }
461
461
  ), (x, F) => {
462
- 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");
463
- 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, {
464
464
  "dismiss-away": "",
465
465
  modelValue: s(O),
466
466
  "onUpdate:modelValue": F[3] || (F[3] = (i) => Pe(O) ? O.value = i : null),
@@ -468,7 +468,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
468
468
  }, {
469
469
  "side-sheet-header": M(() => [
470
470
  e("div", bo, [
471
- 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)
472
472
  ])
473
473
  ]),
474
474
  default: M(() => [
@@ -479,7 +479,7 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
479
479
  onValidationSuccess: o
480
480
  }, {
481
481
  default: M(() => [
482
- y(G, {
482
+ y(W, {
483
483
  disabled: g.value,
484
484
  "model-value": C.value,
485
485
  "onUpdate:modelValue": F[0] || (F[0] = (i) => C.value = i),
@@ -497,15 +497,15 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
497
497
  }, {
498
498
  default: M(() => [
499
499
  e("div", So, [
500
- e("div", wo, f(s(R)("inventory.stock.convert.deductionSummary")), 1),
500
+ e("div", wo, m(s(R)("inventory.stock.convert.deductionSummary")), 1),
501
501
  (j(!0), q(ue, null, ve(E.value, (i) => {
502
502
  var S, P;
503
503
  return j(), q("div", {
504
504
  key: (S = i.sku) == null ? void 0 : S._id,
505
505
  class: "flex items-center"
506
506
  }, [
507
- e("div", Ao, f((P = i.sku) == null ? void 0 : P.name), 1),
508
- 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)
509
509
  ]);
510
510
  }), 128))
511
511
  ])
@@ -525,16 +525,16 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
525
525
  v.value ? (j(), q(ue, { key: 0 }, [
526
526
  y(u, {
527
527
  modelValue: l.value,
528
- rules: [s(Gt)(1, "Must have at least one ingredient binding")]
528
+ rules: [s(Wt)(1, "Must have at least one ingredient binding")]
529
529
  }, null, 8, ["modelValue", "rules"]),
530
530
  e("div", jo, [
531
- e("div", Vo, f(s(R)("inventory.stock.convert.ingredients")), 1),
531
+ e("div", Vo, m(s(R)("inventory.stock.convert.ingredients")), 1),
532
532
  (j(!0), q(ue, null, ve(l.value, (i) => (j(), ne(u, {
533
533
  key: i.id,
534
534
  disabled: g.value,
535
535
  modelValue: +s(he)(i.amount ?? { amount: 1, precision: 0 }),
536
536
  rules: [
537
- s(Wt)(
537
+ s(Gt)(
538
538
  a.value.find((S) => S._id === i.id).unit,
539
539
  i.measurement
540
540
  ),
@@ -545,8 +545,8 @@ const bo = { class: "flex items-center" }, go = { class: "fm-typo-en-title-md-80
545
545
  var P, ee, ae;
546
546
  return [
547
547
  e("div", Co, [
548
- e("div", Bo, f((P = a.value.find((Q) => Q._id === i.id)) == null ? void 0 : P.name), 1),
549
- 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, {
550
550
  class: "xs:col-span-2",
551
551
  disabled: g.value,
552
552
  modelValue: +s(he)(
@@ -618,7 +618,7 @@ function De(A, c) {
618
618
  function pt(A, c) {
619
619
  return Ee(Math.abs(A), c);
620
620
  }
621
- const We = {
621
+ const Ge = {
622
622
  [ie.enum.DAMAGE]: {
623
623
  label: "Damage",
624
624
  toAdjustmentAmount: De
@@ -655,8 +655,8 @@ const We = {
655
655
  },
656
656
  emits: ["update:modelValue", "click:delete"],
657
657
  setup(A, { emit: c }) {
658
- const k = A, _ = c, { t: w } = ye(), V = Oe(), d = T(
659
- () => Object.keys(We).map((t) => ({
658
+ const k = A, _ = c, { t: w } = ye(), V = Oe(), f = T(
659
+ () => Object.keys(Ge).map((t) => ({
660
660
  label: Ht(t),
661
661
  value: t
662
662
  }))
@@ -670,7 +670,7 @@ const We = {
670
670
  };
671
671
  n.type = t;
672
672
  const $ = ct(k.modelValue.amount);
673
- n.amount = We[n.type].toAdjustmentAmount(
673
+ n.amount = Ge[n.type].toAdjustmentAmount(
674
674
  +he($),
675
675
  $.precision
676
676
  ), _("update:modelValue", n);
@@ -684,7 +684,7 @@ const We = {
684
684
  const n = {
685
685
  ...k.modelValue
686
686
  }, $ = xe(t);
687
- n.amount = We[b.value].toAdjustmentAmount(
687
+ n.amount = Ge[b.value].toAdjustmentAmount(
688
688
  t,
689
689
  $.precision
690
690
  ), _("update:modelValue", n);
@@ -734,8 +734,8 @@ const We = {
734
734
  default: M(() => [
735
735
  e("div", Io, [
736
736
  e("div", Ho, [
737
- e("div", To, f(t.modelValue.doc.name), 1),
738
- 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)
739
739
  ]),
740
740
  y($, {
741
741
  variant: "tertiary",
@@ -747,7 +747,7 @@ const We = {
747
747
  disabled: t.disabled,
748
748
  class: "col-span-2",
749
749
  label: "Type",
750
- items: d.value,
750
+ items: f.value,
751
751
  modelValue: b.value,
752
752
  "onUpdate:modelValue": n[1] || (n[1] = (L) => b.value = L),
753
753
  rules: [s(Kt)()],
@@ -780,18 +780,18 @@ const We = {
780
780
  "label-mark": "optional"
781
781
  }, null, 8, ["disabled", "modelValue"]),
782
782
  e("div", Uo, [
783
- 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),
784
784
  e("div", {
785
785
  class: He(["fm-typo-en-body-lg-600", o.value ? "text-red-700" : "text-green-700"])
786
- }, f(g.value), 3),
787
- 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)
788
788
  ])
789
789
  ]),
790
790
  _: 1
791
791
  });
792
792
  };
793
793
  }
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" }, 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({
795
795
  __name: "AdjustSkuDialog",
796
796
  props: {
797
797
  stock: {},
@@ -799,7 +799,7 @@ const We = {
799
799
  },
800
800
  emits: ["update:show", "submitted"],
801
801
  setup(A, { expose: c, emit: k }) {
802
- 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();
803
803
  function l() {
804
804
  g(Re(v));
805
805
  }
@@ -873,7 +873,7 @@ const We = {
873
873
  sublabel: E.code,
874
874
  value: E._id
875
875
  })), $ = n.filter((E) => v.adjustments.find((N) => N.doc._id === E.value)).map((E) => E.value);
876
- d.open({
876
+ f.open({
877
877
  title: "Select ingredients",
878
878
  contentComponent: St,
879
879
  contentComponentProps: {
@@ -918,7 +918,7 @@ const We = {
918
918
  }, {
919
919
  "side-sheet-header": M(() => [
920
920
  e("div", No, [
921
- e("div", Oo, f(s(C)("inventory.stock.adjust.title")), 1)
921
+ e("div", Oo, m(s(C)("inventory.stock.adjust.title")), 1)
922
922
  ])
923
923
  ]),
924
924
  default: M(() => [
@@ -935,7 +935,7 @@ const We = {
935
935
  "onUpdate:modelValue": $[0] || ($[0] = (X) => v.remark = X)
936
936
  }, null, 8, ["label", "modelValue"]),
937
937
  e("div", Lo, [
938
- e("div", Yo, f(s(C)("inventory.stock.adjust.adjustedItems")), 1),
938
+ e("div", Yo, m(s(C)("inventory.stock.adjust.adjustedItems")), 1),
939
939
  y(N, {
940
940
  "prepend-icon": "add",
941
941
  variant: "tertiary",
@@ -969,7 +969,7 @@ const We = {
969
969
  }, 8, ["modelValue"]);
970
970
  };
971
971
  }
972
- }), 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 = {
973
973
  key: 0,
974
974
  class: "flex flex-col gap-4"
975
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({
@@ -979,7 +979,7 @@ const We = {
979
979
  },
980
980
  emits: ["update:show", "submitted"],
981
981
  setup(A, { emit: c }) {
982
- 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({
983
983
  remark: "",
984
984
  effectiveAt: /* @__PURE__ */ new Date(),
985
985
  adjustments: []
@@ -1068,10 +1068,10 @@ const We = {
1068
1068
  C.value = !0;
1069
1069
  try {
1070
1070
  const K = l.adjustments.map(
1071
- ({ doc: Z, remark: re, type: x, amount: F, measurement: G }) => ({
1071
+ ({ doc: Z, remark: re, type: x, amount: F, measurement: W }) => ({
1072
1072
  id: Z._id,
1073
1073
  amount: F,
1074
- measurement: G,
1074
+ measurement: W,
1075
1075
  remark: re,
1076
1076
  doc: Z,
1077
1077
  type: x
@@ -1081,7 +1081,7 @@ const We = {
1081
1081
  adjustments: K,
1082
1082
  ...a.value ? { effectiveAt: l.effectiveAt.toISOString() } : {}
1083
1083
  };
1084
- await d.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
1084
+ await f.adjustSku(Re(U)), _("submitted"), _("update:show", !1);
1085
1085
  } catch (K) {
1086
1086
  b.open({
1087
1087
  title: w("inventory.stock.adjust.error.title"),
@@ -1093,7 +1093,7 @@ const We = {
1093
1093
  }
1094
1094
  }
1095
1095
  return (K, U) => {
1096
- 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");
1097
1097
  return j(), ne(I, {
1098
1098
  modelValue: s(R),
1099
1099
  "onUpdate:modelValue": U[6] || (U[6] = (u) => Pe(R) ? R.value = u : null),
@@ -1102,8 +1102,8 @@ const We = {
1102
1102
  onAfterEnter: N
1103
1103
  }, {
1104
1104
  "side-sheet-header": M(() => [
1105
- e("div", Wo, [
1106
- 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)
1107
1107
  ])
1108
1108
  ]),
1109
1109
  default: M(() => [
@@ -1129,7 +1129,7 @@ const We = {
1129
1129
  labelPlacement: "right"
1130
1130
  }, null, 8, ["model-value", "label", "sublabel"]),
1131
1131
  a.value ? (j(), q("div", qo, [
1132
- 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),
1133
1133
  e("div", Jo, [
1134
1134
  e("div", Qo, [
1135
1135
  y(x, {
@@ -1148,14 +1148,14 @@ const We = {
1148
1148
  }, null, 8, ["modelValue"])
1149
1149
  ])
1150
1150
  ]),
1151
- y(G, {
1151
+ y(W, {
1152
1152
  "model-value": o.value,
1153
1153
  rules: n.value
1154
1154
  }, null, 8, ["model-value", "rules"]),
1155
- 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)
1156
1156
  ])) : se("", !0),
1157
1157
  e("div", tn, [
1158
- e("div", on, f(s(w)("inventory.stock.adjust.adjustedItems")), 1),
1158
+ e("div", on, m(s(w)("inventory.stock.adjust.adjustedItems")), 1),
1159
1159
  y(H, {
1160
1160
  "prepend-icon": "add",
1161
1161
  variant: "tertiary",
@@ -1199,19 +1199,19 @@ const We = {
1199
1199
  }), an = Tt((A, c) => ({
1200
1200
  // TODO: remove once latest inventory backend has been push
1201
1201
  async findBillsByBusinessId(k, _, w) {
1202
- const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, d = {
1202
+ const V = `${A.businessesBackendUrl}/${k}/reports/find-many`, f = {
1203
1203
  // type: TYPE.bill,
1204
1204
  type: "bill",
1205
1205
  restaurantIds: _,
1206
1206
  ids: w
1207
1207
  };
1208
- return await c.post(V, d);
1208
+ return await c.post(V, f);
1209
1209
  },
1210
1210
  async findBillsById(k) {
1211
- const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`, d = {
1211
+ const w = Se().currentLocationDBName, V = `${A.inventoryBackendUrl}/${w}/bill/search`, f = {
1212
1212
  ids: k
1213
1213
  };
1214
- return await c.post(V, d);
1214
+ return await c.post(V, f);
1215
1215
  }
1216
1216
  })), rn = {
1217
1217
  key: 0,
@@ -1226,15 +1226,15 @@ const We = {
1226
1226
  }),
1227
1227
  emits: /* @__PURE__ */ st(["refreshHistory"], ["update:modelValue"]),
1228
1228
  setup(A, { emit: c }) {
1229
- 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({
1230
1230
  _id: `inventoryAdjustment_${(/* @__PURE__ */ new Date()).toISOString()}_XXXXX`,
1231
1231
  skus: []
1232
1232
  }), C = Y();
1233
1233
  Xe(async () => {
1234
- d.value = !0;
1234
+ f.value = !0;
1235
1235
  const o = await w.readSingleAdjustment(k.adjustmentId);
1236
1236
  if (!o) throw new Error("Adjustment not found");
1237
- R.value = o, d.value = !1;
1237
+ R.value = o, f.value = !1;
1238
1238
  });
1239
1239
  async function l() {
1240
1240
  var t, n;
@@ -1335,7 +1335,7 @@ const We = {
1335
1335
  ])
1336
1336
  ]),
1337
1337
  default: M(() => [
1338
- d.value ? (j(), q("div", rn)) : (j(), ne(N, {
1338
+ f.value ? (j(), q("div", rn)) : (j(), ne(N, {
1339
1339
  key: 1,
1340
1340
  ref_key: "formRef",
1341
1341
  ref: C,
@@ -1351,7 +1351,7 @@ const We = {
1351
1351
  e("p", ln, [
1352
1352
  t[6] || (t[6] = e("b", null, "Date:", -1)),
1353
1353
  t[7] || (t[7] = e("br", null, null, -1)),
1354
- me(" " + f(s(Qt)(s(Et)(R.value._id))), 1)
1354
+ me(" " + m(s(Qt)(s(Et)(R.value._id))), 1)
1355
1355
  ]),
1356
1356
  e("div", un, [
1357
1357
  (j(!0), q(ue, null, ve(R.value.skus, (z, K) => (j(), q(ue, { key: K }, [
@@ -1362,17 +1362,17 @@ const We = {
1362
1362
  }, {
1363
1363
  default: M(() => [
1364
1364
  e("div", cn, [
1365
- e("span", dn, f(z.sku.code), 1),
1366
- 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)
1367
1367
  ]),
1368
1368
  t[12] || (t[12] = e("hr", { class: "m-2" }, null, -1)),
1369
1369
  e("div", mn, [
1370
1370
  t[8] || (t[8] = e("span", { class: "fm-typo-en-body-lg-600" }, "Adjustment type:", -1)),
1371
- e("span", null, f(U.type), 1)
1371
+ e("span", null, m(U.type), 1)
1372
1372
  ]),
1373
1373
  e("div", fn, [
1374
1374
  t[9] || (t[9] = e("span", { class: "fm-typo-en-body-lg-600" }, "Current amount:", -1)),
1375
- 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)
1376
1376
  ]),
1377
1377
  y($, {
1378
1378
  "max-fraction-digits": s($e)(z.sku.unit),
@@ -1398,7 +1398,7 @@ const We = {
1398
1398
  e("div", vn, [
1399
1399
  t[10] || (t[10] = e("span", { class: "fm-typo-en-body-lg-600" }, "Amount after amend:", -1)),
1400
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)),
1401
- me(" " + f(g(
1401
+ me(" " + m(g(
1402
1402
  U.amount,
1403
1403
  s(_e).fromNumber(
1404
1404
  a({
@@ -1407,7 +1407,7 @@ const We = {
1407
1407
  unit: z.sku.unit
1408
1408
  }).value
1409
1409
  )
1410
- )) + " " + f(v(z, U)), 1)
1410
+ )) + " " + m(v(z, U)), 1)
1411
1411
  ])
1412
1412
  ]),
1413
1413
  _: 2
@@ -1463,7 +1463,7 @@ const We = {
1463
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());
1464
1464
  return v.length > 0 ? v[0].cost : null;
1465
1465
  }
1466
- 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");
1467
1467
  Xe(() => {
1468
1468
  var C;
1469
1469
  V.value = ((C = w.value) == null ? void 0 : C.scrollHeight) || 0;
@@ -1551,7 +1551,7 @@ const We = {
1551
1551
  class: "flex items-center cursor-pointer mb-1",
1552
1552
  onClick: l[0] || (l[0] = (g) => _.value = !_.value)
1553
1553
  }, [
1554
- e("div", hn, f(C.record.date), 1),
1554
+ e("div", hn, m(C.record.date), 1),
1555
1555
  y(a, {
1556
1556
  name: _.value ? "expand_more" : "expand_less",
1557
1557
  color: "#777777",
@@ -1563,21 +1563,21 @@ const We = {
1563
1563
  class: "flex flex-row py-1",
1564
1564
  style: { "font-size": "0.8rem" }
1565
1565
  }, [
1566
- e("div", bn, f(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1566
+ e("div", bn, m(s(b)(`inventory.inventoryAdjustment.type.${o}`)), 1),
1567
1567
  e("div", {
1568
1568
  class: He({
1569
1569
  "text-fm-color-typo-error": g.startsWith("-"),
1570
1570
  "text-fm-color-typo-success": !g.startsWith("-"),
1571
1571
  "ml-auto": !0
1572
1572
  })
1573
- }, f(g), 3)
1573
+ }, m(g), 3)
1574
1574
  ]))), 128)),
1575
1575
  e("div", {
1576
1576
  ref_key: "detailRef",
1577
1577
  ref: w,
1578
1578
  style: kt({
1579
1579
  fontSize: "0.8rem",
1580
- maxHeight: d.value,
1580
+ maxHeight: f.value,
1581
1581
  overflow: "hidden",
1582
1582
  transition: "max-height 0.2s ease-out"
1583
1583
  })
@@ -1587,7 +1587,7 @@ const We = {
1587
1587
  key: g.time,
1588
1588
  class: "flex gap-1 w-full"
1589
1589
  }, [
1590
- e("div", xn, f(g.time), 1),
1590
+ e("div", xn, m(g.time), 1),
1591
1591
  e("div", Sn, [
1592
1592
  (j(!0), q(ue, null, ve(g.adjustments, (o) => {
1593
1593
  var t;
@@ -1596,7 +1596,7 @@ const We = {
1596
1596
  class: "flex gap-1"
1597
1597
  }, [
1598
1598
  e("div", wn, [
1599
- me(f(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1599
+ me(m(s(b)(`inventory.inventoryAdjustment.type.${o.name}`)) + " ", 1),
1600
1600
  o.backdateFrom ? (j(), ne(B, {
1601
1601
  key: 0,
1602
1602
  variant: "plain",
@@ -1604,7 +1604,7 @@ const We = {
1604
1604
  "z-index": 50
1605
1605
  }, {
1606
1606
  content: M(() => [
1607
- e("div", An, f(s(b)("inventory.stock.record.backdate", [
1607
+ e("div", An, m(s(b)("inventory.stock.record.backdate", [
1608
1608
  s(wt)(new Date(o.backdateFrom))
1609
1609
  ])), 1)
1610
1610
  ]),
@@ -1617,10 +1617,10 @@ const We = {
1617
1617
  ]),
1618
1618
  _: 2
1619
1619
  }, 1024)) : se("", !0),
1620
- o.billRemark ? (j(), q("span", Fn, " # " + f(o.billRemark), 1)) : se("", !0),
1621
- o.billRemark && o.remark ? (j(), q("span", $n, " (" + f(o.remark) + ") ", 1)) : se("", !0),
1622
- !o.billRemark && o.reason ? (j(), q("span", jn, " (" + f(o.reason) + ") ", 1)) : se("", !0),
1623
- !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),
1624
1624
  (t = o.createdBy) != null && t.name ? (j(), ne(B, {
1625
1625
  key: 5,
1626
1626
  variant: "plain",
@@ -1628,7 +1628,7 @@ const We = {
1628
1628
  "z-index": 50
1629
1629
  }, {
1630
1630
  content: M(() => [
1631
- 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)
1632
1632
  ]),
1633
1633
  default: M(() => [
1634
1634
  e("span", Cn, [
@@ -1637,12 +1637,12 @@ const We = {
1637
1637
  size: "sm",
1638
1638
  color: "primary"
1639
1639
  }),
1640
- me(" " + f(o.createdBy.name), 1)
1640
+ me(" " + m(o.createdBy.name), 1)
1641
1641
  ])
1642
1642
  ]),
1643
1643
  _: 2
1644
1644
  }, 1024)) : se("", !0),
1645
- 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)
1646
1646
  ]),
1647
1647
  e("div", {
1648
1648
  class: He({
@@ -1650,13 +1650,13 @@ const We = {
1650
1650
  "text-fm-color-typo-success": !o.amount.startsWith("-"),
1651
1651
  "ml-auto": !0
1652
1652
  })
1653
- }, f(o.amount), 3),
1653
+ }, m(o.amount), 3),
1654
1654
  o.name === s(ie).Enum.WASTAGE ? (j(), ne(_n, {
1655
1655
  key: 0,
1656
1656
  adjustmentId: o.adjustmentId,
1657
1657
  onRefreshHistory: l[1] || (l[1] = (n) => C.$emit("refreshHistory"))
1658
1658
  }, null, 8, ["adjustmentId"])) : se("", !0),
1659
- 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)
1660
1660
  ]);
1661
1661
  }), 128))
1662
1662
  ])
@@ -1672,33 +1672,33 @@ const We = {
1672
1672
  function In(A, c) {
1673
1673
  var V;
1674
1674
  const k = Object.keys(ie.enum).reduce(
1675
- (d, r) => (d[r] = { amount: 0, precision: 0 }, d),
1675
+ (f, r) => (f[r] = { amount: 0, precision: 0 }, f),
1676
1676
  {}
1677
1677
  );
1678
1678
  if (!c)
1679
1679
  return Object.entries(k).reduce(
1680
- (d, [r]) => (d[r] = oe.fromNumber(0), d),
1680
+ (f, [r]) => (f[r] = oe.fromNumber(0), f),
1681
1681
  {}
1682
1682
  );
1683
- const w = A.flatMap((d) => {
1683
+ const w = A.flatMap((f) => {
1684
1684
  var r;
1685
- return ((r = d.skus) == null ? void 0 : r.filter((b) => b.sku._id === c._id)) ?? [];
1686
- }).flatMap((d) => d.amounts);
1687
- for (const d of w) {
1688
- const r = d.measurement ? oe.multiply([d.measurement.conversion, d.amount]) : d.amount;
1689
- 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]]);
1690
1690
  }
1691
1691
  return Object.entries(k).reduce(
1692
- (d, [r, b]) => {
1692
+ (f, [r, b]) => {
1693
1693
  const R = {
1694
1694
  ...b,
1695
1695
  amount: Math.abs(b.amount)
1696
1696
  };
1697
- return d[r] = /// comment, because without it formatter makes code uglier
1697
+ return f[r] = /// comment, because without it formatter makes code uglier
1698
1698
  `${oe.toFormatString({
1699
1699
  value: R,
1700
1700
  precision: 4
1701
- })} ${c.unit.abbrev}`, d;
1701
+ })} ${c.unit.abbrev}`, f;
1702
1702
  },
1703
1703
  {}
1704
1704
  );
@@ -1708,15 +1708,15 @@ function Hn(A, c) {
1708
1708
  return null;
1709
1709
  let k = null;
1710
1710
  const w = A.flatMap((V) => {
1711
- var d;
1712
- 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)) ?? [];
1713
1713
  }).flatMap((V) => {
1714
- var d;
1715
- 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];
1716
1716
  });
1717
1717
  for (const V of w) {
1718
- const d = V.amounts;
1719
- for (const r of d) {
1718
+ const f = V.amounts;
1719
+ for (const r of f) {
1720
1720
  if (r.type !== ie.Enum.SALES)
1721
1721
  continue;
1722
1722
  const b = r.measurement ? oe.multiply([r.measurement.conversion, r.amount]) : r.amount;
@@ -1734,10 +1734,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1734
1734
  }, On = { class: "fm-typo-en-body-lg-400 translate-x-4" }, Ln = {
1735
1735
  key: 1,
1736
1736
  class: "flex flex-col gap-12"
1737
- }, 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 = {
1738
1738
  class: "grid gap-12 fm-typo-en-body-md-400",
1739
1739
  style: { "grid-template-columns": "auto auto auto", "grid-auto-rows": "1fr" }
1740
- }, 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 = {
1741
1741
  key: 0,
1742
1742
  class: "flex flex-col gap-8"
1743
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 = {
@@ -1751,7 +1751,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1751
1751
  },
1752
1752
  emits: ["update:show"],
1753
1753
  setup(A) {
1754
- 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([
1755
1755
  { label: "Adjustment (Default)", value: "adjustment" }
1756
1756
  ]), B = Y([]), v = Y(no(0));
1757
1757
  async function g() {
@@ -1779,18 +1779,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1779
1779
  }
1780
1780
  function E(u, h) {
1781
1781
  const p = u.reduce(
1782
- (m, i) => {
1782
+ (d, i) => {
1783
1783
  const S = i.effectiveAt ?? Te(i._id);
1784
1784
  if (!S)
1785
- return m;
1785
+ return d;
1786
1786
  const P = $(new Date(S), h);
1787
- return m[P] ?? (m[P] = []), m[P].push(i), m;
1787
+ return d[P] ?? (d[P] = []), d[P].push(i), d;
1788
1788
  },
1789
1789
  {}
1790
1790
  );
1791
- return Object.keys(p).map((m) => ({
1792
- date: m,
1793
- adjustments: p[m]
1791
+ return Object.keys(p).map((d) => ({
1792
+ date: d,
1793
+ adjustments: p[d]
1794
1794
  }));
1795
1795
  }
1796
1796
  async function N() {
@@ -1801,10 +1801,10 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1801
1801
  );
1802
1802
  o.value = u;
1803
1803
  const h = u.filter(({ ref: p }) => p == null ? void 0 : p.startsWith("bill_")).map(({ ref: p }) => p);
1804
- 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 }) => ({
1805
1805
  date: p,
1806
- adjustments: m,
1807
- adjustmentsByTime: E(m, "minute")
1806
+ adjustments: d,
1807
+ adjustmentsByTime: E(d, "minute")
1808
1808
  }));
1809
1809
  try {
1810
1810
  const p = await _.readUnitCostHistory(
@@ -1813,18 +1813,18 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1813
1813
  mt(new Date(v.value.endDate)).toISOString()
1814
1814
  );
1815
1815
  B.value = p;
1816
- const m = /* @__PURE__ */ new Set();
1816
+ const d = /* @__PURE__ */ new Set();
1817
1817
  p.forEach((S) => {
1818
- m.add(S.mechanism);
1818
+ d.add(S.mechanism);
1819
1819
  });
1820
1820
  const i = [{ label: "Default", value: "adjustment" }];
1821
- m.has(ge.Enum.weightedAverage) && i.push({
1821
+ d.has(ge.Enum.weightedAverage) && i.push({
1822
1822
  label: "Weighted Average (Beta)",
1823
1823
  value: ge.Enum.weightedAverage
1824
- }), 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({
1825
1825
  label: "NetSuite Average (Beta)",
1826
1826
  value: ge.Enum["netsuite-average"]
1827
- }), 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");
1828
1828
  } catch (p) {
1829
1829
  console.error("Failed to fetch unit cost history:", p);
1830
1830
  }
@@ -1833,8 +1833,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1833
1833
  u.length && (n.value = await w.findBillsById(u).catch((h) => {
1834
1834
  var i;
1835
1835
  console.error("Error on using latest bill API, retrying using legacy api", h);
1836
- const p = ((i = c.currentBusiness.value) == null ? void 0 : i._id) ?? "", m = V.currentLocation.doc._id;
1837
- 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);
1838
1838
  }));
1839
1839
  }
1840
1840
  const L = T(() => {
@@ -1846,8 +1846,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1846
1846
  }), z = T(() => {
1847
1847
  const u = [...o.value].computeFirst((p) => {
1848
1848
  var i, S;
1849
- const m = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1850
- 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;
1851
1851
  }) ?? {
1852
1852
  amount: 0,
1853
1853
  precision: 0
@@ -1859,8 +1859,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1859
1859
  }), K = T(() => {
1860
1860
  const u = [...o.value].reverse().computeFirst((p) => {
1861
1861
  var i, S;
1862
- const m = (S = (i = p.skus) == null ? void 0 : i.find) == null ? void 0 : S.call(i, (P) => P.sku._id === b.sku._id);
1863
- 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;
1864
1864
  }) ?? {
1865
1865
  amount: 0,
1866
1866
  precision: 0
@@ -1868,20 +1868,20 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1868
1868
  return h ? `${oe.toFormatString({ value: u, precision: 4 })} ${h.unit.abbrev}` : "";
1869
1869
  }), U = T(() => {
1870
1870
  var p;
1871
- const h = o.value.flatMap((m) => {
1871
+ const h = o.value.flatMap((d) => {
1872
1872
  var i;
1873
- return ((i = m.skus) == null ? void 0 : i.flatMap((S) => S.amounts)) ?? [];
1874
- }).filter((m) => m.amount.amount < 0).reduce(
1875
- (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) => {
1876
1876
  const S = i.cost;
1877
- if (!S) return m;
1877
+ if (!S) return d;
1878
1878
  const P = {
1879
- ...zt(m, Math.max(m.precision, S.precision)),
1879
+ ...zt(d, Math.max(d.precision, S.precision)),
1880
1880
  currency: S.currency
1881
1881
  };
1882
1882
  return {
1883
1883
  ...Ze(P, S),
1884
- currency: m.currency
1884
+ currency: d.currency
1885
1885
  };
1886
1886
  },
1887
1887
  {
@@ -1907,60 +1907,60 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1907
1907
  (S) => S.mechanism === l.value && S.skuId === b.sku._id
1908
1908
  );
1909
1909
  if (p.length === 0) return null;
1910
- const m = p.find((S) => {
1910
+ const d = p.find((S) => {
1911
1911
  const P = S.meta;
1912
1912
  return (P == null ? void 0 : P.adjustmentId) === u;
1913
1913
  });
1914
- if (m) return m.cost;
1914
+ if (d) return d.cost;
1915
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());
1916
1916
  return i.length > 0 ? i[0].cost : null;
1917
1917
  }
1918
1918
  const F = T(() => {
1919
- var m, i, S, P, ee, ae;
1919
+ var d, i, S, P, ee, ae;
1920
1920
  const u = [...o.value].reverse().find((Q) => {
1921
- var W, te;
1922
- 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);
1923
1923
  });
1924
1924
  if (!u) return "No data";
1925
- 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);
1926
1926
  if (!h) return "No data";
1927
1927
  const p = h.toBalance;
1928
1928
  if (l.value === "adjustment") {
1929
- const Q = [...h.amounts].reverse()[0], W = {
1929
+ const Q = [...h.amounts].reverse()[0], G = {
1930
1930
  amount: ((i = Q.cost) == null ? void 0 : i.amount) ?? 0,
1931
1931
  precision: ((S = Q.cost) == null ? void 0 : S.precision) ?? 0
1932
- }, 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]);
1933
1933
  return {
1934
1934
  ...oe.multiply([le, p]),
1935
1935
  currency: ((P = Q.cost) == null ? void 0 : P.currency) || Ce(((ee = c.currentCountry) == null ? void 0 : ee.value) ?? it)
1936
1936
  };
1937
1937
  } else {
1938
- const Q = u.effectiveAt ?? Te(u._id), W = x(
1938
+ const Q = u.effectiveAt ?? Te(u._id), G = x(
1939
1939
  u._id,
1940
1940
  Q ?? (/* @__PURE__ */ new Date()).toISOString()
1941
1941
  );
1942
- if (!W) return "No data";
1943
- const te = oe.fromDinero(W);
1942
+ if (!G) return "No data";
1943
+ const te = oe.fromDinero(G);
1944
1944
  return {
1945
1945
  ...oe.multiply([te, p]),
1946
- 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)
1947
1947
  };
1948
1948
  }
1949
- }), G = T(() => {
1949
+ }), W = T(() => {
1950
1950
  var p;
1951
- const u = [...o.value].reverse().computeFirst((m) => {
1951
+ const u = [...o.value].reverse().computeFirst((d) => {
1952
1952
  var S, P;
1953
- 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);
1954
1954
  return i == null ? void 0 : i.toCostBalances;
1955
1955
  });
1956
- return !u || u.some((m) => m.cost == null) ? "No data" : {
1957
- ...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)]), {
1958
1958
  amount: 0,
1959
1959
  precision: 0
1960
1960
  }),
1961
1961
  currency: Ce((p = c.currentCountry) == null ? void 0 : p.value)
1962
1962
  };
1963
- }), 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);
1964
1964
  function J() {
1965
1965
  const { startDate: u, endDate: h } = to(v.value);
1966
1966
  u !== null && h !== null && (v.value = {
@@ -1970,7 +1970,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1970
1970
  }
1971
1971
  const I = Ye(b, "show");
1972
1972
  return (u, h) => {
1973
- 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");
1974
1974
  return j(), ne(je, {
1975
1975
  "dismiss-away": "",
1976
1976
  modelValue: s(I),
@@ -1980,7 +1980,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
1980
1980
  }, {
1981
1981
  "side-sheet-header": M(() => [
1982
1982
  e("div", Tn, [
1983
- 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),
1984
1984
  y(p, {
1985
1985
  variant: "tertiary",
1986
1986
  "prepend-icon": "close",
@@ -2003,12 +2003,12 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2003
2003
  "z-index": 50
2004
2004
  }, {
2005
2005
  "trigger-button": M(({ opened: de }) => [
2006
- y(m, {
2006
+ y(d, {
2007
2007
  "prepend-icon": "calendar_month",
2008
2008
  focused: de
2009
2009
  }, {
2010
2010
  default: M(() => [
2011
- me(f(v.value.startDate) + " - " + f(v.value.endDate), 1)
2011
+ me(m(v.value.startDate) + " - " + m(v.value.endDate), 1)
2012
2012
  ]),
2013
2013
  _: 2
2014
2014
  }, 1032, ["focused"])
@@ -2030,7 +2030,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2030
2030
  R.value ? (j(), q("div", Nn, [
2031
2031
  y(S),
2032
2032
  y(P, { size: "xl" }),
2033
- e("div", On, f(s(r)("inventory.stock.history.loading")), 1),
2033
+ e("div", On, m(s(r)("inventory.stock.history.loading")), 1),
2034
2034
  y(S),
2035
2035
  y(S)
2036
2036
  ])) : t.value && ((fe = t.value) == null ? void 0 : fe.length) > 0 ? (j(), q("div", Ln, [
@@ -2039,16 +2039,16 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2039
2039
  y(le, { class: "flex flex-col gap-4" }, {
2040
2040
  default: M(() => [
2041
2041
  e("div", Yn, [
2042
- 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)
2043
2043
  ]),
2044
- e("div", Gn, [
2045
- e("div", Wn, [
2046
- e("div", Kn, f(s(r)("inventory.stock.history.summary.totalPurchase")), 1),
2047
- 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)
2048
2048
  ]),
2049
2049
  e("div", Xn, [
2050
2050
  e("div", Jn, [
2051
- me(f(s(r)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2051
+ me(m(s(r)("inventory.stock.history.summary.totalSales")) + "  ", 1),
2052
2052
  X.value != null ? (j(), ne(ae, {
2053
2053
  key: 0,
2054
2054
  variant: "plain",
@@ -2065,44 +2065,44 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2065
2065
  _: 1
2066
2066
  }, 8, ["content"])) : se("", !0)
2067
2067
  ]),
2068
- e("div", Qn, f(L.value.SALES), 1)
2068
+ e("div", Qn, m(L.value.SALES), 1)
2069
2069
  ]),
2070
2070
  e("div", Zn, [
2071
- e("div", es, f(s(r)("inventory.stock.history.summary.totalLose")), 1),
2072
- 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)
2073
2073
  ]),
2074
2074
  e("div", os, [
2075
- e("div", ns, f(s(r)("inventory.stock.history.summary.totalRequest")), 1),
2076
- 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)
2077
2077
  ]),
2078
2078
  e("div", as, [
2079
- e("div", rs, f(s(r)("inventory.stock.history.summary.totalReceive")), 1),
2080
- 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)
2081
2081
  ]),
2082
2082
  e("div", is, [
2083
- e("div", us, f(s(r)("inventory.stock.history.summary.totalConvert")), 1),
2084
- 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)
2085
2085
  ]),
2086
2086
  e("div", ds, [
2087
- e("div", ms, f(s(r)("inventory.stock.history.summary.totalDamage")), 1),
2088
- 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)
2089
2089
  ]),
2090
2090
  e("div", vs, [
2091
- e("div", ps, f(s(r)("inventory.stock.history.summary.openingBalance")), 1),
2092
- 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)
2093
2093
  ]),
2094
2094
  e("div", _s, [
2095
- e("div", ks, f(s(r)("inventory.stock.history.summary.lastStockBalance")), 1),
2096
- 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)
2097
2097
  ])
2098
2098
  ]),
2099
- s(d).enableTotalCost ? (j(), q("div", bs, [
2099
+ s(f).enableTotalCost ? (j(), q("div", bs, [
2100
2100
  y(Q, { class: "w-full" }),
2101
2101
  e("div", gs, [
2102
2102
  e("div", xs, [
2103
2103
  e("div", Ss, [
2104
2104
  e("div", ws, [
2105
- me(f(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
2105
+ me(m(s(r)("inventory.stock.history.estimatedValue")) + " ", 1),
2106
2106
  y(ae, {
2107
2107
  variant: "plain",
2108
2108
  placement: "top",
@@ -2126,17 +2126,17 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2126
2126
  ]),
2127
2127
  e("div", As, [
2128
2128
  u.sku.valuation === s(ut).Enum.FIFO ? (j(), q(ue, { key: 0 }, [
2129
- y(W, {
2129
+ y(G, {
2130
2130
  label: "FIFO",
2131
2131
  compact: ""
2132
2132
  }),
2133
- me(" " + f(typeof H.value != "string" ? s(Me)(
2133
+ me(" " + m(typeof H.value != "string" ? s(Me)(
2134
2134
  H.value,
2135
2135
  !1,
2136
2136
  H.value.precision
2137
2137
  ) : H.value), 1)
2138
2138
  ], 64)) : (j(), q(ue, { key: 1 }, [
2139
- me(f(typeof H.value != "string" ? s(Me)(
2139
+ me(m(typeof H.value != "string" ? s(Me)(
2140
2140
  H.value,
2141
2141
  !1,
2142
2142
  H.value.precision
@@ -2155,14 +2155,14 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2155
2155
  e("div", Fs, [
2156
2156
  e("div", $s, [
2157
2157
  e("div", js, [
2158
- me(f(s(r)("inventory.stock.history.costSold")) + " ", 1),
2158
+ me(m(s(r)("inventory.stock.history.costSold")) + " ", 1),
2159
2159
  y(ae, {
2160
2160
  variant: "plain",
2161
2161
  placement: "top",
2162
2162
  "z-index": 50
2163
2163
  }, {
2164
2164
  content: M(() => [
2165
- e("div", Vs, f(s(r)("inventory.stock.history.costSoldTooltip")), 1)
2165
+ e("div", Vs, m(s(r)("inventory.stock.history.costSoldTooltip")), 1)
2166
2166
  ]),
2167
2167
  default: M(() => [
2168
2168
  y(ee, {
@@ -2179,7 +2179,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2179
2179
  "feature-key": "total-cost"
2180
2180
  })
2181
2181
  ]),
2182
- e("div", Cs, f(U.value), 1)
2182
+ e("div", Cs, m(U.value), 1)
2183
2183
  ])
2184
2184
  ])
2185
2185
  ])) : se("", !0)
@@ -2211,8 +2211,8 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2211
2211
  alt: "List is empty"
2212
2212
  }, null, 8, Ds)
2213
2213
  ]),
2214
- e("div", Ms, f(s(r)("inventory.stock.history.noRecords")), 1),
2215
- 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),
2216
2216
  y(S),
2217
2217
  y(S)
2218
2218
  ]))
@@ -2243,7 +2243,7 @@ const Tn = { class: "flex items-center w-full fm-typo-en-title-md-800" }, En = {
2243
2243
  });
2244
2244
  function Es(A) {
2245
2245
  const c = io(), k = Se(), _ = Y(!1), w = Y(null), V = Y(null);
2246
- let d = null, r = !1, b = !1;
2246
+ let f = null, r = !1, b = !1;
2247
2247
  function R() {
2248
2248
  if (b) return;
2249
2249
  const a = k.currentLocationDBName;
@@ -2256,7 +2256,7 @@ function Es(A) {
2256
2256
  B,
2257
2257
  C
2258
2258
  );
2259
- d = v, g.then((o) => {
2259
+ f = v, g.then((o) => {
2260
2260
  o != null && o.initialState && C(o.initialState);
2261
2261
  }).catch((o) => {
2262
2262
  console.error("Failed to fetch refresh-balance initial state", o);
@@ -2287,7 +2287,7 @@ function Es(A) {
2287
2287
  }
2288
2288
  }
2289
2289
  function l() {
2290
- 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;
2291
2291
  }
2292
2292
  return Ct(() => {
2293
2293
  l();
@@ -2305,7 +2305,7 @@ const Us = {
2305
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({
2306
2306
  __name: "StockView",
2307
2307
  setup(A) {
2308
- 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(
2309
2309
  T(() => [
2310
2310
  {
2311
2311
  action: Be.Action.manage,
@@ -2339,12 +2339,12 @@ const Us = {
2339
2339
  }), O = T(() => n.value || t.value);
2340
2340
  async function L() {
2341
2341
  E();
2342
- const p = c("inventory.stock.stock_balance.refreshBalanceDescription"), m = $.value ? `${p}
2342
+ const p = c("inventory.stock.stock_balance.refreshBalanceDescription"), d = $.value ? `${p}
2343
2343
 
2344
2344
  Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2345
2345
  B.open({
2346
2346
  title: c("inventory.stock.stock_balance.refreshBalance"),
2347
- message: m,
2347
+ message: d,
2348
2348
  closeButton: !0,
2349
2349
  primaryActions: {
2350
2350
  text: c("common.confirm"),
@@ -2362,7 +2362,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2362
2362
  if (!t.value) {
2363
2363
  t.value = !0;
2364
2364
  try {
2365
- await d.recalculation.refreshCurrentBalances();
2365
+ await f.recalculation.refreshCurrentBalances();
2366
2366
  } catch (i) {
2367
2367
  console.log("Failed to queue refresh balan22ce", typeof i);
2368
2368
  const S = typeof i == "object" ? JSON.stringify(i) : String(i);
@@ -2412,7 +2412,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2412
2412
  ]
2413
2413
  }), U = T(() => {
2414
2414
  var i, S, P;
2415
- const p = K.value ? co.build(K.value) : null, m = [];
2415
+ const p = K.value ? co.build(K.value) : null, d = [];
2416
2416
  for (const ee of k.skus) {
2417
2417
  let ae = !0;
2418
2418
  if (b.isEnabled && re.value && g.value && ae && (ae = g.value.has(ee._id)), p && ae && (ae = mo(
@@ -2422,14 +2422,14 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2422
2422
  p
2423
2423
  )), ae) {
2424
2424
  const Q = ee.trackingMeasurement;
2425
- 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(
2426
2426
  (ce) => ce.id === ee._id
2427
2427
  )) == null ? void 0 : S.balance, te = r.inventoryForecast.skus.find(
2428
2428
  (ce) => ce.id === ee._id
2429
2429
  );
2430
2430
  const le = {
2431
2431
  ...ee,
2432
- balance: W ?? {
2432
+ balance: G ?? {
2433
2433
  amount: 0,
2434
2434
  precision: 0
2435
2435
  },
@@ -2437,11 +2437,11 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2437
2437
  day: (te == null ? void 0 : te.depletionDays) ?? void 0,
2438
2438
  trackingUnitAbbrev: Q ? ((P = ee.unit.measurements.find((ce) => ce.id === Q)) == null ? void 0 : P.abbrev) ?? "" : ee.unit.abbrev
2439
2439
  };
2440
- m.push(le);
2440
+ d.push(le);
2441
2441
  }
2442
2442
  }
2443
- return m;
2444
- }), 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(() => {
2445
2445
  const p = [
2446
2446
  {
2447
2447
  label: c("inventory.stock.stock_balance.refreshBalance"),
@@ -2478,7 +2478,7 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2478
2478
  return u();
2479
2479
  }
2480
2480
  }
2481
- return (p, m) => {
2481
+ return (p, d) => {
2482
2482
  const i = D("FmSwitch"), S = D("FmTable");
2483
2483
  return j(), ne(Mt, {
2484
2484
  title: s(c)("inventory.stock.title"),
@@ -2501,22 +2501,22 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2501
2501
  searchable: "",
2502
2502
  "change-location": "",
2503
2503
  search: Z.value,
2504
- "onUpdate:search": m[1] || (m[1] = (W) => Z.value = W),
2504
+ "onUpdate:search": d[1] || (d[1] = (G) => Z.value = G),
2505
2505
  "hide-filter-options": !0,
2506
2506
  filterable: "",
2507
2507
  "filter-attributes": z.value,
2508
2508
  filter: K.value,
2509
- "onUpdate:filter": m[2] || (m[2] = (W) => K.value = W)
2509
+ "onUpdate:filter": d[2] || (d[2] = (G) => K.value = G)
2510
2510
  }, {
2511
2511
  default: M(() => [
2512
2512
  s(b).isEnabled ? (j(), q("div", Us, [
2513
- 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),
2514
2514
  y(Rt),
2515
2515
  y(Qe, null, {
2516
2516
  default: M(() => [
2517
2517
  y(i, {
2518
2518
  modelValue: re.value,
2519
- "onUpdate:modelValue": m[0] || (m[0] = (W) => re.value = W)
2519
+ "onUpdate:modelValue": d[0] || (d[0] = (G) => re.value = G)
2520
2520
  }, null, 8, ["modelValue"])
2521
2521
  ]),
2522
2522
  _: 1
@@ -2532,12 +2532,12 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2532
2532
  "search-value": Z.value,
2533
2533
  loading: o.value || s(n) || !s(_)._currentLocation,
2534
2534
  key: (P = s(_)._currentLocation) == null ? void 0 : P.dbName,
2535
- onRowClick: m[3] || (m[3] = (W) => s(V).showSkuHistory(W.original)),
2536
- "page-size": G.value
2535
+ onRowClick: d[3] || (d[3] = (G) => s(V).showSkuHistory(G.original)),
2536
+ "page-size": W.value
2537
2537
  }, {
2538
- "list-row": M((W) => [
2538
+ "list-row": M((G) => [
2539
2539
  y(ro, {
2540
- row: W,
2540
+ row: G,
2541
2541
  onRowClick: s(V).showSkuHistory
2542
2542
  }, {
2543
2543
  default: M((te) => {
@@ -2560,16 +2560,16 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2560
2560
  ]),
2561
2561
  e("div", null, [
2562
2562
  y(Ke, {
2563
- days: W.original.day
2563
+ days: G.original.day
2564
2564
  }, null, 8, ["days"])
2565
2565
  ]),
2566
2566
  e("div", null, [
2567
2567
  y(ht, {
2568
2568
  class: "xs:w-[160px]",
2569
- unit: W.original.unit,
2570
- sku: W.original,
2571
- amount: W.original.balance,
2572
- "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
2573
2573
  }, null, 8, ["unit", "sku", "amount", "default-tracking-measurement"])
2574
2574
  ])
2575
2575
  ])
@@ -2584,8 +2584,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2584
2584
  (j(), ne(Bt, { to: "body" }, [
2585
2585
  (ee = s(V).stockHistoryProps) != null && ee.sku ? (j(), ne(Hs, rt(ze({ key: 0 }, s(V).stockHistoryProps)), null, 16)) : se("", !0),
2586
2586
  (ae = s(V).convertSkuDialogProps) != null && ae.sku ? (j(), ne(Mo, rt(ze({ key: 1 }, s(V).convertSkuDialogProps)), null, 16)) : se("", !0),
2587
- (Q = s(V).adjustSkuDialogProps) != null && Q.stock ? (j(), ne(Go, ze({ key: 2 }, s(V).adjustSkuDialogProps, {
2588
- 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())
2589
2589
  }), null, 16)) : se("", !0),
2590
2590
  y(Ts, {
2591
2591
  permission: {
@@ -2597,8 +2597,8 @@ Last refreshed: ${new Date($.value).toLocaleString()}` : p;
2597
2597
  I.value ? (j(), ne(sn, {
2598
2598
  key: 0,
2599
2599
  show: I.value,
2600
- "onUpdate:show": m[5] || (m[5] = (W) => I.value = W),
2601
- 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())
2602
2602
  }, null, 8, ["show"])) : se("", !0)
2603
2603
  ]),
2604
2604
  _: 1