[FIX] hr_attendance:Attendance by month report now prints minutes also

lp bug: https://launchpad.net/bugs/711533 fixed

bzr revid: mtr@mtr-20110203101717-2hr3a3q83fto442h
This commit is contained in:
mtr 2011-02-03 15:47:17 +05:30
parent 36c8648d41
commit 94c626ed9a
1 changed files with 8 additions and 1 deletions

View File

@ -85,7 +85,14 @@ class report_custom(report_rml):
for att in attendences:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
if ldt and att['action'] == 'sign_out':
wh += (dt - ldt).seconds/60/60
tot_tim = (str(float((dt - ldt).seconds)/3600))
hrs = int(tot_tim.split('.')[0])
mints = int(tot_tim.split('.')[1])
tot_min = (int(mints * 60) / 10)
if tot_min < (10) or tot_tim < ('0.09'):
wh += float((str(hrs))+ '.' + '0' +(str(tot_min)))
else:
wh += float((str(hrs))+ '.' + (str(tot_min)))
else:
ldt = dt
# Week xml representation