You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this task, you will complete the final parts of an invoice, allowing it to be saved, emailed, and backed up to our database.
Generating The Invoice
Generate the invoice using:
- Code found in `client/src/components/invoices/PDFButtonInvoice.jsx` to create the PDF
- The invoice created in `client/src/components/invoices/EditInvoice.jsx`
Use the invoice component, gather all invoice data and generate a PDF of the invoice
Create a new file which contains a function to do this. Do NOT copy the code from the invoice, instead re-use it in a way which allows it to be saved as a PDF. This may need some figuring out, so please reach out early if you need help
Downloading the PDF
Update the outdated client/src/components/invoices/PDFButtonInvoice.jsx to use your new function for downloading the real-pdf when given the ID of the invoice
Use this button to replace the current download button on the /invoices page. Match the Hi-Fi styling
This button is the one on each row which should now download a PDF of the specific invoice
Sending Email With PDF
Update the send email functionality in localhost/invoices/id to send the new PDF as part of the invoice. You may need to trace the current flow for sending emails.
Save PDF to DB
When an email is sent, the corresponding PDF should be saved in its current state to the `historic_invoices` table.
Use the /backupInvoice/id endpoint in server/routes/invoices.js where "id" is the ID of the invoice being backed up
Call this endpoint with the PDF in the body of the request in the field file when the email is sent to clients
You may also need to include a comment, which can be empty
Acceptance Criteria
Generating invoice works
A function has been created to generate an invoice which matches that of the edit invoice
The invoice contains all relevant information
The invoice reuses existing components, and does not create a new rendered view of the invoice
The download PDF button has been updated to use the new PDF, and has been used in the /invoices table
When an email is sent from an invoice dashboard, the new PDF is included as an attachment
When an email is sent with the PDF, the PDF is also backed up to the database using the described endpoint.
NOTE:
You will need to update your .env file. Use this updated env.
The text was updated successfully, but these errors were encountered:
For this task, you will complete the final parts of an invoice, allowing it to be saved, emailed, and backed up to our database.
Generating The Invoice
Generate the invoice using: - Code found in `client/src/components/invoices/PDFButtonInvoice.jsx` to create the PDF - The invoice created in `client/src/components/invoices/EditInvoice.jsx`Downloading the PDF
client/src/components/invoices/PDFButtonInvoice.jsx
to use your new function for downloading the real-pdf when given the ID of the invoice/invoices
page. Match the Hi-Fi stylingSending Email With PDF
localhost/invoices/id
to send the new PDF as part of the invoice. You may need to trace the current flow for sending emails.Save PDF to DB
When an email is sent, the corresponding PDF should be saved in its current state to the `historic_invoices` table./backupInvoice/id
endpoint inserver/routes/invoices.js
where "id" is the ID of the invoice being backed upfile
when the email is sent to clientsAcceptance Criteria
/invoices
tableNOTE:
You will need to update your .env file. Use this updated env.
The text was updated successfully, but these errors were encountered: