aeat.application.calculations._bienes_inversion_regularizacion module¶
Advisory projection for the capital-goods IVA regularización (LIVA arts. 107-110).
Builds the non-blocking source diagnostics the calculate path surfaces for
Modelo 303 casilla 43 / Modelo 390 casilla 63: the ordinary annual
art-109 comparison for in-window, non-disposed goods
(build_bienes_inversion_regularizacion_advisory()), and the art-110 single
(“única”) disposal regularización for a good disposed of during the filing year
(build_bienes_inversion_transmision_advisory()). The source resolver
projects the same register-backed amount into the governed M303/M390 binding
targets when the current-year definitive prorrata percentage is available; the
advisory functions remain as the visible fallback for operator review.
The pure projections never derive the definitive percentage. M303 supplies it
from the registry materialisation seam, while M390 may read the stamped current
year M303 settlement observation that already owns iva.prorrata-porcentaje.
See also
ModeloRevisionCompiled revision whose bindings the advisory functions resolve their Modelo 303 / 390 output casillas against.
- CASILLA_REGULARIZACION_BIENES_INVERSION¶
The Modelo 303 casilla the register feeds. Deducciones block, “Regularización de bienes de inversión” (LIVA arts. 107-110).
- build_bienes_inversion_regularizacion_advisory(register, *, regularizacion_year, prorrata_definitiva_by_identifier)[source]¶
Project the register and build the fallback advisory diagnostic.
Returns the register projection plus a non-blocking
CalculationSourceDiagnosticwhen the register holds in-window, art-108-eligible, non-disposed goods forregularizacion_year— so a taxpayer who owns capital goods in their regularisation window is alerted that casilla 43 may be due, rather than silently filing zero. When no in-window goods exist the diagnostic isNone(nothing to regularise, no noise). A good disposed of at or beforeregularizacion_yearis excluded here and routed instead throughbuild_bienes_inversion_transmision_advisory().The diagnostic
messagenames the in-window count, the number of goods whose regularización could be computed (a definitive percentage was supplied), the number still pending a definitive percentage, and the proposed casilla-43 value.- Parameters:
register (
BienesInversionIvaRegister) – The persistedBienesInversionIvaRegister.regularizacion_year (
int) – The year being calculated.prorrata_definitiva_by_identifier (
Mapping[str,Decimal]) – Current-year definitive deduction percentages keyed by record identifier (absent keys are pending).
- Return type:
tuple[RegistroRegularizacionResult,CalculationSourceDiagnostic|None]- Returns:
(projection, diagnostic)whereprojectionis aRegistroRegularizacionResult; the diagnostic isNonewhen there is nothing to regularise.
- build_bienes_inversion_transmision_advisory(register, *, disposal_year, cuota_devengada_entrega_by_identifier=None)[source]¶
Project the register’s art-110 disposals and build the advisory diagnostic.
Returns the register-wide transmisión projection plus a non-blocking
CalculationSourceDiagnosticwhen the register holds a good disposed of indisposal_yearwith window time remaining — so a taxpayer who sold, transmitted, or otherwise disposed of a tracked capital good is alerted that the art-110 single regularización is due on casilla 43, rather than silently filing zero. Unlike the annual advisory, this projection carries no pending state: every fact art-110 needs (acquisition-year percentage, cuota soportada, disposal regime) is already on the record, so the diagnostic always names a concrete proposed figure (the regla-1ª cap is applied only when the caller supplies the disposal’s own cuota devengada).- Parameters:
register (
BienesInversionIvaRegister) – The persistedBienesInversionIvaRegister.disposal_year (
int) – The filing year being calculated.cuota_devengada_entrega_by_identifier (
Mapping[str,Decimal] |None) – Optional per-good cuota devengada on the disposal itself, applied as the regla-1ª cap. Absent keys leave regla 1ª uncapped for that good.
- Return type:
tuple[RegistroTransmisionesResult,CalculationSourceDiagnostic|None]- Returns:
(projection, diagnostic)whereprojectionis aRegistroTransmisionesResult; the diagnostic isNonewhen no disposal falls indisposal_year.
- class BienesInversionRegularizacionSourceResolver(*, current_year_values=None, missing_current_year_casilla_ids=(), unresolved_current_year_casilla_ids=(), register_repository=None, observation_repository=None)[source]¶
Bases:
objectResolve capital-goods regularizacion bindings from the profile register.
- Parameters:
current_year_values (Mapping[CasillaId, Decimal] | None)
missing_current_year_casilla_ids (tuple[CasillaId, ...])
unresolved_current_year_casilla_ids (tuple[CasillaId, ...])
register_repository (BienesInversionIvaRegisterRepository | None)
observation_repository (CalculationObservationRepository | None)
- resolver_id¶
-
owned_sources:
tuple[BindingSourceKind,...]¶
- resolve(context)[source]¶
- Return type:
- Parameters:
context (CalculationSourceContext)