From f40e4fdb2e309e8fbf7efbc595b57444b5d11609 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Wed, 21 Jun 2023 09:47:23 +0200 Subject: [PATCH] Fix passing company ID to expenses chart query By mistake, i was using 1 instead of $1, but i all was OK in testing because there is only a single company with ID = 1. --- pkg/dashboard.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/dashboard.go b/pkg/dashboard.go index bde7ae5..cb0d639 100644 --- a/pkg/dashboard.go +++ b/pkg/dashboard.go @@ -203,7 +203,7 @@ func buildDashboardChart(ctx context.Context, conn *Conn, locale *Locale, compan select to_char(date.invoice_date, '%[3]s')::integer as date , sum(amount)::integer as total from generate_series(%[1]s, %[2]s, interval '1 day') as date(invoice_date) - left join expense on expense.invoice_date = date.invoice_date and company_id = 1 + left join expense on expense.invoice_date = date.invoice_date and company_id = $1 group by date ) as expense using (date) order by date