From 9d00d4746b25c306628320496bb1af12588335f8 Mon Sep 17 00:00:00 2001 From: Max R Date: Sun, 24 May 2026 07:20:05 -0400 Subject: [PATCH] fix: interest query summed inflows with wrong sign Interest is recorded as inflows (positive amount_currency), but the query negated the amount, so totals were negative and failed the HAVING threshold, yielding $0. Use SUM(amount_currency). Co-Authored-By: Claude Opus 4.7 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 546a76b..e45985d 100644 --- a/README.md +++ b/README.md @@ -242,7 +242,7 @@ WITH interest_by_account AS ( SELECT plan_id , account_name - , SUM(-amount_currency) AS total + , SUM(amount_currency) AS total FROM flat_transactions WHERE TRUE