-
Notifications
You must be signed in to change notification settings - Fork 370
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: [M3-7008] - Invoice and Payment id
wrapping in generated PDFs
#9702
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,6 +44,7 @@ const formatDateForTable = ( | |
export const createPaymentsTable = ( | ||
doc: JSPDF, | ||
payment: Payment, | ||
startY: number, | ||
timezone?: string | ||
) => { | ||
autoTable(doc, { | ||
|
@@ -63,7 +64,7 @@ export const createPaymentsTable = ( | |
headStyles: { | ||
fillColor: '#444444', | ||
}, | ||
startY: 165, | ||
startY, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good choice, the dynamic value definitely improves the table's aesthetic. |
||
styles: { | ||
lineWidth: 1, | ||
}, | ||
|
@@ -95,6 +96,10 @@ interface CreateInvoiceItemsTableOptions { | |
* Used to add Region labels to the `Region` column | ||
*/ | ||
regions: Region[]; | ||
/** | ||
* The start position of the table on the Y axis | ||
*/ | ||
startY: number; | ||
timezone?: string; | ||
} | ||
|
||
|
@@ -104,7 +109,7 @@ interface CreateInvoiceItemsTableOptions { | |
export const createInvoiceItemsTable = ( | ||
options: CreateInvoiceItemsTableOptions | ||
) => { | ||
const { doc, flags, items, regions, timezone } = options; | ||
const { doc, flags, items, regions, timezone, startY } = options; | ||
|
||
autoTable(doc, { | ||
body: items.map((item) => { | ||
|
@@ -182,7 +187,7 @@ export const createInvoiceItemsTable = ( | |
headStyles: { | ||
fillColor: '#444444', | ||
}, | ||
startY: 165, | ||
startY, | ||
styles: { | ||
lineWidth: 1, | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed
4
to12
to match the payment PDFs. It helps make the PDF a bit more readable (see before and after photos above).