@openmrs/esm-stock-management-app 1.0.1-pre.38 → 1.0.1-pre.383
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/835.js +2 -0
- package/dist/835.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 +42 -42
- 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-items/add-stock-item/stock-item-details/stock-item-details.component.tsx +0 -1
- package/src/stock-items/add-stock-item/stock-item-rules/stock-item-rules.component.tsx +2 -2
- package/src/stock-items/stock-items-table.component.tsx +22 -3
- package/src/stock-items/types.ts +79 -0
- package/src/stock-locations/add-locations-form.component.tsx +74 -0
- package/src/stock-locations/location-admin-form.component.tsx +164 -0
- package/src/stock-locations/stock-locations-table.component.tsx +33 -10
- package/src/stock-locations/stock-locations-table.resource.tsx +67 -12
- package/src/stock-locations/stock-locations-table.scss +3 -0
- package/src/stock-lookups/stock-lookups.resource.ts +1 -1
- package/src/stock-operations/add-stock-operation/add-stock-operation.component.tsx +18 -8
- package/src/stock-operations/add-stock-operation/add-stock-utils.ts +0 -2
- package/src/stock-operations/add-stock-operation/base-operation-details.component.tsx +28 -37
- package/src/stock-operations/stock-operation.utils.tsx +17 -2
- package/src/stock-operations/stock-operations-dialog/stock-operations-dialog.component.tsx +12 -12
- package/src/stock-operations/stock-operations-dialog/stock-operations-issue-stock-button.component.tsx +10 -2
- package/src/stock-operations/stock-operations-table.component.tsx +16 -15
- package/src/stock-operations/validation-schema.ts +0 -3
- 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/src/stock-user-role-scopes/add-stock-user-scope/add-stock-user-role-scope.component.tsx +7 -19
- package/tsconfig.json +2 -1
- package/dist/500.js +0 -2
- package/dist/500.js.map +0 -1
- package/dist/842.js +0 -1
- package/dist/842.js.map +0 -1
- /package/dist/{500.js.LICENSE.txt → 835.js.LICENSE.txt} +0 -0
@@ -45,7 +45,6 @@ import { initialStockOperationValue } from "../core/utils/utils";
|
|
45
45
|
import { StockOperationType } from "../core/api/types/stockOperation/StockOperationType";
|
46
46
|
import { useTranslation } from "react-i18next";
|
47
47
|
import EditStockOperationActionMenu from "./edit-stock-operation/edit-stock-operation-action-menu.component";
|
48
|
-
import { handleMutate } from "./swr-revalidation";
|
49
48
|
import StockOperationsFilters from "./stock-operations-filters.component";
|
50
49
|
import {
|
51
50
|
DATE_PICKER_CONTROL_FORMAT,
|
@@ -107,18 +106,14 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
107
106
|
const [selectedSources, setSelectedSources] = useState<string[]>([]);
|
108
107
|
const [selectedStatus, setSelectedStatus] = useState<string[]>([]);
|
109
108
|
const [selectedOperations, setSelectedOperations] = useState<string[]>([]);
|
110
|
-
|
111
109
|
const config = useConfig();
|
112
110
|
|
113
111
|
let operations: StockOperationType[] | null | undefined;
|
114
112
|
const handleOnComplete = () => {
|
115
113
|
const dispose = showModal("stock-operation-dialog", {
|
116
114
|
title: "complete",
|
117
|
-
operation: operation,
|
118
|
-
requireReason: "",
|
119
115
|
closeModal: () => dispose(),
|
120
116
|
});
|
121
|
-
handleMutate("ws/rest/v1/stockmanagement/stockoperation");
|
122
117
|
};
|
123
118
|
|
124
119
|
useEffect(() => {
|
@@ -131,6 +126,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
131
126
|
selectedOperations,
|
132
127
|
currentPage,
|
133
128
|
currentPageSize,
|
129
|
+
items,
|
134
130
|
]);
|
135
131
|
|
136
132
|
const handleOnFilterChange = useCallback((selectedItems, filterType) => {
|
@@ -230,12 +226,12 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
230
226
|
details: (
|
231
227
|
<div className="tbl-expand-display-fields">
|
232
228
|
<div className="field-label">
|
233
|
-
<span className="field-title">Created</span>
|
229
|
+
<span className="field-title"> {t("created", "Created")}</span>
|
234
230
|
<span className="field-desc">
|
235
231
|
<span className="action-date">
|
236
232
|
{formatDisplayDate(stockOperation?.dateCreated)}
|
237
233
|
</span>{" "}
|
238
|
-
By
|
234
|
+
{t("by", "By")}
|
239
235
|
<span className="action-by">
|
240
236
|
{stockOperation.creatorFamilyName ?? ""}{" "}
|
241
237
|
{stockOperation.creatorGivenName ?? ""}
|
@@ -246,12 +242,14 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
246
242
|
stockOperation?.status !== StockOperationStatusReturned &&
|
247
243
|
stockOperation?.submittedDate && (
|
248
244
|
<div className="field-label">
|
249
|
-
<span className="field-title">
|
245
|
+
<span className="field-title">
|
246
|
+
{t("submitted", "Submitted")}
|
247
|
+
</span>
|
250
248
|
<span className="field-desc">
|
251
249
|
<span className="action-date">
|
252
250
|
{formatDisplayDate(stockOperation?.submittedDate)}
|
253
251
|
</span>{" "}
|
254
|
-
By
|
252
|
+
{t("by", "By")}
|
255
253
|
<span className="action-by">
|
256
254
|
{stockOperation.submittedByFamilyName ?? ""}{" "}
|
257
255
|
{stockOperation.submittedByGivenName ?? ""}
|
@@ -262,12 +260,12 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
262
260
|
|
263
261
|
{stockOperation?.completedDate && (
|
264
262
|
<div className="field-label">
|
265
|
-
<span className="field-title">Completed</span>
|
263
|
+
<span className="field-title">{t("completed", "Completed")}</span>
|
266
264
|
<span className="field-desc">
|
267
265
|
<span className="action-date">
|
268
266
|
{formatDisplayDate(stockOperation?.completedDate)}
|
269
267
|
</span>{" "}
|
270
|
-
By
|
268
|
+
{t("by", "By")}
|
271
269
|
<span className="action-by">
|
272
270
|
{stockOperation.completedByFamilyName ?? ""}{" "}
|
273
271
|
{stockOperation.completedByGivenName ?? ""}
|
@@ -278,12 +276,15 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
278
276
|
|
279
277
|
{stockOperation?.status === StockOperationStatusCancelled && (
|
280
278
|
<div className="field-label">
|
281
|
-
<span className="field-title">
|
279
|
+
<span className="field-title">
|
280
|
+
{" "}
|
281
|
+
{t("cancelled", "Cancelled")}
|
282
|
+
</span>
|
282
283
|
<span className="field-desc">
|
283
284
|
<span className="action-date">
|
284
285
|
{formatDisplayDate(stockOperation?.cancelledDate)}
|
285
286
|
</span>{" "}
|
286
|
-
By
|
287
|
+
{t("by", "By")}
|
287
288
|
<span className="action-by">
|
288
289
|
{stockOperation.cancelledByFamilyName ?? ""}{" "}
|
289
290
|
{stockOperation.cancelledByGivenName ?? ""}
|
@@ -300,7 +301,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
300
301
|
<span className="action-date">
|
301
302
|
{formatDisplayDate(stockOperation?.rejectedDate)}
|
302
303
|
</span>{" "}
|
303
|
-
By
|
304
|
+
{t("by", "By")}
|
304
305
|
<span className="action-by">
|
305
306
|
{stockOperation.rejectedByFamilyName ?? ""}{" "}
|
306
307
|
{stockOperation.rejectedByGivenName ?? ""}
|
@@ -346,7 +347,7 @@ const StockOperations: React.FC<StockOperationsTableProps> = () => {
|
|
346
347
|
</OverflowMenu>
|
347
348
|
),
|
348
349
|
}));
|
349
|
-
}, [handleOnComplete, filteredItems, operation, operations]);
|
350
|
+
}, [handleOnComplete, filteredItems, operation, operations, items]);
|
350
351
|
|
351
352
|
if (isLoading) {
|
352
353
|
return (
|
@@ -169,9 +169,6 @@ export const operationSchema = (operation: OperationType): z.Schema => {
|
|
169
169
|
.min(1, {
|
170
170
|
message: "Destination Required",
|
171
171
|
}),
|
172
|
-
requisitionStockOperationUuid: z.string({
|
173
|
-
required_error: "Requisition stock uuid required",
|
174
|
-
}),
|
175
172
|
})
|
176
173
|
);
|
177
174
|
case OperationType.RETURN_OPERATION_TYPE:
|
@@ -44,7 +44,7 @@ export const getReportStartDateLabel = (
|
|
44
44
|
) => {
|
45
45
|
return isForecastReport(reportSystemName)
|
46
46
|
? "stockmanagement.report.edit.historicalstartdate"
|
47
|
-
: "
|
47
|
+
: "Start Date";
|
48
48
|
};
|
49
49
|
|
50
50
|
export const getReportEndDateLabel = (
|
@@ -52,7 +52,7 @@ export const getReportEndDateLabel = (
|
|
52
52
|
) => {
|
53
53
|
return isForecastReport(reportSystemName)
|
54
54
|
? "stockmanagement.report.edit.historicalenddate"
|
55
|
-
: "
|
55
|
+
: "End Date";
|
56
56
|
};
|
57
57
|
|
58
58
|
export interface ReportType {
|