Skip to content

[BUG]: Invoice PDF totals overlap the footer with 10 line items #310

Open

Description

@Thushara3005

Bug Description

The invoice PDF generator does not check whether sufficient page space remains before rendering the totals section. For invoices with 10 short line items, the calculated totals box can extend below the footer separator, causing the separator to cross the totals area.

The issue is in frontend/src/utils/generateInvoicePDF.js.

Technical Details

  • The line-item table starts at approximately y = 142 mm.
  • Each item advances the vertical position by 10 mm.
  • The page-break check runs before drawing each item and only triggers when yPos > 250.
  • After 10 items, yPos reaches approximately 252 mm.
  • The totals section begins around y = 257 mm and its background box extends to y = 285 mm.
  • The footer separator is drawn at y = 280 mm.

Consequently, the footer separator can cross the totals box and the total amount text.

Steps to Reproduce

  1. Run the Chainvoice frontend locally.
  2. Prepare an invoice containing 10 short line items.
  3. Export the invoice as a PDF.
  4. Open the PDF and inspect the totals section near the bottom of the page.
  5. Check whether the footer separator crosses the totals box or total amount.

Expected Behavior

The totals section should remain fully visible and separated from the footer. If insufficient space remains, the generator should move the totals section to a new page or reserve sufficient space before rendering the final line items.

Actual Behavior

Based on the current layout calculations, the totals box can extend to approximately 285 mm, while the footer separator is drawn at 280 mm. This can cause the footer line to overlap the totals area.

Impact

Medium: the exported invoice can look unprofessional, and the footer line can interfere with the readability of the total amount.

Affected File

frontend/src/utils/generateInvoicePDF.js

Suggested Fix

Check the remaining page space before rendering the totals section and add a page break when necessary. Ensure that the totals box and its text remain above the footer separator.

Steps to Reproduce

No response

Logs and Screenshots

No response

Environment Details

No response

Impact

Critical - Application is unusable

Code of Conduct

  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates

Activity

  1. Atharva0506 commented on Oct 21, 2026

    @Atharva0506
    Member

    Thanks. The numbers here come from layout calculations rather than an actual export. Could you export a 10-item invoice from the running app and attach the PDF or a screenshot showing the footer line crossing the totals? Also, the body says Medium but the impact field says Critical; a cosmetic PDF overlap isn't "Application is unusable", so please update it.

  2. Mansi2007275 commented on Oct 23, 2026

    @Mansi2007275
    Contributor

    hi @Atharva0506 i reallly want to work on this ...May i solve this ..

  3. Thushara3005 commented on Oct 23, 2026

    @Thushara3005
    ContributorAuthor

    Hi @Mansi2007275, I have already completed the issue I am just waiting for the approval from @Atharva0506 so I can raise the pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions