Skip to content
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

[Bug]: Bug in Mozilla PDF.js: Quantity Selection Updates Total for All Rows Instead of a Single Row #18536

Closed
paritosh-mahale opened this issue Aug 1, 2024 · 3 comments · Fixed by #18552
Assignees
Labels

Comments

@paritosh-mahale
Copy link

paritosh-mahale commented Aug 1, 2024

Attach (recommended) or Link to PDF file

Please find document calculation-issue.pdf

I am encountering an issue while using the Mozilla PDF.js library to render PDFs on my webpage. The PDF includes several input fields and formulas. There is a specific problem with the calculation of totals based on the quantity selected from a dropdown menu in the "QTY" column.

Here is a screenshot demonstrating the issue. The total for each row is recalculated incorrectly when the quantity in any row is changed.

iii

Web browser and its version

firefox 127.0

Operating system and its version

Linux

PDF.js version

v4.5.136

Is the bug present in the latest PDF.js version?

Yes

Is a browser extension

No

Steps to reproduce the problem

  1. Render the PDF using Mozilla PDF.js on a webpage.
  2. The PDF contains a column labeled "QTY" with a dropdown to select the quantity.
  3. Selecting a quantity value triggers a formula to calculate the total for that row (Total = QTY * Price per).
  4. The expectation is that the total calculation should only affect the row where the quantity was changed.

What is the expected behavior?

When a quantity is selected from the dropdown in the "QTY" column, the total should be calculated only for the corresponding row.

What went wrong?

Changing the quantity in the dropdown causes the total to be recalculated for all rows in the PDF, leading to an incorrect grand total.

Link to a viewer

No response

Additional context

No response

@calixteman calixteman self-assigned this Aug 1, 2024
@calixteman
Copy link
Contributor

Thank you for this bug report :)

@Snuffleupagus
Copy link
Collaborator

Please find document calculation-issue.pdf

To avoid having to hunt around for it, that line should be placed immediately after Attach (recommended) or Link to PDF file.

@paritosh-mahale

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants