Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 17992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser.py	(revision 18021)
@@ -1828,7 +1828,12 @@
     pnav = 3
 
-    def update(self, CREATE=None, DISCARD=None, job_id=None):
+    def update(self, CREATE=None, CREATE_PAYMENTS=None, payments_start=None,
+               payments_end=None, DISCARD=None, job_id=None):
         if CREATE:
             self.redirect(self.url('@@start_export'))
+            return
+        if CREATE_PAYMENTS:
+            args = {'payments_start':payments_start, 'payments_end':payments_end}
+            self.redirect(self.url('@@start_export_payments') + '?%s' % urlencode(args))
             return
         if DISCARD and job_id:
@@ -1882,6 +1887,40 @@
         return
 
+
+class PaymentsExportJobContainerJobStart(UtilityView, grok.View):
+    """View that starts only payment export jobs.
+    """
+    grok.context(VirtualApplicantsExportJobContainer)
+    grok.require('waeup.exportApplication')
+    grok.name('start_export_payments')
+
+    def update(self, payments_start=None, payments_end= None):
+        utils = queryUtility(IKofaUtils)
+        if not utils.expensive_actions_allowed():
+            self.flash(_(
+                "Currently, exporters cannot be started due to high "
+                "system load. Please try again later."), type='danger')
+            self.entries = doll_up(self, user=None)
+            return
+
+        ob_class = self.__implemented__.__name__.replace('waeup.kofa.','')
+        container_code = self.context.__parent__.code
+        job_id = self.context.start_export_job('applicantpayments',
+                                      self.request.principal.id,
+                                      container=container_code,
+                                      p_start=payments_start,
+                                      p_end=payments_end)
+        self.context.logger.info(
+            '%s - exported: %s (%s), job_id=%s'
+            % (ob_class, 'applicantpayments', container_code, job_id))
+        self.flash(_('Exports started.'))
+        self.redirect(self.url(self.context))
+        return
+
+    def render(self):
+        return
+
 class ExportJobContainerDownload(ExportCSVView):
-    """Page that downloads a students export csv file.
+    """Page that downloads an applicants export csv file.
 
     """
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/exportjobsindex.pt
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/exportjobsindex.pt	(revision 17992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/browser_templates/exportjobsindex.pt	(revision 18021)
@@ -55,5 +55,16 @@
 <form method="POST" i18n:domain="waeup.kofa">
   <input class="btn btn-primary" type="submit" name="CREATE"
-         value="Start new exports"
+         value="Export all data"
           />
 </form>
+<br />
+<form method="POST" i18n:domain="waeup.kofa">
+  <input class="btn btn-primary" type="submit" name="CREATE_PAYMENTS"
+         value="Export payment data only"
+          />
+  from
+  <input class="datepicker-le-year datepicker-short textType"
+         name="payments_start" type="text" value="" />
+  to <input class="datepicker-le-year datepicker-short textType"
+         name="payments_end" type="text" value="" />
+</form>
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py	(revision 17992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/export.py	(revision 18021)
@@ -19,13 +19,14 @@
 """
 import grok
+from datetime import datetime, timedelta
 from zope.catalog.interfaces import ICatalog
-from zope.component import queryUtility
+from zope.component import queryUtility, getUtility
 from waeup.kofa.applicants.interfaces import (
     IApplicantBaseData, IApplicantsContainer, IApplicantOnlinePayment,
     IApplicantRefereeReport, IApplicant)
-from waeup.kofa.interfaces import ICSVExporter
+from waeup.kofa.interfaces import ICSVExporter, IKofaUtils
 from waeup.kofa.interfaces import MessageFactory as _
 from waeup.kofa.utils.batching import ExporterBase
-from waeup.kofa.utils.helpers import iface_names
+from waeup.kofa.utils.helpers import iface_names, to_timezone
 
 class ApplicantsContainerExporter(grok.GlobalUtility, ExporterBase):
@@ -213,10 +214,24 @@
         """
         container = grok.getSite()['applicants'][kw['container']]
+        p_start = kw.get('p_start')
+        p_end = kw.get('p_end')
         container_values = container.values()
         used = [value for value in container_values
                 if value.container_code.endswith('+')]
         payments = []
+        date_format = '%d/%m/%Y'
         for applicant in used:
             for payment in applicant.payments:
+                if p_start and p_end:
+                    if not payment.payment_date:
+                        continue
+                    payments_start = datetime.strptime(p_start, date_format)
+                    payments_end = datetime.strptime(p_end, date_format)
+                    tz = getUtility(IKofaUtils).tzinfo
+                    payments_start = tz.localize(payments_start)
+                    payments_end = tz.localize(payments_end) + timedelta(days=1)
+                    payment_date = to_timezone(payment.payment_date, tz)
+                    if payment_date < payments_start or payment_date > payments_end:
+                        continue
                 if payment.p_state == 'paid':
                     payments.append(payment)
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 17992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_browser.py	(revision 18021)
@@ -1702,5 +1702,5 @@
         self.browser.open(container_path)
         self.browser.getLink("Export application data").click()
-        self.browser.getControl("Start new exports").click()
+        self.browser.getControl("Export all data").click()
         job_ids = self.wait_for_export_jobs_completed()
         # Three exports were created
@@ -1782,4 +1782,36 @@
             'zope.mgr - applicants.browser.ExportJobContainerOverview '
             '- discarded: job_id=%s' % job_ids[2] in logcontent
+            )
+
+    def test_payments_in_container_export(self):
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        container_path = 'http://localhost/app/applicants/%s' % container_name_1
+        self.browser.open(container_path)
+        self.browser.getLink("Export application data").click()
+        self.browser.getControl("Export payment data only").click()
+        job_ids = self.wait_for_export_jobs_completed()
+        # Three exports were created
+        self.assertEqual(len(self.app['datacenter'].running_exports), 1)
+       # When the job is finished and we reload the page...
+        self.browser.open(container_path + '/exports')
+        self.browser.getLink("Download", index=0).click()
+        self.assertEqual(self.browser.headers['content-type'],
+            'text/csv; charset=UTF-8')
+        self.assertTrue(
+            'filename="WAeUP.Kofa_applicantpayments_%s.csv' % job_ids[0] in
+            self.browser.headers['content-disposition'])
+        # Creation and downloading was logged
+        logfile = os.path.join(
+            self.app['datacenter'].storage, 'logs', 'datacenter.log')
+        logcontent = open(logfile).read()
+        self.assertTrue(
+            'zope.mgr - applicants.browser.PaymentsExportJobContainerJobStart - '
+            'exported: applicantpayments (%s), job_id=%s'
+            % (container_name_1, job_ids[0]) in logcontent
+            )
+        self.assertTrue(
+            'zope.mgr - applicants.browser.ExportJobContainerDownload - '
+            'downloaded: WAeUP.Kofa_applicantpayments_%s.csv, job_id=%s'
+            % (job_ids[0], job_ids[0]) in logcontent
             )
 
Index: main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py
===================================================================
--- main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py	(revision 17992)
+++ main/waeup.kofa/trunk/src/waeup/kofa/applicants/tests/test_export.py	(revision 18021)
@@ -22,4 +22,6 @@
 from waeup.kofa.testing import KofaUnitTestLayer, FunctionalLayer
 from waeup.kofa.utils.utils import KofaUtils
+
+curr_year = datetime.datetime.now().year
 
 class ApplicantsContainersExporterTest(unittest.TestCase):
@@ -319,14 +321,37 @@
     def test_export_filtered(self):
         self.applicant = self.setup_applicant(self.applicant)
+        cdate = str('%s#' % self.applicant['p120'].creation_date)
+        self.applicant['p120'].payment_date = datetime.datetime(
+            curr_year-6, 4, 1, 14, 12, 1)
         exporter = ApplicantPaymentExporter()
         exporter.export_filtered(
             self.app, self.outfile, container=self.container.code)
         result = open(self.outfile, 'rb').read()
-        cdate = str('%s#' % self.applicant['p120'].creation_date)
         self.assertEqual(
             'ac,amount_auth,creation_date,p_category,p_combi,p_id,'
             'p_item,p_session,p_state,payment_date,r_amount_approved,'
             'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n'
-            ',0.0,%s,application,[],p120,,2012,paid,,0.0,,,dp2011_654321,'
+            ',0.0,%s,application,[],p120,,2012,paid,2019-04-01 14:12:01#,0.0,'
+            ',,dp2011_654321,'
+            '123456,Anna M. Tester\r\n' % cdate, result)
+        exporter.export_filtered(
+            self.app, self.outfile, container=self.container.code,
+            p_start='03/02/2025', p_end='04/02/2025')
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            'ac,amount_auth,creation_date,p_category,p_combi,p_id,'
+            'p_item,p_session,p_state,payment_date,r_amount_approved,'
+            'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n',
+            result)
+        exporter.export_filtered(
+            self.app, self.outfile, container=self.container.code,
+            p_start='03/02/2019', p_end='04/05/2019')
+        result = open(self.outfile, 'rb').read()
+        self.assertEqual(
+            'ac,amount_auth,creation_date,p_category,p_combi,p_id,'
+            'p_item,p_session,p_state,payment_date,r_amount_approved,'
+            'r_code,r_desc,applicant_id,reg_number,display_fullname\r\n'
+            ',0.0,%s,application,[],p120,,2012,paid,2019-04-01 14:12:01#,0.0,'
+            ',,dp2011_654321,'
             '123456,Anna M. Tester\r\n' % cdate, result)
         return
