@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,761 +0,0 @@
1
- import { defineComponent as se, ref as p, computed as D, watch as ue, resolveComponent as x, createElementBlock as y, openBlock as u, createVNode as _, withCtx as $, createElementVNode as a, createCommentVNode as w, toDisplayString as r, unref as d, Fragment as j, createBlock as G, createTextVNode as ae, renderList as re, normalizeClass as fe, h as W, Teleport as ge } from "vue";
2
- import { _ as ve } from "./SingleColumnLayout.vue_vue_type_script_setup_true_lang-DpwneGOV.js";
3
- import { useI18n as le, useCoreStore as he } from "@feedmepos/mf-common";
4
- import { G as me, B as N, a as _e, u as be } from "./app-CURawLhs.js";
5
- import { F as ce } from "./FmAdminBadge-DlplQOHb.js";
6
- import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-D_y8VcCI.js";
7
- import { _ as de } from "./CursorPaginatedTable.vue_vue_type_script_setup_true_lang-BCUhtL_B.js";
8
- import { useSnackbar as pe, useDialog as De } from "@feedmepos/ui-library";
9
- import { u as xe } from "./stock-B9XerL9c.js";
10
- import { g as Se, f as we } from "./recalculationUtils-BYN393eE.js";
11
- import { _ as Ve } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js";
12
- const Ce = { class: "fm-typo-en-heading-lg-600" }, Fe = { class: "flex flex-col gap-16" }, Ae = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Ie = { class: "flex flex-col gap-8" }, $e = { class: "fm-typo-en-body-md-600" }, Be = { class: "flex flex-col gap-8" }, Te = { class: "fm-typo-en-body-md-600" }, Le = {
13
- key: 0,
14
- class: "text-red-500 text-sm mt-2"
15
- }, Re = { class: "fm-typo-en-body-sm-400" }, Ne = {
16
- key: 1,
17
- class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
18
- }, Oe = {
19
- key: 0,
20
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
21
- }, Pe = {
22
- key: 1,
23
- class: "flex flex-col gap-8"
24
- }, Me = { class: "fm-typo-en-body-sm-600" }, Ke = { class: "flex flex-col gap-4" }, Ue = { key: 0 }, Ee = { key: 1 }, He = { key: 2 }, We = {
25
- key: 1,
26
- class: "flex flex-col gap-8"
27
- }, ze = { class: "fm-typo-en-body-md-600" }, je = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Ge = { class: "flex items-center justify-between" }, Ye = { class: "fm-typo-en-body-sm-600" }, Je = { class: "flex items-center gap-8" }, Qe = {
28
- key: 0,
29
- class: "fm-typo-en-body-xs-600 px-8 py-4 rounded-4 bg-fm-color-neutral-100 text-fm-color-typo-secondary"
30
- }, Xe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Ze = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, qe = {
31
- key: 0,
32
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
33
- }, et = {
34
- key: 1,
35
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
36
- }, tt = {
37
- key: 2,
38
- class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
39
- }, ot = {
40
- key: 0,
41
- class: "flex gap-8 ml-auto"
42
- }, nt = {
43
- key: 1,
44
- class: "flex gap-8 ml-auto"
45
- }, at = 15 * 60 * 1e3, st = /* @__PURE__ */ se({
46
- __name: "RecalculationDialog",
47
- emits: ["submitted"],
48
- setup(Z, { expose: f, emit: h }) {
49
- const A = h, { t: i } = le(), T = xe(), V = me(), k = pe(), I = p(!1), g = p(""), v = p(""), L = p([]), O = p([]), s = p(!1), n = p([]), S = p(!1), m = p([]), C = p(!1), B = D(
50
- () => Se(L.value, O.value)
51
- ), F = D(() => we(
52
- m.value.filter((t) => !!t.closingId).map((t) => ({ closingId: t.closingId, draftCreatedAt: new Date(N(t._id)) }))
53
- )), P = D(() => {
54
- if (g.value)
55
- try {
56
- const t = N(g.value);
57
- if (t)
58
- return t;
59
- } catch (t) {
60
- console.error("Error parsing date from opening ID:", t);
61
- }
62
- }), M = D(() => {
63
- if (!g.value || !v.value) return "";
64
- const t = N(g.value);
65
- if (t && v.value) {
66
- const c = new Date(t).getTime();
67
- if (new Date(v.value).getTime() <= c)
68
- return i("inventory.stock.recalculation.error.endDateBeforeOpening");
69
- }
70
- return "";
71
- }), z = D(() => {
72
- if (!v.value) return !1;
73
- const t = new Date(v.value), c = /* @__PURE__ */ new Date();
74
- return c.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), t >= c;
75
- }), K = D(() => !!g.value && !!v.value && !M.value), Y = D(() => n.value.some(
76
- (t) => !t.completedAt && !t.failedReason && Date.now() - new Date(t.createdAt).getTime() < at
77
- ));
78
- async function J() {
79
- I.value = !0, await Promise.all([q(), U(), E()]), g.value = "", v.value = "";
80
- }
81
- f({
82
- open: J
83
- });
84
- async function q() {
85
- s.value = !0;
86
- try {
87
- const t = await V.getLastNClosings(30);
88
- L.value = t;
89
- } catch (t) {
90
- console.error("Error fetching recent closings:", t), k.open({
91
- title: i("common.error"),
92
- message: "Failed to fetch recent closings",
93
- type: "error"
94
- });
95
- } finally {
96
- s.value = !1;
97
- }
98
- }
99
- async function U() {
100
- try {
101
- const t = await V.getLastNStockSnapshots(30);
102
- O.value = t;
103
- } catch (t) {
104
- console.error("Error fetching recent snapshots:", t);
105
- }
106
- }
107
- async function E() {
108
- S.value = !0;
109
- try {
110
- const t = await T.recalculation.recalculationRequests();
111
- n.value = t;
112
- } catch (t) {
113
- console.error("Error fetching recalculation requests:", t);
114
- } finally {
115
- S.value = !1;
116
- }
117
- }
118
- async function ee() {
119
- if (!g.value || !v.value) {
120
- m.value = [];
121
- return;
122
- }
123
- C.value = !0;
124
- try {
125
- const t = new Date(v.value);
126
- t.setHours(23, 59, 59, 999);
127
- const c = await T.recalculation.getAffectedClosingDrafts(
128
- g.value,
129
- t.toISOString()
130
- );
131
- m.value = c;
132
- } catch {
133
- k.open({
134
- title: i("common.error"),
135
- message: "Failed to fetch affected closing drafts",
136
- type: "error"
137
- }), m.value = [];
138
- } finally {
139
- C.value = !1;
140
- }
141
- }
142
- ue(
143
- [g, v],
144
- () => {
145
- g.value && v.value && !M.value ? ee() : m.value = [];
146
- },
147
- { immediate: !1 }
148
- );
149
- async function te() {
150
- if (!(!K.value || !v.value)) {
151
- s.value = !0;
152
- try {
153
- const t = new Date(v.value);
154
- if (t.setHours(23, 59, 59, 999), await T.recalculation.scheduleRecalculation({
155
- openingId: g.value,
156
- untilDate: t.toISOString(),
157
- recalculateBySnapshot: !0
158
- }), m.value.length > 0) {
159
- const c = m.value.map((H) => H._id);
160
- await T.recalculation.scheduleInvalidateClosingDraftCache(c);
161
- }
162
- k.open({
163
- title: i("common.success"),
164
- message: "Stock recalculation has been scheduled successfully",
165
- type: "success"
166
- }), await E(), I.value = !1, A("submitted");
167
- } catch (t) {
168
- console.error("Error scheduling recalculation:", t), k.open({
169
- title: i("common.error"),
170
- message: "Failed to schedule stock recalculation",
171
- type: "error"
172
- });
173
- } finally {
174
- s.value = !1;
175
- }
176
- }
177
- }
178
- return (t, c) => {
179
- const H = x("FmSelect"), oe = x("FmDatePicker"), Q = x("FmSnackbar"), X = x("FmAlert"), o = x("FmButton"), l = x("FmDialog");
180
- return u(), y("div", null, [
181
- _(l, {
182
- modelValue: I.value,
183
- "onUpdate:modelValue": c[4] || (c[4] = (e) => I.value = e),
184
- "close-button": "",
185
- dismissAway: "",
186
- "max-width": "600px"
187
- }, {
188
- "dialog-header": $(() => [
189
- a("div", Ce, r(d(i)("inventory.stock.recalculation.title")), 1)
190
- ]),
191
- "dialog-footer": $(() => [
192
- Y.value ? (u(), y("div", nt, [
193
- _(o, {
194
- variant: "tertiary",
195
- onClick: c[3] || (c[3] = (e) => I.value = !1),
196
- label: d(i)("common.close")
197
- }, null, 8, ["label"])
198
- ])) : (u(), y("div", ot, [
199
- _(o, {
200
- variant: "tertiary",
201
- onClick: c[2] || (c[2] = (e) => I.value = !1),
202
- disabled: s.value,
203
- label: d(i)("common.cancel")
204
- }, null, 8, ["disabled", "label"]),
205
- _(o, {
206
- variant: "primary",
207
- onClick: te,
208
- disabled: !K.value || s.value,
209
- loading: s.value,
210
- label: d(i)("inventory.stock.recalculation.schedule")
211
- }, null, 8, ["disabled", "loading", "label"])
212
- ]))
213
- ]),
214
- default: $(() => [
215
- a("div", Fe, [
216
- a("div", Ae, r(d(i)("inventory.stock.recalculation.description")), 1),
217
- Y.value ? w("", !0) : (u(), y(j, { key: 0 }, [
218
- a("div", Ie, [
219
- a("p", $e, [
220
- ae(r(d(i)("inventory.stock.recalculation.openingDate")) + " ", 1),
221
- c[5] || (c[5] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
222
- ]),
223
- c[6] || (c[6] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select from the last 30 closing or snapshot records as the opening date for recalculation. ", -1)),
224
- _(H, {
225
- modelValue: g.value,
226
- "onUpdate:modelValue": c[0] || (c[0] = (e) => g.value = e),
227
- items: B.value,
228
- placeholder: d(i)("inventory.stock.recalculation.selectOpening"),
229
- loading: s.value,
230
- disabled: s.value
231
- }, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
232
- ]),
233
- a("div", Be, [
234
- a("p", Te, [
235
- ae(r(d(i)("inventory.stock.recalculation.untilDate")) + " ", 1),
236
- c[7] || (c[7] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
237
- ]),
238
- c[8] || (c[8] = a("div", { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary mb-4" }, " Select the end date for recalculation. Must be after the selected opening date. ", -1)),
239
- _(oe, {
240
- modelValue: v.value,
241
- "onUpdate:modelValue": c[1] || (c[1] = (e) => v.value = e),
242
- placeholder: d(i)("inventory.stock.recalculation.selectDate"),
243
- min: P.value,
244
- disabled: !g.value || s.value
245
- }, null, 8, ["modelValue", "placeholder", "min", "disabled"]),
246
- M.value ? (u(), y("div", Le, r(M.value), 1)) : w("", !0),
247
- z.value ? (u(), G(Q, {
248
- key: 1,
249
- title: "Warning",
250
- variant: "warning",
251
- description: "You have selected today or a future date. The stock balance will be refreshed accordingly."
252
- })) : w("", !0)
253
- ]),
254
- g.value && v.value && !M.value ? (u(), G(X, {
255
- key: 0,
256
- type: "info"
257
- }, {
258
- default: $(() => [
259
- a("div", Re, r(d(i)("inventory.stock.recalculation.info")), 1)
260
- ]),
261
- _: 1
262
- })) : w("", !0),
263
- m.value.length > 0 ? (u(), y("div", Ne, [
264
- C.value ? (u(), y("div", Oe, " Loading affected closing drafts... ")) : (u(), y("div", Pe, [
265
- a("div", Me, " Affected closing draft(s): " + r(m.value.length), 1),
266
- a("div", Ke, [
267
- (u(!0), y(j, null, re(m.value, (e) => (u(), y("div", {
268
- key: e._id,
269
- class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
270
- }, [
271
- c[9] || (c[9] = ae(" • ")),
272
- e.closingId && F.value.get(e.closingId) ? (u(), y("span", Ue, r(F.value.get(e.closingId)), 1)) : (u(), y("span", Ee, r(e._id), 1)),
273
- e.effectiveAt ? (u(), y("span", He, " (" + r(new Date(e.effectiveAt).toLocaleString()) + ") ", 1)) : w("", !0)
274
- ]))), 128))
275
- ])
276
- ]))
277
- ])) : w("", !0)
278
- ], 64)),
279
- n.value.length > 0 ? (u(), y("div", We, [
280
- a("p", ze, r(d(i)("inventory.stock.recalculation.recentRequests")), 1),
281
- a("div", je, [
282
- (u(!0), y(j, null, re(n.value, (e) => {
283
- var R;
284
- return u(), y("div", {
285
- key: e._id,
286
- class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
287
- }, [
288
- a("div", Ge, [
289
- a("div", Ye, r(d(i)("inventory.stock.recalculation.requestedAt")) + ": " + r(new Date(e.createdAt).toLocaleString()), 1),
290
- a("div", Je, [
291
- (R = e.meta) != null && R.openingType ? (u(), y("div", Qe, r(e.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : w("", !0),
292
- a("div", {
293
- class: fe(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
294
- "bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
295
- "bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
296
- "bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
297
- }])
298
- }, r(e.failedReason ? d(i)("inventory.stock.recalculation.status.failed") : e.completedAt ? d(i)("inventory.stock.recalculation.status.completed") : d(i)("inventory.stock.recalculation.status.inProgress")), 3)
299
- ])
300
- ]),
301
- a("div", Xe, r(d(i)("inventory.stock.recalculation.from")) + ": " + r(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
302
- a("div", Ze, r(d(i)("inventory.stock.recalculation.to")) + ": " + r(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
303
- e.createdBy ? (u(), y("div", qe, r(d(i)("inventory.stock.recalculation.requestedBy")) + ": " + r(e.createdBy.name || e.createdBy.id), 1)) : w("", !0),
304
- e.completedAt ? (u(), y("div", et, r(d(i)("inventory.stock.recalculation.completedAt")) + ": " + r(new Date(e.completedAt).toLocaleString()), 1)) : w("", !0),
305
- e.failedReason ? (u(), y("div", tt, r(e.failedReason), 1)) : w("", !0)
306
- ]);
307
- }), 128))
308
- ])
309
- ])) : w("", !0)
310
- ])
311
- ]),
312
- _: 1
313
- }, 8, ["modelValue"])
314
- ]);
315
- };
316
- }
317
- }), lt = { class: "fm-typo-en-heading-lg-600" }, it = { class: "flex flex-col gap-16" }, rt = { class: "flex flex-col gap-4" }, ct = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, dt = { class: "fm-typo-en-body-md-400" }, ut = { class: "flex flex-col gap-4" }, mt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, pt = { class: "fm-typo-en-body-md-400" }, yt = { class: "flex flex-col gap-4" }, ft = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, gt = { class: "flex gap-8 ml-auto" }, vt = /* @__PURE__ */ se({
318
- __name: "ClosingDetailDialog",
319
- props: {
320
- modelValue: { type: Boolean },
321
- type: {},
322
- data: {}
323
- },
324
- emits: ["update:modelValue"],
325
- setup(Z, { emit: f }) {
326
- const { t: h } = le(), A = _e(), i = Z, T = f, V = D({
327
- get: () => i.modelValue,
328
- set: (s) => T("update:modelValue", s)
329
- }), k = p("");
330
- ue(V, (s) => {
331
- s || (k.value = "");
332
- });
333
- const I = D(() => {
334
- var s;
335
- return ((s = i.data) == null ? void 0 : s.skus) ?? [];
336
- }), g = D(() => {
337
- var m;
338
- const s = (m = i.data) == null ? void 0 : m._id;
339
- if (!s) return "-";
340
- const n = N(s);
341
- return new Date(n).toLocaleString();
342
- }), v = D(() => i.type === "closing" ? h("inventory.closing.history.closingDetail", "Closing Detail") : h("inventory.closing.history.snapshotDetail", "Snapshot Detail")), L = D(() => I.value.map((s) => {
343
- const n = A.skuById[s.id] ?? null, S = !n;
344
- return {
345
- id: s.id,
346
- sku: n,
347
- skuName: (n == null ? void 0 : n.name) ?? s.id,
348
- skuCode: (n == null ? void 0 : n.code) ?? "-",
349
- balance: s.balance ?? { amount: 0, precision: 0 },
350
- isMissing: S,
351
- costs: s.costs,
352
- weightedAverage: s.weightedAverage
353
- };
354
- })), O = [
355
- {
356
- accessorKey: "skuName",
357
- header: () => h("inventory.ingredient.name", "Ingredient Name"),
358
- cell: (s) => {
359
- const n = s.row.original;
360
- return n.isMissing ? W("div", { class: "flex items-center gap-8" }, [
361
- W("span", {}, n.id),
362
- W(
363
- "span",
364
- {
365
- class: "px-8 py-2 rounded-4 bg-fm-color-danger-weak text-fm-color-danger-default fm-typo-en-label-sm-400"
366
- },
367
- "Missing"
368
- )
369
- ]) : s.getValue();
370
- }
371
- },
372
- {
373
- accessorKey: "skuCode",
374
- header: () => h("inventory.ingredient.code", "Code")
375
- },
376
- {
377
- id: "balance",
378
- header: () => h("inventory.closing.history.balance", "Balance"),
379
- cell: (s) => {
380
- var m;
381
- const n = s.row.original;
382
- if (n.isMissing || !((m = n.sku) != null && m.unit))
383
- return `${n.balance.amount / Math.pow(10, n.balance.precision)}`;
384
- const S = {
385
- unit: n.sku.unit,
386
- sku: n.sku,
387
- amount: n.balance,
388
- defaultTrackingMeasurement: n.sku.trackingMeasurement ?? void 0
389
- };
390
- return W(Ve, S);
391
- },
392
- size: 180
393
- },
394
- {
395
- accessorKey: "weightedAverage",
396
- header: () => h("inventory.closing.history.weightedAvgCost", "Weighted Avg Cost"),
397
- cell: (s) => {
398
- const n = s.getValue();
399
- if (!n) return "-";
400
- const S = n.amount ?? 0, m = n.precision ?? 0, C = n.currency ?? "", B = S / Math.pow(10, m);
401
- return `${C} ${B.toFixed(2)}`;
402
- }
403
- }
404
- ];
405
- return (s, n) => {
406
- const S = x("FmTextField"), m = x("FmTable"), C = x("FmButton"), B = x("FmDialog");
407
- return u(), G(B, {
408
- modelValue: V.value,
409
- "onUpdate:modelValue": n[2] || (n[2] = (F) => V.value = F),
410
- "close-button": "",
411
- dismissAway: "",
412
- "max-width": "900px"
413
- }, {
414
- "dialog-header": $(() => [
415
- a("div", lt, r(v.value), 1)
416
- ]),
417
- default: $(() => {
418
- var F;
419
- return [
420
- a("div", it, [
421
- a("div", rt, [
422
- a("div", ct, r(i.type === "closing" ? d(h)("inventory.closing.history.closingId") : d(h)("inventory.closing.history.snapshotId", "Snapshot ID")), 1),
423
- a("div", dt, r(((F = i.data) == null ? void 0 : F._id) ?? "-"), 1)
424
- ]),
425
- a("div", ut, [
426
- a("div", mt, r(d(h)("inventory.closing.history.date")), 1),
427
- a("div", pt, r(g.value), 1)
428
- ]),
429
- a("div", yt, [
430
- a("div", ft, r(d(h)("inventory.closing.history.ingredientBalances", "Ingredient Balances")) + " (" + r(I.value.length) + ") ", 1),
431
- _(S, {
432
- modelValue: k.value,
433
- "onUpdate:modelValue": n[0] || (n[0] = (P) => k.value = P),
434
- placeholder: "Filter by code or name"
435
- }, null, 8, ["modelValue"]),
436
- _(m, {
437
- "row-data": L.value,
438
- "column-defs": O,
439
- pagination: { pageSize: 10 },
440
- "search-value": k.value
441
- }, null, 8, ["row-data", "search-value"])
442
- ])
443
- ])
444
- ];
445
- }),
446
- "dialog-footer": $(() => [
447
- a("div", gt, [
448
- _(C, {
449
- variant: "tertiary",
450
- onClick: n[1] || (n[1] = (F) => V.value = !1),
451
- label: "Close"
452
- })
453
- ])
454
- ]),
455
- _: 1
456
- }, 8, ["modelValue"]);
457
- };
458
- }
459
- }), ht = { class: "flex flex-col gap-16 p-16" }, _t = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, bt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, kt = { class: "flex flex-col gap-16" }, Dt = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, xt = { class: "flex gap-8 ml-auto" }, Rt = /* @__PURE__ */ se({
460
- __name: "ClosingHistoryView",
461
- setup(Z) {
462
- var Q, X;
463
- const { t: f } = le(), h = me(), A = be(), i = he(), T = De(), V = pe(), k = p("closings"), I = D(() => [
464
- { label: f("inventory.closing.history.closingsTab"), value: "closings" },
465
- { label: f("inventory.closing.history.snapshotsTab"), value: "snapshots" }
466
- ]), g = p([]), v = p(0), L = p([]), O = p(0);
467
- let s = A.currentLocationDBName;
468
- async function n(o) {
469
- return A.currentLocationDBName ? (s = A.currentLocationDBName, h.listClosingsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
470
- }
471
- async function S(o) {
472
- return A.currentLocationDBName ? (s = A.currentLocationDBName, h.listStockSnapshotsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
473
- }
474
- function m() {
475
- g.value = [], v.value++;
476
- }
477
- function C() {
478
- L.value = [], O.value++;
479
- }
480
- const B = p(!1), F = p("closing"), P = p(null);
481
- function M(o) {
482
- return [
483
- o.getFullYear(),
484
- String(o.getMonth() + 1).padStart(2, "0"),
485
- String(o.getDate()).padStart(2, "0")
486
- ].join("-");
487
- }
488
- const z = () => M(new Date(Date.now() - 864e5)), K = p(z()), Y = D(() => {
489
- const o = [
490
- {
491
- label: f("inventory.stock.recalculation.title"),
492
- value: "recalculation",
493
- prependIcon: "history",
494
- isAdminOnly: !0
495
- }
496
- ];
497
- return k.value === "closings" ? o.push(
498
- {
499
- label: f("inventory.closing.history.initiate_opening"),
500
- value: "initiateOpening",
501
- prependIcon: "add_box",
502
- isAdminOnly: !0
503
- },
504
- {
505
- label: "Refresh",
506
- value: "refreshOpening",
507
- prependIcon: "refresh"
508
- }
509
- ) : o.push(
510
- {
511
- label: f("inventory.closing.history.initiate_snapshot"),
512
- value: "initiateStockSnapshot",
513
- prependIcon: "camera",
514
- isAdminOnly: !0
515
- },
516
- {
517
- label: "Refresh",
518
- value: "refreshStockSnapshot",
519
- prependIcon: "refresh"
520
- }
521
- ), o;
522
- }), J = p();
523
- function q(o) {
524
- var l;
525
- switch (o) {
526
- case "recalculation":
527
- return (l = J.value) == null ? void 0 : l.open();
528
- case "initiateOpening": {
529
- T.open({
530
- title: "Initiate Opening Balance",
531
- message: "Initiate opening balance if no opening balance exists for the current location.",
532
- primaryActions: { text: "Confirm", close: !0 }
533
- }).onPrimary(async () => {
534
- try {
535
- await h.initiateClosing(), V.open({
536
- message: "Opening balance initiated successfully.",
537
- type: "success"
538
- }), await m();
539
- } catch (e) {
540
- V.open({
541
- message: e.message || "Failed to initiate opening balance. Please try again.",
542
- type: "error"
543
- });
544
- }
545
- });
546
- break;
547
- }
548
- case "initiateStockSnapshot": {
549
- K.value = z(), U.value = !0;
550
- break;
551
- }
552
- case "refreshOpening": {
553
- m();
554
- break;
555
- }
556
- case "refreshStockSnapshot": {
557
- C();
558
- break;
559
- }
560
- }
561
- }
562
- const U = p(!1), E = p(!1), ee = z();
563
- async function te() {
564
- E.value = !0;
565
- try {
566
- await h.initiateStockSnapshot(K.value), V.open({
567
- message: "Stock snapshot created successfully.",
568
- type: "success"
569
- }), U.value = !1, await C();
570
- } catch (o) {
571
- V.open({
572
- message: o.message || "Failed to create stock snapshot. Please try again.",
573
- type: "error"
574
- });
575
- } finally {
576
- E.value = !1;
577
- }
578
- }
579
- const t = [
580
- ...(Q = i.sessionUser.value) != null && Q.role.isAdmin ? [
581
- {
582
- accessorKey: "_id",
583
- header: () => W(ce, {}, () => `${f("inventory.closing.history.closingId")}`),
584
- cell: (o) => o.getValue()
585
- }
586
- ] : [],
587
- {
588
- accessorKey: "_id",
589
- id: "date",
590
- header: () => f("inventory.closing.history.date"),
591
- cell: (o) => {
592
- const l = o.getValue(), e = N(l);
593
- return new Date(e).toLocaleDateString();
594
- }
595
- },
596
- {
597
- accessorKey: "_id",
598
- id: "time",
599
- header: () => f("inventory.closing.history.time"),
600
- cell: (o) => {
601
- const l = o.getValue(), e = N(l);
602
- return new Date(e).toLocaleTimeString();
603
- }
604
- },
605
- {
606
- accessorKey: "ref",
607
- header: () => f("inventory.closing.history.createdFrom"),
608
- cell: (o) => o.getValue() || "-"
609
- }
610
- ], c = [
611
- ...(X = i.sessionUser.value) != null && X.role.isAdmin ? [
612
- {
613
- accessorKey: "_id",
614
- header: () => W(
615
- ce,
616
- {},
617
- () => `${f("inventory.closing.history.snapshotId", "Snapshot ID")}`
618
- ),
619
- cell: (o) => o.getValue()
620
- }
621
- ] : [],
622
- {
623
- accessorKey: "_id",
624
- id: "date",
625
- header: () => f("inventory.closing.history.date"),
626
- cell: (o) => {
627
- const l = o.getValue(), e = N(l);
628
- return new Date(e).toLocaleDateString();
629
- }
630
- },
631
- {
632
- accessorKey: "_id",
633
- id: "time",
634
- header: () => f("inventory.closing.history.time"),
635
- cell: (o) => {
636
- const l = o.getValue(), e = N(l);
637
- return new Date(e).toLocaleTimeString();
638
- }
639
- },
640
- {
641
- accessorKey: "remark",
642
- header: () => f("inventory.closing.history.createdFrom"),
643
- cell: (o) => o.getValue() || "-"
644
- }
645
- ];
646
- async function H(o, l) {
647
- const e = await h.getClosingById(o, l);
648
- if (!e) throw new Error(`Closing ${o} not found`);
649
- return F.value = "closing", P.value = e, B.value = !0, e;
650
- }
651
- async function oe(o, l) {
652
- const e = await h.getStockSnapshotById(o, l);
653
- if (!e) throw new Error(`Stock snapshot ${o} not found`);
654
- return F.value = "snapshot", P.value = e, B.value = !0, e;
655
- }
656
- return A.watchLocation(async () => {
657
- (A.currentLocationDBName || void 0) !== s && (m(), C());
658
- }), (o, l) => {
659
- const e = x("FmTabs"), R = x("FmDatePicker"), ie = x("FmButton"), ye = x("FmDialog");
660
- return u(), G(ve, {
661
- actions: Y.value,
662
- title: d(f)("inventory.closing.history.title"),
663
- "onClick:action": q
664
- }, {
665
- default: $(() => [
666
- a("div", ht, [
667
- _(ke, {
668
- "change-location": "",
669
- "hide-filter-options": !0
670
- }),
671
- _(e, {
672
- "model-value": k.value,
673
- "onUpdate:modelValue": l[0] || (l[0] = (b) => k.value = b),
674
- items: I.value
675
- }, null, 8, ["model-value", "items"]),
676
- k.value === "closings" ? (u(), y(j, { key: 0 }, [
677
- a("div", _t, r(d(f)("inventory.closing.history.closingsDescription")), 1),
678
- _(de, {
679
- rows: g.value,
680
- "onUpdate:rows": l[1] || (l[1] = (b) => g.value = b),
681
- "fetch-page": n,
682
- "refresh-key": v.value,
683
- "column-defs": t,
684
- "fetch-detail": (b, ne) => H(b._id, ne)
685
- }, null, 8, ["rows", "refresh-key", "fetch-detail"])
686
- ], 64)) : w("", !0),
687
- k.value === "snapshots" ? (u(), y(j, { key: 1 }, [
688
- a("div", bt, r(d(f)("inventory.closing.history.snapshotsDescription")), 1),
689
- _(de, {
690
- rows: L.value,
691
- "onUpdate:rows": l[2] || (l[2] = (b) => L.value = b),
692
- "fetch-page": S,
693
- "refresh-key": O.value,
694
- "column-defs": c,
695
- "fetch-detail": (b, ne) => oe(b._id, ne)
696
- }, null, 8, ["rows", "refresh-key", "fetch-detail"])
697
- ], 64)) : w("", !0)
698
- ]),
699
- (u(), G(ge, { to: "body" }, [
700
- _(st, {
701
- ref_key: "recalculationDialogRef",
702
- ref: J,
703
- onSubmitted: l[3] || (l[3] = (b) => {
704
- m(), C();
705
- })
706
- }, null, 512),
707
- _(vt, {
708
- modelValue: B.value,
709
- "onUpdate:modelValue": l[4] || (l[4] = (b) => B.value = b),
710
- type: F.value,
711
- data: P.value
712
- }, null, 8, ["modelValue", "type", "data"]),
713
- _(ye, {
714
- modelValue: U.value,
715
- "onUpdate:modelValue": l[7] || (l[7] = (b) => U.value = b),
716
- "close-button": "",
717
- dismissAway: "",
718
- "max-width": "400px"
719
- }, {
720
- "dialog-header": $(() => l[8] || (l[8] = [
721
- a("div", { class: "fm-typo-en-heading-lg-600" }, "Initiate Stock Snapshot", -1)
722
- ])),
723
- default: $(() => [
724
- a("div", kt, [
725
- a("div", Dt, r(d(f)("inventory.closing.history.snapshotsDescription")), 1),
726
- _(R, {
727
- modelValue: K.value,
728
- "onUpdate:modelValue": l[5] || (l[5] = (b) => K.value = b),
729
- label: "Snapshot Date",
730
- max: d(ee)
731
- }, null, 8, ["modelValue", "max"])
732
- ])
733
- ]),
734
- "dialog-footer": $(() => [
735
- a("div", xt, [
736
- _(ie, {
737
- variant: "tertiary",
738
- onClick: l[6] || (l[6] = (b) => U.value = !1),
739
- label: "Cancel",
740
- disabled: E.value
741
- }, null, 8, ["disabled"]),
742
- _(ie, {
743
- variant: "primary",
744
- onClick: te,
745
- label: "Confirm",
746
- loading: E.value
747
- }, null, 8, ["loading"])
748
- ])
749
- ]),
750
- _: 1
751
- }, 8, ["modelValue"])
752
- ]))
753
- ]),
754
- _: 1
755
- }, 8, ["actions", "title"]);
756
- };
757
- }
758
- });
759
- export {
760
- Rt as default
761
- };