aeat.application.modelo._art109_activity_income module

Period-scoped Art. 109 activity-income coverage from ledger evidence.

The coverage helper derives the RIRPF Art. 109 70 percent withholding fact from current-period ledger rows in a TransactionCatalogue. Work-unit consumers use a bucket-scoped TransactionCatalogueRepository to load that catalogue before applying the same pure calculation.

The result is intentionally evidence-scoped: the denominator and withholding status must be proven from invoice-substrate ledger facts, so gross-only bank movements fail closed instead of fabricating an activity-income ratio.

See also

derive_art109_activity_income_coverage()

Pure catalogue-level derivation for already-loaded ledger rows.

derive_art109_activity_income_coverage_for_work_unit()

Work-unit adapter that resolves the matching bucket repository.

application.modelo._verification_actions

Verification path that folds a proven coverage fact into the workflow profile used for M130 verification.

class Art109ActivityIncomeCoverageStatus(*values)[source]

Bases: StrEnum

Whether current-period ledger evidence proves the Art. 109 threshold.

PROVEN
INSUFFICIENT
class Art109ActivityIncomeCoverage(status, meets_threshold, numerator, denominator, reason)[source]

Bases: object

Period-scoped Art. 109 70 percent activity-income coverage result.

Parameters:
status: Art109ActivityIncomeCoverageStatus
meets_threshold: bool | None
numerator: Decimal
denominator: Decimal
reason: str
property is_proven: bool

Return whether meets_threshold is backed by sufficient evidence.

derive_art109_activity_income_coverage_for_work_unit(work_unit, *, transaction_repository)[source]

Derive the Art. 109 current-payment-period coverage fact for an M130 work unit.

The returned Art109ActivityIncomeCoverage is proven only from current-period ledger rows, not from M130 output casillas. A row proves the denominator and withholding status only when it carries invoice substrate (taxable_base and iva_amount); gross-only bank movements fail closed because they cannot prove whether the receipt was subject to withholding.

Return type:

Art109ActivityIncomeCoverage

Parameters:
derive_art109_activity_income_coverage(catalogue, *, period)[source]

Derive Art. 109 current-period coverage from a transaction catalogue.

Parameters:
Return type:

Art109ActivityIncomeCoverage

Returns:

The proven or insufficient Art109ActivityIncomeCoverage.