Skip to content

Commit

Permalink
Merge pull request #354 from ZIMkaRU/feature/move-statement-details-s…
Browse files Browse the repository at this point in the history
…ection-under-logo-for-pdf-reports

Move statement details section under logo for pdf reports
  • Loading branch information
ezewer authored Mar 4, 2024
2 parents 2a9db00 + 5a75078 commit 3ce20da
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 7 deletions.
14 changes: 13 additions & 1 deletion workers/loc.api/generate-report-file/pdf-writer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@ class PdfWriter extends MainPdfWriter {
const {
template = 'No data',
format = 'portrait',
orientation = 'Letter'
orientation = 'Letter',
headerHeight = '65mm',
footerHeight = '28mm'
} = args ?? {}

if (this.isElectronjsEnv) {
Expand All @@ -72,8 +74,18 @@ class PdfWriter extends MainPdfWriter {
})
}

const headerOpt = headerHeight
? { header: { height: headerHeight } }
: {}
const footerOpt = footerHeight
? { footer: { height: footerHeight } }
: {}

return await new Promise((resolve, reject) => {
pdf.create(template, {
...headerOpt,
...footerOpt,

format,
orientation,
type: 'pdf',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ block content
:translate(prop='template.positions')
Positions
ul.responsive-table.sm.no-margin-bottom
ul.responsive-table.no-margin-bottom
li.table-header
each columnVal, columnKey in reportColumns.positionsSnapshot
.col #{columnVal}
Expand All @@ -27,7 +27,7 @@ block content
each columnVal, columnKey in reportColumns.positionsSnapshot
.col #{dataItem[columnKey]}
ul.responsive-table.sm.width-by-content
ul.responsive-table.width-by-content
li.table-header
each columnVal, columnKey in reportColumns.positionsTotalPlUsd
.col #{columnVal}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ block content
:translate(prop='template.startingPositionsSnapshot')
Starting positions snapshot
ul.responsive-table.sm
ul.responsive-table
li.table-header
each columnVal, columnKey in reportColumns.positionsSnapshot
.col #{columnVal}
Expand All @@ -28,7 +28,7 @@ block content
:translate(prop='template.endingPositionsSnapshot')
Ending positions snapshot

ul.responsive-table.sm
ul.responsive-table
li.table-header
each columnVal, columnKey in reportColumns.positionsSnapshot
.col #{columnVal}
Expand Down Expand Up @@ -57,7 +57,7 @@ block content
:translate(prop='template.movementsDetails')
Movements details

ul.responsive-table.sm.no-margin-bottom
ul.responsive-table.no-margin-bottom
li.table-header
each columnVal, columnKey in reportColumns.movements
.col #{columnVal}
Expand All @@ -66,7 +66,7 @@ block content
each columnVal, columnKey in reportColumns.movements
.col #{dataItem[columnKey]}

ul.responsive-table.sm.width-by-content
ul.responsive-table.width-by-content
li.table-header
each columnVal, columnKey in reportColumns.movementsTotalAmount
.col #{columnVal}
Expand Down

0 comments on commit 3ce20da

Please sign in to comment.