Skip to content

Commit

Permalink
Exclude accounts from reports
Browse files Browse the repository at this point in the history
  • Loading branch information
howeyc committed Oct 6, 2015
1 parent a9a22df commit 3879bdf
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/cmd/lweb/handler_report.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,14 @@ func ReportHandler(w http.ResponseWriter, r *http.Request, params martini.Params
accName := account.Name[accStartLen+1:]
value, _ := account.Balance.Float64()

if !strings.Contains(accName, ":") {
include := true
for _, excludeName := range rConf.Exclude {
if strings.Contains(accName, excludeName) {
include = false
}
}

if include && !strings.Contains(accName, ":") {
values = append(values, reportAccount{Name: accName, Balance: value,
Color: colorlist[colorIdx].Color,
Highlight: colorlist[colorIdx].Highlight})
Expand Down
1 change: 1 addition & 0 deletions src/cmd/lweb/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ type reportConfig struct {
DateRange string `toml:"date_range"`
DateFreq string `toml:"date_freq"`
Accounts []string
Exclude []string `toml:"exclude"`
}

var reportConfigData struct {
Expand Down

0 comments on commit 3879bdf

Please sign in to comment.