Index: /main/waeup.kofa/trunk/CHANGES.txt
===================================================================
--- /main/waeup.kofa/trunk/CHANGES.txt	(revision 15545)
+++ /main/waeup.kofa/trunk/CHANGES.txt	(revision 15546)
@@ -4,4 +4,6 @@
 1.6.1.dev0 (unreleased)
 =======================
+
+* Add semester filter to Fix `CourseTicketExporter`. 
 
 * Add `FacultiesExportJobContainerSelectStudents` view to allow
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 15545)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/browser.py	(revision 15546)
@@ -3773,4 +3773,11 @@
         return
 
+    def _set_semesters_values(self):
+        utils = getUtility(IKofaUtils)
+        self.semesters =[(_('All Semesters'), 'all')]
+        self.semesters += sorted([(value, key) for key, value in
+                      utils.SEMESTER_DICT.items()])
+        return
+
     def _set_mode_values(self):
         utils = getUtility(IKofaUtils)
@@ -3833,5 +3840,6 @@
     def update(self, START=None, session=None, level=None, mode=None,
                payments_start=None, payments_end=None, ct_level=None, 
-               ct_session=None, paycat=None, paysession=None, exporter=None):
+               ct_session=None, ct_semester=None, paycat=None,
+               paysession=None, exporter=None):
         self._set_session_values()
         self._set_level_values()
@@ -3839,4 +3847,5 @@
         self._set_paycat_values()
         self._set_exporter_values()
+        self._set_semesters_values()
         if START is None:
             return
@@ -3875,4 +3884,5 @@
                                           ct_level = ct_level,
                                           ct_session = ct_session,
+                                          ct_semester = ct_semester,
                                           )
         else:
@@ -3890,5 +3900,6 @@
                                           paysession=paysession,
                                           ct_level = ct_level,
-                                          ct_session = ct_session,)
+                                          ct_session = ct_session,
+                                          ct_semester = ct_semester,)
         ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
         self.context.logger.info(
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 15545)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/browser_templates/exportconfig.pt	(revision 15546)
@@ -117,4 +117,14 @@
     </select>
     <br />
+    <label for="semester" i18n:translate="">
+      Course Ticket Semester
+    </label>
+    <select name="ct_semester" class="form-control half">
+      <option tal:repeat="item view/semesters"
+              tal:attributes="value python:item[1]">
+        <span tal:replace="python: item[0]">1st Semester</span>
+      </option>
+    </select>
+    <br />
   </span>
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 15545)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/export.py	(revision 15546)
@@ -59,7 +59,8 @@
     which belong to this course code and meet level=level
     and level_session=level_session.
-    If not, but ct_level and ct_session
+    If not, but ct_level, ct_session and ct_semester
     are passed through, filter course tickets
-    which meet level==ct_level and level_session==ct_session.
+    which meet level==ct_level, level_session==ct_session
+    and semester==ct_semester.
     """
     tickets = []
@@ -69,4 +70,5 @@
     ct_level = kw.get('ct_level', None)
     ct_session = kw.get('ct_session', None)
+    ct_semester = kw.get('ct_semester', None)
     if code is None:
         for level_obj in get_levels(students):
@@ -81,4 +83,7 @@
                 if ct_session not in ('all', None) and \
                     int(ct_session) != level_obj.level_session:
+                    continue
+                if ct_semester not in ('all', None) and \
+                    int(ct_semester) != ticket.semester:
                     continue
                 tickets.append(ticket)
@@ -219,4 +224,5 @@
             del kw['ct_level']
             del kw['ct_session']
+            del kw['ct_semester']
         except KeyError:
             pass
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 15545)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_export.py	(revision 15546)
@@ -690,9 +690,9 @@
             'Anna M. Tester\r\n'
             )
-        # We can set the course tickets level and level_session without code
-        # (used in the datacenter)
+        # We can set the course tickets level, semester and level_session 
+        # without code (used in the datacenter)
         notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
         exporter.export_filtered(self.student, self.outfile, ct_level='100',
-            ct_session='2012')
+            ct_session='2012', ct_semester='2')
         result = open(self.outfile, 'rb').read()
         self.assertEqual(
@@ -707,5 +707,5 @@
         notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
         exporter.export_filtered(self.student, self.outfile, ct_level='all',
-            ct_session='2012')
+            ct_session='2012', ct_semester='all')
         result = open(self.outfile, 'rb').read()
         self.assertEqual(
@@ -731,4 +731,15 @@
         exporter.export_filtered(self.student, self.outfile,
             ct_level='all', ct_session='2013')
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            result,
+            'automatic,carry_over,code,course_category,credits,dcode,fcode,level,level_session,'
+            'mandatory,outstanding,passmark,score,semester,ticket_session,title,student_id,certcode,'
+            'display_fullname\r\n'
+            )
+        # 1st semester tickets do not exist.
+        notify(grok.ObjectModifiedEvent(self.student['studycourse']['100']['CRS1']))
+        exporter.export_filtered(self.student, self.outfile,
+            ct_level='all', ct_session='all', ct_semester='1')
         result = open(self.outfile, 'rb').read()
         self.assertEqual(
