cadrumo.domain.iva.prorrata_especial_parameters module

Registry-resolved LIVA art-103.Dos.2 mandatory-especial margin.

Art. 103.Dos.2 makes the prorrata especial regime compulsory once the deduction computed under the general regime exceeds the one under the especial regime by a statutory margin. Both halves of that test are law: the margin ITSELF, and whether landing exactly on it is enough.

The provision has had two redactions and they differ on both. The original (in force to 31-12-2014) required the excess to be “en un 20 por 100”, with no “o más” and so exclusive. Ley 28/2014 art. 1.26 (in force from 01-01-2015) replaced it with “en un 10 por ciento o más” – lowering the margin AND making it inclusive. A margin without its comparison direction is therefore only half the rule, which is why both travel together here.

Only the current redaction is declared in the registry. The resolver derives its applicability window from the dated registry value rather than carrying a year boundary in Python; a filing period outside that window is refused as an ungrounded context.

See also

domain.iva.prorrata

The predicate and advisory that consume the resolved margin.

PRORRATA_ESPECIAL_MANDATORY_PARAMETER_ID

The registry parameter carrying the art-103.Dos.2 margin.

exception ProrrataEspecialMandatoryParameterError(message=None, *, context=None, translated_message=None)[source]

Bases: CadrumoError

Raised when the art-103.Dos.2 margin cannot be grounded for an ejercicio.

Parameters:
  • message (str | None)

  • context (Mapping[str, object] | None)

  • translated_message (str | None)

Return type:

None

code
class ProrrataEspecialMandatoryParameters(**data)[source]

Bases: BaseModel

The art-103.Dos.2 margin and its comparison direction, resolved.

Variables:
  • margin_percentage – The percentage the provision names.

  • comparison – Whether the margin must be exceeded strictly or merely reached. Registry data, because the two redactions differ on it.

  • modelo_id – Modelo whose revision hosts the parameter.

  • revision_id – The hosting revision’s canonical id.

  • resolved_on – The filing-period date the value was selected for.

Parameters:

data (Any)

margin_percentage: Decimal
comparison: ThresholdComparison
modelo_id: str
revision_id: str
resolved_on: date
property multiple: Decimal

The factor the especial-regime deduction is scaled by for the threshold.

property inclusive: bool

Whether a deduction landing exactly on the threshold already qualifies.

resolve_prorrata_especial_mandatory_parameters(revision, *, modelo_id, ejercicio)[source]

Resolve the art-103.Dos.2 margin for one ejercicio from a compiled revision.

Parameters:
  • revision (ModeloRevision) – The compiled revision the application layer selected.

  • modelo_id (str) – Modelo the revision belongs to.

  • ejercicio (int) – The filing year whose margin is wanted.

Return type:

ProrrataEspecialMandatoryParameters

Returns:

The resolved ProrrataEspecialMandatoryParameters.

Raises:

ProrrataEspecialMandatoryParameterError – When the revision does not declare the parameter or cannot resolve it for that ejercicio.

Core types: ModeloRevision.