@openmrs/esm-stock-management-app 1.0.1-pre.750 → 1.0.1-pre.758
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/172.js +1 -1
- package/dist/20.js +1 -1
- package/dist/290.js +1 -1
- package/dist/400.js +1 -0
- package/dist/400.js.map +1 -0
- package/dist/606.js +1 -1
- package/dist/627.js +1 -1
- package/dist/766.js +2 -0
- package/dist/766.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 +62 -62
- package/dist/openmrs-esm-stock-management-app.js.map +1 -1
- package/dist/routes.json +1 -1
- package/package.json +1 -1
- package/src/config-schema.ts +6 -0
- package/src/stock-home/stock-home-inventory-card.component.tsx +12 -2
- package/src/stock-home/stock-home-inventory-expiry.component.tsx +64 -0
- package/src/stock-home/stock-home-issuing-card.component.tsx +10 -2
- package/src/stock-home/stock-home-issuing-modal.component.tsx +56 -0
- package/src/stock-home/stock-home-receiving-card.component.tsx +10 -2
- package/src/stock-home/stock-home-receiving-modal.component.tsx +58 -0
- package/src/stock-items/add-stock-item/transactions/printout/transactions-print-action.component.tsx +22 -17
- package/dist/18.js +0 -1
- package/dist/18.js.map +0 -1
- package/dist/651.js +0 -2
- package/dist/651.js.map +0 -1
- /package/dist/{651.js.LICENSE.txt → 766.js.LICENSE.txt} +0 -0
@@ -0,0 +1,58 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { Modal, Table, TableHead, TableRow, TableHeader, TableBody, TableCell, TableContainer } from '@carbon/react';
|
3
|
+
|
4
|
+
const ReceivingStockModal = ({ open, onClose, receivingStock }) => {
|
5
|
+
const headers = [
|
6
|
+
{ key: 'status', header: 'Status' },
|
7
|
+
{ key: 'sourceName', header: 'Source' },
|
8
|
+
{ key: 'destinationName', header: 'Destination' },
|
9
|
+
{ key: 'stockItemName', header: 'Stock Item' },
|
10
|
+
{ key: 'stockItemPackagingUOMName', header: 'Unit' },
|
11
|
+
{ key: 'quantity', header: 'Quantity' },
|
12
|
+
];
|
13
|
+
|
14
|
+
return (
|
15
|
+
<Modal
|
16
|
+
open={open}
|
17
|
+
onRequestClose={onClose}
|
18
|
+
modalHeading="Received Stock"
|
19
|
+
primaryButtonText="Close"
|
20
|
+
onSecondarySubmit={onClose}
|
21
|
+
size="lg"
|
22
|
+
>
|
23
|
+
<div>
|
24
|
+
{receivingStock && receivingStock.length > 0 ? (
|
25
|
+
<TableContainer>
|
26
|
+
<Table>
|
27
|
+
<TableHead>
|
28
|
+
<TableRow>
|
29
|
+
{headers.map((header) => (
|
30
|
+
<TableHeader key={header.key}>{header.header}</TableHeader>
|
31
|
+
))}
|
32
|
+
</TableRow>
|
33
|
+
</TableHead>
|
34
|
+
<TableBody>
|
35
|
+
{receivingStock.map((item, index) =>
|
36
|
+
item?.stockOperationItems.map((stock, stockIndex) => (
|
37
|
+
<TableRow key={`${index}-${stockIndex}`}>
|
38
|
+
<TableCell>{item?.status || 'N/A'}</TableCell>
|
39
|
+
<TableCell>{item?.sourceName || 'N/A'}</TableCell>
|
40
|
+
<TableCell>{item?.destinationName || 'N/A'}</TableCell>
|
41
|
+
<TableCell>{stock?.stockItemName || 'N/A'}</TableCell>
|
42
|
+
<TableCell>{stock?.stockItemPackagingUOMName || 'N/A'}</TableCell>
|
43
|
+
<TableCell>{stock?.quantity || 'N/A'}</TableCell>
|
44
|
+
</TableRow>
|
45
|
+
)),
|
46
|
+
)}
|
47
|
+
</TableBody>
|
48
|
+
</Table>
|
49
|
+
</TableContainer>
|
50
|
+
) : (
|
51
|
+
<p>No received stock data available.</p>
|
52
|
+
)}
|
53
|
+
</div>
|
54
|
+
</Modal>
|
55
|
+
);
|
56
|
+
};
|
57
|
+
|
58
|
+
export default ReceivingStockModal;
|
package/src/stock-items/add-stock-item/transactions/printout/transactions-print-action.component.tsx
CHANGED
@@ -3,7 +3,8 @@ import { Button, Stack, ComboButton, MenuItem } from '@carbon/react';
|
|
3
3
|
import { Printer } from '@carbon/react/icons';
|
4
4
|
import { useTranslation } from 'react-i18next';
|
5
5
|
import { useStockItem } from '../../../stock-items.resource';
|
6
|
-
import { showModal } from '@openmrs/esm-framework';
|
6
|
+
import { showModal, useConfig } from '@openmrs/esm-framework';
|
7
|
+
import { type ConfigObject } from '../../../../config-schema';
|
7
8
|
import styles from './printable-transaction.scss';
|
8
9
|
import { useEffect, useMemo, useState } from 'react';
|
9
10
|
import { StockItemInventoryFilter, useStockItemTransactions } from '../../../stock-items.resource';
|
@@ -18,6 +19,8 @@ type Props = {
|
|
18
19
|
const TransactionsPrintAction: React.FC<Props> = ({ columns, data, itemUuid }) => {
|
19
20
|
const { t } = useTranslation();
|
20
21
|
|
22
|
+
const { enablePrintButton } = useConfig<ConfigObject>();
|
23
|
+
|
21
24
|
const [stockCardItemFilter, setStockCardItemFilter] = useState<StockItemInventoryFilter>({
|
22
25
|
startIndex: 0,
|
23
26
|
totalCount: true,
|
@@ -86,22 +89,24 @@ const TransactionsPrintAction: React.FC<Props> = ({ columns, data, itemUuid }) =
|
|
86
89
|
|
87
90
|
return (
|
88
91
|
<>
|
89
|
-
|
90
|
-
<
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
92
|
+
{enablePrintButton && (
|
93
|
+
<ComboButton label="Print">
|
94
|
+
<MenuItem
|
95
|
+
label={t('printStockCard', 'Print Stock Card')}
|
96
|
+
renderIcon={(props) => <Printer size={24} {...props} />}
|
97
|
+
iconDescription="Print Stock Card"
|
98
|
+
onClick={handleStockcardClick}
|
99
|
+
disabled={isStockItemLoading || isStockCardLoading}
|
100
|
+
/>
|
101
|
+
<MenuItem
|
102
|
+
label={t('printBinCard', 'Print Bin Card')}
|
103
|
+
renderIcon={(props) => <Printer size={24} {...props} />}
|
104
|
+
iconDescription="Print Bin Card"
|
105
|
+
onClick={handleBincardClick}
|
106
|
+
disabled={isStockItemLoading}
|
107
|
+
/>
|
108
|
+
</ComboButton>
|
109
|
+
)}
|
105
110
|
</>
|
106
111
|
);
|
107
112
|
};
|