summaryrefslogtreecommitdiff
path: root/zeitgeist.go
diff options
context:
space:
mode:
Diffstat (limited to 'zeitgeist.go')
-rw-r--r--zeitgeist.go15
1 files changed, 12 insertions, 3 deletions
diff --git a/zeitgeist.go b/zeitgeist.go
index 32d8fd6..643f0e2 100644
--- a/zeitgeist.go
+++ b/zeitgeist.go
@@ -811,7 +811,7 @@ func (p *Project) Calendars() map[int]string {
type Totals struct {
Budgeted Amount
Planned Amount
- Actual Amount
+ Done Amount
}
type WPTotals struct {
@@ -828,6 +828,15 @@ func (t *Totals) Unaccounted() Amount {
return d
}
+func (t *Totals) Open() Amount {
+ d := t.Budgeted - t.Done
+ // TODO: rounding OK!?
+ if d*d < 1 {
+ return 0
+ }
+ return d
+}
+
func (p *Project) TotalWPTask(wp, task string) (to *Totals, e error) {
w, ok := p.Workpackages[wp]
if !ok {
@@ -840,7 +849,7 @@ func (p *Project) TotalWPTask(wp, task string) (to *Totals, e error) {
to = &Totals{
Budgeted: t.Budget,
Planned: p.Planned.FilterWPTask(wp, task).Total(),
- Actual: p.Timeline.FilterWPTask(wp, task).Total(),
+ Done: p.Timeline.FilterWPTask(wp, task).Total(),
}
return to, nil
}
@@ -853,7 +862,7 @@ func (p *Project) TotalWP(name string) (t *Totals, e error) {
t = &Totals{
Budgeted: wp.TotalBudget(),
Planned: p.Planned.FilterWP(name).Total(),
- Actual: p.Timeline.FilterWP(name).Total(),
+ Done: p.Timeline.FilterWP(name).Total(),
}
return t, nil
}