[BUG]: Invoice views and exports show discount/tax without % or token unit, so percentage and flat values look the same

Open
#371 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Atishyy27 is already working on this.

Since Nov 21, 2026.

  • #372 by @Muneerali199 — closed without merging
  • #375 by @Atishyy27 — open

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript
Domain
full-stack

Research direction

Start by locating the invoice preview, sent and received invoice details, and PDF, CSV, JSON, and bulk export code paths that display discount and tax values. Trace how each path gets the value type and invoice token symbol, then check formatting for percentage, fixed, empty, and older invoices without type fields. Done means all listed views and exports show the appropriate unit, with tests covering those cases.

Written by the indexing model from the issue text.

Description

bug
Bug Description
Description

While creating an invoice, we can set discounts and taxes as either a percentage or a fixed amount.

The calculation works correctly, but when we view the invoice or download it, the discount and tax values are displayed without showing whether they are percentages or fixed amounts.

For example, if two items have a discount of 10, one with a percentage discount and the other with a fixed discount, both are displayed as 10. This can be confusing because the actual calculations are different.

This happens in several places:

  • Invoice preview
  • Sent invoice details
  • Received invoice details
  • PDF export
  • CSV export
  • JSON and bulk export
Steps to Reproduce

Create an invoice with two items.
Set the quantity to 1 and price to 200 for both.
Set a discount of 10 for the first item as a percentage.
Set a discount of 10 for the second item as a fixed amount.
Open the invoice preview or download the PDF/CSV.

Logs and Screenshots

No response

Environment Details

Actual Behavior
Both discounts are displayed as 10, even though one is 10% and the other is a fixed amount.

The same issue happens with taxes. Also, when the tax value is empty and its type is a fixed amount, it is still displayed as 0%.

Expected Behavior
The discount and tax should be displayed according to their selected type.

Percentage: 10%
Fixed amount: 10 USDC
Empty percentage: 0%
Empty fixed amount: 0 USDC
The same formatting should be used everywhere, including invoice previews, invoice details, and exports.

Suggested Solution
We can create a shared helper function to format discounts and taxes based on their type and invoice token symbol.

Then we can use that helper wherever these values are displayed.

We should also add unit tests for percentage values, fixed amounts, empty values, and older invoices that don't have discount or tax type fields.

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
Dominant language
JavaScript
Stars
13
Forks
62
Avg merge
2d 14h
Merged PRs (30d)
18

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from StabilityNexus/Chainvoice

All issues in StabilityNexus/Chainvoice

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.