comparison contrib/zeiterfassung @ 59:58bfac26a9ff

add displaying of total time in all projects
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 03 May 2011 14:37:23 +0200
parents 9826dcbf119f
children 9df5d62e6f7e
comparison
equal deleted inserted replaced
58:9826dcbf119f 59:58bfac26a9ff
209 project_ids = [[row[0], project, row[1]]] 209 project_ids = [[row[0], project, row[1]]]
210 else: 210 else:
211 cur.execute(ALL_PROJECT_IDS); 211 cur.execute(ALL_PROJECT_IDS);
212 project_ids = cur.fetchall() 212 project_ids = cur.fetchall()
213 213
214 total = 0
214 for project_id, project, proj_desc in project_ids: 215 for project_id, project, proj_desc in project_ids:
215 print "# project: %s (%s)" % (project, proj_desc) 216 print "# project: %s (%s)" % (project, proj_desc)
216 if not week is None: 217 if not week is None:
217 cur.execute(WEEK_ENTRIES, {'project_id': project_id, 'week': week, 'year' : proj_year}) 218 cur.execute(WEEK_ENTRIES, {'project_id': project_id, 'week': week, 'year' : proj_year})
218 elif not year: 219 elif not year:
239 human_time(t), 240 human_time(t),
240 TYPE_OF_ENTRY, 241 TYPE_OF_ENTRY,
241 user, 242 user,
242 workpackage, 243 workpackage,
243 c) 244 c)
245 total += total_proj
244 print "# total: %sh\n\n" % human_time(total_proj) 246 print "# total: %sh\n\n" % human_time(total_proj)
247 print "# total all projects: %sh\n\n" % human_time(total)
245 finally: 248 finally:
246 tolerantClose(cur) 249 tolerantClose(cur)
247 tolerantClose(con) 250 tolerantClose(con)
248 251
249 except TermError, e: 252 except TermError, e:
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)