Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodations.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodations.pt	(revision 5619)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodations.pt	(revision 5621)
@@ -36,9 +36,9 @@
                 tal:content="python:context.getFormattedBed(row['bed'])" />
 
-            <td tal:condition="not:row/paid">
-              <a 
-                 tal:attributes="href string:${row/url}/pay_accommodation?session=${row/session}">
+            <td>
+              <a tal:condition="row/current_unpaid"
+                 tal:attributes="href string:${row/url}/pay_accommodation">
                  [pay maintenance fee]
-              </a> 
+              </a> &nbsp;
             </td>
 
@@ -50,15 +50,15 @@
               </a> 
             </td>
-            <td tal:condition="row/cancellation_allowed">
-              <a href=""
+            <td>
+              <a tal:condition="row/cancellation_allowed" href=""
                  tal:attributes="href string:${row/url}/cancel_allocation?session=${row/session}">
                  [cancel booking]
-              </a> 
+              </a> &nbsp;
             </td>            
-            <td tal:condition="row/relocation_allowed">
-              <a href="" 
+            <td>
+              <a  tal:condition="row/relocation_allowed" href="" 
                  tal:attributes="href string:${row/url}/relocate?session=${row/session}">
                  [relocate]
-              </a> 
+              </a> &nbsp;
             </td>             
           </tr>
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationRecords.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationRecords.py	(revision 5619)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationRecords.py	(revision 5621)
@@ -51,12 +51,16 @@
 for ar in accommodation_records:
     row = {}
+    row['sort_param'] = ar.session[-2:]  # in 2006 we used the session attribute was 2006 and not 06
     row['session'] = ar.session
     row['bed'] = ar.bed
     row['reservation_status'] = ar.reservation_status
     row['paid'] = ar.reservation_status == 'maintenance_fee_paid'
+    row['current_unpaid'] = not row['paid'] and ar.session == portal_session
     row['url'] = student_path
     row['cancellation_allowed'] = info['is_so'] and ar.session == portal_session
     row['relocation_allowed'] = info['is_so'] and ar.session == portal_session
     accommodations.append(row)
+
+accommodations.sort(cmp=lambda x,y: cmp(x['sort_param'],y['sort_param']))
 
 info['accommodations'] = accommodations
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationStatus.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationStatus.py	(revision 5619)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/getAccommodationStatus.py	(revision 5621)
@@ -173,4 +173,5 @@
 info['acco_res_sc_pin'] = accommodation_record.acco_res_sc_pin
 info['acco_maint_fee'] = accommodation_record.acco_maint_fee
+info['acco_maint_code'] = accommodation_record.acco_maint_code
 info['student_status'] = accommodation_record.student_status
 info['bed'] = accommodation_record.bed
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation.py
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation.py	(revision 5619)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation.py	(revision 5621)
@@ -54,5 +54,4 @@
 if psm == 'invalid':
     member_id = str(context.portal_membership.getAuthenticatedMember())
-    #logger.info('%s, %s' % (member_id,info['error'] ))
     logger.info('%s entered invalid data' % (member_id))
     psm = "Please correct your input."
@@ -77,6 +76,7 @@
 data['reservation_status'] = 'maintenance_fee_paid'
 
-#set_trace()
 context.accommodation_catalog.modifyRecord(**data)
+
+logger.info('%s paid accommodation in session %s' % (student_id,session))
 
 return context.REQUEST.RESPONSE.redirect("%s/accommodations" % student.absolute_url())
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation_form.pt	(revision 5619)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/pay_accommodation_form.pt	(revision 5621)
@@ -22,6 +22,6 @@
         <ul tal:condition="not: maintenance_online">
              <li>Buy a Hostel Maintenance Scratch Card 
-               (Code: <span tal:replace="python: 'acco_maint_code'" />) for 
-               <span tal:replace="python: 'acco_maint_fee'" /> Nairas</li> 
+               (Code: <span tal:replace="info/acco_maint_code" />) for 
+               <span tal:replace="info/acco_maint_fee" /> Nairas</li> 
              <li>Enter the PIN above and press 'Submit'.</li>
              <li>Print your Hostel Maintenance Receipt.</li>
