diff options
-rw-r--r-- | templates/wp-total.t | 12 | ||||
-rw-r--r-- | zeitgeist.go | 5 |
2 files changed, 17 insertions, 0 deletions
diff --git a/templates/wp-total.t b/templates/wp-total.t new file mode 100644 index 0000000..a5fd93a --- /dev/null +++ b/templates/wp-total.t @@ -0,0 +1,12 @@ +{{ $p := .Project -}} +Total for {{ .WP }}: + - Budgeted: {{ printf "%8s" .Total.Budgeted.AsDay }} + - Planned: {{ printf "%8s" .Total.Planned.AsDay }}{{with .Total.Unaccounted }} !Unaccounted: {{printf "%8s" .AsDay}}{{end}} + - Actual: {{ printf "%8s" .Total.Actual.AsDay }} + - Per Task: +{{- range $n, $t := .Tasks }} + - {{ $t.ID }} ({{ $n }}):{{ $tt := $p.TotalWPTask .WP $t }} + - Budgeted: {{ printf "%8s" $tt.Budgeted.AsDay }} + - Planned: {{ printf "%8s" $tt.Planned.AsDay }}{{with $tt.Unaccounted }} !Unaccounted: {{printf "%8s" .AsDay}}{{end}} + - Actual: {{ printf "%8s" $tt.Actual.AsDay }} +{{ end }} diff --git a/zeitgeist.go b/zeitgeist.go index 64bdc0d..32d8fd6 100644 --- a/zeitgeist.go +++ b/zeitgeist.go @@ -814,6 +814,11 @@ type Totals struct { Actual Amount } +type WPTotals struct { + *Totals + Tasks map[string]*Totals +} + func (t *Totals) Unaccounted() Amount { d := t.Budgeted - t.Planned // TODO: rounding OK!? |