-
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.
ppr purchased and receipts submitted
- Loading branch information
1 parent
224dbe2
commit a7b2ae9
Showing
5 changed files
with
96 additions
and
3 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { Button, Center, Heading, Tooltip, VStack } from '@chakra-ui/react' | ||
import React from 'react' | ||
import { useSetRecoilState } from 'recoil' | ||
import { allTicketsState } from '../../state/atoms' | ||
import { axiosPreset } from '../../axiosConfig' | ||
import { TICKET_ENDPOINTS } from '../../constants' | ||
import { getAllTickets } from '../../utils/globalSetters' | ||
|
||
const PPRReporterTable = ({ currentTicket, supportingDocuments }) => { | ||
const setAllTickets = useSetRecoilState(allTicketsState) | ||
|
||
const transitionToPurchasedAndReceiptsSubmitted = async () => { | ||
const payload = { | ||
status: 'PURCHASED_AND_RECEIPTS_SUBMITTED', | ||
} | ||
await axiosPreset.patch( | ||
`${TICKET_ENDPOINTS.PPR}/${currentTicket._id}`, | ||
payload | ||
) | ||
await getAllTickets(setAllTickets) | ||
} | ||
|
||
return ( | ||
<VStack | ||
border="1px solid black" | ||
borderRadius="8px" | ||
padding="8px" | ||
mb="30px" | ||
> | ||
<Heading size="md">Reporter View</Heading> | ||
<Center pb="7px"> | ||
<Tooltip | ||
hasArrow | ||
label="Please upload at least one supporting document before requesting reimbursement." | ||
isDisabled={supportingDocuments.length !== 0} | ||
> | ||
<Button | ||
colorScheme="blue" | ||
size="sm" | ||
mr="20px" | ||
onClick={transitionToPurchasedAndReceiptsSubmitted} | ||
disabled={supportingDocuments.length === 0} | ||
> | ||
Confirm Item(s) Purchased and Request Reimbursement | ||
</Button> | ||
</Tooltip> | ||
</Center> | ||
</VStack> | ||
) | ||
} | ||
|
||
export default PPRReporterTable |
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