aeat.application.modelo._prorrata_regularizacion_advisory module

Calculate-path advisory wiring for the annual prorrata-general regularización.

Modelo 303 casilla 44 (Regularización prorrata por porcentaje definitivo - Cuota) is input_kind = manual: LIVA art. 105.Cuatro requires comparing the year’s DEFINITIVE prorrata percentage (art. 104, computed from the year’s actual annual con-derecho/sin-derecho volumes) against the PROVISIONAL percentage applied across the year’s liquidations (art. 105.Uno — normally the PRIOR year’s definitive percentage). The registry already computes the current period’s definitive percentage from real operator-entered annual volumes (iva.prorrata-porcentaje, fed by iva.prorrata-volumen-total / iva.prorrata-volumen-con-derecho). The automatic feed is now backed by the live BindingSourceKind.PRORRATA_REGULARIZACION resolver when its governed inputs are available; this collector remains as the no-silent-under-declaration advisory path for missing or unresolved facts. First, for every period, it reads the profile-scoped prorrata register and raises a missing-carry advisory when prorrata applies but the provisional percentage ladder is unresolved. Second, at the settlement period, it reads the CURRENT year’s own registry-computed prorrata figures (never a fabricated value) and can look up the PRIOR year’s persisted iva.prorrata-porcentaje observation from the local CalculationObservationRepository — the same same-modelo prior-filing lookup pattern _prior_payment_advisory already uses for the Modelo 130 casilla-05 carry. When a real prior-year percentage is found, the pure build_prorrata_regularizacion_advisory() projection runs against real, non-fabricated inputs and its advisory is surfaced verbatim (never re-implemented). When no prior-year observation exists (a first-filing ejercicio, or the operator has not yet filed the prior year through this application), the collector still alerts that a regularización may be due once the prior-year percentage is available, rather than silently dropping the check.

The register’s LIVA art. 105.Cuatro “último período de liquidación del año natural” timing means the regularización is due once a year, at the settlement period (the fourth quarter or the annual period for Modelo 303 filers); the proposed-casilla-44 regularización branch only runs on those periods, while the missing-provisional-carry branch is intentionally per-period.

See also

_calculation_diagnostics:

Post-calculation coordinator that calls this collector with the computed casilla values and the shared observation repository.

_prorrata_regularizacion:

Source resolver and advisory-projection functions this collector shares with the registry-computed annual prorrata figures.

_bienes_inversion_advisory:

Sibling advisory collector for the capital-goods IVA regularización (LIVA arts. 107-110), whose settlement-period gating this module mirrors.

_prior_payment_advisory:

Origin of the same-modelo prior-filing observation lookup pattern this collector reuses for the prior-year definitive-percentage carry.

collect_prorrata_regularizacion_diagnostics(revision, casilla_values, *, modelo, period_token, filing_year, observation_repository, bucket_id=None)[source]

Return the annual prorrata-general regularización advisory for one calculation.

Reads the CURRENT year’s registry-computed annual prorrata figures (iva.prorrata-volumen-total, iva.prorrata-volumen-con-derecho, iva.prorrata-porcentaje, iva.cuota-deducible-total) from casilla_values and looks up the PRIOR year’s persisted definitive percentage from observation_repository. When both are available, the pure build_prorrata_regularizacion_advisory() projection runs and its advisory (or silence, when no regularización is due) is returned verbatim. When the prior-year percentage cannot be found, a lighter pending advisory fires whenever the current year shows exempt-without-right operations (prorrata applies), naming casilla 44 as not yet automatically checkable.

Parameters:
  • revision (ModeloRevision) – The ModeloRevision whose casillas are inspected for the prorrata semantic roles. Only Modelo 303 revisions declare them; every other modelo returns an empty tuple immediately.

  • casilla_values (Mapping[TypeAliasType, Decimal]) – Computed engine values keyed by CasillaId.

  • modelo (str) – The modelo identifier of the filing being calculated.

  • period_token (str) – Bare registry period token for the filing being calculated (e.g. "4T", "1T", "0A").

  • filing_year (int) – The filing year regularised (the year whose prior ejercicio’s percentage is looked up).

  • bucket_id (str | None) – Optional bucket identifier for loading the profile-scoped prorrata register. When supplied, unresolved provisional register state emits a per-period missing-carry advisory before settlement.

  • observation_repository (CalculationObservationRepository) – The local CalculationObservationRepository scanned for the prior-year definitive-percentage carry.

Return type:

tuple[CalculationSourceDiagnostic, ...]

Returns:

A tuple of advisories. At the settlement period it may carry the casilla-44 regularización advisory (or the pending-percentage advisory), the per-period missing-provisional-carry advisory, and the LIVA art. 103.Dos.2 +10% mandatory-especial advisory (the obligation check when both regime totals are honestly computable, or the classify-to-enable prompt for a general filer whose especial total is not yet derivable). Empty when no advisory fires (non-settlement period, no exempt-without-right operations, no resolvable prorrata register).