pas.views.settlement_run ======================== .. py:module:: pas.views.settlement_run Attributes ---------- .. autoapisummary:: pas.views.settlement_run.SettlementDataRow pas.views.settlement_run.PDF_CSS Functions --------- .. autoapisummary:: pas.views.settlement_run.view_settlement_runs pas.views.settlement_run.add_settlement_run pas.views.settlement_run.view_settlement_run pas.views.settlement_run._get_commission_totals pas.views.settlement_run._get_party_totals_for_export_all pas.views.settlement_run.generate_settlement_pdf pas.views.settlement_run._get_commission_settlement_data pas.views.settlement_run._generate_settlement_html pas.views.settlement_run._get_data_export_all pas.views.settlement_run.get_party_specific_totals pas.views.settlement_run._get_party_settlement_data pas.views.settlement_run.view_settlement_run_all_export pas.views.settlement_run.view_settlement_run_export pas.views.settlement_run.edit_settlement_run pas.views.settlement_run.delete_settlement_run Module Contents --------------- .. py:data:: SettlementDataRow .. py:data:: PDF_CSS :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ @page { size: A4; margin: 2.5cm 0.75cm 2cm 0.75cm; /* top right bottom left */ @top-right { content: "Staatskanzlei"; font-family: Helvetica, Arial, sans-serif; font-size: 8pt; } } body { font-family: Helvetica, Arial, sans-serif; font-size: 7pt; line-height: 1.2; } table { border-collapse: collapse; margin-top: 1cm; width: 100%; table-layout: fixed; } /* Journal entries table - updated column widths */ .journal-table th:nth-child(1), /* Date */ .journal-table td:nth-child(1) { width: 20pt; } .journal-table th:nth-child(2), /* Personnel Number */ .journal-table td:nth-child(2) { width: 20pt; } .journal-table th:nth-child(3), /* Person */ .journal-table td:nth-child(3) { width: 80pt; } .journal-table th:nth-child(4), /* Type */ .journal-table td:nth-child(4) { width: 170pt; } .journal-table th:nth-child(5), /* Value */ .journal-table td:nth-child(5), .journal-table th:nth-child(6), /* CHF */ .journal-table td:nth-child(6), .journal-table th:nth-child(7), /* CHF + TZ */ .journal-table td:nth-child(7) { width: 30pt; } /* Party summary table */ .summary-table th:nth-child(1), /* Name */ .summary-table td:nth-child(1) { width: 120pt; } .summary-table th:nth-child(2), /* Meetings */ .summary-table td:nth-child(2), .summary-table th:nth-child(3), /* Expenses */ .summary-table td:nth-child(3), .summary-table th:nth-child(4), /* Total */ .summary-table td:nth-child(4), .summary-table th:nth-child(5), /* COLA */ .summary-table td:nth-child(5), .summary-table th:nth-child(6), /* Final */ .summary-table td:nth-child(6) { width: 60pt; } /* Dark header for title row */ th[colspan="6"] { background-color: #707070; color: white; font-weight: bold; text-align: left; padding: 2pt; border: 1pt solid #000; } th:not([colspan]) { background-color: #d5d7d9; font-weight: bold; text-align: left; padding: 2pt; border: 1pt solid #000; } td { padding: 2pt; border: 1pt solid #000; } tr:nth-child(even):not(.total-row) td { background-color: #f3f3f3; } .numeric { text-align: right; } .total-row { font-weight: bold; background-color: #d5d7d9; } .summary-table { margin-top: 2cm; /* page-break-before: always; */ } """ .. raw:: html
.. py:function:: view_settlement_runs(self: onegov.pas.collections.SettlementRunCollection, request: onegov.town6.request.TownRequest) -> onegov.core.types.RenderData .. py:function:: add_settlement_run(self: onegov.pas.collections.SettlementRunCollection, request: onegov.town6.request.TownRequest, form: onegov.pas.forms.SettlementRunForm) -> onegov.core.types.RenderData | webob.Response .. py:function:: view_settlement_run(self: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest) -> onegov.core.types.RenderData A page where all exports are listed and grouped by category. .. py:function:: _get_commission_totals(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, commission: onegov.pas.models.Commission) -> list[TotalRow] Get totals for a specific commission grouped by party. .. py:function:: _get_party_totals_for_export_all(self: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest) -> list[tuple[str, decimal.Decimal, decimal.Decimal, decimal.Decimal, decimal.Decimal, decimal.Decimal]] Get totals grouped by party. .. py:function:: generate_settlement_pdf(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, entity_type: Literal['all', 'commission', 'party', 'parliamentarian'], entity: onegov.pas.models.Commission | onegov.pas.models.Party | onegov.pas.models.Parliamentarian | None = None) -> bytes Entry point for almost all settlement PDF generations. .. py:function:: _get_commission_settlement_data(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, commission: onegov.pas.models.Commission) -> list[SettlementDataRow] Get settlement data for a specific commission. .. py:function:: _generate_settlement_html(settlement_data: list[SettlementDataRow], totals: list[TotalRow], subtitle: str) -> str Generate HTML for settlement PDF. .. py:function:: _get_data_export_all(self: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest) -> list[SettlementDataRow] .. py:function:: get_party_specific_totals(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, party: onegov.pas.models.Party) -> list[TotalRow] Get totals for a specific party. .. py:function:: _get_party_settlement_data(settlement_run: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, party: onegov.pas.models.Party) -> list[SettlementDataRow] Get settlement data for a specific party. .. py:function:: view_settlement_run_all_export(self: onegov.pas.path.SettlementRunAllExport, request: onegov.town6.request.TownRequest) -> webob.Response Generate export data for a specific entity in a settlement run. .. py:function:: view_settlement_run_export(self: onegov.pas.path.SettlementRunExport, request: onegov.town6.request.TownRequest) -> webob.Response Generate export data for a specific entity (commission, party or parliamentarian) in a settlement run. .. py:function:: edit_settlement_run(self: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest, form: onegov.pas.forms.SettlementRunForm) -> onegov.core.types.RenderData | webob.Response .. py:function:: delete_settlement_run(self: onegov.pas.models.SettlementRun, request: onegov.town6.request.TownRequest) -> None