aeat.core._amendment_kind_regime module

Per-modelo, period-aware autoliquidación amendment-kind regime.

AEAT’s amendment mechanism for a self-assessment (autoliquidación) changed over time. Before the reform, a correction that raised the tax due filed as a complementaria (LGT art. 122.2, ley-58-2003:art-122) while a correction that lowered it required a separate solicitud de rectificación procedure (LGT art. 120.3, ley-58-2003:art-120). RD-ley 13/2023 plus each tax’s implementing orden unified both into a single autoliquidación rectificativa (LGT art. 120.4) that may raise OR lower the resultado — but only from the period each modelo’s own orden establishes; earlier periods are still governed by the dual complementaria/rectificación regime.

This module codifies, per modelo, the filing period from which the rectificativa mechanism applies, grounded in the bundled AEAT Diseño de Registros and manual corpus:

  • M303 (IVA autoliquidación): the rectificativa casillas (fichero-BOE position 392 autoliq_rectificativa onward) appear starting with the diseño “ejercicio 2024 a partir de periodos 09 y 3T y siguientes”; the prior diseño “ejercicio 2024 hasta periodos 08 y 2T” carries no rectificativa fields. The boundary is therefore filing_year 2024, period 09 (monthly) or 3T (quarterly) onward — every subsequent period and year uses rectificativa.

  • M100 (IRPF Renta): the Manual Práctico de Renta states the rectificativa became the general correction mechanism “para los períodos impositivos 2024 y siguientes”, with effective application from Orden HAC/242/2025 (14 March 2025); the registry casilla 0669 (2024 revision, “discrepancia de criterio administrativo… autoliquidación rectificativa”) corroborates M100 carries rectificativa support from filing_year 2024.

  • M200 (Impuesto sobre Sociedades): the 2024-y-siguientes registry revision carries rectificativa casillas (0497/0499/0508/0509/ 0513/0519/etc.), so M200 supports rectificativa from filing_year 2024 onward.

  • M130/M131 (IRPF pagos fraccionados): the bundled diseño de registros for M130 stops at “ejercicios 2019 y siguientes” with no rectificativa fields at all, and the registry carries only that single revision. No bundled AEAT source grounds a specific rectificativa-adoption period for M130/M131, so this module conservatively reports them as NOT YET supporting rectificativa — every period continues to route through the dual complementaria/solicitud-de-rectificación regime — until a bundled AEAT diseño or orden grounds an effective period (legal-grounding-verifies-bundled-authoritative-corpus).

A modelo absent from _RECTIFICATIVA_EFFECTIVE_FROM has no codified regime at all: permitted_amendment_kind_values() falls back to the complementaria/sustitutiva pair for every period, never asserting rectificativa support that no bundled source confirms.

See also

assert_amendment_kind_permitted():

Application-layer guard that binds this table to CalculationRevisionAmendmentKind and refuses an operator-requested kind the period does not permit.

CalculationRevisionAmendmentKind:

The domain enum this module’s string values back.

class AmendmentLiabilityDirection(*values)[source]

Bases: StrEnum

Direction of an amendment’s effect on the taxpayer’s declared liability.

Under the pre-rectificativa dual regime, the direction determines which of the two legally-distinct procedures applies: an INCREASE (the corrected resultado raises the tax due, or lowers a requested devolución) is a complementaria (LGT art. 122.2); a DECREASE (the corrected resultado lowers the tax due, or raises a requested devolución) requires the solicitud de rectificación procedure (LGT art. 120.3) rather than a self-filed complementaria. Post-rectificativa, the direction no longer selects a different legal mechanism (both raise and lower route through the unified rectificativa), so this classification is only load-bearing for pre-rectificativa periods.

INCREASE
DECREASE
UNCHANGED
class AmendmentKindRegime(permitted_kinds, rectificativa_effective)[source]

Bases: object

The codified amendment-kind regime resolved for one (modelo, period).

Variables:
  • permitted_kinds – The closed set of CalculationRevisionAmendmentKind string values legally available for this modelo and period. "sustitutiva" is always permitted (a material restatement is never barred by the rectificativa timeline); "rectificativa" is permitted only once the modelo’s own effective period is reached; "complementaria" is permitted only before that point (once rectificativa applies, it replaces complementaria for the modelo’s ordinary corrective filings — see CalculationRevisionAmendmentKind.RECTIFICATIVA’s docstring).

  • rectificativa_effective – Whether the resolved period is within the modelo’s rectificativa-supported window (True) or the pre-rectificativa dual regime still applies (False).

Parameters:
permitted_kinds: frozenset[str]
rectificativa_effective: bool
modelo_has_codified_amendment_regime(modelo)[source]

Return whether modelo has a bundled-source-grounded rectificativa boundary.

A modelo without a codified boundary (e.g. M130/M131, whose bundled diseño de registros carries no rectificativa fields) is never reported as rectificativa-effective; permitted_amendment_kind_values() returns the pre-rectificativa complementaria/sustitutiva pair for every period.

Return type:

bool

Parameters:

modelo (str)

resolve_amendment_kind_regime(modelo, period)[source]

Resolve the codified amendment-kind regime for modelo at period.

Returns an AmendmentKindRegime naming the legally-permitted CalculationRevisionAmendmentKind string values for this (modelo, period) pair. A modelo with no codified boundary (modelo_has_codified_amendment_regime() is False) always resolves to the pre-rectificativa pair, never asserting rectificativa support no bundled source confirms.

For a period with no calendar date span (an instalment clave or an extended/ad-hoc form), the resolution falls back to filing_year >= <the modelo's boundary year> using the boundary date’s year, since no calendar comparison is possible for those forms.

Return type:

AmendmentKindRegime

Parameters:
permitted_amendment_kind_values(modelo, period)[source]

Return the closed set of legally-permitted amendment-kind string values.

Thin convenience wrapper over resolve_amendment_kind_regime() for callers that only need the permitted set (e.g. rendering an accepted-value list in a refusal message).

Return type:

frozenset[str]

Parameters:
classify_amendment_liability_direction(*, baseline_result, corrected_result)[source]

Classify whether a correction increases, decreases, or leaves liability unchanged.

baseline_result and corrected_result are the modelo’s signed final result casilla value (a positive value means “a ingresar” tax due; a negative value means a credit or refund position, modelo-dependent) before and after the operator’s overrides. An increase in the signed result (a higher amount to pay, or a lower credit/refund) is INCREASE (LGT art. 122.2, complementaria territory); a decrease is DECREASE (LGT art. 120.3, solicitud de rectificación territory pre-unification). Equal values are UNCHANGED.

Accepts any Decimal-comparable numeric type so callers do not need to import decimal solely to call this classifier.

Return type:

str

Parameters:
  • baseline_result (SupportsAllComparisons)

  • corrected_result (SupportsAllComparisons)