- Timestamp:
- 6 Sep 2023, 05:08:23 (16 months ago)
- Location:
- main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser.py
r17549 r17572 263 263 def _schoolfee_payments_made(self): 264 264 cs = self.context.student.current_session 265 es = self.context.student.entry_session 265 266 SF_PAYMENTS = ('schoolfee', 'schoolfee40', 'secondinstal', 'clearance') 266 267 sf_paid = dict() … … 269 270 except (AttributeError, TypeError): 270 271 return sf_paid, 0 271 session = self.context.student.entry_session272 session = es 272 273 # Initiliaze sf_paid dict with items 273 # session: [school fee in session, ,amount paid in session, amount due]274 # session: [school fee in session, amount paid in session, amount due] 274 275 sf_paid[session] = [getattr(certificate, 'school_fee_1', 0.0), 0.0, 0.0] 275 276 while session < cs + 1: … … 290 291 ticket.p_category == 'brought_fwd': 291 292 brought_fwd += ticket.amount_auth 292 # Calculate due, first entry session 293 entry_session = sessions[0] 294 # amount due in session = brought forward from previous sessions + school fee in session - amount paid in session 295 sf_paid[entry_session][2] = brought_fwd + sf_paid[entry_session][0] - sf_paid[entry_session][1] 296 for session in sessions[1:]: 293 # Calculate due, first for the entry session 294 # amount due in session = brought forward from previous sessions + school fees in session - amount paid in session 295 session = es 296 sf_paid[session][2] = brought_fwd + sf_paid[session][0] - sf_paid[session][1] 297 while session < cs + 1: 298 session += 1 297 299 # amount due in session = brought forward from previous session + school fee in session - amount paid in session 298 300 sf_paid[session][2] = sf_paid[session-1][2] + sf_paid[session][0] - sf_paid[session][1] … … 301 303 def update(self): 302 304 super(CustomPaymentsManageFormPage, self).update() 303 #self.sfp_made = self._schoolfee_payments_made()305 self.sfp_made = self._schoolfee_payments_made() 304 306 return 305 307 -
main/kofacustom.iuokada/trunk/src/kofacustom/iuokada/students/browser_templates/paymentsmanagepage.pt
r17548 r17572 43 43 </span> 44 44 </div> 45 45 <br /><br /> 46 <p tal:condition="python: True"> 47 <strong>Balance Brought Forward:</strong> <span tal:content ="python: view.sfp_made[1]">BROUGHTFORWARD</span> 48 </p> 49 <br /> 50 <table class="table" style="width: 50%;" tal:condition="python: True"> 51 <thead> 52 <tr> 53 <th i18n:translate="">Session</th> 54 <th i18n:translate="">School Fees</th> 55 <th i18n:translate="">Amount Paid</th> 56 <th i18n:translate="">Amount Due</th> 57 </tr> 58 </thead> 59 <tbody> 60 <tr tal:repeat="sfpm python: view.sfp_made[0]"> 61 <td tal:content ="python: '%s/%s' %(sfpm[0],sfpm[0]+1)">SESSION</td> 62 <td tal:content ="python: sfpm[1][0]">FEE</td> 63 <td tal:content ="python: sfpm[1][1]">AMOUNT PAID</td> 64 <td tal:content ="python: sfpm[1][2]">TOTAL AMOUNT DUE</td> 65 </tr> 66 </tbody> 67 </table> 46 68 </form>
Note: See TracChangeset for help on using the changeset viewer.