aeat.application.modelo._work_plazo module¶
Application summaries for modelo work-unit filing deadlines.
This module turns a WorkUnit into the deadline summary used by the
calculate CLI payload. It asks the registry deadline-window surface for the
voluntary filing close date, derives either days_remaining or
days_overdue against a reference date, and attaches the Ley 58/2003 art. 27
recargo band when the filing is late and the band table resolves.
An unknown registry deadline is deliberately represented as None rather
than a blocking error. A recargo lookup failure still returns the overdue
posture, logs the validation problem, and lets the rendering layer emit the
generic extemporaneous-filing warning.
See also
aeat.domain.deadlines._plazo.resolve_filing_closes_on():Registry-backed lookup for the plazo voluntario close date.
aeat.domain.deadlines._recargo.build_recovery_for_overdue():Resolves the Art. 27 LGT recargo band for overdue filing.
aeat.entrypoints.cli._modelo_rendering.work_unit_deadline_output():Projects this summary onto JSON payloads and warning notices.
- class ModeloWorkRecargoSummary(band_id, surcharge_pct, interest_applies, legal_ref)[source]¶
Bases:
objectRecargo band summary for an overdue modelo work unit.
The fields mirror the resolved deadline-domain recovery band: stable band id, surcharge percentage, interest applicability, and legal reference. The CLI renderer serialises this structure into the recargo block on the deadline payload.
- class ModeloWorkPlazoSummary(closes_on, days_remaining=None, days_overdue=None, recargo=None)[source]¶
Bases:
objectFiling-deadline summary for a modelo work unit.
closes_onis the voluntary filing close date. Exactly one posture should be populated bymodelo_work_plazo_summary():days_remainingfor in-time filings, ordays_overduefor late filings.recargois present only when the overdue Art. 27 LGT band resolved successfully.- Parameters:
closes_on (date)
days_remaining (int | None)
days_overdue (int | None)
recargo (ModeloWorkRecargoSummary | None)
-
recargo:
ModeloWorkRecargoSummary|None¶
- modelo_work_plazo_summary(work_unit, *, today=None)[source]¶
Return deadline and recargo posture for a
WorkUnit, if known.The work unit supplies the modelo, filing year, and typed period used to match a registry deadline window. When no window matches, the function returns
Noneso callers can omit the deadline block. When the filing is still inside the voluntary window, the summary carriesdays_remaining. When the close date has passed, it carriesdays_overdueand, when available, aModeloWorkRecargoSummary.- Parameters:
- Return type:
- Returns:
A
ModeloWorkPlazoSummary, orNonewhen the registry has no deadline window for the work unit’s filing axis.
See also
aeat.entrypoints.cli._modelo_rendering._work_unit_deadline_output_from_summary():Converts the summary into operator-facing payloads and notices.