|
1 | 1 | from __future__ import annotations |
2 | 2 | from collections import defaultdict |
3 | 3 | from io import BytesIO |
4 | | -from decimal import Decimal, ROUND_HALF_UP |
| 4 | +from decimal import Decimal |
5 | 5 | from operator import itemgetter |
6 | 6 | import xlsxwriter |
7 | 7 |
|
|
18 | 18 | LOHNART_ALLOWANCE_TEXT, |
19 | 19 | ) |
20 | 20 | from onegov.pas.utils import get_parliamentarians_with_settlements |
21 | | -from onegov.pas.utils import is_commission_president |
| 21 | +from onegov.pas.utils import is_president_for_attendance |
22 | 22 | from onegov.pas.models.parliamentarian_role import PASParliamentarianRole |
23 | 23 | from onegov.pas.models.party import Party |
24 | 24 | from sqlalchemy import or_ |
@@ -133,7 +133,7 @@ def get_abschlussliste_data( |
133 | 133 |
|
134 | 134 | for att in attendances: |
135 | 135 | p = att.parliamentarian |
136 | | - is_president = is_commission_president(p, att, settlement_run) |
| 136 | + is_president = is_president_for_attendance(p, att, settlement_run) |
137 | 137 | compensation = calculate_attendance_compensation( |
138 | 138 | rate_set=rate_set, |
139 | 139 | attendence_type=att.type, |
@@ -252,7 +252,7 @@ def generate_abschlussliste_xlsx( |
252 | 252 | for details_row_num, att in enumerate(attendances, start=1): |
253 | 253 | p = att.parliamentarian |
254 | 254 | party = details_party_lookup[str(p.id)] |
255 | | - is_president = is_commission_president(p, att, settlement_run) |
| 255 | + is_president = is_president_for_attendance(p, att, settlement_run) |
256 | 256 | compensation = calculate_attendance_compensation( |
257 | 257 | rate_set=rate_set, |
258 | 258 | attendence_type=att.type, |
@@ -349,7 +349,7 @@ def generate_buchungen_abrechnungslauf_xlsx( |
349 | 349 | party_name = party.name if party else '' |
350 | 350 |
|
351 | 351 | # Calculate rates |
352 | | - is_president = is_commission_president( |
| 352 | + is_president = is_president_for_attendance( |
353 | 353 | parliamentarian, |
354 | 354 | att, |
355 | 355 | settlement_run, |
@@ -463,11 +463,7 @@ def generate_buchungen_abrechnungslauf_xlsx( |
463 | 463 | worksheet.write( |
464 | 464 | row_num, |
465 | 465 | 5, |
466 | | - float( |
467 | | - row_data['value'].quantize( |
468 | | - Decimal('0.01'), rounding=ROUND_HALF_UP |
469 | | - ) |
470 | | - ), |
| 466 | + float(row_data['value']), |
471 | 467 | cell_format, |
472 | 468 | ) |
473 | 469 | worksheet.write( |
|
0 commit comments