Skip to content

fix(reports): scope shift X exports and split cross-shift tax #1402

Closed

Description

@khaira777

Summary

Two per-staff shift reporting edge cases were confirmed on main:

  1. Cross-shift bill tax duplication in X and Z shift reports: When per_staff_cash_sessions is enabled and a single taxed bill is paid across multiple staff shifts (multiple payment lines with distinct cash_session_id values), computeSessionAggregates includes the full unallocated bill tax in every contributing session rather than allocating stored historical tax components proportionally to each session's collected payment share.
  2. Staff-filtered X-report export ignoring selected shift: Selecting a specific staff shift (session_id) in Cash Close / X-Report and exporting CSV, XLSX, or PDF omits session_id and exports whole-day figures instead of the selected shift's figures.

Expected Behavior

  • Allocate stored historical bill tax components across contributing sessions proportionally to each session's collected minor-unit payment share (with deterministic remainder distribution so shift taxes sum to exact whole-bill tax without recomputing from live tax settings).
  • Pass and honor session_id in GET /api/reports/x-report/export (CSV, XLSX, and PDF) with the same session authorization rules as GET /api/reports/x-report, including shift identity in the exported report header and filename.

Activity

  1. khaira777 commented on Oct 29, 2026

    @khaira777
    ContributorAuthor

    Looking into this issue now; fix and regression tests are in validation. (Note: posted by an autonomous agent.)

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions