@openmrs/esm-stock-management-app 1.0.1-pre.327
Sign up to get free protection for your applications and to get access to all the features.
- package/.editorconfig +12 -0
- package/.eslintignore +2 -0
- package/.eslintrc +39 -0
- package/.husky/pre-commit +4 -0
- package/.husky/pre-push +6 -0
- package/.prettierignore +14 -0
- package/.turbo.json +18 -0
- package/.yarn/plugins/@yarnpkg/plugin-outdated.cjs +35 -0
- package/LICENSE +401 -0
- package/README.md +3 -0
- package/__mocks__/react-i18next.js +55 -0
- package/dist/26.js +2 -0
- package/dist/26.js.LICENSE.txt +32 -0
- package/dist/26.js.map +1 -0
- package/dist/294.js +2 -0
- package/dist/294.js.LICENSE.txt +9 -0
- package/dist/294.js.map +1 -0
- package/dist/375.js +2 -0
- package/dist/375.js.LICENSE.txt +40 -0
- package/dist/375.js.map +1 -0
- package/dist/46.js +1 -0
- package/dist/46.js.map +1 -0
- package/dist/484.js +1 -0
- package/dist/484.js.map +1 -0
- package/dist/574.js +1 -0
- package/dist/629.js +1 -0
- package/dist/629.js.map +1 -0
- package/dist/707.js +1 -0
- package/dist/707.js.map +1 -0
- package/dist/800.js +2 -0
- package/dist/800.js.LICENSE.txt +3 -0
- package/dist/800.js.map +1 -0
- package/dist/935.js +2 -0
- package/dist/935.js.LICENSE.txt +19 -0
- package/dist/935.js.map +1 -0
- package/dist/979.js +1 -0
- package/dist/979.js.map +1 -0
- package/dist/main.js +2 -0
- package/dist/main.js.LICENSE.txt +60 -0
- package/dist/main.js.map +1 -0
- package/dist/openmrs-esm-stock-management-app.js +1 -0
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +356 -0
- package/dist/openmrs-esm-stock-management-app.js.map +1 -0
- package/dist/routes.json +1 -0
- package/i18next-parser.config.js +89 -0
- package/jest.config.js +25 -0
- package/package.json +116 -0
- package/src/config-schema.ts +18 -0
- package/src/constants.ts +214 -0
- package/src/core/api/api.ts +34 -0
- package/src/core/api/types/Auditable.ts +9 -0
- package/src/core/api/types/BaseOpenmrsData.ts +4 -0
- package/src/core/api/types/BaseOpenmrsMetadata.ts +6 -0
- package/src/core/api/types/BaseOpenmrsObject.ts +3 -0
- package/src/core/api/types/BatchJob.ts +121 -0
- package/src/core/api/types/DashboardExtension.ts +8 -0
- package/src/core/api/types/Location.ts +16 -0
- package/src/core/api/types/LocationTree.ts +7 -0
- package/src/core/api/types/OpenmrsData.ts +5 -0
- package/src/core/api/types/OpenmrsMetadata.ts +8 -0
- package/src/core/api/types/OpenmrsObject.ts +3 -0
- package/src/core/api/types/PageableResult.ts +15 -0
- package/src/core/api/types/Party.ts +8 -0
- package/src/core/api/types/RecordPermission.ts +9 -0
- package/src/core/api/types/Retireable.ts +9 -0
- package/src/core/api/types/Voidable.ts +9 -0
- package/src/core/api/types/concept/Concept.ts +24 -0
- package/src/core/api/types/concept/ConceptName.ts +14 -0
- package/src/core/api/types/concept/Drug.ts +14 -0
- package/src/core/api/types/identity/Credentials.ts +4 -0
- package/src/core/api/types/identity/Patient.ts +3 -0
- package/src/core/api/types/identity/Person.ts +4 -0
- package/src/core/api/types/identity/PriviledgeScope.ts +9 -0
- package/src/core/api/types/identity/Privilege.ts +5 -0
- package/src/core/api/types/identity/Role.ts +5 -0
- package/src/core/api/types/identity/Session.ts +16 -0
- package/src/core/api/types/identity/User.ts +19 -0
- package/src/core/api/types/identity/UserRoleScope.ts +17 -0
- package/src/core/api/types/identity/UserRoleScopeLocation.ts +7 -0
- package/src/core/api/types/identity/UserRoleScopeOperationType.ts +6 -0
- package/src/core/api/types/stockItem/ImportResult.ts +9 -0
- package/src/core/api/types/stockItem/StockBatch.ts +8 -0
- package/src/core/api/types/stockItem/StockBatchDTO.ts +8 -0
- package/src/core/api/types/stockItem/StockItem.ts +63 -0
- package/src/core/api/types/stockItem/StockItemInventory.ts +10 -0
- package/src/core/api/types/stockItem/StockItemPackagingUOM.ts +20 -0
- package/src/core/api/types/stockItem/StockItemTransaction.ts +22 -0
- package/src/core/api/types/stockItem/StockRule.ts +28 -0
- package/src/core/api/types/stockOperation/LocationType.ts +4 -0
- package/src/core/api/types/stockOperation/StockOperation.ts +36 -0
- package/src/core/api/types/stockOperation/StockOperationAction.ts +24 -0
- package/src/core/api/types/stockOperation/StockOperationDTO.ts +64 -0
- package/src/core/api/types/stockOperation/StockOperationItem.ts +13 -0
- package/src/core/api/types/stockOperation/StockOperationItemCost.ts +14 -0
- package/src/core/api/types/stockOperation/StockOperationItemDTO.ts +29 -0
- package/src/core/api/types/stockOperation/StockOperationLinkDTO.ts +13 -0
- package/src/core/api/types/stockOperation/StockOperationStatus.ts +18 -0
- package/src/core/api/types/stockOperation/StockOperationType.ts +162 -0
- package/src/core/api/types/stockOperation/StockSource.ts +8 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.component.tsx +37 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.scss +0 -0
- package/src/core/components/carbon/controlled-combo-box/controlled-combo-box.test.tsx +8 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.component.tsx +40 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.scss +0 -0
- package/src/core/components/carbon/controlled-dropdown/controlled-dropdown.test.tsx +8 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.component.tsx +44 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.scss +0 -0
- package/src/core/components/carbon/controlled-number-input/controlled-number-input.test.tsx +8 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.component.tsx +54 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.scss +0 -0
- package/src/core/components/carbon/controlled-radio-button-group/controlled-radio-button-group.test.tsx +8 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.component.tsx +37 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.scss +0 -0
- package/src/core/components/carbon/controlled-text-area/controlled-text-area.test.tsx +11 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.component.tsx +37 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.resource.tsx +0 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.scss +0 -0
- package/src/core/components/carbon/controlled-text-input/controlled-text-input.test.tsx +8 -0
- package/src/core/components/carbon/types.ts +7 -0
- package/src/core/components/card/metrics-card-component.tsx +102 -0
- package/src/core/components/card/metrics-card.scss +78 -0
- package/src/core/components/overlay/hook.ts +47 -0
- package/src/core/components/overlay/overlay.component.tsx +52 -0
- package/src/core/components/overlay/overlay.scss +97 -0
- package/src/core/components/side-nav/side-nav.component.tsx +62 -0
- package/src/core/components/side-nav/side-nav.scss +126 -0
- package/src/core/components/side-nav/types.ts +6 -0
- package/src/core/components/table/table.component.tsx +239 -0
- package/src/core/components/table/table.scss +173 -0
- package/src/core/components/table/types.ts +8 -0
- package/src/core/components/tabs/types.ts +7 -0
- package/src/core/components/tabs/vertical-tabs.component.tsx +53 -0
- package/src/core/components/tabs/vertical-tabs.scss +126 -0
- package/src/core/hooks/debounce-hook.ts +35 -0
- package/src/core/print/PrintStyles.ts +774 -0
- package/src/core/print/PrintTemplate.ts +65 -0
- package/src/core/print/printUtils.ts +19 -0
- package/src/core/utils/alert.ts +10 -0
- package/src/core/utils/datetimeUtils.ts +84 -0
- package/src/core/utils/debounce.ts +21 -0
- package/src/core/utils/imageUtils.ts +82 -0
- package/src/core/utils/stringUtils.ts +27 -0
- package/src/core/utils/utils.ts +70 -0
- package/src/createDashboardLink.tsx +43 -0
- package/src/dashboard/stock-management-dashboard-side-nav.component.tsx +50 -0
- package/src/dashboard/stock-management-dashboard.component.tsx +41 -0
- package/src/dashboard/stock-management-dashboard.scss +8 -0
- package/src/dashboard.meta.ts +5 -0
- package/src/declarations.d.ts +6 -0
- package/src/index.ts +64 -0
- package/src/root.component.tsx +12 -0
- package/src/root.scss +174 -0
- package/src/routes.json +53 -0
- package/src/setup-tests.ts +1 -0
- package/src/stock-app-menu-item/item.component.tsx +21 -0
- package/src/stock-app-menu-item/item.resource.ts +0 -0
- package/src/stock-app-menu-item/item.scss +17 -0
- package/src/stock-batch/stock-batch.resource.ts +79 -0
- package/src/stock-home/stock-home-detail-card.scss +211 -0
- package/src/stock-home/stock-home-detail-cards.component.tsx +62 -0
- package/src/stock-home/stock-home-inventory-card.component.tsx +80 -0
- package/src/stock-home/stock-home-inventory-expiry.resource.tsx +32 -0
- package/src/stock-home/stock-home-inventory-items.resource.tsx +28 -0
- package/src/stock-home/stock-home-issuing-card.component.tsx +84 -0
- package/src/stock-home/stock-home-issuing.resource.tsx +18 -0
- package/src/stock-home/stock-home-landing-page-component.tsx +14 -0
- package/src/stock-home/stock-home-metrics.tsx +112 -0
- package/src/stock-home/stock-home-receiving-card.component.tsx +66 -0
- package/src/stock-home/stock-home-receiving.resource.tsx +17 -0
- package/src/stock-home/stock-home.scss +13 -0
- package/src/stock-home/useDisposalList.tsx +18 -0
- package/src/stock-home/useStockList.tsx +36 -0
- package/src/stock-items/add-bulk-stock-item/add-stock-items-bulk-import-action-button.component.tsx +26 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx +109 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.resource.ts +14 -0
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.scss +0 -0
- package/src/stock-items/add-stock-item/add-stock-action-button.component.tsx +21 -0
- package/src/stock-items/add-stock-item/add-stock-item.component.tsx +84 -0
- package/src/stock-items/add-stock-item/add-stock-item.resource.tsx +36 -0
- package/src/stock-items/add-stock-item/add-stock-item.scss +5 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.component.tsx +98 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.resource.tsx +71 -0
- package/src/stock-items/add-stock-item/batch-information/batch-information.scss +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.component.tsx +79 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.scss +0 -0
- package/src/stock-items/add-stock-item/concepts-selector/concepts-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/dispensing-package-measurement/dispensing-package-measurement.component.tsx +76 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.component.tsx +66 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.scss +0 -0
- package/src/stock-items/add-stock-item/dispensing-unit-selector/dispensing-unit-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.component.tsx +83 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.resource.tsx +50 -0
- package/src/stock-items/add-stock-item/drug-selector/drug-selector.scss +0 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.component.tsx +255 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.resource.tsx +38 -0
- package/src/stock-items/add-stock-item/packaging-units/packaging-units.scss +21 -0
- package/src/stock-items/add-stock-item/packaging-units/validationSchema.ts +14 -0
- package/src/stock-items/add-stock-item/packaging-units-concept-selector/packaging-units-concept-selector.component.tsx +95 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.component.tsx +70 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.scss +0 -0
- package/src/stock-items/add-stock-item/preferred-vendor-selector/preferred-vendor-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/quantities/quantities.component.tsx +83 -0
- package/src/stock-items/add-stock-item/quantities/quantities.resource.tsx +69 -0
- package/src/stock-items/add-stock-item/quantities/quantities.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.component.tsx +67 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-category-selector/stock-item-category-selector.test.tsx +8 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +239 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.resource.tsx +14 -0
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rule-button.component.tsx +30 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +424 -0
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.scss +18 -0
- package/src/stock-items/add-stock-item/stock-item-rules/delete-stock-rule-modal.component.tsx +47 -0
- package/src/stock-items/add-stock-item/stock-item-rules/edit-stock-rule.component.tsx +37 -0
- package/src/stock-items/add-stock-item/stock-item-rules/edit-stock-rule.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +222 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.resource.tsx +72 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.component.tsx +67 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.scss +0 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.component.tsx +38 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-filter.scss +13 -0
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules.resource.ts +79 -0
- package/src/stock-items/add-stock-item/stock-item-units-edit/stock-item-units-edit.component.tsx +132 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.component.tsx +16 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.resource.tsx +0 -0
- package/src/stock-items/add-stock-item/stock-rules/stock-rules.scss +0 -0
- package/src/stock-items/add-stock-item/transactions/transactions.component.tsx +151 -0
- package/src/stock-items/add-stock-item/transactions/transactions.resource.tsx +109 -0
- package/src/stock-items/add-stock-item/transactions/transactions.scss +0 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.component.tsx +28 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.resource.tsx +0 -0
- package/src/stock-items/components/filter-stock-items/filter-stock-items.scss +3 -0
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +30 -0
- package/src/stock-items/stock-item.utils.tsx +62 -0
- package/src/stock-items/stock-items-table.component.tsx +266 -0
- package/src/stock-items/stock-items-table.resource.ts +58 -0
- package/src/stock-items/stock-items-table.scss +66 -0
- package/src/stock-items/stock-items.component.tsx +12 -0
- package/src/stock-items/stock-items.resource.ts +365 -0
- package/src/stock-items/types.ts +8 -0
- package/src/stock-items/validationSchema.ts +67 -0
- package/src/stock-locations/stock-locations-table.component.tsx +69 -0
- package/src/stock-locations/stock-locations-table.resource.tsx +73 -0
- package/src/stock-locations/stock-locations-table.scss +0 -0
- package/src/stock-locations/stock-locations.component.tsx +12 -0
- package/src/stock-locations/stock-locations.resource.ts +0 -0
- package/src/stock-lookups/stock-lookups.resource.ts +306 -0
- package/src/stock-management-admin-card-link.component.tsx +29 -0
- package/src/stock-management-header/stock-management-Illustration.tsx +35 -0
- package/src/stock-management-header/stock-management-header.component.tsx +37 -0
- package/src/stock-management-header/stock-management-header.scss +58 -0
- package/src/stock-management.component.tsx +6 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +491 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.resource.tsx +33 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.scss +44 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.utils.tsx +241 -0
- package/src/stock-operations/add-stock-operation/add-stock-utils.ts +110 -0
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +352 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.component.tsx +347 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.resource.tsx +0 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.scss +0 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.test.tsx +11 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.scss +5 -0
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.tsx +272 -0
- package/src/stock-operations/add-stock-operation/stock-operation-context/useStockOperationContext.tsx +22 -0
- package/src/stock-operations/add-stock-operation/stock-operation-submission.component.tsx +188 -0
- package/src/stock-operations/add-stock-operation/types.ts +55 -0
- package/src/stock-operations/add-stock-operation/validationSchema.ts +45 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.component.tsx +100 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.resource.tsx +46 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.scss +0 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.test.tsx +11 -0
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +73 -0
- package/src/stock-operations/party-selector/party-selector.component.tsx +58 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.component.tsx +65 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.resource.tsx +0 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.scss +0 -0
- package/src/stock-operations/qty-uom-selector/qty-uom-selector.test.tsx +11 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.component.tsx +74 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.resource.tsx +47 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.scss +0 -0
- package/src/stock-operations/stock-item-selector/stock-item-selector.test.tsx +11 -0
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.component.tsx +27 -0
- package/src/stock-operations/stock-operation-operations-filter/stock-operation-operations-filter.scss +13 -0
- package/src/stock-operations/stock-operation-reason-selector/stock-operation-reason-selector.component.tsx +65 -0
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.component.tsx +30 -0
- package/src/stock-operations/stock-operation-sources-filter/stock-operation-sources-filter.scss +13 -0
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.component.tsx +32 -0
- package/src/stock-operations/stock-operation-statuses-filter/stock-operation-statuses-filter.scss +13 -0
- package/src/stock-operations/stock-operation-types-selector/stock-operation-types-selector.component.tsx +80 -0
- package/src/stock-operations/stock-operation.utils.tsx +106 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-approve-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-approve-dispatch-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-cancel-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-complete-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-completed-dispatch-button.component.tsx +36 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +167 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.scss +14 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-issue-stock-button.component.tsx +58 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-print-button.component.tsx +160 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-reject-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-dialog/stock-operations-return-button.component.tsx +37 -0
- package/src/stock-operations/stock-operations-table.component.tsx +524 -0
- package/src/stock-operations/stock-operations-table.resource.tsx +77 -0
- package/src/stock-operations/stock-operations-table.scss +0 -0
- package/src/stock-operations/stock-operations.component.tsx +12 -0
- package/src/stock-operations/stock-operations.resource.ts +238 -0
- package/src/stock-operations/stock-print-reports/GoodsReceivedNote.tsx +147 -0
- package/src/stock-operations/stock-print-reports/RequisitionDocument.tsx +153 -0
- package/src/stock-operations/stock-print-reports/StockOperationReport.tsx +133 -0
- package/src/stock-operations/stock-print-reports/StockTransferDocument.tsx +161 -0
- package/src/stock-operations/swr-revalidation.ts +7 -0
- package/src/stock-operations/users-selector/users-selector.component.tsx +77 -0
- package/src/stock-operations/users-selector/users-selector.resource.tsx +47 -0
- package/src/stock-operations/validation-schema.ts +195 -0
- package/src/stock-reports/ReportType.ts +63 -0
- package/src/stock-reports/stock-reports.component.tsx +0 -0
- package/src/stock-reports/stock-reports.resource.ts +0 -0
- package/src/stock-settings/stock-settings.component.tsx +11 -0
- package/src/stock-settings/stock-settings.resource.ts +0 -0
- package/src/stock-sources/add-stock-source-button.component.tsx +21 -0
- package/src/stock-sources/add-stock-sources/add-stock-sources.component.tsx +152 -0
- package/src/stock-sources/add-stock-sources/add-stock-sources.scss +18 -0
- package/src/stock-sources/delete-stock-modal.component.tsx +47 -0
- package/src/stock-sources/edit-stock-source/edit-stock-source.component.tsx +35 -0
- package/src/stock-sources/edit-stock-source/edit-stock-source.scss +0 -0
- package/src/stock-sources/stock-sources-delete/stock-sources-delate.scss +0 -0
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.component.tsx +72 -0
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.component.tsx +35 -0
- package/src/stock-sources/stock-sources-filter/stock-sources-filter.scss +13 -0
- package/src/stock-sources/stock-sources-items-table.component.tsx +213 -0
- package/src/stock-sources/stock-sources-items-table.resource.ts +56 -0
- package/src/stock-sources/stock-sources.component.tsx +12 -0
- package/src/stock-sources/stock-sources.resource.ts +80 -0
- package/src/stock-sources/stock-sources.scss +220 -0
- package/src/stock-sources/swr-revalidation.ts +7 -0
- package/src/stock-tabs/commodity-tabs.component.tsx +43 -0
- package/src/stock-tabs/commodity-tabs.scss +0 -0
- package/src/stock-user-role-scopes/add-stock-user-role-scope-button.component.tsx +21 -0
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +525 -0
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.scss +37 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +73 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.scss +0 -0
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.component.tsx +47 -0
- package/src/stock-user-role-scopes/edit-stock-user-scope/edit-stock-user-scope-action-menu.component.tsx +35 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +284 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.resource.ts +31 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.component.tsx +12 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.resource.ts +76 -0
- package/src/stock-user-role-scopes/stock-user-role-scopes.scss +61 -0
- package/src/stock-user-role-scopes/swr-revalidation.ts +7 -0
- package/src/utils.ts +10 -0
- package/translations/en.json +24 -0
- package/tsconfig.json +23 -0
- package/webpack.config.js +1 -0
@@ -0,0 +1,63 @@
|
|
1
|
+
import { BaseOpenmrsData } from "../BaseOpenmrsData";
|
2
|
+
import { Concept } from "../concept/Concept";
|
3
|
+
import { Drug } from "../concept/Drug";
|
4
|
+
import { RecordPermission } from "../RecordPermission";
|
5
|
+
import { StockBatch } from "./StockBatch";
|
6
|
+
import {
|
7
|
+
StockItemPackagingUOM,
|
8
|
+
StockItemPackagingUOMDTO,
|
9
|
+
} from "./StockItemPackagingUOM";
|
10
|
+
|
11
|
+
export interface StockItem extends BaseOpenmrsData {
|
12
|
+
concept: Concept;
|
13
|
+
drug: Drug;
|
14
|
+
hasExpiration: boolean;
|
15
|
+
stockBatches: StockBatch[];
|
16
|
+
stockItemPackagingUOMs: StockItemPackagingUOM[];
|
17
|
+
}
|
18
|
+
|
19
|
+
export interface StockItemDTO {
|
20
|
+
uuid: string | null | undefined;
|
21
|
+
isDrug: boolean | null | undefined;
|
22
|
+
drugUuid: string | null | undefined;
|
23
|
+
drugName: string | null | undefined;
|
24
|
+
conceptUuid: string | null | undefined;
|
25
|
+
commonName: string | null | undefined;
|
26
|
+
acronym: string | null | undefined;
|
27
|
+
conceptName: string | null | undefined;
|
28
|
+
hasExpiration: boolean | null | undefined;
|
29
|
+
preferredVendorUuid: string | null | undefined;
|
30
|
+
preferredVendorName: string | null | undefined;
|
31
|
+
purchasePrice: number | null | undefined;
|
32
|
+
purchasePriceUoMUuid: string | null | undefined;
|
33
|
+
purchasePriceUoMName: string | null | undefined;
|
34
|
+
dispensingUnitName: string | null | undefined;
|
35
|
+
dispensingUnitUuid: string | null | undefined;
|
36
|
+
dispensingUnitPackagingUoMUuid: string | null | undefined;
|
37
|
+
dispensingUnitPackagingUoMName: string | null | undefined;
|
38
|
+
defaultStockOperationsUoMUuid: string | null | undefined;
|
39
|
+
defaultStockOperationsUoMName: string | null | undefined;
|
40
|
+
reorderLevel: number | null | undefined;
|
41
|
+
reorderLevelUoMUuid: string | null | undefined;
|
42
|
+
reorderLevelUoMName: string | null | undefined;
|
43
|
+
dateCreated: Date | null | undefined;
|
44
|
+
creatorGivenName: string | null | undefined;
|
45
|
+
creatorFamilyName: string | null | undefined;
|
46
|
+
voided: boolean | null | undefined;
|
47
|
+
packagingUnits: StockItemPackagingUOMDTO[];
|
48
|
+
permission: RecordPermission;
|
49
|
+
categoryUuid: string | null | undefined;
|
50
|
+
categoryName: string | null | undefined;
|
51
|
+
expiryNotice: number | null | undefined;
|
52
|
+
}
|
53
|
+
|
54
|
+
export const LocationStockItemBatchNo = "LocationStockItemBatchNo";
|
55
|
+
export const LocationStockItem = "LocationStockItem";
|
56
|
+
export const StockItemOnly = "StockItemOnly";
|
57
|
+
|
58
|
+
export const InventoryGroupByOptions = [
|
59
|
+
LocationStockItemBatchNo,
|
60
|
+
LocationStockItem,
|
61
|
+
StockItemOnly,
|
62
|
+
] as const;
|
63
|
+
export type InventoryGroupBy = (typeof InventoryGroupByOptions)[number];
|
@@ -0,0 +1,20 @@
|
|
1
|
+
import { BaseOpenmrsData } from "../BaseOpenmrsData";
|
2
|
+
import { Concept } from "../concept/Concept";
|
3
|
+
import { StockItem } from "./StockItem";
|
4
|
+
|
5
|
+
export interface StockItemPackagingUOM extends BaseOpenmrsData {
|
6
|
+
factor: number;
|
7
|
+
packagingUom: Concept;
|
8
|
+
stockItem: StockItem;
|
9
|
+
}
|
10
|
+
|
11
|
+
export interface StockItemPackagingUOMDTO {
|
12
|
+
id?: string;
|
13
|
+
uuid?: string;
|
14
|
+
stockItemUuid?: string;
|
15
|
+
packagingUomName?: string;
|
16
|
+
packagingUomUuid?: string;
|
17
|
+
factor?: number | null;
|
18
|
+
isDefaultStockOperationsUoM?: boolean;
|
19
|
+
isDispensingUnit?: boolean;
|
20
|
+
}
|
@@ -0,0 +1,22 @@
|
|
1
|
+
import { StockOperationStatus } from "../stockOperation/StockOperationStatus";
|
2
|
+
|
3
|
+
export interface StockItemTransactionDTO {
|
4
|
+
uuid: string;
|
5
|
+
dateCreated: Date;
|
6
|
+
partyUuid: string;
|
7
|
+
partyName: string;
|
8
|
+
isPatientTransaction: boolean;
|
9
|
+
quantity: number;
|
10
|
+
stockBatchUuid: string;
|
11
|
+
stockBatchNo: string;
|
12
|
+
expiration: Date;
|
13
|
+
stockItemUuid: string;
|
14
|
+
stockOperationUuid: string;
|
15
|
+
stockOperationStatus: StockOperationStatus;
|
16
|
+
stockOperationNumber: string;
|
17
|
+
stockOperationTypeName: string;
|
18
|
+
stockItemPackagingUOMUuid: string;
|
19
|
+
packagingUomName: string;
|
20
|
+
operationSourcePartyName: string;
|
21
|
+
operationDestinationPartyName: string;
|
22
|
+
}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import { RecordPermission } from "../RecordPermission";
|
2
|
+
|
3
|
+
export interface StockRule {
|
4
|
+
id?: string;
|
5
|
+
uuid: string;
|
6
|
+
stockItemUuid: string;
|
7
|
+
name: string;
|
8
|
+
description: string;
|
9
|
+
locationUuid: string;
|
10
|
+
locationName: string;
|
11
|
+
quantity?: number | null;
|
12
|
+
stockItemPackagingUOMUuid: string;
|
13
|
+
packagingUomName: string;
|
14
|
+
enabled: boolean;
|
15
|
+
evaluationFrequency?: number | null;
|
16
|
+
lastEvaluation: Date;
|
17
|
+
nextEvaluation: Date;
|
18
|
+
lastActionDate: Date;
|
19
|
+
actionFrequency?: number | null;
|
20
|
+
alertRole?: string | null;
|
21
|
+
mailRole?: string | null;
|
22
|
+
permission: RecordPermission;
|
23
|
+
enableDescendants: boolean;
|
24
|
+
creatorGivenName?: string;
|
25
|
+
creatorFamilyName?: string;
|
26
|
+
dateCreated?: Date;
|
27
|
+
nextActionDate?: Date;
|
28
|
+
}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import { BaseOpenmrsData } from "../BaseOpenmrsData";
|
2
|
+
import { Patient } from "../identity/Patient";
|
3
|
+
import { OpenMRSLocation } from "../Location";
|
4
|
+
import { User } from "../identity/User";
|
5
|
+
import { StockOperationItem } from "./StockOperationItem";
|
6
|
+
import { StockOperationStatus } from "./StockOperationStatus";
|
7
|
+
import { StockOperationType } from "./StockOperationType";
|
8
|
+
import { Concept } from "../concept/Concept";
|
9
|
+
|
10
|
+
export interface StockOperation extends BaseOpenmrsData {
|
11
|
+
cancelReason: string;
|
12
|
+
cancelledBy: User;
|
13
|
+
cancelledDate: Date;
|
14
|
+
completedBy: User;
|
15
|
+
completedDate: Date;
|
16
|
+
destination: OpenMRSLocation;
|
17
|
+
externalReference: string;
|
18
|
+
location: OpenMRSLocation;
|
19
|
+
operationDate: Date;
|
20
|
+
locked: boolean;
|
21
|
+
operationNumber: string;
|
22
|
+
operationOrder: number;
|
23
|
+
patient: Patient;
|
24
|
+
remarks: string;
|
25
|
+
source: OpenMRSLocation;
|
26
|
+
sourceOther: string;
|
27
|
+
status: StockOperationStatus;
|
28
|
+
returnReason: string;
|
29
|
+
rejectionReason: string;
|
30
|
+
workflowId: number;
|
31
|
+
responsiblePerson: User;
|
32
|
+
responsiblePersonOther: string;
|
33
|
+
consignmentCategory: Concept;
|
34
|
+
stockOperationType: StockOperationType;
|
35
|
+
stockOperationItems: StockOperationItem[];
|
36
|
+
}
|
@@ -0,0 +1,24 @@
|
|
1
|
+
export interface StopOperationAction {
|
2
|
+
name: StopOperationActionType;
|
3
|
+
reason?: string | null;
|
4
|
+
uuid: string;
|
5
|
+
lineItems?: StockOperationActionLineItem[];
|
6
|
+
}
|
7
|
+
|
8
|
+
export interface StockOperationActionLineItem {
|
9
|
+
uuid: string;
|
10
|
+
amount: number;
|
11
|
+
packagingUoMUuId: string;
|
12
|
+
}
|
13
|
+
|
14
|
+
export const StopOperationActionTypes = [
|
15
|
+
"SUBMIT",
|
16
|
+
"DISPATCH",
|
17
|
+
"APPROVE",
|
18
|
+
"RETURN",
|
19
|
+
"REJECT",
|
20
|
+
"COMPLETE",
|
21
|
+
"CANCEL",
|
22
|
+
"QUANTITY_RECEIVED",
|
23
|
+
] as const;
|
24
|
+
export type StopOperationActionType = (typeof StopOperationActionTypes)[number];
|
@@ -0,0 +1,64 @@
|
|
1
|
+
import { RecordPermission } from "../RecordPermission";
|
2
|
+
import { StockOperationItemDTO } from "./StockOperationItemDTO";
|
3
|
+
import { StockOperationStatus } from "./StockOperationStatus";
|
4
|
+
|
5
|
+
export interface StockOperationDTO {
|
6
|
+
uuid: string | null | undefined;
|
7
|
+
cancelReason: string | null | undefined;
|
8
|
+
cancelledBy: number;
|
9
|
+
cancelledByGivenName: string | null | undefined;
|
10
|
+
cancelledByFamilyName: string | null | undefined;
|
11
|
+
cancelledDate: Date;
|
12
|
+
completedBy: number;
|
13
|
+
completedByGivenName: string | null | undefined;
|
14
|
+
completedByFamilyName: string | null | undefined;
|
15
|
+
completedDate: Date;
|
16
|
+
destinationUuid: string | null | undefined;
|
17
|
+
destinationName: string | null | undefined;
|
18
|
+
externalReference: string | null | undefined;
|
19
|
+
atLocationUuid: string | null | undefined;
|
20
|
+
atLocationName: string | null | undefined;
|
21
|
+
operationDate: Date;
|
22
|
+
submitted: boolean;
|
23
|
+
submittedBy: string | null | undefined;
|
24
|
+
submittedByGivenName: string | null | undefined;
|
25
|
+
submittedByFamilyName: string | null | undefined;
|
26
|
+
locked: boolean;
|
27
|
+
operationNumber: string | null | undefined;
|
28
|
+
operationOrder: number;
|
29
|
+
remarks: string | null | undefined;
|
30
|
+
sourceUuid: string | null | undefined;
|
31
|
+
sourceName: string | null | undefined;
|
32
|
+
status: StockOperationStatus;
|
33
|
+
returnReason: string | null | undefined;
|
34
|
+
rejectionReason: string | null | undefined;
|
35
|
+
operationTypeUuid: string | null | undefined;
|
36
|
+
operationType: string | null | undefined;
|
37
|
+
operationTypeName: string | null | undefined;
|
38
|
+
responsiblePerson: number;
|
39
|
+
responsiblePersonUuid: string | null | undefined;
|
40
|
+
responsiblePersonGivenName: string | null | undefined;
|
41
|
+
responsiblePersonFamilyName: string | null | undefined;
|
42
|
+
responsiblePersonOther: string | null | undefined;
|
43
|
+
creator: number;
|
44
|
+
dateCreated: Date;
|
45
|
+
creatorGivenName: string | null | undefined;
|
46
|
+
creatorFamilyName: string | null | undefined;
|
47
|
+
permission: RecordPermission | null | undefined;
|
48
|
+
reasonUuid: string | null | undefined;
|
49
|
+
reasonName: string | null | undefined;
|
50
|
+
approvalRequired?: boolean | null | undefined;
|
51
|
+
stockOperationItems: StockOperationItemDTO[];
|
52
|
+
|
53
|
+
submittedDate: Date;
|
54
|
+
returnedByGivenName: string | null | undefined;
|
55
|
+
returnedByFamilyName: string | null | undefined;
|
56
|
+
returnedDate: Date;
|
57
|
+
rejectedByGivenName: string | null | undefined;
|
58
|
+
rejectedByFamilyName: string | null | undefined;
|
59
|
+
rejectedDate: Date;
|
60
|
+
dispatchedByGivenName: string | null | undefined;
|
61
|
+
dispatchedByFamilyName: string | null | undefined;
|
62
|
+
dispatchedDate: Date;
|
63
|
+
requisitionStockOperationUuid: string;
|
64
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
import { BaseOpenmrsData } from "../BaseOpenmrsData";
|
2
|
+
import { StockBatch } from "../stockItem/StockBatch";
|
3
|
+
import { StockItem } from "../stockItem/StockItem";
|
4
|
+
import { StockItemPackagingUOM } from "../stockItem/StockItemPackagingUOM";
|
5
|
+
import { StockOperation } from "./StockOperation";
|
6
|
+
|
7
|
+
export interface StockOperationItem extends BaseOpenmrsData {
|
8
|
+
quantity: number;
|
9
|
+
stockBatch: StockBatch;
|
10
|
+
stockItemPackagingUOM: StockItemPackagingUOM;
|
11
|
+
stockItem: StockItem;
|
12
|
+
stockOperation: StockOperation;
|
13
|
+
}
|
@@ -0,0 +1,14 @@
|
|
1
|
+
export interface StockOperationItemCost {
|
2
|
+
uuid: string;
|
3
|
+
stockItemUuid: string;
|
4
|
+
stockItemPackagingUOMUuid: string;
|
5
|
+
stockItemPackagingUOMName: string;
|
6
|
+
stockBatchId: number;
|
7
|
+
stockBatchUuid: string;
|
8
|
+
batchNo: string;
|
9
|
+
quantity: number;
|
10
|
+
unitCost: number;
|
11
|
+
unitCostUOMUuid: string;
|
12
|
+
unitCostUOMName: string;
|
13
|
+
totalCost: number;
|
14
|
+
}
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import { RecordPermission } from "../RecordPermission";
|
2
|
+
import { StockItemPackagingUOMDTO } from "../stockItem/StockItemPackagingUOM";
|
3
|
+
|
4
|
+
export interface StockOperationItemDTO {
|
5
|
+
itemIndex?: number;
|
6
|
+
id: string | null | undefined;
|
7
|
+
uuid: string | null | undefined;
|
8
|
+
stockItemUuid?: string | null | undefined;
|
9
|
+
stockItemName?: string | null | undefined;
|
10
|
+
stockItemPackagingUOMUuid?: string | null | undefined;
|
11
|
+
stockItemPackagingUOMName?: string | null | undefined;
|
12
|
+
stockBatchUuid?: string | null | undefined;
|
13
|
+
batchNo?: string | null | undefined;
|
14
|
+
expiration?: Date | null | undefined;
|
15
|
+
quantity?: number | null | undefined;
|
16
|
+
purchasePrice?: number | null | undefined;
|
17
|
+
permission?: RecordPermission | null | undefined;
|
18
|
+
edit?: boolean | null | undefined;
|
19
|
+
hasExpiration?: boolean;
|
20
|
+
packagingUnits?: StockItemPackagingUOMDTO[];
|
21
|
+
quantityReceived?: number | null | undefined;
|
22
|
+
quantityReceivedPackagingUOMName?: string | null | undefined;
|
23
|
+
quantityReceivedPackagingUOMUuid?: string | null | undefined;
|
24
|
+
quantityRequested?: number | null | undefined;
|
25
|
+
quantityRequestedPackagingUOMUuid?: string | null | undefined;
|
26
|
+
quantityRequestedPackagingUOMName?: string | null | undefined;
|
27
|
+
commonName?: string | null | undefined;
|
28
|
+
acronym?: string | null | undefined;
|
29
|
+
}
|
@@ -0,0 +1,13 @@
|
|
1
|
+
export interface StockOperationLinkDTO {
|
2
|
+
uuid: string;
|
3
|
+
parentUuid: string;
|
4
|
+
parentOperationNumber: string;
|
5
|
+
parentOperationTypeName: string;
|
6
|
+
parentStatus: string;
|
7
|
+
parentVoided: boolean;
|
8
|
+
childUuid: string;
|
9
|
+
childOperationNumber: string;
|
10
|
+
childOperationTypeName: string;
|
11
|
+
childStatus: string;
|
12
|
+
childVoided: boolean;
|
13
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
export const StockOperationStatusSubmitted = "SUBMITTED";
|
2
|
+
export const StockOperationStatusNew = "NEW";
|
3
|
+
export const StockOperationStatusReturned = "RETURNED";
|
4
|
+
export const StockOperationStatusCancelled = "CANCELLED";
|
5
|
+
export const StockOperationStatusDispatched = "DISPATCHED";
|
6
|
+
export const StockOperationStatusCompleted = "COMPLETED";
|
7
|
+
export const StockOperationStatusRejected = "REJECTED";
|
8
|
+
|
9
|
+
export const StockOperationStatusTypes = [
|
10
|
+
StockOperationStatusNew,
|
11
|
+
StockOperationStatusSubmitted,
|
12
|
+
StockOperationStatusDispatched,
|
13
|
+
StockOperationStatusCompleted,
|
14
|
+
StockOperationStatusReturned,
|
15
|
+
StockOperationStatusCancelled,
|
16
|
+
StockOperationStatusRejected,
|
17
|
+
] as const;
|
18
|
+
export type StockOperationStatus = (typeof StockOperationStatusTypes)[number];
|
@@ -0,0 +1,162 @@
|
|
1
|
+
import { BaseOpenmrsData } from "../BaseOpenmrsData";
|
2
|
+
import { LocationType } from "./LocationType";
|
3
|
+
|
4
|
+
export interface StockOperationType extends BaseOpenmrsData {
|
5
|
+
name: string;
|
6
|
+
description: string;
|
7
|
+
operationType: string;
|
8
|
+
hasSource: boolean;
|
9
|
+
sourceType: LocationType;
|
10
|
+
hasDestination: boolean;
|
11
|
+
destinationType: LocationType;
|
12
|
+
hasRecipient: boolean;
|
13
|
+
recipientRequired: boolean;
|
14
|
+
availableWhenReserved: boolean;
|
15
|
+
allowExpiredBatchNumbers: boolean;
|
16
|
+
stockOperationTypeLocationScopes: StockOperationTypeLocationScope[];
|
17
|
+
}
|
18
|
+
|
19
|
+
export interface StockOperationTypeLocationScope {
|
20
|
+
uuid: string;
|
21
|
+
locationTag: string;
|
22
|
+
isSource: string;
|
23
|
+
isDestination: string;
|
24
|
+
}
|
25
|
+
|
26
|
+
export enum OperationType {
|
27
|
+
TRANSFER_OUT_OPERATION_TYPE = "transferout",
|
28
|
+
DISPOSED_OPERATION_TYPE = "disposed",
|
29
|
+
STOCK_ISSUE_OPERATION_TYPE = "stockissue",
|
30
|
+
STOCK_TAKE_OPERATION_TYPE = "stocktake",
|
31
|
+
REQUISITION_OPERATION_TYPE = "requisition",
|
32
|
+
OPENING_STOCK_OPERATION_TYPE = "initial",
|
33
|
+
RECEIPT_OPERATION_TYPE = "receipt",
|
34
|
+
RETURN_OPERATION_TYPE = "return",
|
35
|
+
ADJUSTMENT_OPERATION_TYPE = "adjustment",
|
36
|
+
}
|
37
|
+
|
38
|
+
export function operationFromString(str: string): OperationType | undefined {
|
39
|
+
str = str.toLowerCase();
|
40
|
+
if (str === OperationType.TRANSFER_OUT_OPERATION_TYPE)
|
41
|
+
return OperationType.TRANSFER_OUT_OPERATION_TYPE;
|
42
|
+
if (str === OperationType.DISPOSED_OPERATION_TYPE)
|
43
|
+
return OperationType.DISPOSED_OPERATION_TYPE;
|
44
|
+
if (str === OperationType.STOCK_ISSUE_OPERATION_TYPE)
|
45
|
+
return OperationType.STOCK_ISSUE_OPERATION_TYPE;
|
46
|
+
if (str === OperationType.STOCK_TAKE_OPERATION_TYPE)
|
47
|
+
return OperationType.STOCK_TAKE_OPERATION_TYPE;
|
48
|
+
if (str === OperationType.REQUISITION_OPERATION_TYPE)
|
49
|
+
return OperationType.REQUISITION_OPERATION_TYPE;
|
50
|
+
if (str === OperationType.RECEIPT_OPERATION_TYPE)
|
51
|
+
return OperationType.RECEIPT_OPERATION_TYPE;
|
52
|
+
if (str === OperationType.RETURN_OPERATION_TYPE)
|
53
|
+
return OperationType.RETURN_OPERATION_TYPE;
|
54
|
+
if (str === OperationType.ADJUSTMENT_OPERATION_TYPE)
|
55
|
+
return OperationType.ADJUSTMENT_OPERATION_TYPE;
|
56
|
+
if (str === OperationType.OPENING_STOCK_OPERATION_TYPE)
|
57
|
+
return OperationType.OPENING_STOCK_OPERATION_TYPE;
|
58
|
+
}
|
59
|
+
|
60
|
+
export const StockOperationTypeRequiresStockAdjustmentReason = (
|
61
|
+
operationType: OperationType
|
62
|
+
) => {
|
63
|
+
return (
|
64
|
+
operationType === OperationType.ADJUSTMENT_OPERATION_TYPE ||
|
65
|
+
operationType === OperationType.STOCK_TAKE_OPERATION_TYPE ||
|
66
|
+
operationType === OperationType.DISPOSED_OPERATION_TYPE
|
67
|
+
);
|
68
|
+
};
|
69
|
+
|
70
|
+
export const StockOperationTypeIsNegativeQtyAllowed = (
|
71
|
+
operationType: OperationType
|
72
|
+
) => {
|
73
|
+
return operationType === OperationType.ADJUSTMENT_OPERATION_TYPE;
|
74
|
+
};
|
75
|
+
|
76
|
+
export const StockOperationTypeRequiresBatchUuid = (
|
77
|
+
operationType: OperationType
|
78
|
+
) => {
|
79
|
+
return (
|
80
|
+
!StockOperationTypeRequiresActualBatchInformation(operationType) &&
|
81
|
+
operationType !== OperationType.REQUISITION_OPERATION_TYPE
|
82
|
+
);
|
83
|
+
};
|
84
|
+
|
85
|
+
export const StockOperationTypeRequiresActualBatchInformation = (
|
86
|
+
operationType: OperationType
|
87
|
+
) => {
|
88
|
+
return (
|
89
|
+
operationType === OperationType.RECEIPT_OPERATION_TYPE ||
|
90
|
+
operationType === OperationType.OPENING_STOCK_OPERATION_TYPE
|
91
|
+
);
|
92
|
+
};
|
93
|
+
|
94
|
+
export const StockOperationTypeIsQuantityOptional = (
|
95
|
+
operationType: OperationType
|
96
|
+
) => {
|
97
|
+
return operationType === OperationType.REQUISITION_OPERATION_TYPE;
|
98
|
+
};
|
99
|
+
|
100
|
+
export const StockOperationTypeCanCapturePurchasePrice = (
|
101
|
+
operationType: OperationType
|
102
|
+
) => {
|
103
|
+
return (
|
104
|
+
operationType === OperationType.RECEIPT_OPERATION_TYPE ||
|
105
|
+
operationType === OperationType.OPENING_STOCK_OPERATION_TYPE
|
106
|
+
);
|
107
|
+
};
|
108
|
+
|
109
|
+
export const StockOperationTypeCanBeRelatedToRequisition = (
|
110
|
+
operationType: OperationType
|
111
|
+
) => {
|
112
|
+
return operationType === OperationType.STOCK_ISSUE_OPERATION_TYPE;
|
113
|
+
};
|
114
|
+
|
115
|
+
export const StockOperationTypeRequiresDispatchAcknowledgement = (
|
116
|
+
operationType: OperationType
|
117
|
+
) => {
|
118
|
+
return (
|
119
|
+
operationType === OperationType.STOCK_ISSUE_OPERATION_TYPE ||
|
120
|
+
operationType === OperationType.RETURN_OPERATION_TYPE
|
121
|
+
);
|
122
|
+
};
|
123
|
+
|
124
|
+
export const StockOperationTypeHasPrint = (operationType: OperationType) => {
|
125
|
+
return (
|
126
|
+
operationType === OperationType.STOCK_ISSUE_OPERATION_TYPE ||
|
127
|
+
StockOperationTypeIsRequistion(operationType) ||
|
128
|
+
StockOperationTypeIsReceipt(operationType) ||
|
129
|
+
StockOperationTypeIsTransferOut(operationType)
|
130
|
+
);
|
131
|
+
};
|
132
|
+
|
133
|
+
export const StockOperationTypeIsRequistion = (
|
134
|
+
operationType: OperationType
|
135
|
+
) => {
|
136
|
+
return operationType === OperationType.REQUISITION_OPERATION_TYPE;
|
137
|
+
};
|
138
|
+
|
139
|
+
export const StockOperationTypeIsReceipt = (operationType: OperationType) => {
|
140
|
+
return operationType === OperationType.RECEIPT_OPERATION_TYPE;
|
141
|
+
};
|
142
|
+
|
143
|
+
export const StockOperationTypeIsTransferOut = (
|
144
|
+
operationType: OperationType
|
145
|
+
) => {
|
146
|
+
return operationType === OperationType.TRANSFER_OUT_OPERATION_TYPE;
|
147
|
+
};
|
148
|
+
|
149
|
+
export const StockOperationTypeIsStockIssue = (
|
150
|
+
operationType: OperationType
|
151
|
+
) => {
|
152
|
+
return operationType === OperationType.STOCK_ISSUE_OPERATION_TYPE;
|
153
|
+
};
|
154
|
+
|
155
|
+
export const StockOperationPrintHasItemCosts = (
|
156
|
+
operationType: OperationType
|
157
|
+
) => {
|
158
|
+
return (
|
159
|
+
StockOperationTypeIsStockIssue(operationType) ||
|
160
|
+
StockOperationTypeIsTransferOut(operationType)
|
161
|
+
);
|
162
|
+
};
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import React from "react";
|
2
|
+
import { Control, Controller, FieldValues } from "react-hook-form";
|
3
|
+
import { ComboBox } from "@carbon/react";
|
4
|
+
|
5
|
+
interface ControlledComboBoxProps<T> {
|
6
|
+
controllerName: string;
|
7
|
+
name: string;
|
8
|
+
control: Control<FieldValues, T>;
|
9
|
+
onChange?: (e: { selectedItem: never }) => void;
|
10
|
+
}
|
11
|
+
|
12
|
+
const ControlledComboBox = <T,>(props: ControlledComboBoxProps<T>) => {
|
13
|
+
return (
|
14
|
+
<Controller
|
15
|
+
name={props.controllerName}
|
16
|
+
control={props.control}
|
17
|
+
render={({ field: { onChange, value, ref } }) => (
|
18
|
+
<ComboBox
|
19
|
+
{...props}
|
20
|
+
onChange={(e: { selectedItem: never }) => {
|
21
|
+
onChange(e);
|
22
|
+
|
23
|
+
// Fire prop change
|
24
|
+
if (props.onChange) {
|
25
|
+
props.onChange(e);
|
26
|
+
}
|
27
|
+
}}
|
28
|
+
id={props.name}
|
29
|
+
ref={ref}
|
30
|
+
value={value}
|
31
|
+
/>
|
32
|
+
)}
|
33
|
+
/>
|
34
|
+
);
|
35
|
+
};
|
36
|
+
|
37
|
+
export default ControlledComboBox;
|
File without changes
|
File without changes
|