@openmrs/esm-stock-management-app 1.0.1-pre.575 → 1.0.1-pre.586
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/769.js +1 -1
- package/dist/769.js.map +1 -1
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +6 -6
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +1 -1
- package/src/core/api/types/stockItem/StockItemInventory.ts +1 -0
- package/src/stock-items/add-stock-item/transactions/transactions.component.tsx +5 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +7 -5
- package/src/stock-operations/add-stock-operation/add-stock-operation.utils.tsx +23 -27
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +350 -223
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.component.tsx +151 -25
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.tsx +2 -0
- package/src/stock-operations/batch-no-selector/batch-no-selector.component.tsx +8 -4
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +26 -51
- package/src/stock-operations/party-selector/party-selector.component.tsx +35 -30
- package/src/stock-operations/stock-item-selector/stock-item-selector.component.tsx +1 -1
- package/src/stock-operations/stock-operation.utils.tsx +2 -13
- package/src/stock-operations/stock-operations-table.component.tsx +29 -20
- package/src/stock-operations/stock-operations.resource.ts +1 -1
@@ -85,10 +85,10 @@
|
|
85
85
|
"initial": true,
|
86
86
|
"entry": true,
|
87
87
|
"recorded": false,
|
88
|
-
"size":
|
88
|
+
"size": 5466293,
|
89
89
|
"sizes": {
|
90
90
|
"consume-shared": 252,
|
91
|
-
"javascript":
|
91
|
+
"javascript": 5444343,
|
92
92
|
"share-init": 252,
|
93
93
|
"runtime": 21446
|
94
94
|
},
|
@@ -105,7 +105,7 @@
|
|
105
105
|
"auxiliaryFiles": [
|
106
106
|
"main.js.map"
|
107
107
|
],
|
108
|
-
"hash": "
|
108
|
+
"hash": "33627f87b927e8a1",
|
109
109
|
"childrenByOrder": {}
|
110
110
|
},
|
111
111
|
{
|
@@ -367,9 +367,9 @@
|
|
367
367
|
"initial": false,
|
368
368
|
"entry": false,
|
369
369
|
"recorded": false,
|
370
|
-
"size":
|
370
|
+
"size": 1797866,
|
371
371
|
"sizes": {
|
372
|
-
"javascript":
|
372
|
+
"javascript": 1797656,
|
373
373
|
"consume-shared": 210
|
374
374
|
},
|
375
375
|
"names": [],
|
@@ -383,7 +383,7 @@
|
|
383
383
|
"auxiliaryFiles": [
|
384
384
|
"769.js.map"
|
385
385
|
],
|
386
|
-
"hash": "
|
386
|
+
"hash": "5a7cd03d178e7659",
|
387
387
|
"childrenByOrder": {}
|
388
388
|
},
|
389
389
|
{
|
package/dist/routes.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.
|
1
|
+
{"$schema":"https://json.openmrs.org/routes.schema.json","backendDependencies":{"fhir2":">=1.2","webservices.rest":"^2.24.0"},"extensions":[{"name":"stock-nav-menu","slot":"stock-sidebar-slot","component":"stockNavMenu","online":true,"offline":true},{"name":"overview-db-link","slot":"stock-page-dashboard-slot","component":"stockOverviewLink","meta":{"name":"overview","slot":"overview-dashboard-slot","title":"overview"},"order":0,"online":true,"offline":true},{"name":"stock-overview-db","slot":"overview-dashboard-slot","component":"stockOverview"},{"name":"operations-db-link","slot":"stock-page-dashboard-slot","component":"stockOperationsLink","meta":{"name":"operations","slot":"operations-dashboard-slot","title":"operations"},"order":2,"online":true,"offline":true},{"name":"stock-operations-db","slot":"operations-dashboard-slot","component":"stockOperations"},{"name":"items-db-link","slot":"stock-page-dashboard-slot","component":"stockItemsLink","meta":{"name":"items","slot":"items-dashboard-slot","title":"items"},"order":1,"online":true,"offline":true},{"name":"stock-items-db","slot":"items-dashboard-slot","component":"stockItems"},{"name":"user-scopes-db-link","slot":"stock-page-dashboard-slot","component":"stockUserScopesLink","meta":{"name":"user-scopes","slot":"user-scopes-dashboard-slot","title":"user-scopes"},"order":3,"online":true,"offline":true},{"name":"stock-user-scopes-db","slot":"user-scopes-dashboard-slot","component":"stockUserScopes"},{"name":"sources-db-link","slot":"stock-page-dashboard-slot","component":"stockSourcesLink","meta":{"name":"sources","slot":"sources-dashboard-slot","title":"Sources"},"order":2,"online":true,"offline":true},{"name":"stock-sources-db","slot":"sources-dashboard-slot","component":"stockSources"},{"name":"locations-db-link","slot":"stock-page-dashboard-slot","component":"stockLocationsLink","meta":{"name":"locations","slot":"locations-dashboard-slot","title":"Locations"},"order":4,"online":true,"offline":true},{"name":"stock-locations-db","slot":"locations-dashboard-slot","component":"stockLocations"},{"name":"reports-db-link","slot":"stock-page-dashboard-slot","component":"stockReportsLink","meta":{"name":"reports","slot":"reports-dashboard-slot","title":"Reports"},"order":5,"online":true,"offline":true},{"name":"stock-reports-db","slot":"reports-dashboard-slot","component":"stockReports"},{"name":"settings-db-link","slot":"stock-page-dashboard-slot","component":"stockSettingsLink","meta":{"name":"settings","slot":"settings-dashboard-slot","title":"Settings"},"order":6,"online":true,"offline":true},{"name":"stock-settings-db","slot":"settings-dashboard-slot","component":"stockSettings"},{"name":"stock-management-admin-card-link","slot":"system-admin-page-card-link-slot","component":"stockManagementAdminCardLink"},{"name":"stock-operation-dialog","component":"stockOperationDialog"},{"name":"import-bulk-stock-items","component":"importBulkStockItemsDialog"},{"name":"delete-stock-modal","component":"deleteStockModal"},{"name":"delete-stock-user-scope-modal","component":"deleteUserScopeModal"},{"name":"stock-management-app-menu-item","component":"stockManagementAppMenuItem","slot":"app-menu-item-slot","meta":{"name":" Stock Management"}},{"name":"delete-stock-rule-modal","component":"deleteStockRuleModal"},{"name":"delete-packaging-unit-modal","component":"deletePackagingUnitModal"},{"name":"delete-packaging-unit-button","component":"deletePackagingUnitButton"}],"pages":[{"component":"root","route":"stock-management"}],"version":"1.0.1-pre.586"}
|
package/package.json
CHANGED
package/src/config-schema.ts
CHANGED
@@ -18,7 +18,7 @@ export const configSchema = {
|
|
18
18
|
stockAdjustmentReasonUUID: {
|
19
19
|
_type: Type.ConceptUuid,
|
20
20
|
_description: "UUID for the stock adjustment reasons",
|
21
|
-
_default: "
|
21
|
+
_default: "47f0825e-8648-47c2-b847-d3197ed6bb72",
|
22
22
|
},
|
23
23
|
stockSourceTypeUUID: {
|
24
24
|
_type: Type.ConceptUuid,
|
@@ -21,6 +21,7 @@ import TransactionsLocationsFilter from "./transaction-filters/transaction-locat
|
|
21
21
|
import { useForm } from "react-hook-form";
|
22
22
|
import { StockItemInventoryFilter } from "../../stock-items.resource";
|
23
23
|
import { useTranslation } from "react-i18next";
|
24
|
+
import { StockOperationDTO } from "../../../core/api/types/stockOperation/StockOperationDTO";
|
24
25
|
|
25
26
|
interface TransactionsProps {
|
26
27
|
onSubmit?: () => void;
|
@@ -124,6 +125,10 @@ const Transactions: React.FC<TransactionsProps> = ({ stockItemUuid }) => {
|
|
124
125
|
operationUuid={stockItemTransaction?.stockOperationUuid}
|
125
126
|
operationNumber={stockItemTransaction?.stockOperationNumber}
|
126
127
|
operations={operations}
|
128
|
+
model={undefined}
|
129
|
+
onEdit={function (operation: StockOperationDTO): void {
|
130
|
+
throw new Error("Function not implemented.");
|
131
|
+
}}
|
127
132
|
/>
|
128
133
|
) : (
|
129
134
|
<></>
|
@@ -64,7 +64,11 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
64
64
|
) {
|
65
65
|
setRequisition(props.model?.uuid);
|
66
66
|
}
|
67
|
-
}, [
|
67
|
+
}, [
|
68
|
+
currentStockOperationType,
|
69
|
+
props.model?.operationType,
|
70
|
+
props.model?.uuid,
|
71
|
+
]);
|
68
72
|
|
69
73
|
useEffect(() => {
|
70
74
|
if (
|
@@ -79,7 +83,7 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
79
83
|
setOperationLinks(resp.data?.results);
|
80
84
|
});
|
81
85
|
}
|
82
|
-
}, [currentStockOperationType, requisition, props.model?.uuid]);
|
86
|
+
}, [currentStockOperationType, requisition, props.model?.uuid, isEditing]);
|
83
87
|
|
84
88
|
const [selectedIndex, setSelectedIndex] = useState(0);
|
85
89
|
const [canDisplayReceivedItems, setCanDisplayReceivedItems] = useState(false);
|
@@ -193,9 +197,7 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
193
197
|
t,
|
194
198
|
model,
|
195
199
|
props.isEditing,
|
196
|
-
props.operation
|
197
|
-
props.operations,
|
198
|
-
props.canPrint
|
200
|
+
props.operation
|
199
201
|
);
|
200
202
|
},
|
201
203
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/* eslint-disable prefer-const */
|
1
2
|
import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOperationDTO";
|
2
3
|
import { initialStockOperationValue } from "../../core/utils/utils";
|
3
4
|
import { MAIN_STORE_LOCATION_TAG, today } from "../../constants";
|
@@ -58,6 +59,27 @@ export async function initializeNewStockOperation(
|
|
58
59
|
let sourcePartyList: Party[] | null | undefined;
|
59
60
|
let destinationPartyList: Party[] | null | undefined;
|
60
61
|
|
62
|
+
const partyList = await getParties();
|
63
|
+
if (!partyList.ok) throw Error("Error loading parties");
|
64
|
+
sourcePartyList = partyList?.data?.results?.filter(
|
65
|
+
(p) =>
|
66
|
+
(p.locationUuid &&
|
67
|
+
currentStockOperationType?.sourceType === LocationTypeLocation &&
|
68
|
+
(sourceTags.length === 0 ||
|
69
|
+
(p.tags && sourceTags.some((x) => p.tags.includes(x))))) ||
|
70
|
+
(p.stockSourceUuid &&
|
71
|
+
currentStockOperationType?.sourceType === LocationTypeOther)
|
72
|
+
);
|
73
|
+
destinationPartyList = partyList?.data?.results?.filter(
|
74
|
+
(p) =>
|
75
|
+
(p.locationUuid &&
|
76
|
+
currentStockOperationType?.destinationType === LocationTypeLocation &&
|
77
|
+
(destinationTags.length === 0 ||
|
78
|
+
(p.tags && destinationTags.some((x) => p.tags.includes(x))))) ||
|
79
|
+
(p.stockSourceUuid &&
|
80
|
+
currentStockOperationType?.destinationType === LocationTypeOther)
|
81
|
+
);
|
82
|
+
|
61
83
|
if (isNew) {
|
62
84
|
model = structuredClone(initialStockOperationValue());
|
63
85
|
model = Object.assign(model, {
|
@@ -66,22 +88,6 @@ export async function initializeNewStockOperation(
|
|
66
88
|
operationTypeUuid: currentStockOperationType?.uuid,
|
67
89
|
operationType: currentStockOperationType?.operationType,
|
68
90
|
});
|
69
|
-
const partyList = await getParties();
|
70
|
-
|
71
|
-
if (!partyList.ok) throw Error("Error loading parties");
|
72
|
-
const filteredPartyList = partyList.data?.results?.filter(
|
73
|
-
(party) => party.stockSourceUuid !== null
|
74
|
-
);
|
75
|
-
|
76
|
-
sourcePartyList = partyList?.data?.results?.filter(
|
77
|
-
(p) =>
|
78
|
-
(p.locationUuid &&
|
79
|
-
currentStockOperationType?.sourceType === LocationTypeLocation &&
|
80
|
-
(sourceTags.length === 0 ||
|
81
|
-
(p.tags && sourceTags.some((x) => p.tags.includes(x))))) ||
|
82
|
-
(p.stockSourceUuid &&
|
83
|
-
currentStockOperationType?.sourceType === LocationTypeOther)
|
84
|
-
);
|
85
91
|
if (currentStockOperationType?.hasSource) {
|
86
92
|
if (isNew && shouldLockSource && sourcePartyList?.length > 0) {
|
87
93
|
const party = sourcePartyList[0];
|
@@ -92,17 +98,6 @@ export async function initializeNewStockOperation(
|
|
92
98
|
}
|
93
99
|
|
94
100
|
if (currentStockOperationType?.hasDestination) {
|
95
|
-
destinationPartyList = partyList?.data?.results?.filter(
|
96
|
-
(p) =>
|
97
|
-
(p.locationUuid &&
|
98
|
-
currentStockOperationType?.destinationType ===
|
99
|
-
LocationTypeLocation &&
|
100
|
-
(destinationTags.length === 0 ||
|
101
|
-
(p.tags && destinationTags.some((x) => p.tags.includes(x))))) ||
|
102
|
-
(p.stockSourceUuid &&
|
103
|
-
currentStockOperationType?.destinationType === LocationTypeOther)
|
104
|
-
);
|
105
|
-
|
106
101
|
if (isNew && shouldLockDestination && destinationPartyList?.length > 0) {
|
107
102
|
const party = destinationPartyList[0];
|
108
103
|
model.destinationUuid = party.uuid;
|
@@ -110,6 +105,7 @@ export async function initializeNewStockOperation(
|
|
110
105
|
}
|
111
106
|
}
|
112
107
|
} else {
|
108
|
+
model = stockOperation!;
|
113
109
|
const response = await getStockOperationTypes();
|
114
110
|
if (response.ok) {
|
115
111
|
operationTypes = response.data.results;
|