Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py	(revision 12562)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py	(revision 12563)
@@ -55,5 +55,5 @@
     site = grok.getSite()
     payment_cats = ('clearance', 'gown', 'hostel_maintenance', 'schoolfee')
-    payment_cats = payment_cats + (u'Total',)
+    payment_cats = payment_cats + ('Total',)
     if breakdown == 'faccode':
         codes = tuple(sorted([x for x in site['faculties'].keys()],
@@ -67,5 +67,5 @@
         codes = tuple(sorted([x for x in depcodes],
                                  key=lambda x: x.lower()))
-    codes = codes + ('Total',)
+    codes = codes + (u'Total',)
     # XXX: Here we do _one_ query and then examine the single
     #   students. One could also do multiple queries and just look for
@@ -109,9 +109,14 @@
     # Build table header
     utils = getUtility(IKofaUtils)
-    table_header = ['' for x in xrange(2*len(payment_cats))]
+
+
+    table_header = ['' for x in xrange(len(payment_cats))]
     for cat in payment_cats:
         cat_title = utils.PAYMENT_CATEGORIES.get(cat, cat)
-        table_header[2*payment_cats.index(cat)] = cat_title
-    # turn lists into tuples
+        table_header[payment_cats.index(cat)] = cat_title
+
+    # Convert float into int
+    table = [[int(col) for col in row] for row in table]
+    # Turn lists into tuples
     table = tuple([tuple(row) for row in table])
     return (codes, table_header, table)
@@ -124,8 +129,28 @@
 from waeup.kofa.reports import Report
 from waeup.kofa.browser.interfaces import IPDFCreator
+from waeup.kofa.students.reports.level_report import TTR
 
 from waeup.kofa.students.reports.student_statistics import (
     tbl_data_to_table, STYLE)
 
+def tbl_data_to_table(row_names, col_names, data):
+    result = []
+    new_col_names = []
+    for name in col_names:
+        if len(name) > 18:
+            new_col_names.append(name.replace(' ', '\n', 1))
+        else:
+            new_col_names.append(name)
+    head = [''] + [col_name for col_name in new_col_names]
+    result = [head]
+    for idx, row_name in enumerate(row_names):
+        row = []
+        i = 0
+        while i < len(data[idx]):
+            row.append("%s (%s)" % (data[idx][i+1], data[idx][i]))
+            i += 2
+        row = [row_name] + row
+        result.append(row)
+    return result
 
 TABLE_STYLE = [
@@ -136,8 +161,8 @@
     ('FONT', (-1,0), (-1,-1), 'Helvetica-Bold', 8),
     ('ALIGN', (1,1), (-1,-1), 'RIGHT'),
-    ('INNERGRID', (0,1), (-1,-1), 0.25, colors.black),
+    ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black),
     ('LINEBELOW', (0,-1), (-1,-1), 0.25, colors.black),
-    ('LINEAFTER', (-1,1), (-1,-1), 0.25, colors.black),
-    ('LINEBEFORE', (-1,1), (-1,-1), 0.25, colors.black),
+    ('LINEAFTER', (-1,0), (-1,-1), 0.25, colors.black),
+    ('LINEBEFORE', (-1,0), (-1,-1), 0.25, colors.black),
     #('LINEABOVE', (0,-1), (-1,-1), 1.0, colors.black),
     #('LINEABOVE', (0,0), (-1,0), 0.25, colors.black),
@@ -164,5 +189,5 @@
         creator = getUtility(IPDFCreator, name='landscape')
         table_data = tbl_data_to_table(*self.data)
-        col_widths = [None,] + [1.6*cm] * len(self.data[1]) + [None,]
+        col_widths = [None,] + [3.2*cm] * len(self.data[1]) + [None,]
         pdf_data = [Paragraph('<b>%s</b>' % self.creation_dt_string,
                               STYLE["Normal"]),
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py	(revision 12562)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py	(revision 12563)
@@ -34,16 +34,16 @@
             result1,
             ((u'fac1', u'Total'),
-             ['Acceptance Fee', '', 'Gown Hire Fee', '',
-              'Hostel Maintenance Fee', '', 'School Fee', '',
-              'Total', ''],
-              ((0, 0, 0, 0, 0, 0, 1, 5.678, 1, 5.678),
-              (0, 0, 0, 0, 0, 0, 1, 5.678, 1, 5.678)))
+             ['Acceptance Fee', 'Gown Hire Fee',
+              'Hostel Maintenance Fee', 'School Fee',
+              'Total'],
+              ((0, 0, 0, 0, 0, 0, 1, 5, 1, 5),
+              (0, 0, 0, 0, 0, 0, 1, 5, 1, 5)))
             )
         self.assertEqual(
             result2,
             ((u'fac1', u'Total'),
-             ['Acceptance Fee', '', 'Gown Hire Fee', '',
-              'Hostel Maintenance Fee', '', 'School Fee', '',
-              'Total', ''],
+             ['Acceptance Fee', 'Gown Hire Fee',
+              'Hostel Maintenance Fee', 'School Fee',
+              'Total'],
               ((0, 0, 0, 0, 0, 0, 0, 0, 0, 0),
               (0, 0, 0, 0, 0, 0, 0, 0, 0, 0)))
