| @@ -419,54 +419,54 @@ const InvoiceSearch: React.FC<Props> = ({ invoices, projects, abilities }) => { | |||||
| ); | ); | ||||
| const isAddInvoiceRightExist = () => { | const isAddInvoiceRightExist = () => { | ||||
| const importRight = [IMPORT_INVOICE].some((ability) => abilities.includes(ability)) | |||||
| return importRight | |||||
| } | |||||
| const isAddReciptRightExist = () => { | |||||
| const importRight = [IMPORT_RECEIPT].some((ability) => abilities.includes(ability)) | |||||
| const importRight = [IMPORT_INVOICE, IMPORT_RECEIPT].some((ability) => abilities.includes(ability)) | |||||
| return importRight | return importRight | ||||
| } | } | ||||
| return ( | return ( | ||||
| <> | <> | ||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="right" | |||||
| flexWrap="wrap" | |||||
| spacing={2} | |||||
| > | |||||
| <ButtonGroup variant="contained"> | |||||
| <Button | |||||
| startIcon={<AddIcon />} | |||||
| variant="outlined" | |||||
| component="label" | |||||
| onClick={handleAddInvoiceClick} | |||||
| > | |||||
| {t("Create Invoice")} | |||||
| </Button> | |||||
| <Button startIcon={<FileUploadIcon />} variant="contained" component="label"> | |||||
| { | |||||
| isAddInvoiceRightExist() && | |||||
| <Stack | |||||
| direction="row" | |||||
| justifyContent="right" | |||||
| flexWrap="wrap" | |||||
| spacing={2} | |||||
| > | |||||
| <ButtonGroup variant="contained"> | |||||
| <Button | |||||
| startIcon={<AddIcon />} | |||||
| variant="outlined" | |||||
| component="label" | |||||
| onClick={handleAddInvoiceClick} | |||||
| > | |||||
| {t("Create Invoice")} | |||||
| </Button> | |||||
| <Button startIcon={<FileUploadIcon />} variant="contained" component="label"> | |||||
| <input | |||||
| id='importExcel' | |||||
| type='file' | |||||
| accept='.xlsx, .csv' | |||||
| hidden | |||||
| onChange={(event) => {handleImportClick(event)}} | |||||
| /> | |||||
| {t("Import Invoice Issue Summary")} | |||||
| </Button> | |||||
| <Button startIcon={<FileUploadIcon />} component="label" variant="contained"> | |||||
| <input | <input | ||||
| id='importExcel' | |||||
| type='file' | |||||
| accept='.xlsx, .csv' | |||||
| hidden | |||||
| onChange={(event) => {handleImportClick(event)}} | |||||
| /> | |||||
| {t("Import Invoice Issue Summary")} | |||||
| </Button> | |||||
| <Button startIcon={<FileUploadIcon />} component="label" variant="contained"> | |||||
| <input | |||||
| id='importExcel' | |||||
| type='file' | |||||
| accept='.xlsx, .csv' | |||||
| hidden | |||||
| onChange={(event) => {handleRecImportClick(event)}} | |||||
| /> | |||||
| {t("Import Invoice Amount Receive Summary")} | |||||
| </Button> | |||||
| </ButtonGroup> | |||||
| </Stack> | |||||
| id='importExcel' | |||||
| type='file' | |||||
| accept='.xlsx, .csv' | |||||
| hidden | |||||
| onChange={(event) => {handleRecImportClick(event)}} | |||||
| /> | |||||
| {t("Import Invoice Amount Receive Summary")} | |||||
| </Button> | |||||
| </ButtonGroup> | |||||
| </Stack> | |||||
| } | |||||
| { | { | ||||
| // tabIndex == 0 && | // tabIndex == 0 && | ||||
| <SearchBox | <SearchBox | ||||