-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jan
committed
Feb 23, 2024
1 parent
02c66c8
commit f3b1dc4
Showing
3 changed files
with
101 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
90 changes: 90 additions & 0 deletions
90
src/components/payroll/dialogs/PayrollReconciliationFilesDialog.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,90 @@ | ||
import React, { useState } from 'react'; | ||
import { useSelector } from 'react-redux'; | ||
import Button from '@material-ui/core/Button'; | ||
import Dialog from '@material-ui/core/Dialog'; | ||
import DialogActions from '@material-ui/core/DialogActions'; | ||
import DialogContent from '@material-ui/core/DialogContent'; | ||
import DialogTitle from '@material-ui/core/DialogTitle'; | ||
import { | ||
useTranslations, | ||
useModulesManager, | ||
} from '@openimis/fe-core'; | ||
import PayrollPaymentFilesSearcher from '../PayrollPaymentFilesSearcher'; | ||
import { MODULE_NAME } from '../../../constants'; | ||
|
||
function PayrollReconciliationFilesDialog({ | ||
payroll, classes, | ||
}) { | ||
const modulesManager = useModulesManager(); | ||
const rights = useSelector((state) => state.core?.user?.i_user?.rights ?? []); | ||
const { formatMessage } = useTranslations(MODULE_NAME, modulesManager); | ||
const [isOpen, setIsOpen] = useState(false); | ||
|
||
const handleClose = () => { | ||
setIsOpen(false); | ||
}; | ||
|
||
const handleOpen = () => { | ||
setIsOpen(true); | ||
}; | ||
|
||
return ( | ||
<> | ||
<Button | ||
onClick={handleOpen} | ||
variant="contained" | ||
color="primary" | ||
className={classes.button} | ||
> | ||
{formatMessage('payroll.viewReconciliationFiles')} | ||
</Button> | ||
<Dialog | ||
open={isOpen} | ||
onClose={handleClose} | ||
PaperProps={{ | ||
style: { | ||
width: 600, | ||
maxWidth: 1000, | ||
}, | ||
}} | ||
> | ||
<form noValidate> | ||
<DialogContent> | ||
<PayrollPaymentFilesSearcher | ||
module="payroll" | ||
payrollUuid={payroll?.id} | ||
rights={rights} | ||
showFilters={false} | ||
/> | ||
</DialogContent> | ||
<DialogActions | ||
style={{ | ||
display: 'inline', | ||
paddingLeft: '10px', | ||
marginTop: '25px', | ||
marginBottom: '15px', | ||
}} | ||
> | ||
<div style={{ maxWidth: '1000px' }}> | ||
<div style={{ float: 'right' }}> | ||
<Button | ||
onClick={handleClose} | ||
variant="outlined" | ||
autoFocus | ||
style={{ | ||
margin: '0 16px', | ||
marginBottom: '15px', | ||
}} | ||
> | ||
{formatMessage('payroll.summary.close')} | ||
</Button> | ||
</div> | ||
</div> | ||
</DialogActions> | ||
</form> | ||
</Dialog> | ||
</> | ||
); | ||
} | ||
|
||
export default PayrollReconciliationFilesDialog; |