Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_edit_form.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_edit_form.pt	(revision 5167)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_edit_form.pt	(revision 5167)
@@ -0,0 +1,78 @@
+<tal:block define="rendered_main options/rendered;
+                   portal_status_message options/psm;
+                   data_storage options/ds|nothing;
+                   mode options/mode;
+                   edition python:1;
+                   info python: context.getAccommodationInfo();
+                   maintenance_online info/online_payment|nothing"
+                   >
+<metal:block define-macro="edit_form">
+  <metal:block use-macro="here/main_template/macros/master">
+  <metal:block fill-slot="header"
+    tal:define="creation creation|nothing;
+                edition edition|nothing;
+                metadata metadata|nothing"
+                >
+    </metal:block>
+      <metal:block fill-slot="main">
+      
+        <div style="text-align: right" tal:condition="python: mode == 'edit'">
+        <a href="" target="slip" tal:attributes="href string:accommodation_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Accommodation Slip
+        </a>
+        </div>      
+      
+        <h3 tal:condition="python: mode == 'create'">Book Your Accommodation! </h3>
+        <h3 tal:condition="python: mode == 'edit'">Pay Your Accommodation Maintenance Fee! </h3>
+        <br />
+        <div tal:replace="structure rendered_main" />
+        
+        <p tal:condition="not: maintenance_online">Instructions :</p>
+        
+        <ul tal:condition="python: mode == 'create' and not maintenance_online">
+                  <li>Buy a Hostel Application Scratch Card.</li> 
+            <li>Enter the PIN above and press 'Book'.</li>
+            <li>Print your Hostel Allocation Slip.</li>
+        </ul>
+ 
+        <tal:block condition="python: mode == 'edit'" >
+ 
+           <ul tal:condition="not: maintenance_online" tal:omit-tag="">
+             <li>Buy a Hostel Maintenance Scratch Card 
+               (Code: <span tal:replace="python: info['acco_doc'].acco_maint_code" />) for 
+               <span tal:replace="python: info['acco_doc'].acco_maint_fee" /> Nairas</li> 
+             <li>Enter the PIN above and press 'Save'.</li>
+             <li>Print your Hostel Maintenance Receipt.</li>
+           </ul>
+          
+        
+          <tal:block condition="maintenance_online">
+            <table tal:condition="not: info/maintenance_paid">
+              <tr >
+                <form action="pay_interswitch_acco" method="post" 
+                      enctype="multipart/form-data" class="workflow"
+                      >
+                  <input type="hidden" 
+                         name="paytype"
+                         value="HOM"
+                         />
+                  <td colspan="2">  
+                    <input type="submit" 
+                           class="standalone" 
+                           name="cpsdocument_create_button"
+                           value="Pay Maintenance Fee Online"
+                           />
+                  </td>
+                </form>
+              </tr>
+            </table>
+          </tal:block>
+        </tal:block>
+      </metal:block>
+      <metal:block fill-slot="sub">
+      </metal:block>
+    </metal:block>
+  </metal:block>
+</tal:block>
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_slip.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_slip.pt	(revision 5167)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_slip.pt	(revision 5167)
@@ -0,0 +1,26 @@
+<metal:body use-macro="here/slip_template/macros/master">
+    <metal:main fill-slot="main"
+                tal:define="info_acco context/getAccommodationInfo;
+                            info_app  context/getApplicationInfo">
+      <span tal:condition="python: not info_acco or not info_acco['acco']">
+            <span tal:content="here/illegal_view" />
+      </span>   
+      <span tal:condition="python: info_acco and info_acco['acco']">                   
+          <h3>Hostel Allocation Slip (including Maintenance Receipt)</h3>
+
+          <br />
+           
+        <span tal:omit-tag=""
+              tal:content="structure python: info_app['app_doc'].render(proxy=info_app['app_doc'],
+              layout_mode='view_info', 
+              layout_id='student_application')" 
+              />     
+          
+          <span tal:omit-tag=""
+                tal:content="structure python: info_acco['acco_doc'].render(proxy=info_acco['acco_doc'],
+                layout_mode='view_slip', 
+                layout_id='student_accommodation_fe')" 
+                />
+      </span>      
+    </metal:main>
+</metal:body>
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt	(revision 5167)
+++ WAeUP_SRP/trunk/skins/waeup_accommodation/accommodation_view.pt	(revision 5167)
@@ -0,0 +1,30 @@
+<metal:body use-macro="here/main_template/macros/master">
+    <metal:main fill-slot="main"
+            tal:define="info context/getAccommodationInfo">
+      <span tal:condition="python: not info or not info['acco']">
+        <span tal:content="here/illegal_view" />
+      </span>
+      <span tal:condition="python: info and info['acco']">
+
+        <div style="text-align: right">
+        <a href="" target="slip" tal:attributes="href string:accommodation_slip"
+            onclick="javascript:window.open('','slip','width=600, height=700, directories=no, toolbar=no, location=no, menubar=yes, scrollbars=yes, status=no, resizable=no, dependent=no')">
+            <img tal:attributes="src string:${here/portal_url}/actionicon_print.png" />
+            Accommodation Slip
+        </a>
+        </div>
+        <a href=""
+           tal:attributes="href string:${here/academicsParent}">
+          <img tal:attributes="src string:${here/portal_url}/arrow_up.gif"/>
+          Up one level
+        </a>        
+        <h3>My Accommodation Record</h3>
+        <br />
+        <span tal:omit-tag=""
+              tal:content="structure python: info['acco_doc'].render(proxy=info['acco_doc'],
+              layout_mode='view', 
+              layout_id='student_accommodation_fe')" 
+              />
+    </span>
+  </metal:main>
+</metal:body>
Index: WAeUP_SRP/trunk/skins/waeup_accommodation/reallocate_bed.py_not_used
===================================================================
--- WAeUP_SRP/trunk/skins/waeup_accommodation/reallocate_bed.py_not_used	(revision 4196)
+++ 	(revision )
@@ -1,107 +1,0 @@
-## Script (Python) "reallocate_bed"
-##bind container=container
-##bind context=context
-##bind namespace=
-##bind script=script
-##bind subpath=traverse_subpath
-##parameters=
-##title=
-##
-# $Id: reallocateBed.py 1206 2007-01-05 18:24:56Z joachim $
-"""
-reallocate beds
-"""
-import logging
-logger = logging.getLogger('Skins.reallocate_bed')
-
-request = context.REQUEST
-redirect = request.RESPONSE.redirect
-mtool = context.portal_membership
-wf = context.portal_workflow
-member = mtool.getAuthenticatedMember()
-member_id = str(member)
-path_info = request.get('PATH_INFO').split('/')
-
-if mtool.isAnonymousUser():
-    return None
-students = context.portal_url.getPortalObject().campus.students
-beds = context.portal_accommodation
-studs = context.students_catalog
-student_id = context.getStudentId()
-
-if student_id is not None:
-    logger.info('%s requests bed_change for %s' % (member_id,student_id))
-    info = context.getAccommodationInfo(student_id)
-    res = beds(student=student_id)
-    if len(res) == 0:
-        logger.info('No bed found for %s' % (student_id))
-        redirect("%s/%s" % (students.absolute_url(),student_id))
-    allocated_bed = res[0]
-    status = info['student_status']
-    student = student_id
-    bedtype = context.getBedStatusFromHall(allocated_bed.bed)
-    if not bedtype.endswith("reserved"):
-        logger.info('%s is NOT a reserved bed' % (bedtype))
-        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-    logger.info('%s reallocate reserved bed %s/%s' % (student_id,bedtype,status))
-    beds.modifyRecord(bed=allocated_bed.bed,
-                      student='',
-                      bed_type=bedtype)
-    code,bed = beds.searchAndReserveBed(student_id,status)
-    if code > 0:
-        #from Products.zdb import set_trace; set_trace()
-        d = {}
-        d['bed'] = bed
-        d['student_status'] = status
-        acco_info = context.waeup_tool.getHallInfo(bed)
-        d['acco_maint_code'] = acco_info.get('maintenance_code')
-        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
-        acco_doc = info['acco_doc']
-        acco_doc.edit(mapping=d)
-        return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-    logger.info('%s new bed allocation failed, code = %s' % (student_id,code))
-    return redirect("%s/%s/%s" % (students.absolute_url(),student,info['acco_id']))
-
-info = {}
-#records = [r for r in beds() if  r.student]
-records = beds.uniqueValuesFor('bed')
-list = []
-to_modify = []
-for b in records:
-    r = beds(bed=b)[0]
-    bedtype = context.getBedStatusFromHall(r.bed)
-    if not bedtype.endswith("reserved"):
-        #logger.info('"%s", "allocated bed is NOT reserved","%s"' % (student_id,bedtype))
-        #list.append("Student %s bed_type %s ok" % (r.student,bedtype))
-        continue
-    if not r.student:
-        beds.modifyRecord(bed=b,
-                      bed_type=bedtype)
-        list.append("Empty bed %s set to %s" % (r.bed,bedtype))
-        continue
-    info = context.getAccommodationInfo(r.student)
-    sbt = info.get('student_status',None)
-    if sbt is None:
-        continue
-    list.append("Student %s bed_type %s != %s" % (r.student,
-                                                  r.bed_type,
-                                                  bedtype))
-    to_modify.append((r.bed,r.student,info['student_status'],info['acco_doc'],bedtype))
-for former_bed, student, status,acco_doc,bedtype in to_modify:
-    beds.modifyRecord(bed=former_bed,
-                      student='',
-                      bed_type=bedtype)
-    code,bed = beds.searchAndReserveBed(student,status)
-    if code > 0:
-        #from Products.zdb import set_trace; set_trace()
-        d = {}
-        d['bed'] = bed
-        d['student_status'] = status
-        acco_info = context.waeup_tool.getHallInfo(bed)
-        d['acco_maint_code'] = acco_info.get('maintenance_code')
-        d['acco_maint_fee'] = acco_info.get('maintenance_fee')
-        acco_doc.edit(mapping=d)
-        list.append("Student %s got bed %s, code = %s" % (student,
-                                                              bed,
-                                                              code))
-return "\r".join(list)
