aeat.application.modelo._result_summary module¶
Headline result summary for a persisted calculation revision.
work calculate and work revision render every casilla a modelo
declares — 2235 rows for Modelo 100. The figures an operator actually
looks for (the result to pay or refund, the key computed totals) are
buried in that flat table. This module distills a persisted
CalculationRevision into a short, registry-grounded summary of
the headline casillas, so the CLI can lead with it before the full
table.
The headline casillas are taken from the modelo’s own registry
metadata, never hand-picked. The revision’s parent WorkUnit
selects the registry snapshot, whose VerificationExpectationDefinition
entries use reconciliation_total_casilla_ids for result-to-pay /
result-to-refund casillas and computed_casilla_ids for the modelo’s
key computed outputs.
This is a presentation summary only. It does not derive the fichero
Tipo de declaración result disposition, apply Modelo 303 refund elections,
or decide cross-period carry-forward; that single determined fact belongs to
aeat.application.modelo.resolve_modelo_result_disposition().
See also
aeat.application.modelo.resolve_modelo_result_disposition()Determines the filed result disposition that export and carry-forward persistence read.
aeat.application.filing.summarise_calculation()Draft-calculation summary surface for filing workflows; this module handles persisted modelo revisions instead.
- class ResultSummaryRow(**data)[source]¶
Bases:
BaseModelOne application row for a headline casilla in a calculation summary.
Rows are emitted only for casillas present in the source
CalculationRevisionvalues.result_ingresarandresult_devolveridentify registry-declared reconciliation totals;key_figureidentifies a computed output retained for the CLI summary.labelremains the official Spanish invariant;localized_labelscarries registry-provided operator-facing display labels for other output languages. CLI JSON rendering serializes this model intoResultSummaryRowPayloadrows with string decimal values.- Parameters:
- casilla_id: CasillaId¶
- label: str¶
- localized_labels: dict[str, str]¶
- value: Decimal¶
- role: str¶
Why the casilla is a headline figure.
result_ingresar/result_devolvermark the registry-declared result-to-pay / result-to-refund total.key_figuremarks a computed casilla the modelo’s verification expectation tracks.
- class CalculationResultSummary(**data)[source]¶
Bases:
BaseModelDistilled headline figures for a persisted calculation revision.
The modelo, filing year, and typed
Periodcome from the parentWorkUnit; rows areResultSummaryRowvalues selected from that work unit’s registry snapshot. Text rendering uses the period’s bare registry token so the summary header does not duplicate the filing year.- Parameters:
modelo (str)
filing_year (int)
period (Period)
rows (tuple[ResultSummaryRow, ...])
- modelo: str¶
- filing_year: int¶
- period: Period¶
- rows: tuple[ResultSummaryRow, ...]¶
- calculation_result_summary(revision, *, work_unit_resolver=<function get_work_unit>)[source]¶
Return the
CalculationResultSummaryforrevision, if available.revisionis the persistedCalculationRevisionattempt and providescasilla_values. The function resolves its parentWorkUnit, then reads the registry snapshot’s verification expectations for that work unit’s revision. Missing work-unit or snapshot lookup errors returnNoneso callers can render only the full casilla table; unexpected errors are allowed to propagate.For each
VerificationExpectationDefinition,reconciliation_total_casilla_idsare considered first and produceresult_ingresarorresult_devolverrows. Remaining uniquecomputed_casilla_idsproducekey_figurerows. A result casilla is emitted once and skipped later if it also appears as a computed key figure.Rows are emitted only when their casilla id exists in
revision.casilla_values. ReturnsNonewhen no candidate row survives.- Return type:
- Parameters:
revision (CalculationRevision)