Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py	(revision 11783)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/applicant.py	(revision 11784)
@@ -31,4 +31,11 @@
     grok.provides(ICustomApplicant)
 
+    def admchecking_fee_paid(self):
+        for key in self.keys():
+            ticket = self[key]
+            if ticket.p_state == 'paid' and ticket.p_category == 'admission_checking':
+                return True
+        return False
+
 # Set all attributes of CustomApplicant required in ICustomApplicant as field
 # properties. Doing this, we do not have to set initial attributes
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 11783)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser.py	(revision 11784)
@@ -19,11 +19,15 @@
 """
 import grok
+from time import time
 from zope.component import getUtility, createObject
 from zope.security import checkPermission
+from hurry.workflow.interfaces import IWorkflowState
+from waeup.kofa.browser.layout import action, UtilityView
 from waeup.kofa.interfaces import IExtFileStore
 from waeup.kofa.applicants.browser import (
     ApplicantRegistrationPage, ApplicantsContainerPage,
     ApplicationFeePaymentAddPage,
-    OnlinePaymentApprovePage)
+    OnlinePaymentApprovePage,
+    ExportPDFPageApplicationSlip)
 from waeup.kofa.applicants.interfaces import (
     ISpecialApplicant, IApplicantsUtils)
@@ -34,4 +38,5 @@
 from waeup.uniben.applicants.interfaces import (
     ICustomApplicant)
+from waeup.kofa.applicants.workflow import ADMITTED, PAID
 
 from waeup.uniben.interfaces import MessageFactory as _
@@ -112,16 +117,42 @@
                and self.context.state in ('paid', 'submitted') 
 
-    # customizations for admission checking payments
+    # Customizations for admission checking payments
+
     @property
     def form_fields(self):
-        if self.context.special:
-            form_fields = grok.AutoFields(ISpecialApplicant).omit('locked')
-        else:
-            form_fields = grok.AutoFields(ICustomApplicant).omit(
-                'locked', 'course_admitted', 'password', 'suspended')
+        form_fields = super(CustomApplicantDisplayFormPage, self).form_fields
+        if not self.context.admchecking_fee_paid():
+            form_fields = form_fields.omit(
+                'screening_score', 'aggregate', 'student_id')
         return form_fields
 
+    @property
+    def display_actions(self):
+        state = IWorkflowState(self.context).getState()
+        actions = []
+        if state == ADMITTED and not self.context.admchecking_fee_paid():
+            actions = [_('Add admission checking payment ticket')]
+        return actions
+
+
+    def getCourseAdmitted(self):
+        """Return link, title and code in html format to the certificate
+           admitted.
+        """
+        course_admitted = self.context.course_admitted
+        if getattr(course_admitted, '__parent__',None) and \
+            self.context.admchecking_fee_paid():
+            url = self.url(course_admitted)
+            title = course_admitted.title
+            code = course_admitted.code
+            return '<a href="%s">%s - %s</a>' %(url,code,title)
+        return ''
+
+    @action(_('Add admission checking payment ticket'), style='primary')
+    def addPaymentTicket(self, **data):
+        self.redirect(self.url(self.context, '@@addacp'))
+        return
+
 class CustomNigeriaPDFApplicationSlip(NigeriaPDFApplicationSlip):
-
 
     @property
@@ -147,27 +178,39 @@
         return ''
 
-    # customizations for admission checking payments
+class AdmissionCheckingFeePaymentAddPage(UtilityView, grok.View):
+    """ Page to add an admission checking online payment ticket.
+    """
+    grok.context(ICustomApplicant)
+    grok.name('addacp')
+    grok.require('waeup.payApplicant')
+    factory = u'waeup.ApplicantOnlinePayment'
+
+    def _setPaymentDetails(self, payment):
+        container = self.context.__parent__
+        timestamp = ("%d" % int(time()*10000))[1:]
+        session = str(container.year)
+        try:
+            session_config = grok.getSite()['configuration'][session]
+        except KeyError:
+            return _(u'Session configuration object is not available.'), None
+        payment.p_id = "p%s" % timestamp
+        payment.p_item = container.title
+        payment.p_session = container.year
+        payment.amount_auth = 0.0
+        payment.p_category = 'admission_checking'
+        payment.amount_auth = session_config.admchecking_fee
+        if payment.amount_auth in (0.0, None):
+            return _('Amount could not be determined.'), None
+        return
+
     def update(self):
-        # Additional requirements in custom packages.
-        if self.custom_requirements:
-            self.flash(
-                self.custom_requirements,
-                type='danger')
-            self.redirect(self.url(self.context))
-            return
-        if not self.context.special:
-            for key in self.context.keys():
-                ticket = self.context[key]
-                if ticket.p_state == 'paid':
-                      self.flash(
-                          _('This type of payment has already been made.'),
-                          type='warning')
-                      self.redirect(self.url(self.context))
-                      return
-        applicants_utils = getUtility(IApplicantsUtils)
-        container = self.context.__parent__
+        if self.context.admchecking_fee_paid():
+              self.flash(
+                  _('Admission checking payment has already been made.'),
+                  type='warning')
+              self.redirect(self.url(self.context))
+              return
         payment = createObject(self.factory)
-        failure = applicants_utils.setPaymentDetails(
-            container, payment, self.context)
+        failure = self._setPaymentDetails(payment)
         if failure is not None:
             self.flash(failure[0], type='danger')
@@ -179,4 +222,7 @@
         return
 
+    def render(self):
+        return
+
 
 class CustomApplicantManageFormPage(NigeriaApplicantManageFormPage):
@@ -191,7 +237,18 @@
     """
 
-    # customizations for admission checking payments
+
     def update(self):
-        flashtype, msg, log = self.context.approveApplicantPayment()
+        if self.context.p_category == 'admission_checking':
+            if self.context.p_state == 'paid':
+                flashtype = 'warning'
+                msg = _('This ticket has already been paid.')
+                log = None
+            else:
+                self.context.approve()
+                log = 'payment approved: %s' % self.context.p_id
+                msg = _('Payment approved')
+                flashtype = 'success'
+        else:
+            flashtype, msg, log = self.context.approveApplicantPayment()
         if log is not None:
             applicant = self.context.__parent__
@@ -206,2 +263,17 @@
         self.flash(msg, type=flashtype)
         return
+
+class CustomExportPDFPageApplicationSlip(ExportPDFPageApplicationSlip):
+    """Deliver a PDF slip of the context.
+    """
+
+
+    def update(self):
+        super(CustomExportPDFPageApplicationSlip, self).update()
+        if self.context.state == ADMITTED and \
+            not self.context.admchecking_fee_paid():
+            self.flash(
+                _('Please pay admission checking fee before trying to download '
+                  'the application slip.'), type='warning')
+            return self.redirect(self.url(self.context))
+        return
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/applicantdisplaypage.pt
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/applicantdisplaypage.pt	(revision 11783)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/browser_templates/applicantdisplaypage.pt	(revision 11784)
@@ -109,2 +109,12 @@
   </tbody>
 </table>
+<form action="." tal:attributes="action request/URL" method="post"
+      i18n:domain="waeup.kofa">
+  <div tal:condition="view/availableActions">
+    <span tal:repeat="action view/actions"
+          tal:omit-tag="">
+      <input tal:condition="python:action.label in view.display_actions"
+             tal:replace="structure action/render"/>
+    </span>
+  </div>
+</form>
Index: /main/waeup.uniben/trunk/src/waeup/uniben/applicants/viewlets.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/applicants/viewlets.py	(revision 11784)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/applicants/viewlets.py	(revision 11784)
@@ -0,0 +1,33 @@
+## $Id: viewlets.py 11599 2014-04-24 06:17:10Z henrik $
+##
+## Copyright (C) 2011 Uli Fouquet & Henrik Bettermann
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+## GNU General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+##
+
+from waeup.kofa.applicants.viewlets import PDFActionButton
+
+class CustomPDFActionButton(PDFActionButton):
+
+    @property
+    def target_url(self):
+        """Get a URL to the target...
+        """
+        if self.context.state in ('initialized', 'started', 'paid') \
+            or self.context.special:
+            return
+        if self.context.state == 'admitted' and \
+            not self.context.admchecking_fee_paid():
+            return
+        return self.view.url(self.view.context, self.target)
