Changeset 12564 for main/waeup.kofa/trunk
- Timestamp:
- 6 Feb 2015, 18:47:37 (10 years ago)
- Location:
- main/waeup.kofa/trunk/src/waeup/kofa
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py
r12563 r12564 54 54 """ 55 55 site = grok.getSite() 56 payment_cats = ('clearance', 'gown', 'hostel_maintenance', 'schoolfee')57 payment_cats = payment_cats+ ('Total',)56 payment_cats_dict = getUtility(IKofaUtils).REPORTABLE_PAYMENT_CATEGORIES 57 payment_cats = tuple(sorted(payment_cats_dict.keys())) + ('Total',) 58 58 if breakdown == 'faccode': 59 59 codes = tuple(sorted([x for x in site['faculties'].keys()], … … 108 108 109 109 # Build table header 110 utils = getUtility(IKofaUtils)111 112 113 110 table_header = ['' for x in xrange(len(payment_cats))] 114 111 for cat in payment_cats: 115 cat_title = utils.PAYMENT_CATEGORIES.get(cat, cat)112 cat_title = payment_cats_dict.get(cat, cat) 116 113 table_header[payment_cats.index(cat)] = cat_title 117 114 118 # Convert float into int119 table = [[int(col) for col in row] for row in table]120 115 # Turn lists into tuples 121 116 table = tuple([tuple(row) for row in table]) … … 148 143 i = 0 149 144 while i < len(data[idx]): 150 row.append("%s (%s)" % ( data[idx][i+1], data[idx][i]))145 row.append("%s (%s)" % ("{:,}".format(data[idx][i+1]), data[idx][i])) 151 146 i += 2 152 147 row = [row_name] + row … … 160 155 ('FONT', (0,-1), (-1,-1), 'Helvetica-Bold', 8), 161 156 ('FONT', (-1,0), (-1,-1), 'Helvetica-Bold', 8), 162 ('ALIGN', ( 1,1), (-1,-1), 'RIGHT'),157 ('ALIGN', (0,0), (-1,-1), 'RIGHT'), 163 158 ('INNERGRID', (0,0), (-1,-1), 0.25, colors.black), 164 159 ('LINEBELOW', (0,-1), (-1,-1), 0.25, colors.black), -
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/tests/test_student_payment_statistics.py
r12563 r12564 37 37 'Hostel Maintenance Fee', 'School Fee', 38 38 'Total'], 39 ((0, 0, 0, 0, 0, 0, 1, 5, 1, 5),40 (0, 0, 0, 0, 0, 0, 1, 5, 1, 5)))39 ((0, 0, 0, 0, 0, 0, 1, 12345.678, 1, 12345.678), 40 (0, 0, 0, 0, 0, 0, 1, 12345.678, 1, 12345.678))) 41 41 ) 42 42 self.assertEqual( -
main/waeup.kofa/trunk/src/waeup/kofa/students/tests/test_catalog.py
r12562 r12564 90 90 payment.p_session = 2010 91 91 payment.p_category = 'schoolfee' 92 payment.amount_auth = 5.67892 payment.amount_auth = 12345.678 93 93 payment.p_state = 'paid' 94 94 self.student['payments'][payment.p_id] = payment -
main/waeup.kofa/trunk/src/waeup/kofa/utils/utils.py
r11969 r12564 181 181 PREVIOUS_PAYMENT_CATEGORIES = deepcopy(SELECTABLE_PAYMENT_CATEGORIES) 182 182 183 REPORTABLE_PAYMENT_CATEGORIES = { 184 'schoolfee': 'School Fee', 185 'clearance': 'Acceptance Fee', 186 'hostel_maintenance': 'Hostel Maintenance Fee', 187 'gown': 'Gown Hire Fee', 188 } 189 183 190 BALANCE_PAYMENT_CATEGORIES = { 184 191 'schoolfee': 'School Fee',
Note: See TracChangeset for help on using the changeset viewer.