From 4a0759af8f01425ef056b5f2456216df2ef4c5a0 Mon Sep 17 00:00:00 2001 From: Jan Bader Date: Tue, 7 Dec 2021 13:45:08 +0000 Subject: [PATCH] Sort categories and add link to current month --- postgres/categories.sql.go | 1 + postgres/queries/categories.sql | 3 ++- web/budgeting.html | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/postgres/categories.sql.go b/postgres/categories.sql.go index 395ac2d..21104f0 100644 --- a/postgres/categories.sql.go +++ b/postgres/categories.sql.go @@ -111,6 +111,7 @@ FROM categories INNER JOIN category_groups ON categories.category_group_id = category_groups.id WHERE category_groups.budget_id = $3 GROUP BY categories.id, categories.name, category_groups.name +ORDER BY category_groups.name, categories.name ` type GetCategoriesWithBalanceParams struct { diff --git a/postgres/queries/categories.sql b/postgres/queries/categories.sql index 9d03541..22460fb 100644 --- a/postgres/queries/categories.sql +++ b/postgres/queries/categories.sql @@ -40,4 +40,5 @@ SELECT categories.id, categories.name, category_groups.name as group, FROM categories INNER JOIN category_groups ON categories.category_group_id = category_groups.id WHERE category_groups.budget_id = @budget_id -GROUP BY categories.id, categories.name, category_groups.name; \ No newline at end of file +GROUP BY categories.id, categories.name, category_groups.name +ORDER BY category_groups.name, categories.name; \ No newline at end of file diff --git a/web/budgeting.html b/web/budgeting.html index 94249f0..ea84b95 100644 --- a/web/budgeting.html +++ b/web/budgeting.html @@ -15,7 +15,8 @@
- Previous Month + Previous Month - + Current Month - Next Month