@openmrs/esm-stock-management-app 1.0.1-pre.476 → 1.0.1-pre.484
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/271.js +1 -0
- package/dist/319.js +1 -0
- package/dist/460.js +1 -0
- package/dist/474.js +1 -1
- package/dist/474.js.map +1 -1
- package/dist/574.js +1 -1
- package/dist/757.js +1 -0
- package/dist/788.js +1 -0
- package/dist/807.js +1 -0
- package/dist/833.js +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +163 -9
- package/dist/routes.json +1 -1
- package/i18next-parser.config.js +1 -1
- package/package.json +2 -2
- package/src/core/components/card/metrics-card-component.tsx +3 -3
- package/src/core/components/privilages-component/privilages.component.tsx +7 -1
- package/src/core/components/table/table.component.tsx +1 -1
- package/src/stock-items/add-bulk-stock-item/stock-items-bulk-import.component.tsx +3 -2
- package/src/stock-items/add-stock-item/add-stock-action-button.component.tsx +2 -2
- package/src/stock-items/add-stock-item/packaging-units/packaging-units-delete-modal.component.tsx +4 -4
- package/src/stock-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +30 -34
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rule-button.component.tsx +1 -1
- package/src/stock-items/add-stock-item/stock-item-rules/add-stock-rules.component.tsx +2 -2
- package/src/stock-items/add-stock-item/stock-item-rules/stock-rules-delete.component.tsx +2 -2
- package/src/stock-items/edit-stock-item/edit-stock-item-action-menu.component.tsx +1 -1
- package/src/stock-items/stock-item.utils.tsx +20 -9
- package/src/stock-items/stock-items-table.component.tsx +1 -1
- package/src/stock-locations/add-locations-form.component.tsx +8 -2
- package/src/stock-locations/location-admin-form.component.tsx +8 -5
- package/src/stock-locations/stock-locations-table.component.tsx +4 -14
- package/src/stock-locations/stock-locations-table.resource.tsx +9 -21
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +1 -0
- package/src/stock-operations/add-stock-operation/add-stock-operation.resource.tsx +1 -7
- package/src/stock-operations/add-stock-operation/add-stock-operation.utils.tsx +0 -1
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +10 -8
- package/src/stock-operations/add-stock-operation/stock-items-addition-row.component.tsx +2 -1
- package/src/stock-operations/add-stock-operation/stock-items-addition.component.tsx +2 -2
- package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx +3 -0
- package/src/stock-operations/stock-operation.utils.tsx +28 -12
- package/src/stock-operations/stock-operations-dialog/stock-operations-issue-stock-button.component.tsx +1 -1
- package/src/stock-operations/stock-operations-table.component.tsx +9 -2
- package/src/stock-reports/generate-report/create-stock-report.component.tsx +33 -18
- package/src/stock-sources/add-stock-source-button.component.tsx +1 -1
- package/src/stock-sources/add-stock-sources/add-stock-sources.component.tsx +2 -2
- package/src/stock-sources/stock-sources-delete/stock-sources-delete.component.tsx +2 -2
- package/src/stock-user-role-scopes/add-stock-user-role-scope-button.component.tsx +5 -2
- package/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +10 -8
- package/src/stock-user-role-scopes/delete-stock-user-scope/delete-stock-user-scope.component.tsx +3 -2
- package/src/stock-user-role-scopes/delete-stock-user-scope-modal.component.tsx +1 -3
- package/src/stock-user-role-scopes/stock-user-role-scopes-items-table.component.tsx +1 -1
- package/src/utils.ts +0 -10
- package/translations/am.json +292 -0
- package/translations/ar.json +292 -0
- package/translations/en.json +75 -57
- package/translations/es.json +292 -0
- package/translations/fr.json +292 -0
- package/translations/he.json +292 -0
- package/translations/km.json +292 -0
- package/translations/zh.json +292 -0
@@ -4,6 +4,7 @@ import { showSnackbar } from "@openmrs/esm-framework";
|
|
4
4
|
import { saveLocation } from "./stock-locations-table.resource";
|
5
5
|
import { locationData, LocationMutator } from "../stock-items/types";
|
6
6
|
import LocationAdministrationForm from "./location-admin-form.component";
|
7
|
+
import { extractErrorMessagesFromResponse } from "../constants";
|
7
8
|
|
8
9
|
interface LocationFormProps {
|
9
10
|
showModal: boolean;
|
@@ -39,18 +40,23 @@ const NewLocationForm: React.FC<LocationFormProps> = ({
|
|
39
40
|
title: t("formCreated", "Add Location"),
|
40
41
|
kind: "success",
|
41
42
|
isLowContrast: true,
|
42
|
-
subtitle: t(
|
43
|
+
subtitle: t(
|
44
|
+
"locationCreatedSuccessfully",
|
45
|
+
"Location {{locationName}} was created successfully.",
|
46
|
+
{ locationName: name }
|
47
|
+
),
|
43
48
|
});
|
44
49
|
|
45
50
|
mutate();
|
46
51
|
onModalChange(false);
|
47
52
|
})
|
48
53
|
.catch((error) => {
|
54
|
+
const errorMessages = extractErrorMessagesFromResponse(error);
|
49
55
|
showSnackbar({
|
50
56
|
title: t("errorCreatingForm", "Error creating location"),
|
51
57
|
kind: "error",
|
52
58
|
isLowContrast: true,
|
53
|
-
subtitle:
|
59
|
+
subtitle: errorMessages.join(", "),
|
54
60
|
});
|
55
61
|
onModalChange(false);
|
56
62
|
});
|
@@ -13,7 +13,6 @@ import {
|
|
13
13
|
TextInput,
|
14
14
|
InlineNotification,
|
15
15
|
FilterableMultiSelect,
|
16
|
-
InlineLoading,
|
17
16
|
} from "@carbon/react";
|
18
17
|
import { useTranslation } from "react-i18next";
|
19
18
|
import { locationData } from "../stock-items/types";
|
@@ -50,7 +49,7 @@ const LocationAdministrationForm: React.FC<LocationAdministrationFormProps> = ({
|
|
50
49
|
const [formStateError, setFormStateError] = useState("");
|
51
50
|
|
52
51
|
// Location tag types
|
53
|
-
const { locationTagList: Tags
|
52
|
+
const { locationTagList: Tags } = useLocationTags();
|
54
53
|
|
55
54
|
const {
|
56
55
|
handleSubmit,
|
@@ -120,10 +119,10 @@ const LocationAdministrationForm: React.FC<LocationAdministrationFormProps> = ({
|
|
120
119
|
<Controller
|
121
120
|
name="tags"
|
122
121
|
control={control}
|
123
|
-
render={({ field
|
122
|
+
render={({ field }) => (
|
124
123
|
<FilterableMultiSelect
|
125
124
|
id="tag"
|
126
|
-
titleText="Select tag(s)"
|
125
|
+
titleText={t("selectTags", "Select tag(s)")}
|
127
126
|
helperText="This is helper text"
|
128
127
|
items={Tags ?? []}
|
129
128
|
{...field}
|
@@ -142,7 +141,11 @@ const LocationAdministrationForm: React.FC<LocationAdministrationFormProps> = ({
|
|
142
141
|
style={{ minWidth: "100%", margin: "0rem", padding: "0rem" }}
|
143
142
|
role="alert"
|
144
143
|
kind="error"
|
145
|
-
subtitle={
|
144
|
+
subtitle={
|
145
|
+
t("pleaseFillField", "{{message}}", {
|
146
|
+
message: formStateError,
|
147
|
+
}) + "."
|
148
|
+
}
|
146
149
|
onClose={() => setShowErrorNotification(false)}
|
147
150
|
/>
|
148
151
|
)}
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import React, {
|
1
|
+
import React, { useState } from "react";
|
2
2
|
import { useStockLocationPages } from "./stock-locations-table.resource";
|
3
3
|
import {
|
4
4
|
Button,
|
@@ -35,18 +35,6 @@ const StockLocationsItems: React.FC<StockLocationsTableProps> = () => {
|
|
35
35
|
handleMutate(`${restBaseUrl}/Location?_summary=data`);
|
36
36
|
};
|
37
37
|
|
38
|
-
const createStockLocation = () => {
|
39
|
-
{
|
40
|
-
showLocationModal ? (
|
41
|
-
<NewLocationForm
|
42
|
-
onModalChange={setAddLocationModal}
|
43
|
-
showModal={showLocationModal}
|
44
|
-
mutate={mutate}
|
45
|
-
/>
|
46
|
-
) : null;
|
47
|
-
}
|
48
|
-
};
|
49
|
-
|
50
38
|
if (isLoading) {
|
51
39
|
return <DataTableSkeleton role="progressbar" />;
|
52
40
|
}
|
@@ -85,7 +73,9 @@ const StockLocationsItems: React.FC<StockLocationsTableProps> = () => {
|
|
85
73
|
return (
|
86
74
|
<div className={styles.tileContainer}>
|
87
75
|
<Tile className={styles.tile}>
|
88
|
-
<p className={styles.content}>
|
76
|
+
<p className={styles.content}>
|
77
|
+
{t("noStockItemsToDisplay", "No stock items to display")}
|
78
|
+
</p>
|
89
79
|
</Tile>
|
90
80
|
</div>
|
91
81
|
);
|
@@ -4,13 +4,11 @@ import {
|
|
4
4
|
FetchResponse,
|
5
5
|
openmrsFetch,
|
6
6
|
restBaseUrl,
|
7
|
-
showSnackbar,
|
8
7
|
usePagination,
|
9
8
|
} from "@openmrs/esm-framework";
|
10
9
|
import { useTranslation } from "react-i18next";
|
11
10
|
import { StockOperationFilter } from "../stock-operations/stock-operations.resource";
|
12
11
|
import { useStockTagLocations } from "../stock-lookups/stock-lookups.resource";
|
13
|
-
import { extractErrorMessagesFromResponse } from "../constants";
|
14
12
|
|
15
13
|
export function useStockLocationPages(filter: StockOperationFilter) {
|
16
14
|
const { stockLocations, error, isLoading } = useStockTagLocations();
|
@@ -103,23 +101,13 @@ interface LocationName {
|
|
103
101
|
export async function saveLocation({
|
104
102
|
locationPayload,
|
105
103
|
}): Promise<FetchResponse<LocationName>> {
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
return response;
|
116
|
-
} catch (error) {
|
117
|
-
const errorMessages = extractErrorMessagesFromResponse(error);
|
118
|
-
showSnackbar({
|
119
|
-
subtitle: errorMessages.join(", "),
|
120
|
-
title: "Error on saving form",
|
121
|
-
kind: "error",
|
122
|
-
isLowContrast: true,
|
123
|
-
});
|
124
|
-
}
|
104
|
+
const response: FetchResponse = await openmrsFetch(
|
105
|
+
`${restBaseUrl}/location/`,
|
106
|
+
{
|
107
|
+
method: "POST",
|
108
|
+
headers: { "Content-Type": "application/json" },
|
109
|
+
body: locationPayload,
|
110
|
+
}
|
111
|
+
);
|
112
|
+
return response;
|
125
113
|
}
|
@@ -6,16 +6,10 @@ export const useInitializeStockOperations = (props: AddStockOperationProps) => {
|
|
6
6
|
const [isLoading, setIsLoading] = useState(true);
|
7
7
|
const [isError, setIsError] = useState(false);
|
8
8
|
const [result, setResult] = useState<InitializeResult>();
|
9
|
-
// const urlQueryParams = useUrlQueryParams();
|
10
9
|
|
11
10
|
useEffect(() => {
|
12
11
|
setIsLoading(true);
|
13
|
-
initializeNewStockOperation(
|
14
|
-
props.operation,
|
15
|
-
// urlQueryParams,
|
16
|
-
props.model,
|
17
|
-
props.operations
|
18
|
-
)
|
12
|
+
initializeNewStockOperation(props.operation, props.model, props.operations)
|
19
13
|
.then((data) => {
|
20
14
|
setResult(data);
|
21
15
|
setIsLoading(false);
|
@@ -3,7 +3,6 @@ import { initialStockOperationValue } from "../../core/utils/utils";
|
|
3
3
|
import { MAIN_STORE_LOCATION_TAG, today } from "../../constants";
|
4
4
|
import {
|
5
5
|
operationFromString,
|
6
|
-
OperationType,
|
7
6
|
StockOperationType,
|
8
7
|
StockOperationTypeCanCapturePurchasePrice,
|
9
8
|
StockOperationTypeHasPrint,
|
@@ -4,7 +4,6 @@ import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOper
|
|
4
4
|
import { SaveStockOperation } from "../../stock-items/types";
|
5
5
|
import {
|
6
6
|
operationFromString,
|
7
|
-
OperationType,
|
8
7
|
StockOperationType,
|
9
8
|
} from "../../core/api/types/stockOperation/StockOperationType";
|
10
9
|
import {
|
@@ -19,7 +18,6 @@ import {
|
|
19
18
|
DatePickerInput,
|
20
19
|
InlineLoading,
|
21
20
|
TextInput,
|
22
|
-
ComboBox,
|
23
21
|
} from "@carbon/react";
|
24
22
|
import { Controller, useForm } from "react-hook-form";
|
25
23
|
import { zodResolver } from "@hookform/resolvers/zod";
|
@@ -32,11 +30,12 @@ import ControlledTextInput from "../../core/components/carbon/controlled-text-in
|
|
32
30
|
import StockOperationReasonSelector from "../stock-operation-reason-selector/stock-operation-reason-selector.component";
|
33
31
|
import ControlledTextArea from "../../core/components/carbon/controlled-text-area/controlled-text-area.component";
|
34
32
|
import { InitializeResult } from "./types";
|
35
|
-
import rootStyles from "../../root.scss";
|
36
33
|
import { ResourceRepresentation } from "../../core/api/api";
|
37
34
|
import { useStockOperationPages } from "../stock-operations-table.resource";
|
38
|
-
import { useStockOperationContext } from "./stock-operation-context/useStockOperationContext";
|
39
35
|
import { createBaseOperationPayload } from "./add-stock-utils";
|
36
|
+
import { showSnackbar } from "@openmrs/esm-framework";
|
37
|
+
|
38
|
+
import rootStyles from "../../root.scss";
|
40
39
|
|
41
40
|
interface BaseOperationDetailsProps {
|
42
41
|
isEditing?: boolean;
|
@@ -62,8 +61,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
62
61
|
},
|
63
62
|
}) => {
|
64
63
|
const { t } = useTranslation();
|
65
|
-
const {
|
66
|
-
const { isLoading, items } = useStockOperationPages({
|
64
|
+
const { isLoading } = useStockOperationPages({
|
67
65
|
v: ResourceRepresentation.Full,
|
68
66
|
totalCount: true,
|
69
67
|
});
|
@@ -88,7 +86,7 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
88
86
|
<InlineLoading
|
89
87
|
status="active"
|
90
88
|
iconDescription="Loading"
|
91
|
-
description="Loading data..."
|
89
|
+
description={t("loadingData", "Loading data...")}
|
92
90
|
/>
|
93
91
|
);
|
94
92
|
}
|
@@ -99,7 +97,11 @@ const BaseOperationDetails: React.FC<BaseOperationDetailsProps> = ({
|
|
99
97
|
const payload = createBaseOperationPayload(model, item, operationType);
|
100
98
|
await onSave(payload);
|
101
99
|
} catch (e) {
|
102
|
-
|
100
|
+
showSnackbar({
|
101
|
+
title: t("errorSavingBaseOperation", "Erro saving base operation"),
|
102
|
+
isLowContrast: true,
|
103
|
+
kind: "error",
|
104
|
+
});
|
103
105
|
} finally {
|
104
106
|
setIsSaving(false);
|
105
107
|
}
|
@@ -1,5 +1,4 @@
|
|
1
1
|
import React, { ChangeEvent, useState } from "react";
|
2
|
-
import styles from "./stock-items-addition-row.scss";
|
3
2
|
import { isDesktop } from "@openmrs/esm-framework";
|
4
3
|
import {
|
5
4
|
Button,
|
@@ -37,6 +36,8 @@ import { StockItemDTO } from "../../core/api/types/stockItem/StockItem";
|
|
37
36
|
import QtyUomSelector from "../qty-uom-selector/qty-uom-selector.component";
|
38
37
|
import BatchNoSelector from "../batch-no-selector/batch-no-selector.component";
|
39
38
|
|
39
|
+
import styles from "./stock-items-addition-row.scss";
|
40
|
+
|
40
41
|
interface StockItemsAdditionRowProps {
|
41
42
|
canEdit?: boolean;
|
42
43
|
rows: StockOperationItemFormData[];
|
@@ -23,10 +23,11 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|
23
23
|
import { useValidationSchema } from "./validationSchema";
|
24
24
|
import StockItemsAdditionRow from "./stock-items-addition-row.component";
|
25
25
|
import { Add, ArrowRight } from "@carbon/react/icons";
|
26
|
-
import styles from "./stock-items-addition.component.scss";
|
27
26
|
import { errorAlert } from "../../core/utils/alert";
|
28
27
|
import { useStockOperationContext } from "./stock-operation-context/useStockOperationContext";
|
29
28
|
|
29
|
+
import styles from "./stock-items-addition.component.scss";
|
30
|
+
|
30
31
|
interface StockItemsAdditionProps {
|
31
32
|
isEditing?: boolean;
|
32
33
|
canEdit?: boolean;
|
@@ -65,7 +66,6 @@ const StockItemsAddition: React.FC<StockItemsAdditionProps> = ({
|
|
65
66
|
return;
|
66
67
|
}
|
67
68
|
|
68
|
-
// const data = Object.assign(model, item);
|
69
69
|
model.stockOperationItems = item?.stockItems;
|
70
70
|
await onSave?.(model);
|
71
71
|
};
|
package/src/stock-operations/edit-stock-operation/edit-stock-operation-action-menu.component.tsx
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import React, { useState } from "react";
|
2
2
|
import { Button } from "@carbon/react";
|
3
|
+
import { useTranslation } from "react-i18next";
|
3
4
|
import { StockOperationDTO } from "../../core/api/types/stockOperation/StockOperationDTO";
|
4
5
|
import { launchAddOrEditDialog } from "../stock-operation.utils";
|
5
6
|
import { StockOperationType } from "../../core/api/types/stockOperation/StockOperationType";
|
@@ -13,6 +14,7 @@ interface EditStockOperationActionMenuProps {
|
|
13
14
|
const EditStockOperationActionMenu: React.FC<
|
14
15
|
EditStockOperationActionMenuProps
|
15
16
|
> = ({ operationUuid, operationNumber, model, operations }) => {
|
17
|
+
const { t } = useTranslation();
|
16
18
|
const [operation, setOperation] = useState<StockOperationDTO | null>(null);
|
17
19
|
|
18
20
|
if (operationUuid && !operation) {
|
@@ -56,6 +58,7 @@ const EditStockOperationActionMenu: React.FC<
|
|
56
58
|
kind="ghost"
|
57
59
|
onClick={() => {
|
58
60
|
launchAddOrEditDialog(
|
61
|
+
t,
|
59
62
|
model ?? operation,
|
60
63
|
true,
|
61
64
|
type,
|
@@ -1,11 +1,12 @@
|
|
1
|
-
import { closeOverlay, launchOverlay } from "../core/components/overlay/hook";
|
2
1
|
import React from "react";
|
2
|
+
import { closeOverlay, launchOverlay } from "../core/components/overlay/hook";
|
3
3
|
import {
|
4
4
|
FetchResponse,
|
5
5
|
restBaseUrl,
|
6
6
|
showModal,
|
7
7
|
showSnackbar,
|
8
8
|
} from "@openmrs/esm-framework";
|
9
|
+
import { TFunction } from "react-i18next";
|
9
10
|
import { StockOperationDTO } from "../core/api/types/stockOperation/StockOperationDTO";
|
10
11
|
import {
|
11
12
|
createStockOperation,
|
@@ -19,7 +20,9 @@ import {
|
|
19
20
|
import { useLocation } from "react-router-dom";
|
20
21
|
import { extractErrorMessagesFromResponse } from "../constants";
|
21
22
|
import { handleMutate } from "../utils";
|
23
|
+
|
22
24
|
export const addOrEditStockOperation = async (
|
25
|
+
t: TFunction,
|
23
26
|
stockOperation: StockOperationDTO,
|
24
27
|
isEditing: boolean,
|
25
28
|
operation?: StockOperationType,
|
@@ -50,21 +53,22 @@ export const addOrEditStockOperation = async (
|
|
50
53
|
handleMutate(`${restBaseUrl}/stockmanagement/stockoperation`);
|
51
54
|
showSnackbar({
|
52
55
|
isLowContrast: true,
|
53
|
-
title:
|
56
|
+
title: isEditing
|
57
|
+
? t("editStockOperation", "Edit stock operation")
|
58
|
+
: t("addStockOperation", "Add stock operation"),
|
54
59
|
kind: "success",
|
55
|
-
subtitle:
|
56
|
-
|
57
|
-
|
60
|
+
subtitle: isEditing
|
61
|
+
? t("stockOperationEdited", "Stock operation edited successfully")
|
62
|
+
: t("stockOperationAdded", "Stock operation added successfully"),
|
58
63
|
});
|
59
64
|
|
60
|
-
// Close overlay and open edit overlay
|
61
65
|
closeOverlay();
|
62
66
|
}
|
63
67
|
} catch (error) {
|
64
68
|
const errorMessages = extractErrorMessagesFromResponse(error);
|
65
69
|
showSnackbar({
|
66
70
|
subtitle: errorMessages.join(", "),
|
67
|
-
title: "Error on saving form",
|
71
|
+
title: t("errorSavingForm", "Error on saving form"),
|
68
72
|
kind: "error",
|
69
73
|
isLowContrast: true,
|
70
74
|
});
|
@@ -72,6 +76,7 @@ export const addOrEditStockOperation = async (
|
|
72
76
|
};
|
73
77
|
|
74
78
|
export const launchAddOrEditDialog = (
|
79
|
+
t: TFunction,
|
75
80
|
stockOperation: StockOperationDTO,
|
76
81
|
isEditing: boolean,
|
77
82
|
operation?: StockOperationType,
|
@@ -79,13 +84,24 @@ export const launchAddOrEditDialog = (
|
|
79
84
|
canPrint?: boolean
|
80
85
|
) => {
|
81
86
|
launchOverlay(
|
82
|
-
|
83
|
-
|
84
|
-
|
87
|
+
isEditing
|
88
|
+
? t("editOperationTitle", "Edit {{operationType}}", {
|
89
|
+
operationType: stockOperation?.operationTypeName,
|
90
|
+
})
|
91
|
+
: t("newOperationTitle", "New: {{operationName}}", {
|
92
|
+
operationName: operation?.name,
|
93
|
+
}),
|
85
94
|
<AddStockOperation
|
86
95
|
model={stockOperation}
|
87
|
-
onSave={(
|
88
|
-
addOrEditStockOperation(
|
96
|
+
onSave={(stockOperation) =>
|
97
|
+
addOrEditStockOperation(
|
98
|
+
t,
|
99
|
+
stockOperation,
|
100
|
+
isEditing,
|
101
|
+
operation,
|
102
|
+
operations,
|
103
|
+
canPrint
|
104
|
+
)
|
89
105
|
}
|
90
106
|
isEditing={isEditing}
|
91
107
|
operation={operation}
|
@@ -42,7 +42,7 @@ const StockOperationIssueStockButton: React.FC<
|
|
42
42
|
|
43
43
|
const modifiedOperation = addRequisitionStockOperation(operation);
|
44
44
|
const handleButtonClick = () => {
|
45
|
-
launchAddOrEditDialog(modifiedOperation, false, type, operations, false);
|
45
|
+
launchAddOrEditDialog(t, modifiedOperation, false, type, operations, false);
|
46
46
|
};
|
47
47
|
|
48
48
|
return (
|
@@ -347,6 +347,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
347
347
|
itemText="Edit"
|
348
348
|
onClick={() => {
|
349
349
|
launchAddOrEditDialog(
|
350
|
+
t,
|
350
351
|
filteredItems[index],
|
351
352
|
true,
|
352
353
|
operation,
|
@@ -358,7 +359,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
358
359
|
</OverflowMenu>
|
359
360
|
),
|
360
361
|
}));
|
361
|
-
}, [handleOnComplete, filteredItems, operation, operations,
|
362
|
+
}, [handleOnComplete, filteredItems, operation, operations, t]);
|
362
363
|
|
363
364
|
if (isLoading) {
|
364
365
|
return (
|
@@ -374,7 +375,12 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
374
375
|
|
375
376
|
return (
|
376
377
|
<div className={styles.tableOverride}>
|
377
|
-
<TabPanel>
|
378
|
+
<TabPanel>
|
379
|
+
{t(
|
380
|
+
"stockOperationTrackMovement",
|
381
|
+
"Stock operations to track movement of stock."
|
382
|
+
)}
|
383
|
+
</TabPanel>
|
378
384
|
<div id="table-tool-bar">
|
379
385
|
<div></div>
|
380
386
|
<div className="right-filters"></div>
|
@@ -447,6 +453,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
447
453
|
<StockOperationTypesSelector
|
448
454
|
onOperationTypeSelected={(operation) => {
|
449
455
|
launchAddOrEditDialog(
|
456
|
+
t,
|
450
457
|
initialStockOperationValue(),
|
451
458
|
false,
|
452
459
|
operation,
|
@@ -241,7 +241,10 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
241
241
|
ReportParameter.Fullfillment,
|
242
242
|
(report.fullFillment ?? ["All"]).join(","),
|
243
243
|
(report.fullFillment ?? ["All"]).join(", "),
|
244
|
-
t(
|
244
|
+
t(
|
245
|
+
"editFullfillmentReport",
|
246
|
+
"stockmanagement.report.edit.fullfillment"
|
247
|
+
),
|
245
248
|
newLine
|
246
249
|
);
|
247
250
|
}
|
@@ -250,7 +253,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
250
253
|
ReportParameter.Patient,
|
251
254
|
report.patientUuid ?? "",
|
252
255
|
report.patientName?.trim() ?? "All Patients",
|
253
|
-
t("Patients"),
|
256
|
+
t("patients", "Patients"),
|
254
257
|
newLine
|
255
258
|
);
|
256
259
|
}
|
@@ -259,7 +262,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
259
262
|
ReportParameter.StockItem,
|
260
263
|
report.stockItemUuid ?? "",
|
261
264
|
report.stockItemName?.trim() ?? "All Stock Items",
|
262
|
-
t("Stock Item"),
|
265
|
+
t("stockItem", "Stock Item"),
|
263
266
|
newLine
|
264
267
|
);
|
265
268
|
}
|
@@ -268,7 +271,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
268
271
|
ReportParameter.StockItemCategory,
|
269
272
|
report.stockItemCategoryConceptUuid ?? "",
|
270
273
|
report.stockItemCategory?.trim() ?? "All Categories",
|
271
|
-
t("Stock Item Category"),
|
274
|
+
t("stockItemCategory", "Stock Item Category"),
|
272
275
|
newLine
|
273
276
|
);
|
274
277
|
}
|
@@ -277,7 +280,10 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
277
280
|
ReportParameter.InventoryGroupBy,
|
278
281
|
report.inventoryGroupBy ?? "LocationStockItemBatchNo",
|
279
282
|
report.inventoryGroupByName?.trim() ?? "Stock Item Batch Number",
|
280
|
-
t(
|
283
|
+
t(
|
284
|
+
"displayInventoryReport",
|
285
|
+
"stockmanagement.report.edit.inventorygroupby"
|
286
|
+
),
|
281
287
|
newLine
|
282
288
|
);
|
283
289
|
}
|
@@ -286,7 +292,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
286
292
|
ReportParameter.Location,
|
287
293
|
report.location,
|
288
294
|
report.location?.trim() ?? "",
|
289
|
-
t("Location"),
|
295
|
+
t("location", "Location"),
|
290
296
|
newLine
|
291
297
|
);
|
292
298
|
if (displayChildLocations) {
|
@@ -294,7 +300,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
294
300
|
ReportParameter.ChildLocations,
|
295
301
|
report.childLocations ? "true" : "false",
|
296
302
|
report.childLocations ? "Yes" : "No",
|
297
|
-
t("Include Child Locations"),
|
303
|
+
t("includeChildLocations", "Include Child Locations"),
|
298
304
|
newLine
|
299
305
|
);
|
300
306
|
}
|
@@ -304,7 +310,10 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
304
310
|
ReportParameter.MaxReorderLevelRatio,
|
305
311
|
(report.maxReorderLevelRatio ?? 0).toString(),
|
306
312
|
(report.maxReorderLevelRatio ?? 0).toString() + "%",
|
307
|
-
t(
|
313
|
+
t(
|
314
|
+
"displayMaxReorderReport",
|
315
|
+
"stockmanagement.report.edit.maxreorderlevelratio"
|
316
|
+
),
|
308
317
|
newLine
|
309
318
|
);
|
310
319
|
}
|
@@ -313,7 +322,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
313
322
|
ReportParameter.StockSource,
|
314
323
|
report.stockSourceUuid ?? "",
|
315
324
|
report.stockSource?.trim() ?? "All Sources",
|
316
|
-
t("stockmanagement.report.edit.stocksource"),
|
325
|
+
t("displayStockReport", "stockmanagement.report.edit.stocksource"),
|
317
326
|
newLine
|
318
327
|
);
|
319
328
|
}
|
@@ -322,7 +331,10 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
322
331
|
ReportParameter.StockSourceDestination,
|
323
332
|
report.stockSourceDestinationUuid ?? "",
|
324
333
|
report.stockSourceDestination?.trim() ?? "All Destinations",
|
325
|
-
t(
|
334
|
+
t(
|
335
|
+
"displayStockDestinationReport",
|
336
|
+
"stockmanagement.report.edit.stocksourcedestination"
|
337
|
+
),
|
326
338
|
newLine
|
327
339
|
);
|
328
340
|
}
|
@@ -331,7 +343,10 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
331
343
|
ReportParameter.MostLeastMoving,
|
332
344
|
report.mostLeastMoving ?? "MostMoving",
|
333
345
|
report.mostLeastMovingName?.trim() ?? "Most Moving",
|
334
|
-
t(
|
346
|
+
t(
|
347
|
+
"displayMostLeastMovingReport",
|
348
|
+
"stockmanagement.report.edit.mostleastmoving"
|
349
|
+
),
|
335
350
|
newLine
|
336
351
|
);
|
337
352
|
}
|
@@ -357,7 +372,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
357
372
|
ReportParameter.Date,
|
358
373
|
report.date ? JSON.stringify(report.date).replaceAll('"', "") : "",
|
359
374
|
formatDisplayDate(report.date) ?? "",
|
360
|
-
t("stockmanagement.report.edit.date"),
|
375
|
+
t("displayReportDate", "stockmanagement.report.edit.date"),
|
361
376
|
newLine
|
362
377
|
);
|
363
378
|
}
|
@@ -405,7 +420,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
405
420
|
});
|
406
421
|
}
|
407
422
|
})
|
408
|
-
.catch((
|
423
|
+
.catch(() => {
|
409
424
|
showSnackbar({
|
410
425
|
title: t("BatchJobErrorTitle", "Batch job"),
|
411
426
|
subtitle: t("batchJobErrorMessage", "Error creating batch job"),
|
@@ -549,11 +564,11 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
549
564
|
/>
|
550
565
|
<SelectItem
|
551
566
|
value="LocationStockItem"
|
552
|
-
text={t("
|
567
|
+
text={t("locationAndStockItem", "Location and Stock Item")}
|
553
568
|
/>
|
554
569
|
<SelectItem
|
555
570
|
value="LocationStockItemBatchNo"
|
556
|
-
text={t("
|
571
|
+
text={t("locationAndBatchno", "Location and Batch")}
|
557
572
|
/>
|
558
573
|
</Select>
|
559
574
|
)}
|
@@ -572,7 +587,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
572
587
|
disabled
|
573
588
|
hidden
|
574
589
|
value=""
|
575
|
-
text={t("Choose a location")}
|
590
|
+
text={t("chooseALocation", "Choose a location")}
|
576
591
|
/>
|
577
592
|
{(stockLocations ?? [])?.map((loc) => {
|
578
593
|
return <SelectItem key={loc.id} value={loc.id} text={loc.name} />;
|
@@ -589,7 +604,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
589
604
|
onChange={onChange}
|
590
605
|
value={value}
|
591
606
|
labelText={t(
|
592
|
-
"
|
607
|
+
"includeChildLocations",
|
593
608
|
"Include Child Locations"
|
594
609
|
)}
|
595
610
|
/>
|
@@ -615,7 +630,7 @@ const CreateReport: React.FC<CreateReportProps> = ({ model }) => {
|
|
615
630
|
<RadioButton
|
616
631
|
value="LeastMoving"
|
617
632
|
id="mostLeastMovingLeast"
|
618
|
-
labelText={t("
|
633
|
+
labelText={t("leastMoving", "Least Moving")}
|
619
634
|
/>
|
620
635
|
</RadioButtonGroup>
|
621
636
|
)}
|
@@ -63,7 +63,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model }) => {
|
|
63
63
|
title: t("addedSource", "Add Source"),
|
64
64
|
kind: "success",
|
65
65
|
subtitle: t(
|
66
|
-
"
|
66
|
+
"stockSourceAddedSuccessfully",
|
67
67
|
"Stock Source Added Successfully"
|
68
68
|
),
|
69
69
|
timeoutInMs: 5000,
|
@@ -75,7 +75,7 @@ const StockSourcesAddOrUpdate: React.FC<AddStockSourceProps> = ({ model }) => {
|
|
75
75
|
},
|
76
76
|
(error) => {
|
77
77
|
showSnackbar({
|
78
|
-
title: t(
|
78
|
+
title: t("errorAddingSource", "Error adding a source"),
|
79
79
|
kind: "error",
|
80
80
|
isLowContrast: true,
|
81
81
|
subtitle: error?.message,
|