aeat.application.prorrata_register._sector_lifecycle module¶
Per-sector provisional/definitive lifecycle (LIVA arts. 9.1.c / 101 / 105).
A taxpayer with differentiated sectors applies the deduction regime separately
per sector (art. 101.Uno). Each sector therefore runs the same cross-period
lifecycle the whole-entity register runs — seed the year’s provisional from the
prior year’s definitive (art. 105.Uno), apportion in-year (the sector-aware
ledger IVA aggregation), and regularise at 4T against the year’s definitive
(art. 105.Cuatro) — but scoped to the sector’s own (ejercicio, sector_id)
register entries.
The one place a sector’s lifecycle diverges from the whole-entity one is the
seed SOURCE. The whole-entity carried seed reads the prior-year Modelo 303
settlement observation (seed_carried_prior_definitiva_entry()), but a
sectorized taxpayer files one whole-entity Modelo 303 that carries a single
percentage — it cannot supply a per-sector definitive. A sector’s prior-year
definitive lives in the register’s own (ejercicio-1, sector_id) entry
(written back at that year’s settlement), so the per-sector carried seed reads
the register, not the observation catalogue.
See also
seed_carried_prior_definitiva_entry()Whole-entity carried seed sourced from the prior Modelo 303 observation.
build_interrumpida_tres_ultimos_seed()The art. 105.Cinco interrupted-activity seed, already sector-parameterised.
compute_prorrata_definitiva_anual()Pure substrate that computes the year-end definitive percentage from the sector’s full-year operation volumes.
- seed_sector_carried_definitive_from_register(register, *, ejercicio, sector_id, regime=ProrrataRegisterRegime.GENERAL)[source]¶
Seed a sector’s current-year provisional from its own prior-year definitive.
LIVA art. 105.Uno applied per differentiated sector (art. 101.Uno): the provisional percentage a sector applies during the year is that sector’s prior-year DEFINITIVE, read from the register’s own
(ejercicio - 1, sector_id)entry. The whole-entity Modelo 303 observation is not consulted — it carries a single filing percentage and cannot supply a per-sector definitive.Returns
Nonewhen the prior year holds no settled definitive for the sector (the caller surfaces the missing-provisional advisory rather than assuming a percentage —no-silent-under-declaration()), so a sector’s first ejercicio, or a gap year, never silently defaults.- Parameters:
register (
ProrrataRegister) – The active-profile prorrata register.ejercicio (
int) – Ejercicio whose per-sector provisional is being seeded.sector_id (
str) – The differentiated sector to seed.regime (
ProrrataRegisterRegime) – Prorrata regime in force for the sector this ejercicio.
- Return type:
- Returns:
A seeded
ProrrataRegisterEntrycarrying the sector’s provisional percentage withCARRIED_PRIOR_DEFINITIVAprovenance, orNone.
- settle_sector_definitive(entry, *, con_derecho_volume, sin_derecho_volume)[source]¶
Compute a sector’s year-end definitive from its own volumes and settle it.
LIVA art. 105.Cuatro applied per differentiated sector: the definitive percentage is derived from the sector’s OWN full-year operation volumes (con-derecho / sin-derecho, art. 104 exclusions already applied) via
compute_prorrata_definitiva_anual(), then written back onto the sector’s register entry. The provisional fields are preserved so the annual regularización can compare the provisional applied in-year against the definitive.- Parameters:
entry (
ProrrataRegisterEntry) – The sector’s(ejercicio, sector_id)register entry to settle.con_derecho_volume (
Decimal) – The sector’s annual con-derecho operations volume.sin_derecho_volume (
Decimal) – The sector’s annual sin-derecho operations volume.
- Return type:
- Returns:
A copy of
entrywith the definitive percentage and both volume inputs populated (the settled state the next year’s carried seed reads).