From e8ba843c8f44cd934a85f8d137b2693ed3210787 Mon Sep 17 00:00:00 2001 From: Markus Krogh Date: Tue, 15 Mar 2016 12:53:16 +0000 Subject: better summary --- maconomy_hours.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'maconomy_hours.py') 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() -- cgit v1.1