f3d25952cc
max(...[]) throws ArgumentCountError. Split the intermediate array and only call max() when it has elements. Fixes /app/finance 500 on tenants with no payments in the current period. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>