Changeset 15244 for main/waeup.kofa/trunk/src
- Timestamp:
- 15 Nov 2018, 10:24:58 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.kofa/trunk/src/waeup/kofa/students/reports/student_payment_statistics.py
r15243 r15244 92 92 if entry_session != 0 and stud.entry_session != entry_session: 93 93 continue 94 if breakdown == 'faccode': 95 if getattr(stud, 'faccode') not in paths: 96 # studs can have a faccode ``None`` 97 continue 94 if None in (getattr(stud, 'faccode'), getattr(stud, 'depcode')): 95 continue 98 96 # Dep codes are not unique. 99 97 if breakdown == 'depcode': … … 163 161 i = 0 164 162 while i < len(data[idx]): 165 row.append("%s (%s)" % ("{:,}".format(data[idx][i+1]), data[idx][i])) 163 if row_name == 'Total': 164 row.append( 165 "%s\n(%s)" % ("{:,}".format(data[idx][i+1]), data[idx][i])) 166 else: 167 row.append( 168 "%s (%s)" % ("{:,}".format(data[idx][i+1]), data[idx][i])) 166 169 i += 2 167 170 row = [row_name] + row … … 242 245 def create_pdf(self, job_id): 243 246 creator = getUtility(IPDFCreator, name=self.pdfcreator) 244 maxlength = len(str(self.data[2][-1][-1])) \245 + len(str(self.data[2][-1][-2])) \246 + 3247 maxlength = max(maxlength, 10)247 # maxlength = len(str(self.data[2][-1][-1])) \ 248 # + len(str(self.data[2][-1][-2])) \ 249 # + 3 250 # maxlength = max(maxlength, 10) 248 251 table_data = tbl_data_to_table(*self.data) 249 col_widths = [None,] + [.17*cm*maxlength] * len(self.data[1]) + [None,]252 # col_widths = [None,] + [.17*cm*maxlength] * len(self.data[1]) + [None,] 250 253 pdf_data = [Paragraph('<b>%s - Report %s</b>' 251 254 % (self.creation_dt_string, job_id), … … 266 269 Spacer(1, 12),] 267 270 pdf_data += [ 268 Table(table_data, style=TABLE_STYLE , colWidths=col_widths)]271 Table(table_data, style=TABLE_STYLE)] 269 272 right_footer = translate( 270 _(' ${a} Student Payments - ${b} -',271 mapping = {'a':self.mode, 'b':self.session }))273 _('Student Payments - ${a} - ${b} - ${c} - ', 274 mapping = {'a':self.mode, 'b':self.session, 'c':self.level})) 272 275 pdf = creator.create_pdf( 273 276 pdf_data, None, self.title, self.author, right_footer
Note: See TracChangeset for help on using the changeset viewer.