summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@codeblau.de>2024-11-28 14:37:32 +0100
committerÖzgür Kesim <oec@codeblau.de>2024-11-28 14:37:32 +0100
commit0ff7cb7e40c656e545494c62f2349bfd357fd317 (patch)
tree0560b0bbb3d0f03608e430550160dae7f50ce29d
parent2de8fe8b48580852013b87c16c199c6df4a46de9 (diff)
start work on wp-totals
-rw-r--r--templates/wp-total.t12
-rw-r--r--zeitgeist.go5
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!?