Skip to content

[FEATURE]: Bulk Export Multiple Invoices (CSV / JSON / PDF) with Single File & Separate Files Option #162

@Atharva0506

Description

@Atharva0506

Problem

Currently, Chainvoice supports exporting a single invoice at a time (CSV/JSON/PDF from the invoice detail drawer), implemented in #136 and shipped in PR #138. There is no way to bulk export multiple invoices at once from the main invoices list page.

Businesses using Chainvoice need bulk export capabilities for:

  • Exporting monthly/quarterly invoice batches for accounting software (QuickBooks, Xero, Wave)
  • Tax filing and audits requiring all invoices in a period
  • Data reconciliation across multiple transactions
  • Bookkeeping automation pipelines

Exporting invoices one by one when dealing with dozens or hundreds of records is impractical and defeats the purpose of a decentralized, automated invoicing platform.

Discord thread: https://discord.com/channels/995968619034984528/1328282666335993856/1480964370069717063

The first PR (#138) has since been merged, and this issue is the agreed follow-up for part 2.

Proposed Solution

Add bulk export support on the Sent Invoices and Received Invoices list pages, allowing users to select multiple invoices and export them in CSV, JSON, or PDF format.

Export Formats

Format Description
CSV All selected invoices in a single .csv file, one row per invoice
JSON Array of invoice objects exported as a single .json file
PDF Selected invoices as a multi-page .pdf (one invoice per page)

User Choice: Single File vs. Separate Files

Users should be able to decide how their invoices are packaged on export:

Option A — All in One File (default)

  • CSV: single file, one row per invoice
  • JSON: single file, array of all selected invoice objects
  • PDF: single multi-page PDF, one invoice per page

Option B — Separate Files per Invoice

  • Each selected invoice is exported as its own individual file
  • Files are bundled and downloaded as a .zip archive
  • Naming convention: invoice-<id>-<date>.csv / .json / .pdf

A simple toggle or radio group in the export modal (e.g. "Export as: Single file / Separate files (ZIP)") can handle this UX cleanly.

Implementation Approach

  • Add checkboxes to each invoice row on the list page for selection
  • Add a toolbar that appears when invoices are selected, with an Export Selected button (matching the pattern already introduced in PR feat: implement Export Invoice to JSON/CSV #138)
  • Extend existing utilities from PR feat: implement Export Invoice to JSON/CSV #138:
    • frontend/src/utils/generateInvoiceCSV.js — accept array of invoices
    • frontend/src/utils/generateInvoiceJSON.js — accept array of invoices
    • frontend/src/utils/generateInvoicePDF.js — batch multi-page PDF generation
    • frontend/src/utils/invoiceExportHelpers.js — add ZIP bundling helper for separate-file option
  • Use Blob + URL.createObjectURL() for client-side downloads (no backend needed)
  • Use a lightweight ZIP library (e.g. jszip) for the separate-files option
  • Only already-decrypted (visible) invoice data is exported — no additional Lit Protocol calls needed
  • Show success/error toasts consistent with the export UX introduced in PR feat: implement Export Invoice to JSON/CSV #138

Why This Matters

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions