Index: main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt	(revision 15972)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt	(revision 15979)
@@ -155,4 +155,5 @@
           document.getElementById('exporter').value == 'studentpayments' ||
           document.getElementById('exporter').value == 'accommodationpayments' ||
+          document.getElementById('exporter').value == 'trimmedpayments' ||
           document.getElementById('exporter').value == 'unpaidpayments') {
           document.getElementById('payment_dates').style.display = 'block';
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 15972)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 15979)
@@ -508,4 +508,36 @@
             value, name, context=context)
 
+class StudentTrimmedPaymentExporter(grok.GlobalUtility, StudentExporterBase):
+    """The Student Trimmed Payment Exporter is a slightly customized version
+    of the StudentPaymentExporter requested by Uniben.
+    """
+    grok.name('trimmedpayments')
+
+    fields = tuple(
+        sorted(iface_names(
+            IStudentOnlinePayment, exclude_attribs=False,
+            omit=['display_item', 'certificate', 'student', 'ac']))) + (
+            'student_id','faccode', 'depcode', 'state','current_session')
+    title = _(u'Student Payments (Sorted Data)')
+
+    def filter_func(self, x, **kw):
+        payments = get_payments(x, **kw)
+        return sorted([payment for payment in payments],
+            key=lambda payment: payment.category + str(payment.student.faccode)
+                + str(payment.student.depcode) + str(payment.p_item))
+
+    def mangle_value(self, value, name, context=None):
+        """The mangler determines the student's id, registration
+        state and current session.
+        """
+        if context is not None:
+            student = context.student
+            if name in ['student_id','state', 'faccode', 'depcode',
+                        'current_session'] and student is not None:
+                value = getattr(student, name, None)
+        return super(
+            StudentTrimmedPaymentExporter, self).mangle_value(
+            value, name, context=context)
+
 class DataForLecturerExporter(grok.GlobalUtility, StudentExporterBase):
     """The Data for Lecturer Exporter searches for students in the course
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 15972)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 15979)
@@ -39,4 +39,5 @@
     TranscriptDataExporter,
     TrimmedDataExporter,
+    StudentTrimmedPaymentExporter,
     get_students,)
 from waeup.kofa.students.accommodation import BedTicket
@@ -1089,4 +1090,48 @@
             )
         return
+
+class StudentTrimmedPaymentExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(StudentTrimmedPaymentExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = StudentTrimmedPaymentExporter()
+        verifyObject(ICSVStudentExporter, obj)
+        verifyClass(ICSVStudentExporter, StudentTrimmedPaymentExporter)
+        return
+
+    def test_get_as_utility(self):
+        # we can get a payments exporter as utility
+        result = queryUtility(ICSVExporter, name="trimmedpayments")
+        self.assertTrue(result is not None)
+        return
+
+    def test_export_all(self):
+        # we can really export all payments
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        exporter = StudentTrimmedPaymentExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'amount_auth,creation_date,p_category,p_combi,p_current,'
+            'p_id,p_item,p_level,p_session,p_state,payment_date,'
+            'r_amount_approved,r_code,r_desc,student_id,faccode,'
+            'depcode,state,current_session\r\n'
+
+            '12.12,%s-04-01 13:12:01#,schoolfee,[],1,my-id,p-item,'
+            '100,%s,paid,%s-04-01 14:12:01#,12.12,r-code,,'
+            'A111111,NA,NA,created,2012\r\n'
+            % (curr_year-6, curr_year-6, curr_year-6)
+            )
+        return
+
 
 class UnpaidPaymentsExporterTest(StudentImportExportSetup):
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 15972)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 15979)
@@ -1166,5 +1166,7 @@
             'bursary',
             'accommodationpayments',
-            'transcriptdata')
+            'transcriptdata',
+            #'trimmedpayments',
+            )
 
     #: A tuple containing all exporter names needed for backing
