The totals PL/SQL block was generating invalid SQL with duplicate WHERE clauses when bank/cash filters were applied (e.g., "WHERE bank_account=X WHERE dataact IS NULL"). Now properly uses AND when where_clause exists, WHERE otherwise. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>