Skip to content

feat(reports): date-range daily sales export with per-tax-rate summary for accountants #1335

Open

Description

@khaira777

Parent: #830 (S1 accountant export). Verified against main @ 8e39053.

Problem

Accountants want one file per month or period. Today owners have to download one business day at a time.

Current behavior (verified)

Decisions (made)

  • Add from / to business-date parameters (inclusive, store timezone, business-day cutoff respected), capped at 93 days per request so memory stays bounded.
  • Keep the existing single-day call working unchanged (date=).
  • Add a per-tax-rate summary sheet: taxable base, tax and gross per rate per day. This is what accountants file from.

Scope

  • main/services/daily-sales-export.ts, daily-sales-export-files.ts, the route in reports.ts, and the date-range picker in the dashboard export UI.
  • Update docs/reference/daily-sales-export.md in the same PR (replace the "one day" limitation).

Out of scope: accounting-software specific formats (Tally, QuickBooks, Xero) and tips (#364).

Acceptance criteria

  • A range export over N days equals the sum of N single-day exports (orders, payments, tax).
  • Ranges over 93 days, or with to < from, return 400 with a clear message.
  • The tax summary sheet totals equal the tax totals of the orders sheet.
  • CSV parts and xlsx sheets are consistent.

Verification

  • tests/daily-sales-export.test.ts: add range equivalence, cutoff boundary and cap tests.
  • npm run lint && npm test

Activity

  1. added
    enhancementNew feature or request
    area:backendBackend (Express/SQLite)
    type:featureNew capability or enhancement request
    state:readyScoped and ready for implementation
    on Oct 23, 2026
  2. khaira777 commented on Oct 27, 2026

    @khaira777
    ContributorAuthor

    Looking into this issue now.

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

    area:backendBackend (Express/SQLite)area:frontendFrontend (React/Next.js)enhancementNew feature or requeststate:readyScoped and ready for implementationtype:featureNew capability or enhancement request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions