pas.utils ========= .. py:module:: pas.utils Functions --------- .. autoapisummary:: pas.utils.format_swiss_number pas.utils.is_commission_president pas.utils.get_parliamentarians_with_settlements pas.utils.get_parties_with_settlements pas.utils.get_commissions_with_memberships pas.utils.debug_party_export pas.utils.debug_party_export2 Module Contents --------------- .. py:function:: format_swiss_number(value: decimal.Decimal | int) -> str .. py:function:: is_commission_president(parliamentarian: onegov.pas.models.parliamentarian.PASParliamentarian, attendance_or_commission_id: onegov.pas.models.attendence.Attendence | uuid.UUID, settlement_run: onegov.pas.models.SettlementRun) -> bool Check if a parliamentarian is president of the commission for the given attendance or commission_id during the settlement run period. .. py:function:: get_parliamentarians_with_settlements(session: sqlalchemy.orm.Session, start_date: datetime.date, end_date: datetime.date) -> list[onegov.pas.models.parliamentarian.PASParliamentarian] Get all parliamentarians who were active and had settlements during the specified period. .. py:function:: get_parties_with_settlements(session: sqlalchemy.orm.Session, start_date: datetime.date, end_date: datetime.date) -> list[onegov.pas.models.party.Party] Get all parties that had active members with attendances during the specified period. This function ensures accurate party filtering by checking that parliamentarians were active members of their party at the time of each attendance, properly handling cases where parliamentarians switch parties or have changing membership dates. .. py:function:: get_commissions_with_memberships(session: sqlalchemy.orm.Session, start_date: datetime.date, end_date: datetime.date) -> list[onegov.pas.models.commission.PASCommission] Get all commissions that had active memberships during the specified period. This function ensures accurate commission filtering by checking that commissions had active members during the period, properly handling cases where memberships have changing dates. .. py:function:: debug_party_export(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, party: onegov.pas.models.party.Party) -> None Debug function to trace party export data retrieval .. py:function:: debug_party_export2(request: onegov.town6.request.TownRequest, party: onegov.pas.models.party.Party) -> None