Also fetch GroupID and highlight groups in transactions-view
This commit is contained in:
parent
b0776023b4
commit
a147830e12
@ -23,7 +23,7 @@ DELETE FROM transactions
|
||||
WHERE id = $1;
|
||||
|
||||
-- name: GetTransactionsForBudget :many
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount,
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount, transactions.group_id,
|
||||
accounts.name as account, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category
|
||||
FROM transactions
|
||||
INNER JOIN accounts ON accounts.id = transactions.account_id
|
||||
@ -35,7 +35,7 @@ ORDER BY transactions.date DESC
|
||||
LIMIT 200;
|
||||
|
||||
-- name: GetTransactionsForAccount :many
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount,
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount, transactions.group_id,
|
||||
accounts.name as account, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category
|
||||
FROM transactions
|
||||
INNER JOIN accounts ON accounts.id = transactions.account_id
|
||||
|
@ -132,7 +132,7 @@ func (q *Queries) GetTransactionsByMonthAndCategory(ctx context.Context, budgetI
|
||||
}
|
||||
|
||||
const getTransactionsForAccount = `-- name: GetTransactionsForAccount :many
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount,
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount, transactions.group_id,
|
||||
accounts.name as account, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category
|
||||
FROM transactions
|
||||
INNER JOIN accounts ON accounts.id = transactions.account_id
|
||||
@ -149,6 +149,7 @@ type GetTransactionsForAccountRow struct {
|
||||
Date time.Time
|
||||
Memo string
|
||||
Amount Numeric
|
||||
GroupID uuid.NullUUID
|
||||
Account string
|
||||
Payee string
|
||||
CategoryGroup string
|
||||
@ -169,6 +170,7 @@ func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.
|
||||
&i.Date,
|
||||
&i.Memo,
|
||||
&i.Amount,
|
||||
&i.GroupID,
|
||||
&i.Account,
|
||||
&i.Payee,
|
||||
&i.CategoryGroup,
|
||||
@ -188,7 +190,7 @@ func (q *Queries) GetTransactionsForAccount(ctx context.Context, accountID uuid.
|
||||
}
|
||||
|
||||
const getTransactionsForBudget = `-- name: GetTransactionsForBudget :many
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount,
|
||||
SELECT transactions.id, transactions.date, transactions.memo, transactions.amount, transactions.group_id,
|
||||
accounts.name as account, COALESCE(payees.name, '') as payee, COALESCE(category_groups.name, '') as category_group, COALESCE(categories.name, '') as category
|
||||
FROM transactions
|
||||
INNER JOIN accounts ON accounts.id = transactions.account_id
|
||||
@ -205,6 +207,7 @@ type GetTransactionsForBudgetRow struct {
|
||||
Date time.Time
|
||||
Memo string
|
||||
Amount Numeric
|
||||
GroupID uuid.NullUUID
|
||||
Account string
|
||||
Payee string
|
||||
CategoryGroup string
|
||||
@ -225,6 +228,7 @@ func (q *Queries) GetTransactionsForBudget(ctx context.Context, budgetID uuid.UU
|
||||
&i.Date,
|
||||
&i.Memo,
|
||||
&i.Amount,
|
||||
&i.GroupID,
|
||||
&i.Account,
|
||||
&i.Payee,
|
||||
&i.CategoryGroup,
|
||||
|
@ -26,6 +26,9 @@
|
||||
{{.CategoryGroup}} : {{.Category}}
|
||||
{{end}}
|
||||
</td>
|
||||
<td>
|
||||
{{if .GroupID.Valid}}☀{{end}}
|
||||
</td>
|
||||
<td>
|
||||
<a href="/budget/{{$.Budget.ID}}/transaction/{{.ID}}">{{.Memo}}</a>
|
||||
</td>
|
||||
|
Loading…
x
Reference in New Issue
Block a user