Index: main/waeup.kwarapoly/trunk/CHANGES.txt
===================================================================
--- main/waeup.kwarapoly/trunk/CHANGES.txt	(revision 11452)
+++ main/waeup.kwarapoly/trunk/CHANGES.txt	(revision 11453)
@@ -4,4 +4,7 @@
 1.0.1dev (unreleased)
 =====================
+
+* Method for disabling student payments customized. We can now
+  disable school fee payment for non-pg students.
 
 * jquery-ui.min.js is also used for tooltips.
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 11452)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/tests/test_browser.py	(revision 11453)
@@ -110,5 +110,5 @@
 
         # In KwaraPoly only returning students can create school fee payment
-        # without haveing paid accommodation fee
+        # without having paid accommodation fee
         IWorkflowState(self.student).setState('returning')
         configuration = createObject('waeup.SessionConfiguration')
@@ -464,2 +464,34 @@
 
         return
+
+    def test_payment_disabled(self):
+        IWorkflowState(self.student).setState('returning')
+        configuration = createObject('waeup.SessionConfiguration')
+        configuration.academic_session = 2005
+        self.app['configuration'].addSessionConfiguration(configuration)
+        self.browser.addHeader('Authorization', 'Basic mgr:mgrpw')
+        self.browser.open(self.payments_path)
+        self.browser.getLink("Add current session payment ticket").click()
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        self.app['configuration']['2005'].payment_disabled = ['sf_all']
+        self.browser.getLink("Add current session payment ticket").click()
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...Payment temporarily disabled...',
+                           self.browser.contents)
+        self.app['configuration']['2005'].payment_disabled = ['sf_non_pg']
+        # Non-PG students can't pay ...
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...Payment temporarily disabled...',
+                           self.browser.contents)
+        # ... but PG can pay.
+        self.certificate.study_mode = 'pg_ft'
+        self.browser.getControl(name="form.p_category").value = ['schoolfee']
+        self.browser.getControl("Create ticket").click()
+        self.assertMatches('...ticket created...',
+                           self.browser.contents)
+        return
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py	(revision 11452)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/students/utils.py	(revision 11453)
@@ -152,4 +152,14 @@
             # Bed has not yet been booked but beds are available.
             return True
+        return False
+
+    def _isPaymentDisabled(self, p_session, category, student):
+        academic_session = self._getSessionConfiguration(p_session)
+        if category == 'schoolfee':
+            if 'sf_all' in academic_session.payment_disabled:
+                return True
+            if 'sf_non_pg' in academic_session.payment_disabled and \
+                not student.is_postgrad:
+                return True
         return False
 
@@ -258,4 +268,6 @@
         elif category == 'schoolfee':
             amount += academic_session.penalty_ug
+        if self._isPaymentDisabled(p_session, category, student):
+            return _('Payment temporarily disabled.'), None
         payment = createObject(u'waeup.StudentOnlinePayment')
         timestamp = ("%d" % int(time()*10000))[1:]
Index: main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py
===================================================================
--- main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py	(revision 11452)
+++ main/waeup.kwarapoly/trunk/src/waeup/kwarapoly/utils/utils.py	(revision 11453)
@@ -102,4 +102,9 @@
         }
 
+    DISABLE_PAYMENT_GROUP_DICT = {
+        'sf_all': 'School Fee - All Students',
+        'sf_non_pg': 'School Fee - Non-PG Students',
+        }
+
     SPECIAL_HANDLING_DICT = {
         'regular': 'Regular Hostel',
