cadrumo.domain.contribuyente.descendant_madrid module

Madrid nacimiento/adopción behavior for descendants.

class DescendantMadridMixin(**data)[source]

Bases: DescendantRecordBase

Madrid’s autonomous deduction for a descendant.

Parameters:

data (Any)

entry_year()[source]

Calendar year of the nacimiento/adopción event, for the Madrid deducción window.

Scoped to the autonomic nacimiento/adopción deducción and NOT to Art. 58.2, which counts from a different event for the same child: see _entry_date() for why an acogimiento resolución moves one anchor and not the other, and art_58_2_entry_date() for the state anchor.

Return type:

int

is_nacimiento_adopcion_eligible(filing_year, *, context)[source]

True when this descendant is inside the nacimiento/adopción window and cohabits.

The Madrid nacimiento/adopción deducción (DL 1/2010 art. 4) requires both that the parent cohabits with the child (“Solo tendrán derecho a practicar la deducción los padres que convivan con los hijos nacidos o adoptados”) and that the filing year falls inside the applicability window measured from the entry (nacimiento/adopción) year.

Return type:

bool

Parameters:
nacimiento_adopcion_prorrateo_share(*, context)[source]

Return this descendant’s share of the deducción after prorrateo.

When the child cohabits with both parents and they file individually the Madrid manual splits the amount equally between the two declarations (the lirpf-art-61-shared-custody-proration-factor governed fact); otherwise the full amount accrues to this filer through the governed full-proration share fact. custodia_compartida is the profile signal for the shared-cohabitation case that triggers the ÷2 prorrateo.

Return type:

Decimal

Parameters:

context (FamilyFactResolutionContext)