Skip to content

Commit

Permalink
feat(manual-payments): Adjust overdue balance query
Browse files Browse the repository at this point in the history
  • Loading branch information
ivannovosad committed Jan 7, 2025
1 parent 0262dcf commit f89e589
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/analytics/overdue_balance.rb
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def query(organization_id, **args)
SELECT
DATE_TRUNC('month', payment_due_date) AS month,
i.currency,
COALESCE(SUM(total_amount_cents), 0) AS total_amount_cents,
COALESCE(SUM(total_amount_cents - total_paid_amount_cents), 0) AS total_amount_cents,
array_agg(DISTINCT i.id) AS ids
FROM invoices i
LEFT JOIN customers c ON i.customer_id = c.id
Expand Down

0 comments on commit f89e589

Please sign in to comment.