@openmrs/esm-stock-management-app 1.0.1-pre.479 → 1.0.1-pre.485
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/271.js +1 -1
- package/dist/319.js +1 -1
- package/dist/460.js +1 -1
- package/dist/474.js +1 -1
- package/dist/474.js.map +1 -1
- package/dist/574.js +1 -1
- package/dist/757.js +1 -1
- package/dist/788.js +1 -1
- package/dist/807.js +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 +27 -27
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +30 -34
- package/src/stock-items/stock-item.utils.tsx +3 -5
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +8 -6
- package/src/stock-operations/add-stock-operation/stock-operation-submission.component.tsx +10 -18
- package/src/stock-operations/stock-operations-dialog/stock-operations-complete-button.component.tsx +3 -2
- package/src/stock-operations/stock-operations-dialog/stock-operations-completed-dispatch-button.component.tsx +3 -2
- package/src/stock-operations/stock-operations-table.component.tsx +19 -59
- package/translations/am.json +1 -1
- package/translations/ar.json +1 -1
- package/translations/en.json +3 -3
- package/translations/es.json +1 -1
- package/translations/fr.json +2 -2
- package/translations/km.json +3 -3
- package/translations/zh.json +3 -3
@@ -86,10 +86,10 @@
|
|
86
86
|
"initial": true,
|
87
87
|
"entry": true,
|
88
88
|
"recorded": false,
|
89
|
-
"size":
|
89
|
+
"size": 4763915,
|
90
90
|
"sizes": {
|
91
91
|
"consume-shared": 252,
|
92
|
-
"javascript":
|
92
|
+
"javascript": 4741966,
|
93
93
|
"share-init": 252,
|
94
94
|
"runtime": 21445
|
95
95
|
},
|
@@ -106,7 +106,7 @@
|
|
106
106
|
"auxiliaryFiles": [
|
107
107
|
"main.js.map"
|
108
108
|
],
|
109
|
-
"hash": "
|
109
|
+
"hash": "26765f1fdc368317",
|
110
110
|
"childrenByOrder": {}
|
111
111
|
},
|
112
112
|
{
|
@@ -114,9 +114,9 @@
|
|
114
114
|
"initial": false,
|
115
115
|
"entry": false,
|
116
116
|
"recorded": false,
|
117
|
-
"size":
|
117
|
+
"size": 7694,
|
118
118
|
"sizes": {
|
119
|
-
"javascript":
|
119
|
+
"javascript": 7694
|
120
120
|
},
|
121
121
|
"names": [],
|
122
122
|
"idHints": [],
|
@@ -128,7 +128,7 @@
|
|
128
128
|
"271.js"
|
129
129
|
],
|
130
130
|
"auxiliaryFiles": [],
|
131
|
-
"hash": "
|
131
|
+
"hash": "0cb37e3477f0eecc",
|
132
132
|
"childrenByOrder": {}
|
133
133
|
},
|
134
134
|
{
|
@@ -160,9 +160,9 @@
|
|
160
160
|
"initial": false,
|
161
161
|
"entry": false,
|
162
162
|
"recorded": false,
|
163
|
-
"size":
|
163
|
+
"size": 12770,
|
164
164
|
"sizes": {
|
165
|
-
"javascript":
|
165
|
+
"javascript": 12770
|
166
166
|
},
|
167
167
|
"names": [],
|
168
168
|
"idHints": [],
|
@@ -174,7 +174,7 @@
|
|
174
174
|
"319.js"
|
175
175
|
],
|
176
176
|
"auxiliaryFiles": [],
|
177
|
-
"hash": "
|
177
|
+
"hash": "78c810e8e20a403e",
|
178
178
|
"childrenByOrder": {}
|
179
179
|
},
|
180
180
|
{
|
@@ -182,9 +182,9 @@
|
|
182
182
|
"initial": false,
|
183
183
|
"entry": false,
|
184
184
|
"recorded": false,
|
185
|
-
"size":
|
185
|
+
"size": 10604,
|
186
186
|
"sizes": {
|
187
|
-
"javascript":
|
187
|
+
"javascript": 10604
|
188
188
|
},
|
189
189
|
"names": [],
|
190
190
|
"idHints": [],
|
@@ -196,7 +196,7 @@
|
|
196
196
|
"460.js"
|
197
197
|
],
|
198
198
|
"auxiliaryFiles": [],
|
199
|
-
"hash": "
|
199
|
+
"hash": "853e580ee18acb6d",
|
200
200
|
"childrenByOrder": {}
|
201
201
|
},
|
202
202
|
{
|
@@ -204,9 +204,9 @@
|
|
204
204
|
"initial": false,
|
205
205
|
"entry": false,
|
206
206
|
"recorded": false,
|
207
|
-
"size":
|
207
|
+
"size": 1092203,
|
208
208
|
"sizes": {
|
209
|
-
"javascript":
|
209
|
+
"javascript": 1091993,
|
210
210
|
"consume-shared": 210
|
211
211
|
},
|
212
212
|
"names": [],
|
@@ -220,7 +220,7 @@
|
|
220
220
|
"auxiliaryFiles": [
|
221
221
|
"474.js.map"
|
222
222
|
],
|
223
|
-
"hash": "
|
223
|
+
"hash": "75f18ad427b85c95",
|
224
224
|
"childrenByOrder": {}
|
225
225
|
},
|
226
226
|
{
|
@@ -252,9 +252,9 @@
|
|
252
252
|
"initial": false,
|
253
253
|
"entry": false,
|
254
254
|
"recorded": false,
|
255
|
-
"size":
|
255
|
+
"size": 10907,
|
256
256
|
"sizes": {
|
257
|
-
"javascript":
|
257
|
+
"javascript": 10907
|
258
258
|
},
|
259
259
|
"names": [],
|
260
260
|
"idHints": [],
|
@@ -266,7 +266,7 @@
|
|
266
266
|
"574.js"
|
267
267
|
],
|
268
268
|
"auxiliaryFiles": [],
|
269
|
-
"hash": "
|
269
|
+
"hash": "532db745e309f76a",
|
270
270
|
"childrenByOrder": {}
|
271
271
|
},
|
272
272
|
{
|
@@ -343,9 +343,9 @@
|
|
343
343
|
"initial": false,
|
344
344
|
"entry": false,
|
345
345
|
"recorded": false,
|
346
|
-
"size":
|
346
|
+
"size": 12879,
|
347
347
|
"sizes": {
|
348
|
-
"javascript":
|
348
|
+
"javascript": 12879
|
349
349
|
},
|
350
350
|
"names": [],
|
351
351
|
"idHints": [],
|
@@ -357,7 +357,7 @@
|
|
357
357
|
"757.js"
|
358
358
|
],
|
359
359
|
"auxiliaryFiles": [],
|
360
|
-
"hash": "
|
360
|
+
"hash": "0f431833a88f72aa",
|
361
361
|
"childrenByOrder": {}
|
362
362
|
},
|
363
363
|
{
|
@@ -365,9 +365,9 @@
|
|
365
365
|
"initial": false,
|
366
366
|
"entry": false,
|
367
367
|
"recorded": false,
|
368
|
-
"size":
|
368
|
+
"size": 9611,
|
369
369
|
"sizes": {
|
370
|
-
"javascript":
|
370
|
+
"javascript": 9611
|
371
371
|
},
|
372
372
|
"names": [],
|
373
373
|
"idHints": [],
|
@@ -379,7 +379,7 @@
|
|
379
379
|
"788.js"
|
380
380
|
],
|
381
381
|
"auxiliaryFiles": [],
|
382
|
-
"hash": "
|
382
|
+
"hash": "704ff9bb8200591c",
|
383
383
|
"childrenByOrder": {}
|
384
384
|
},
|
385
385
|
{
|
@@ -414,9 +414,9 @@
|
|
414
414
|
"initial": false,
|
415
415
|
"entry": false,
|
416
416
|
"recorded": false,
|
417
|
-
"size":
|
417
|
+
"size": 11294,
|
418
418
|
"sizes": {
|
419
|
-
"javascript":
|
419
|
+
"javascript": 11294
|
420
420
|
},
|
421
421
|
"names": [],
|
422
422
|
"idHints": [],
|
@@ -428,7 +428,7 @@
|
|
428
428
|
"807.js"
|
429
429
|
],
|
430
430
|
"auxiliaryFiles": [],
|
431
|
-
"hash": "
|
431
|
+
"hash": "b18f2b03183a99b3",
|
432
432
|
"childrenByOrder": {}
|
433
433
|
},
|
434
434
|
{
|
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.485"}
|
package/package.json
CHANGED
@@ -66,13 +66,6 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
66
66
|
|
67
67
|
useEffect(() => {
|
68
68
|
setIsDrug(model.isDrug ?? false);
|
69
|
-
setSelectedItemType(
|
70
|
-
model.isDrug === true
|
71
|
-
? "Pharmaceuticals"
|
72
|
-
: model.isDrug === false
|
73
|
-
? "Non Pharmaceuticals"
|
74
|
-
: undefined
|
75
|
-
);
|
76
69
|
setHasExpiration(model.hasExpiration ?? false);
|
77
70
|
}, [model.hasExpiration, model.isDrug]);
|
78
71
|
|
@@ -80,30 +73,34 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
80
73
|
<form
|
81
74
|
className={`${rootStyles.formContainer} ${rootStyles.verticalForm}`}
|
82
75
|
>
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
76
|
+
{!isEditing && (
|
77
|
+
<FormGroup
|
78
|
+
className="clear-margin-bottom"
|
79
|
+
legendText={t("itemType", "Item Type")}
|
80
|
+
title={t("itemType", "Item Type")}
|
81
|
+
>
|
82
|
+
<ControlledRadioButtonGroup
|
83
|
+
control={control}
|
84
|
+
name="isDrug"
|
85
|
+
controllerName="isDrug"
|
86
|
+
legendText=""
|
87
|
+
invalid={!!errors.isDrug}
|
88
|
+
invalidText={errors.isDrug && errors?.isDrug?.message}
|
89
|
+
onChange={(selection: boolean) => {
|
90
|
+
const selectedOption = radioOptions.find(
|
91
|
+
(option) => option.value === selection
|
92
|
+
);
|
93
|
+
const selectedLabel = selectedOption
|
94
|
+
? selectedOption.label
|
95
|
+
: "";
|
96
|
+
setIsDrug(selection);
|
97
|
+
setSelectedItemType(selectedLabel);
|
98
|
+
}}
|
99
|
+
options={radioOptions} // Pass radioOptions directly
|
100
|
+
/>
|
101
|
+
</FormGroup>
|
102
|
+
)}
|
103
|
+
{selectedItemType === "Pharmaceuticals" ? (
|
107
104
|
<DrugSelector
|
108
105
|
name="drugUuid"
|
109
106
|
controllerName="drugUuid"
|
@@ -113,8 +110,7 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
113
110
|
invalid={!!errors.drugUuid}
|
114
111
|
invalidText={errors.drugUuid && errors?.drugUuid?.message}
|
115
112
|
/>
|
116
|
-
)
|
117
|
-
{isDrug != undefined && !isDrug && (
|
113
|
+
) : selectedItemType === "Non Pharmaceuticals" ? (
|
118
114
|
<ConceptsSelector
|
119
115
|
name="conceptUuid"
|
120
116
|
controllerName="conceptUuid"
|
@@ -124,7 +120,7 @@ const StockItemDetails = forwardRef<never, StockItemDetailsProps>(
|
|
124
120
|
invalid={!!errors.drugUuid}
|
125
121
|
invalidText={errors.drugUuid && errors?.drugUuid?.message}
|
126
122
|
/>
|
127
|
-
)}
|
123
|
+
) : null}
|
128
124
|
<ControlledTextInput
|
129
125
|
id="commonName"
|
130
126
|
name="commonName"
|
@@ -56,12 +56,10 @@ export const launchAddOrEditDialog = (
|
|
56
56
|
) => {
|
57
57
|
launchOverlay(
|
58
58
|
isEditing
|
59
|
-
? t("editItem", "Edit {{name}}", {
|
59
|
+
? `${t("editItem", "Edit {{name}}", {
|
60
60
|
name: stockItem?.drugName || stockItem.conceptName || "",
|
61
|
-
})
|
62
|
-
: t("addItem", "Add
|
63
|
-
name: stockItem?.drugName || stockItem.conceptName || "",
|
64
|
-
}),
|
61
|
+
})} ${stockItem.isDrug ? "(Drug)" : "(Non Drug)"}`
|
62
|
+
: t("addItem", "Add stock item"),
|
65
63
|
<AddEditStockItem
|
66
64
|
model={stockItem}
|
67
65
|
onSave={(stockItem) => addOrEditStockItem(t, stockItem, isEditing)}
|
@@ -132,6 +132,9 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
132
132
|
: result.requiresDispatchAcknowledgement
|
133
133
|
}
|
134
134
|
actions={{
|
135
|
+
onGoBack: () => {
|
136
|
+
setSelectedIndex(1);
|
137
|
+
},
|
135
138
|
onSave: async (model) => {
|
136
139
|
// TODO: Update
|
137
140
|
await addOrEditStockOperation(
|
@@ -143,17 +146,15 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
143
146
|
props.canPrint
|
144
147
|
);
|
145
148
|
},
|
146
|
-
|
147
|
-
setSelectedIndex(1);
|
148
|
-
},
|
149
|
+
|
149
150
|
onComplete: async () => {
|
150
|
-
await showActionDialogButton("Complete",
|
151
|
+
await showActionDialogButton("Complete", false, props?.model);
|
151
152
|
},
|
152
153
|
onSubmit: async () => {
|
153
|
-
await showActionDialogButton("Submit",
|
154
|
+
await showActionDialogButton("Submit", false, props?.model);
|
154
155
|
},
|
155
156
|
onDispatch: async () => {
|
156
|
-
await showActionDialogButton("Dispatch",
|
157
|
+
await showActionDialogButton("Dispatch", false, props?.model);
|
157
158
|
},
|
158
159
|
}}
|
159
160
|
/>
|
@@ -442,6 +443,7 @@ const AddStockOperation: React.FC<AddStockOperationProps> = (props) => {
|
|
442
443
|
<div style={{ margin: "2px" }}>
|
443
444
|
<StockOperationCompleteDispatchButton
|
444
445
|
operation={props?.model}
|
446
|
+
reason={false}
|
445
447
|
/>
|
446
448
|
</div>
|
447
449
|
<div style={{ margin: "2px" }}>
|
@@ -50,7 +50,7 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
50
50
|
const { t } = useTranslation();
|
51
51
|
const [isSaving, setIsSaving] = useState(false);
|
52
52
|
const [approvalRequired, setApprovalRequired] = useState<boolean | null>(
|
53
|
-
|
53
|
+
model?.approvalRequired
|
54
54
|
);
|
55
55
|
|
56
56
|
const handleRadioButtonChange = (selectedItem: boolean) => {
|
@@ -68,7 +68,7 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
68
68
|
"Does the transaction require approval ?"
|
69
69
|
)}
|
70
70
|
onChange={handleRadioButtonChange}
|
71
|
-
defaultSelected={approvalRequired}
|
71
|
+
defaultSelected={model?.approvalRequired}
|
72
72
|
>
|
73
73
|
<RadioButton
|
74
74
|
value={true}
|
@@ -111,15 +111,10 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
111
111
|
kind="primary"
|
112
112
|
onClick={async () => {
|
113
113
|
delete model?.dateCreated;
|
114
|
-
|
114
|
+
model.status = "COMPLETED";
|
115
115
|
setIsSaving(true);
|
116
|
-
await actions.
|
117
|
-
|
118
|
-
model.status = "COMPLETED";
|
119
|
-
setIsSaving(true);
|
120
|
-
actions.onComplete(model);
|
121
|
-
setIsSaving(false);
|
122
|
-
});
|
116
|
+
await actions.onComplete(model);
|
117
|
+
setIsSaving(false);
|
123
118
|
}}
|
124
119
|
renderIcon={ListChecked}
|
125
120
|
>
|
@@ -137,13 +132,9 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
137
132
|
delete model?.dateCreated;
|
138
133
|
delete model?.status;
|
139
134
|
setIsSaving(true);
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
setIsSaving(true);
|
144
|
-
actions.onDispatch(model);
|
145
|
-
setIsSaving(false);
|
146
|
-
});
|
135
|
+
model.status = "DISPATCHED";
|
136
|
+
await actions.onDispatch(model);
|
137
|
+
setIsSaving(false);
|
147
138
|
}}
|
148
139
|
renderIcon={Departure}
|
149
140
|
>
|
@@ -160,7 +151,7 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
160
151
|
onClick={actions.onSubmit}
|
161
152
|
renderIcon={SendFilled}
|
162
153
|
>
|
163
|
-
{t("
|
154
|
+
{t("submitForReview", "Submit For Review")}
|
164
155
|
</Button>
|
165
156
|
)}
|
166
157
|
</>
|
@@ -175,6 +166,7 @@ const StockOperationSubmission: React.FC<StockOperationSubmissionProps> = ({
|
|
175
166
|
delete model?.dateCreated;
|
176
167
|
delete model?.status;
|
177
168
|
setIsSaving(true);
|
169
|
+
model.approvalRequired = approvalRequired ? true : false;
|
178
170
|
await actions.onSave(model);
|
179
171
|
setIsSaving(false);
|
180
172
|
}}
|
package/src/stock-operations/stock-operations-dialog/stock-operations-complete-button.component.tsx
CHANGED
@@ -8,17 +8,18 @@ import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOper
|
|
8
8
|
|
9
9
|
interface StockOperationCompleteButtonProps {
|
10
10
|
operation: StockOperationDTO;
|
11
|
+
reason: boolean;
|
11
12
|
}
|
12
13
|
|
13
14
|
const StockOperationCompleteButton: React.FC<
|
14
15
|
StockOperationCompleteButtonProps
|
15
|
-
> = ({ operation }) => {
|
16
|
+
> = ({ operation, reason }) => {
|
16
17
|
const { t } = useTranslation();
|
17
18
|
const launchCompleteModal = useCallback(() => {
|
18
19
|
const dispose = showModal("stock-operation-dialog", {
|
19
20
|
title: "Complete",
|
20
21
|
operation: operation,
|
21
|
-
requireReason:
|
22
|
+
requireReason: reason,
|
22
23
|
closeModal: () => dispose(),
|
23
24
|
});
|
24
25
|
}, [operation]);
|
@@ -8,17 +8,18 @@ import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOper
|
|
8
8
|
|
9
9
|
interface StockOperationCompleteDispatchButtonProps {
|
10
10
|
operation: StockOperationDTO;
|
11
|
+
reason: boolean;
|
11
12
|
}
|
12
13
|
|
13
14
|
const StockOperationCompleteDispatchButton: React.FC<
|
14
15
|
StockOperationCompleteDispatchButtonProps
|
15
|
-
> = ({ operation }) => {
|
16
|
+
> = ({ operation, reason }) => {
|
16
17
|
const { t } = useTranslation();
|
17
18
|
const launchcompletedDispatchModal = useCallback(() => {
|
18
19
|
const dispose = showModal("stock-operation-dialog", {
|
19
20
|
title: "Complete Dispatch",
|
20
21
|
operation: operation,
|
21
|
-
requireReason:
|
22
|
+
requireReason: reason,
|
22
23
|
closeModal: () => dispose(),
|
23
24
|
});
|
24
25
|
}, [operation]);
|
@@ -24,14 +24,14 @@ import {
|
|
24
24
|
StructuredListRow,
|
25
25
|
StructuredListCell,
|
26
26
|
StructuredListBody,
|
27
|
-
OverflowMenu,
|
28
|
-
OverflowMenuItem,
|
29
27
|
DatePickerInput,
|
30
28
|
DatePicker,
|
31
29
|
TableToolbarMenu,
|
32
30
|
TableToolbarAction,
|
31
|
+
Button,
|
33
32
|
} from "@carbon/react";
|
34
|
-
import { ArrowRight } from "@carbon/react/icons";
|
33
|
+
import { ArrowRight, Edit } from "@carbon/react/icons";
|
34
|
+
|
35
35
|
import { formatDisplayDate } from "../core/utils/datetimeUtils";
|
36
36
|
import styles from "../stock-items/stock-items-table.scss";
|
37
37
|
import {
|
@@ -341,22 +341,22 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
341
341
|
</div>
|
342
342
|
),
|
343
343
|
actions: (
|
344
|
-
<
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
/>
|
359
|
-
|
344
|
+
<Button
|
345
|
+
kind="ghost"
|
346
|
+
size="md"
|
347
|
+
onClick={() => {
|
348
|
+
launchAddOrEditDialog(
|
349
|
+
t,
|
350
|
+
filteredItems[index],
|
351
|
+
true,
|
352
|
+
operation,
|
353
|
+
operations,
|
354
|
+
false
|
355
|
+
);
|
356
|
+
}}
|
357
|
+
iconDescription={t("editStockItem", "Edit Stock Item")}
|
358
|
+
renderIcon={(props) => <Edit size={16} {...props} />}
|
359
|
+
></Button>
|
360
360
|
),
|
361
361
|
}));
|
362
362
|
}, [handleOnComplete, filteredItems, operation, operations, t]);
|
@@ -520,10 +520,6 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
520
520
|
<StructuredListCell head>
|
521
521
|
{t("dateCompleted", "Date Completed")}
|
522
522
|
</StructuredListCell>
|
523
|
-
<StructuredListCell head>
|
524
|
-
{t("batchNumber", "Batch Number")}
|
525
|
-
</StructuredListCell>
|
526
|
-
<StructuredListCell head>Qty</StructuredListCell>
|
527
523
|
</StructuredListRow>
|
528
524
|
</StructuredListHead>
|
529
525
|
<StructuredListBody>
|
@@ -556,24 +552,6 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
556
552
|
? filteredItems[index]?.creatorFamilyName
|
557
553
|
: ""}
|
558
554
|
</StructuredListCell>
|
559
|
-
<StructuredListCell>
|
560
|
-
{filteredItems[index]?.stockOperationItems
|
561
|
-
? filteredItems[
|
562
|
-
index
|
563
|
-
].stockOperationItems?.map(
|
564
|
-
(item) => item.batchNo
|
565
|
-
)[0]
|
566
|
-
: ""}
|
567
|
-
</StructuredListCell>
|
568
|
-
<StructuredListCell>
|
569
|
-
{filteredItems[index]?.stockOperationItems
|
570
|
-
? filteredItems[
|
571
|
-
index
|
572
|
-
].stockOperationItems?.map(
|
573
|
-
(item) => item.quantity
|
574
|
-
)[0]
|
575
|
-
: ""}
|
576
|
-
</StructuredListCell>
|
577
555
|
</StructuredListRow>
|
578
556
|
<StructuredListRow>
|
579
557
|
<StructuredListCell noWrap>
|
@@ -618,24 +596,6 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
618
596
|
? items[index]?.creatorFamilyName
|
619
597
|
: ""}
|
620
598
|
</StructuredListCell>
|
621
|
-
<StructuredListCell>
|
622
|
-
{filteredItems[index]?.stockOperationItems
|
623
|
-
? filteredItems[
|
624
|
-
index
|
625
|
-
].stockOperationItems?.map(
|
626
|
-
(item) => item.batchNo
|
627
|
-
)[1]
|
628
|
-
: ""}
|
629
|
-
</StructuredListCell>
|
630
|
-
<StructuredListCell>
|
631
|
-
{filteredItems[index]?.stockOperationItems
|
632
|
-
? filteredItems[
|
633
|
-
index
|
634
|
-
].stockOperationItems?.map(
|
635
|
-
(item) => item.quantity
|
636
|
-
)[1]
|
637
|
-
: ""}
|
638
|
-
</StructuredListCell>
|
639
599
|
</StructuredListRow>
|
640
600
|
</StructuredListBody>
|
641
601
|
</>
|
package/translations/am.json
CHANGED
package/translations/ar.json
CHANGED
package/translations/en.json
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"activeTo": "Active To",
|
10
10
|
"addedRule": "Add Rule",
|
11
11
|
"addedSource": "Add Source",
|
12
|
-
"addItem": "Add
|
12
|
+
"addItem": "Add stock item",
|
13
13
|
"addLocation": "Create new Location",
|
14
14
|
"addNewStock": "Add New",
|
15
15
|
"addNewStockRule": "Add New Rule",
|
@@ -52,8 +52,8 @@
|
|
52
52
|
"code": "Code",
|
53
53
|
"comingSoonUnderDev": "Exciting updates are on the way! In the meantime, use the link below to access Admin UI settings.",
|
54
54
|
"commonName": "Common Name",
|
55
|
-
"
|
56
|
-
"
|
55
|
+
"completedispatch": "Complete Dispatch ",
|
56
|
+
"complete": "Complete",
|
57
57
|
"continue": "Continue",
|
58
58
|
"created": "Created",
|
59
59
|
"createLocation": "Create Location",
|
package/translations/es.json
CHANGED
@@ -9,7 +9,7 @@
|
|
9
9
|
"activeTo": "Activo Hasta",
|
10
10
|
"addedRule": "Agregar Regla",
|
11
11
|
"addedSource": "Agregar Fuente",
|
12
|
-
"addItem": "Agregar
|
12
|
+
"addItem": "Agregar stock item",
|
13
13
|
"addLocation": "Crear una nueva Ubicación",
|
14
14
|
"addNewStock": "Agregar nuevo",
|
15
15
|
"addNewStockRule": "Agregar nueva regla",
|