@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.
- package/dist/App-BPdZMhM8.js +1445 -0
- package/dist/{ApprovalView-1Y_jh_UJ.js → ApprovalView-UzjSuZ2L.js} +26 -25
- package/dist/{BindingsDialog-VMvTLguN.js → BindingsDialog-Cb6WRlKq.js} +2 -2
- package/dist/{BindingsPicker-KNRM5rMU.js → BindingsPicker-CtD4U4lv.js} +2 -2
- package/dist/{BindingsTable-CSyNlNCL.js → BindingsTable-CX-3403K.js} +10 -10
- package/dist/BulkReceiveRequestPage-CUq1Lmww.js +2839 -0
- 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
- package/dist/{ClosingDraftView-A2pJuhIb.js → ClosingDraftView-Ca_SvdWQ.js} +748 -746
- package/dist/ClosingHistoryView-DzkeJYoe.js +769 -0
- package/dist/{ClosingTemplateView-DpkNCyoB.js → ClosingTemplateView-DSrelbso.js} +22 -21
- package/dist/{CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-DOpIDvsy.js → CustomPrintTemplatePreview.vue_vue_type_script_setup_true_lang-BuOuXPy1.js} +1 -1
- package/dist/{DefaultView-B4UuAqYu.js → DefaultView-Dw-7Y8vD.js} +2 -2
- package/dist/{DeliveryOrderPrintPreview-w0YcNH3F.js → DeliveryOrderPrintPreview-C5qJsv_O.js} +15 -15
- package/dist/{EmailDialog.vue_vue_type_script_setup_true_lang-BimIEHsW.js → EmailDialog.vue_vue_type_script_setup_true_lang-D8od7aKT.js} +10075 -9949
- package/dist/FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-ChekXW32.js +48 -0
- package/dist/FeatureCapabilityGate-C-IM5_7n.js +82 -0
- package/dist/FeaturePageGate.vue_vue_type_script_setup_true_lang-DEDU1XUC.js +189 -0
- package/dist/{FmDateRangePickerChip.vue_vue_type_script_setup_true_lang--54VR4oB.js → FmDateRangePickerChip.vue_vue_type_script_setup_true_lang-B861gqIJ.js} +1 -1
- 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
- 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
- package/dist/{FmMultiselectDialog-DMA5eR0C.js → FmMultiselectDialog-CShFKSIW.js} +2 -2
- package/dist/{FmMultiselectDialog-BnZInvgp.js → FmMultiselectDialog-Ci-6NMsV.js} +2 -2
- package/dist/{FmUnitInput.vue_vue_type_script_setup_true_lang-BXTUsnwN.js → FmUnitInput.vue_vue_type_script_setup_true_lang-Dkx5vVap.js} +105 -99
- package/dist/ImportView-7ij7RUHI.js +1540 -0
- package/dist/{IngredientsView-C4-8qNGD.js → IngredientsView-fIPtTyFD.js} +685 -688
- package/dist/{IntegrationExplorerView-D3leld2Z.js → IntegrationExplorerView-DLYT4T-I.js} +1537 -1620
- package/dist/IntegrationPlatformView-CwywuK_y.js +13385 -0
- package/dist/{IntegrationView-BhRzry3g.js → IntegrationView-DnyVHXge.js} +2380 -2340
- package/dist/{InventoryBindingForm-ewAgZ6e-.js → InventoryBindingForm-BBs8v7CL.js} +1 -1
- 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
- package/dist/{InventoryBindingSummary-e67GzHYr.js → InventoryBindingSummary-CwIrQ8lG.js} +1 -1
- package/dist/JsonViewer.vue_vue_type_script_setup_true_lang-C_hg75l0.js +25 -0
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-DJSbskyn.js +79 -0
- package/dist/PlanTierBadge.vue_vue_type_script_setup_true_lang-CM3gtYZo.js +19 -0
- package/dist/PlanUpgradeDialog.vue_vue_type_script_setup_true_lang-0F-yOcPC.js +79 -0
- package/dist/PremiumUpgradePage.vue_vue_type_script_setup_true_lang-DGAxPOEh.js +58 -0
- package/dist/ProductionRunDetailPage-C_WC4qfP.js +2317 -0
- package/dist/{ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-7u0HQH67.js → ProductionRunLifecycleDialogs.vue_vue_type_script_setup_true_lang-BIkoMOM2.js} +3051 -3161
- package/dist/ProductionRunPage-DuzVrjbZ.js +954 -0
- package/dist/{PublishView-BXA3k8Cp.js → PublishView-BVg44yke.js} +3 -3
- package/dist/{PurchaseOrderPrintPreview-DRugr4BU.js → PurchaseOrderPrintPreview-CNx6unyj.js} +17 -17
- package/dist/{ReceiveRequestView-CeJs9NTD.js → ReceiveRequestView-DeNrYOUt.js} +17 -16
- package/dist/RecipeView-De3pLsPR.js +3272 -0
- package/dist/SettingsView-B5ud0KtI.js +1005 -0
- package/dist/StockView-4N3NRjY8.js +3003 -0
- 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
- package/dist/{SupplierView-DH9u6e2M.js → SupplierView-fC9oe5nu.js} +304 -301
- package/dist/{SurchargeView-BPVEpc0f.js → SurchargeView-H6rv7u8A.js} +7 -7
- package/dist/{SystemTrailDialog.vue_vue_type_script_setup_true_lang-BRwxKmwb.js → SystemTrailDialog.vue_vue_type_script_setup_true_lang-DFdrmR2Z.js} +2 -2
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-gJQQKKAC.js +71 -0
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BivHE94R.js +332 -0
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-Df01LqHp.js +4953 -0
- package/dist/TransferTemplateView-CVUnofkI.js +2347 -0
- package/dist/{UnitCostHistoryView-06rIaX_M.js → UnitCostHistoryView-DjD2WAFI.js} +4 -4
- package/dist/{UnitDisplayControl.vue_vue_type_script_setup_true_lang-C2zidBrl.js → UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js} +4 -4
- package/dist/{UnitView-Xk_F9SYG.js → UnitView-DCfsbE8e.js} +111 -106
- package/dist/{WarehouseView-bmpLmpcX.js → WarehouseView-BCebmbcj.js} +12 -11
- package/dist/{WastageTemplateView-CWV1pFxM.js → WastageTemplateView-BXYNMBun.js} +19 -18
- package/dist/api/bill.d.ts +4 -2
- package/dist/api/bill.spec.d.ts +1 -0
- package/dist/api/closing.d.ts +1 -0
- package/dist/api/feature-flags.d.ts +2 -0
- package/dist/api/integration-sync-log.d.ts +0 -13
- package/dist/api/inventory.d.ts +9 -9
- package/dist/api/netsuite-explorer.d.ts +1 -0
- package/dist/api/stock.d.ts +1 -1
- package/dist/{app-CURawLhs.js → app-VtVYHCDF.js} +9785 -9546
- package/dist/app.d.ts +151 -14
- package/dist/app.js +1 -1
- package/dist/bulk-edit-simulation.helper-Nd6CtWGf.js +178 -0
- package/dist/{closing-template-q_KGB4jO.js → closing-template-LCe0U9w9.js} +4 -4
- package/dist/components/FeatureCapabilityGate.spec.d.ts +1 -0
- package/dist/components/FeatureCapabilityGate.vue.d.ts +5 -0
- package/dist/components/FeatureGateLayout.vue.d.ts +11 -0
- package/dist/components/FeaturePageGate.spec.d.ts +1 -0
- package/dist/components/FeaturePageGate.vue.d.ts +34 -0
- package/dist/components/FmAdminCollapsiblePanel.vue.d.ts +1 -1
- package/dist/components/FmDroppableField.vue.d.ts +1 -1
- package/dist/components/FmInventoryTableToolbar.vue.d.ts +2 -2
- package/dist/components/FmUnitInputProps.d.ts +1 -0
- package/dist/components/FmUnitInputRules.d.ts +1 -1
- package/dist/components/HrmPermissionGuard.vue.d.ts +1 -1
- package/dist/components/MultiLocationSelector.vue.d.ts +6 -6
- package/dist/components/NumberPrecisionInput.spec.d.ts +1 -0
- package/dist/components/PremiumUpgradePage.vue.d.ts +2 -0
- package/dist/components/TemplatePublishDialog.d.ts +2 -0
- package/dist/components/TemplatePublishDialog.spec.d.ts +1 -0
- package/dist/composable/defineApi.d.ts +1 -1
- package/dist/{date2-3kdweNLp.js → date2-Cfb6DXM4.js} +1 -1
- package/dist/{dayjs.min-DHE73-wM.js → dayjs.min-BOndKK7B.js} +1 -1
- package/dist/{decimal-CAnQe2Ib.js → decimal-nbuisP61.js} +2 -2
- package/dist/{defineDeepModel-CctS67Do.js → defineDeepModel-DKySrdwp.js} +5 -5
- package/dist/{duplicate-template-Jk2V2Ezg.js → duplicate-template-BxcKb3Jp.js} +1 -1
- package/dist/{feature-D9n0IC0c.js → feature-VDUlSvM1.js} +452 -354
- package/dist/feature-flags/core.d.ts +1 -0
- package/dist/feature-flags/vue.d.ts +22 -1
- package/dist/feature-flags/vue.spec.d.ts +1 -0
- package/dist/{format-time-from-id-Bmzpbg-8.js → format-time-from-id-CfVH4LZ_.js} +1 -1
- package/dist/{format-unit-display-CVg4Bl5L.js → format-unit-display-BjTeAtgS.js} +209 -208
- package/dist/helper/country.spec.d.ts +1 -0
- package/dist/helper/menu-usage-module.d.ts +2 -1
- package/dist/helper/number.d.ts +5 -1
- package/dist/helper/rules.d.ts +1 -1
- package/dist/{id-to-date-DPCcxufP.js → id-to-date-Jr9SlHLO.js} +1 -1
- package/dist/{import-export.helper-bmGZwUBB.js → import-export.helper-FT9Wbigh.js} +17 -17
- package/dist/{index-zCBA-X6R.js → index-BV9b3Ulp.js} +2234 -2163
- package/dist/{index-yt6MlAFG.js → index-By5-VjVg.js} +1 -1
- package/dist/{JsonViewer.vue_vue_type_script_setup_true_lang-ig2zSXAB.js → index-C25C1Dg7.js} +1074 -1066
- package/dist/{index-CFNNQo-7.js → index-DXHVgUHU.js} +3 -3
- package/dist/index-eGvSlWMU.js +1892 -0
- package/dist/layout/SingleColumnLayout.vue.d.ts +1 -1
- package/dist/{lz-string-CqlY9MC2.js → lz-string-BAzqO9xf.js} +1 -1
- package/dist/menu-usage-module-Bq_KLsO4.js +74 -0
- package/dist/{netsuite-DudeltN_.js → netsuite-BhGuduqd.js} +254 -263
- package/dist/netsuite-explorer-9Qj7qAum.js +79 -0
- package/dist/{predefined-templates-DT32p04n.js → predefined-templates-BlRafgnc.js} +1 -1
- package/dist/production-run-list-DR1WsaBR.js +61 -0
- package/dist/{purchase-order-template-LaRpWA04.js → purchase-order-template-By_Zxu1b.js} +1 -1
- package/dist/{recalculationUtils-BYN393eE.js → recalculationUtils-VsBar7jB.js} +1 -1
- package/dist/router/name.d.ts +2 -1
- package/dist/{row-action.enum-BiP5wkT6.js → row-action.enum-76yLYmPA.js} +1 -1
- package/dist/rules-fOcvgt4t.js +243 -0
- package/dist/{stock-B9XerL9c.js → stock-C-dQaxY2.js} +1 -1
- package/dist/stock-Dh0KXA1P.js +78 -0
- package/dist/stores/feature.d.ts +31 -2
- package/dist/stores/feature.load-state.spec.d.ts +1 -0
- package/dist/stores/integration/netsuite.d.ts +2 -2
- package/dist/stores/inventory.no-location.spec.d.ts +1 -0
- package/dist/stores/location.d.ts +42 -42
- package/dist/stores/supplier.d.ts +48 -48
- package/dist/stores/warehouse.d.ts +2 -2
- package/dist/style.css +1 -1
- package/dist/{supplier-dpHijd2E.js → supplier-XHHHN8vZ.js} +2 -2
- package/dist/{surcharge-BZ4STY5J.js → surcharge-0-oBiYoF.js} +1 -1
- package/dist/tsconfig.app.tsbuildinfo +1 -1
- package/dist/{uom-rules-Da5Lngvp.js → uom-rules-DrRuSFgM.js} +1 -1
- package/dist/{use-ingredient-select-dialog-C3YsT5l-.js → use-ingredient-select-dialog-mQ7aQChK.js} +2 -2
- package/dist/{use-inventory-binding-dialog-BSsyrcGe.js → use-inventory-binding-dialog-5Wu0ItnH.js} +2 -2
- package/dist/{use-template-enabled-locations-BmJUzSUm.js → use-template-enabled-locations-CgpPMl8g.js} +2 -2
- package/dist/{use-transfer-locations-frEk_aBH.js → use-transfer-locations-DZ6B7eMT.js} +14 -14
- package/dist/{useHrmPermission-Cyjm0y9a.js → useHrmPermission-BaGxz4EV.js} +1 -1
- package/dist/{useNavigationMenu-CnTsOF9T.js → useNavigationMenu-CyP39v3U.js} +50 -49
- package/dist/{useSseClient-D_7o9nuf.js → useSseClient-CaD4MVg0.js} +1 -1
- package/dist/views/adjustment-template/wastage-template/actions.d.ts +36 -36
- package/dist/views/adjustment-template/wastage-template/table.d.ts +36 -36
- package/dist/views/changelog/composables/use-snapshot-diff.d.ts +2 -2
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftApprovalDialog.vue.d.ts +6 -6
- package/dist/views/closing-draft/components/closing-draft-dialog/ClosingDraftDialog.vue.d.ts +12 -12
- package/dist/views/closing-draft/components/closing-draft-groups/ClosingGroupDetailSideSheet.vue.d.ts +6 -6
- package/dist/views/closing-draft/composables/use-closing-draft-import.d.ts +3 -3
- package/dist/views/closing-draft/composables/use-closing-draft-table.d.ts +19 -19
- package/dist/views/closing-draft/helpers/draft-status-to-class-name.helper.d.ts +1 -1
- package/dist/views/closing-template/composables/use-closing-template-actions.d.ts +45 -45
- package/dist/views/closing-template/composables/use-closing-template-table.d.ts +36 -36
- package/dist/views/import/helper/submit-rows.d.ts +1 -1
- package/dist/views/ingredients/components/inventory-binding/recipe-amount-validation.spec.d.ts +1 -0
- package/dist/views/ingredients/helper/is-linked-ingredient-error.d.ts +3 -1
- package/dist/views/integration/IntegrationPlatformView.vue.d.ts +24 -0
- package/dist/views/integration/components/IntegrationCard.vue.d.ts +3 -3
- package/dist/views/integration/components/Synergy/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/Xilnex/importFn.spec.d.ts +1 -0
- package/dist/views/integration/components/netsuite/business/AddLocationDialog.vue.d.ts +36 -36
- package/dist/views/integration/components/netsuite/business/AddVendorDialog.vue.d.ts +24 -24
- package/dist/views/integration/helper/opening-balance.d.ts +22 -0
- package/dist/views/integration/helper/opening-balance.spec.d.ts +1 -0
- package/dist/views/production-run/ProductionRunDetailPage.spec.d.ts +1 -0
- package/dist/views/{integration/components/IntegrationSyncLogTab.vue.d.ts → production-run/ProductionRunDetailPage.vue.d.ts} +2 -2
- package/dist/views/production-run/ProductionRunPage.vue.d.ts +2 -0
- package/dist/views/production-run/features/detail/ProductionRunItemsTable.vue.d.ts +2 -2
- package/dist/views/production-run/features/detail/ProductionRunOverviewTab.vue.d.ts +4 -4
- package/dist/views/production-run/features/detail/use-production-run-detail.d.ts +19 -9
- package/dist/views/production-run/features/lifecycle/CancelRunDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/lifecycle/CloseRunDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/lifecycle/ProductionRunLifecycleDialogs.vue.d.ts +14 -14
- package/dist/views/production-run/features/lifecycle/TargetReachedDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/planning/ProductionRunFormDialog.vue.d.ts +4 -4
- package/dist/views/production-run/features/planning/ProductionRunPlanner.vue.d.ts +1 -1
- package/dist/views/production-run/features/planning/use-production-run-duplicate-sources.d.ts +6 -6
- package/dist/views/production-run/shared/helpers/production-run-navigation.d.ts +0 -1
- package/dist/views/production-run/shared/model/production-run-list.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunInfoBadge.vue.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunInfoText.vue.d.ts +1 -1
- package/dist/views/production-run/shared/ui/ProductionRunScrollHint.vue.d.ts +2 -2
- package/dist/views/production-run/shared/ui/ProductionRunTextarea.vue.d.ts +3 -3
- package/dist/views/receive-request/components/transfer-form/TransferFormWithController.vue.d.ts +5 -5
- package/dist/views/receive-request/composables/netsuite-order-label.d.ts +11 -0
- package/dist/views/receive-request/composables/netsuite-order-label.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-process-purchase-order.d.ts +6 -6
- package/dist/views/receive-request/composables/use-receive-request-form.d.ts +48 -48
- package/dist/views/receive-request/composables/use-receive-request-form.spec.d.ts +1 -0
- package/dist/views/receive-request/composables/use-receive-request-table.d.ts +42 -42
- package/dist/views/receive-request/import/export.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/BulkReceiveRequestPage.vue.d.ts +2 -0
- package/dist/views/receive-request-bulk/components/CreateTransferWizard.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.d.ts +54 -54
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-form.readiness.spec.d.ts +1 -0
- package/dist/views/receive-request-bulk/composables/use-bulk-receive-request-table.d.ts +8 -8
- package/dist/views/recipe/components/recipe-bulk-editor/components/ModificationCard.spec.d.ts +1 -0
- package/dist/views/recipe/helper/import-recipe.d.ts +30 -0
- package/dist/views/recipe/helper/import-recipe.spec.d.ts +1 -0
- package/dist/views/settings/PlanLicenseDisplay.spec.d.ts +1 -0
- package/dist/views/settings/PlanLicenseDisplay.vue.d.ts +2 -0
- package/dist/views/stock/components/StockRecordCard.spec.d.ts +1 -0
- package/dist/views/stock/components/StockRecordCard.vue.d.ts +19 -865
- package/dist/views/stock/components/dialog/AmendAdjustmentForm.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.spec.d.ts +1 -0
- package/dist/views/stock/components/dialog/BillInventoryInfoDialog.vue.d.ts +36 -0
- package/dist/views/stock/components/dialog/ConvertSkuDialog.spec.d.ts +1 -0
- package/dist/views/stock/composables/use-last-closing-summary.d.ts +4 -0
- package/dist/views/stock/composables/use-last-closing-summary.spec.d.ts +1 -0
- package/dist/views/supplier/components/SupplierForm.vue.d.ts +4 -4
- package/dist/views/supplier/composables/use-supplier-table.d.ts +2 -2
- package/dist/views/transfer-template/components/transfer-template-dialog/TransferTemplateDialog.vue.d.ts +8 -8
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-locations.d.ts +4 -4
- package/dist/views/transfer-template/components/transfer-template-form/composables/use-transfer-template-items.spec.d.ts +1 -0
- package/dist/views/transfer-template/composables/use-template-item-bulk-editor.d.ts +24 -24
- package/dist/views/transfer-template/composables/use-transfer-template-actions.d.ts +48 -48
- package/dist/views/transfer-template/composables/use-transfer-template-table.d.ts +48 -48
- package/dist/views/transfer-template/helpers/template-item.error.helper.spec.d.ts +1 -0
- package/dist/views/unit/composables/use-unit-form.spec.d.ts +1 -0
- package/dist/views/warehouse/components/WarehouseForm.vue.d.ts +4 -4
- package/dist/{FeatureCapabilityBadge.vue_vue_type_script_setup_true_lang-BBkF9lOE.js → vue-KHCpiw_e.js} +106 -108
- package/dist/{vue-i18n-DwAcG7yc.js → vue-i18n-D6btLtve.js} +422 -422
- package/dist/{xlsx.util-C7S-uyqm.js → xlsx.util-Dr5i_LBa.js} +2 -2
- package/package.json +71 -66
- package/dist/App-Bo29Nwt0.js +0 -1537
- package/dist/BulkReceiveRequestView-vOeHbWM_.js +0 -2656
- package/dist/ClosingHistoryView-woRmvmYT.js +0 -761
- package/dist/ImportView-C7Hah7MM.js +0 -1291
- package/dist/NumberPrecisionInput.vue_vue_type_script_setup_true_lang-CKEzy2Uo.js +0 -72
- package/dist/ProductionRunDetailView-Ct7kr5Ht.js +0 -2312
- package/dist/ProductionRunView-odWyBZGx.js +0 -930
- package/dist/RecipeView-BH0REMB3.js +0 -3428
- package/dist/SettingsView-Dc27wyk-.js +0 -977
- package/dist/StockView-DrHLzosW.js +0 -2616
- package/dist/TableActionableRow.vue_vue_type_script_setup_true_lang-DAMpuZ1X.js +0 -84
- package/dist/TemplatePublishDialog.vue_vue_type_script_setup_true_lang-BpiePSmo.js +0 -299
- package/dist/TransferDetails.vue_vue_type_script_setup_true_lang-DOQGPKiv.js +0 -4820
- package/dist/TransferTemplateView-CEVRsKL7.js +0 -2326
- package/dist/menu-usage-module-BdjYEk3s.js +0 -57
- package/dist/number-BoePMDs8.js +0 -138
- package/dist/rules-CQT0uAAo.js +0 -98
- package/dist/stock-CVybjhUm.js +0 -75
- package/dist/views/integration/composables/use-integration-sync-log.d.ts +0 -45
|
@@ -0,0 +1,769 @@
|
|
|
1
|
+
import { defineComponent as se, ref as p, computed as S, watch as ue, resolveComponent as w, createElementBlock as f, openBlock as u, createVNode as _, withCtx as $, createElementVNode as a, createCommentVNode as F, toDisplayString as l, unref as d, Fragment as G, createBlock as j, createTextVNode as ne, renderList as re, normalizeClass as fe, h as P, 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 M, a as _e, u as be } from "./app-VtVYHCDF.js";
|
|
5
|
+
import { F as ce } from "./FmAdminBadge-DlplQOHb.js";
|
|
6
|
+
import { _ as ke } from "./FmInventoryTableToolbar.vue_vue_type_script_setup_true_lang-BEjFoMJJ.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-C-dQaxY2.js";
|
|
10
|
+
import { g as Se, f as we } from "./recalculationUtils-VsBar7jB.js";
|
|
11
|
+
import { u as Ve } from "./feature-VDUlSvM1.js";
|
|
12
|
+
import { F as Ce } from "./FeatureCapabilityGate-C-IM5_7n.js";
|
|
13
|
+
import { _ as Fe } from "./UnitDisplayControl.vue_vue_type_script_setup_true_lang-CE0zHU6c.js";
|
|
14
|
+
const Ae = { class: "fm-typo-en-heading-lg-600" }, Ie = { class: "flex flex-col gap-16" }, $e = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, Te = { class: "flex flex-col gap-8" }, Be = { class: "fm-typo-en-body-md-600" }, Le = { class: "flex flex-col gap-8" }, Re = { class: "fm-typo-en-body-md-600" }, Ne = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "text-red-500 text-sm mt-2"
|
|
17
|
+
}, Oe = { class: "fm-typo-en-body-sm-400" }, Pe = {
|
|
18
|
+
key: 1,
|
|
19
|
+
class: "p-12 border border-fm-color-border-primary rounded-8 bg-fm-color-background-secondary"
|
|
20
|
+
}, Me = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
23
|
+
}, Ke = {
|
|
24
|
+
key: 1,
|
|
25
|
+
class: "flex flex-col gap-8"
|
|
26
|
+
}, Ue = { class: "fm-typo-en-body-sm-600" }, Ee = { class: "flex flex-col gap-4" }, He = { key: 0 }, We = { key: 1 }, ze = { key: 2 }, Ge = {
|
|
27
|
+
key: 1,
|
|
28
|
+
class: "flex flex-col gap-8"
|
|
29
|
+
}, je = { class: "fm-typo-en-body-md-600" }, Ye = { class: "flex flex-col gap-8 max-h-[300px] overflow-y-auto" }, Je = { class: "flex items-center justify-between" }, Qe = { class: "fm-typo-en-body-sm-600" }, Xe = { class: "flex items-center gap-8" }, Ze = {
|
|
30
|
+
key: 0,
|
|
31
|
+
class: "fm-typo-en-body-xs-600 px-8 py-4 rounded-4 bg-fm-color-neutral-100 text-fm-color-typo-secondary"
|
|
32
|
+
}, qe = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, et = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, tt = {
|
|
33
|
+
key: 0,
|
|
34
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
35
|
+
}, ot = {
|
|
36
|
+
key: 1,
|
|
37
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
38
|
+
}, at = {
|
|
39
|
+
key: 2,
|
|
40
|
+
class: "fm-typo-en-body-xs-400 text-fm-color-system-error-500"
|
|
41
|
+
}, nt = {
|
|
42
|
+
key: 0,
|
|
43
|
+
class: "flex gap-8 ml-auto"
|
|
44
|
+
}, st = {
|
|
45
|
+
key: 1,
|
|
46
|
+
class: "flex gap-8 ml-auto"
|
|
47
|
+
}, lt = 15 * 60 * 1e3, it = /* @__PURE__ */ se({
|
|
48
|
+
__name: "RecalculationDialog",
|
|
49
|
+
emits: ["submitted"],
|
|
50
|
+
setup(Z, { expose: g, emit: h }) {
|
|
51
|
+
const A = h, { t: c } = le(), V = xe(), L = me(), x = pe(), C = p(!1), y = p(""), v = p(""), N = p([]), K = p([]), D = p(!1), i = p([]), n = p(!1), m = p([]), b = p(!1), T = S(
|
|
52
|
+
() => Se(N.value, K.value)
|
|
53
|
+
), B = S(() => we(
|
|
54
|
+
m.value.filter((t) => !!t.closingId).map((t) => ({ closingId: t.closingId, draftCreatedAt: new Date(M(t._id)) }))
|
|
55
|
+
)), I = S(() => {
|
|
56
|
+
if (y.value)
|
|
57
|
+
try {
|
|
58
|
+
const t = M(y.value);
|
|
59
|
+
if (t)
|
|
60
|
+
return t;
|
|
61
|
+
} catch (t) {
|
|
62
|
+
console.error("Error parsing date from opening ID:", t);
|
|
63
|
+
}
|
|
64
|
+
}), R = S(() => {
|
|
65
|
+
if (!y.value || !v.value) return "";
|
|
66
|
+
const t = M(y.value);
|
|
67
|
+
if (t && v.value) {
|
|
68
|
+
const r = new Date(t).getTime();
|
|
69
|
+
if (new Date(v.value).getTime() <= r)
|
|
70
|
+
return c("inventory.stock.recalculation.error.endDateBeforeOpening");
|
|
71
|
+
}
|
|
72
|
+
return "";
|
|
73
|
+
}), z = S(() => {
|
|
74
|
+
if (!v.value) return !1;
|
|
75
|
+
const t = new Date(v.value), r = /* @__PURE__ */ new Date();
|
|
76
|
+
return r.setHours(0, 0, 0, 0), t.setHours(0, 0, 0, 0), t >= r;
|
|
77
|
+
}), U = S(() => !!y.value && !!v.value && !R.value), Y = S(() => i.value.some(
|
|
78
|
+
(t) => !t.completedAt && !t.failedReason && Date.now() - new Date(t.createdAt).getTime() < lt
|
|
79
|
+
));
|
|
80
|
+
async function J() {
|
|
81
|
+
C.value = !0, await Promise.all([q(), E(), H()]), y.value = "", v.value = "";
|
|
82
|
+
}
|
|
83
|
+
g({
|
|
84
|
+
open: J
|
|
85
|
+
});
|
|
86
|
+
async function q() {
|
|
87
|
+
D.value = !0;
|
|
88
|
+
try {
|
|
89
|
+
const t = await L.getLastNClosings(30);
|
|
90
|
+
N.value = t;
|
|
91
|
+
} catch (t) {
|
|
92
|
+
console.error("Error fetching recent closings:", t), x.open({
|
|
93
|
+
title: c("common.error"),
|
|
94
|
+
message: "Failed to fetch recent closings",
|
|
95
|
+
type: "error"
|
|
96
|
+
});
|
|
97
|
+
} finally {
|
|
98
|
+
D.value = !1;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
async function E() {
|
|
102
|
+
try {
|
|
103
|
+
const t = await L.getLastNStockSnapshots(30);
|
|
104
|
+
K.value = t;
|
|
105
|
+
} catch (t) {
|
|
106
|
+
console.error("Error fetching recent snapshots:", t);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
async function H() {
|
|
110
|
+
n.value = !0;
|
|
111
|
+
try {
|
|
112
|
+
const t = await V.recalculation.recalculationRequests();
|
|
113
|
+
i.value = t;
|
|
114
|
+
} catch (t) {
|
|
115
|
+
console.error("Error fetching recalculation requests:", t);
|
|
116
|
+
} finally {
|
|
117
|
+
n.value = !1;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
async function ee() {
|
|
121
|
+
if (!y.value || !v.value) {
|
|
122
|
+
m.value = [];
|
|
123
|
+
return;
|
|
124
|
+
}
|
|
125
|
+
b.value = !0;
|
|
126
|
+
try {
|
|
127
|
+
const t = new Date(v.value);
|
|
128
|
+
t.setHours(23, 59, 59, 999);
|
|
129
|
+
const r = await V.recalculation.getAffectedClosingDrafts(
|
|
130
|
+
y.value,
|
|
131
|
+
t.toISOString()
|
|
132
|
+
);
|
|
133
|
+
m.value = r;
|
|
134
|
+
} catch {
|
|
135
|
+
x.open({
|
|
136
|
+
title: c("common.error"),
|
|
137
|
+
message: "Failed to fetch affected closing drafts",
|
|
138
|
+
type: "error"
|
|
139
|
+
}), m.value = [];
|
|
140
|
+
} finally {
|
|
141
|
+
b.value = !1;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
ue(
|
|
145
|
+
[y, v],
|
|
146
|
+
() => {
|
|
147
|
+
y.value && v.value && !R.value ? ee() : m.value = [];
|
|
148
|
+
},
|
|
149
|
+
{ immediate: !1 }
|
|
150
|
+
);
|
|
151
|
+
async function te() {
|
|
152
|
+
if (!(!U.value || !v.value)) {
|
|
153
|
+
D.value = !0;
|
|
154
|
+
try {
|
|
155
|
+
const t = new Date(v.value);
|
|
156
|
+
if (t.setHours(23, 59, 59, 999), await V.recalculation.scheduleRecalculation({
|
|
157
|
+
openingId: y.value,
|
|
158
|
+
untilDate: t.toISOString(),
|
|
159
|
+
recalculateBySnapshot: !0
|
|
160
|
+
}), m.value.length > 0) {
|
|
161
|
+
const r = m.value.map((W) => W._id);
|
|
162
|
+
await V.recalculation.scheduleInvalidateClosingDraftCache(r);
|
|
163
|
+
}
|
|
164
|
+
x.open({
|
|
165
|
+
title: c("common.success"),
|
|
166
|
+
message: "Stock recalculation has been scheduled successfully",
|
|
167
|
+
type: "success"
|
|
168
|
+
}), await H(), C.value = !1, A("submitted");
|
|
169
|
+
} catch (t) {
|
|
170
|
+
console.error("Error scheduling recalculation:", t), x.open({
|
|
171
|
+
title: c("common.error"),
|
|
172
|
+
message: "Failed to schedule stock recalculation",
|
|
173
|
+
type: "error"
|
|
174
|
+
});
|
|
175
|
+
} finally {
|
|
176
|
+
D.value = !1;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return (t, r) => {
|
|
181
|
+
const W = w("FmSelect"), oe = w("FmDatePicker"), Q = w("FmSnackbar"), X = w("FmAlert"), o = w("FmButton"), s = w("FmDialog");
|
|
182
|
+
return u(), f("div", null, [
|
|
183
|
+
_(s, {
|
|
184
|
+
modelValue: C.value,
|
|
185
|
+
"onUpdate:modelValue": r[4] || (r[4] = (e) => C.value = e),
|
|
186
|
+
"close-button": "",
|
|
187
|
+
dismissAway: "",
|
|
188
|
+
"max-width": "600px"
|
|
189
|
+
}, {
|
|
190
|
+
"dialog-header": $(() => [
|
|
191
|
+
a("div", Ae, l(d(c)("inventory.stock.recalculation.title")), 1)
|
|
192
|
+
]),
|
|
193
|
+
"dialog-footer": $(() => [
|
|
194
|
+
Y.value ? (u(), f("div", st, [
|
|
195
|
+
_(o, {
|
|
196
|
+
variant: "tertiary",
|
|
197
|
+
onClick: r[3] || (r[3] = (e) => C.value = !1),
|
|
198
|
+
label: d(c)("common.close")
|
|
199
|
+
}, null, 8, ["label"])
|
|
200
|
+
])) : (u(), f("div", nt, [
|
|
201
|
+
_(o, {
|
|
202
|
+
variant: "tertiary",
|
|
203
|
+
onClick: r[2] || (r[2] = (e) => C.value = !1),
|
|
204
|
+
disabled: D.value,
|
|
205
|
+
label: d(c)("common.cancel")
|
|
206
|
+
}, null, 8, ["disabled", "label"]),
|
|
207
|
+
_(o, {
|
|
208
|
+
variant: "primary",
|
|
209
|
+
onClick: te,
|
|
210
|
+
disabled: !U.value || D.value,
|
|
211
|
+
loading: D.value,
|
|
212
|
+
label: d(c)("inventory.stock.recalculation.schedule")
|
|
213
|
+
}, null, 8, ["disabled", "loading", "label"])
|
|
214
|
+
]))
|
|
215
|
+
]),
|
|
216
|
+
default: $(() => [
|
|
217
|
+
a("div", Ie, [
|
|
218
|
+
a("div", $e, l(d(c)("inventory.stock.recalculation.description")), 1),
|
|
219
|
+
Y.value ? F("", !0) : (u(), f(G, { key: 0 }, [
|
|
220
|
+
a("div", Te, [
|
|
221
|
+
a("p", Be, [
|
|
222
|
+
ne(l(d(c)("inventory.stock.recalculation.openingDate")) + " ", 1),
|
|
223
|
+
r[5] || (r[5] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
224
|
+
]),
|
|
225
|
+
r[6] || (r[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)),
|
|
226
|
+
_(W, {
|
|
227
|
+
modelValue: y.value,
|
|
228
|
+
"onUpdate:modelValue": r[0] || (r[0] = (e) => y.value = e),
|
|
229
|
+
items: T.value,
|
|
230
|
+
placeholder: d(c)("inventory.stock.recalculation.selectOpening"),
|
|
231
|
+
loading: D.value,
|
|
232
|
+
disabled: D.value
|
|
233
|
+
}, null, 8, ["modelValue", "items", "placeholder", "loading", "disabled"])
|
|
234
|
+
]),
|
|
235
|
+
a("div", Le, [
|
|
236
|
+
a("p", Re, [
|
|
237
|
+
ne(l(d(c)("inventory.stock.recalculation.untilDate")) + " ", 1),
|
|
238
|
+
r[7] || (r[7] = a("span", { class: "text-fm-color-system-error-300" }, "*", -1))
|
|
239
|
+
]),
|
|
240
|
+
r[8] || (r[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)),
|
|
241
|
+
_(oe, {
|
|
242
|
+
modelValue: v.value,
|
|
243
|
+
"onUpdate:modelValue": r[1] || (r[1] = (e) => v.value = e),
|
|
244
|
+
placeholder: d(c)("inventory.stock.recalculation.selectDate"),
|
|
245
|
+
min: I.value,
|
|
246
|
+
disabled: !y.value || D.value
|
|
247
|
+
}, null, 8, ["modelValue", "placeholder", "min", "disabled"]),
|
|
248
|
+
R.value ? (u(), f("div", Ne, l(R.value), 1)) : F("", !0),
|
|
249
|
+
z.value ? (u(), j(Q, {
|
|
250
|
+
key: 1,
|
|
251
|
+
title: "Warning",
|
|
252
|
+
variant: "warning",
|
|
253
|
+
description: "You have selected today or a future date. The stock balance will be refreshed accordingly."
|
|
254
|
+
})) : F("", !0)
|
|
255
|
+
]),
|
|
256
|
+
y.value && v.value && !R.value ? (u(), j(X, {
|
|
257
|
+
key: 0,
|
|
258
|
+
type: "info"
|
|
259
|
+
}, {
|
|
260
|
+
default: $(() => [
|
|
261
|
+
a("div", Oe, l(d(c)("inventory.stock.recalculation.info")), 1)
|
|
262
|
+
]),
|
|
263
|
+
_: 1
|
|
264
|
+
})) : F("", !0),
|
|
265
|
+
m.value.length > 0 ? (u(), f("div", Pe, [
|
|
266
|
+
b.value ? (u(), f("div", Me, " Loading affected closing drafts... ")) : (u(), f("div", Ke, [
|
|
267
|
+
a("div", Ue, " Affected closing draft(s): " + l(m.value.length), 1),
|
|
268
|
+
a("div", Ee, [
|
|
269
|
+
(u(!0), f(G, null, re(m.value, (e) => (u(), f("div", {
|
|
270
|
+
key: e._id,
|
|
271
|
+
class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary"
|
|
272
|
+
}, [
|
|
273
|
+
r[9] || (r[9] = ne(" • ")),
|
|
274
|
+
e.closingId && B.value.get(e.closingId) ? (u(), f("span", He, l(B.value.get(e.closingId)), 1)) : (u(), f("span", We, l(e._id), 1)),
|
|
275
|
+
e.effectiveAt ? (u(), f("span", ze, " (" + l(new Date(e.effectiveAt).toLocaleString()) + ") ", 1)) : F("", !0)
|
|
276
|
+
]))), 128))
|
|
277
|
+
])
|
|
278
|
+
]))
|
|
279
|
+
])) : F("", !0)
|
|
280
|
+
], 64)),
|
|
281
|
+
i.value.length > 0 ? (u(), f("div", Ge, [
|
|
282
|
+
a("p", je, l(d(c)("inventory.stock.recalculation.recentRequests")), 1),
|
|
283
|
+
a("div", Ye, [
|
|
284
|
+
(u(!0), f(G, null, re(i.value, (e) => {
|
|
285
|
+
var O;
|
|
286
|
+
return u(), f("div", {
|
|
287
|
+
key: e._id,
|
|
288
|
+
class: "p-12 border border-fm-color-border-primary rounded-8 flex flex-col gap-4"
|
|
289
|
+
}, [
|
|
290
|
+
a("div", Je, [
|
|
291
|
+
a("div", Qe, l(d(c)("inventory.stock.recalculation.requestedAt")) + ": " + l(new Date(e.createdAt).toLocaleString()), 1),
|
|
292
|
+
a("div", Xe, [
|
|
293
|
+
(O = e.meta) != null && O.openingType ? (u(), f("div", Ze, l(e.meta.openingType === "stockSnapshot" ? "Snapshot" : "Closing"), 1)) : F("", !0),
|
|
294
|
+
a("div", {
|
|
295
|
+
class: fe(["fm-typo-en-body-xs-600 px-8 py-4 rounded-4", {
|
|
296
|
+
"bg-fm-color-system-error-100 text-fm-color-system-error-500": e.failedReason,
|
|
297
|
+
"bg-fm-color-system-success-100 text-fm-color-system-success-500": e.completedAt,
|
|
298
|
+
"bg-fm-color-system-info-100 text-fm-color-system-info-500": !e.failedReason && !e.completedAt
|
|
299
|
+
}])
|
|
300
|
+
}, l(e.failedReason ? d(c)("inventory.stock.recalculation.status.failed") : e.completedAt ? d(c)("inventory.stock.recalculation.status.completed") : d(c)("inventory.stock.recalculation.status.inProgress")), 3)
|
|
301
|
+
])
|
|
302
|
+
]),
|
|
303
|
+
a("div", qe, l(d(c)("inventory.stock.recalculation.from")) + ": " + l(new Date(e.recalculateStartDate).toLocaleDateString()), 1),
|
|
304
|
+
a("div", et, l(d(c)("inventory.stock.recalculation.to")) + ": " + l(new Date(e.recalculateEndDate).toLocaleDateString()), 1),
|
|
305
|
+
e.createdBy ? (u(), f("div", tt, l(d(c)("inventory.stock.recalculation.requestedBy")) + ": " + l(e.createdBy.name || e.createdBy.id), 1)) : F("", !0),
|
|
306
|
+
e.completedAt ? (u(), f("div", ot, l(d(c)("inventory.stock.recalculation.completedAt")) + ": " + l(new Date(e.completedAt).toLocaleString()), 1)) : F("", !0),
|
|
307
|
+
e.failedReason ? (u(), f("div", at, l(e.failedReason), 1)) : F("", !0)
|
|
308
|
+
]);
|
|
309
|
+
}), 128))
|
|
310
|
+
])
|
|
311
|
+
])) : F("", !0)
|
|
312
|
+
])
|
|
313
|
+
]),
|
|
314
|
+
_: 1
|
|
315
|
+
}, 8, ["modelValue"])
|
|
316
|
+
]);
|
|
317
|
+
};
|
|
318
|
+
}
|
|
319
|
+
}), rt = { class: "fm-typo-en-heading-lg-600" }, ct = { class: "flex flex-col gap-16" }, dt = { class: "flex flex-col gap-4" }, ut = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, mt = { class: "fm-typo-en-body-md-400" }, pt = { class: "flex flex-col gap-4" }, yt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, ft = { class: "fm-typo-en-body-md-400" }, gt = { class: "flex flex-col gap-4" }, vt = { class: "fm-typo-en-label-md-400 text-fm-color-typo-secondary" }, ht = { class: "flex gap-8 ml-auto" }, _t = /* @__PURE__ */ se({
|
|
320
|
+
__name: "ClosingDetailDialog",
|
|
321
|
+
props: {
|
|
322
|
+
modelValue: { type: Boolean },
|
|
323
|
+
type: {},
|
|
324
|
+
data: {}
|
|
325
|
+
},
|
|
326
|
+
emits: ["update:modelValue"],
|
|
327
|
+
setup(Z, { emit: g }) {
|
|
328
|
+
const { t: h } = le(), A = _e(), c = Ve(), V = Z, L = g, x = S({
|
|
329
|
+
get: () => V.modelValue,
|
|
330
|
+
set: (i) => L("update:modelValue", i)
|
|
331
|
+
}), C = p("");
|
|
332
|
+
ue(x, (i) => {
|
|
333
|
+
i || (C.value = "");
|
|
334
|
+
});
|
|
335
|
+
const y = S(() => {
|
|
336
|
+
var i;
|
|
337
|
+
return ((i = V.data) == null ? void 0 : i.skus) ?? [];
|
|
338
|
+
}), v = S(() => {
|
|
339
|
+
var b;
|
|
340
|
+
const i = (b = V.data) == null ? void 0 : b._id;
|
|
341
|
+
if (!i) return "-";
|
|
342
|
+
const n = M(i);
|
|
343
|
+
return new Date(n).toLocaleString();
|
|
344
|
+
}), N = S(() => V.type === "closing" ? h("inventory.closing.history.closingDetail", "Closing Detail") : h("inventory.closing.history.snapshotDetail", "Snapshot Detail")), K = S(() => y.value.map((i) => {
|
|
345
|
+
const n = A.skuById[i.id] ?? null, m = !n;
|
|
346
|
+
return {
|
|
347
|
+
id: i.id,
|
|
348
|
+
sku: n,
|
|
349
|
+
skuName: (n == null ? void 0 : n.name) ?? i.id,
|
|
350
|
+
skuCode: (n == null ? void 0 : n.code) ?? "-",
|
|
351
|
+
balance: i.balance ?? { amount: 0, precision: 0 },
|
|
352
|
+
isMissing: m,
|
|
353
|
+
costs: i.costs,
|
|
354
|
+
weightedAverage: i.weightedAverage
|
|
355
|
+
};
|
|
356
|
+
})), D = S(() => [
|
|
357
|
+
{
|
|
358
|
+
accessorKey: "skuName",
|
|
359
|
+
header: () => h("inventory.ingredient.name", "Ingredient Name"),
|
|
360
|
+
cell: (i) => {
|
|
361
|
+
const n = i.row.original;
|
|
362
|
+
return n.isMissing ? P("div", { class: "flex items-center gap-8" }, [
|
|
363
|
+
P("span", {}, n.id),
|
|
364
|
+
P(
|
|
365
|
+
"span",
|
|
366
|
+
{
|
|
367
|
+
class: "px-8 py-2 rounded-4 bg-fm-color-danger-weak text-fm-color-danger-default fm-typo-en-label-sm-400"
|
|
368
|
+
},
|
|
369
|
+
"Missing"
|
|
370
|
+
)
|
|
371
|
+
]) : i.getValue();
|
|
372
|
+
}
|
|
373
|
+
},
|
|
374
|
+
{
|
|
375
|
+
accessorKey: "skuCode",
|
|
376
|
+
header: () => h("inventory.ingredient.code", "Code")
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
id: "balance",
|
|
380
|
+
header: () => h("inventory.closing.history.balance", "Balance"),
|
|
381
|
+
cell: (i) => {
|
|
382
|
+
var b;
|
|
383
|
+
const n = i.row.original;
|
|
384
|
+
if (n.isMissing || !((b = n.sku) != null && b.unit))
|
|
385
|
+
return `${n.balance.amount / Math.pow(10, n.balance.precision)}`;
|
|
386
|
+
const m = {
|
|
387
|
+
unit: n.sku.unit,
|
|
388
|
+
sku: n.sku,
|
|
389
|
+
amount: n.balance,
|
|
390
|
+
defaultTrackingMeasurement: n.sku.trackingMeasurement ?? void 0
|
|
391
|
+
};
|
|
392
|
+
return P(Fe, m);
|
|
393
|
+
},
|
|
394
|
+
size: 180
|
|
395
|
+
},
|
|
396
|
+
{
|
|
397
|
+
accessorKey: "weightedAverage",
|
|
398
|
+
header: () => h("inventory.closing.history.weightedAvgCost", "Weighted Avg Cost"),
|
|
399
|
+
cell: (i) => {
|
|
400
|
+
if (!c.enableTotalCost)
|
|
401
|
+
return P(
|
|
402
|
+
Ce,
|
|
403
|
+
{ featureKey: "total-cost", compact: !0 },
|
|
404
|
+
() => P("span", "0.00")
|
|
405
|
+
);
|
|
406
|
+
const n = i.getValue();
|
|
407
|
+
if (!n) return "-";
|
|
408
|
+
const m = n.amount ?? 0, b = n.precision ?? 0, T = n.currency ?? "", B = m / Math.pow(10, b);
|
|
409
|
+
return `${T} ${B.toFixed(2)}`;
|
|
410
|
+
}
|
|
411
|
+
}
|
|
412
|
+
]);
|
|
413
|
+
return (i, n) => {
|
|
414
|
+
const m = w("FmTextField"), b = w("FmTable"), T = w("FmButton"), B = w("FmDialog");
|
|
415
|
+
return u(), j(B, {
|
|
416
|
+
modelValue: x.value,
|
|
417
|
+
"onUpdate:modelValue": n[2] || (n[2] = (I) => x.value = I),
|
|
418
|
+
"close-button": "",
|
|
419
|
+
dismissAway: "",
|
|
420
|
+
"max-width": "900px"
|
|
421
|
+
}, {
|
|
422
|
+
"dialog-header": $(() => [
|
|
423
|
+
a("div", rt, l(N.value), 1)
|
|
424
|
+
]),
|
|
425
|
+
default: $(() => {
|
|
426
|
+
var I;
|
|
427
|
+
return [
|
|
428
|
+
a("div", ct, [
|
|
429
|
+
a("div", dt, [
|
|
430
|
+
a("div", ut, l(V.type === "closing" ? d(h)("inventory.closing.history.closingId") : d(h)("inventory.closing.history.snapshotId", "Snapshot ID")), 1),
|
|
431
|
+
a("div", mt, l(((I = V.data) == null ? void 0 : I._id) ?? "-"), 1)
|
|
432
|
+
]),
|
|
433
|
+
a("div", pt, [
|
|
434
|
+
a("div", yt, l(d(h)("inventory.closing.history.date")), 1),
|
|
435
|
+
a("div", ft, l(v.value), 1)
|
|
436
|
+
]),
|
|
437
|
+
a("div", gt, [
|
|
438
|
+
a("div", vt, l(d(h)("inventory.closing.history.ingredientBalances", "Ingredient Balances")) + " (" + l(y.value.length) + ") ", 1),
|
|
439
|
+
_(m, {
|
|
440
|
+
modelValue: C.value,
|
|
441
|
+
"onUpdate:modelValue": n[0] || (n[0] = (R) => C.value = R),
|
|
442
|
+
placeholder: "Filter by code or name"
|
|
443
|
+
}, null, 8, ["modelValue"]),
|
|
444
|
+
_(b, {
|
|
445
|
+
"row-data": K.value,
|
|
446
|
+
"column-defs": D.value,
|
|
447
|
+
pagination: { pageSize: 10 },
|
|
448
|
+
"search-value": C.value
|
|
449
|
+
}, null, 8, ["row-data", "column-defs", "search-value"])
|
|
450
|
+
])
|
|
451
|
+
])
|
|
452
|
+
];
|
|
453
|
+
}),
|
|
454
|
+
"dialog-footer": $(() => [
|
|
455
|
+
a("div", ht, [
|
|
456
|
+
_(T, {
|
|
457
|
+
variant: "tertiary",
|
|
458
|
+
onClick: n[1] || (n[1] = (I) => x.value = !1),
|
|
459
|
+
label: "Close"
|
|
460
|
+
})
|
|
461
|
+
])
|
|
462
|
+
]),
|
|
463
|
+
_: 1
|
|
464
|
+
}, 8, ["modelValue"]);
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
}), bt = { class: "flex flex-col gap-16 p-16" }, kt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, Dt = { class: "fm-typo-en-body-sm-400 text-fm-color-typo-secondary" }, xt = { class: "flex flex-col gap-16" }, St = { class: "fm-typo-en-body-md-400 text-fm-color-typo-secondary" }, wt = { class: "flex gap-8 ml-auto" }, Mt = /* @__PURE__ */ se({
|
|
468
|
+
__name: "ClosingHistoryView",
|
|
469
|
+
setup(Z) {
|
|
470
|
+
var Q, X;
|
|
471
|
+
const { t: g } = le(), h = me(), A = be(), c = he(), V = De(), L = pe(), x = p("closings"), C = S(() => [
|
|
472
|
+
{ label: g("inventory.closing.history.closingsTab"), value: "closings" },
|
|
473
|
+
{ label: g("inventory.closing.history.snapshotsTab"), value: "snapshots" }
|
|
474
|
+
]), y = p([]), v = p(0), N = p([]), K = p(0);
|
|
475
|
+
let D = A.currentLocationDBName;
|
|
476
|
+
async function i(o) {
|
|
477
|
+
return A.currentLocationDBName ? (D = A.currentLocationDBName, h.listClosingsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
|
|
478
|
+
}
|
|
479
|
+
async function n(o) {
|
|
480
|
+
return A.currentLocationDBName ? (D = A.currentLocationDBName, h.listStockSnapshotsPage(o)) : { docs: [], nextStartkey: null, hasMore: !1 };
|
|
481
|
+
}
|
|
482
|
+
function m() {
|
|
483
|
+
y.value = [], v.value++;
|
|
484
|
+
}
|
|
485
|
+
function b() {
|
|
486
|
+
N.value = [], K.value++;
|
|
487
|
+
}
|
|
488
|
+
const T = p(!1), B = p("closing"), I = p(null);
|
|
489
|
+
function R(o) {
|
|
490
|
+
return [
|
|
491
|
+
o.getFullYear(),
|
|
492
|
+
String(o.getMonth() + 1).padStart(2, "0"),
|
|
493
|
+
String(o.getDate()).padStart(2, "0")
|
|
494
|
+
].join("-");
|
|
495
|
+
}
|
|
496
|
+
const z = () => R(new Date(Date.now() - 864e5)), U = p(z()), Y = S(() => {
|
|
497
|
+
const o = [
|
|
498
|
+
{
|
|
499
|
+
label: g("inventory.stock.recalculation.title"),
|
|
500
|
+
value: "recalculation",
|
|
501
|
+
prependIcon: "history",
|
|
502
|
+
isAdminOnly: !0
|
|
503
|
+
}
|
|
504
|
+
];
|
|
505
|
+
return x.value === "closings" ? o.push(
|
|
506
|
+
{
|
|
507
|
+
label: g("inventory.closing.history.initiate_opening"),
|
|
508
|
+
value: "initiateOpening",
|
|
509
|
+
prependIcon: "add_box",
|
|
510
|
+
isAdminOnly: !0
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
label: "Refresh",
|
|
514
|
+
value: "refreshOpening",
|
|
515
|
+
prependIcon: "refresh"
|
|
516
|
+
}
|
|
517
|
+
) : o.push(
|
|
518
|
+
{
|
|
519
|
+
label: g("inventory.closing.history.initiate_snapshot"),
|
|
520
|
+
value: "initiateStockSnapshot",
|
|
521
|
+
prependIcon: "camera",
|
|
522
|
+
isAdminOnly: !0
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
label: "Refresh",
|
|
526
|
+
value: "refreshStockSnapshot",
|
|
527
|
+
prependIcon: "refresh"
|
|
528
|
+
}
|
|
529
|
+
), o;
|
|
530
|
+
}), J = p();
|
|
531
|
+
function q(o) {
|
|
532
|
+
var s;
|
|
533
|
+
switch (o) {
|
|
534
|
+
case "recalculation":
|
|
535
|
+
return (s = J.value) == null ? void 0 : s.open();
|
|
536
|
+
case "initiateOpening": {
|
|
537
|
+
V.open({
|
|
538
|
+
title: "Initiate Opening Balance",
|
|
539
|
+
message: "Initiate opening balance if no opening balance exists for the current location.",
|
|
540
|
+
primaryActions: { text: "Confirm", close: !0 }
|
|
541
|
+
}).onPrimary(async () => {
|
|
542
|
+
try {
|
|
543
|
+
await h.initiateClosing(), L.open({
|
|
544
|
+
message: "Opening balance initiated successfully.",
|
|
545
|
+
type: "success"
|
|
546
|
+
}), await m();
|
|
547
|
+
} catch (e) {
|
|
548
|
+
L.open({
|
|
549
|
+
message: e.message || "Failed to initiate opening balance. Please try again.",
|
|
550
|
+
type: "error"
|
|
551
|
+
});
|
|
552
|
+
}
|
|
553
|
+
});
|
|
554
|
+
break;
|
|
555
|
+
}
|
|
556
|
+
case "initiateStockSnapshot": {
|
|
557
|
+
U.value = z(), E.value = !0;
|
|
558
|
+
break;
|
|
559
|
+
}
|
|
560
|
+
case "refreshOpening": {
|
|
561
|
+
m();
|
|
562
|
+
break;
|
|
563
|
+
}
|
|
564
|
+
case "refreshStockSnapshot": {
|
|
565
|
+
b();
|
|
566
|
+
break;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const E = p(!1), H = p(!1), ee = z();
|
|
571
|
+
async function te() {
|
|
572
|
+
H.value = !0;
|
|
573
|
+
try {
|
|
574
|
+
await h.initiateStockSnapshot(U.value), L.open({
|
|
575
|
+
message: "Stock snapshot created successfully.",
|
|
576
|
+
type: "success"
|
|
577
|
+
}), E.value = !1, await b();
|
|
578
|
+
} catch (o) {
|
|
579
|
+
L.open({
|
|
580
|
+
message: o.message || "Failed to create stock snapshot. Please try again.",
|
|
581
|
+
type: "error"
|
|
582
|
+
});
|
|
583
|
+
} finally {
|
|
584
|
+
H.value = !1;
|
|
585
|
+
}
|
|
586
|
+
}
|
|
587
|
+
const t = [
|
|
588
|
+
...(Q = c.sessionUser.value) != null && Q.role.isAdmin ? [
|
|
589
|
+
{
|
|
590
|
+
accessorKey: "_id",
|
|
591
|
+
header: () => P(ce, {}, () => `${g("inventory.closing.history.closingId")}`),
|
|
592
|
+
cell: (o) => o.getValue()
|
|
593
|
+
}
|
|
594
|
+
] : [],
|
|
595
|
+
{
|
|
596
|
+
accessorKey: "_id",
|
|
597
|
+
id: "date",
|
|
598
|
+
header: () => g("inventory.closing.history.date"),
|
|
599
|
+
cell: (o) => {
|
|
600
|
+
const s = o.getValue(), e = M(s);
|
|
601
|
+
return new Date(e).toLocaleDateString();
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
accessorKey: "_id",
|
|
606
|
+
id: "time",
|
|
607
|
+
header: () => g("inventory.closing.history.time"),
|
|
608
|
+
cell: (o) => {
|
|
609
|
+
const s = o.getValue(), e = M(s);
|
|
610
|
+
return new Date(e).toLocaleTimeString();
|
|
611
|
+
}
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
accessorKey: "ref",
|
|
615
|
+
header: () => g("inventory.closing.history.createdFrom"),
|
|
616
|
+
cell: (o) => o.getValue() || "-"
|
|
617
|
+
}
|
|
618
|
+
], r = [
|
|
619
|
+
...(X = c.sessionUser.value) != null && X.role.isAdmin ? [
|
|
620
|
+
{
|
|
621
|
+
accessorKey: "_id",
|
|
622
|
+
header: () => P(
|
|
623
|
+
ce,
|
|
624
|
+
{},
|
|
625
|
+
() => `${g("inventory.closing.history.snapshotId", "Snapshot ID")}`
|
|
626
|
+
),
|
|
627
|
+
cell: (o) => o.getValue()
|
|
628
|
+
}
|
|
629
|
+
] : [],
|
|
630
|
+
{
|
|
631
|
+
accessorKey: "_id",
|
|
632
|
+
id: "date",
|
|
633
|
+
header: () => g("inventory.closing.history.date"),
|
|
634
|
+
cell: (o) => {
|
|
635
|
+
const s = o.getValue(), e = M(s);
|
|
636
|
+
return new Date(e).toLocaleDateString();
|
|
637
|
+
}
|
|
638
|
+
},
|
|
639
|
+
{
|
|
640
|
+
accessorKey: "_id",
|
|
641
|
+
id: "time",
|
|
642
|
+
header: () => g("inventory.closing.history.time"),
|
|
643
|
+
cell: (o) => {
|
|
644
|
+
const s = o.getValue(), e = M(s);
|
|
645
|
+
return new Date(e).toLocaleTimeString();
|
|
646
|
+
}
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
accessorKey: "remark",
|
|
650
|
+
header: () => g("inventory.closing.history.createdFrom"),
|
|
651
|
+
cell: (o) => o.getValue() || "-"
|
|
652
|
+
}
|
|
653
|
+
];
|
|
654
|
+
async function W(o, s) {
|
|
655
|
+
const e = await h.getClosingById(o, s);
|
|
656
|
+
if (!e) throw new Error(`Closing ${o} not found`);
|
|
657
|
+
return B.value = "closing", I.value = e, T.value = !0, e;
|
|
658
|
+
}
|
|
659
|
+
async function oe(o, s) {
|
|
660
|
+
const e = await h.getStockSnapshotById(o, s);
|
|
661
|
+
if (!e) throw new Error(`Stock snapshot ${o} not found`);
|
|
662
|
+
return B.value = "snapshot", I.value = e, T.value = !0, e;
|
|
663
|
+
}
|
|
664
|
+
return A.watchLocation(async () => {
|
|
665
|
+
(A.currentLocationDBName || void 0) !== D && (m(), b());
|
|
666
|
+
}), (o, s) => {
|
|
667
|
+
const e = w("FmTabs"), O = w("FmDatePicker"), ie = w("FmButton"), ye = w("FmDialog");
|
|
668
|
+
return u(), j(ve, {
|
|
669
|
+
actions: Y.value,
|
|
670
|
+
title: d(g)("inventory.closing.history.title"),
|
|
671
|
+
"onClick:action": q
|
|
672
|
+
}, {
|
|
673
|
+
default: $(() => [
|
|
674
|
+
a("div", bt, [
|
|
675
|
+
_(ke, {
|
|
676
|
+
"change-location": "",
|
|
677
|
+
"hide-filter-options": !0
|
|
678
|
+
}),
|
|
679
|
+
_(e, {
|
|
680
|
+
"model-value": x.value,
|
|
681
|
+
"onUpdate:modelValue": s[0] || (s[0] = (k) => x.value = k),
|
|
682
|
+
items: C.value
|
|
683
|
+
}, null, 8, ["model-value", "items"]),
|
|
684
|
+
x.value === "closings" ? (u(), f(G, { key: 0 }, [
|
|
685
|
+
a("div", kt, l(d(g)("inventory.closing.history.closingsDescription")), 1),
|
|
686
|
+
_(de, {
|
|
687
|
+
rows: y.value,
|
|
688
|
+
"onUpdate:rows": s[1] || (s[1] = (k) => y.value = k),
|
|
689
|
+
"fetch-page": i,
|
|
690
|
+
"refresh-key": v.value,
|
|
691
|
+
"column-defs": t,
|
|
692
|
+
"fetch-detail": (k, ae) => W(k._id, ae)
|
|
693
|
+
}, null, 8, ["rows", "refresh-key", "fetch-detail"])
|
|
694
|
+
], 64)) : F("", !0),
|
|
695
|
+
x.value === "snapshots" ? (u(), f(G, { key: 1 }, [
|
|
696
|
+
a("div", Dt, l(d(g)("inventory.closing.history.snapshotsDescription")), 1),
|
|
697
|
+
_(de, {
|
|
698
|
+
rows: N.value,
|
|
699
|
+
"onUpdate:rows": s[2] || (s[2] = (k) => N.value = k),
|
|
700
|
+
"fetch-page": n,
|
|
701
|
+
"refresh-key": K.value,
|
|
702
|
+
"column-defs": r,
|
|
703
|
+
"fetch-detail": (k, ae) => oe(k._id, ae)
|
|
704
|
+
}, null, 8, ["rows", "refresh-key", "fetch-detail"])
|
|
705
|
+
], 64)) : F("", !0)
|
|
706
|
+
]),
|
|
707
|
+
(u(), j(ge, { to: "body" }, [
|
|
708
|
+
_(it, {
|
|
709
|
+
ref_key: "recalculationDialogRef",
|
|
710
|
+
ref: J,
|
|
711
|
+
onSubmitted: s[3] || (s[3] = (k) => {
|
|
712
|
+
m(), b();
|
|
713
|
+
})
|
|
714
|
+
}, null, 512),
|
|
715
|
+
_(_t, {
|
|
716
|
+
modelValue: T.value,
|
|
717
|
+
"onUpdate:modelValue": s[4] || (s[4] = (k) => T.value = k),
|
|
718
|
+
type: B.value,
|
|
719
|
+
data: I.value
|
|
720
|
+
}, null, 8, ["modelValue", "type", "data"]),
|
|
721
|
+
_(ye, {
|
|
722
|
+
modelValue: E.value,
|
|
723
|
+
"onUpdate:modelValue": s[7] || (s[7] = (k) => E.value = k),
|
|
724
|
+
"close-button": "",
|
|
725
|
+
dismissAway: "",
|
|
726
|
+
"max-width": "400px"
|
|
727
|
+
}, {
|
|
728
|
+
"dialog-header": $(() => s[8] || (s[8] = [
|
|
729
|
+
a("div", { class: "fm-typo-en-heading-lg-600" }, "Initiate Stock Snapshot", -1)
|
|
730
|
+
])),
|
|
731
|
+
default: $(() => [
|
|
732
|
+
a("div", xt, [
|
|
733
|
+
a("div", St, l(d(g)("inventory.closing.history.snapshotsDescription")), 1),
|
|
734
|
+
_(O, {
|
|
735
|
+
modelValue: U.value,
|
|
736
|
+
"onUpdate:modelValue": s[5] || (s[5] = (k) => U.value = k),
|
|
737
|
+
label: "Snapshot Date",
|
|
738
|
+
max: d(ee)
|
|
739
|
+
}, null, 8, ["modelValue", "max"])
|
|
740
|
+
])
|
|
741
|
+
]),
|
|
742
|
+
"dialog-footer": $(() => [
|
|
743
|
+
a("div", wt, [
|
|
744
|
+
_(ie, {
|
|
745
|
+
variant: "tertiary",
|
|
746
|
+
onClick: s[6] || (s[6] = (k) => E.value = !1),
|
|
747
|
+
label: "Cancel",
|
|
748
|
+
disabled: H.value
|
|
749
|
+
}, null, 8, ["disabled"]),
|
|
750
|
+
_(ie, {
|
|
751
|
+
variant: "primary",
|
|
752
|
+
onClick: te,
|
|
753
|
+
label: "Confirm",
|
|
754
|
+
loading: H.value
|
|
755
|
+
}, null, 8, ["loading"])
|
|
756
|
+
])
|
|
757
|
+
]),
|
|
758
|
+
_: 1
|
|
759
|
+
}, 8, ["modelValue"])
|
|
760
|
+
]))
|
|
761
|
+
]),
|
|
762
|
+
_: 1
|
|
763
|
+
}, 8, ["actions", "title"]);
|
|
764
|
+
};
|
|
765
|
+
}
|
|
766
|
+
});
|
|
767
|
+
export {
|
|
768
|
+
Mt as default
|
|
769
|
+
};
|