cadrumo.application.calculations.iva_compensation_annual_partition module

Modelo 390 IVA compensation annual partition source resolver.

The resolver reads a RegistrySnapshot for the annual Modelo 390 revision, inspects its ModeloRevision bindings owned by IVA_COMPENSATION_ANNUAL_PARTITION, and derives the two annual compensation partition amounts from filed Modelo 303 ObservationEnvelopePayload records.

period_state_from_303_envelope(envelope, *, operation)[source]

Build one FIFO state from a validated filed Modelo 303 envelope.

Return type:

IvaCompensationPeriodState

Parameters:
resolve_iva_compensation_annual_partition_binding_values(revision, envelopes, *, filing_year, operation)[source]

Resolve Modelo 390 annual compensation bindings from filed M303 states.

Parameters:
Return type:

dict[TypeAliasType, Decimal]

class IvaCompensationAnnualPartitionSourceResolver(*, operation, repository, registry_snapshot=None)[source]

Bases: object

Resolve Modelo 390 boxes 97 / 662 from the IVA compensation FIFO partition.

Parameters:
resolver_id: ClassVar[str]
owned_sources: ClassVar[tuple[BindingSourceKind, ...]]
resolve(context)[source]

Resolve the Modelo 390 boxes 97 / 662 IVA compensation FIFO partition for context.

Return type:

CalculationSourceResolution

Returns:

An empty resolution when the revision declares no such requirement, a degraded resolution on repository failure, or the resolved CalculationSourceResolution.

Parameters:

context (CalculationSourceContext)