got transactions into rows in transactions.html, now gotta fix column with for description then go for editable
All checks were successful
cicd / ci (push) Successful in 55s

This commit is contained in:
Bel LaPointe
2024-07-20 11:40:06 -06:00
parent 8886442e89
commit 2ce78d2b42
2 changed files with 30 additions and 19 deletions

View File

@@ -94,16 +94,18 @@ func (router Router) APITransactions(w http.ResponseWriter, r *http.Request) {
houseRelatedDeltas := deltas.Like(ledger.LikeTransactions(
deltas.Like(ledger.LikeName(`^House`))...,
))
sixMonths := time.Hour * 24 * 365 / 2
recent := time.Hour * 24 * 365 / 6
json.NewEncoder(w).Encode(map[string]any{
"deltas": houseRelatedDeltas.
Like(ledger.LikeAfter(time.Now().Add(-1 * sixMonths).Format("2006-01"))),
Like(ledger.LikeAfter(time.Now().Add(-1 * recent).Format("2006-01"))),
"balances": houseRelatedDeltas.Balances().
Like(`^(Zach|Bel|House[^:]*:Debts:)`).
Group(`^[^:]*`).
WithBPIs(bpis),
"transactions": houseRelatedDeltas.Transactions(),
"transactions": houseRelatedDeltas.
Like(ledger.LikeAfter(time.Now().Add(-1 * recent).Format("2006-01"))).
Transactions(),
})
}