@feedmepos/mf-inventory-portal 1.8.0-dev.7 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/dist/App-BPdZMhM8.js +1445 -0
  2. package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-UzjSuZ2L.js} +26 -25
  3. package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-Cb6WRlKq.js} +2 -2
  4. package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-CtD4U4lv.js} +2 -2
  5. package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-CX-3403K.js} +10 -10
  6. package/dist/BulkReceiveRequestPage-CUq1Lmww.js +2839 -0
  7. package/dist/{ChangeLocationComponent.vue_vue_type_script_setup_true_lang-DQuI04Yj.js → ChangeLocationComponent.vue_vue_type_script_setup_true_lang-C5cA-lGH.js} +1 -1
  8. package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-Ca_SvdWQ.js} +748 -746
  9. package/dist/ClosingHistoryView-DzkeJYoe.js +769 -0
  10. package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-DSrelbso.js} +22 -21
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuOuXPy1.js} +1 -1
  12. package/dist/{DefaultView-B4UuAqYu.js → DefaultView-Dw-7Y8vD.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-C5qJsv_O.js} +15 -15
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-D8od7aKT.js} +10075 -9949
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js +48 -0
  16. package/dist/FeatureCapabilityGate-C-IM5_7n.js +82 -0
  17. package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DEDU1XUC.js +189 -0
  18. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js} +1 -1
  19. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-B7j4ZSOe.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-Ckli_nZx.js} +2 -2
  20. package/dist/{FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js → FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js} +2 -2
  21. package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CShFKSIW.js} +2 -2
  22. package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-Ci-6NMsV.js} +2 -2
  23. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dkx5vVap.js} +105 -99
  24. package/dist/ImportView-7ij7RUHI.js +1540 -0
  25. package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-fIPtTyFD.js} +685 -688
  26. package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-DLYT4T-I.js} +1537 -1620
  27. package/dist/IntegrationPlatformView-CwywuK_y.js +13385 -0
  28. package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-DnyVHXge.js} +2380 -2340
  29. package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-BBs8v7CL.js} +1 -1
  30. package/dist/{InventoryBindingForm.vue_vue_type_script_setup_true_lang-Bpo7Yv9A.js → InventoryBindingForm.vue_vue_type_script_setup_true_lang--pI5wz_M.js} +134 -134
  31. package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-CwIrQ8lG.js} +1 -1
  32. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  33. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJSbskyn.js +79 -0
  34. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
  35. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
  36. package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
  37. package/dist/ProductionRunDetailPage-C_WC4qfP.js +2317 -0
  38. package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BIkoMOM2.js} +3051 -3161
  39. package/dist/ProductionRunPage-DuzVrjbZ.js +954 -0
  40. package/dist/{PublishView-BXA3k8Cp.js → PublishView-BVg44yke.js} +3 -3
  41. package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-CNx6unyj.js} +17 -17
  42. package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-DeNrYOUt.js} +17 -16
  43. package/dist/RecipeView-De3pLsPR.js +3272 -0
  44. package/dist/SettingsView-B5ud0KtI.js +1005 -0
  45. package/dist/StockView-4N3NRjY8.js +3003 -0
  46. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-Ckw1_xIc.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-DvlRRKdt.js} +1 -1
  47. package/dist/{SupplierView-DH9u6e2M.js → SupplierView-fC9oe5nu.js} +304 -301
  48. package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-H6rv7u8A.js} +7 -7
  49. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DFdrmR2Z.js} +2 -2
  50. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  51. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BivHE94R.js +332 -0
  52. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Df01LqHp.js +4953 -0
  53. package/dist/TransferTemplateView-CVUnofkI.js +2347 -0
  54. package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-DjD2WAFI.js} +4 -4
  55. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js} +4 -4
  56. package/dist/{UnitView-Xk_F9SYG.js → UnitView-DCfsbE8e.js} +111 -106
  57. package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BCebmbcj.js} +12 -11
  58. package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-BXYNMBun.js} +19 -18
  59. package/dist/api/bill.d.ts +4 -2
  60. package/dist/api/bill.spec.d.ts +1 -0
  61. package/dist/api/closing.d.ts +1 -0
  62. package/dist/api/feature-flags.d.ts +2 -0
  63. package/dist/api/integration-sync-log.d.ts +0 -13
  64. package/dist/api/inventory.d.ts +9 -9
  65. package/dist/api/netsuite-explorer.d.ts +1 -0
  66. package/dist/api/stock.d.ts +1 -1
  67. package/dist/{app-CURawLhs.js → app-VtVYHCDF.js} +9785 -9546
  68. package/dist/app.d.ts +151 -14
  69. package/dist/app.js +1 -1
  70. package/dist/bulk-edit-simulation.helper-Nd6CtWGf.js +178 -0
  71. package/dist/{closing-template-q_KGB4jO.js → closing-template-LCe0U9w9.js} +4 -4
  72. package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
  73. package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
  74. package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
  75. package/dist/components/FeaturePageGate.spec.d.ts +1 -0
  76. package/dist/components/FeaturePageGate.vue.d.ts +34 -0
  77. package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
  78. package/dist/components/FmDroppableField.vue.d.ts +1 -1
  79. package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
  80. package/dist/components/FmUnitInputProps.d.ts +1 -0
  81. package/dist/components/FmUnitInputRules.d.ts +1 -1
  82. package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
  83. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  84. package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
  85. package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
  86. package/dist/components/TemplatePublishDialog.d.ts +2 -0
  87. package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
  88. package/dist/composable/defineApi.d.ts +1 -1
  89. package/dist/{date2-3kdweNLp.js → date2-Cfb6DXM4.js} +1 -1
  90. package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-BOndKK7B.js} +1 -1
  91. package/dist/{decimal-CAnQe2Ib.js → decimal-nbuisP61.js} +2 -2
  92. package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DKySrdwp.js} +5 -5
  93. package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-BxcKb3Jp.js} +1 -1
  94. package/dist/{feature-D9n0IC0c.js → feature-VDUlSvM1.js} +452 -354
  95. package/dist/feature-flags/core.d.ts +1 -0
  96. package/dist/feature-flags/vue.d.ts +22 -1
  97. package/dist/feature-flags/vue.spec.d.ts +1 -0
  98. package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-CfVH4LZ_.js} +1 -1
  99. package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-BjTeAtgS.js} +209 -208
  100. package/dist/helper/country.spec.d.ts +1 -0
  101. package/dist/helper/menu-usage-module.d.ts +2 -1
  102. package/dist/helper/number.d.ts +5 -1
  103. package/dist/helper/rules.d.ts +1 -1
  104. package/dist/{id-to-date-DPCcxufP.js → id-to-date-Jr9SlHLO.js} +1 -1
  105. package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-FT9Wbigh.js} +17 -17
  106. package/dist/{index-zCBA-X6R.js → index-BV9b3Ulp.js} +2234 -2163
  107. package/dist/{index-yt6MlAFG.js → index-By5-VjVg.js} +1 -1
  108. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  109. package/dist/{index-CFNNQo-7.js → index-DXHVgUHU.js} +3 -3
  110. package/dist/index-eGvSlWMU.js +1892 -0
  111. package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
  112. package/dist/{lz-string-CqlY9MC2.js → lz-string-BAzqO9xf.js} +1 -1
  113. package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
  114. package/dist/{netsuite-DudeltN_.js → netsuite-BhGuduqd.js} +254 -263
  115. package/dist/netsuite-explorer-9Qj7qAum.js +79 -0
  116. package/dist/{predefined-templates-DT32p04n.js → predefined-templates-BlRafgnc.js} +1 -1
  117. package/dist/production-run-list-DR1WsaBR.js +61 -0
  118. package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-By_Zxu1b.js} +1 -1
  119. package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-VsBar7jB.js} +1 -1
  120. package/dist/router/name.d.ts +2 -1
  121. package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-76yLYmPA.js} +1 -1
  122. package/dist/rules-fOcvgt4t.js +243 -0
  123. package/dist/{stock-B9XerL9c.js → stock-C-dQaxY2.js} +1 -1
  124. package/dist/stock-Dh0KXA1P.js +78 -0
  125. package/dist/stores/feature.d.ts +31 -2
  126. package/dist/stores/feature.load-state.spec.d.ts +1 -0
  127. package/dist/stores/integration/netsuite.d.ts +2 -2
  128. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  129. package/dist/stores/location.d.ts +42 -42
  130. package/dist/stores/supplier.d.ts +48 -48
  131. package/dist/stores/warehouse.d.ts +2 -2
  132. package/dist/style.css +1 -1
  133. package/dist/{supplier-dpHijd2E.js → supplier-XHHHN8vZ.js} +2 -2
  134. package/dist/{surcharge-BZ4STY5J.js → surcharge-0-oBiYoF.js} +1 -1
  135. package/dist/tsconfig.app.tsbuildinfo +1 -1
  136. package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DrRuSFgM.js} +1 -1
  137. package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-mQ7aQChK.js} +2 -2
  138. package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-5Wu0ItnH.js} +2 -2
  139. package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-CgpPMl8g.js} +2 -2
  140. package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-DZ6B7eMT.js} +14 -14
  141. package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BaGxz4EV.js} +1 -1
  142. package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CyP39v3U.js} +50 -49
  143. package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CaD4MVg0.js} +1 -1
  144. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  145. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  146. package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
  147. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  148. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  149. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  150. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  151. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +19 -19
  152. package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
  153. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  154. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  155. package/dist/views/import/helper/submit-rows.d.ts +1 -1
  156. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  157. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
  158. package/dist/views/integration/IntegrationPlatformView.vue.d.ts +24 -0
  159. package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
  160. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  161. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  162. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  163. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  164. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  165. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  166. package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
  167. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
  168. package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
  169. package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
  170. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
  171. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
  172. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
  173. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
  174. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
  175. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
  176. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
  177. package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
  178. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
  179. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
  180. package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
  181. package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
  182. package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
  183. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
  184. package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
  185. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  186. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  187. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  188. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
  189. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
  190. package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
  191. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
  192. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  193. package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
  194. package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
  195. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +54 -54
  196. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
  197. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
  198. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  199. package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
  200. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  201. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  202. package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
  203. package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
  204. package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
  205. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  206. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
  207. package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
  208. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  209. package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
  210. package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
  211. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  212. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  213. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  214. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  215. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  216. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  217. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  218. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  219. package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
  220. package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
  221. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -4
  222. package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → vue-KHCpiw_e.js} +106 -108
  223. package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-D6btLtve.js} +422 -422
  224. package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-Dr5i_LBa.js} +2 -2
  225. package/package.json +71 -66
  226. package/dist/App-Bo29Nwt0.js +0 -1537
  227. package/dist/BulkReceiveRequestView-vOeHbWM_.js +0 -2656
  228. package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
  229. package/dist/ImportView-C7Hah7MM.js +0 -1291
  230. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js +0 -72
  231. package/dist/ProductionRunDetailView-Ct7kr5Ht.js +0 -2312
  232. package/dist/ProductionRunView-odWyBZGx.js +0 -930
  233. package/dist/RecipeView-BH0REMB3.js +0 -3428
  234. package/dist/SettingsView-Dc27wyk-.js +0 -977
  235. package/dist/StockView-DrHLzosW.js +0 -2616
  236. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  237. package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js +0 -299
  238. package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js +0 -4820
  239. package/dist/TransferTemplateView-CEVRsKL7.js +0 -2326
  240. package/dist/menu-usage-module-BdjYEk3s.js +0 -57
  241. package/dist/number-BoePMDs8.js +0 -138
  242. package/dist/rules-CQT0uAAo.js +0 -98
  243. package/dist/stock-CVybjhUm.js +0 -75
  244. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
@@ -1,33 +1,33 @@
1
- import { defineComponent as De, ref as q, computed as C, onMounted as mo, resolveComponent as te, createElementBlock as A, createBlock as ne, openBlock as p, Fragment as le, createTextVNode as ge, withCtx as ee, createElementVNode as a, createCommentVNode as H, toDisplayString as R, unref as d, createVNode as h, h as D, watch as je, renderList as he, onUnmounted as Zo, withModifiers as Xo, normalizeStyle as yt, normalizeClass as ke, isRef as ht, reactive as io, createSlots as en, Teleport as tn, mergeProps as on } from "vue";
2
- import { u as nn, _ as an } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { useCoreStore as po, useI18n as tt } from "@feedmepos/mf-common";
4
- import { useSnackbar as Ne, useDialog as fo, components as be, useProxiedModel as Mt, useBreakpoints as sn } from "@feedmepos/ui-library";
5
- import { d as rn, u as qe, V as fe, w as se, q as vo, s as Ie, W as xe, B as Le, c as ln, a as Ut, X as cn, k as un } from "./app-CURawLhs.js";
6
- import { defineStore as go, storeToRefs as dn } from "pinia";
7
- import { c as Ke, e as yo, f as mn, b as Fe } from "./date2-3kdweNLp.js";
8
- import { R as bo } from "./rules-CQT0uAAo.js";
9
- import { e as _t, c as Xe, j as et, m as ho, o as _o, a as pn, k as ko, l as me, t as fn } from "./number-BoePMDs8.js";
10
- import { b as vn, d as gn, u as gt, w as yn, c as bn } from "./xlsx.util-C7S-uyqm.js";
11
- import { i as Nt, u as Pt } from "./uom-rules-Da5Lngvp.js";
12
- import { u as hn } from "./stock-CVybjhUm.js";
13
- import { u as kt } from "./stock-B9XerL9c.js";
14
- import { D as co, R as He } from "./row-action.enum-BiP5wkT6.js";
15
- import { c as _n } from "./component-BmLAdDiY.js";
16
- import { f as kn } from "./format-time-from-id-Bmzpbg-8.js";
17
- import { i as wn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js";
18
- import { f as xn } from "./recalculationUtils-BYN393eE.js";
19
- import { _ as Dn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js";
20
- import { _ as An } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
21
- import { _ as wo } from "./empty-placeholder-B0QU467o.js";
22
- import { F as Tt } from "./FmAdminBadge-DlplQOHb.js";
23
- import { u as $n } from "./vue-i18n-DwAcG7yc.js";
24
- import { F as Cn } from "./decimal-CAnQe2Ib.js";
25
- import { u as Sn } from "./useSseClient-D_7o9nuf.js";
26
- import { d as Fn } from "./dayjs.min-DHE73-wM.js";
27
- import { F as In } from "./FmDroppableField-J0tG_U3w.js";
28
- import { _ as Bn } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js";
29
- import { _ as Tn, F as Je } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js";
30
- const Oe = rn((t, o) => {
1
+ import { defineComponent as De, ref as q, computed as C, onMounted as uo, resolveComponent as te, createElementBlock as A, createBlock as ae, openBlock as p, Fragment as le, createTextVNode as ge, withCtx as ee, createElementVNode as a, createCommentVNode as H, toDisplayString as R, unref as d, createVNode as h, h as D, watch as je, renderList as he, onUnmounted as Jo, withModifiers as Zo, normalizeStyle as gt, normalizeClass as we, isRef as bt, reactive as lo, createSlots as Xo, Teleport as en, mergeProps as tn } from "vue";
2
+ import { u as on, _ as nn } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
+ import { useCoreStore as mo, useI18n as et } from "@feedmepos/mf-common";
4
+ import { useSnackbar as Ue, useDialog as po, components as be, useProxiedModel as Rt, useBreakpoints as an } from "@feedmepos/ui-library";
5
+ import { d as sn, u as qe, W as fe, s as ne, q as fo, t as Ie, X as xe, B as Le, c as rn, a as Nt, Y as ln, k as cn } from "./app-VtVYHCDF.js";
6
+ import { defineStore as vo, storeToRefs as un } from "pinia";
7
+ import { c as Ke, e as go, f as dn, b as Fe } from "./date2-Cfb6DXM4.js";
8
+ import { R as yo, h as ht, l as Xe, p as bo, q as ho, a as mn, m as _o, o as me, t as pn } from "./rules-fOcvgt4t.js";
9
+ import { b as fn, d as vn, u as vt, w as gn, c as yn } from "./xlsx.util-Dr5i_LBa.js";
10
+ import { i as Mt, u as Ut } from "./uom-rules-DrRuSFgM.js";
11
+ import { u as bn } from "./stock-Dh0KXA1P.js";
12
+ import { u as _t } from "./stock-C-dQaxY2.js";
13
+ import { D as io, R as He } from "./row-action.enum-76yLYmPA.js";
14
+ import { c as hn } from "./component-BmLAdDiY.js";
15
+ import { f as _n } from "./format-time-from-id-CfVH4LZ_.js";
16
+ import { i as kn } from "./FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js";
17
+ import { f as wn } from "./recalculationUtils-VsBar7jB.js";
18
+ import { _ as xn } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.js";
19
+ import { _ as Dn } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
20
+ import { _ as ko } from "./empty-placeholder-B0QU467o.js";
21
+ import { F as Bt } from "./FmAdminBadge-DlplQOHb.js";
22
+ import { u as An } from "./vue-i18n-D6btLtve.js";
23
+ import { F as $n } from "./decimal-nbuisP61.js";
24
+ import { u as Cn } from "./useSseClient-CaD4MVg0.js";
25
+ import { d as Sn } from "./dayjs.min-BOndKK7B.js";
26
+ import { F as Fn } from "./FmDroppableField-J0tG_U3w.js";
27
+ import { _ as In } from "./FmConfirmationButton.vue_vue_type_script_setup_true_lang-Vg8U7WMZ.js";
28
+ import { _ as Bn } from "./TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js";
29
+ import { F as Je } from "./index-eGvSlWMU.js";
30
+ const Oe = sn((t, o) => {
31
31
  function e() {
32
32
  return qe().currentLocation.dbName;
33
33
  }
@@ -107,13 +107,13 @@ const Oe = rn((t, o) => {
107
107
  return o.get(s);
108
108
  }
109
109
  };
110
- }), jn = { class: "fm-typo-en-body-lg-400" }, Rn = { class: "fm-typo-en-body-lg-600" }, Mn = {
110
+ }), Tn = { class: "fm-typo-en-body-lg-400" }, jn = { class: "fm-typo-en-body-lg-600" }, Rn = {
111
111
  key: 0,
112
112
  class: "flex flex-col"
113
- }, Un = {
113
+ }, Nn = {
114
114
  key: 0,
115
115
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
116
- }, Nn = { "data-testid": "closing-draft-action-remark" }, Pn = { class: "flex gap-12 py-8 justify-end w-full" }, jt = /* @__PURE__ */ De({
116
+ }, Mn = { "data-testid": "closing-draft-action-remark" }, Un = { class: "flex gap-12 py-8 justify-end w-full" }, Tt = /* @__PURE__ */ De({
117
117
  __name: "ClosingDraftAction",
118
118
  props: {
119
119
  draft: {},
@@ -122,7 +122,7 @@ const Oe = rn((t, o) => {
122
122
  onFinished: { type: Function }
123
123
  },
124
124
  setup(t) {
125
- const o = t, e = q(), n = Oe(), l = Ne(), r = q(!1), s = q(null), u = q(!1), c = C(() => {
125
+ const o = t, e = q(), n = Oe(), l = Ue(), r = q(!1), s = q(null), u = q(!1), c = C(() => {
126
126
  switch (o.action) {
127
127
  case fe.enum.approveDraft:
128
128
  return "Approve";
@@ -143,7 +143,7 @@ const Oe = rn((t, o) => {
143
143
  }
144
144
  throw new Error(`Unknown action: ${o.action}`);
145
145
  });
146
- mo(() => {
146
+ uo(() => {
147
147
  if (o.draft.effectiveAt)
148
148
  s.value = new Date(o.draft.effectiveAt);
149
149
  else {
@@ -165,7 +165,7 @@ const Oe = rn((t, o) => {
165
165
  }
166
166
  }), S = C({
167
167
  get() {
168
- return s.value === null ? "" : yo(s.value);
168
+ return s.value === null ? "" : go(s.value);
169
169
  },
170
170
  set(B) {
171
171
  if (B) {
@@ -211,19 +211,19 @@ const Oe = rn((t, o) => {
211
211
  }
212
212
  return (B, I) => {
213
213
  const P = te("FmLabel"), Z = te("FmDatePicker"), X = te("FmTimePicker"), z = te("FmTextField"), F = te("FmButton"), T = te("FmForm");
214
- return u.value ? (p(), ne(T, {
214
+ return u.value ? (p(), ae(T, {
215
215
  key: 1,
216
216
  onValidationSuccess: E,
217
217
  class: "flex flex-col gap-32",
218
218
  disabled: r.value
219
219
  }, {
220
220
  default: ee(() => [
221
- a("div", jn, [
221
+ a("div", Tn, [
222
222
  I[4] || (I[4] = ge(" You are about to ")),
223
- a("span", Rn, R(c.value), 1),
223
+ a("span", jn, R(c.value), 1),
224
224
  I[5] || (I[5] = ge(" this draft. Please provide a remark to justify this action. "))
225
225
  ]),
226
- B.action === d(fe).enum.approveDraft ? (p(), A("div", Mn, [
226
+ B.action === d(fe).enum.approveDraft ? (p(), A("div", Rn, [
227
227
  h(P, { class: "fm-typo-en-body-lg-600" }, {
228
228
  default: ee(() => I[6] || (I[6] = [
229
229
  ge("Closing Date")
@@ -245,18 +245,18 @@ const Oe = rn((t, o) => {
245
245
  modelValue: S.value,
246
246
  "onUpdate:modelValue": I[1] || (I[1] = (k) => S.value = k)
247
247
  }, null, 8, ["modelValue"]),
248
- J.value ? (p(), A("div", Un, " Cannot select future date ")) : H("", !0)
248
+ J.value ? (p(), A("div", Nn, " Cannot select future date ")) : H("", !0)
249
249
  ])) : H("", !0),
250
- a("div", Nn, [
250
+ a("div", Mn, [
251
251
  h(z, {
252
252
  modelValue: e.value,
253
253
  "onUpdate:modelValue": I[2] || (I[2] = (k) => e.value = k),
254
254
  label: "Remark",
255
255
  "label-mark": "required",
256
- rules: [d(bo)()]
256
+ rules: [d(yo)()]
257
257
  }, null, 8, ["modelValue", "rules"])
258
258
  ]),
259
- a("div", Pn, [
259
+ a("div", Un, [
260
260
  h(F, {
261
261
  label: "Cancel",
262
262
  variant: "tertiary",
@@ -277,53 +277,53 @@ const Oe = rn((t, o) => {
277
277
  ], 64));
278
278
  };
279
279
  }
280
- }), Vn = Xe(0);
281
- function wt(t) {
280
+ }), Pn = ne.fromNumber(0);
281
+ function kt(t) {
282
282
  const o = t.measurementsAmounts.groupBy((e) => e.measurement.id);
283
283
  return t.sku.unit.measurements.reduce((e, n) => {
284
284
  var s, u;
285
- const l = ((u = (s = o.get(n.id)) == null ? void 0 : s[0]) == null ? void 0 : u.amount) ?? Vn, r = _t(n.conversion, l);
286
- return et(e, r);
285
+ const l = ((u = (s = o.get(n.id)) == null ? void 0 : s[0]) == null ? void 0 : u.amount) ?? Pn, r = ht(n.conversion, l);
286
+ return Xe(e, r);
287
287
  }, t.baseAmount);
288
288
  }
289
- const En = Xe(0), Ln = Xe(100);
290
- function On(t, o, e, n, l, r, s, u) {
291
- var _, $, L, M, ve;
292
- const c = wt(t), b = n ?? c, g = ho(b, o), S = o.amount === 0 ? null : _o(g, {
289
+ const Vn = ne.fromNumber(0), En = ne.fromNumber(100);
290
+ function Ln(t, o, e, n, l, r, s, u) {
291
+ var _, $, L, N, ve;
292
+ const c = kt(t), b = n ?? c, g = bo(b, o), S = o.amount === 0 ? null : ho(g, {
293
293
  ...o,
294
294
  amount: Math.abs(o.amount)
295
- }), J = S ? _t(S, Ln) : null, E = ((_ = t.sku.defaultCost) == null ? void 0 : _.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(se.toFormatString({ value: E })), I = ((L = ($ = t.sku.defaultCost) == null ? void 0 : $.measurement) == null ? void 0 : L.conversion) ?? {
295
+ }), J = S ? ht(S, En) : null, E = ((_ = t.sku.defaultCost) == null ? void 0 : _.costPerUnit) ?? { amount: 0, precision: 0 }, B = Number(ne.toFormatString({ value: E })), I = ((L = ($ = t.sku.defaultCost) == null ? void 0 : $.measurement) == null ? void 0 : L.conversion) ?? {
296
296
  amount: 1,
297
297
  precision: 0
298
298
  }, P = Number(
299
- se.toFormatString({ value: I })
300
- ), Z = l ? Number(se.toFormatString({ value: l })) : 0, X = Number(se.toFormatString({ value: o })), z = Number(se.toFormatString({ value: b })), F = z - X, T = F * B / P, k = z * B / P, x = X * B / P, w = {};
299
+ ne.toFormatString({ value: I })
300
+ ), Z = l ? Number(ne.toFormatString({ value: l })) : 0, X = Number(ne.toFormatString({ value: o })), z = Number(ne.toFormatString({ value: b })), F = z - X, T = F * B / P, k = z * B / P, x = X * B / P, w = {};
301
301
  return s && r && s.forEach((oe) => {
302
- const U = { amount: 0, precision: 0 }, f = r[oe];
302
+ const M = { amount: 0, precision: 0 }, f = r[oe];
303
303
  if (f) {
304
- const y = et(U, f);
305
- w[`adjustment_${oe}`] = pn(y);
304
+ const y = Xe(M, f);
305
+ w[`adjustment_${oe}`] = mn(y);
306
306
  } else
307
307
  w[`adjustment_${oe}`] = "0";
308
308
  }), {
309
309
  code: t.sku.code,
310
310
  name: t.sku.name,
311
311
  baseUnit: t.sku.unit.abbrev,
312
- costUnit: ((ve = (M = t.sku.defaultCost) == null ? void 0 : M.measurement) == null ? void 0 : ve.abbrev) ?? null,
313
- baseUnitAmount: Number(se.toFormatString({ value: t.baseAmount })),
312
+ costUnit: ((ve = (N = t.sku.defaultCost) == null ? void 0 : N.measurement) == null ? void 0 : ve.abbrev) ?? null,
313
+ baseUnitAmount: Number(ne.toFormatString({ value: t.baseAmount })),
314
314
  ...e.reduce(
315
- (oe, U, f) => {
316
- const y = se.toFormatString({ value: U.conversion }), N = U.orphan ? " [invalid UOM]" : U.inactive ? " [NetSuite-inactive]" : "";
317
- return oe[`measurementAbbrev${f}`] = `(${U.abbrev}) × ${y}${N}`, oe[`measurementAmount${f}`] = Number(se.toFormatString({ value: U.amount })), oe;
315
+ (oe, M, f) => {
316
+ const y = ne.toFormatString({ value: M.conversion }), U = M.orphan ? " [invalid UOM]" : M.inactive ? " [NetSuite-inactive]" : "";
317
+ return oe[`measurementAbbrev${f}`] = `(${M.abbrev}) × ${y}${U}`, oe[`measurementAmount${f}`] = Number(ne.toFormatString({ value: M.amount })), oe;
318
318
  },
319
319
  {}
320
320
  ),
321
321
  systemBalance: X,
322
322
  physicalBalance: z,
323
- adjustedAmount: Number(se.toFormatString({ value: g })),
323
+ adjustedAmount: Number(ne.toFormatString({ value: g })),
324
324
  adjustedDiffPercentage: J ? Number(
325
- se.toFormatString({
326
- value: ko(J, 2)
325
+ ne.toFormatString({
326
+ value: _o(J, 2)
327
327
  })
328
328
  ) : null,
329
329
  costPerUnit: B,
@@ -335,22 +335,22 @@ function On(t, o, e, n, l, r, s, u) {
335
335
  systemValue: x,
336
336
  // Include custom attribute values
337
337
  ...(u ?? []).reduce(
338
- (oe, U) => {
338
+ (oe, M) => {
339
339
  var y;
340
- const f = (y = t.sku.customAttributes) == null ? void 0 : y[U];
341
- return oe[`customAttr_${U}`] = f != null ? String(f) : null, oe;
340
+ const f = (y = t.sku.customAttributes) == null ? void 0 : y[M];
341
+ return oe[`customAttr_${M}`] = f != null ? String(f) : null, oe;
342
342
  },
343
343
  {}
344
344
  )
345
345
  };
346
346
  }
347
- function Gn(t) {
347
+ function On(t) {
348
348
  let o = 0;
349
349
  for (const e of t.values())
350
350
  e.length > o && (o = e.length);
351
351
  return o;
352
352
  }
353
- function zn(t, o) {
353
+ function Gn(t, o) {
354
354
  const e = /* @__PURE__ */ new Map();
355
355
  for (const n of t) {
356
356
  if (e.has(n.sku._id)) continue;
@@ -364,7 +364,7 @@ function zn(t, o) {
364
364
  abbrev: u.abbrev,
365
365
  conversion: u.conversion,
366
366
  amount: c,
367
- inactive: Nt(u, o),
367
+ inactive: Mt(u, o),
368
368
  orphan: !1
369
369
  });
370
370
  }
@@ -381,8 +381,8 @@ function zn(t, o) {
381
381
  }
382
382
  return e;
383
383
  }
384
- function Hn(t, o = [], e = []) {
385
- const n = vo(), l = n === "MYR" ? "RM" : n;
384
+ function zn(t, o = [], e = []) {
385
+ const n = fo(), l = n === "MYR" ? "RM" : n;
386
386
  return [
387
387
  {
388
388
  id: "code",
@@ -462,40 +462,40 @@ function Hn(t, o = [], e = []) {
462
462
  }))
463
463
  ];
464
464
  }
465
- function Yn(t, o, e, n = [], l) {
466
- var re, _, $, L, M, ve, oe;
465
+ function Hn(t, o, e, n = [], l) {
466
+ var re, _, $, L, N, ve, oe;
467
467
  const r = o.groupBy(
468
- (U) => U.id,
469
- (U) => U.balance
468
+ (M) => M.id,
469
+ (M) => M.balance
470
470
  ), s = e.groupBy(
471
- (U) => U.id,
472
- (U) => U.balance
471
+ (M) => M.id,
472
+ (M) => M.balance
473
473
  ), u = /* @__PURE__ */ new Map();
474
474
  if (t.opening)
475
- for (const U of t.opening)
476
- u.set(U.skuId, U.balance);
475
+ for (const M of t.opening)
476
+ u.set(M.skuId, M.balance);
477
477
  const c = /* @__PURE__ */ new Set(), b = /* @__PURE__ */ new Map();
478
478
  if (t.adjustmentSnapshot)
479
- for (const U of t.adjustmentSnapshot)
480
- U.adjustmentsByType && (Object.keys(U.adjustmentsByType).forEach((f) => c.add(f)), b.set(U.skuId, U.adjustmentsByType));
479
+ for (const M of t.adjustmentSnapshot)
480
+ M.adjustmentsByType && (Object.keys(M.adjustmentsByType).forEach((f) => c.add(f)), b.set(M.skuId, M.adjustmentsByType));
481
481
  const g = ["receive", "sales", "wastage"], S = [];
482
- g.forEach((U) => {
483
- c.has(U) && (S.push(U), c.delete(U));
482
+ g.forEach((M) => {
483
+ c.has(M) && (S.push(M), c.delete(M));
484
484
  });
485
- const J = Array.from(c).sort(), E = [...S, ...J], B = [...t.items, ...t.negativeStockItems ?? []], P = po().currentBusiness.value, Z = zn(B, l), X = B.map((U) => {
485
+ const J = Array.from(c).sort(), E = [...S, ...J], B = [...t.items, ...t.negativeStockItems ?? []], P = mo().currentBusiness.value, Z = Gn(B, l), X = B.map((M) => {
486
486
  var de, j;
487
- const f = ((de = r.get(U.sku._id)) == null ? void 0 : de[0]) ?? En, y = Z.get(U.sku._id) ?? [], N = u.get(U.sku._id), Y = b.get(U.sku._id);
488
- return On(
489
- U,
487
+ const f = ((de = r.get(M.sku._id)) == null ? void 0 : de[0]) ?? Vn, y = Z.get(M.sku._id) ?? [], U = u.get(M.sku._id), Y = b.get(M.sku._id);
488
+ return Ln(
489
+ M,
490
490
  f,
491
491
  y,
492
- (j = s.get(U.sku._id)) == null ? void 0 : j[0],
493
- N,
492
+ (j = s.get(M.sku._id)) == null ? void 0 : j[0],
493
+ U,
494
494
  Y,
495
495
  E,
496
496
  n
497
497
  );
498
- }), z = Gn(Z), F = Hn(z, E, n), T = [
498
+ }), z = On(Z), F = zn(z, E, n), T = [
499
499
  ["Business name:", P == null ? void 0 : P.name],
500
500
  ["Business ID:", P == null ? void 0 : P._id],
501
501
  ["Menu version", P == null ? void 0 : P.menuVersion],
@@ -506,7 +506,7 @@ function Yn(t, o, e, n = [], l) {
506
506
  ["Recent action", t.approvedAt ? "Approve" : t.rejectionHistory ? "Reject" : ""],
507
507
  [
508
508
  "Action by",
509
- t.approvedAt ? ($ = t.approvedBy) == null ? void 0 : $.name : t.rejectionHistory ? (M = (L = t.rejectionHistory[0]) == null ? void 0 : L.rejectedBy) == null ? void 0 : M.name : ""
509
+ t.approvedAt ? ($ = t.approvedBy) == null ? void 0 : $.name : t.rejectionHistory ? (N = (L = t.rejectionHistory[0]) == null ? void 0 : L.rejectedBy) == null ? void 0 : N.name : ""
510
510
  ],
511
511
  [
512
512
  "Action at",
@@ -517,15 +517,15 @@ function Yn(t, o, e, n = [], l) {
517
517
  t.approvedAt ? t.approveRemark : t.rejectionHistory ? new Date((oe = t.rejectionHistory[0]) == null ? void 0 : oe.rejectRemark) : ""
518
518
  ],
519
519
  [],
520
- F.map((U) => U.name),
521
- ...X.map((U) => F.map((f) => U[f.id]))
522
- ], k = F.map((U) => `system:${U.id}`), x = vn(T, k), w = `[${P == null ? void 0 : P.name}] closing draft (${mn(new Date(t.updatedAt))}).xlsx`;
523
- return gn(x, w), w;
520
+ F.map((M) => M.name),
521
+ ...X.map((M) => F.map((f) => M[f.id]))
522
+ ], k = F.map((M) => `system:${M.id}`), x = fn(T, k), w = `[${P == null ? void 0 : P.name}] closing draft (${dn(new Date(t.updatedAt))}).xlsx`;
523
+ return vn(x, w), w;
524
524
  }
525
- const Wn = { class: "flex flex-col" }, Kn = {
525
+ const Yn = { class: "flex flex-col" }, Wn = {
526
526
  key: 0,
527
527
  class: "fm-typo-en-body-sm-400 text-fm-color-typo-error mt-4"
528
- }, qn = { class: "flex gap-12 py-8 justify-end w-full" }, Qn = /* @__PURE__ */ De({
528
+ }, Kn = { class: "flex gap-12 py-8 justify-end w-full" }, qn = /* @__PURE__ */ De({
529
529
  __name: "RefreshBalanceAction",
530
530
  props: {
531
531
  draft: {},
@@ -534,9 +534,9 @@ const Wn = { class: "flex flex-col" }, Kn = {
534
534
  },
535
535
  setup(t) {
536
536
  const o = t;
537
- kt();
537
+ _t();
538
538
  const e = q(!1), n = q(null), l = q(!1);
539
- mo(() => {
539
+ uo(() => {
540
540
  if (o.draft.effectiveAt)
541
541
  n.value = new Date(o.draft.effectiveAt);
542
542
  else {
@@ -558,7 +558,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
558
558
  }
559
559
  }), s = C({
560
560
  get() {
561
- return n.value === null ? "" : yo(n.value);
561
+ return n.value === null ? "" : go(n.value);
562
562
  },
563
563
  set(b) {
564
564
  if (b) {
@@ -573,7 +573,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
573
573
  }
574
574
  return (b, g) => {
575
575
  const S = te("FmLabel"), J = te("FmDatePicker"), E = te("FmTimePicker"), B = te("FmButton"), I = te("FmForm");
576
- return l.value ? (p(), ne(I, {
576
+ return l.value ? (p(), ae(I, {
577
577
  key: 1,
578
578
  onValidationSuccess: c,
579
579
  class: "flex flex-col gap-32",
@@ -592,7 +592,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
592
592
  ge(" the effective date and time. ")
593
593
  ])
594
594
  ], -1)),
595
- a("div", Wn, [
595
+ a("div", Yn, [
596
596
  h(S, { class: "fm-typo-en-body-lg-600" }, {
597
597
  default: ee(() => g[3] || (g[3] = [
598
598
  ge("Closing Date")
@@ -614,9 +614,9 @@ const Wn = { class: "flex flex-col" }, Kn = {
614
614
  modelValue: s.value,
615
615
  "onUpdate:modelValue": g[1] || (g[1] = (P) => s.value = P)
616
616
  }, null, 8, ["modelValue"]),
617
- u.value ? (p(), A("div", Kn, " Cannot select future date ")) : H("", !0)
617
+ u.value ? (p(), A("div", Wn, " Cannot select future date ")) : H("", !0)
618
618
  ]),
619
- a("div", qn, [
619
+ a("div", Kn, [
620
620
  h(B, {
621
621
  label: "Cancel",
622
622
  variant: "tertiary",
@@ -638,10 +638,10 @@ const Wn = { class: "flex flex-col" }, Kn = {
638
638
  ], 64));
639
639
  };
640
640
  }
641
- }), bt = go(
641
+ }), yt = vo(
642
642
  "closingDraftActions",
643
643
  function() {
644
- const o = fo(), e = Ne(), n = kt(), l = Oe(), r = hn(), s = Pt(), u = q(!1), c = q();
644
+ const o = po(), e = Ue(), n = _t(), l = Oe(), r = bn(), s = Ut(), u = q(!1), c = q();
645
645
  async function b(F, T) {
646
646
  const k = await l.getDraftDetail(F, T), x = {
647
647
  draft: k
@@ -673,7 +673,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
673
673
  T || (e.open({
674
674
  title: "Exporting",
675
675
  message: "Fetching data..."
676
- }), T = await g(F)), Yn(
676
+ }), T = await g(F)), Hn(
677
677
  F,
678
678
  T,
679
679
  k ?? [],
@@ -684,7 +684,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
684
684
  function J(F, T, k) {
685
685
  o.open({
686
686
  title: "Approve draft",
687
- contentComponent: jt,
687
+ contentComponent: Tt,
688
688
  contentComponentProps: {
689
689
  draft: F,
690
690
  action: fe.enum.approveDraft,
@@ -702,7 +702,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
702
702
  function E(F, T) {
703
703
  o.open({
704
704
  title: "Reject draft",
705
- contentComponent: jt,
705
+ contentComponent: Tt,
706
706
  contentComponentProps: {
707
707
  draft: F,
708
708
  action: fe.enum.rejectDraft,
@@ -716,7 +716,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
716
716
  function B(F, T) {
717
717
  o.open({
718
718
  title: "Mark draft as failed",
719
- contentComponent: jt,
719
+ contentComponent: Tt,
720
720
  contentComponentProps: {
721
721
  draft: F,
722
722
  action: fe.enum.markAsFailed,
@@ -747,7 +747,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
747
747
  async function Z(F, T, k) {
748
748
  await o.open({
749
749
  title: "Refresh balance",
750
- contentComponent: Qn,
750
+ contentComponent: qn,
751
751
  contentComponentProps: {
752
752
  draft: F,
753
753
  onFinished: (x) => {
@@ -807,7 +807,7 @@ const Wn = { class: "flex flex-col" }, Kn = {
807
807
  };
808
808
  }
809
809
  );
810
- function Ue(t) {
810
+ function Me(t) {
811
811
  switch (t) {
812
812
  case "DRAFT":
813
813
  return "fm-status-badge-draft";
@@ -821,7 +821,7 @@ function Ue(t) {
821
821
  return "fm-status-badge-processing";
822
822
  }
823
823
  }
824
- function Vt(t) {
824
+ function Pt(t) {
825
825
  var n, l;
826
826
  if (t.status !== "DRAFT") return t.status;
827
827
  const o = (l = (n = t.rejectionHistory) == null ? void 0 : n[0]) == null ? void 0 : l.rejectedAt;
@@ -829,38 +829,38 @@ function Vt(t) {
829
829
  const e = t.updatedAt ? new Date(t.updatedAt) : null;
830
830
  return !e || new Date(o).getTime() > e.getTime() ? "REJECTED" : "UPDATED";
831
831
  }
832
- function Jn(t) {
832
+ function Qn(t) {
833
833
  return t.baseAmount.amount > 0 ? !0 : t.measurementsAmounts.some((o) => o.amount.amount !== 0);
834
834
  }
835
- function Zn(t) {
835
+ function Jn(t) {
836
836
  var l, r, s;
837
- const o = Number(se.toFormatString({ value: wt(t) })), e = Number(
838
- se.toFormatString({
837
+ const o = Number(ne.toFormatString({ value: kt(t) })), e = Number(
838
+ ne.toFormatString({
839
839
  value: ((l = t.sku.defaultCost) == null ? void 0 : l.costPerUnit) ?? { amount: 0, precision: 0 }
840
840
  })
841
841
  ), n = Number(
842
- se.toFormatString({
842
+ ne.toFormatString({
843
843
  value: ((s = (r = t.sku.defaultCost) == null ? void 0 : r.measurement) == null ? void 0 : s.conversion) ?? { amount: 1, precision: 0 }
844
844
  })
845
845
  );
846
846
  return o * e / n;
847
847
  }
848
- function xt(t) {
848
+ function wt(t) {
849
849
  var o, e;
850
850
  return ((e = (o = t.usingTemplates) == null ? void 0 : o[0]) == null ? void 0 : e.name) || "Group";
851
851
  }
852
- function Xn(t) {
852
+ function Zn(t) {
853
853
  var e;
854
854
  const o = (e = t.usingTemplates) == null ? void 0 : e[0];
855
- return o != null && o.ref ? o.ref : xt(t).replace(/[^a-z0-9]/gi, "").slice(0, 6).toUpperCase() || "GROUP";
855
+ return o != null && o.ref ? o.ref : wt(t).replace(/[^a-z0-9]/gi, "").slice(0, 6).toUpperCase() || "GROUP";
856
856
  }
857
- function Rt(t) {
857
+ function jt(t) {
858
858
  var r, s, u;
859
- const o = [...t.items, ...t.negativeStockItems ?? []], e = o.filter(Jn).length, n = o.reduce((c, b) => c + Zn(b), 0), l = ((r = t.updatedBy) == null ? void 0 : r.name) || ((s = t.createdBy) == null ? void 0 : s.name) || void 0;
859
+ const o = [...t.items, ...t.negativeStockItems ?? []], e = o.filter(Qn).length, n = o.reduce((c, b) => c + Jn(b), 0), l = ((r = t.updatedBy) == null ? void 0 : r.name) || ((s = t.createdBy) == null ? void 0 : s.name) || void 0;
860
860
  return {
861
861
  id: t._id,
862
- name: xt(t),
863
- code: Xn(t),
862
+ name: wt(t),
863
+ code: Zn(t),
864
864
  status: t.status,
865
865
  rejectionHistory: t.rejectionHistory,
866
866
  itemCount: o.length,
@@ -872,11 +872,11 @@ function Rt(t) {
872
872
  updatedAt: t.updatedAt || t.createdAt
873
873
  };
874
874
  }
875
- function ea(t) {
875
+ function Xn(t) {
876
876
  return t.reduce(
877
877
  (o, e) => {
878
878
  o.totalItems += e.itemCount, o.totalAmount += e.totalAmount;
879
- const n = Vt(e);
879
+ const n = Pt(e);
880
880
  return n === "COMPLETED" ? o.completed++ : n === "REJECTED" ? o.rejected++ : o.draft++, o;
881
881
  },
882
882
  {
@@ -889,11 +889,11 @@ function ea(t) {
889
889
  }
890
890
  );
891
891
  }
892
- const xo = go(
892
+ const wo = vo(
893
893
  "closingDraftTable",
894
894
  function() {
895
- var U;
896
- const { t: o } = tt(), e = po(), n = bt(), l = q(new Array()), r = q(0), s = q(!1), u = qe(), c = Oe(), b = Ne();
895
+ var M;
896
+ const { t: o } = et(), e = mo(), n = yt(), l = q(new Array()), r = q(0), s = q(!1), u = qe(), c = Oe(), b = Ue();
897
897
  function g(f) {
898
898
  console.error("Row action failed:", f), b.open({
899
899
  title: o("inventory.common.somethingWentWrong"),
@@ -901,8 +901,8 @@ const xo = go(
901
901
  type: "error"
902
902
  });
903
903
  }
904
- let S = {}, J = (U = u._currentLocation) == null ? void 0 : U.dbName;
905
- const E = 6, B = q(wn());
904
+ let S = {}, J = (M = u._currentLocation) == null ? void 0 : M.dbName;
905
+ const E = 6, B = q(kn());
906
906
  function I(f) {
907
907
  const y = new Date(f.endDate);
908
908
  return y.setMonth(y.getMonth() - E), new Date(f.startDate) < y ? { startDate: Ke(y), endDate: f.endDate } : f;
@@ -934,9 +934,9 @@ const xo = go(
934
934
  const [y] = await Promise.all([
935
935
  c.getDraft(f),
936
936
  new Promise((Y) => setTimeout(Y, 1e3))
937
- ]), { toClosingDraftListItem: N } = await import("./index-zCBA-X6R.js");
937
+ ]), { toClosingDraftListItem: U } = await import("./index-BV9b3Ulp.js");
938
938
  l.value = k([
939
- N(y)
939
+ U(y)
940
940
  ]), x(f);
941
941
  } catch (y) {
942
942
  console.log("Something went wrong when fetching drafts:", y);
@@ -947,50 +947,50 @@ const xo = go(
947
947
  }
948
948
  function k(f) {
949
949
  for (const Y of f) S[Y._id] = Y;
950
- const y = Object.values(S), N = xn(
950
+ const y = Object.values(S), U = wn(
951
951
  y.filter((Y) => !!Y.closingId).map((Y) => ({ closingId: Y.closingId, draftCreatedAt: new Date(Le(Y._id)) }))
952
952
  );
953
953
  return f.map((Y) => ({
954
954
  ...Y,
955
- closingIdDisplay: Y.closingId ? N.get(Y.closingId) ?? null : null
955
+ closingIdDisplay: Y.closingId ? U.get(Y.closingId) ?? null : null
956
956
  }));
957
957
  }
958
958
  async function x(f) {
959
959
  try {
960
- const N = (await c.getClosingGroups(f)).map(Rt);
961
- l.value = l.value.map((Y) => Y._id === f ? { ...Y, groups: N } : Y);
960
+ const U = (await c.getClosingGroups(f)).map(jt);
961
+ l.value = l.value.map((Y) => Y._id === f ? { ...Y, groups: U } : Y);
962
962
  } catch (y) {
963
963
  console.log(`Something went wrong when refreshing groups for ${f}:`, y);
964
964
  }
965
965
  }
966
966
  async function w(f, y) {
967
- const { toClosingDraftListItem: N } = await import("./index-zCBA-X6R.js");
967
+ const { toClosingDraftListItem: U } = await import("./index-BV9b3Ulp.js");
968
968
  return {
969
- ...N(
969
+ ...U(
970
970
  f
971
971
  ),
972
972
  _rev: f._rev,
973
973
  closingIdDisplay: y.closingIdDisplay,
974
974
  groups: (f.groups ?? []).map(
975
- (Y) => Rt(Y)
975
+ (Y) => jt(Y)
976
976
  )
977
977
  };
978
978
  }
979
979
  async function re(f) {
980
- const { toClosingDraftListItem: y } = await import("./index-zCBA-X6R.js");
981
- l.value = l.value.map((N) => N._id === f._id ? {
980
+ const { toClosingDraftListItem: y } = await import("./index-BV9b3Ulp.js");
981
+ l.value = l.value.map((U) => U._id === f._id ? {
982
982
  ...y(f),
983
983
  _rev: f._rev,
984
- closingIdDisplay: N.closingIdDisplay,
984
+ closingIdDisplay: U.closingIdDisplay,
985
985
  // The full doc carries no groups; keep the row's embedded
986
986
  // summaries until refreshDraftGroups below replaces them.
987
- groups: N.groups
988
- } : N), x(f._id);
987
+ groups: U.groups
988
+ } : U), x(f._id);
989
989
  }
990
990
  function _(f) {
991
991
  var Y;
992
- const y = f.itemCount + f.negativeStockItemCount, N = (f == null ? void 0 : f.approveRemark) ?? ((Y = f == null ? void 0 : f.rejectionHistory) == null ? void 0 : Y.computeFirst((de) => de.rejectRemark)) ?? f.remark ?? "";
993
- return { count: y, remark: N };
992
+ const y = f.itemCount + f.negativeStockItemCount, U = (f == null ? void 0 : f.approveRemark) ?? ((Y = f == null ? void 0 : f.rejectionHistory) == null ? void 0 : Y.computeFirst((de) => de.rejectRemark)) ?? f.remark ?? "";
993
+ return { count: y, remark: U };
994
994
  }
995
995
  function $(f, y = "") {
996
996
  return D(
@@ -1007,9 +1007,9 @@ const xo = go(
1007
1007
  function L(f) {
1008
1008
  if (!f.length) return null;
1009
1009
  const y = f.reduce(
1010
- (N, Y) => {
1011
- const de = Vt(Y);
1012
- return de === "COMPLETED" ? N.completed++ : de === "REJECTED" ? N.rejected++ : N.draft++, N;
1010
+ (U, Y) => {
1011
+ const de = Pt(Y);
1012
+ return de === "COMPLETED" ? U.completed++ : de === "REJECTED" ? U.rejected++ : U.draft++, U;
1013
1013
  },
1014
1014
  { completed: 0, draft: 0, rejected: 0 }
1015
1015
  );
@@ -1020,11 +1020,11 @@ const xo = go(
1020
1020
  y.rejected ? $(`${y.rejected} rejected`, "text-fm-color-typo-error") : null
1021
1021
  ]);
1022
1022
  }
1023
- function M() {
1023
+ function N() {
1024
1024
  n.closeDraftDialog(), z();
1025
1025
  }
1026
1026
  async function ve(f, y) {
1027
- switch (y = ln(y), f) {
1027
+ switch (y = rn(y), f) {
1028
1028
  case He.Details:
1029
1029
  return n.viewDraft(y._id).then(
1030
1030
  () => {
@@ -1032,15 +1032,15 @@ const xo = go(
1032
1032
  g
1033
1033
  );
1034
1034
  case He.Export:
1035
- return c.getDraft(y._id).then((N) => n.exportDraft(N)).catch(g);
1035
+ return c.getDraft(y._id).then((U) => n.exportDraft(U)).catch(g);
1036
1036
  case fe.enum.approveDraft:
1037
- return n.approveDraft(y, M);
1037
+ return n.approveDraft(y, N);
1038
1038
  case fe.enum.rejectDraft:
1039
- return n.rejectDraft(y, M);
1039
+ return n.rejectDraft(y, N);
1040
1040
  case fe.enum.markAsFailed:
1041
- return n.markAsFailed(y, M);
1041
+ return n.markAsFailed(y, N);
1042
1042
  case He.Duplicate:
1043
- return n.cloneDraft(y, M);
1043
+ return n.cloneDraft(y, N);
1044
1044
  }
1045
1045
  }
1046
1046
  return {
@@ -1050,7 +1050,7 @@ const xo = go(
1050
1050
  accessorKey: "_id",
1051
1051
  header: () => o("inventory.closing.table.createdAt"),
1052
1052
  cell(f) {
1053
- return kn(`${f.getValue()}`);
1053
+ return _n(`${f.getValue()}`);
1054
1054
  },
1055
1055
  sortingFn: (f, y) => new Date(Le(f.original._id)).getTime() - new Date(Le(y.original._id)).getTime(),
1056
1056
  enableSorting: !0
@@ -1070,8 +1070,8 @@ const xo = go(
1070
1070
  header: () => o("inventory.closing.draft.table.effectiveAt"),
1071
1071
  cell(f) {
1072
1072
  const y = f.row.original;
1073
- let N = f.getValue();
1074
- return N || (N = Le(y._id)), Fe(N);
1073
+ let U = f.getValue();
1074
+ return U || (U = Le(y._id)), Fe(U);
1075
1075
  },
1076
1076
  enableSorting: !0,
1077
1077
  size: 230
@@ -1079,14 +1079,14 @@ const xo = go(
1079
1079
  {
1080
1080
  id: "description",
1081
1081
  accessorFn: (f) => {
1082
- const { count: y, remark: N } = _(f);
1083
- return `${y} ${N}`;
1082
+ const { count: y, remark: U } = _(f);
1083
+ return `${y} ${U}`;
1084
1084
  },
1085
1085
  header: () => o("inventory.closing.draft.table.description"),
1086
1086
  enableSorting: !0,
1087
1087
  size: 350,
1088
1088
  cell(f) {
1089
- const { count: y, remark: N } = _(f.row.original), Y = f.row.original.groups ?? [], de = (j, G) => D("div", { class: "flex gap-4" }, [
1089
+ const { count: y, remark: U } = _(f.row.original), Y = f.row.original.groups ?? [], de = (j, G) => D("div", { class: "flex gap-4" }, [
1090
1090
  D(
1091
1091
  "span",
1092
1092
  { class: "fm-typo-en-body-sm-600 text-fm-color-typo-primary" },
@@ -1103,7 +1103,7 @@ const xo = go(
1103
1103
  ]);
1104
1104
  return D("div", { class: "flex flex-col gap-2", style: "width: 300px;" }, [
1105
1105
  de(o("inventory.closing.draft.table.items"), y),
1106
- N ? de(o("inventory.closing.draft.table.remark"), N) : null,
1106
+ U ? de(o("inventory.closing.draft.table.remark"), U) : null,
1107
1107
  L(Y)
1108
1108
  ]);
1109
1109
  }
@@ -1115,8 +1115,8 @@ const xo = go(
1115
1115
  enableSorting: !1,
1116
1116
  cell(f) {
1117
1117
  var G;
1118
- const y = f.row.original, N = y.status, Y = new Date(y.updatedAt), de = (G = y == null ? void 0 : y.rejectionHistory) == null ? void 0 : G.computeFirst((ie) => ie.rejectedAt), j = de ? new Date(de) : null;
1119
- return N === "DRAFT" && j ? j.getTime() > Y.getTime() ? D(
1118
+ const y = f.row.original, U = y.status, Y = new Date(y.updatedAt), de = (G = y == null ? void 0 : y.rejectionHistory) == null ? void 0 : G.computeFirst((ie) => ie.rejectedAt), j = de ? new Date(de) : null;
1119
+ return U === "DRAFT" && j ? j.getTime() > Y.getTime() ? D(
1120
1120
  "div",
1121
1121
  {
1122
1122
  class: "flex"
@@ -1124,7 +1124,7 @@ const xo = go(
1124
1124
  D(
1125
1125
  "div",
1126
1126
  {
1127
- class: ["fm-status-badge", Ue("FAILED")]
1127
+ class: ["fm-status-badge", Me("FAILED")]
1128
1128
  },
1129
1129
  "Rejected"
1130
1130
  )
@@ -1136,7 +1136,7 @@ const xo = go(
1136
1136
  D(
1137
1137
  "div",
1138
1138
  {
1139
- class: ["fm-status-badge", Ue("PROCESSING")]
1139
+ class: ["fm-status-badge", Me("PROCESSING")]
1140
1140
  },
1141
1141
  "Updated"
1142
1142
  )
@@ -1148,9 +1148,9 @@ const xo = go(
1148
1148
  D(
1149
1149
  "div",
1150
1150
  {
1151
- class: ["fm-status-badge", Ue(N)]
1151
+ class: ["fm-status-badge", Me(U)]
1152
1152
  },
1153
- Ie(N)
1153
+ Ie(U)
1154
1154
  )
1155
1155
  );
1156
1156
  }
@@ -1162,13 +1162,13 @@ const xo = go(
1162
1162
  enableSorting: !0,
1163
1163
  size: 200,
1164
1164
  cell(f) {
1165
- var N;
1165
+ var U;
1166
1166
  const y = f.row.original;
1167
1167
  return D("div", { class: "flex flex-col" }, [
1168
1168
  D(
1169
1169
  "div",
1170
1170
  { class: "fm-typo-en-body-md-600 text-fm-color-typo-primary" },
1171
- ((N = y.updatedBy) == null ? void 0 : N.name) ?? ""
1171
+ ((U = y.updatedBy) == null ? void 0 : U.name) ?? ""
1172
1172
  ),
1173
1173
  D(
1174
1174
  "div",
@@ -1182,9 +1182,9 @@ const xo = go(
1182
1182
  id: "action",
1183
1183
  cell(f) {
1184
1184
  var G;
1185
- const y = f.row.original, N = ((G = e.sessionUser.value) == null ? void 0 : G.role.isAdmin) ?? !1, Y = [
1186
- co[He.Details],
1187
- co[He.Export]
1185
+ const y = f.row.original, U = ((G = e.sessionUser.value) == null ? void 0 : G.role.isAdmin) ?? !1, Y = [
1186
+ io[He.Details],
1187
+ io[He.Export]
1188
1188
  ], de = [
1189
1189
  {
1190
1190
  translationKey: "inventory.closing.draft.approveDraft",
@@ -1201,14 +1201,14 @@ const xo = go(
1201
1201
  color: "text-fm-color-typo-error",
1202
1202
  value: fe.enum.markAsFailed
1203
1203
  }
1204
- ], j = N && y.status !== xe.enum.DRAFT ? [
1204
+ ], j = U && y.status !== xe.enum.DRAFT ? [
1205
1205
  {
1206
1206
  translationKey: "inventory.closing.draft.cloneDraft",
1207
1207
  color: "text-fm-color-typo-primary",
1208
1208
  value: He.Duplicate
1209
1209
  }
1210
1210
  ] : [];
1211
- return _n(
1211
+ return hn(
1212
1212
  [
1213
1213
  ...Y,
1214
1214
  ...y.status === xe.enum.DRAFT ? de : []
@@ -1241,7 +1241,7 @@ const xo = go(
1241
1241
  };
1242
1242
  }
1243
1243
  );
1244
- function ta(t) {
1244
+ function ea(t) {
1245
1245
  const o = /* @__PURE__ */ new Map();
1246
1246
  for (const e of t)
1247
1247
  for (const n of e) {
@@ -1257,12 +1257,12 @@ function ta(t) {
1257
1257
  });
1258
1258
  continue;
1259
1259
  }
1260
- l.baseAmount = et(l.baseAmount, n.baseAmount);
1260
+ l.baseAmount = Xe(l.baseAmount, n.baseAmount);
1261
1261
  for (const r of n.measurementsAmounts) {
1262
1262
  const s = l.measurementsAmounts.findIndex(
1263
1263
  (u) => u.measurement.id === r.measurement.id
1264
1264
  );
1265
- s > -1 ? l.measurementsAmounts[s].amount = et(
1265
+ s > -1 ? l.measurementsAmounts[s].amount = Xe(
1266
1266
  l.measurementsAmounts[s].amount,
1267
1267
  r.amount
1268
1268
  ) : l.measurementsAmounts.push({ ...r, amount: { ...r.amount } });
@@ -1270,25 +1270,25 @@ function ta(t) {
1270
1270
  }
1271
1271
  return [...o.values()];
1272
1272
  }
1273
- const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, sa = { key: 0 }, ra = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full mb-4" }, la = {
1273
+ const ta = { class: "fm-typo-en-heading-lg-600" }, oa = { class: "py-4" }, na = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, aa = { key: 0 }, sa = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full mb-4" }, ra = {
1274
1274
  key: 0,
1275
1275
  class: "text-fm-color-system-success-300"
1276
- }, ia = {
1276
+ }, la = {
1277
1277
  key: 1,
1278
1278
  class: "text-fm-color-system-error-300"
1279
- }, ca = { class: "fm-typo-en-body-md-400" }, ua = { class: "mt-4 flex gap-4" }, da = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, ma = { key: 0 }, pa = { class: "mt-4 flex gap-4" }, fa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, va = { key: 0 }, ga = {
1279
+ }, ia = { class: "fm-typo-en-body-md-400" }, ca = { class: "mt-4 flex gap-4" }, ua = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, da = { key: 0 }, ma = { class: "mt-4 flex gap-4" }, pa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, fa = { key: 0 }, va = {
1280
1280
  key: 0,
1281
1281
  class: "mb-4"
1282
- }, ya = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full" }, ba = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ha = {
1282
+ }, ga = { class: "flex flex-col gap-1 max-h-200 overflow-auto w-full" }, ya = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ba = {
1283
1283
  key: 0,
1284
1284
  class: "text-fm-color-system-success-300 mr-1"
1285
- }, _a = {
1285
+ }, ha = {
1286
1286
  key: 1,
1287
1287
  class: "text-fm-color-system-error-300 mr-1"
1288
- }, ka = { class: "fm-typo-en-body-md-400" }, wa = { class: "mt-4 flex gap-4" }, xa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, Da = {
1288
+ }, _a = { class: "fm-typo-en-body-md-400" }, ka = { class: "mt-4 flex gap-4" }, wa = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary mb-4" }, xa = {
1289
1289
  key: 0,
1290
1290
  class: "flex gap-4"
1291
- }, Aa = { class: "fm-typo-en-heading-lg-600" }, $a = { class: "py-4 flex flex-col gap-4" }, Ca = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Sa = { class: "flex gap-4 justify-end" }, Ze = 1, Ye = 2, We = 3, Ee = 4, Fa = /* @__PURE__ */ De({
1291
+ }, Da = { class: "fm-typo-en-heading-lg-600" }, Aa = { class: "py-4 flex flex-col gap-4" }, $a = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ca = { class: "flex gap-4 justify-end" }, Ze = 1, Ye = 2, We = 3, Ee = 4, Sa = /* @__PURE__ */ De({
1292
1292
  __name: "ClosingDraftApprovalDialog",
1293
1293
  props: {
1294
1294
  show: { type: Boolean },
@@ -1300,7 +1300,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1300
1300
  },
1301
1301
  emits: ["update:show", "refresh", "approve", "approve-all-groups"],
1302
1302
  setup(t, { emit: o }) {
1303
- const { FmStepper: e, FmStep: n, FmDialog: l, FmButton: r } = be, { t: s } = $n(), u = Ut(), c = t, b = o, g = q(!1);
1303
+ const { FmStepper: e, FmStep: n, FmDialog: l, FmButton: r } = be, { t: s } = An(), u = Nt(), c = t, b = o, g = q(!1);
1304
1304
  function S() {
1305
1305
  g.value = !0;
1306
1306
  }
@@ -1313,12 +1313,12 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1313
1313
  return ((j = c.draft) == null ? void 0 : j.stockSnapshot) && ((G = c.draft) == null ? void 0 : G.stockSnapshot) !== void 0;
1314
1314
  }
1315
1315
  ), B = C(() => {
1316
- var ie, ae, Ae;
1316
+ var ie, se, Ae;
1317
1317
  const j = ((ie = c.draft) == null ? void 0 : ie.items.map((_e) => ({
1318
1318
  id: _e.sku._id,
1319
1319
  code: _e.sku.code,
1320
1320
  name: _e.sku.name
1321
- }))) ?? [], G = ((Ae = (ae = c.draft) == null ? void 0 : ae.negativeStockItems) == null ? void 0 : Ae.map((_e) => ({
1321
+ }))) ?? [], G = ((Ae = (se = c.draft) == null ? void 0 : se.negativeStockItems) == null ? void 0 : Ae.map((_e) => ({
1322
1322
  id: _e.sku._id,
1323
1323
  code: _e.sku.code,
1324
1324
  name: _e.sku.name
@@ -1330,14 +1330,14 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1330
1330
  }), I = C(
1331
1331
  () => {
1332
1332
  var j, G, ie;
1333
- return (((ie = (G = (j = c.draft) == null ? void 0 : j.stockSnapshot) == null ? void 0 : G.filter((ae) => ae.balance.amount < 0)) == null ? void 0 : ie.map((ae) => {
1334
- const Ae = u.skuById[ae.id];
1333
+ return (((ie = (G = (j = c.draft) == null ? void 0 : j.stockSnapshot) == null ? void 0 : G.filter((se) => se.balance.amount < 0)) == null ? void 0 : ie.map((se) => {
1334
+ const Ae = u.skuById[se.id];
1335
1335
  return Ae ? {
1336
1336
  id: Ae._id,
1337
1337
  code: Ae.code,
1338
1338
  name: Ae.name
1339
1339
  } : null;
1340
- })) ?? []).filter((ae) => ae !== null);
1340
+ })) ?? []).filter((se) => se !== null);
1341
1341
  }
1342
1342
  ), P = C(() => {
1343
1343
  var j;
@@ -1365,25 +1365,25 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1365
1365
  return j === Ze ? !X.value : j === Ye ? E.value : j === We ? P.value.length == 0 : !1;
1366
1366
  }
1367
1367
  const L = C(() => !E.value || P.value.length > 0 || X.value && !F.value);
1368
- function M() {
1368
+ function N() {
1369
1369
  let j = 1;
1370
1370
  for (; j < Ee && $(j); ) j++;
1371
1371
  return j;
1372
1372
  }
1373
- const ve = C(() => k.value > M());
1373
+ const ve = C(() => k.value > N());
1374
1374
  function oe(j) {
1375
1375
  let G = j + 1;
1376
1376
  for (; G <= Ee && $(G); ) G++;
1377
1377
  return G > Ee ? Ee : G;
1378
1378
  }
1379
- function U(j) {
1379
+ function M(j) {
1380
1380
  let G = j - 1;
1381
1381
  for (; G >= 1 && $(G); ) G--;
1382
- const ie = M();
1382
+ const ie = N();
1383
1383
  return G < ie ? ie : G;
1384
1384
  }
1385
1385
  function f() {
1386
- return M();
1386
+ return N();
1387
1387
  }
1388
1388
  je(
1389
1389
  () => c.show,
@@ -1404,11 +1404,11 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1404
1404
  function y() {
1405
1405
  b("refresh");
1406
1406
  }
1407
- function N() {
1407
+ function U() {
1408
1408
  k.value < Ee && (k.value = oe(k.value));
1409
1409
  }
1410
1410
  function Y() {
1411
- k.value > 1 && (k.value = U(k.value));
1411
+ k.value > 1 && (k.value = M(k.value));
1412
1412
  }
1413
1413
  function de() {
1414
1414
  b("approve");
@@ -1418,50 +1418,50 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1418
1418
  return p(), A(le, null, [
1419
1419
  h(d(l), {
1420
1420
  modelValue: Z.value,
1421
- "onUpdate:modelValue": G[1] || (G[1] = (ae) => Z.value = ae),
1421
+ "onUpdate:modelValue": G[1] || (G[1] = (se) => Z.value = se),
1422
1422
  "max-width": 600
1423
1423
  }, {
1424
1424
  "dialog-header": ee(() => [
1425
- a("div", oa, R(d(s)("inventory.closing.approval.title")), 1)
1425
+ a("div", ta, R(d(s)("inventory.closing.approval.title")), 1)
1426
1426
  ]),
1427
1427
  default: ee(() => [
1428
- a("div", na, [
1428
+ a("div", oa, [
1429
1429
  h(d(e), {
1430
1430
  modelValue: k.value,
1431
- "onUpdate:modelValue": G[0] || (G[0] = (ae) => k.value = ae),
1431
+ "onUpdate:modelValue": G[0] || (G[0] = (se) => k.value = se),
1432
1432
  orientation: "vertical"
1433
1433
  }, {
1434
1434
  default: ee(() => [
1435
- X.value ? (p(), ne(d(n), {
1435
+ X.value ? (p(), ae(d(n), {
1436
1436
  key: 0,
1437
1437
  value: Ze,
1438
1438
  title: d(s)("inventory.closing.approval.step.groups.title"),
1439
1439
  complete: x
1440
1440
  }, {
1441
1441
  default: ee(() => [
1442
- a("div", aa, R(F.value ? d(s)("inventory.closing.approval.step.groups.completedMessage") : d(s)("inventory.closing.approval.step.groups.pendingMessage")), 1),
1443
- k.value === Ze ? (p(), A("div", sa, [
1444
- a("div", ra, [
1445
- (p(!0), A(le, null, he(j.groups ?? [], (ae) => (p(), A("div", {
1446
- key: ae._id,
1442
+ a("div", na, R(F.value ? d(s)("inventory.closing.approval.step.groups.completedMessage") : d(s)("inventory.closing.approval.step.groups.pendingMessage")), 1),
1443
+ k.value === Ze ? (p(), A("div", aa, [
1444
+ a("div", sa, [
1445
+ (p(!0), A(le, null, he(j.groups ?? [], (se) => (p(), A("div", {
1446
+ key: se._id,
1447
1447
  class: "flex gap-8 items-center"
1448
1448
  }, [
1449
- ae.status === d(xe).enum.COMPLETED ? (p(), A("span", la, [
1449
+ se.status === d(xe).enum.COMPLETED ? (p(), A("span", ra, [
1450
1450
  h(ie, {
1451
1451
  name: "check_circle",
1452
1452
  size: "sm"
1453
1453
  })
1454
- ])) : (p(), A("span", ia, [
1454
+ ])) : (p(), A("span", la, [
1455
1455
  h(ie, {
1456
1456
  name: "error",
1457
1457
  size: "sm"
1458
1458
  })
1459
1459
  ])),
1460
- a("div", ca, R(d(xt)(ae)), 1)
1460
+ a("div", ia, R(d(wt)(se)), 1)
1461
1461
  ]))), 128))
1462
1462
  ]),
1463
- a("div", ua, [
1464
- T.value ? (p(), ne(d(r), {
1463
+ a("div", ca, [
1464
+ T.value ? (p(), ae(d(r), {
1465
1465
  key: 0,
1466
1466
  label: d(s)("inventory.closing.approval.step.groups.approveAll"),
1467
1467
  variant: "secondary",
@@ -1474,7 +1474,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1474
1474
  label: d(s)("inventory.common.continue"),
1475
1475
  disabled: !F.value,
1476
1476
  "data-testid": "closing-draft-approve-continue",
1477
- onClick: N
1477
+ onClick: U
1478
1478
  }, null, 8, ["label", "disabled"])
1479
1479
  ])
1480
1480
  ])) : H("", !0)
@@ -1488,8 +1488,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1488
1488
  complete: w
1489
1489
  }, {
1490
1490
  default: ee(() => [
1491
- a("div", da, R(d(s)("inventory.closing.approval.step.generateReport.description")), 1),
1492
- k.value === Ye ? (p(), A("div", ma, [
1491
+ a("div", ua, R(d(s)("inventory.closing.approval.step.generateReport.description")), 1),
1492
+ k.value === Ye ? (p(), A("div", da, [
1493
1493
  h(d(r), {
1494
1494
  label: d(s)("inventory.stock.stock_balance.refreshBalance"),
1495
1495
  "prepend-icon": "refresh",
@@ -1499,8 +1499,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1499
1499
  "data-testid": "closing-draft-refresh-balance",
1500
1500
  onClick: y
1501
1501
  }, null, 8, ["label", "loading", "disabled"]),
1502
- a("div", pa, [
1503
- ve.value ? (p(), ne(d(r), {
1502
+ a("div", ma, [
1503
+ ve.value ? (p(), ae(d(r), {
1504
1504
  key: 0,
1505
1505
  label: d(s)("inventory.common.back"),
1506
1506
  variant: "secondary",
@@ -1510,7 +1510,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1510
1510
  label: d(s)("inventory.common.continue"),
1511
1511
  disabled: !E.value,
1512
1512
  "data-testid": "closing-draft-approve-continue",
1513
- onClick: N
1513
+ onClick: U
1514
1514
  }, null, 8, ["label", "disabled"])
1515
1515
  ])
1516
1516
  ])) : H("", !0)
@@ -1524,35 +1524,35 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1524
1524
  complete: re
1525
1525
  }, {
1526
1526
  default: ee(() => [
1527
- a("div", fa, R(I.value.length > 0 ? `${d(s)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${d(s)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${P.value.length})]` : d(s)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
1528
- k.value === We ? (p(), A("div", va, [
1529
- I.value.length > 0 ? (p(), A("div", ga, [
1527
+ a("div", pa, R(I.value.length > 0 ? `${d(s)("inventory.closing.approval.step.negativeItems.resolveMessage")} [${d(s)("inventory.closing.approval.step.negativeItems.itemsHeader")} (${P.value.length})]` : d(s)("inventory.closing.approval.step.negativeItems.noItemsMessage")), 1),
1528
+ k.value === We ? (p(), A("div", fa, [
1529
+ I.value.length > 0 ? (p(), A("div", va, [
1530
1530
  G[4] || (G[4] = a("div", { class: "fm-typo-en-body-md-600 mb-2" }, null, -1)),
1531
- a("div", ya, [
1532
- (p(!0), A(le, null, he(I.value, (ae) => (p(), A("div", {
1533
- key: ae.id,
1531
+ a("div", ga, [
1532
+ (p(!0), A(le, null, he(I.value, (se) => (p(), A("div", {
1533
+ key: se.id,
1534
1534
  class: "flex gap-8"
1535
1535
  }, [
1536
- a("div", ba, [
1537
- B.value[ae.id] ? (p(), A("span", ha, [
1536
+ a("div", ya, [
1537
+ B.value[se.id] ? (p(), A("span", ba, [
1538
1538
  h(ie, {
1539
1539
  name: "check_circle",
1540
1540
  size: "sm"
1541
1541
  })
1542
- ])) : (p(), A("span", _a, [
1542
+ ])) : (p(), A("span", ha, [
1543
1543
  h(ie, {
1544
1544
  name: "error",
1545
1545
  size: "sm"
1546
1546
  })
1547
1547
  ])),
1548
- ge(" " + R(ae.code), 1)
1548
+ ge(" " + R(se.code), 1)
1549
1549
  ]),
1550
- a("div", ka, R(ae.name), 1)
1550
+ a("div", _a, R(se.name), 1)
1551
1551
  ]))), 128))
1552
1552
  ])
1553
1553
  ])) : H("", !0),
1554
- a("div", wa, [
1555
- ve.value ? (p(), ne(d(r), {
1554
+ a("div", ka, [
1555
+ ve.value ? (p(), ae(d(r), {
1556
1556
  key: 0,
1557
1557
  label: d(s)("inventory.common.back"),
1558
1558
  variant: "secondary",
@@ -1562,7 +1562,7 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1562
1562
  label: d(s)("inventory.common.continue"),
1563
1563
  disabled: L.value,
1564
1564
  "data-testid": "closing-draft-approve-continue",
1565
- onClick: N
1565
+ onClick: U
1566
1566
  }, null, 8, ["label", "disabled"])
1567
1567
  ])
1568
1568
  ])) : H("", !0)
@@ -1576,9 +1576,9 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1576
1576
  complete: _
1577
1577
  }, {
1578
1578
  default: ee(() => [
1579
- a("div", xa, R(d(s)("inventory.closing.approval.step.approval.warning")), 1),
1580
- k.value === Ee ? (p(), A("div", Da, [
1581
- ve.value ? (p(), ne(d(r), {
1579
+ a("div", wa, R(d(s)("inventory.closing.approval.step.approval.warning")), 1),
1580
+ k.value === Ee ? (p(), A("div", xa, [
1581
+ ve.value ? (p(), ae(d(r), {
1582
1582
  key: 0,
1583
1583
  label: d(s)("inventory.common.back"),
1584
1584
  variant: "secondary",
@@ -1605,20 +1605,20 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1605
1605
  }, 8, ["modelValue"]),
1606
1606
  h(d(l), {
1607
1607
  modelValue: g.value,
1608
- "onUpdate:modelValue": G[3] || (G[3] = (ae) => g.value = ae),
1608
+ "onUpdate:modelValue": G[3] || (G[3] = (se) => g.value = se),
1609
1609
  "max-width": 480
1610
1610
  }, {
1611
1611
  "dialog-header": ee(() => [
1612
- a("div", Aa, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.title")), 1)
1612
+ a("div", Da, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.title")), 1)
1613
1613
  ]),
1614
1614
  default: ee(() => [
1615
- a("div", $a, [
1616
- a("div", Ca, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.warning")), 1),
1617
- a("div", Sa, [
1615
+ a("div", Aa, [
1616
+ a("div", $a, R(d(s)("inventory.closing.approval.step.groups.approveAllConfirm.warning")), 1),
1617
+ a("div", Ca, [
1618
1618
  h(d(r), {
1619
1619
  label: d(s)("inventory.common.cancel"),
1620
1620
  variant: "secondary",
1621
- onClick: G[2] || (G[2] = (ae) => g.value = !1)
1621
+ onClick: G[2] || (G[2] = (se) => g.value = !1)
1622
1622
  }, null, 8, ["label"]),
1623
1623
  h(d(r), {
1624
1624
  label: d(s)("inventory.closing.approval.step.groups.approveAllConfirm.confirm"),
@@ -1635,8 +1635,8 @@ const oa = { class: "fm-typo-en-heading-lg-600" }, na = { class: "py-4" }, aa =
1635
1635
  };
1636
1636
  }
1637
1637
  });
1638
- function Ia(t) {
1639
- const o = Oe(), e = Sn(), n = Ne(), { t: l } = tt(), r = q(!1), s = q(null);
1638
+ function Fa(t) {
1639
+ const o = Oe(), e = Cn(), n = Ue(), { t: l } = et(), r = q(!1), s = q(null);
1640
1640
  let u = !1, c = null, b = !1, g = !1;
1641
1641
  function S() {
1642
1642
  P();
@@ -1743,7 +1743,7 @@ function Ia(t) {
1743
1743
  ([z, F], [T, k]) => {
1744
1744
  g && (z === T && F === k || S());
1745
1745
  }
1746
- ), Zo(() => {
1746
+ ), Jo(() => {
1747
1747
  X();
1748
1748
  }), {
1749
1749
  refreshing: r,
@@ -1753,18 +1753,18 @@ function Ia(t) {
1753
1753
  cleanup: X
1754
1754
  };
1755
1755
  }
1756
- function Ba(t) {
1757
- const o = Vt(t);
1758
- return o === "REJECTED" ? { label: "Rejected", className: Ue("FAILED") } : o === "UPDATED" ? { label: "Updated", className: Ue("PROCESSING") } : { label: Ie(o), className: Ue(o) };
1756
+ function Ia(t) {
1757
+ const o = Pt(t);
1758
+ return o === "REJECTED" ? { label: "Rejected", className: Me("FAILED") } : o === "UPDATED" ? { label: "Updated", className: Me("PROCESSING") } : { label: Ie(o), className: Me(o) };
1759
1759
  }
1760
- const Ta = { class: "flex items-start justify-between gap-8" }, ja = { class: "flex items-center gap-8 min-w-0" }, Ra = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary truncate" }, Ma = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Ua = { class: "fm-typo-en-body-md-600" }, Na = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, Pa = /* @__PURE__ */ De({
1760
+ const Ba = { class: "flex items-start justify-between gap-8" }, Ta = { class: "flex items-center gap-8 min-w-0" }, ja = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary truncate" }, Ra = { class: "fm-typo-en-body-md-400 text-fm-color-typo-primary" }, Na = { class: "fm-typo-en-body-md-600" }, Ma = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-tertiary" }, Ua = /* @__PURE__ */ De({
1761
1761
  __name: "ClosingGroupCard",
1762
1762
  props: {
1763
1763
  group: {}
1764
1764
  },
1765
1765
  emits: ["select"],
1766
1766
  setup(t, { emit: o }) {
1767
- const e = t, n = o, l = C(() => Ba(e.group)), r = C(
1767
+ const e = t, n = o, l = C(() => Ia(e.group)), r = C(
1768
1768
  () => `RM ${e.group.totalAmount.toLocaleString("en-MY", {
1769
1769
  minimumFractionDigits: 2,
1770
1770
  maximumFractionDigits: 2
@@ -1775,36 +1775,36 @@ const Ta = { class: "flex items-start justify-between gap-8" }, ja = { class: "f
1775
1775
  });
1776
1776
  return (u, c) => (p(), A("div", {
1777
1777
  class: "flex flex-col gap-8 rounded-lg border border-fm-color-neutral-gray-200 bg-white p-16 cursor-pointer hover:border-fm-color-primary",
1778
- onClick: c[0] || (c[0] = Xo((b) => n("select", u.group.id), ["stop"]))
1778
+ onClick: c[0] || (c[0] = Zo((b) => n("select", u.group.id), ["stop"]))
1779
1779
  }, [
1780
- a("div", Ta, [
1781
- a("div", ja, [
1780
+ a("div", Ba, [
1781
+ a("div", Ta, [
1782
1782
  u.group.color ? (p(), A("span", {
1783
1783
  key: 0,
1784
1784
  class: "w-8 h-8 rounded-full shrink-0",
1785
- style: yt({ backgroundColor: u.group.color })
1785
+ style: gt({ backgroundColor: u.group.color })
1786
1786
  }, null, 4)) : H("", !0),
1787
- a("span", Ra, R(u.group.name), 1)
1787
+ a("span", ja, R(u.group.name), 1)
1788
1788
  ]),
1789
1789
  a("div", {
1790
- class: ke(["fm-status-badge shrink-0", l.value.className])
1790
+ class: we(["fm-status-badge shrink-0", l.value.className])
1791
1791
  }, R(l.value.label), 3)
1792
1792
  ]),
1793
- a("div", Ma, [
1794
- a("span", Ua, R(u.group.itemCount), 1),
1793
+ a("div", Ra, [
1794
+ a("span", Na, R(u.group.itemCount), 1),
1795
1795
  ge(" items · " + R(r.value), 1)
1796
1796
  ]),
1797
1797
  c[1] || (c[1] = a("div", { class: "border-t border-dashed border-fm-color-neutral-gray-200" }, null, -1)),
1798
- a("div", Na, R(s.value), 1)
1798
+ a("div", Ma, R(s.value), 1)
1799
1799
  ]));
1800
1800
  }
1801
- }), Va = {
1801
+ }), Pa = {
1802
1802
  key: 0,
1803
1803
  class: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-16"
1804
- }, Ea = {
1804
+ }, Va = {
1805
1805
  key: 1,
1806
1806
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
1807
- }, La = /* @__PURE__ */ De({
1807
+ }, Ea = /* @__PURE__ */ De({
1808
1808
  __name: "ClosingGroupGrid",
1809
1809
  props: {
1810
1810
  groups: {}
@@ -1812,17 +1812,17 @@ const Ta = { class: "flex items-start justify-between gap-8" }, ja = { class: "f
1812
1812
  emits: ["select"],
1813
1813
  setup(t, { emit: o }) {
1814
1814
  const e = o;
1815
- return (n, l) => n.groups.length ? (p(), A("div", Va, [
1816
- (p(!0), A(le, null, he(n.groups, (r) => (p(), ne(Pa, {
1815
+ return (n, l) => n.groups.length ? (p(), A("div", Pa, [
1816
+ (p(!0), A(le, null, he(n.groups, (r) => (p(), ae(Ua, {
1817
1817
  key: r.id,
1818
1818
  group: r,
1819
1819
  onSelect: l[0] || (l[0] = (s) => e("select", s))
1820
1820
  }, null, 8, ["group"]))), 128))
1821
- ])) : (p(), A("div", Ea, "No closing groups"));
1821
+ ])) : (p(), A("div", Va, "No closing groups"));
1822
1822
  }
1823
1823
  });
1824
- function Do(t, o) {
1825
- const e = t.sku, n = [], l = Number(se.toFormatString({ value: t.baseAmount }));
1824
+ function xo(t, o) {
1825
+ const e = t.sku, n = [], l = Number(ne.toFormatString({ value: t.baseAmount }));
1826
1826
  l && n.push({
1827
1827
  label: "Base",
1828
1828
  amount: l,
@@ -1835,11 +1835,11 @@ function Do(t, o) {
1835
1835
  const r = new Map(
1836
1836
  t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
1837
1837
  ), s = new Set(e.unit.measurements.map((c) => c.id)), u = (c, b, g, S, J) => {
1838
- const E = Number(se.toFormatString({ value: g }));
1838
+ const E = Number(ne.toFormatString({ value: g }));
1839
1839
  if (!E) return;
1840
- const B = se.toFormatString({ value: b }), I = Number(
1841
- se.toFormatString({
1842
- value: _t(g, b)
1840
+ const B = ne.toFormatString({ value: b }), I = Number(
1841
+ ne.toFormatString({
1842
+ value: ht(g, b)
1843
1843
  })
1844
1844
  );
1845
1845
  n.push({
@@ -1854,20 +1854,20 @@ function Do(t, o) {
1854
1854
  };
1855
1855
  for (const c of e.unit.measurements) {
1856
1856
  const b = r.get(c.id);
1857
- b && u(c.abbrev, c.conversion, b, Nt(c, o), !1);
1857
+ b && u(c.abbrev, c.conversion, b, Mt(c, o), !1);
1858
1858
  }
1859
1859
  for (const c of t.measurementsAmounts)
1860
1860
  s.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
1861
1861
  return n;
1862
1862
  }
1863
- const vt = (t) => me(t, { minPrecision: 0, maxPrecision: 3 });
1864
- function Oa(t, o) {
1863
+ const ft = (t) => me(t, { minPrecision: 0, maxPrecision: 3 });
1864
+ function La(t, o) {
1865
1865
  return o ? "text-fm-color-system-error-300" : t ? "text-purple-500" : "";
1866
1866
  }
1867
- function Ga(t, o) {
1867
+ function Oa(t, o) {
1868
1868
  return o ? D(be.FmIcon, { name: "warning", size: "sm", color: "system-error-300" }) : t ? D(be.FmIcon, { name: "rule", size: "sm" }) : null;
1869
1869
  }
1870
- function Ao(t, o, e) {
1870
+ function Do(t, o, e) {
1871
1871
  return D(
1872
1872
  "div",
1873
1873
  {
@@ -1879,29 +1879,29 @@ function Ao(t, o, e) {
1879
1879
  (n) => D("div", { class: "flex justify-between gap-12" }, [
1880
1880
  D(
1881
1881
  "div",
1882
- { class: ["flex items-center gap-4", Oa(n.inactive, n.orphan)] },
1883
- [Ga(n.inactive, n.orphan), D("span", n.label)]
1882
+ { class: ["flex items-center gap-4", La(n.inactive, n.orphan)] },
1883
+ [Oa(n.inactive, n.orphan), D("span", n.label)]
1884
1884
  ),
1885
1885
  D(
1886
1886
  "div",
1887
1887
  { class: n.counted ? "" : "line-through text-fm-color-typo-tertiary" },
1888
- n.orphan ? `${vt(n.amount)} ${n.abbrev} (no valid conversion)` : n.counted ? `${vt(n.subtotal)} ${e}` : `${vt(n.subtotal)} ${e} (ignored)`
1888
+ n.orphan ? `${ft(n.amount)} ${n.abbrev} (no valid conversion)` : n.counted ? `${ft(n.subtotal)} ${e}` : `${ft(n.subtotal)} ${e} (ignored)`
1889
1889
  )
1890
1890
  ])
1891
1891
  ),
1892
1892
  D("hr", { class: "border-fm-color-typo-secondary my-4" }),
1893
1893
  D("div", { class: "flex justify-between fm-typo-en-body-lg-600" }, [
1894
1894
  D("span", "Total"),
1895
- D("span", `${vt(o)} ${e}`)
1895
+ D("span", `${ft(o)} ${e}`)
1896
1896
  ])
1897
1897
  ]
1898
1898
  );
1899
1899
  }
1900
- function Et(t, o) {
1901
- const e = t.sku, n = Number(se.toFormatString({ value: t.baseAmount })), l = new Map(
1900
+ function Vt(t, o) {
1901
+ const e = t.sku, n = Number(ne.toFormatString({ value: t.baseAmount })), l = new Map(
1902
1902
  t.measurementsAmounts.map((c) => [c.measurement.id, c.amount])
1903
1903
  ), r = new Set(e.unit.measurements.map((c) => c.id)), s = [], u = (c, b, g, S, J) => {
1904
- const E = Number(se.toFormatString({ value: g })), B = se.toFormatString({ value: b });
1904
+ const E = Number(ne.toFormatString({ value: g })), B = ne.toFormatString({ value: b });
1905
1905
  s.push({
1906
1906
  abbrev: `(${c}) × ${B}`,
1907
1907
  amount: E,
@@ -1910,14 +1910,14 @@ function Et(t, o) {
1910
1910
  };
1911
1911
  for (const c of e.unit.measurements) {
1912
1912
  const b = l.get(c.id);
1913
- b && u(c.abbrev, c.conversion, b, Nt(c, o), !1);
1913
+ b && u(c.abbrev, c.conversion, b, Mt(c, o), !1);
1914
1914
  }
1915
1915
  for (const c of t.measurementsAmounts)
1916
1916
  r.has(c.measurement.id) || u(c.measurement.abbrev, c.measurement.conversion, c.amount, !1, !0);
1917
1917
  return { baseUnitAmount: n, measurements: s };
1918
1918
  }
1919
- function uo(t, o, e) {
1920
- const n = t.sku, { baseUnitAmount: l, measurements: r } = Et(t, e);
1919
+ function co(t, o, e) {
1920
+ const n = t.sku, { baseUnitAmount: l, measurements: r } = Vt(t, e);
1921
1921
  return {
1922
1922
  id: n._id,
1923
1923
  code: n.code,
@@ -1926,18 +1926,18 @@ function uo(t, o, e) {
1926
1926
  baseUnitAmount: l,
1927
1927
  isTemplateItem: o,
1928
1928
  measurements: r,
1929
- physicalBalance: Number(se.toFormatString({ value: wt(t) })),
1930
- breakdown: Do(t, e)
1929
+ physicalBalance: Number(ne.toFormatString({ value: kt(t) })),
1930
+ breakdown: xo(t, e)
1931
1931
  };
1932
1932
  }
1933
- function za(t, o) {
1933
+ function Ga(t, o) {
1934
1934
  const e = [
1935
- ...t.items.map((n) => uo(n, !0, o)),
1936
- ...(t.negativeStockItems ?? []).map((n) => uo(n, !1, o))
1935
+ ...t.items.map((n) => co(n, !0, o)),
1936
+ ...(t.negativeStockItems ?? []).map((n) => co(n, !1, o))
1937
1937
  ];
1938
1938
  return e.sort((n, l) => n.code.localeCompare(l.code)), e;
1939
1939
  }
1940
- function Lt(t, o, e) {
1940
+ function Et(t, o, e) {
1941
1941
  const n = (s, u, c = "normal") => D(
1942
1942
  be.FmTooltip,
1943
1943
  { zIndex: 50 },
@@ -1972,17 +1972,17 @@ function Lt(t, o, e) {
1972
1972
  r
1973
1973
  );
1974
1974
  }
1975
- function Ha(t, o, e) {
1975
+ function za(t, o, e) {
1976
1976
  const n = [];
1977
1977
  for (const l of o) {
1978
1978
  const r = l.items.find((b) => b.sku._id === t);
1979
1979
  if (!r) continue;
1980
- const { baseUnitAmount: s, measurements: u } = Et(r, e);
1980
+ const { baseUnitAmount: s, measurements: u } = Vt(r, e);
1981
1981
  (s !== 0 || u.some((b) => b.amount !== 0)) && n.push({ label: l.label, isSub: l.isSub, baseUnitAmount: s, measurements: u });
1982
1982
  }
1983
1983
  return n;
1984
1984
  }
1985
- function Ya(t, o) {
1985
+ function Ha(t, o) {
1986
1986
  return D(
1987
1987
  "div",
1988
1988
  { class: "flex flex-col gap-8" },
@@ -1993,13 +1993,13 @@ function Ya(t, o) {
1993
1993
  { class: "fm-typo-en-body-sm-600 text-fm-color-typo-tertiary uppercase" },
1994
1994
  e.label
1995
1995
  ),
1996
- Lt(e.baseUnitAmount, o, e.measurements)
1996
+ Et(e.baseUnitAmount, o, e.measurements)
1997
1997
  ])
1998
1998
  )
1999
1999
  );
2000
2000
  }
2001
- const Wa = "N/A";
2002
- function $o(t, o) {
2001
+ const Ya = "N/A";
2002
+ function Ao(t, o) {
2003
2003
  var n, l;
2004
2004
  const e = t.approvedAt ? {
2005
2005
  action: `Approve at ${Fe(t.approvedAt)}`,
@@ -2014,7 +2014,7 @@ function $o(t, o) {
2014
2014
  o.idDisplay ? { label: "ID", value: o.idDisplay } : null,
2015
2015
  {
2016
2016
  label: "Location",
2017
- value: o.locationName ?? Wa
2017
+ value: o.locationName ?? Ya
2018
2018
  },
2019
2019
  {
2020
2020
  label: "Created at",
@@ -2046,7 +2046,7 @@ function $o(t, o) {
2046
2046
  e && e.remark ? { label: "Action remark", value: e.remark } : null
2047
2047
  ].filter((r) => !!r);
2048
2048
  }
2049
- const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-lg-600" }, Qa = { class: "flex gap-12 py-8 justify-end w-full" }, Ja = /* @__PURE__ */ De({
2049
+ const Wa = { class: "fm-typo-en-body-lg-400" }, Ka = { class: "fm-typo-en-body-lg-600" }, qa = { class: "flex gap-12 py-8 justify-end w-full" }, Qa = /* @__PURE__ */ De({
2050
2050
  __name: "ClosingGroupAction",
2051
2051
  props: {
2052
2052
  group: {},
@@ -2055,7 +2055,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2055
2055
  onFinished: { type: Function }
2056
2056
  },
2057
2057
  setup(t) {
2058
- const o = t, e = Oe(), n = Ne(), l = q(), r = q(!1), s = C(
2058
+ const o = t, e = Oe(), n = Ue(), l = q(), r = q(!1), s = C(
2059
2059
  () => ({ approve: "Approve", reject: "Reject", submit: "Submit for approval" })[o.action]
2060
2060
  ), u = C(
2061
2061
  () => ({ approve: "Approve", reject: "Reject", submit: "Submit" })[o.action]
@@ -2076,15 +2076,15 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2076
2076
  }
2077
2077
  return (g, S) => {
2078
2078
  const J = te("FmTextField"), E = te("FmButton"), B = te("FmForm");
2079
- return p(), ne(B, {
2079
+ return p(), ae(B, {
2080
2080
  onValidationSuccess: b,
2081
2081
  class: "flex flex-col gap-32",
2082
2082
  disabled: r.value
2083
2083
  }, {
2084
2084
  default: ee(() => [
2085
- a("div", Ka, [
2085
+ a("div", Wa, [
2086
2086
  S[2] || (S[2] = ge(" You are about to ")),
2087
- a("span", qa, R(u.value), 1),
2087
+ a("span", Ka, R(u.value), 1),
2088
2088
  S[3] || (S[3] = ge(" this group. Please provide a remark to justify this action. "))
2089
2089
  ]),
2090
2090
  h(J, {
@@ -2092,9 +2092,9 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2092
2092
  "onUpdate:modelValue": S[0] || (S[0] = (I) => l.value = I),
2093
2093
  label: "Remark",
2094
2094
  "label-mark": "required",
2095
- rules: [d(bo)()]
2095
+ rules: [d(yo)()]
2096
2096
  }, null, 8, ["modelValue", "rules"]),
2097
- a("div", Qa, [
2097
+ a("div", qa, [
2098
2098
  h(E, {
2099
2099
  label: "Cancel",
2100
2100
  variant: "tertiary",
@@ -2112,31 +2112,31 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2112
2112
  }, 8, ["disabled"]);
2113
2113
  };
2114
2114
  }
2115
- }), Za = { class: "w-full flex flex-col gap-32" }, Xa = { class: "fm-typo-en-title-md-600" }, es = { class: "text-fm-color-typo-secondary" }, ts = { class: "text-fm-color-primary" }, os = { class: "flex justify-between" }, ns = { class: "flex" }, as = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, ss = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, rs = { class: "flex gap-1" }, ls = {
2115
+ }), Ja = { class: "w-full flex flex-col gap-32" }, Za = { class: "fm-typo-en-title-md-600" }, Xa = { class: "text-fm-color-typo-secondary" }, es = { class: "text-fm-color-primary" }, ts = { class: "flex justify-between" }, os = { class: "flex" }, ns = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, as = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, ss = { class: "flex gap-1" }, rs = {
2116
2116
  class: "fm-typo-en-body-lg-600",
2117
2117
  style: { "white-space": "pre-wrap", "word-break": "break-word" }
2118
- }, is = { class: "fm-typo-en-body-lg-600" }, cs = { class: "flex gap-8" }, us = { class: "overflow-x-auto" }, ds = {
2118
+ }, ls = { class: "fm-typo-en-body-lg-600" }, is = { class: "flex gap-8" }, cs = { class: "overflow-x-auto" }, us = {
2119
2119
  key: 1,
2120
2120
  class: "flex-1 xs:w-screen xs:max-w-full"
2121
- }, ms = {
2121
+ }, ds = {
2122
2122
  key: 0,
2123
2123
  class: "flex flex-col items-center gap-8 h-full"
2124
- }, ps = ["src"], fs = {
2124
+ }, ms = ["src"], ps = {
2125
2125
  key: 1,
2126
2126
  class: "px-4 flex flex-col"
2127
- }, vs = { class: "flex gap-12 content-stretch" }, gs = {
2127
+ }, fs = { class: "flex gap-12 content-stretch" }, vs = {
2128
2128
  class: "flex flex-col w-24",
2129
2129
  name: "circles"
2130
- }, ys = { class: "flex-1 flex flex-col items-center" }, bs = { class: "flex-1 flex flex-col items-center" }, hs = {
2130
+ }, gs = { class: "flex-1 flex flex-col items-center" }, ys = { class: "flex-1 flex flex-col items-center" }, bs = {
2131
2131
  class: "py-12 flex flex-col gap-4",
2132
2132
  name: "received-at header"
2133
- }, _s = { class: "fm-typo-en-body-lg-400" }, ks = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ws = { class: "flex gap-12 content-stretch" }, xs = {
2133
+ }, hs = { class: "fm-typo-en-body-lg-400" }, _s = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, ks = { class: "flex gap-12 content-stretch" }, ws = {
2134
2134
  class: "flex flex-col w-24",
2135
2135
  name: "circles"
2136
- }, Ds = { class: "flex-1 flex flex-col items-center" }, As = {
2136
+ }, xs = { class: "flex-1 flex flex-col items-center" }, Ds = {
2137
2137
  class: "py-12 flex flex-col gap-4 flex-1",
2138
2138
  name: "delivery details"
2139
- }, $s = { class: "flex flex-col gap-8" }, Cs = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ss = { class: "flex flex-col gap-4" }, Fs = { class: "flex items-center gap-8 w-full" }, Is = /* @__PURE__ */ De({
2139
+ }, As = { class: "flex flex-col gap-8" }, $s = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Cs = { class: "flex flex-col gap-4" }, Ss = { class: "flex items-center gap-8 w-full" }, Fs = /* @__PURE__ */ De({
2140
2140
  __name: "ClosingGroupDetailSideSheet",
2141
2141
  props: {
2142
2142
  show: { type: Boolean },
@@ -2145,7 +2145,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2145
2145
  },
2146
2146
  emits: ["update:show", "updated"],
2147
2147
  setup(t, { emit: o }) {
2148
- const e = t, n = o, l = Mt(e, "show"), r = Pt(), s = qe(), u = fo(), c = C(() => {
2148
+ const e = t, n = o, l = Rt(e, "show"), r = Ut(), s = qe(), u = po(), c = C(() => {
2149
2149
  var x, w, re;
2150
2150
  return ((re = (w = (x = e.group) == null ? void 0 : x.usingTemplates) == null ? void 0 : w.find((_) => _)) == null ? void 0 : re.name) ?? "Group";
2151
2151
  }), b = C(() => {
@@ -2160,7 +2160,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2160
2160
  function S(x) {
2161
2161
  e.group && u.open({
2162
2162
  title: { approve: "Approve group", reject: "Reject group", submit: "Submit group for approval" }[x],
2163
- contentComponent: Ja,
2163
+ contentComponent: Qa,
2164
2164
  contentComponentProps: {
2165
2165
  group: e.group,
2166
2166
  action: x,
@@ -2173,7 +2173,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2173
2173
  }
2174
2174
  const J = C(() => {
2175
2175
  var x;
2176
- return e.group ? $o(e.group, {
2176
+ return e.group ? Ao(e.group, {
2177
2177
  locationName: (x = s._currentLocation) == null ? void 0 : x.name
2178
2178
  }) : [];
2179
2179
  }), E = [
@@ -2190,7 +2190,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2190
2190
  }
2191
2191
  );
2192
2192
  const z = C(
2193
- () => e.group ? za(e.group, r.value) : []
2193
+ () => e.group ? Ga(e.group, r.value) : []
2194
2194
  ), F = C(
2195
2195
  () => z.value.filter((x) => !!(x.isTemplateItem && P.value.templateItem || !x.isTemplateItem && P.value.nonTemplateItem))
2196
2196
  ), T = C(() => [
@@ -2256,7 +2256,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2256
2256
  },
2257
2257
  [re, D(be.FmIcon, { name: "info", size: "sm", outline: !0 })]
2258
2258
  ),
2259
- default: () => Ao(w.breakdown, w.physicalBalance, w.baseUnit)
2259
+ default: () => Do(w.breakdown, w.physicalBalance, w.baseUnit)
2260
2260
  }
2261
2261
  ) : re;
2262
2262
  },
@@ -2268,7 +2268,7 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2268
2268
  enableSorting: !1,
2269
2269
  cell(x) {
2270
2270
  const w = x.row.original;
2271
- return Lt(w.baseUnitAmount, w.baseUnit, w.measurements);
2271
+ return Et(w.baseUnitAmount, w.baseUnit, w.measurements);
2272
2272
  }
2273
2273
  }
2274
2274
  ]), k = C(() => {
@@ -2301,34 +2301,34 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2301
2301
  }));
2302
2302
  });
2303
2303
  return (x, w) => {
2304
- const re = te("FmButtonGroup"), _ = te("FmMenuDivider"), $ = te("FmCard"), L = te("FmChip"), M = te("FmTextField"), ve = te("FmTable"), oe = te("FmSpacer"), U = te("FmButton"), f = te("FmSideSheet");
2305
- return p(), ne(f, {
2304
+ const re = te("FmButtonGroup"), _ = te("FmMenuDivider"), $ = te("FmCard"), L = te("FmChip"), N = te("FmTextField"), ve = te("FmTable"), oe = te("FmSpacer"), M = te("FmButton"), f = te("FmSideSheet");
2305
+ return p(), ae(f, {
2306
2306
  "dismiss-away": "",
2307
2307
  "max-width": 9999,
2308
2308
  "model-value": d(l),
2309
- "onUpdate:modelValue": w[8] || (w[8] = (y) => ht(l) ? l.value = y : null),
2309
+ "onUpdate:modelValue": w[8] || (w[8] = (y) => bt(l) ? l.value = y : null),
2310
2310
  header: "Group details"
2311
2311
  }, {
2312
2312
  "side-sheet-footer": ee(() => [
2313
- a("div", Fs, [
2314
- b.value ? (p(), ne(U, {
2313
+ a("div", Ss, [
2314
+ b.value ? (p(), ae(M, {
2315
2315
  key: 0,
2316
2316
  label: "Submit for approval",
2317
2317
  variant: "secondary",
2318
2318
  onClick: w[4] || (w[4] = (y) => S("submit"))
2319
2319
  })) : H("", !0),
2320
- g.value ? (p(), ne(U, {
2320
+ g.value ? (p(), ae(M, {
2321
2321
  key: 1,
2322
2322
  label: "Approve",
2323
2323
  onClick: w[5] || (w[5] = (y) => S("approve"))
2324
2324
  })) : H("", !0),
2325
- g.value ? (p(), ne(U, {
2325
+ g.value ? (p(), ae(M, {
2326
2326
  key: 2,
2327
2327
  label: "Reject",
2328
2328
  variant: "destructive",
2329
2329
  onClick: w[6] || (w[6] = (y) => S("reject"))
2330
2330
  })) : H("", !0),
2331
- h(U, {
2331
+ h(M, {
2332
2332
  label: "Close",
2333
2333
  variant: "tertiary",
2334
2334
  onClick: w[7] || (w[7] = (y) => l.value = !1)
@@ -2336,14 +2336,14 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2336
2336
  ])
2337
2337
  ]),
2338
2338
  default: ee(() => [
2339
- a("div", Za, [
2340
- a("div", Xa, [
2339
+ a("div", Ja, [
2340
+ a("div", Za, [
2341
2341
  x.parentName ? (p(), A(le, { key: 0 }, [
2342
- a("span", es, R(x.parentName), 1),
2342
+ a("span", Xa, R(x.parentName), 1),
2343
2343
  w[9] || (w[9] = ge(" · "))
2344
2344
  ], 64)) : H("", !0),
2345
2345
  w[10] || (w[10] = ge(" Group · ")),
2346
- a("span", ts, R(c.value), 1)
2346
+ a("span", es, R(c.value), 1)
2347
2347
  ]),
2348
2348
  a("div", null, [
2349
2349
  h(re, {
@@ -2358,26 +2358,26 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2358
2358
  class: "flex flex-col gap-8 px-12 py-16"
2359
2359
  }, {
2360
2360
  default: ee(() => {
2361
- var y, N;
2361
+ var y, U;
2362
2362
  return [
2363
- a("div", os, [
2363
+ a("div", ts, [
2364
2364
  w[11] || (w[11] = a("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
2365
- a("div", ns, [
2365
+ a("div", os, [
2366
2366
  a("div", {
2367
- class: ke(["fm-status-badge", d(Ue)(((y = x.group) == null ? void 0 : y.status) ?? "DRAFT")])
2368
- }, R(d(Ie)(((N = x.group) == null ? void 0 : N.status) ?? "")), 3)
2367
+ class: we(["fm-status-badge", d(Me)(((y = x.group) == null ? void 0 : y.status) ?? "DRAFT")])
2368
+ }, R(d(Ie)(((U = x.group) == null ? void 0 : U.status) ?? "")), 3)
2369
2369
  ])
2370
2370
  ]),
2371
2371
  h(_),
2372
- a("div", as, [
2372
+ a("div", ns, [
2373
2373
  (p(!0), A(le, null, he(J.value, (Y, de) => (p(), A("div", {
2374
2374
  class: "flex flex-col gap-4",
2375
2375
  key: de
2376
2376
  }, [
2377
- a("div", ss, [
2378
- a("div", rs, R(Y.label), 1)
2377
+ a("div", as, [
2378
+ a("div", ss, R(Y.label), 1)
2379
2379
  ]),
2380
- a("div", ls, R(Y.value), 1)
2380
+ a("div", rs, R(Y.value), 1)
2381
2381
  ]))), 128))
2382
2382
  ])
2383
2383
  ];
@@ -2389,8 +2389,8 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2389
2389
  class: "flex flex-col gap-16 px-12 py-16"
2390
2390
  }, {
2391
2391
  default: ee(() => [
2392
- a("div", is, R(c.value) + " items", 1),
2393
- a("div", cs, [
2392
+ a("div", ls, R(c.value) + " items", 1),
2393
+ a("div", is, [
2394
2394
  h(L, {
2395
2395
  label: "Template Item(s)",
2396
2396
  selected: P.value.templateItem,
@@ -2402,12 +2402,12 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2402
2402
  onClick: w[2] || (w[2] = (y) => P.value.nonTemplateItem = !P.value.nonTemplateItem)
2403
2403
  }, null, 8, ["selected"])
2404
2404
  ]),
2405
- h(M, {
2405
+ h(N, {
2406
2406
  modelValue: I.value,
2407
2407
  "onUpdate:modelValue": w[3] || (w[3] = (y) => I.value = y),
2408
2408
  placeholder: "Filter items"
2409
2409
  }, null, 8, ["modelValue"]),
2410
- a("div", us, [
2410
+ a("div", cs, [
2411
2411
  h(ve, {
2412
2412
  "column-defs": T.value,
2413
2413
  "row-data": F.value,
@@ -2419,64 +2419,64 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2419
2419
  _: 1
2420
2420
  })
2421
2421
  ], 64)) : H("", !0),
2422
- B.value.value === "history" ? (p(), A("div", ds, [
2423
- k.value.length ? (p(), A("div", fs, [
2424
- (p(!0), A(le, null, he(k.value, (y, N) => (p(), A(le, { key: N }, [
2425
- a("div", vs, [
2426
- a("div", gs, [
2427
- a("div", ys, [
2422
+ B.value.value === "history" ? (p(), A("div", us, [
2423
+ k.value.length ? (p(), A("div", ps, [
2424
+ (p(!0), A(le, null, he(k.value, (y, U) => (p(), A(le, { key: U }, [
2425
+ a("div", fs, [
2426
+ a("div", vs, [
2427
+ a("div", gs, [
2428
2428
  a("div", {
2429
- class: ke([
2430
- { "bg-fm-color-primary": N !== 0, "bg-white": N === 0 },
2429
+ class: we([
2430
+ { "bg-fm-color-primary": U !== 0, "bg-white": U === 0 },
2431
2431
  "w-[2px] h-full"
2432
2432
  ])
2433
2433
  }, null, 2)
2434
2434
  ]),
2435
2435
  w[14] || (w[14] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
2436
- a("div", bs, [
2436
+ a("div", ys, [
2437
2437
  a("div", {
2438
- class: ke([
2438
+ class: we([
2439
2439
  {
2440
- "bg-fm-color-primary": N < k.value.length - 1,
2441
- "bg-white": N >= k.value.length - 1
2440
+ "bg-fm-color-primary": U < k.value.length - 1,
2441
+ "bg-white": U >= k.value.length - 1
2442
2442
  },
2443
2443
  "w-[2px] h-full"
2444
2444
  ])
2445
2445
  }, null, 2)
2446
2446
  ])
2447
2447
  ]),
2448
- a("div", hs, [
2449
- a("div", _s, R(y.header), 1),
2450
- a("div", ks, R(y.date), 1)
2448
+ a("div", bs, [
2449
+ a("div", hs, R(y.header), 1),
2450
+ a("div", _s, R(y.date), 1)
2451
2451
  ])
2452
2452
  ]),
2453
- a("div", ws, [
2454
- a("div", xs, [
2455
- a("div", Ds, [
2453
+ a("div", ks, [
2454
+ a("div", ws, [
2455
+ a("div", xs, [
2456
2456
  a("div", {
2457
- class: ke([
2457
+ class: we([
2458
2458
  {
2459
- "bg-fm-color-primary": N < k.value.length - 1,
2460
- "bg-white": N >= k.value.length - 1
2459
+ "bg-fm-color-primary": U < k.value.length - 1,
2460
+ "bg-white": U >= k.value.length - 1
2461
2461
  },
2462
2462
  "w-[2px] h-full"
2463
2463
  ])
2464
2464
  }, null, 2)
2465
2465
  ])
2466
2466
  ]),
2467
- a("div", As, [
2467
+ a("div", Ds, [
2468
2468
  h($, {
2469
2469
  variant: "outlined",
2470
2470
  class: "py-12 px-16"
2471
2471
  }, {
2472
2472
  default: ee(() => [
2473
- a("div", $s, [
2473
+ a("div", As, [
2474
2474
  (p(!0), A(le, null, he(y.info, (Y, de) => (p(), A("div", {
2475
2475
  key: de,
2476
2476
  class: "flex flex-col gap-4"
2477
2477
  }, [
2478
- a("div", Cs, R(Y.label), 1),
2479
- a("div", Ss, [
2478
+ a("div", $s, R(Y.label), 1),
2479
+ a("div", Cs, [
2480
2480
  (p(!0), A(le, null, he(Y.values, (j, G) => (p(), A("div", {
2481
2481
  key: G,
2482
2482
  class: "fm-typo-en-body-lg-600"
@@ -2490,13 +2490,13 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2490
2490
  ])
2491
2491
  ])
2492
2492
  ], 64))), 128))
2493
- ])) : (p(), A("div", ms, [
2493
+ ])) : (p(), A("div", ds, [
2494
2494
  h(oe),
2495
2495
  a("div", null, [
2496
2496
  a("img", {
2497
- src: d(wo),
2497
+ src: d(ko),
2498
2498
  alt: "List is empty"
2499
- }, null, 8, ps)
2499
+ }, null, 8, ms)
2500
2500
  ]),
2501
2501
  w[12] || (w[12] = a("div", { class: "fm-typo-en-body-lg-600" }, "No records found", -1)),
2502
2502
  w[13] || (w[13] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, " You can track approval and rejection history here ", -1)),
@@ -2511,10 +2511,10 @@ const Ka = { class: "fm-typo-en-body-lg-400" }, qa = { class: "fm-typo-en-body-l
2511
2511
  };
2512
2512
  }
2513
2513
  });
2514
- function Bs(t) {
2515
- return cn.isDraftItemAmendBlocked(t).blocked;
2514
+ function Is(t) {
2515
+ return ln.isDraftItemAmendBlocked(t).blocked;
2516
2516
  }
2517
- function Ts(t, o, e) {
2517
+ function Bs(t, o, e) {
2518
2518
  const n = C(() => {
2519
2519
  if (e && !e.value) return [];
2520
2520
  const r = [], s = /* @__PURE__ */ new Set();
@@ -2522,7 +2522,7 @@ function Ts(t, o, e) {
2522
2522
  const c = u.sku._id;
2523
2523
  if (!s.has(c))
2524
2524
  try {
2525
- if (!Bs({
2525
+ if (!Is({
2526
2526
  item: u,
2527
2527
  master: o.value[c] ?? null
2528
2528
  })) continue;
@@ -2535,10 +2535,10 @@ function Ts(t, o, e) {
2535
2535
  });
2536
2536
  return { blockedSkuIds: C(() => new Set(n.value.map((r) => r.id))), blockedItems: n };
2537
2537
  }
2538
- const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { class: "flex flex-col gap-4" }, Ms = { class: "flex items-center gap-4 min-w-0" }, Us = {
2538
+ const Ts = { class: "flex items-center gap-4 justify-start w-full" }, js = { class: "flex flex-col gap-4" }, Rs = { class: "flex items-center gap-4 min-w-0" }, Ns = {
2539
2539
  key: 0,
2540
2540
  class: "flex items-center gap-4 w-fit px-8 py-2 fm-corner-radius-md bg-orange-50 text-fm-color-primary fm-typo-en-body-md-600"
2541
- }, Ns = /* @__PURE__ */ De({
2541
+ }, Ms = /* @__PURE__ */ De({
2542
2542
  __name: "ClosingDraftSkuCell",
2543
2543
  props: {
2544
2544
  code: {},
@@ -2551,33 +2551,33 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2551
2551
  const { FmTooltip: o, FmPill: e, FmIcon: n } = be, l = t, r = C(
2552
2552
  () => l.hasError ? "Adjustment difference is more than 10%." : `${l.code} - ${l.name}`
2553
2553
  );
2554
- return (s, u) => (p(), ne(d(o), { "z-index": 51 }, {
2554
+ return (s, u) => (p(), ae(d(o), { "z-index": 51 }, {
2555
2555
  content: ee(() => [
2556
2556
  ge(R(r.value), 1)
2557
2557
  ]),
2558
2558
  default: ee(() => [
2559
- a("div", js, [
2560
- a("div", Rs, [
2561
- a("div", Ms, [
2559
+ a("div", Ts, [
2560
+ a("div", js, [
2561
+ a("div", Rs, [
2562
2562
  a("span", {
2563
- class: ke([
2563
+ class: we([
2564
2564
  "line-clamp-1 fm-typo-en-body-lg-400",
2565
2565
  s.hasError ? "text-fm-color-system-error-300" : "text-fm-color-typo-primary"
2566
2566
  ])
2567
2567
  }, R(s.name), 3),
2568
- s.isOutdated ? (p(), ne(d(e), {
2568
+ s.isOutdated ? (p(), ae(d(e), {
2569
2569
  key: 0,
2570
2570
  variant: "beta",
2571
2571
  label: "Outdated"
2572
2572
  })) : H("", !0)
2573
2573
  ]),
2574
2574
  a("div", {
2575
- class: ke([
2575
+ class: we([
2576
2576
  "line-clamp-1 fm-typo-en-body-md-400",
2577
2577
  s.hasError ? "text-fm-color-system-error-300" : "text-fm-color-typo-secondary"
2578
2578
  ])
2579
2579
  }, R(s.code), 3),
2580
- s.subSources.length >= 2 ? (p(), A("div", Us, [
2580
+ s.subSources.length >= 2 ? (p(), A("div", Ns, [
2581
2581
  h(d(n), {
2582
2582
  name: "refresh",
2583
2583
  size: "sm"
@@ -2590,7 +2590,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2590
2590
  _: 1
2591
2591
  }));
2592
2592
  }
2593
- }), Ps = { class: "py-4 flex flex-col gap-8" }, Vs = { class: "flex flex-col gap-4 max-h-[180px] overflow-y-auto" }, Es = { class: "flex gap-4 justify-end" }, Ls = /* @__PURE__ */ De({
2593
+ }), Us = { class: "py-4 flex flex-col gap-8" }, Ps = { class: "flex flex-col gap-4 max-h-[180px] overflow-y-auto" }, Vs = { class: "flex gap-4 justify-end" }, Es = /* @__PURE__ */ De({
2594
2594
  __name: "ClosingDraftOutdatedApproveWarning",
2595
2595
  props: {
2596
2596
  show: { type: Boolean },
@@ -2608,7 +2608,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2608
2608
  function u(c) {
2609
2609
  l("update:show", c);
2610
2610
  }
2611
- return (c, b) => (p(), ne(d(e), {
2611
+ return (c, b) => (p(), ae(d(e), {
2612
2612
  "model-value": c.show,
2613
2613
  "max-width": 520,
2614
2614
  "z-index": 60,
@@ -2618,15 +2618,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2618
2618
  a("div", { class: "fm-typo-en-heading-lg-600" }, "Approve with outdated measurements?", -1)
2619
2619
  ])),
2620
2620
  default: ee(() => [
2621
- a("div", Ps, [
2621
+ a("div", Us, [
2622
2622
  b[1] || (b[1] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " These items were counted against outdated measurements. You can continue, but review them before approving if the count should use the latest inventory setup. ", -1)),
2623
- a("div", Vs, [
2623
+ a("div", Ps, [
2624
2624
  (p(!0), A(le, null, he(c.items, (g) => (p(), A("div", {
2625
2625
  key: g.id,
2626
2626
  class: "fm-typo-en-body-md-400 text-fm-color-typo-primary"
2627
2627
  }, R(g.code) + " - " + R(g.name), 1))), 128))
2628
2628
  ]),
2629
- a("div", Es, [
2629
+ a("div", Vs, [
2630
2630
  h(d(n), {
2631
2631
  label: "Cancel",
2632
2632
  variant: "secondary",
@@ -2644,46 +2644,46 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2644
2644
  _: 1
2645
2645
  }, 8, ["model-value"]));
2646
2646
  }
2647
- }), Os = { class: "w-full flex flex-col gap-32" }, Gs = { class: "flex flex-col gap-4" }, zs = { class: "flex justify-between" }, Hs = { class: "flex" }, Ys = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ws = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ks = { class: "flex gap-1" }, qs = {
2647
+ }), Ls = { class: "w-full flex flex-col gap-32" }, Os = { class: "flex flex-col gap-4" }, Gs = { class: "flex justify-between" }, zs = { class: "flex" }, Hs = { class: "grid grid-cols-[repeat(4,1fr)] xs:flex xs:flex-col sm:flex sm:flex-col gap-8" }, Ys = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ws = { class: "flex gap-1" }, Ks = {
2648
2648
  class: "fm-typo-en-body-lg-600",
2649
2649
  style: { "white-space": "pre-wrap", "word-break": "break-word" }
2650
- }, Qs = { class: "flex items-center justify-between" }, Js = { class: "fm-typo-en-body-lg-600" }, Zs = {
2650
+ }, qs = { class: "flex items-center justify-between" }, Qs = { class: "fm-typo-en-body-lg-600" }, Js = {
2651
2651
  key: 1,
2652
2652
  class: "flex items-start gap-8 p-12 fm-corner-radius-md border-1 border-yellow-500 bg-yellow-50 text-yellow-700"
2653
- }, Xs = { class: "flex flex-col gap-2" }, er = { class: "fm-typo-en-body-sm-400 list-disc pl-16" }, tr = { key: 0 }, or = { key: 1 }, nr = { class: "flex flex-col gap-16" }, ar = { class: "flex items-center" }, sr = {
2653
+ }, Zs = { class: "flex flex-col gap-2" }, Xs = { class: "fm-typo-en-body-sm-400 list-disc pl-16" }, er = { key: 0 }, tr = { key: 1 }, or = { class: "flex flex-col gap-16" }, nr = { class: "flex items-center" }, ar = {
2654
2654
  key: 0,
2655
2655
  class: "flex gap-8"
2656
- }, rr = {
2656
+ }, sr = {
2657
2657
  key: 0,
2658
2658
  class: "w-full flex flex-col items-center"
2659
- }, lr = { class: "flex items-center gap-8" }, ir = { class: "flex flex-col gap-8" }, cr = { class: "flex gap-8" }, ur = {
2659
+ }, rr = { class: "flex items-center gap-8" }, lr = { class: "flex flex-col gap-8" }, ir = { class: "flex gap-8" }, cr = {
2660
2660
  key: 0,
2661
2661
  class: "flex gap-8"
2662
- }, dr = {
2662
+ }, ur = {
2663
2663
  key: 1,
2664
2664
  class: "flex gap-8 flex-wrap"
2665
- }, mr = { class: "overflow-x-auto" }, pr = {
2665
+ }, dr = { class: "overflow-x-auto" }, mr = {
2666
2666
  key: 1,
2667
2667
  class: "flex-1 xs:w-screen xs:max-w-full"
2668
- }, fr = {
2668
+ }, pr = {
2669
2669
  key: 0,
2670
2670
  class: "flex flex-col items-center gap-8 h-full"
2671
- }, vr = ["src"], gr = {
2671
+ }, fr = ["src"], vr = {
2672
2672
  key: 1,
2673
2673
  class: "px-4 flex flex-col"
2674
- }, yr = { class: "flex gap-12 content-stretch" }, br = {
2674
+ }, gr = { class: "flex gap-12 content-stretch" }, yr = {
2675
2675
  class: "flex flex-col w-24",
2676
2676
  name: "circles"
2677
- }, hr = { class: "flex-1 flex flex-col items-center" }, _r = { class: "flex-1 flex flex-col items-center" }, kr = {
2677
+ }, br = { class: "flex-1 flex flex-col items-center" }, hr = { class: "flex-1 flex flex-col items-center" }, _r = {
2678
2678
  class: "py-12 flex flex-col gap-4",
2679
2679
  name: "received-at header"
2680
- }, wr = { class: "fm-typo-en-body-lg-400" }, xr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Dr = { class: "flex gap-12 content-stretch" }, Ar = {
2680
+ }, kr = { class: "fm-typo-en-body-lg-400" }, wr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, xr = { class: "flex gap-12 content-stretch" }, Dr = {
2681
2681
  class: "flex flex-col w-24",
2682
2682
  name: "circles"
2683
- }, $r = { class: "flex-1 flex flex-col items-center" }, Cr = {
2683
+ }, Ar = { class: "flex-1 flex flex-col items-center" }, $r = {
2684
2684
  class: "py-12 flex flex-col gap-4 flex-1",
2685
2685
  name: "delivery details"
2686
- }, Sr = { class: "flex flex-col gap-8" }, Fr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Ir = { class: "flex flex-col gap-4" }, Br = { class: "flex items-center justify-between gap-8 w-full" }, Tr = { class: "flex items-center gap-8" }, jr = { class: "flex flex-col items-end" }, Rr = { class: "text-2xl font-semibold" }, Mr = "N/A", Ur = /* @__PURE__ */ De({
2686
+ }, Cr = { class: "flex flex-col gap-8" }, Sr = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary" }, Fr = { class: "flex flex-col gap-4" }, Ir = { class: "flex items-center justify-between gap-8 w-full" }, Br = { class: "flex items-center gap-8" }, Tr = { class: "flex flex-col items-end" }, jr = { class: "text-2xl font-semibold" }, Rr = "N/A", Nr = /* @__PURE__ */ De({
2687
2687
  __name: "ClosingDraftDialog",
2688
2688
  props: {
2689
2689
  show: { type: Boolean },
@@ -2692,12 +2692,12 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2692
2692
  emits: ["submitted", "refresh"],
2693
2693
  setup(t, { emit: o }) {
2694
2694
  const e = t, n = C(() => {
2695
- const m = vo();
2695
+ const m = fo();
2696
2696
  return m === "MYR" ? "RM" : m;
2697
- }), l = xo(), r = C(() => {
2697
+ }), l = wo(), r = C(() => {
2698
2698
  var m, i;
2699
2699
  return (m = e.draft) != null && m.closingId ? ((i = l.drafts.find((v) => v._id === e.draft._id)) == null ? void 0 : i.closingIdDisplay) ?? null : null;
2700
- }), s = bt(), u = Oe(), c = Mt(e, "show"), b = q(!1), g = q(!1), S = q([]), J = C(
2700
+ }), s = yt(), u = Oe(), c = Rt(e, "show"), b = q(!1), g = q(!1), S = q([]), J = C(
2701
2701
  () => e.draft
2702
2702
  );
2703
2703
  let E = 0, B;
@@ -2720,7 +2720,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2720
2720
  console.error("Failed to fetch closing groups", V);
2721
2721
  }
2722
2722
  }
2723
- const P = C(() => S.value.map(Rt)), Z = C(() => {
2723
+ const P = C(() => S.value.map(jt)), Z = C(() => {
2724
2724
  var m, i, v;
2725
2725
  return (v = (i = (m = e.draft) == null ? void 0 : m.usingTemplates) == null ? void 0 : i.find((O) => O)) == null ? void 0 : v.name;
2726
2726
  }), X = q(null), z = q(!1);
@@ -2747,15 +2747,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2747
2747
  K.adjustmentsByType && Object.keys(K.adjustmentsByType).forEach((V) => m.add(V));
2748
2748
  const v = ["receive", "sales", "wastage"].filter((K) => m.has(K));
2749
2749
  return v.forEach((K) => m.delete(K)), [...v, ...Array.from(m).sort()];
2750
- }), $ = kt(), L = Ne(), M = Ut(), ve = qe(), oe = io({}), U = C(() => new Set(
2751
- M.skus.filter((m) => {
2750
+ }), $ = _t(), L = Ue(), N = Nt(), ve = qe(), oe = lo({}), M = C(() => new Set(
2751
+ N.skus.filter((m) => {
2752
2752
  var i;
2753
2753
  return oe[(i = m.customAttributes) == null ? void 0 : i.tag];
2754
2754
  }).map((m) => m._id)
2755
2755
  )), f = o, y = C(() => {
2756
2756
  var m;
2757
2757
  return (m = e.draft) == null ? void 0 : m._id;
2758
- }), N = C(() => {
2758
+ }), U = C(() => {
2759
2759
  var m;
2760
2760
  return (m = e.draft) == null ? void 0 : m._rev;
2761
2761
  }), {
@@ -2763,18 +2763,18 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2763
2763
  startListening: de,
2764
2764
  startRefresh: j,
2765
2765
  cleanup: G
2766
- } = Ia({
2766
+ } = Fa({
2767
2767
  closingDraftId: y,
2768
- currentRev: N,
2768
+ currentRev: U,
2769
2769
  onCompleted: (m) => {
2770
2770
  f("refresh", m), c.value = !1;
2771
2771
  }
2772
2772
  }), ie = q({
2773
2773
  templateItem: !0,
2774
2774
  nonTemplateItem: !0
2775
- }), ae = q(null);
2775
+ }), se = q(null);
2776
2776
  function Ae(m, i) {
2777
- ae.value = i ? m : ae.value === m ? null : ae.value;
2777
+ se.value = i ? m : se.value === m ? null : se.value;
2778
2778
  }
2779
2779
  const _e = C(() => {
2780
2780
  var m, i;
@@ -2785,7 +2785,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2785
2785
  items: [...((m = e.draft) == null ? void 0 : m.items) ?? [], ...((i = e.draft) == null ? void 0 : i.negativeStockItems) ?? []]
2786
2786
  },
2787
2787
  ...S.value.map((v) => ({
2788
- label: xt(v),
2788
+ label: wt(v),
2789
2789
  isSub: !0,
2790
2790
  items: [...v.items ?? [], ...v.negativeStockItems ?? []]
2791
2791
  }))
@@ -2795,14 +2795,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2795
2795
  const m = [...((O = e.draft) == null ? void 0 : O.items) ?? [], ...((K = e.draft) == null ? void 0 : K.negativeStockItems) ?? []], i = S.value.map((V) => [
2796
2796
  ...V.items ?? [],
2797
2797
  ...V.negativeStockItems ?? []
2798
- ]), v = ta([m, ...i]);
2799
- return U.value.size ? v.filter((V) => U.value.has(V.sku._id)) : v;
2800
- }), ot = C(
2801
- () => M.isInventoryLoaded || M.inventoryFetchedAt != null
2802
- ), nt = C(() => M.skuById), { blockedSkuIds: at, blockedItems: Pe } = Ts(Be, nt, ot), Re = C(() => {
2798
+ ]), v = ea([m, ...i]);
2799
+ return M.value.size ? v.filter((V) => M.value.has(V.sku._id)) : v;
2800
+ }), tt = C(
2801
+ () => N.isInventoryLoaded || N.inventoryFetchedAt != null
2802
+ ), ot = C(() => N.skuById), { blockedSkuIds: nt, blockedItems: Pe } = Bs(Be, ot, tt), Re = C(() => {
2803
2803
  const m = Be.value.map((i) => i.sku);
2804
2804
  return m.sort((i, v) => i.code.localeCompare(v.code)), m;
2805
- }), Dt = Pt(), At = [
2805
+ }), xt = Ut(), Dt = [
2806
2806
  {
2807
2807
  label: "Overview",
2808
2808
  value: "overview"
@@ -2811,7 +2811,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2811
2811
  label: "Action history",
2812
2812
  value: "history"
2813
2813
  }
2814
- ], Qe = q(At[0]);
2814
+ ], Qe = q(Dt[0]);
2815
2815
  je(
2816
2816
  () => e.show,
2817
2817
  async (m) => {
@@ -2819,26 +2819,26 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2819
2819
  G();
2820
2820
  return;
2821
2821
  }
2822
- Qe.value = At[0], ie.value = {
2822
+ Qe.value = Dt[0], ie.value = {
2823
2823
  templateItem: !0,
2824
2824
  nonTemplateItem: !0
2825
- }, ae.value = null, de();
2825
+ }, se.value = null, de();
2826
2826
  },
2827
2827
  { immediate: !0 }
2828
2828
  ), je(
2829
2829
  [() => e.show, y],
2830
2830
  ([m]) => {
2831
- m && (I(), Fo());
2831
+ m && (I(), So());
2832
2832
  },
2833
2833
  { immediate: !0 }
2834
2834
  );
2835
- const Co = C(() => st.value.reduce((m, i) => m + Number(i.stockTakeValue), 0)), Ot = Xe(0), So = Xe(100);
2836
- async function Fo() {
2835
+ const $o = C(() => at.value.reduce((m, i) => m + Number(i.stockTakeValue), 0)), Lt = ne.fromNumber(0), Co = ne.fromNumber(100);
2836
+ async function So() {
2837
2837
  var m, i, v;
2838
2838
  if (ve._currentLocation) {
2839
2839
  b.value = !0, T.value = [], k.value = [];
2840
2840
  try {
2841
- if (await M.init(), !x.value) return;
2841
+ if (await N.init(), !x.value) return;
2842
2842
  const O = (m = e.draft) == null ? void 0 : m.closingAdjustmentId;
2843
2843
  if (!O) {
2844
2844
  L.open({
@@ -2872,7 +2872,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2872
2872
  }
2873
2873
  }
2874
2874
  }
2875
- async function Gt() {
2875
+ async function Ot() {
2876
2876
  var i, v;
2877
2877
  if (Y.value)
2878
2878
  return;
@@ -2893,7 +2893,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2893
2893
  }
2894
2894
  );
2895
2895
  }
2896
- async function Io() {
2896
+ async function Fo() {
2897
2897
  var i, v;
2898
2898
  if (!(((i = e.draft) == null ? void 0 : i.effectiveAt) ?? (e.draft ? Le((v = e.draft) == null ? void 0 : v._id) : null))) {
2899
2899
  L.open({
@@ -2905,15 +2905,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2905
2905
  }
2906
2906
  await s.invalidateDraftCache(e.draft);
2907
2907
  }
2908
- const Bo = C(
2908
+ const Io = C(
2909
2909
  () => w.value.groupBy(
2910
2910
  (m) => m.id,
2911
2911
  (m) => m.balance
2912
2912
  )
2913
- ), To = C(() => Be.value.groupBy((m) => m.sku._id)), jo = C(() => {
2913
+ ), Bo = C(() => Be.value.groupBy((m) => m.sku._id)), To = C(() => {
2914
2914
  var m;
2915
2915
  return (m = e.draft) != null && m.adjustmentSnapshot ? new Map(e.draft.adjustmentSnapshot.map((i) => [i.skuId, i.adjustmentsByType])) : /* @__PURE__ */ new Map();
2916
- }), Ro = C(() => {
2916
+ }), jo = C(() => {
2917
2917
  var m;
2918
2918
  return (m = e.draft) != null && m.opening ? new Map(e.draft.opening.map((i) => [i.skuId, i.balance])) : /* @__PURE__ */ new Map();
2919
2919
  });
@@ -2931,15 +2931,15 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2931
2931
  }
2932
2932
  );
2933
2933
  }
2934
- const zt = C(() => [
2934
+ const Gt = C(() => [
2935
2935
  {
2936
2936
  id: "sku",
2937
2937
  accessorFn: (i) => `${i.code} ${i.name}`,
2938
2938
  header: () => "Name",
2939
2939
  size: 350,
2940
2940
  cell(i) {
2941
- const v = i.row.original, O = v.adjustedDiffPercentage, K = typeof O == "number" && Math.abs(O) > 10, V = at.value.has(v.id);
2942
- return D(Ns, {
2941
+ const v = i.row.original, O = v.adjustedDiffPercentage, K = typeof O == "number" && Math.abs(O) > 10, V = nt.value.has(v.id);
2942
+ return D(Ms, {
2943
2943
  code: v.code,
2944
2944
  name: v.name,
2945
2945
  hasError: K,
@@ -2949,7 +2949,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
2949
2949
  }
2950
2950
  },
2951
2951
  // Dynamic custom attribute columns (toggled by user)
2952
- ...Wt.value.map(
2952
+ ...Yt.value.map(
2953
2953
  (i) => ({
2954
2954
  id: `customAttr_${i}`,
2955
2955
  accessorFn: (v) => v.customAttributeValues[i],
@@ -3053,16 +3053,16 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3053
3053
  accessorFn: (i) => {
3054
3054
  var O;
3055
3055
  const v = (O = re.value.find((K) => K.id === i.id)) == null ? void 0 : O.balance;
3056
- return v ? Cn.toDouble(v) : i.physicalBalance;
3056
+ return v ? $n.toDouble(v) : i.physicalBalance;
3057
3057
  },
3058
3058
  header: () => Se("Stock Take balance", "The physical balance recorded during stock take."),
3059
3059
  cell(i) {
3060
3060
  var pe;
3061
- const v = i.row.original, O = se.fromNumber(v.physicalBalance);
3061
+ const v = i.row.original, O = v.physicalBalanceDecimal;
3062
3062
  let K = !0;
3063
3063
  const V = (pe = re.value.find((ce) => ce.id === v.id)) == null ? void 0 : pe.balance;
3064
3064
  let W;
3065
- V && !se.equals({ a: O, b: V }) ? (K = !1, W = me(V)) : W = me(v.physicalBalance);
3065
+ V && !ne.equals({ a: O, b: V }) ? (K = !1, W = me(V)) : W = me(v.physicalBalance);
3066
3066
  const ue = D("div", { class: "flex flex-col items-end" }, [
3067
3067
  D(
3068
3068
  "span",
@@ -3078,7 +3078,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3078
3078
  return v.breakdown.length ? D(
3079
3079
  be.FmPopover,
3080
3080
  {
3081
- showPopover: ae.value === v.id,
3081
+ showPopover: se.value === v.id,
3082
3082
  placement: "bottom-end",
3083
3083
  zIndex: 9999,
3084
3084
  "onPopover-changed": (ce) => Ae(v.id, ce)
@@ -3092,7 +3092,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3092
3092
  },
3093
3093
  [ue, D(be.FmIcon, { name: "info", size: "sm", outline: !0 })]
3094
3094
  ),
3095
- default: () => Ao(v.breakdown, v.physicalBalance, v.baseUnit)
3095
+ default: () => Do(v.breakdown, v.physicalBalance, v.baseUnit)
3096
3096
  }
3097
3097
  ) : ue;
3098
3098
  },
@@ -3141,7 +3141,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3141
3141
  return D(
3142
3142
  "div",
3143
3143
  { class: "flex items-center gap-4 justify-end fm-typo-en-body-lg-400" },
3144
- Mr
3144
+ Rr
3145
3145
  );
3146
3146
  const O = me(v);
3147
3147
  if (v === 0)
@@ -3171,7 +3171,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3171
3171
  var pe;
3172
3172
  const v = i.row.original, O = v.stockTakeValue, K = Re.value.find((ce) => ce._id === v.id), V = (pe = K == null ? void 0 : K.defaultCost) == null ? void 0 : pe.measurement, W = v.physicalBalance, ue = v.costPerUnit;
3173
3173
  if (V) {
3174
- const ce = se.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
3174
+ const ce = ne.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
3175
3175
  return D(
3176
3176
  be.FmTooltip,
3177
3177
  { zIndex: 51 },
@@ -3221,7 +3221,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3221
3221
  var pe;
3222
3222
  const v = i.row.original, O = v.systemValue, K = Re.value.find((ce) => ce._id === v.id), V = (pe = K == null ? void 0 : K.defaultCost) == null ? void 0 : pe.measurement, W = v.systemBalance, ue = v.costPerUnit;
3223
3223
  if (V) {
3224
- const ce = se.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
3224
+ const ce = ne.toFormatString({ value: V.conversion }), Ve = `${me(W, { minPrecision: 2, maxPrecision: 4 })} ${v.baseUnit} ÷ ${ce} × ${ue} ${n.value}`;
3225
3225
  return D(
3226
3226
  be.FmTooltip,
3227
3227
  { zIndex: 51 },
@@ -3268,46 +3268,47 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3268
3268
  enableSorting: !1,
3269
3269
  cell(i) {
3270
3270
  const v = i.row.original;
3271
- return S.value.length && v.sourceBuckets.length ? Ya(v.sourceBuckets, v.baseUnit) : Lt(v.baseUnitAmount, v.baseUnit, v.measurements);
3271
+ return S.value.length && v.sourceBuckets.length ? Ha(v.sourceBuckets, v.baseUnit) : Et(v.baseUnitAmount, v.baseUnit, v.measurements);
3272
3272
  }
3273
3273
  }
3274
- ]), Mo = C(() => zt.value.map((m) => m.size ?? 0).reduce((m, i) => m + i)), $t = q(""), Uo = C(() => {
3274
+ ]), Ro = C(() => Gt.value.map((m) => m.size ?? 0).reduce((m, i) => m + i)), At = q(""), No = C(() => {
3275
3275
  var O, K;
3276
3276
  const m = ((K = (O = e.draft) == null ? void 0 : O.negativeStockItems) == null ? void 0 : K.reduce(
3277
3277
  (V, W) => (V[W.sku._id] = W, V),
3278
3278
  {}
3279
3279
  )) ?? {}, i = new Map(re.value.map((V) => [V.id, V.balance]));
3280
3280
  return Re.value.map((V) => {
3281
- var Xt, eo, to, oo, no, ao, so, ro, lo;
3282
- const W = (Xt = To.value.get(V._id)) == null ? void 0 : Xt[0], ue = ((eo = Bo.value.get(V._id)) == null ? void 0 : eo[0]) ?? Ot, pe = ((to = V.defaultCost) == null ? void 0 : to.costPerUnit) ?? Ot, ce = Number(se.toFormatString({ value: pe })), Ve = ((no = (oo = V.defaultCost) == null ? void 0 : oo.measurement) == null ? void 0 : no.conversion) ?? {
3281
+ var Zt, Xt, eo, to, oo, no, ao, so, ro;
3282
+ const W = (Zt = Bo.value.get(V._id)) == null ? void 0 : Zt[0], ue = ((Xt = Io.value.get(V._id)) == null ? void 0 : Xt[0]) ?? Lt, pe = ((eo = V.defaultCost) == null ? void 0 : eo.costPerUnit) ?? Lt, ce = Number(ne.toFormatString({ value: pe })), Ve = ((oo = (to = V.defaultCost) == null ? void 0 : to.measurement) == null ? void 0 : oo.conversion) ?? {
3283
3283
  amount: 1,
3284
3284
  precision: 0
3285
3285
  }, Te = Number(
3286
- se.toFormatString({ value: Ve })
3287
- ), ut = Ro.value.get(V._id), dt = ut ? Number(se.toFormatString({ value: ut })) : 0, Q = jo.value.get(V._id), ye = {};
3286
+ ne.toFormatString({ value: Ve })
3287
+ ), ct = jo.value.get(V._id), ut = ct ? Number(ne.toFormatString({ value: ct })) : 0, Q = To.value.get(V._id), ye = {};
3288
3288
  if (_.value.forEach(($e) => {
3289
- const pt = ye[$e] ?? { amount: 0, precision: 0 }, ft = Q == null ? void 0 : Q[$e];
3290
- ft && (ye[$e] = et(pt, ft));
3289
+ const mt = ye[$e] ?? { amount: 0, precision: 0 }, pt = Q == null ? void 0 : Q[$e];
3290
+ pt && (ye[$e] = Xe(mt, pt));
3291
3291
  }), !W) {
3292
- const $e = Number(se.toFormatString({ value: ue })), pt = 0 - $e, ft = pt * ce / Te, Qo = 0, Jo = $e * ce / Te;
3292
+ const $e = Number(ne.toFormatString({ value: ue })), mt = 0 - $e, pt = mt * ce / Te, qo = 0, Qo = $e * ce / Te;
3293
3293
  return {
3294
3294
  id: V._id,
3295
3295
  code: V.code,
3296
3296
  name: V.name,
3297
- costUnit: ((so = (ao = V.defaultCost) == null ? void 0 : ao.measurement) == null ? void 0 : so.abbrev) ?? null,
3297
+ costUnit: ((ao = (no = V.defaultCost) == null ? void 0 : no.measurement) == null ? void 0 : ao.abbrev) ?? null,
3298
3298
  baseUnit: V.unit.abbrev,
3299
3299
  baseUnitAmount: 0,
3300
3300
  systemBalance: $e,
3301
3301
  physicalBalance: 0,
3302
+ physicalBalanceDecimal: ne.reset(),
3302
3303
  adjustedAmount: -$e,
3303
3304
  adjustedDiffPercentage: -100,
3304
3305
  isTemplateItem: !m[V._id],
3305
3306
  costPerUnit: ce,
3306
- opening: dt,
3307
- varianceQty: pt,
3308
- varianceInCost: ft,
3309
- stockTakeValue: Qo,
3310
- systemValue: Jo,
3307
+ opening: ut,
3308
+ varianceQty: mt,
3309
+ varianceInCost: pt,
3310
+ stockTakeValue: qo,
3311
+ systemValue: Qo,
3311
3312
  adjustmentAmounts: ye,
3312
3313
  customAttributeValues: V.customAttributes ?? {},
3313
3314
  measurements: [],
@@ -3316,61 +3317,62 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3316
3317
  subSources: []
3317
3318
  };
3318
3319
  }
3319
- const we = wt(W), Me = i.get(V._id), ze = ho(
3320
- Me ?? we,
3320
+ const ke = kt(W), Ne = i.get(V._id), ze = bo(
3321
+ Ne ?? ke,
3321
3322
  ue
3322
- ), mt = ue.amount === 0 ? null : _o(ze, {
3323
+ ), dt = ue.amount === 0 ? null : ho(ze, {
3323
3324
  ...ue,
3324
3325
  amount: Math.abs(ue.amount)
3325
- }), Qt = mt ? _t(mt, So) : null, It = Number(se.toFormatString({ value: ue })), Bt = Number(se.toFormatString({ value: we })), Jt = Bt - It, zo = Jt * ce / Te, Ho = Bt * ce / Te, Yo = It * ce / Te, { baseUnitAmount: Wo, measurements: Ko } = Et(W, Dt.value), qo = Do(W, Dt.value), Zt = Ha(V._id, _e.value, Dt.value);
3326
+ }), qt = dt ? ht(dt, Co) : null, Ft = Number(ne.toFormatString({ value: ue })), It = Number(ne.toFormatString({ value: ke })), Qt = It - Ft, Go = Qt * ce / Te, zo = It * ce / Te, Ho = Ft * ce / Te, { baseUnitAmount: Yo, measurements: Wo } = Vt(W, xt.value), Ko = xo(W, xt.value), Jt = za(V._id, _e.value, xt.value);
3326
3327
  return {
3327
3328
  id: V._id,
3328
3329
  code: V.code,
3329
3330
  name: V.name,
3330
- costUnit: ((lo = (ro = V.defaultCost) == null ? void 0 : ro.measurement) == null ? void 0 : lo.abbrev) ?? null,
3331
+ costUnit: ((ro = (so = V.defaultCost) == null ? void 0 : so.measurement) == null ? void 0 : ro.abbrev) ?? null,
3331
3332
  baseUnit: V.unit.abbrev,
3332
- baseUnitAmount: Wo,
3333
- measurements: Ko,
3334
- breakdown: qo,
3335
- systemBalance: It,
3336
- physicalBalance: Bt,
3337
- adjustedAmount: Number(se.toFormatString({ value: ze })),
3338
- adjustedDiffPercentage: Qt ? Number(
3339
- se.toFormatString({
3340
- value: ko(Qt, 2)
3333
+ baseUnitAmount: Yo,
3334
+ measurements: Wo,
3335
+ breakdown: Ko,
3336
+ systemBalance: Ft,
3337
+ physicalBalance: It,
3338
+ physicalBalanceDecimal: ke,
3339
+ adjustedAmount: Number(ne.toFormatString({ value: ze })),
3340
+ adjustedDiffPercentage: qt ? Number(
3341
+ ne.toFormatString({
3342
+ value: _o(qt, 2)
3341
3343
  })
3342
3344
  ) : null,
3343
3345
  isTemplateItem: !m[V._id],
3344
3346
  costPerUnit: ce,
3345
- opening: dt,
3346
- varianceQty: Jt,
3347
- varianceInCost: zo,
3348
- stockTakeValue: Ho,
3349
- systemValue: Yo,
3347
+ opening: ut,
3348
+ varianceQty: Qt,
3349
+ varianceInCost: Go,
3350
+ stockTakeValue: zo,
3351
+ systemValue: Ho,
3350
3352
  adjustmentAmounts: ye,
3351
3353
  customAttributeValues: V.customAttributes ?? {},
3352
- sourceBuckets: Zt,
3353
- subSources: Zt.filter(($e) => $e.isSub).map(($e) => $e.label)
3354
+ sourceBuckets: Jt,
3355
+ subSources: Jt.filter(($e) => $e.isSub).map(($e) => $e.label)
3354
3356
  };
3355
3357
  });
3356
- }), st = C(() => Uo.value.filter((m) => !!(m.isTemplateItem && ie.value.templateItem || !m.isTemplateItem && ie.value.nonTemplateItem))), Ht = C(
3357
- () => st.value.some((m) => m.measurements.some((i) => i.variant === "inactive"))
3358
- ), Yt = C(
3359
- () => st.value.some((m) => m.measurements.some((i) => i.variant === "orphan"))
3360
- ), No = C(
3361
- () => Ht.value || Yt.value
3362
- ), Ct = C(() => {
3358
+ }), at = C(() => No.value.filter((m) => !!(m.isTemplateItem && ie.value.templateItem || !m.isTemplateItem && ie.value.nonTemplateItem))), zt = C(
3359
+ () => at.value.some((m) => m.measurements.some((i) => i.variant === "inactive"))
3360
+ ), Ht = C(
3361
+ () => at.value.some((m) => m.measurements.some((i) => i.variant === "orphan"))
3362
+ ), Mo = C(
3363
+ () => zt.value || Ht.value
3364
+ ), $t = C(() => {
3363
3365
  const m = /* @__PURE__ */ new Set();
3364
3366
  for (const i of Re.value)
3365
3367
  if (i.customAttributes)
3366
3368
  for (const v of Object.keys(i.customAttributes))
3367
3369
  v !== "tag" && m.add(v);
3368
3370
  return Array.from(m).sort();
3369
- }), rt = io({}), Wt = C(
3370
- () => Ct.value.filter((m) => rt[m])
3371
- ), Po = C(() => {
3371
+ }), st = lo({}), Yt = C(
3372
+ () => $t.value.filter((m) => st[m])
3373
+ ), Uo = C(() => {
3372
3374
  var m;
3373
- return e.draft ? $o(e.draft, {
3375
+ return e.draft ? Ao(e.draft, {
3374
3376
  idDisplay: r.value,
3375
3377
  locationName: (m = ve._currentLocation) == null ? void 0 : m.name
3376
3378
  }) : [];
@@ -3412,13 +3414,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3412
3414
  ]
3413
3415
  })
3414
3416
  );
3415
- }), lt = q(!1), it = q(!1), St = q(!1), ct = q(!1), Kt = C(() => {
3417
+ }), rt = q(!1), lt = q(!1), Ct = q(!1), it = q(!1), Wt = C(() => {
3416
3418
  var m;
3417
3419
  return ((m = e.draft) == null ? void 0 : m.status) !== xe.enum.DRAFT ? "Status is not draft." : null;
3418
3420
  });
3419
- async function Vo(m) {
3421
+ async function Po(m) {
3420
3422
  if (e.draft) {
3421
- St.value = !0;
3423
+ Ct.value = !0;
3422
3424
  try {
3423
3425
  const i = await u.approveAllClosingGroups(e.draft._id, m);
3424
3426
  S.value = i;
@@ -3429,62 +3431,62 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3429
3431
  type: "error"
3430
3432
  });
3431
3433
  } finally {
3432
- St.value = !1;
3434
+ Ct.value = !1;
3433
3435
  }
3434
3436
  }
3435
3437
  }
3436
- function Eo(m) {
3437
- qt(() => Vo(m));
3438
+ function Vo(m) {
3439
+ Kt(() => Po(m));
3438
3440
  }
3439
- function Lo() {
3440
- e.draft && (it.value = !0, s.approveDraft(
3441
+ function Eo() {
3442
+ e.draft && (lt.value = !0, s.approveDraft(
3441
3443
  e.draft,
3442
3444
  () => {
3443
- it.value = !1, lt.value = !1, f("submitted");
3445
+ lt.value = !1, rt.value = !1, f("submitted");
3444
3446
  },
3445
3447
  () => {
3446
- it.value = !1;
3448
+ lt.value = !1;
3447
3449
  }
3448
3450
  ));
3449
3451
  }
3450
- let Ft = null;
3451
- function qt(m) {
3452
+ let St = null;
3453
+ function Kt(m) {
3452
3454
  if (Pe.value.length) {
3453
- Ft = m, ct.value = !0;
3455
+ St = m, it.value = !0;
3454
3456
  return;
3455
3457
  }
3456
3458
  m();
3457
3459
  }
3458
- function Oo() {
3459
- e.draft && qt(Lo);
3460
+ function Lo() {
3461
+ e.draft && Kt(Eo);
3460
3462
  }
3461
- function Go() {
3462
- const m = Ft;
3463
- Ft = null, ct.value = !1, m == null || m();
3463
+ function Oo() {
3464
+ const m = St;
3465
+ St = null, it.value = !1, m == null || m();
3464
3466
  }
3465
3467
  return (m, i) => {
3466
- const v = te("FmButtonGroup"), O = te("FmMenuDivider"), K = te("FmCard"), V = te("FmIcon"), W = te("FmButton"), ue = te("FmCircularProgress"), pe = te("FmChip"), ce = te("FmTextField"), Ve = te("FmTable"), Te = te("FmSpacer"), ut = te("FmTooltip"), dt = te("FmSideSheet");
3468
+ const v = te("FmButtonGroup"), O = te("FmMenuDivider"), K = te("FmCard"), V = te("FmIcon"), W = te("FmButton"), ue = te("FmCircularProgress"), pe = te("FmChip"), ce = te("FmTextField"), Ve = te("FmTable"), Te = te("FmSpacer"), ct = te("FmTooltip"), ut = te("FmSideSheet");
3467
3469
  return p(), A(le, null, [
3468
- h(dt, {
3470
+ h(ut, {
3469
3471
  "dismiss-away": "",
3470
3472
  "max-width": 9999,
3471
3473
  "model-value": d(c),
3472
- "onUpdate:modelValue": i[9] || (i[9] = (Q) => ht(c) ? c.value = Q : null),
3474
+ "onUpdate:modelValue": i[9] || (i[9] = (Q) => bt(c) ? c.value = Q : null),
3473
3475
  header: "Closing details"
3474
3476
  }, {
3475
3477
  "side-sheet-footer": ee(() => {
3476
- var Q, ye, we, Me;
3478
+ var Q, ye, ke, Ne;
3477
3479
  return [
3478
- a("div", Br, [
3479
- a("div", Tr, [
3480
+ a("div", Ir, [
3481
+ a("div", Br, [
3480
3482
  ((Q = e.draft) == null ? void 0 : Q.status) === d(xe).enum.DRAFT ? (p(), A(le, { key: 0 }, [
3481
- Kt.value ? (p(), ne(ut, {
3483
+ Wt.value ? (p(), ae(ct, {
3482
3484
  key: 0,
3483
3485
  "z-index": 51,
3484
3486
  placement: "right"
3485
3487
  }, {
3486
3488
  content: ee(() => [
3487
- ge(R(Kt.value), 1)
3489
+ ge(R(Wt.value), 1)
3488
3490
  ]),
3489
3491
  default: ee(() => [
3490
3492
  h(W, {
@@ -3495,14 +3497,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3495
3497
  })
3496
3498
  ]),
3497
3499
  _: 1
3498
- })) : (p(), ne(W, {
3500
+ })) : (p(), ae(W, {
3499
3501
  key: "approve key",
3500
3502
  label: "Approve",
3501
3503
  "data-testid": "closing-draft-approve",
3502
- onClick: i[5] || (i[5] = (ze) => lt.value = !0)
3504
+ onClick: i[5] || (i[5] = (ze) => rt.value = !0)
3503
3505
  }))
3504
3506
  ], 64)) : H("", !0),
3505
- ((ye = e.draft) == null ? void 0 : ye.status) === d(xe).enum.DRAFT ? (p(), ne(W, {
3507
+ ((ye = e.draft) == null ? void 0 : ye.status) === d(xe).enum.DRAFT ? (p(), ae(W, {
3506
3508
  key: 1,
3507
3509
  label: "Reject",
3508
3510
  variant: "destructive",
@@ -3513,7 +3515,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3513
3515
  variant: "tertiary",
3514
3516
  onClick: i[7] || (i[7] = (ze) => c.value = !1)
3515
3517
  }),
3516
- (we = e.draft) != null && we.approvedAt && ((Me = e.draft) == null ? void 0 : Me.status) !== d(xe).enum.COMPLETED ? (p(), ne(Tt, { key: 2 }, {
3518
+ (ke = e.draft) != null && ke.approvedAt && ((Ne = e.draft) == null ? void 0 : Ne.status) !== d(xe).enum.COMPLETED ? (p(), ae(Bt, { key: 2 }, {
3517
3519
  default: ee(() => [
3518
3520
  h(W, {
3519
3521
  label: "Sync",
@@ -3528,28 +3530,28 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3528
3530
  _: 1
3529
3531
  })) : H("", !0)
3530
3532
  ]),
3531
- a("div", jr, [
3533
+ a("div", Tr, [
3532
3534
  i[26] || (i[26] = a("div", { class: "text-xs text-gray-500 uppercase tracking-wide" }, "Total stock take value", -1)),
3533
- a("div", Rr, R(n.value) + " " + R(Co.value.toFixed(2)), 1)
3535
+ a("div", jr, R(n.value) + " " + R($o.value.toFixed(2)), 1)
3534
3536
  ])
3535
3537
  ])
3536
3538
  ];
3537
3539
  }),
3538
3540
  default: ee(() => [
3539
- a("div", Os, [
3541
+ a("div", Ls, [
3540
3542
  a("div", null, [
3541
3543
  h(v, {
3542
- items: At,
3544
+ items: Dt,
3543
3545
  modelValue: Qe.value,
3544
3546
  "onUpdate:modelValue": i[0] || (i[0] = (Q) => Qe.value = Q)
3545
3547
  }, null, 8, ["modelValue"])
3546
3548
  ]),
3547
3549
  Qe.value.value === "overview" ? (p(), A(le, { key: 0 }, [
3548
- h(Tt, { selectable: "" }, {
3550
+ h(Bt, { selectable: "" }, {
3549
3551
  default: ee(() => {
3550
3552
  var Q;
3551
3553
  return [
3552
- a("div", Gs, [
3554
+ a("div", Os, [
3553
3555
  i[13] || (i[13] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, [
3554
3556
  a("div", { class: "flex gap-1" }, "Draft ID")
3555
3557
  ], -1)),
@@ -3566,70 +3568,70 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3566
3568
  default: ee(() => {
3567
3569
  var Q, ye;
3568
3570
  return [
3569
- a("div", zs, [
3571
+ a("div", Gs, [
3570
3572
  i[14] || (i[14] = a("div", { class: "fm-typo-en-body-lg-600" }, "Closing summary", -1)),
3571
- a("div", Hs, [
3573
+ a("div", zs, [
3572
3574
  a("div", {
3573
- class: ke(["fm-status-badge", d(Ue)(((Q = m.draft) == null ? void 0 : Q.status) ?? "DRAFT")])
3575
+ class: we(["fm-status-badge", d(Me)(((Q = m.draft) == null ? void 0 : Q.status) ?? "DRAFT")])
3574
3576
  }, R(d(Ie)(((ye = m.draft) == null ? void 0 : ye.status) ?? "")), 3)
3575
3577
  ])
3576
3578
  ]),
3577
3579
  h(O),
3578
- a("div", Ys, [
3579
- (p(!0), A(le, null, he(Po.value, (we, Me) => (p(), A("div", {
3580
+ a("div", Hs, [
3581
+ (p(!0), A(le, null, he(Uo.value, (ke, Ne) => (p(), A("div", {
3580
3582
  class: "flex flex-col gap-4",
3581
- key: Me
3583
+ key: Ne
3582
3584
  }, [
3583
- a("div", Ws, [
3584
- a("div", Ks, R(we.label), 1)
3585
+ a("div", Ys, [
3586
+ a("div", Ws, R(ke.label), 1)
3585
3587
  ]),
3586
- a("div", qs, R(we.value), 1)
3588
+ a("div", Ks, R(ke.value), 1)
3587
3589
  ]))), 128))
3588
3590
  ])
3589
3591
  ];
3590
3592
  }),
3591
3593
  _: 1
3592
3594
  }),
3593
- P.value.length ? (p(), ne(K, {
3595
+ P.value.length ? (p(), ae(K, {
3594
3596
  key: 0,
3595
3597
  variant: "outlined",
3596
3598
  class: "flex flex-col gap-8 px-12 py-16"
3597
3599
  }, {
3598
3600
  default: ee(() => [
3599
- a("div", Qs, [
3600
- a("div", Js, "Groups " + R(P.value.length), 1),
3601
+ a("div", qs, [
3602
+ a("div", Qs, "Groups " + R(P.value.length), 1),
3601
3603
  i[15] || (i[15] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, " Parent totals = sum of all groups ", -1))
3602
3604
  ]),
3603
3605
  h(O),
3604
- h(La, {
3606
+ h(Ea, {
3605
3607
  groups: P.value,
3606
3608
  onSelect: F
3607
3609
  }, null, 8, ["groups"])
3608
3610
  ]),
3609
3611
  _: 1
3610
3612
  })) : H("", !0),
3611
- No.value ? (p(), A("div", Zs, [
3613
+ Mo.value ? (p(), A("div", Js, [
3612
3614
  h(V, {
3613
3615
  name: "rule",
3614
3616
  size: "sm"
3615
3617
  }),
3616
- a("div", Xs, [
3618
+ a("div", Zs, [
3617
3619
  i[17] || (i[17] = a("div", { class: "fm-typo-en-body-md-600" }, "UOM notes", -1)),
3618
- a("ul", er, [
3619
- Ht.value ? (p(), A("li", tr, i[16] || (i[16] = [
3620
+ a("ul", Xs, [
3621
+ zt.value ? (p(), A("li", er, i[16] || (i[16] = [
3620
3622
  ge(" Measurements highlighted in "),
3621
3623
  a("span", { class: "font-bold" }, "purple", -1),
3622
3624
  ge(" are NetSuite-inactive UOMs (surfaced for audit; their amounts are part of the base total). ")
3623
3625
  ]))) : H("", !0),
3624
- Yt.value ? (p(), A("li", or, " Red highlights are UOMs not on the SKU (ignored). ")) : H("", !0)
3626
+ Ht.value ? (p(), A("li", tr, " Red highlights are UOMs not on the SKU (ignored). ")) : H("", !0)
3625
3627
  ])
3626
3628
  ])
3627
3629
  ])) : H("", !0),
3628
- a("div", nr, [
3629
- a("div", ar, [
3630
+ a("div", or, [
3631
+ a("div", nr, [
3630
3632
  i[18] || (i[18] = a("div", { class: "flex-1 fm-typo-en-title-sm-600 text-fm-color-typo-primary" }, " Closing items ", -1)),
3631
- b.value ? H("", !0) : (p(), A("div", sr, [
3632
- m.draft && m.draft.status !== d(xe).enum.COMPLETED ? (p(), ne(W, {
3633
+ b.value ? H("", !0) : (p(), A("div", ar, [
3634
+ m.draft && m.draft.status !== d(xe).enum.COMPLETED ? (p(), ae(W, {
3633
3635
  key: 0,
3634
3636
  label: "Refresh balance",
3635
3637
  "prepend-icon": "refresh",
@@ -3639,9 +3641,9 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3639
3641
  "border-color": "primary",
3640
3642
  loading: d(Y),
3641
3643
  disabled: d(Y),
3642
- onClick: Gt
3644
+ onClick: Ot
3643
3645
  }, null, 8, ["loading", "disabled"])) : H("", !0),
3644
- h(Tt, null, {
3646
+ h(Bt, null, {
3645
3647
  default: ee(() => [
3646
3648
  h(W, {
3647
3649
  label: "Invalidate Draft Cache",
@@ -3651,7 +3653,7 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3651
3653
  "bg-color": "transparent",
3652
3654
  "border-color": "primary",
3653
3655
  loading: d(Y),
3654
- onClick: Io
3656
+ onClick: Fo
3655
3657
  }, null, 8, ["loading"])
3656
3658
  ]),
3657
3659
  _: 1
@@ -3667,14 +3669,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3667
3669
  m.draft,
3668
3670
  w.value,
3669
3671
  re.value,
3670
- Wt.value
3672
+ Yt.value
3671
3673
  ) : null)
3672
3674
  })
3673
3675
  ]))
3674
3676
  ]),
3675
- b.value ? (p(), A("div", rr, [
3677
+ b.value ? (p(), A("div", sr, [
3676
3678
  i[20] || (i[20] = a("div", { class: "h-80" }, null, -1)),
3677
- a("div", lr, [
3679
+ a("div", rr, [
3678
3680
  a("div", null, [
3679
3681
  h(ue, { size: "md" })
3680
3682
  ]),
@@ -3682,8 +3684,8 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3682
3684
  ]),
3683
3685
  i[21] || (i[21] = a("div", { class: "h-80" }, null, -1))
3684
3686
  ])) : (p(), A(le, { key: 1 }, [
3685
- a("div", ir, [
3686
- a("div", cr, [
3687
+ a("div", lr, [
3688
+ a("div", ir, [
3687
3689
  h(pe, {
3688
3690
  label: "Template Item(s)",
3689
3691
  selected: ie.value.templateItem,
@@ -3696,13 +3698,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3696
3698
  }, null, 8, ["selected"])
3697
3699
  ]),
3698
3700
  h(ce, {
3699
- modelValue: $t.value,
3700
- "onUpdate:modelValue": i[4] || (i[4] = (Q) => $t.value = Q),
3701
+ modelValue: At.value,
3702
+ "onUpdate:modelValue": i[4] || (i[4] = (Q) => At.value = Q),
3701
3703
  placeholder: "Filter items"
3702
3704
  }, null, 8, ["modelValue"])
3703
3705
  ]),
3704
- d(M).skuTags.size ? (p(), A("div", ur, [
3705
- (p(!0), A(le, null, he(d(M).skuTags.keys(), (Q) => (p(), ne(pe, {
3706
+ d(N).skuTags.size ? (p(), A("div", cr, [
3707
+ (p(!0), A(le, null, he(d(N).skuTags.keys(), (Q) => (p(), ae(pe, {
3706
3708
  key: `${Q}`,
3707
3709
  label: `${Q}`,
3708
3710
  selectable: "",
@@ -3710,14 +3712,14 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3710
3712
  onClick: (ye) => oe[`${Q}`] = !oe[`${Q}`]
3711
3713
  }, {
3712
3714
  default: ee(() => [
3713
- oe[`${Q}`] ? (p(), ne(V, {
3715
+ oe[`${Q}`] ? (p(), ae(V, {
3714
3716
  key: 0,
3715
3717
  name: "check",
3716
3718
  class: "text-white",
3717
3719
  size: "sm"
3718
3720
  })) : H("", !0),
3719
3721
  a("span", {
3720
- class: ke([
3722
+ class: we([
3721
3723
  "",
3722
3724
  {
3723
3725
  "text-white fm-typo-en-body-md-600": oe[`${Q}`],
@@ -3729,38 +3731,38 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3729
3731
  _: 2
3730
3732
  }, 1032, ["label", "selected", "onClick"]))), 128))
3731
3733
  ])) : H("", !0),
3732
- Ct.value.length ? (p(), A("div", dr, [
3734
+ $t.value.length ? (p(), A("div", ur, [
3733
3735
  i[22] || (i[22] = a("span", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary self-center" }, "Extra columns:", -1)),
3734
- (p(!0), A(le, null, he(Ct.value, (Q) => (p(), ne(pe, {
3736
+ (p(!0), A(le, null, he($t.value, (Q) => (p(), ae(pe, {
3735
3737
  key: Q,
3736
3738
  label: Q,
3737
3739
  selectable: "",
3738
- selected: rt[Q],
3739
- onClick: (ye) => rt[Q] = !rt[Q]
3740
+ selected: st[Q],
3741
+ onClick: (ye) => st[Q] = !st[Q]
3740
3742
  }, null, 8, ["label", "selected", "onClick"]))), 128))
3741
3743
  ])) : H("", !0),
3742
- a("div", mr, [
3744
+ a("div", dr, [
3743
3745
  a("div", {
3744
- style: yt({ height: "600px", minWidth: `${Mo.value}px` })
3746
+ style: gt({ height: "600px", minWidth: `${Ro.value}px` })
3745
3747
  }, [
3746
3748
  h(Ve, {
3747
- "column-defs": zt.value,
3748
- "row-data": st.value,
3749
- "search-value": $t.value
3749
+ "column-defs": Gt.value,
3750
+ "row-data": at.value,
3751
+ "search-value": At.value
3750
3752
  }, null, 8, ["column-defs", "row-data", "search-value"])
3751
3753
  ], 4)
3752
3754
  ])
3753
3755
  ], 64))
3754
3756
  ])
3755
3757
  ], 64)) : H("", !0),
3756
- Qe.value.value === "history" ? (p(), A("div", pr, [
3757
- Ge.value.length ? (p(), A("div", gr, [
3758
+ Qe.value.value === "history" ? (p(), A("div", mr, [
3759
+ Ge.value.length ? (p(), A("div", vr, [
3758
3760
  (p(!0), A(le, null, he(Ge.value, (Q, ye) => (p(), A(le, { key: ye }, [
3759
- a("div", yr, [
3760
- a("div", br, [
3761
- a("div", hr, [
3761
+ a("div", gr, [
3762
+ a("div", yr, [
3763
+ a("div", br, [
3762
3764
  a("div", {
3763
- class: ke([
3765
+ class: we([
3764
3766
  {
3765
3767
  "bg-fm-color-primary": ye !== 0,
3766
3768
  "bg-white": ye === 0
@@ -3770,9 +3772,9 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3770
3772
  }, null, 2)
3771
3773
  ]),
3772
3774
  i[25] || (i[25] = a("div", { class: "h-24 w-24 bg-fm-color-primary rounded-full" }, null, -1)),
3773
- a("div", _r, [
3775
+ a("div", hr, [
3774
3776
  a("div", {
3775
- class: ke([
3777
+ class: we([
3776
3778
  {
3777
3779
  "bg-fm-color-primary": ye < Ge.value.length - 1,
3778
3780
  "bg-white": ye >= Ge.value.length - 1
@@ -3782,16 +3784,16 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3782
3784
  }, null, 2)
3783
3785
  ])
3784
3786
  ]),
3785
- a("div", kr, [
3786
- a("div", wr, R(Q.header), 1),
3787
- a("div", xr, R(Q.date), 1)
3787
+ a("div", _r, [
3788
+ a("div", kr, R(Q.header), 1),
3789
+ a("div", wr, R(Q.date), 1)
3788
3790
  ])
3789
3791
  ]),
3790
- a("div", Dr, [
3791
- a("div", Ar, [
3792
- a("div", $r, [
3792
+ a("div", xr, [
3793
+ a("div", Dr, [
3794
+ a("div", Ar, [
3793
3795
  a("div", {
3794
- class: ke([
3796
+ class: we([
3795
3797
  {
3796
3798
  "bg-fm-color-primary": ye < Ge.value.length - 1,
3797
3799
  "bg-white": ye >= Ge.value.length - 1
@@ -3801,21 +3803,21 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3801
3803
  }, null, 2)
3802
3804
  ])
3803
3805
  ]),
3804
- a("div", Cr, [
3806
+ a("div", $r, [
3805
3807
  h(K, {
3806
3808
  variant: "outlined",
3807
3809
  class: "py-12 px-16"
3808
3810
  }, {
3809
3811
  default: ee(() => [
3810
- a("div", Sr, [
3811
- (p(!0), A(le, null, he(Q.info, (we, Me) => (p(), A("div", {
3812
- key: Me,
3812
+ a("div", Cr, [
3813
+ (p(!0), A(le, null, he(Q.info, (ke, Ne) => (p(), A("div", {
3814
+ key: Ne,
3813
3815
  class: "flex flex-col gap-4"
3814
3816
  }, [
3815
- a("div", Fr, R(we == null ? void 0 : we.label), 1),
3816
- a("div", Ir, [
3817
- (p(!0), A(le, null, he(we == null ? void 0 : we.values, (ze, mt) => (p(), A("div", {
3818
- key: mt,
3817
+ a("div", Sr, R(ke == null ? void 0 : ke.label), 1),
3818
+ a("div", Fr, [
3819
+ (p(!0), A(le, null, he(ke == null ? void 0 : ke.values, (ze, dt) => (p(), A("div", {
3820
+ key: dt,
3819
3821
  class: "fm-typo-en-body-lg-600"
3820
3822
  }, R(ze), 1))), 128))
3821
3823
  ])
@@ -3827,13 +3829,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3827
3829
  ])
3828
3830
  ])
3829
3831
  ], 64))), 128))
3830
- ])) : (p(), A("div", fr, [
3832
+ ])) : (p(), A("div", pr, [
3831
3833
  h(Te),
3832
3834
  a("div", null, [
3833
3835
  a("img", {
3834
- src: d(wo),
3836
+ src: d(ko),
3835
3837
  alt: "List is empty"
3836
- }, null, 8, vr)
3838
+ }, null, 8, fr)
3837
3839
  ]),
3838
3840
  i[23] || (i[23] = a("div", { class: "fm-typo-en-body-lg-600" }, R("No records found"), -1)),
3839
3841
  i[24] || (i[24] = a("div", { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary px-16" }, R("You can track approval and rejection history here"), -1)),
@@ -3845,26 +3847,26 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3845
3847
  ]),
3846
3848
  _: 1
3847
3849
  }, 8, ["model-value"]),
3848
- d(c) && e.draft ? (p(), ne(Fa, {
3850
+ d(c) && e.draft ? (p(), ae(Sa, {
3849
3851
  key: 0,
3850
- show: lt.value,
3851
- "onUpdate:show": i[10] || (i[10] = (Q) => lt.value = Q),
3852
+ show: rt.value,
3853
+ "onUpdate:show": i[10] || (i[10] = (Q) => rt.value = Q),
3852
3854
  refreshing: d(Y),
3853
- approving: it.value,
3854
- "approving-all-groups": St.value,
3855
+ approving: lt.value,
3856
+ "approving-all-groups": Ct.value,
3855
3857
  draft: e.draft,
3856
3858
  groups: S.value,
3857
- onRefresh: Gt,
3858
- onApprove: Oo,
3859
- onApproveAllGroups: Eo
3859
+ onRefresh: Ot,
3860
+ onApprove: Lo,
3861
+ onApproveAllGroups: Vo
3860
3862
  }, null, 8, ["show", "refreshing", "approving", "approving-all-groups", "draft", "groups"])) : H("", !0),
3861
- h(Ls, {
3862
- show: ct.value,
3863
- "onUpdate:show": i[11] || (i[11] = (Q) => ct.value = Q),
3863
+ h(Es, {
3864
+ show: it.value,
3865
+ "onUpdate:show": i[11] || (i[11] = (Q) => it.value = Q),
3864
3866
  items: d(Pe),
3865
- onContinue: Go
3867
+ onContinue: Oo
3866
3868
  }, null, 8, ["show", "items"]),
3867
- h(Is, {
3869
+ h(Fs, {
3868
3870
  show: z.value,
3869
3871
  "onUpdate:show": i[12] || (i[12] = (Q) => z.value = Q),
3870
3872
  group: X.value ?? void 0,
@@ -3876,13 +3878,13 @@ const js = { class: "flex items-center gap-4 justify-start w-full" }, Rs = { cla
3876
3878
  }
3877
3879
  });
3878
3880
  var Ce = /* @__PURE__ */ ((t) => (t.ready = "ready", t.negative = "negative", t.systemNegative = "systemNegative", t))(Ce || {});
3879
- async function Nr(t) {
3881
+ async function Mr(t) {
3880
3882
  return new Promise((o, e) => {
3881
3883
  const n = new FileReader();
3882
3884
  n.onload = (l) => {
3883
3885
  var r;
3884
3886
  try {
3885
- const s = (r = l.target) == null ? void 0 : r.result, u = bn(s, { type: "array" }), c = u.SheetNames[0], b = u.Sheets[c], g = gt.sheet_to_json(b, {
3887
+ const s = (r = l.target) == null ? void 0 : r.result, u = yn(s, { type: "array" }), c = u.SheetNames[0], b = u.Sheets[c], g = vt.sheet_to_json(b, {
3886
3888
  header: 1,
3887
3889
  defval: ""
3888
3890
  }), S = (X) => String(X).trim().toLowerCase().replace(/^\uFEFF/, ""), J = g.findIndex(
@@ -3912,14 +3914,14 @@ async function Nr(t) {
3912
3914
  }, n.onerror = e, n.readAsArrayBuffer(t);
3913
3915
  });
3914
3916
  }
3915
- function Pr(t) {
3917
+ function Ur(t) {
3916
3918
  const o = /* @__PURE__ */ new Map();
3917
3919
  return t.forEach((e) => {
3918
3920
  const n = o.get(e.itemCode) || 0;
3919
3921
  o.set(e.itemCode, n + e.quantity);
3920
3922
  }), o;
3921
3923
  }
3922
- function Vr(t, o) {
3924
+ function Pr(t, o) {
3923
3925
  const e = [], n = [];
3924
3926
  for (const [l, r] of o.entries()) {
3925
3927
  const s = t[l];
@@ -3939,21 +3941,21 @@ function Vr(t, o) {
3939
3941
  }
3940
3942
  return { mergedItems: e, unrecognisedItemCodes: n };
3941
3943
  }
3942
- function Er(t, o) {
3943
- const e = t.filter((c) => !c.isInactive), n = Fn().format("YYYY-MM-DD"), l = `${o} - ${n}.csv`, r = [
3944
+ function Vr(t, o) {
3945
+ const e = t.filter((c) => !c.isInactive), n = Sn().format("YYYY-MM-DD"), l = `${o} - ${n}.csv`, r = [
3944
3946
  ["Code", "Name", "Balance"],
3945
3947
  ...e.map((c) => [c.code, c.name, ""])
3946
- ], s = gt.aoa_to_sheet(r), u = gt.book_new();
3947
- gt.book_append_sheet(u, s, "Template"), yn(u, l, { bookType: "csv" });
3948
+ ], s = vt.aoa_to_sheet(r), u = vt.book_new();
3949
+ vt.book_append_sheet(u, s, "Template"), gn(u, l, { bookType: "csv" });
3948
3950
  }
3949
- function Lr() {
3950
- const t = q([]), o = q([]), e = q(!1), n = Ut(), l = qe(), r = kt(), s = C(
3951
+ function Er() {
3952
+ const t = q([]), o = q([]), e = q(!1), n = Nt(), l = qe(), r = _t(), s = C(
3951
3953
  () => t.value.some((g) => g.status === Ce.negative)
3952
3954
  );
3953
3955
  async function u(g) {
3954
3956
  t.value = [], o.value = [], e.value = !0;
3955
3957
  try {
3956
- const S = await Nr(g), J = Pr(S), E = n.skuByCode, { mergedItems: B, unrecognisedItemCodes: I } = Vr(
3958
+ const S = await Mr(g), J = Ur(S), E = n.skuByCode, { mergedItems: B, unrecognisedItemCodes: I } = Pr(
3957
3959
  E,
3958
3960
  J
3959
3961
  ), P = await r.readStockBalance(), Z = P.skus ?? [];
@@ -4000,7 +4002,7 @@ function Lr() {
4000
4002
  name: Z.sku.name,
4001
4003
  unit: Z.sku.unit
4002
4004
  },
4003
- baseAmount: fn(Z.physicalCount, Z.sku.unit.precision),
4005
+ baseAmount: pn(Z.physicalCount, Z.sku.unit.precision),
4004
4006
  measurementsAmounts: []
4005
4007
  }), B = S.map(E), I = J.map(E), P = {
4006
4008
  effectiveAt: (/* @__PURE__ */ new Date()).toISOString(),
@@ -4012,21 +4014,21 @@ function Lr() {
4012
4014
  function b() {
4013
4015
  var S;
4014
4016
  const g = ((S = l.currentLocation) == null ? void 0 : S.name) ?? "template";
4015
- Er(n.skus, g);
4017
+ Vr(n.skus, g);
4016
4018
  }
4017
4019
  return { mergedItems: t, unrecognisedItemCodes: o, hasBlockingErrors: s, isLoading: e, onFileUpload: u, submit: c, downloadTemplate: b };
4018
4020
  }
4019
- const Or = { class: "flex flex-col gap-16" }, Gr = {
4021
+ const Lr = { class: "flex flex-col gap-16" }, Or = {
4020
4022
  key: 0,
4021
4023
  class: "px-16 py-12 rounded-8 bg-fm-color-danger-weak text-fm-color-danger-default"
4022
- }, zr = { key: 1 }, Hr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, Yr = { class: "mt-8 flex flex-col gap-4" }, Wr = { key: 2 }, Kr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, qr = { class: "mt-8 flex flex-col gap-4" }, Qr = /* @__PURE__ */ De({
4024
+ }, Gr = { key: 1 }, zr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, Hr = { class: "mt-8 flex flex-col gap-4" }, Yr = { key: 2 }, Wr = { class: "fm-typo-en-label-md-400 cursor-pointer" }, Kr = { class: "mt-8 flex flex-col gap-4" }, qr = /* @__PURE__ */ De({
4023
4025
  __name: "ClosingDraftCreatePreviewTable",
4024
4026
  props: {
4025
4027
  items: {},
4026
4028
  unrecognisedItemCodes: {}
4027
4029
  },
4028
4030
  setup(t) {
4029
- const o = t, { t: e } = tt(), n = C(
4031
+ const o = t, { t: e } = et(), n = C(
4030
4032
  () => o.items.filter((u) => u.status === Ce.negative)
4031
4033
  ), l = C(
4032
4034
  () => o.items.filter((u) => u.status === Ce.systemNegative)
@@ -4130,23 +4132,23 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4130
4132
  ];
4131
4133
  return (u, c) => {
4132
4134
  const b = te("FmTable");
4133
- return p(), A("div", Or, [
4134
- n.value.length > 0 ? (p(), A("div", Gr, [
4135
+ return p(), A("div", Lr, [
4136
+ n.value.length > 0 ? (p(), A("div", Or, [
4135
4137
  ge(R(d(e)("inventory.closing.draft.createDraft.previewTable.cannotSubmitNegative")) + " ", 1),
4136
4138
  a("strong", null, R(n.value.map((g) => g.sku.code).join(", ")), 1)
4137
4139
  ])) : H("", !0),
4138
- l.value.length > 0 ? (p(), A("details", zr, [
4139
- a("summary", Hr, R(d(e)("inventory.closing.draft.createDraft.previewTable.systemNegativeNote", [l.value.length])), 1),
4140
- a("ul", Yr, [
4140
+ l.value.length > 0 ? (p(), A("details", Gr, [
4141
+ a("summary", zr, R(d(e)("inventory.closing.draft.createDraft.previewTable.systemNegativeNote", [l.value.length])), 1),
4142
+ a("ul", Hr, [
4141
4143
  (p(!0), A(le, null, he(l.value, (g) => (p(), A("li", {
4142
4144
  key: g.sku._id,
4143
4145
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
4144
4146
  }, R(g.sku.code), 1))), 128))
4145
4147
  ])
4146
4148
  ])) : H("", !0),
4147
- u.unrecognisedItemCodes.length > 0 ? (p(), A("details", Wr, [
4148
- a("summary", Kr, R(d(e)("inventory.closing.draft.createDraft.previewTable.unrecognisedNote", [u.unrecognisedItemCodes.length])), 1),
4149
- a("ul", qr, [
4149
+ u.unrecognisedItemCodes.length > 0 ? (p(), A("details", Yr, [
4150
+ a("summary", Wr, R(d(e)("inventory.closing.draft.createDraft.previewTable.unrecognisedNote", [u.unrecognisedItemCodes.length])), 1),
4151
+ a("ul", Kr, [
4150
4152
  (p(!0), A(le, null, he(u.unrecognisedItemCodes, (g) => (p(), A("li", {
4151
4153
  key: g,
4152
4154
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
@@ -4161,20 +4163,20 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4161
4163
  ]);
4162
4164
  };
4163
4165
  }
4164
- }), Jr = { class: "flex flex-col gap-16" }, Zr = { class: "flex flex-col gap-8" }, Xr = { class: "fm-typo-en-body-lg-600" }, el = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, tl = { class: "fm-corner-radius-md p-16 flex items-center gap-16 border border-fm-color-border-default" }, ol = { class: "flex flex-col flex-1 gap-4" }, nl = { class: "fm-typo-en-body-md-600" }, al = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, sl = {
4166
+ }), Qr = { class: "flex flex-col gap-16" }, Jr = { class: "flex flex-col gap-8" }, Zr = { class: "fm-typo-en-body-lg-600" }, Xr = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, el = { class: "fm-corner-radius-md p-16 flex items-center gap-16 border border-fm-color-border-default" }, tl = { class: "flex flex-col flex-1 gap-4" }, ol = { class: "fm-typo-en-body-md-600" }, nl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, al = {
4165
4167
  key: 0,
4166
4168
  class: "flex flex-col gap-8"
4167
- }, rl = { class: "fm-typo-en-body-lg-600" }, ll = {
4169
+ }, sl = { class: "fm-typo-en-body-lg-600" }, rl = {
4168
4170
  key: 0,
4169
4171
  class: "fm-typo-en-body-sm-400 text-fm-color-system-error-300 flex items-center gap-8"
4170
- }, il = { class: "grid grid-cols-[repeat(3,1fr)] gap-12" }, cl = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center gap-4" }, ul = { class: "flex items-center gap-8 w-full" }, dl = /* @__PURE__ */ De({
4172
+ }, ll = { class: "grid grid-cols-[repeat(3,1fr)] gap-12" }, il = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary flex items-center gap-4" }, cl = { class: "flex items-center gap-8 w-full" }, ul = /* @__PURE__ */ De({
4171
4173
  __name: "ClosingDraftCreateSideSheet",
4172
4174
  props: {
4173
4175
  show: { type: Boolean }
4174
4176
  },
4175
4177
  emits: ["update:show", "submitted"],
4176
4178
  setup(t, { emit: o }) {
4177
- const e = t, n = o, l = Mt(e, "show"), { t: r } = tt(), s = Ne(), u = q("upload"), c = q(null), b = q(!1), { mergedItems: g, unrecognisedItemCodes: S, hasBlockingErrors: J, isLoading: E, onFileUpload: B, submit: I, downloadTemplate: P } = Lr(), Z = C(
4179
+ const e = t, n = o, l = Rt(e, "show"), { t: r } = et(), s = Ue(), u = q("upload"), c = q(null), b = q(!1), { mergedItems: g, unrecognisedItemCodes: S, hasBlockingErrors: J, isLoading: E, onFileUpload: B, submit: I, downloadTemplate: P } = Er(), Z = C(
4178
4180
  () => c.value && !E.value && g.value.length > 0
4179
4181
  ), X = C(() => {
4180
4182
  const k = g.value.filter(
@@ -4230,49 +4232,49 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4230
4232
  }
4231
4233
  return (k, x) => {
4232
4234
  const w = te("FmCircularProgress"), re = te("FmIcon"), _ = te("FmButton"), $ = te("FmCard"), L = te("FmSideSheet");
4233
- return p(), ne(L, {
4235
+ return p(), ae(L, {
4234
4236
  "dismiss-away": "",
4235
4237
  "max-width": 9999,
4236
4238
  "model-value": d(l),
4237
- "onUpdate:modelValue": x[2] || (x[2] = (M) => ht(l) ? l.value = M : null),
4239
+ "onUpdate:modelValue": x[2] || (x[2] = (N) => bt(l) ? l.value = N : null),
4238
4240
  header: d(r)("inventory.closing.draft.createDraft.title")
4239
4241
  }, {
4240
4242
  default: ee(() => [
4241
- a("div", Jr, [
4243
+ a("div", Qr, [
4242
4244
  u.value === "upload" ? (p(), A(le, { key: 0 }, [
4243
- a("div", Zr, [
4244
- a("div", Xr, R(d(r)("inventory.closing.draft.createDraft.importCsv")), 1),
4245
- a("div", el, R(d(r)("inventory.closing.draft.createDraft.uploadDescription")), 1),
4246
- h(In, {
4247
- class: ke({ "h-[200px]": !c.value }),
4245
+ a("div", Jr, [
4246
+ a("div", Zr, R(d(r)("inventory.closing.draft.createDraft.importCsv")), 1),
4247
+ a("div", Xr, R(d(r)("inventory.closing.draft.createDraft.uploadDescription")), 1),
4248
+ h(Fn, {
4249
+ class: we({ "h-[200px]": !c.value }),
4248
4250
  accept: ".csv",
4249
4251
  disabled: d(E),
4250
4252
  onFileUpload: z
4251
- }, en({ _: 2 }, [
4253
+ }, Xo({ _: 2 }, [
4252
4254
  c.value ? {
4253
4255
  name: "default",
4254
- fn: ee(({ openFileDialog: M }) => [
4255
- a("div", tl, [
4256
- d(E) ? (p(), ne(w, {
4256
+ fn: ee(({ openFileDialog: N }) => [
4257
+ a("div", el, [
4258
+ d(E) ? (p(), ae(w, {
4257
4259
  key: 0,
4258
4260
  size: "md",
4259
4261
  color: "neutral-gray-200"
4260
- })) : (p(), ne(re, {
4262
+ })) : (p(), ae(re, {
4261
4263
  key: 1,
4262
4264
  name: "check_circle",
4263
4265
  color: "system-success-400",
4264
4266
  size: "lg"
4265
4267
  })),
4266
- a("div", ol, [
4267
- a("div", nl, R(c.value.name), 1),
4268
- a("div", al, R(d(E) ? d(r)("inventory.closing.draft.createDraft.processing") : d(r)("inventory.closing.draft.createDraft.itemsLoaded", [d(g).length])), 1)
4268
+ a("div", tl, [
4269
+ a("div", ol, R(c.value.name), 1),
4270
+ a("div", nl, R(d(E) ? d(r)("inventory.closing.draft.createDraft.processing") : d(r)("inventory.closing.draft.createDraft.itemsLoaded", [d(g).length])), 1)
4269
4271
  ]),
4270
- d(E) ? H("", !0) : (p(), ne(_, {
4272
+ d(E) ? H("", !0) : (p(), ae(_, {
4271
4273
  key: 2,
4272
4274
  label: d(r)("inventory.closing.draft.createDraft.replaceFile"),
4273
4275
  variant: "secondary",
4274
4276
  "prepend-icon": "autorenew",
4275
- onClick: M
4277
+ onClick: N
4276
4278
  }, null, 8, ["label", "onClick"]))
4277
4279
  ])
4278
4280
  ]),
@@ -4280,9 +4282,9 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4280
4282
  } : void 0
4281
4283
  ]), 1032, ["class", "disabled"])
4282
4284
  ]),
4283
- Z.value ? (p(), A("div", sl, [
4284
- a("div", rl, R(d(r)("inventory.closing.draft.createDraft.importSummary")), 1),
4285
- d(J) ? (p(), A("div", ll, [
4285
+ Z.value ? (p(), A("div", al, [
4286
+ a("div", sl, R(d(r)("inventory.closing.draft.createDraft.importSummary")), 1),
4287
+ d(J) ? (p(), A("div", rl, [
4286
4288
  h(re, {
4287
4289
  name: "error",
4288
4290
  size: "sm",
@@ -4295,35 +4297,35 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4295
4297
  class: "flex flex-col gap-12 px-16 py-12"
4296
4298
  }, {
4297
4299
  default: ee(() => [
4298
- a("div", il, [
4299
- (p(!0), A(le, null, he(X.value, (M) => (p(), A("div", {
4300
- key: M.label,
4300
+ a("div", ll, [
4301
+ (p(!0), A(le, null, he(X.value, (N) => (p(), A("div", {
4302
+ key: N.label,
4301
4303
  class: "flex flex-col gap-4"
4302
4304
  }, [
4303
- a("div", cl, [
4304
- M.isError ? (p(), ne(re, {
4305
+ a("div", il, [
4306
+ N.isError ? (p(), ae(re, {
4305
4307
  key: 0,
4306
4308
  name: "error",
4307
4309
  size: "sm",
4308
4310
  color: "system-error-300"
4309
4311
  })) : H("", !0),
4310
- M.isWarning && !M.isError ? (p(), ne(re, {
4312
+ N.isWarning && !N.isError ? (p(), ae(re, {
4311
4313
  key: 1,
4312
4314
  name: "warning",
4313
4315
  size: "sm",
4314
4316
  color: "system-warning-300"
4315
4317
  })) : H("", !0),
4316
- a("span", null, R(M.label), 1)
4318
+ a("span", null, R(N.label), 1)
4317
4319
  ]),
4318
4320
  a("div", {
4319
- class: ke([
4321
+ class: we([
4320
4322
  "fm-typo-en-body-lg-600",
4321
4323
  {
4322
- "text-fm-color-system-error-300": M.isError,
4323
- "text-fm-color-system-warning-300": M.isWarning && !M.isError
4324
+ "text-fm-color-system-error-300": N.isError,
4325
+ "text-fm-color-system-warning-300": N.isWarning && !N.isError
4324
4326
  }
4325
4327
  ])
4326
- }, R(M.value), 3)
4328
+ }, R(N.value), 3)
4327
4329
  ]))), 128))
4328
4330
  ])
4329
4331
  ]),
@@ -4331,7 +4333,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4331
4333
  })
4332
4334
  ])) : H("", !0)
4333
4335
  ], 64)) : H("", !0),
4334
- u.value === "preview" ? (p(), ne(Qr, {
4336
+ u.value === "preview" ? (p(), ae(qr, {
4335
4337
  key: 1,
4336
4338
  items: d(g),
4337
4339
  "unrecognised-item-codes": d(S)
@@ -4339,22 +4341,22 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4339
4341
  ])
4340
4342
  ]),
4341
4343
  "side-sheet-footer": ee(() => [
4342
- a("div", ul, [
4343
- u.value === "preview" ? (p(), ne(_, {
4344
+ a("div", cl, [
4345
+ u.value === "preview" ? (p(), ae(_, {
4344
4346
  key: 0,
4345
4347
  variant: "secondary",
4346
4348
  label: d(r)("inventory.common.back"),
4347
4349
  "prepend-icon": "arrow_back",
4348
- onClick: x[0] || (x[0] = (M) => u.value = "upload")
4350
+ onClick: x[0] || (x[0] = (N) => u.value = "upload")
4349
4351
  }, null, 8, ["label"])) : H("", !0),
4350
- u.value === "upload" ? (p(), ne(_, {
4352
+ u.value === "upload" ? (p(), ae(_, {
4351
4353
  key: 1,
4352
4354
  variant: "primary",
4353
4355
  label: d(r)("inventory.common.next"),
4354
4356
  disabled: !c.value || d(E),
4355
- onClick: x[1] || (x[1] = (M) => u.value = "preview")
4357
+ onClick: x[1] || (x[1] = (N) => u.value = "preview")
4356
4358
  }, null, 8, ["label", "disabled"])) : H("", !0),
4357
- u.value === "preview" ? (p(), ne(Bn, {
4359
+ u.value === "preview" ? (p(), ae(In, {
4358
4360
  key: 2,
4359
4361
  label: d(r)("inventory.closing.draft.createDraft.submit"),
4360
4362
  disabled: d(J) || d(g).length === 0 || b.value,
@@ -4368,7 +4370,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4368
4370
  label: d(r)("inventory.common.close"),
4369
4371
  onClick: T
4370
4372
  }, null, 8, ["label"]),
4371
- u.value === "upload" ? (p(), ne(_, {
4373
+ u.value === "upload" ? (p(), ae(_, {
4372
4374
  key: 3,
4373
4375
  class: "ml-auto",
4374
4376
  variant: "secondary",
@@ -4382,28 +4384,28 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4382
4384
  }, 8, ["model-value", "header"]);
4383
4385
  };
4384
4386
  }
4385
- }), ml = ["onClick"], pl = { class: "flex items-start gap-8" }, fl = { class: "fm-typo-body-md-400 line-clamp-3 w-full" }, vl = { class: "flex flex-col gap-8" }, gl = { class: "flex items-start gap-4" }, yl = { class: "flex-1 flex flex-col gap-8" }, bl = { class: "flex flex-col" }, hl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, _l = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, kl = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, wl = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, xl = {
4387
+ }), dl = ["onClick"], ml = { class: "flex items-start gap-8" }, pl = { class: "fm-typo-body-md-400 line-clamp-3 w-full" }, fl = { class: "flex flex-col gap-8" }, vl = { class: "flex items-start gap-4" }, gl = { class: "flex-1 flex flex-col gap-8" }, yl = { class: "flex flex-col" }, bl = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, hl = { class: "fm-typo-en-body-lg-600 text-fm-color-typo-primary" }, _l = { class: "fm-typo-en-body-lg-400 text-fm-color-typo-secondary line-clamp-2" }, kl = { class: "fm-typo-en-body-lg-400 line-clamp-2" }, wl = {
4386
4388
  key: 0,
4387
4389
  class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary"
4388
- }, ti = /* @__PURE__ */ De({
4390
+ }, ei = /* @__PURE__ */ De({
4389
4391
  __name: "ClosingDraftView",
4390
4392
  setup(t) {
4391
- const { t: o } = tt(), { viewDraft: e } = bt(), { viewClosingDraftProps: n, viewClosingDraftShow: l } = dn(bt()), r = qe(), s = xo(), u = nn(), { breakpoints: c } = sn();
4393
+ const { t: o } = et(), { viewDraft: e } = yt(), { viewClosingDraftProps: n, viewClosingDraftShow: l } = un(yt()), r = qe(), s = wo(), u = on(), { breakpoints: c } = an();
4392
4394
  r.watchLocation(s.onLocationChanged);
4393
- const b = q(""), g = Ne();
4395
+ const b = q(""), g = Ue();
4394
4396
  function S(_) {
4395
4397
  const $ = /* @__PURE__ */ new Date();
4396
4398
  return $.setDate($.getDate() - _), $;
4397
4399
  }
4398
4400
  const J = (() => {
4399
- const _ = Ke, $ = /* @__PURE__ */ new Date(), L = S($.getDay()), M = S($.getDay() + 1), ve = S($.getDay() + 7), oe = new Date($.getFullYear(), $.getMonth(), 1), U = new Date($.getFullYear(), $.getMonth() + 1, 0), f = new Date($.getFullYear(), $.getMonth() - 1, 1), y = new Date($.getFullYear(), $.getMonth(), 0);
4401
+ const _ = Ke, $ = /* @__PURE__ */ new Date(), L = S($.getDay()), N = S($.getDay() + 1), ve = S($.getDay() + 7), oe = new Date($.getFullYear(), $.getMonth(), 1), M = new Date($.getFullYear(), $.getMonth() + 1, 0), f = new Date($.getFullYear(), $.getMonth() - 1, 1), y = new Date($.getFullYear(), $.getMonth(), 0);
4400
4402
  return [
4401
4403
  { label: "Today", value: { startDate: _($), endDate: _($) } },
4402
4404
  { label: "Yesterday", value: { startDate: _(S(1)), endDate: _(S(1)) } },
4403
4405
  { label: "This week", value: { startDate: _(L), endDate: _($) } },
4404
- { label: "Last week", value: { startDate: _(ve), endDate: _(M) } },
4406
+ { label: "Last week", value: { startDate: _(ve), endDate: _(N) } },
4405
4407
  { label: "Last 7 days", value: { startDate: _(S(7)), endDate: _(S(1)) } },
4406
- { label: "This month", value: { startDate: _(oe), endDate: _(U) } },
4408
+ { label: "This month", value: { startDate: _(oe), endDate: _(M) } },
4407
4409
  { label: "Last month", value: { startDate: _(f), endDate: _(y) } }
4408
4410
  ];
4409
4411
  })(), E = q();
@@ -4419,7 +4421,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4419
4421
  const P = q(!1), Z = C(() => c.value.xs || c.value.sm), X = C(() => Z.value ? 10 : 20), z = C(
4420
4422
  () => {
4421
4423
  var _;
4422
- return ((_ = r._currentLocation) == null ? void 0 : _.type) === un.enum.warehouse;
4424
+ return ((_ = r._currentLocation) == null ? void 0 : _.type) === cn.enum.warehouse;
4423
4425
  }
4424
4426
  );
4425
4427
  function F(_) {
@@ -4440,7 +4442,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4440
4442
  return _.column.columnDef.meta;
4441
4443
  }
4442
4444
  function w(_) {
4443
- const $ = ea(k(_)), L = $.totalAmount.toLocaleString("en-MY", {
4445
+ const $ = Xn(k(_)), L = $.totalAmount.toLocaleString("en-MY", {
4444
4446
  minimumFractionDigits: 2,
4445
4447
  maximumFractionDigits: 2
4446
4448
  });
@@ -4468,14 +4470,14 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4468
4470
  return [...z.value ? [_] : [], $];
4469
4471
  });
4470
4472
  return (_, $) => (p(), A(le, null, [
4471
- h(an, {
4473
+ h(nn, {
4472
4474
  title: d(o)("inventory.closing.draft.title"),
4473
4475
  actions: re.value,
4474
4476
  "onClick:action": F
4475
4477
  }, {
4476
4478
  default: ee(() => [
4477
4479
  a("div", {
4478
- class: ke([
4480
+ class: we([
4479
4481
  "flex flex-col gap-8 max-h-full",
4480
4482
  {
4481
4483
  "p-0": Z.value,
@@ -4483,7 +4485,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4483
4485
  }
4484
4486
  ])
4485
4487
  }, [
4486
- h(Dn, {
4488
+ h(xn, {
4487
4489
  "change-location": "",
4488
4490
  searchable: "",
4489
4491
  "date-range-query": "",
@@ -4493,8 +4495,8 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4493
4495
  "date-range": I.value,
4494
4496
  "onUpdate:dateRange": $[1] || ($[1] = (L) => I.value = L)
4495
4497
  }, null, 8, ["predefined-date-ranges", "search", "date-range"]),
4496
- h(An, {
4497
- style: yt(d(u).tableHeight),
4498
+ h(Dn, {
4499
+ style: gt(d(u).tableHeight),
4498
4500
  "column-defs": d(s).columnDefs,
4499
4501
  rows: d(s).drafts,
4500
4502
  "onUpdate:rows": $[2] || ($[2] = (L) => d(s).drafts = L),
@@ -4505,7 +4507,7 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4505
4507
  ref: E,
4506
4508
  "search-value": b.value,
4507
4509
  loading: d(s).loading,
4508
- "fetch-detail": (L, M) => d(e)(L._id, M),
4510
+ "fetch-detail": (L, N) => d(e)(L._id, N),
4509
4511
  "detail-to-row": d(s).detailToRow,
4510
4512
  "page-size": X.value
4511
4513
  }, {
@@ -4513,78 +4515,78 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4513
4515
  a("tr", {
4514
4516
  class: "border-b border-fm-color-neutral-gray-100 hover:bg-fm-color-opacity-sm cursor-pointer",
4515
4517
  "data-testid": "closing-draft-row",
4516
- onClick: (M) => B(L.original)
4518
+ onClick: (N) => B(L.original)
4517
4519
  }, [
4518
- (p(!0), A(le, null, he(L.getVisibleCells(), (M) => {
4519
- var ve, oe, U, f;
4520
+ (p(!0), A(le, null, he(L.getVisibleCells(), (N) => {
4521
+ var ve, oe, M, f;
4520
4522
  return p(), A("td", {
4521
- key: M.id,
4522
- class: ke([
4523
+ key: N.id,
4524
+ class: we([
4523
4525
  "h-[56px] text-fm-color-typo-primary align-top",
4524
- ((ve = x(M)) == null ? void 0 : ve.cellClass) ?? "px-16 py-12"
4526
+ ((ve = x(N)) == null ? void 0 : ve.cellClass) ?? "px-16 py-12"
4525
4527
  ]),
4526
- style: yt({
4527
- width: (oe = x(M)) == null ? void 0 : oe.width,
4528
- maxWidth: (U = x(M)) == null ? void 0 : U.maxWidth,
4529
- textAlign: ((f = x(M)) == null ? void 0 : f.textAlign) ?? "left"
4528
+ style: gt({
4529
+ width: (oe = x(N)) == null ? void 0 : oe.width,
4530
+ maxWidth: (M = x(N)) == null ? void 0 : M.maxWidth,
4531
+ textAlign: ((f = x(N)) == null ? void 0 : f.textAlign) ?? "left"
4530
4532
  })
4531
4533
  }, [
4532
- a("div", pl, [
4533
- a("span", fl, [
4534
+ a("div", ml, [
4535
+ a("span", pl, [
4534
4536
  h(d(Je), {
4535
- render: M.column.columnDef.cell,
4536
- props: M.getContext()
4537
+ render: N.column.columnDef.cell,
4538
+ props: N.getContext()
4537
4539
  }, null, 8, ["render", "props"])
4538
4540
  ])
4539
4541
  ])
4540
4542
  ], 6);
4541
4543
  }), 128))
4542
- ], 8, ml)
4544
+ ], 8, dl)
4543
4545
  ]),
4544
4546
  "list-row": ee((L) => [
4545
- a("div", vl, [
4546
- a("div", gl, [
4547
- h(Tn, {
4547
+ a("div", fl, [
4548
+ a("div", vl, [
4549
+ h(Bn, {
4548
4550
  class: "flex-1",
4549
4551
  "data-testid": "closing-draft-row",
4550
4552
  row: L,
4551
- onRowClick: (M) => B(M)
4553
+ onRowClick: (N) => B(N)
4552
4554
  }, {
4553
- default: ee((M) => {
4554
- var ve, oe, U, f, y, N, Y, de, j, G, ie, ae, Ae, _e, Be, ot, nt, at, Pe, Re;
4555
+ default: ee((N) => {
4556
+ var ve, oe, M, f, y, U, Y, de, j, G, ie, se, Ae, _e, Be, tt, ot, nt, Pe, Re;
4555
4557
  return [
4556
- a("div", yl, [
4557
- a("div", bl, [
4558
- a("div", hl, [
4558
+ a("div", gl, [
4559
+ a("div", yl, [
4560
+ a("div", bl, [
4559
4561
  h(d(Je), {
4560
- render: (U = (oe = (ve = M._id) == null ? void 0 : ve.column) == null ? void 0 : oe.columnDef) == null ? void 0 : U.cell,
4561
- props: (y = (f = M._id) == null ? void 0 : f.getContext) == null ? void 0 : y.call(f)
4562
+ render: (M = (oe = (ve = N._id) == null ? void 0 : ve.column) == null ? void 0 : oe.columnDef) == null ? void 0 : M.cell,
4563
+ props: (y = (f = N._id) == null ? void 0 : f.getContext) == null ? void 0 : y.call(f)
4562
4564
  }, null, 8, ["render", "props"])
4563
4565
  ]),
4564
- a("div", _l, [
4566
+ a("div", hl, [
4565
4567
  h(d(Je), {
4566
- render: (de = (Y = (N = M.name) == null ? void 0 : N.column) == null ? void 0 : Y.columnDef) == null ? void 0 : de.cell,
4567
- props: (G = (j = M.name) == null ? void 0 : j.getContext) == null ? void 0 : G.call(j)
4568
+ render: (de = (Y = (U = N.name) == null ? void 0 : U.column) == null ? void 0 : Y.columnDef) == null ? void 0 : de.cell,
4569
+ props: (G = (j = N.name) == null ? void 0 : j.getContext) == null ? void 0 : G.call(j)
4568
4570
  }, null, 8, ["render", "props"])
4569
4571
  ]),
4570
- a("div", kl, R([
4572
+ a("div", _l, R([
4571
4573
  ...L.original.previewItemNames,
4572
4574
  ...L.original.itemCount - L.original.previewItemNames.length > 0 ? [
4573
4575
  `and ${L.original.itemCount - L.original.previewItemNames.length} more items`
4574
4576
  ] : []
4575
4577
  ].join(", ")), 1),
4576
- a("div", wl, [
4578
+ a("div", kl, [
4577
4579
  h(d(Je), {
4578
- render: (Ae = (ae = (ie = M.ref) == null ? void 0 : ie.column) == null ? void 0 : ae.columnDef) == null ? void 0 : Ae.cell,
4579
- props: (Be = (_e = M.ref) == null ? void 0 : _e.getContext) == null ? void 0 : Be.call(_e)
4580
+ render: (Ae = (se = (ie = N.ref) == null ? void 0 : ie.column) == null ? void 0 : se.columnDef) == null ? void 0 : Ae.cell,
4581
+ props: (Be = (_e = N.ref) == null ? void 0 : _e.getContext) == null ? void 0 : Be.call(_e)
4580
4582
  }, null, 8, ["render", "props"])
4581
4583
  ])
4582
4584
  ]),
4583
- k(L).length ? (p(), A("div", xl, R(w(L)), 1)) : H("", !0),
4585
+ k(L).length ? (p(), A("div", wl, R(w(L)), 1)) : H("", !0),
4584
4586
  a("div", null, [
4585
4587
  h(d(Je), {
4586
- render: (at = (nt = (ot = M.status) == null ? void 0 : ot.column) == null ? void 0 : nt.columnDef) == null ? void 0 : at.cell,
4587
- props: (Re = (Pe = M.status) == null ? void 0 : Pe.getContext) == null ? void 0 : Re.call(Pe)
4588
+ render: (nt = (ot = (tt = N.status) == null ? void 0 : tt.column) == null ? void 0 : ot.columnDef) == null ? void 0 : nt.cell,
4589
+ props: (Re = (Pe = N.status) == null ? void 0 : Pe.getContext) == null ? void 0 : Re.call(Pe)
4588
4590
  }, null, 8, ["render", "props"])
4589
4591
  ])
4590
4592
  ])
@@ -4601,15 +4603,15 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4601
4603
  ]),
4602
4604
  _: 1
4603
4605
  }, 8, ["title", "actions"]),
4604
- h(dl, {
4606
+ h(ul, {
4605
4607
  show: P.value,
4606
4608
  "onUpdate:show": $[3] || ($[3] = (L) => P.value = L),
4607
4609
  onSubmitted: d(s).refresh
4608
4610
  }, null, 8, ["show", "onSubmitted"]),
4609
- (p(), ne(tn, { to: "body" }, [
4610
- h(Ur, on(d(n), {
4611
+ (p(), ae(en, { to: "body" }, [
4612
+ h(Nr, tn(d(n), {
4611
4613
  show: d(l),
4612
- "onUpdate:show": $[4] || ($[4] = (L) => ht(l) ? l.value = L : null),
4614
+ "onUpdate:show": $[4] || ($[4] = (L) => bt(l) ? l.value = L : null),
4613
4615
  onSubmitted: $[5] || ($[5] = () => (l.value = !1, d(s).refresh())),
4614
4616
  onRefresh: $[6] || ($[6] = (L) => d(s).updateDraftRef(L))
4615
4617
  }), null, 16, ["show"])
@@ -4618,5 +4620,5 @@ const Or = { class: "flex flex-col gap-16" }, Gr = {
4618
4620
  }
4619
4621
  });
4620
4622
  export {
4621
- ti as default
4623
+ ei as default
4622
4624
  };