[FEATURE] : Add financial summaries to Sent and Received invoice pages

Open
#334 2 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

@Thushara3005 is already working on this.

Since Oct 27, 2026.

  • #364 by @Thushara3005 — closed without merging
  • #365 by @Thushara3005 — closed without merging

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
javascript

Research direction

Start by tracing the existing invoice retrieval, pagination, and token metadata utilities used by the Sent and Received invoice pages. Identify how on-chain status and amounts are exposed, then map how each page scopes invoices and handles loading or errors. Done means both pages show complete, asset-specific summaries that remain consistent across pagination and status changes, with the listed edge cases covered by tests.

Written by the indexing model from the issue text.

Description

enhancement
Feature and its Use Cases

Is your feature request related to a problem?

Currently, users need to inspect invoice records individually to understand their overall financial activity. Calculating paid amounts, outstanding balances, and cancelled invoice totals manually becomes inconvenient when managing many invoices.

Describe the solution you'd like

Add a financial summary section to both the Sent Invoices and Received Invoices pages.

The summary should display:

  • Total number of invoices
  • Number of paid invoices
  • Number of outstanding invoices
  • Number of cancelled invoices
  • Total invoiced amount
  • Total paid amount
  • Total outstanding amount
  • Total cancelled amount, where reliably calculable

Financial summaries should cover the complete supported invoice dataset, not just the rows visible on the current pagination page.

Functional requirements

1. Invoice status classification

Use authoritative on-chain invoice status:

  • Paid: The invoice is paid and not cancelled.
  • Outstanding: The invoice is neither paid nor cancelled.
  • Cancelled: The invoice is cancelled, regardless of its paid flag if the data is inconsistent.

Cancelled invoices must not be included in outstanding totals.

2. Accurate financial calculations
  • Use on-chain invoice amounts and statuses as the source of truth wherever available.
  • Group totals by chain ID and normalized token address.
  • Never combine different tokens or chains into one monetary total.
  • Use BigInt or equivalent integer-safe arithmetic for token base units.
  • Use validated token decimals when formatting amounts.
  • Do not silently treat missing token metadata or invalid values as zero.
3. Pagination and performance
  • Calculate totals across all invoices in the supported scope.
  • Reuse the existing invoice retrieval and pagination mechanisms.
  • Avoid unnecessary repeated requests or loading the same data multiple times.
  • Ensure that switching pagination pages does not change the overall totals.
4. UI states and updates
  • Display loading and error states when invoice data is unavailable.
  • Do not present partial calculations as complete totals.
  • Update summaries when invoices are paid, cancelled, or otherwise changed.
  • Keep Sent and Received summaries consistent with their respective invoice lists and supported network scope.

Expected behavior

When a user opens either invoice page, Chainvoice displays the invoice counts and asset-specific financial totals. The figures remain consistent across pagination changes and update when the underlying invoice state changes.

If required data is unavailable, the interface should clearly indicate that the relevant amount cannot be calculated.

Acceptance criteria

  • Summary metrics are available on both Sent and Received pages.
  • Counts and totals include all invoices in the supported scope.
  • Pagination does not restrict summaries to the current page.
  • Paid, outstanding, and cancelled invoices are classified correctly.
  • Totals are separated by chain and token address.
  • Token arithmetic and decimal formatting are accurate.
  • Missing metadata and retrieval failures are handled safely.
  • Summaries update when invoice statuses change.
  • Tests cover pagination, multiple tokens, differing decimals, cancellation, and error states.

Implementation notes

Reuse existing contract interfaces, invoice retrieval logic, pagination, and token metadata utilities wherever possible. This feature should not require smart-contract changes unless a clear technical limitation makes them necessary.

Additional Context

This feature would improve invoice visibility, reduce manual calculations, and provide users with a clearer overview of their payment activity.

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.