fix(accounting): connection centre 500'd under only_full_group_by
The stream list used LEFT JOIN revenue_posting_rules + GROUP BY s.id and selected
r.id / r.stage. MySQL rejects that under only_full_group_by — r.id is not
functionally dependent on s.id — so the page threw PDOException on every load.
Caught by running the query against the live database rather than trusting that
it looked reasonable.
The representative rule is now picked in its own aggregate and joined back by id,
preferring the collection stage since that is the one people mean by "where does
this money go", then the newest effective date and version.
Co-Authored-By:
Claude Opus 5 (1M context) <noreply@anthropic.com>
Showing
Please register or sign in to comment