@feedmepos/mf-inventory-portal 1.8.0-dev.0 → 1.8.0-dev.10

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 (247) hide show
  1. package/dist/App-BjFIh5km.js +1466 -0
  2. package/dist/{ApprovalView-BK6E_3Cw.js → ApprovalView-CauRuf64.js} +26 -25
  3. package/dist/{BindingsDialog-BAVPQ_Eq.js → BindingsDialog-U-tzIfGX.js} +2 -2
  4. package/dist/{BindingsPicker-bAuDX7Af.js → BindingsPicker-CV_oghtz.js} +2 -2
  5. package/dist/{BindingsTable-LGlvV0lt.js → BindingsTable-TKSQxAxV.js} +4 -4
  6. package/dist/{BulkReceiveRequestView-CQf7FYos.js → BulkReceiveRequestView-Cyeq26qc.js} +21 -21
  7. package/dist/ChangeLocationComponent.vue_vue_type_script_setup_true_lang-BpJhboKU.js +151 -0
  8. package/dist/{ClosingDraftView-DH7iYiE9.js → ClosingDraftView-UqeHsxyJ.js} +748 -746
  9. package/dist/ClosingHistoryView-Cr6cQq6j.js +769 -0
  10. package/dist/{ClosingTemplateView-D532GNTn.js → ClosingTemplateView-DZ0Mdc87.js} +303 -291
  11. package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-CvqZGcvX.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-C-OsCTxZ.js} +1 -1
  12. package/dist/{DefaultView-DqqXJVba.js → DefaultView-DQKHG5Jl.js} +2 -2
  13. package/dist/{DeliveryOrderPrintPreview-DkHNDEKP.js → DeliveryOrderPrintPreview-Z_kBbMMO.js} +2 -2
  14. package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-Cyj3ka37.js → EmailDialog.vue_vue_type_script_setup_true_lang-Ce6Ly9pT.js} +6228 -6216
  15. package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BUYI8koH.js +47 -0
  16. package/dist/FeatureCapabilityGate-DOn2IVJb.js +74 -0
  17. package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BCuhx2cN.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-BJuo4lEh.js} +1 -1
  18. package/dist/{FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-CDNqm_9N.js → FmFilterableMenuOptions.vue_vue_type_script_setup_true_lang-DZxz5hbo.js} +2 -2
  19. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CiBhz5sq.js +120 -0
  20. package/dist/FmMultiselectDialog-Bx9cLdYs.js +123 -0
  21. package/dist/{FmMultiselectDialog-eH3nO3P3.js → FmMultiselectDialog-DvaWLGY5.js} +2 -2
  22. package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BCIkEl75.js → FmUnitInput.vue_vue_type_script_setup_true_lang-D6f1M96D.js} +72 -73
  23. package/dist/ImportView-1-cjN7ay.js +1290 -0
  24. package/dist/{IngredientsView-DtDtzaMt.js → IngredientsView-JfKlUU2E.js} +656 -649
  25. package/dist/{IntegrationExplorerView-C4lYc_LH.js → IntegrationExplorerView-uElgWH8i.js} +602 -614
  26. package/dist/IntegrationPlatformView-g2dU5SG6.js +13061 -0
  27. package/dist/{IntegrationView-Bx5VdV5l.js → IntegrationView-B9g888K4.js} +2956 -2922
  28. package/dist/{InventoryBindingForm-DKa1DwYs.js → InventoryBindingForm-DfGOKZWg.js} +1 -1
  29. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-CNjTdNL7.js +472 -0
  30. package/dist/{InventoryBindingSummary-CNqwcsrX.js → InventoryBindingSummary-CSii8B2X.js} +1 -1
  31. package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
  32. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-D_Xk4SOH.js +79 -0
  33. package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-DJvfMOND.js +274 -0
  34. package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-Bdjm0Y4w.js +79 -0
  35. package/dist/ProductionRunDetailView-HgH2Wp99.js +2312 -0
  36. package/dist/{production-run-prepare-sheet-aQOcxgaC.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-C88pjV2s.js} +11039 -3661
  37. package/dist/ProductionRunView-BkvQHeCP.js +931 -0
  38. package/dist/{PublishView-D0oSoJ5a.js → PublishView-CIei_T5e.js} +3 -3
  39. package/dist/{PurchaseOrderPrintPreview-CE-l4mvB.js → PurchaseOrderPrintPreview-Wmv7676h.js} +2 -2
  40. package/dist/{ReceiveRequestView-B2z8Ji0e.js → ReceiveRequestView-MqOIpIDB.js} +15 -15
  41. package/dist/RecipeView-WzXJX4JU.js +3440 -0
  42. package/dist/SettingsView-1YlgjyzB.js +1032 -0
  43. package/dist/StockView-C-dIRXPv.js +2651 -0
  44. package/dist/{SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-BTh5E4Tt.js → SubsidiaryTreeDialog.vue_vue_type_script_setup_true_lang-CewKTZzy.js} +1 -1
  45. package/dist/{SupplierView-qqhUQ-SY.js → SupplierView-53rHhQ63.js} +577 -571
  46. package/dist/{SurchargeView-B0TYUfqY.js → SurchargeView-DuJb5EUn.js} +7 -7
  47. package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-tfMHi9Yv.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-C_YmC-ZX.js} +2 -2
  48. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
  49. package/dist/{TemplatePublishDialog.vue_vue_type_script_setup_true_lang-Dxc-jNte.js → TemplatePublishDialog.vue_vue_type_script_setup_true_lang-CyQujMzv.js} +1 -1
  50. package/dist/{TransferDetails.vue_vue_type_script_setup_true_lang-BX36zWMb.js → TransferDetails.vue_vue_type_script_setup_true_lang-CMwqjlb0.js} +1722 -1672
  51. package/dist/TransferTemplateView-B6OGfKQr.js +2343 -0
  52. package/dist/{UnitCostHistoryView-xdRSkjD7.js → UnitCostHistoryView-BVlq4BNG.js} +4 -4
  53. package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-BT2v1gZv.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CULJEeCU.js} +4 -4
  54. package/dist/{UnitView-p-V_TMMo.js → UnitView-AuIJokVF.js} +84 -84
  55. package/dist/{WarehouseView-BOGYcUHH.js → WarehouseView-Cjv8S1ov.js} +194 -189
  56. package/dist/{WastageTemplateView-CiifZMq6.js → WastageTemplateView-mxSTzVSZ.js} +19 -18
  57. package/dist/api/bill.d.ts +144 -88
  58. package/dist/api/feature-flags.d.ts +12 -0
  59. package/dist/api/food-market-hub.d.ts +2 -2
  60. package/dist/api/integration-sync-log.d.ts +0 -13
  61. package/dist/api/inventory.d.ts +9 -9
  62. package/dist/api/license.d.ts +8 -0
  63. package/dist/{app-CGcDbrt8.js → app-OztWApio.js} +27841 -28064
  64. package/dist/app.d.ts +36 -150
  65. package/dist/app.js +1 -1
  66. package/dist/{closing-template-B4lQetjU.js → closing-template-DIxXDgZQ.js} +1 -1
  67. package/dist/components/ChangeLocationComponent.vue.d.ts +21 -14
  68. package/dist/components/DeprecateSoonWarningDialog.vue.d.ts +22 -0
  69. package/dist/components/FeatureCapabilityBadge.vue.d.ts +29 -0
  70. package/dist/components/FeatureCapabilityGate.vue.d.ts +29 -0
  71. package/dist/components/FmUnitInputRules.d.ts +1 -1
  72. package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
  73. package/dist/components/{PreviewBadge.vue.d.ts → PlanTierBadge.vue.d.ts} +5 -13
  74. package/dist/components/PlanUpgradeDialog.vue.d.ts +30 -0
  75. package/dist/composable/useNavigationMenu.d.ts +2 -1
  76. package/dist/{date2-CHOcS7LX.js → date2-BTzYzk-x.js} +1 -1
  77. package/dist/{dayjs.min-DrqpmBJQ.js → dayjs.min-BIg6CfC4.js} +1 -1
  78. package/dist/{decimal-BJ-B2ZXz.js → decimal-B34w3X7O.js} +2 -2
  79. package/dist/{defineDeepModel-DLlTW3xL.js → defineDeepModel-CrZAv12u.js} +1 -1
  80. package/dist/{duplicate-template-Dyz7iXqd.js → duplicate-template-BKVPhi40.js} +1 -1
  81. package/dist/{inventory-core-dart.default-DGI40oFz.js → feature-BUVZ_ab3.js} +766 -398
  82. package/dist/feature-flags/core.d.ts +28 -0
  83. package/dist/feature-flags/navigation-capabilities.d.ts +23 -0
  84. package/dist/feature-flags/navigation-capabilities.spec.d.ts +1 -0
  85. package/dist/feature-flags/plan-tier.d.ts +6 -0
  86. package/dist/feature-flags/plan-tier.spec.d.ts +1 -0
  87. package/dist/feature-flags/portal-feature-catalog.d.ts +19 -0
  88. package/dist/feature-flags/portal-feature-catalog.spec.d.ts +1 -0
  89. package/dist/feature-flags/vue.d.ts +16 -0
  90. package/dist/feature-flags/vue.spec.d.ts +1 -0
  91. package/dist/{format-time-from-id-DBFdt14U.js → format-time-from-id-DGLxhRFH.js} +1 -1
  92. package/dist/{format-unit-display-BXCWhtXb.js → format-unit-display-BhudItCc.js} +118 -119
  93. package/dist/helper/menu-usage-module.d.ts +1 -1
  94. package/dist/helper/number.d.ts +5 -1
  95. package/dist/helper/rules.d.ts +1 -1
  96. package/dist/id-to-date-BfwadWDS.js +67 -0
  97. package/dist/{import-export.helper-BgaADwYQ.js → import-export.helper-BdQ_d-fT.js} +16 -17
  98. package/dist/{index-BT-a2SOP.js → index-BTNI4XZ2.js} +1 -1
  99. package/dist/{index-BS5wlvV_.js → index-B_hoeQNL.js} +3 -3
  100. package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
  101. package/dist/{index-CqgYx0tx.js → index-CCvxPS3E.js} +1 -1
  102. package/dist/index-eGvSlWMU.js +1892 -0
  103. package/dist/{lz-string-CRDgHWib.js → lz-string-CVEGZpSC.js} +1 -1
  104. package/dist/{netsuite-CaILEA4R.js → netsuite-DEhdSyBn.js} +9 -3
  105. package/dist/{predefined-templates-CTLn4dgR.js → predefined-templates-BTdQl7jj.js} +1 -1
  106. package/dist/{purchase-order-template-CE4_gQyK.js → purchase-order-template-DfMmpsrJ.js} +1 -1
  107. package/dist/{recalculationUtils-DoBJhZjA.js → recalculationUtils-Ds9Jcg0l.js} +1 -1
  108. package/dist/router/name.d.ts +2 -3
  109. package/dist/{row-action.enum-ncgDYAjP.js → row-action.enum-B2Y5YFbc.js} +2 -2
  110. package/dist/rules-D01xYhgI.js +238 -0
  111. package/dist/{stock-WxsPiRKa.js → stock-D3kBNq3e.js} +1 -1
  112. package/dist/stock-DyTC4Teu.js +74 -0
  113. package/dist/stores/feature.d.ts +20 -2
  114. package/dist/stores/integration/codemax.d.ts +2 -2
  115. package/dist/stores/integration/foodmarkethub.d.ts +2 -2
  116. package/dist/stores/integration/netsuite.d.ts +2 -2
  117. package/dist/stores/inventory.d.ts +0 -47
  118. package/dist/stores/inventory.no-location.spec.d.ts +1 -0
  119. package/dist/stores/location.d.ts +42 -42
  120. package/dist/stores/supplier.d.ts +49 -49
  121. package/dist/stores/warehouse.d.ts +3 -2
  122. package/dist/style.css +1 -1
  123. package/dist/{supplier-DbdPWPj7.js → supplier-DaidezrO.js} +2 -2
  124. package/dist/{surcharge-BsvY29nN.js → surcharge-C-PFvvlU.js} +1 -1
  125. package/dist/tsconfig.app.tsbuildinfo +1 -1
  126. package/dist/{uom-rules-dxyRNetA.js → uom-rules-Un5bhcrm.js} +1 -1
  127. package/dist/{use-ingredient-select-dialog-eYM-6q4s.js → use-ingredient-select-dialog-DV_hkAt9.js} +2 -2
  128. package/dist/use-inventory-binding-dialog-CTceyFrg.js +113 -0
  129. package/dist/{use-template-enabled-locations-C0o5r4_0.js → use-template-enabled-locations-DGqw8tvz.js} +2 -2
  130. package/dist/{use-transfer-locations-CC35SlyA.js → use-transfer-locations-DgtKajec.js} +2 -2
  131. package/dist/{useHrmPermission-DxzYJX4n.js → useHrmPermission-BMpZlah6.js} +1 -1
  132. package/dist/useNavigationMenu-D0NtXAnB.js +346 -0
  133. package/dist/{useSseClient-ml-_A-4u.js → useSseClient-CHZZxy7Z.js} +1 -1
  134. package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
  135. package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
  136. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
  137. package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
  138. package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
  139. package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
  140. package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +18 -18
  141. package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
  142. package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
  143. package/dist/views/ingredients/components/inventory-binding/InventoryBindingForm.vue.d.ts +0 -1
  144. package/dist/views/ingredients/components/inventory-binding/composables/use-inventory-binding-dialog.d.ts +0 -1
  145. package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
  146. package/dist/views/ingredients/components/inventory-binding/v2/InventoryBindingFormV2.vue.d.ts +0 -1
  147. package/dist/views/ingredients/components/inventory-binding/v2/composables/use-inventory-binding-dialog.d.ts +0 -1
  148. package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +1 -1
  149. package/dist/{components/PremiumBadge.vue.d.ts → views/integration/IntegrationPlatformView.vue.d.ts} +11 -13
  150. package/dist/views/integration/components/ApplyProductDialog.vue.d.ts +4 -4
  151. package/dist/views/integration/components/ApplyProductDialogCodemax.vue.d.ts +4 -4
  152. package/dist/views/integration/components/ApplyProductDialogV4.vue.d.ts +4 -4
  153. package/dist/views/integration/components/CodemaxDialog.vue.d.ts +4 -4
  154. package/dist/views/integration/components/IntegrationCard.vue.d.ts +38 -0
  155. package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
  156. package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
  157. package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
  158. package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
  159. package/dist/views/integration/helper/opening-balance.d.ts +22 -0
  160. package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
  161. package/dist/views/production-run/features/detail/ProductionRunDetailTabs.spec.d.ts +1 -0
  162. package/dist/views/production-run/features/detail/{ProductionRunTabs.vue.d.ts → ProductionRunDetailTabs.vue.d.ts} +4 -8
  163. package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +2 -2
  164. package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +4 -4
  165. package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +2 -2
  166. package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +2 -2
  167. package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +11 -11
  168. package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +2 -2
  169. package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +2 -2
  170. package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +3 -3
  171. package/dist/views/production-run/features/prepare/production-run-prepare-sheet.d.ts +0 -9
  172. package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -2
  173. package/dist/views/production-run/shared/model/production-run-list.d.ts +0 -1
  174. package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +10 -0
  175. package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
  176. package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
  177. package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
  178. package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
  179. package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
  180. package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
  181. package/dist/views/receive-request/import/export.spec.d.ts +1 -0
  182. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +42 -42
  183. package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
  184. package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
  185. package/dist/views/recipe/helper/bulk-edit-simulation.helper.d.ts +0 -1
  186. package/dist/views/recipe/helper/import-recipe.d.ts +2 -2
  187. package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
  188. package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
  189. package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → settings/PlanLicenseDisplay.vue.d.ts} +2 -2
  190. package/dist/views/stock/components/StockRecordCard.vue.d.ts +72 -44
  191. package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
  192. package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
  193. package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
  194. package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
  195. package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
  196. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
  197. package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
  198. package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
  199. package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
  200. package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
  201. package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +6 -4
  202. package/dist/{vue-i18n-DYapak10.js → vue-i18n-mXrQUZTi.js} +235 -235
  203. package/dist/{xlsx.util-DrElrKDx.js → xlsx.util-CKx0NYTq.js} +2 -2
  204. package/package.json +72 -67
  205. package/dist/App-CBS1Tqpl.js +0 -1476
  206. package/dist/ClosingHistoryView-3z17ZJzK.js +0 -761
  207. package/dist/FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CB50Gqot.js +0 -243
  208. package/dist/FmMultiselectDialog-7xh6h5AX.js +0 -77
  209. package/dist/ImportView-C3Fc0e_X.js +0 -1302
  210. package/dist/IngredientBindedItem.vue_vue_type_script_setup_true_lang-6naVJEke.js +0 -51
  211. package/dist/IngredientGroupView-DA1buE1C.js +0 -985
  212. package/dist/InventoryBindingForm.vue_vue_type_script_setup_true_lang-tEKGPtHZ.js +0 -563
  213. package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-Cbg0j7Jz.js +0 -72
  214. package/dist/PremiumBadge.vue_vue_type_script_setup_true_lang-Btrg9HNc.js +0 -93
  215. package/dist/PreviewBadge.vue_vue_type_script_setup_true_lang-DX2MJqL4.js +0 -29
  216. package/dist/ProductionRunDetailView-DYeSPsIY.js +0 -2284
  217. package/dist/ProductionRunPreparePrintView-DJOejqOC.js +0 -34
  218. package/dist/ProductionRunTabs.vue_vue_type_script_setup_true_lang-JKMI-vVw.js +0 -7543
  219. package/dist/ProductionRunView-Cg3aYOg9.js +0 -911
  220. package/dist/RecipeView-DC0p9RKL.js +0 -3625
  221. package/dist/SettingsView-DaKfCVY5.js +0 -698
  222. package/dist/StockView-DdweBRFv.js +0 -2612
  223. package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
  224. package/dist/TransferTemplateView-CSXcAB3-.js +0 -2327
  225. package/dist/feature-DtpSrELx.js +0 -1136
  226. package/dist/number-DE6ovaTs.js +0 -138
  227. package/dist/random-CSbEbElR.js +0 -10
  228. package/dist/rules-CkaU7yFU.js +0 -98
  229. package/dist/stock-B3Q9e174.js +0 -75
  230. package/dist/use-inventory-binding-dialog-CCV1iieA.js +0 -152
  231. package/dist/useNavigationMenu-IKam6CEf.js +0 -172
  232. package/dist/usePromise-CbVUCxhj.js +0 -29
  233. package/dist/views/ingredient-group/IngredientGroupView.vue.d.ts +0 -3
  234. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialog.vue.d.ts +0 -31
  235. package/dist/views/ingredient-group/components/ingredient-group-dialog/IngredientGroupDialogProps.d.ts +0 -10
  236. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupForm.vue.d.ts +0 -21
  237. package/dist/views/ingredient-group/components/ingredient-group-form/IngredientGroupFormProps.d.ts +0 -12
  238. package/dist/views/ingredient-group/components/ingredient-group-rule-field/IngredientGroupRuleField.vue.d.ts +0 -37
  239. package/dist/views/ingredient-group/composables/use-ingredient-group-actions.d.ts +0 -24
  240. package/dist/views/ingredient-group/composables/use-ingredient-group-rule-item.d.ts +0 -31
  241. package/dist/views/ingredient-group/composables/use-ingredient-group-table.d.ts +0 -77
  242. package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
  243. /package/dist/components/{FmFeatureFlagDialog.vue.d.ts → DeprecateSoonPill.vue.d.ts} +0 -0
  244. /package/dist/{views/production-run/ProductionRunPreparePrintView.spec.d.ts → components/FeatureCapabilityGate.spec.d.ts} +0 -0
  245. /package/dist/{views/production-run/features/detail/ProductionRunTabs.spec.d.ts → components/NumberPrecisionInput.spec.d.ts} +0 -0
  246. /package/dist/{views/production-run/features/prepare/production-run-prepare-sheet-cleanup.spec.d.ts → feature-flags/core.spec.d.ts} +0 -0
  247. /package/dist/views/{production-run/ProductionRunPreparePrintView.vue.d.ts → settings/FeatureFlagView.vue.d.ts} +0 -0
@@ -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-CGcDbrt8.js";
5
- import { F as ce } from "./FmAdminBadge-DlplQOHb.js";
6
- import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-CB50Gqot.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-WxsPiRKa.js";
10
- import { g as Se, f as we } from "./recalculationUtils-DoBJhZjA.js";
11
- import { _ as Ve } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-BT2v1gZv.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
- };