cadrumo.application.modelo._rate_box_advisory module¶
Calculate-time advisory when rate boxes account for less than their total.
A rate-specific official box may assert only a rate the evidence determines, so a ledger row that records a cuota without recording the rate charged reaches the rate-blind total and no box. The return stays whole and the breakdown stays truthful, and the price is that the boxes sum to less than the total by exactly that amount.
The operator has to be told, and told HERE rather than only at export. The repair is a ledger edit – record the rate on the rows that lack one – and the information the repair needs is the amount and the tier, which is what this advisory carries. Refusing the calculation instead would withhold the number the operator needs in order to act, which is why this gate is non-blocking while the export gate on the same condition is not.
Both gates read
rate_box_coverage_shortfalls() over the same
derived partitions, so an operator cannot meet a refusal at export that no
advisory preceded at calculate.
See also
domain.calculations.registry.rate_box_partitionDerives the two layers and owns the one subtraction both gates read.
application.filing._export_parityThe export-side refusal on the same condition.
- collect_rate_box_coverage_diagnostics(revision, casilla_values)[source]¶
Return one advisory per rate partition whose boxes underaccount its total.
- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhose ledger-IVA bindings are read for the two-layer rate partitions. A revision declaring no rate-specific binding yields no advisory.casilla_values (
Mapping[TypeAliasType,Decimal]) – The computed engine values keyed byCasillaId.
- Return type:
- Returns:
Tuple of non-blocking
CalculationSourceDiagnosticrows, each naming the unaccounted amount, the tier holding it, and the boxes that do not reach it.