Index: main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9573)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 9574)
@@ -19,4 +19,5 @@
 """
 import grok
+from datetime import datetime
 from zope.catalog.interfaces import ICatalog
 from zope.component import queryUtility
@@ -320,2 +321,33 @@
     def export_student(self, student, filepath=None):
         return self.export(get_bedtickets([student]), filepath)
+
+class StudentPaymentsOverviewExporter(StudentsExporter):
+    """Exporter for students with payment overview.
+    """
+    grok.name('paymentsoverview')
+
+    curr_year = datetime.now().year
+    year_range = range(curr_year - 9, curr_year + 1)
+    year_range_tuple = tuple([str(year) for year in year_range])
+
+    #: Fieldnames considered by this exporter
+    fields = ('student_id', ) + (
+        'state', 'certcode', 'faccode', 'depcode', 'is_postgrad',
+        'current_level', 'current_session',
+        ) + year_range_tuple
+
+    #: The title under which this exporter will be displayed
+    title = _(u'Student Payments Overview')
+
+    def mangle_value(self, value, name, context=None):
+        if name in self.year_range_tuple and context is not None:
+            value = ''
+            for ticket in context['payments'].values():
+                if ticket.p_state == 'paid' and \
+                    ticket.p_category == 'schoolfee' and \
+                    ticket.p_session == int(name):
+                    value = ticket.amount_auth
+                    break
+        return super(
+            StudentsExporter, self).mangle_value(
+            value, name, context=context)
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 9573)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 9574)
@@ -5,5 +5,6 @@
 from waeup.kofa.students.export import (
     StudentsExporter, StudentStudyCourseExporter, StudentStudyLevelExporter,
-    CourseTicketExporter, PaymentsExporter, BedTicketsExporter)
+    CourseTicketExporter, PaymentsExporter, BedTicketsExporter,
+    StudentPaymentsOverviewExporter)
 from waeup.kofa.students.payments import StudentOnlinePayment
 from waeup.kofa.students.accommodation import BedTicket
@@ -12,4 +13,9 @@
 from waeup.kofa.students.tests.test_batching import StudentImportExportSetup
 from waeup.kofa.testing import FunctionalLayer
+
+curr_year = datetime.datetime.now().year
+year_range = range(curr_year - 9, curr_year + 1)
+year_range_str = ','.join([str(i) for i in year_range])
+
 
 class StudentsExporterTest(StudentImportExportSetup):
@@ -531,2 +537,62 @@
             )
         return
+
+class StudentPaymentsOverviewExporterTest(StudentImportExportSetup):
+
+    layer = FunctionalLayer
+
+    def setUp(self):
+        super(StudentPaymentsOverviewExporterTest, self).setUp()
+        self.setup_for_export()
+        return
+
+    def test_ifaces(self):
+        # make sure we fullfill interface contracts
+        obj = StudentPaymentsOverviewExporter()
+        verifyObject(ICSVExporter, obj)
+        verifyClass(ICSVExporter, StudentPaymentsOverviewExporter)
+        return
+
+    def test_get_as_utility(self):
+        # we can get a payments exporter as utility
+        result = queryUtility(ICSVExporter, name="paymentsoverview")
+        self.assertTrue(result is not None)
+        return
+
+    def test_export(self):
+        self.setup_student(self.student)
+        exporter = StudentPaymentsOverviewExporter()
+        exporter.export([self.student], self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            'student_id,state,certcode,faccode,depcode,is_postgrad,'
+            'current_level,current_session,'
+            '%s\r\n'
+            'A111111,created,CERT1,NA,NA,0,200,2012,'
+            ',,,,,,,,,\r\n' % year_range_str,
+            result
+            )
+        return
+
+    def test_export_all(self):
+        # we can really export students
+        # set values we can expect in export file
+        self.setup_student(self.student)
+        # We add successful payments
+        payment = StudentOnlinePayment()
+        payment.p_id = 'my-id'
+        payment.p_session = 2009
+        payment.amount_auth = 12.12
+        payment.p_state = u'paid'
+        self.student['payments']['my-2ndpayment'] = payment
+        exporter = StudentPaymentsOverviewExporter()
+        exporter.export_all(self.app, self.outfile)
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            'student_id,state,certcode,faccode,depcode,is_postgrad,'
+            'current_level,current_session,'
+            '%s\r\nA111111,created,CERT1,NA,NA,0,'
+            '200,2012,,,,,,,12.12,,,\r\n' % year_range_str,
+            result
+            )
+        return
