Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10680)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_browser.py	(revision 10681)
@@ -199,4 +199,5 @@
         hostel.hostel_id = u'hall-1'
         hostel.hostel_name = u'Hall 1'
+        hostel.maint_fee = 876.0
         self.app['hostels'].addHostel(hostel)
         bed = Bed()
@@ -2941,4 +2942,18 @@
         self.assertMatches('...Payment ticket created...',
                            self.browser.contents)
+
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[0]
+        # Maintennace fee is taken from the hostel object
+        self.assertEqual(self.student['payments'][value].amount_auth, 876.0)
+        # If the hostel's maintenance fee isn't set, the fee is
+        # taken from the session configuration object.
+        self.app['hostels']['hall-1'].maint_fee = 0.0
+        self.browser.open(self.payments_path + '/addop')
+        self.browser.getControl(name="form.p_category").value = ['hostel_maintenance']
+        self.browser.getControl("Create ticket").click()
+        ctrl = self.browser.getControl(name='val_id')
+        value = ctrl.options[1]
+        self.assertEqual(self.student['payments'][value].amount_auth, 987.0)
         return
 
Index: /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py
===================================================================
--- /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 10680)
+++ /main/waeup.kofa/trunk/src/waeup/kofa/students/utils.py	(revision 10681)
@@ -406,9 +406,14 @@
             amount = academic_session.booking_fee
         elif category == 'hostel_maintenance':
-            amount = academic_session.maint_fee
+            amount = 0.0
             bedticket = student['accommodation'].get(
                 str(student.current_session), None)
             if bedticket:
                 p_item = bedticket.bed_coordinates
+                if bedticket.bed.__parent__.maint_fee > 0:
+                    amount = bedticket.bed.__parent__.maint_fee
+                else:
+                    # fallback
+                    amount = academic_session.maint_fee
             else:
                 # Should not happen because this is already checked
