Index: main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- main/waeup.kofa/trunk/CHANGES.txt	(revision 14513)
+++ main/waeup.kofa/trunk/CHANGES.txt	(revision 14514)
@@ -4,4 +4,10 @@
 1.4.2.dev0 (unreleased)
 =======================
+
+* Add `entry_session` and `p_session` filter to Student Payment Statistics
+  generator. Adjust reports: Change footer and filename formats.
+
+* Add officer name fields do `IDepartment` and `IFaculty`.
+  Plugins must be updated!
 
 * Add serial number column to Session Results Presentations.
@@ -90,5 +96,5 @@
   (`process`).
 
-* Add `DegreeSource` and `degree` field to `Certificate`.
+* Add `DegreeSource` and `degree` field to `ICertificate`.
   Plugins must be updated!
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/level_report.py	(revision 14514)
@@ -146,9 +146,11 @@
         # Underline mandatory (core) courses
         failed_courses = Paragraph(
-            line[5].replace('m_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE)
+            line[5].replace(
+                'm_', '<u>').replace('_m', '</u>'), SMALL_PARA_STYLE)
         line = line[:5] + (failed_courses,) + line[6:]
         # Superscript in remarks (needed by AAUE)
         remark = Paragraph(
-            line[10].replace('s_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE)
+            line[10].replace(
+                's_', '<super>').replace('_s', '</super>'), SMALL_PARA_STYLE)
         line = line[:10] + (remark,)
         line = (sn,) + line
@@ -233,5 +235,6 @@
         pdf_data += [Paragraph(
                     translate(
-                        '${a}<br />${b}<br />${c}<br /><br />Session: ${d}<br />Level: ${e}',
+                        '${a}<br />${b}<br />${c}<br />'
+                        'Session: ${d}<br />Level: ${e}',
                         mapping = {'a':self.certtitle,
                                    'b':self.deptitle,
@@ -248,12 +251,11 @@
         pdf_data.append(Spacer(1, 40))
         if self.signatures:
-            signaturetables = get_signature_tables(self.signatures, landscape=True)
+            signaturetables = get_signature_tables(
+                self.signatures, landscape=True)
             pdf_data.append(signaturetables[0])
 
         pdf = creator.create_pdf(
             pdf_data, None, doc_title, self.author,
-            doc_title + ' - %s/%s/%s - %s - %s -' % (
-            self.faccode, self.depcode, self.certcode,
-            self.levelcode, self.sessioncode),
+            doc_title + ' - %s -' % self.session,
             note = self.note
             )
@@ -329,5 +331,7 @@
             ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
             grok.getSite().logger.info(
-                '%s - report %s created: %s (faculty=%s, department=%s, certificate=%s, session=%s, level=%s)' % (
+                '%s - report %s created: %s '
+                '(faculty=%s, department=%s, certificate=%s, '
+                'session=%s, level=%s)' % (
                 ob_class, job_id, self.context.title, faccode, depcode,
                 certcode, session, level))
@@ -384,7 +388,6 @@
 
     def _filename(self):
-        return 'LevelReport_%s_%s_%s_%s_%s_%s.pdf' % (
-            self.context.faccode, self.context.depcode, self.context.certcode,
-            self.context.sessioncode, self.context.levelcode,
+        return 'LevelReport_rno%s_%s.pdf' % (
+            self.context.__name__,
             self.context.creation_dt_string)
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/raw_score_report.py	(revision 14514)
@@ -214,5 +214,6 @@
             self.course_codes[level] = course_codes
             self.data[level] = get_students(
-                faccode, depcode, certcode, session, self.levelcode, course_codes)
+                faccode, depcode, certcode, session,
+                self.levelcode, course_codes)
 
     def create_pdf(self, job_id):
@@ -229,5 +230,6 @@
         pdf_data += [Paragraph(
                     translate(
-                        '${a}<br />${b}<br />${c}<br /><br />Session: ${d}<br />Level: ${e}',
+                        '${a}<br />${b}<br />${c}<br />'
+                        'Session: ${d}<br />Level: ${e}',
                         mapping = {'a':self.certtitle,
                                    'b':self.deptitle,
@@ -256,7 +258,5 @@
         pdf = creator.create_pdf(
             pdf_data, None, doc_title, self.author,
-            doc_title + ' - %s/%s/%s - %s - %s -' % (
-            self.faccode, self.depcode, self.certcode,
-            self.levelcode, self.sessioncode),
+            doc_title + ' - %s -' % self.session,
             note=self.note
             )
@@ -299,7 +299,6 @@
 
     def _filename(self):
-        return 'RawScoreReport_%s_%s_%s_%s_%s_%s.pdf' % (
-            self.context.faccode, self.context.depcode, self.context.certcode,
-            self.context.sessioncode, self.context.levelcode,
+        return 'RawScoreReport_rno%s_%s.pdf' % (
+            self.context.__name__,
             self.context.creation_dt_string)
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/session_results_presentation.py	(revision 14514)
@@ -183,5 +183,6 @@
         pdf_data += [Paragraph(
                     translate(
-                        '${a}<br />${b}<br />${c}<br />Session: ${d}<br />Level: ${e}',
+                        '${a}<br />${b}<br />${c}<br />Session: ${d}<br />'
+                        'Level: ${e}',
                         mapping = {'a':self.certtitle,
                                    'b':self.deptitle,
@@ -241,7 +242,5 @@
         pdf = creator.create_pdf(
             pdf_data, None, doc_title, self.author,
-            doc_title + ' - %s/%s/%s - %s - %s -' % (
-            self.faccode, self.depcode, self.certcode,
-            self.levelcode, self.sessioncode),
+            doc_title + ' - %s -' % self.session,
             note = self.note
             )
@@ -294,7 +293,6 @@
 
     def _filename(self):
-        return 'SessionResultsPresentation_%s_%s_%s_%s_%s_%s.pdf' % (
-            self.context.faccode, self.context.depcode, self.context.certcode,
-            self.context.sessioncode, self.context.levelcode,
+        return 'SessionResultsPresentation_rno%s_%s.pdf' % (
+            self.context.__name__,
             self.context.creation_dt_string)
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_statistics.py	(revision 14514)
@@ -148,4 +148,6 @@
         super(StudentStatisticsReport, self).__init__(
             args=[session, mode, breakdown], kwargs={'author':author})
+        self.sessioncode = session
+        self.levelcode = level
         self.studylevelsource = StudyLevelSource().factory
         self.portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
@@ -153,7 +155,8 @@
         self.mode = mode
         if level == 0:
-            self.level = ''
+            self.level = 'All levels'
         else:
-            self.level = translate(self.studylevelsource.getTitle(None, int(level)),
+            self.level = translate(
+                self.studylevelsource.getTitle(None, int(level)),
                 'waeup.kofa', target_language=self.portal_language)
         self.breakdown = breakdown
@@ -171,20 +174,23 @@
                               STYLE["Normal"]),
                     Spacer(1, 12),]
+        pdf_data += [Paragraph(
+                    translate(
+                        'Study Mode: ${a}<br />'
+                        'Academic Session: ${b}<br />Level: ${c}<br />',
+                        mapping = {'a':self.mode,
+                                   'b':self.session,
+                                   'c':self.level,
+                                   }),
+                    STYLE["Normal"]),
+                    Spacer(1, 12),]
         pdf_data += [
             Table(table_data, style=TABLE_STYLE, colWidths=col_widths)]
-        if not self.level:
-            doc_title = translate(
-                _('${a} Students - ${b}',
-                mapping = {'a':self.mode, 'b':self.session}))
-            pdf = creator.create_pdf(
-                pdf_data, None, doc_title, self.author, doc_title + '-'
-                )
-        else:
-            doc_title = translate(
-                _('${a} Students - ${b} - ${c}',
-                mapping = {'a':self.mode, 'b': self.level, 'c':self.session}))
-            pdf = creator.create_pdf(
-                pdf_data, None, doc_title, self.author, doc_title + '-'
-                )
+        doc_title = translate(_('Student Statistics'))
+        right_footer = translate(
+            _('${a} Students - ${b} -',
+            mapping = {'a':self.mode, 'b':self.session}))
+        pdf = creator.create_pdf(
+            pdf_data, None, doc_title, self.author, right_footer
+            )
         return pdf
 
@@ -249,5 +255,6 @@
             ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
             grok.getSite().logger.info(
-                '%s - report %s created: %s (session=%s, mode=%s, level=%s, breakdown=%s)' % (
+                '%s - report %s created: %s '
+                '(session=%s, mode=%s, level=%s, breakdown=%s)' % (
                 ob_class, job_id, self.context.title,
                 session, mode, level, breakdown))
@@ -269,5 +276,5 @@
         portal_language = getUtility(IKofaUtils).PORTAL_LANGUAGE
         studylevelsource = StudyLevelSource().factory
-        self.levels = [(u'All levels', 0)]
+        self.levels = [(u'All', 0)]
         for code in studylevelsource.getValues(None):
             title = translate(studylevelsource.getTitle(None, code),
@@ -288,6 +295,6 @@
 
     def _filename(self):
-        return 'StudentStatisticsReport_%s_%s_%s_%s.pdf' % (
-            self.context.session, self.context.mode, self.context.level,
+        return 'StudentStatisticsReport_rno%s_%s.pdf' % (
+            self.context.__name__,
             self.context.creation_dt_string)
 
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 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_level_report.py	(revision 14514)
@@ -129,8 +129,7 @@
                          'application/pdf')
         self.assertTrue(
-            'filename="LevelReport_fac1_dep1_CERT1_2010_100_' in
+            'filename="LevelReport_rno%s' % job_id in
             self.browser.headers['content-disposition'])
         self.assertEqual(len(self.app['reports'].running_report_jobs), 1)
-        job_id = self.app['reports'].running_report_jobs[0][0]
         # ... and discarded
         self.browser.open('http://localhost/app/reports')
@@ -149,6 +148,6 @@
         self.assertTrue(
             'INFO - zope.mgr - students.reports.level_report.LevelReportPDFView - '
-            'report %s downloaded: LevelReport_fac1_dep1_CERT1_2010_100_'
-            % job_id in logcontent
+            'report %s downloaded: LevelReport_rno%s'
+            % (job_id, job_id) in logcontent
             )
         self.assertTrue(
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_session_results_presentation.py	(revision 14514)
@@ -158,8 +158,7 @@
                          'application/pdf')
         self.assertTrue(
-            'filename="SessionResultsPresentation_fac1_dep1_CERT1_2010_100_' in
+            'filename="SessionResultsPresentation_rno%s' % job_id in
             self.browser.headers['content-disposition'])
         self.assertEqual(len(self.app['reports'].running_report_jobs), 1)
-        job_id = self.app['reports'].running_report_jobs[0][0]
         # ... and discarded
         self.browser.open('http://localhost/app/reports')
@@ -178,6 +177,6 @@
         self.assertTrue(
             'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - '
-            'report %s downloaded: SessionResultsPresentation_fac1_dep1_CERT1_2010_100_'
-            % job_id in logcontent
+            'report %s downloaded: SessionResultsPresentation_rno%s'
+            % (job_id, job_id) in logcontent
             )
         self.assertTrue(
@@ -199,8 +198,7 @@
                          'application/pdf')
         self.assertTrue(
-            'filename="SessionResultsPresentation_fac1_dep1_CERT1_2010_0_' in
+            'filename="SessionResultsPresentation_rno%s' % job_id in
             self.browser.headers['content-disposition'])
         self.assertEqual(len(self.app['reports'].running_report_jobs), 1)
-        job_id = self.app['reports'].running_report_jobs[0][0]
         # ... and discarded
         self.browser.open('http://localhost/app/reports')
@@ -219,6 +217,6 @@
         self.assertTrue(
             'INFO - zope.mgr - students.reports.session_results_presentation.SessionResultsPresentationPDFView - '
-            'report %s downloaded: SessionResultsPresentation_fac1_dep1_CERT1_2010_0_'
-            % job_id in logcontent
+            'report %s downloaded: SessionResultsPresentation_rno%s'
+            % (job_id, job_id) in logcontent
             )
         self.assertTrue(
Index: main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py	(revision 14513)
+++ main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_statistics.py	(revision 14514)
@@ -181,8 +181,7 @@
                          'application/pdf')
         self.assertTrue(
-            'filename="StudentStatisticsReport_2004_2005_All_' in
+            'filename="StudentStatisticsReport_rno%s' % job_id in
             self.browser.headers['content-disposition'])
         self.assertEqual(len(self.app['reports'].running_report_jobs), 1)
-        job_id = self.app['reports'].running_report_jobs[0][0]
         # ... and discarded
         self.browser.open('http://localhost/app/reports')
@@ -200,6 +199,6 @@
         self.assertTrue(
             'INFO - zope.mgr - students.reports.student_statistics.StudentStatisticsReportPDFView - '
-            'report %s downloaded: StudentStatisticsReport_2004_2005_All__'
-            % job_id in logcontent
+            'report %s downloaded: StudentStatisticsReport_rno%s'
+            % (job_id, job_id) in logcontent
             )
         self.assertTrue(
