Index: /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 13295)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/students/tests/test_browser.py	(revision 13296)
@@ -618,8 +618,14 @@
         error, payment = utils.setPaymentDetails('bed_allocation',
             self.student, None, None)
+        self.assertTrue(u'Amount could not be determined.' in error)
+        self.student['studycourse'].current_session = 2004
+        self.student['studycourse'].entry_session = 2004
+        self.student['studycourse'].current_level = 100
+        error, payment = utils.setPaymentDetails('bed_allocation',
+            self.student, None, None)
         self.assertEqual(payment.p_level, 100)
         self.assertEqual(payment.p_session, 2004)
-        self.assertEqual(payment.amount_auth, 150.0)
-        self.assertEqual(payment.p_item, u'regular_male_re')
+        self.assertEqual(payment.amount_auth, 650.0) # plus 500 student union
+        self.assertEqual(payment.p_item, u'regular_male_fr')
         self.assertEqual(error, None)
 
@@ -985,5 +991,5 @@
         self.browser.getControl(name="ac_number").value = sfenumber
         self.browser.getControl("Create bed ticket").click()
-        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
+        self.assertMatches('...Hall 1, Block/Unit A, Room 101, Bed C...',
                            self.browser.contents)
         # Bed has been allocated.
@@ -995,5 +1001,5 @@
         # The bed ticket displays the data correctly.
         self.browser.open(self.acco_path + '/2004')
-        self.assertMatches('...Hall 1, Block A, Room 101, Bed C...',
+        self.assertMatches('...Hall 1, Block/Unit A, Room 101, Bed C...',
                            self.browser.contents)
         self.assertMatches('...2004/2005...', self.browser.contents)
Index: /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py
===================================================================
--- /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 13295)
+++ /main/waeup.uniben/trunk/src/waeup/uniben/students/utils.py	(revision 13296)
@@ -116,4 +116,6 @@
             sex = 'male'
         special_handling = 'regular'
+        if student.faccode == 'MED':
+            special_handling = 'clinical'
         d['bt'] = u'%s_%s_%s' % (special_handling,sex,bt)
         return d
@@ -181,6 +183,8 @@
             if stage == 'fr':
                 amount += 500.0
-            else:
+            elif stage == 'fi' and student.current_verdict in ('A', 'B'):
                 amount += 300.0
+            else:
+                amount = 0.0
         elif category == 'hostel_maintenance':
             amount = 0.0
