summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Krogh <markus@nordu.net>2016-03-15 12:53:16 +0000
committerMarkus Krogh <markus@nordu.net>2016-03-15 12:53:16 +0000
commite8ba843c8f44cd934a85f8d137b2693ed3210787 (patch)
tree8228b962959a48f069dd958381a977a535d2ecbd
parent2d953d27d0d1aad7491485c739a9507127354af9 (diff)
better summary
-rw-r--r--maconomy_hours.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/maconomy_hours.py b/maconomy_hours.py
index b41cd06..e11eed9 100644
--- a/maconomy_hours.py
+++ b/maconomy_hours.py
@@ -75,13 +75,11 @@ def ceo(timesheets, config, mailer):
def summary(timesheets):
- for timesheet in timesheets:
- if timesheet.is_missing():
- print u"[Not created] {}".format(timesheet.employee)
- elif not timesheet.is_submitted():
- print u"[Unsubmitted] {}".format(timesheet.employee)
- elif not timesheet.is_approved():
- print u"[Not approved] {}".format(timesheet.employee)
+ affected = [t for t in timesheets if utils.need_manager_mail(t)]
+ for timesheet in affected:
+ print timesheet.status_summary()
+ print "Number of overdue timesheets: {}".format(len(affected))
+
if __name__ == '__main__':
args = cli.parse()