Skip to content

Conversation

@codisfy
Copy link

@codisfy codisfy commented Dec 17, 2025

What the change is

This PR fixes a bug where the "Hide Group Amounts" filter option in Account Reports (Balance Sheet, Profit & Loss, Trial Balance, General Ledger) was not being respected during CSV and JSON exports. When this option was enabled in the report UI, group account balances were correctly hidden from display, but the export functionality would still include the raw values in the exported file.

The fix ensures that:

When "Hide Group Amounts" is enabled and a report is exported to CSV or JSON, group rows will have empty values for balance columns instead of exporting the underlying numerical amounts
The exported data now matches what the user sees in the UI, providing consistency between display and export
Both CSV and JSON export formats are updated to respect this setting

How it works

The export functions in commonExporter.ts were previously using the rawValue property of report cells for all exports, ignoring the display value that already had the hideGroupAmounts logic applied.

The fix adds a check: if a cell's display value is empty (indicating hideGroupAmounts was applied) and it's a group row, the cell is exported as an empty string instead of using the rawValue. This ensures the exported data respects user-configured visibility settings.

Changes made:

Updated convertReportToCSVMatrix() function - CSV exports now check if a group row has an empty display value and export accordingly
Updated getJsonData() function - JSON exports now apply the same logic for consistency

Testing notes
This is a straightforward behavioral fix that makes exports consistent with the UI display. The change is minimal and focused on the specific issue. Manual testing can be performed by:

  • Creating a balance sheet report with parent accounts and sub-accounts
  • Enabling "Hide Group Amounts"
  • Exporting to CSV/JSON
  • Verifying that group account rows are empty in the exported file (matching the UI display)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant