{{define "content"}} {{$d := .}}

Monthly Reports

12-Month Spend by Category

Breakdown by Month

{{range $cat, $_ := $d.CategoryNames}} {{$color := index $d.CategoryColors $cat}} {{end}} {{range $row := $d.MonthlyData}} {{$total := sub 0 0}} {{range $_, $v := $row.Totals}}{{$total = add $total $v}}{{end}} {{range $cat, $_ := $d.CategoryNames}} {{$v := index $row.Totals $cat}} {{end}} {{end}}
Month {{if $color}}{{end}}{{$cat}} Total
{{$row.Month}} {{if $v}}€{{cents $v}}{{else}}{{end}} €{{cents $total}}
{{end}}