aeat.domain.fincas._amortization_ledger module¶
LIRPF art. 23.1.f amortización 3 % multi-year ledger.
Per-finca per-period amortización accrual with cumulative-through-
year cap tracking. The depreciable basis at year N is
max(coste_adquisicion_construccion, valor_catastral_construccion);
the per-year accrual is basis * 3 % * dias_alquilados / 365,
clamped down so the cumulative-through-year never exceeds
coste_adquisicion_construccion.
Default behaviour clamps to the remaining cap and never raises.
Strict callers (preflight verifiers that surface the cap on the
filing surface) opt in via strict=True and receive
AmortizationLedgerCapExceededError when an accrual would
overflow.
- ART_23_1_F_RATE: Decimal¶
3 % amortización of capital-inmobiliario rental properties; rate fixed by RD 439/2007 (RIRPF) art. 14.2.a; deductibility base Ley 35/2006 art. 23. Re-export alias for
AMORTIZACION_INMUEBLE_RATE.
- DAYS_PER_YEAR: Decimal¶
Pro-rate denominator. The BOE wording uses “anual” — we adopt 365 days for every year (including leap years), matching AEAT’s manual práctico Renta worked-example convention.
- class AmortizationComputation(**data)[source]¶
Bases:
BaseModelOutcome of a single
compute_amortization_for_year()invocation.- Variables:
period_year – Ejercicio.
basis – Depreciable basis used (
max(coste_construccion, valor_catastral_construccion)).gross_amortization –
basis * 0.03 * dias_alquilados / 365, rounded to cents — what would accrue if the cap were not in play.capped_amortization – Final accrual after clamping at the remaining cap. Equal to
gross_amortizationwhen no clamp applied.cumulative_through_year – Cumulative-through-year sum (including the current accrual).
clamp_applied –
Truewhen the cap reduced the gross amortización below its theoretical value.
- Parameters:
- period_year: int¶
- basis: Decimal¶
- gross_amortization: Decimal¶
- capped_amortization: Decimal¶
- cumulative_through_year: Decimal¶
- clamp_applied: bool¶
- compute_amortization_for_year(finca, income, *, cumulative_through_prior_year, strict=False)[source]¶
Compute the per-finca per-year amortización 3 % entry.
- Parameters:
income (
FincaRendimientoRecord) – Income record for the same finca/contract for the target period — providesperiod_yearanddias_alquilados.cumulative_through_prior_year (
Decimal) – Sum of prior years’capped_amortizationfor this finca. The caller (the ledger orchestrator) sources this from the persisted ledger.strict (
bool) – WhenTrueand the gross accrual would push cumulative beyondcoste_adquisicion_construccion, raiseAmortizationLedgerCapExceededErrorinstead of clamping.
- Return type:
- Returns:
An
AmortizationComputationcarrying the per-year result.- Raises:
AmortizationLedgerCapExceededError – When
strictisTrueand the gross accrual would overflow the cap.
- computation_to_ledger_entry(finca_id, income, computation)[source]¶
Project an
AmortizationComputationinto a persistable record.- Return type:
- Returns:
A
FincaAmortizacionLedgerEntryready for persistence.- Parameters:
finca_id (int)
income (FincaRendimientoRecord)
computation (AmortizationComputation)