comparison contrib/zeiterfassung @ 61:4b58763e75c1

Show project name before time entries
author Björn Ricks <bjoern.ricks@intevation.de>
date Thu, 19 May 2011 13:04:21 +0200
parents 9df5d62e6f7e
children e7548b8c6dcc
comparison
equal deleted inserted replaced
60:9df5d62e6f7e 61:4b58763e75c1
222 elif not year: 222 elif not year:
223 cur.execute(ENTRIES, {'project_id': project_id}) 223 cur.execute(ENTRIES, {'project_id': project_id})
224 else: 224 else:
225 cur.execute(ENTRIES_YEAR, {'project_id': project_id, 'year':proj_year}) 225 cur.execute(ENTRIES_YEAR, {'project_id': project_id, 'year':proj_year})
226 total_proj = 0 226 total_proj = 0
227 while True: 227 row = cur.fetchone()
228 row = cur.fetchone() 228 if row or empty_proj:
229 if not row: break 229 print "# project: %s (%s)" % (project, proj_desc)
230 while row:
230 d = date(*map(int, row[0].split('-'))) 231 d = date(*map(int, row[0].split('-')))
231 t = max(60, row[1]) 232 t = max(60, row[1])
232 c = row[2] 233 c = row[2]
233 total_proj += t 234 total_proj += t
234 workpackage = "----" 235 workpackage = "----"
243 human_time(t), 244 human_time(t),
244 TYPE_OF_ENTRY, 245 TYPE_OF_ENTRY,
245 user, 246 user,
246 workpackage, 247 workpackage,
247 c) 248 c)
249 row = cur.fetchone()
248 total += total_proj 250 total += total_proj
249 if empty_proj or total_proj > 0: 251 if empty_proj or total_proj > 0:
250 print "# project: %s (%s)" % (project, proj_desc)
251 print "# total: %sh\n\n" % human_time(total_proj) 252 print "# total: %sh\n\n" % human_time(total_proj)
252 print "# total all projects: %sh\n\n" % human_time(total) 253 print "# total all projects: %sh\n\n" % human_time(total)
253 finally: 254 finally:
254 tolerantClose(cur) 255 tolerantClose(cur)
255 tolerantClose(con) 256 tolerantClose(con)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)