diff --git a/addons/hr_attendance/report/attendance_by_month.py b/addons/hr_attendance/report/attendance_by_month.py
index 8899df5ab59..f4ee7035136 100644
--- a/addons/hr_attendance/report/attendance_by_month.py
+++ b/addons/hr_attendance/report/attendance_by_month.py
@@ -32,10 +32,10 @@ from report.interface import toxml
one_day = DateTime.RelativeDateTime(days=1)
month2name = [0, 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
-def hour2str(h):
- hours = int(h)
- minutes = int(round((h - hours) * 60, 0))
- return '%02dh%02d' % (hours, minutes)
+#def hour2str(h):
+# hours = int(h)
+# minutes = int(round((h - hours) * 60, 0))
+# return '%02dh%02d' % (hours, minutes)
class report_custom(report_rml):
@@ -67,7 +67,7 @@ class report_custom(report_rml):
'''
cr.execute(sql, (today.strftime('%Y-%m-%d %H:%M:%S'), tomor.strftime('%Y-%m-%d %H:%M:%S'), emp['id']))
attendences = cr.dictfetchall()
- wh = 0
+ wh = 0.0
# Fake sign ins/outs at week ends, to take attendances across week ends into account
if attendences and attendences[0]['action'] == 'sign_out':
attendences.insert(0, {'name': today.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
@@ -80,8 +80,8 @@ class report_custom(report_rml):
wh += (dt - ldt).hours
ldt = dt
# Week xml representation
- wh = hour2str(wh)
- today_xml = '%s' % ((today - month).days+1, wh)
+# wh = hour2str(wh)
+ today_xml = '%s' % ((today - month).days+1, round(wh,2))
days_xml.append(today_xml)
today, tomor = tomor, tomor + one_day
user_xml.append(user_repr % '\n'.join(days_xml))
@@ -94,4 +94,4 @@ class report_custom(report_rml):
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/hr_attendance/report/bymonth.xsl b/addons/hr_attendance/report/bymonth.xsl
index 133602f1558..ea4e849cb07 100644
--- a/addons/hr_attendance/report/bymonth.xsl
+++ b/addons/hr_attendance/report/bymonth.xsl
@@ -10,7 +10,7 @@
-
+
@@ -18,8 +18,9 @@
-
+
+
@@ -29,6 +30,7 @@
+
@@ -40,8 +42,10 @@
+ Attendance By Month
+
+ colWidths="3cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm,0.69cm" style="week">
| |
1 |
@@ -77,21 +81,23 @@
31 |
-
+
-
+
|
|
-
-
- | Worked |
|
+
+
+
+
+