diff options
author | Markus Krogh <markus@nordu.net> | 2016-03-08 18:51:12 +0000 |
---|---|---|
committer | Markus Krogh <markus@nordu.net> | 2016-03-08 18:51:12 +0000 |
commit | c00e57756336358e9800fc8fc89392253dbf4ed8 (patch) | |
tree | b005152d9bd390c3e2a8912247fff43dfbbbfde6 /maconomy_hours.py | |
parent | 5c365f875986ffb38345e789a450639b1b833b24 (diff) |
Initial commmit, still needs wireing for email
Diffstat (limited to 'maconomy_hours.py')
-rw-r--r-- | maconomy_hours.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/maconomy_hours.py b/maconomy_hours.py new file mode 100644 index 0000000..1001964 --- /dev/null +++ b/maconomy_hours.py @@ -0,0 +1,21 @@ +from maconomy import cli, Employee, Timesheet, create_db, TimeRegistrationRepository + +def main(config, dry_run): + db = create_db(config) + timereg_repo = TimeRegistrationRepository(db) + + for employee, timesheet in timereg_repo.all_active(): + if timesheet.is_missing(): + print u"Timesheet for {} has not been created".format(employee) + elif not timesheet.is_submitted(): + print u"Missing time sheet for {}".format(employee) + elif not timesheet.is_approved(): + print u"Timesheet for {} not approved".format(employee) + + timereg_repo.close() + db.close() + +if __name__ == '__main__': + args = cli.parse() + config = cli.load_config(args.config) + main(config, args.dry) |