summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÖzgür Kesim <oec@kesim.org>2024-11-27 18:05:16 +0100
committerÖzgür Kesim <oec@kesim.org>2024-11-27 18:05:16 +0100
commit43e5471fdbf91b0028c496f8e01091b2d1ad8189 (patch)
treef36aefdf7dba51f1187208b555de947b7b4910b1
parentc86dfbfcee69062c3bd036a5070a6e62fb11e06c (diff)
seperate out overview
-rw-r--r--templates/overview.t21
-rw-r--r--templates/report.t41
2 files changed, 34 insertions, 28 deletions
diff --git a/templates/overview.t b/templates/overview.t
new file mode 100644
index 0000000..caff0cb
--- /dev/null
+++ b/templates/overview.t
@@ -0,0 +1,21 @@
+{{ range $id, $wp := .Workpackages -}}
+## Workpackage {{ $id }}: {{ $wp.Title }}
+{{ range $tid, $task := $wp.Tasks }}
+ {{$task.ID}}: {{ $task.Title }}
+ Budget: {{ $task.Budget.AsMonth }}
+{{ end }}
+
+{{ end }}
+
+| Date | Time | WP's |
+|:-----------|---------:|:--------:|
+{{- range $d, $e := .Timeline }}
+| {{ $d }} | {{ printf "%8s" $e.Total }} | {{ printf "%8s" $e.WPs }} |
+{{- end }}
+{{- $tl := .Timeline }}{{- $hd := .Holidays }}
+
+# Days
+{{ range .Days 2024 03 }}
+{{if or .IsWeekend .IsHoliday }}# {{end}}{{.Date}}{{ if .IsHoliday}} ({{ index $hd .Date}}){{end -}}
+{{ with .Planned }} Planned: {{ .Total }}{{ end }}{{ with .Worked }} Worked: {{ .Total }}{{end}}
+{{- end }} \ No newline at end of file
diff --git a/templates/report.t b/templates/report.t
index 08f4f43..d89b921 100644
--- a/templates/report.t
+++ b/templates/report.t
@@ -2,34 +2,19 @@ Project: {{.Name}}
Grant: {{.Grant}}
Start: {{.Start}}
End: {{.End}}
-Beneficiary: {{.Beneficiary}}
+Beneficiary: {{.Beneficiary}}{{- $p := .}}
-
-{{ range $wp, $t := .Totals }}
+# Planing
+{{range $wp, $t := .Totals }}
Total for {{ $wp }}:
- - Budgeted: {{ printf "%8s" $t.Budgeted.AsDay }}
- - Planned: {{ printf "%8s" $t.Planned.AsDay }}{{with $t.Unaccounted }} Unaccounted: {{.AsDay}}{{end}}
- - Actual: {{ printf "%8s" $t.Actual.AsDay }}
-{{ end }}
-
-{{ range $id, $wp := .Workpackages -}}
-## Workpackage {{ $id }}: {{ $wp.Title }}
-{{ range $tid, $task := $wp.Tasks }}
- {{$task.ID}}: {{ $task.Title }}
- Budget: {{ $task.Budget.AsMonth }}
+ - Budgeted: {{ printf "%8s" $t.Budgeted.AsDay }}
+ - Planned: {{ printf "%8s" $t.Planned.AsDay }}{{with $t.Unaccounted }} !Unaccounted: {{.AsDay}}{{end}}
+ - Actual: {{ printf "%8s" $t.Actual.AsDay }}
+ - Per Task:
+ {{- range $n, $t := (index $p.Workpackages $wp).Tasks }}
+ - {{ $t.ID }} ({{ $n }}):{{ $tt := $p.TotalWPTask $wp $n }}
+ - Budgeted: {{ printf "%8s" $tt.Budgeted.AsDay }}
+ - Planned: {{ printf "%8s" $tt.Planned.AsDay }}{{with $tt.Unaccounted }} !Unaccounted: {{.AsDay}}{{end}}
+ - Actual: {{ printf "%8s" $tt.Actual.AsDay }}
+ {{ end }}
{{ end }}
-
-{{ end }}
-
-| Date | Time | WP's |
-|:-----------|---------:|:--------:|
-{{- range $d, $e := .Timeline }}
-| {{ $d }} | {{ printf "%8s" $e.Total }} | {{ printf "%8s" $e.WPs }} |
-{{- end }}
-{{- $tl := .Timeline }}{{- $hd := .Holidays }}
-
-# Days
-{{ range .Days 2024 03 }}
-{{if or .IsWeekend .IsHoliday }}# {{end}}{{.Date}}{{ if .IsHoliday}} ({{ index $hd .Date}}){{end -}}
-{{ with .Planned }} Planned: {{ .Total }}{{ end }}{{ with .Worked }} Worked: {{ .Total }}{{end}}
-{{- end }}