Index: main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- main/waeup.kofa/trunk/CHANGES.txt	(revision 18053)
+++ main/waeup.kofa/trunk/CHANGES.txt	(revision 18058)
@@ -4,4 +4,8 @@
 1.8.2.dev0 (unreleased)
 =======================
+
+* Replace `get_unpaid_payments` webservice method by `get_payments`.
+
+* `format_float` is rounding now.
 
 * Implement payment ticket exporter with date range filter. 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py	(revision 18053)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py	(revision 18058)
@@ -72,13 +72,13 @@
         result = lr._get_students('fac1', 'dep1', 'CERT1', 2010, 100)
         self.assertEqual(result,
-            [(u'1234', u'Bob Tester', 90, 30, '1.666',
+            [(u'1234', u'Bob Tester', 90, 30, '1.67',
             'm_Course2_m Course3', 'Course4 Course5\nCourse6',
-            90, 30, '1.666', '')])
+            90, 30, '1.667', '')])
         # same result when selecting all certificates
         result = lr._get_students('fac1', 'dep1', 'all', 2010, 100)
         self.assertEqual(result,
-            [(u'1234', u'Bob Tester', 90, 30, '1.666',
+            [(u'1234', u'Bob Tester', 90, 30, '1.67',
             'm_Course2_m Course3', 'Course4 Course5\nCourse6',
-            90, 30, '1.666', '')])
+            90, 30, '1.667', '')])
         return
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 18053)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_webservices.py	(revision 18058)
@@ -985,5 +985,5 @@
         return
 
-    def test_get_unpaid_payments(self):
+    def test_get_payments(self):
         timestamp1 = ("%d" % int((time()-10)*10000))[1:]
         timestamp2 = ("%d" % int((time()-5)*10000))[1:]
@@ -1002,6 +1002,6 @@
         payment2 = StudentOnlinePayment()
         payment2.p_id = p_id_2
-        payment2.p_session = 2012
-        payment2.amount_auth = 12.12
+        payment2.p_session = 2015
+        payment2.amount_auth = 14.14
         payment2.p_state = u'paid'
         payment2.p_category = u'clearance'
@@ -1015,5 +1015,5 @@
         self.student['payments']['my-payment3'] = payment3
         server = ServerProxy('http://mgr:mgrpw@localhost/app', allow_none=True)
-        results = server.get_unpaid_payments(1)
+        results = server.get_payments(1)
         self.assertEqual(
             results,[
@@ -1028,5 +1028,5 @@
                 'matric_number': '234'}
                 ])
-        results = server.get_unpaid_payments(4)
+        results = server.get_payments(4)
         self.assertEqual(
             results,[
@@ -1052,5 +1052,5 @@
                   'matric_number': '234'},
                 ])
-        results = server.get_unpaid_payments(4,'xyz')
+        results = server.get_payments(4,False,'xyz')
         self.assertEqual(
             results,[
@@ -1067,8 +1067,27 @@
                 ])
 
+        results = server.get_payments(4,True,'xyz')
+        self.assertEqual(
+            results,[])
+
+        results = server.get_payments(4,True)
+        self.assertEqual(
+            results,[
+                {'display_item': None,
+                  'p_id': '%s' % p_id_2,
+                  'p_category': 'clearance',
+                  'amount_auth': 14.14,
+                  'p_session': 2015,
+                  'p_state': 'paid',
+                  'r_company': None,
+                  'fullname': 'Anna Tester',
+                  'id': 'K1000000',
+                  'matric_number': '234'},
+                ])
+
         REQUEST_XML = """\
 <?xml version="1.0"?>
 <methodCall>
-<methodName>get_unpaid_payments</methodName>
+<methodName>get_payments</methodName>
 <params>
 <param>
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 18053)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/webservices.py	(revision 18058)
@@ -506,6 +506,6 @@
 
     @grok.require('waeup.xmlrpc')
-    def get_unpaid_payments(self, days=3, company=None):
-        """Returns the payment and payer data of unpaid payment
+    def get_payments(self, days=3, paid=False, company=None):
+        """Returns the payment and payer data of paid or unpaid payment
         tickets which have been created during the past days.
         """
@@ -516,10 +516,15 @@
         p_id_minus_days = ("p%s" % timestamp_now_minus_days)
         cat = getUtility(ICatalog, name='payments_catalog')
-        payments = list(
-            cat.searchResults(p_id=(p_id_minus_days, p_id_now),
-                              p_state=('unpaid', 'unpaid')))
-        payments += list(
-            cat.searchResults(p_id=(p_id_minus_days, p_id_now),
-                              p_state=('failed', 'failed')))
+        if paid:
+            payments = list(
+                cat.searchResults(p_id=(p_id_minus_days, p_id_now),
+                                  p_state=('paid', 'paid')))
+        else:
+            payments = list(
+                cat.searchResults(p_id=(p_id_minus_days, p_id_now),
+                                  p_state=('unpaid', 'unpaid')))
+            payments += list(
+                cat.searchResults(p_id=(p_id_minus_days, p_id_now),
+                                  p_state=('failed', 'failed')))
         hitlist = []
         if company:
Index: main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 18053)
+++ main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py	(revision 18058)
@@ -565,6 +565,7 @@
         # 459.99999999999994
         value = decimal.Decimal(str(value))
-        # cut floating point value
-        value = int(pow(10, prec)*value) / (1.0*pow(10, prec))
+        value = round(value,prec)
+        # alternatively: cut floating point value
+        #value = int(pow(10, prec)*value) / (1.0*pow(10, prec))
         return '{:{width}.{prec}f}'.format(value, width=0, prec=prec)
 
