@openmrs/esm-stock-management-app 1.0.1-pre.361 → 1.0.1-pre.366
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/56.js +1 -0
- package/dist/56.js.map +1 -0
- package/dist/main.js +1 -1
- package/dist/main.js.map +1 -1
- package/dist/openmrs-esm-stock-management-app.js +1 -1
- package/dist/openmrs-esm-stock-management-app.js.buildmanifest.json +31 -31
- package/dist/openmrs-esm-stock-management-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/core/api/types/BatchJob.ts +2 -2
- package/src/stock-reports/ReportType.ts +2 -2
- package/src/stock-reports/generate-report/create-stock-report.component.tsx +635 -31
- package/src/stock-reports/generate-report/create-stock-report.scss +9 -2
- package/src/stock-reports/report-list/stock-reports.component.tsx +8 -1
- package/src/stock-reports/report-validation-schema.ts +40 -0
- package/tsconfig.json +2 -1
- package/dist/969.js +0 -1
- package/dist/969.js.map +0 -1
@@ -2,8 +2,15 @@
|
|
2
2
|
@use '@carbon/styles/scss/type';
|
3
3
|
@import '~@openmrs/esm-styleguide/src/vars';
|
4
4
|
|
5
|
-
.
|
6
|
-
|
5
|
+
.reportContainer {
|
6
|
+
min-height: 15rem;
|
7
|
+
display: flex;
|
8
|
+
flex-direction: column;
|
9
|
+
row-gap: 1rem;
|
10
|
+
padding: 1rem;
|
11
|
+
}
|
12
|
+
.reportButton {
|
13
|
+
padding: 1rem
|
7
14
|
}
|
8
15
|
|
9
16
|
.sectionTitle {
|
@@ -17,6 +17,7 @@ import {
|
|
17
17
|
TableToolbarSearch,
|
18
18
|
Tile,
|
19
19
|
Button,
|
20
|
+
InlineLoading,
|
20
21
|
} from "@carbon/react";
|
21
22
|
import { isDesktop } from "@openmrs/esm-framework";
|
22
23
|
import NewReportActionButton from "./new-report-button.component";
|
@@ -30,7 +31,6 @@ import {
|
|
30
31
|
BatchJobStatusExpired,
|
31
32
|
BatchJobStatusFailed,
|
32
33
|
BatchJobStatusPending,
|
33
|
-
BatchJobStatusRunning,
|
34
34
|
} from "../../core/api/types/BatchJob";
|
35
35
|
import {
|
36
36
|
CheckmarkOutline,
|
@@ -118,6 +118,13 @@ const StockReports: React.FC = () => {
|
|
118
118
|
)),
|
119
119
|
status: (
|
120
120
|
<>
|
121
|
+
{batchJob.status === BatchJobStatusPending && (
|
122
|
+
<InlineLoading
|
123
|
+
status="active"
|
124
|
+
iconDescription="Loading"
|
125
|
+
description="Generating report..."
|
126
|
+
/>
|
127
|
+
)}
|
121
128
|
{batchJob.status === BatchJobStatusFailed && (
|
122
129
|
<WarningAltFilled
|
123
130
|
className="report-failed"
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import { z } from "zod";
|
2
|
+
|
3
|
+
export const reportSchema = z.object({
|
4
|
+
startDate: z.coerce.date().refine((date) => date !== undefined, {
|
5
|
+
message: "Start Date is required",
|
6
|
+
}),
|
7
|
+
endDate: z.coerce.date().refine((date) => date !== undefined, {
|
8
|
+
message: "End Date is required",
|
9
|
+
}),
|
10
|
+
location: z.string({ required_error: "Location Required" }).min(1, {
|
11
|
+
message: "Location Required",
|
12
|
+
}),
|
13
|
+
reportName: z.string({ required_error: "Report Name Required" }).min(1, {
|
14
|
+
message: "Report Name Required",
|
15
|
+
}),
|
16
|
+
stockReportItemCategory: z.string().optional(),
|
17
|
+
mostLeastMoving: z.string().optional(),
|
18
|
+
mostLeastMovingName: z.string().optional(),
|
19
|
+
stockItemUuid: z.string().optional(),
|
20
|
+
stockItemName: z.string().optional(),
|
21
|
+
patientUuid: z.string().optional(),
|
22
|
+
patientName: z.string().optional(),
|
23
|
+
locationUuid: z.string().optional(),
|
24
|
+
childLocations: z.boolean().optional(),
|
25
|
+
stockSourceUuid: z.string().optional(),
|
26
|
+
stockSource: z.string().optional(),
|
27
|
+
stockSourceDestinationUuid: z.string().optional(),
|
28
|
+
stockSourceDestination: z.string().optional(),
|
29
|
+
inventoryGroupBy: z.string().optional(),
|
30
|
+
inventoryGroupByName: z.string().optional(),
|
31
|
+
stockItemCategoryConceptUuid: z.string().optional(),
|
32
|
+
reportSystemName: z.string().optional(),
|
33
|
+
stockItemCategory: z.string().optional(),
|
34
|
+
maxReorderLevelRatio: z.number().optional(),
|
35
|
+
fullFillment: z.string().array().optional(),
|
36
|
+
limit: z.string().optional(),
|
37
|
+
date: z.date().optional(),
|
38
|
+
});
|
39
|
+
|
40
|
+
export type StockReportSchema = z.infer<typeof reportSchema>;
|