cadrumo.application.aggregation._modelo_bindings_invoice_iva_refusal module¶
Invoice-to-ledger IVA refusal policy for modelo-binding resolution.
- raise_if_invoice_iva_would_be_silent(*, context, period, operation, transaction_binding_values, ledger_observations=(), ports, prorrata_apportionment, screened_bindings=None)[source]¶
Refuse a filing whose invoice IVA would be absent from its ledger totals.
The IVA cuota boxes are sourced from
ledger_iva_aggregation: the transaction ledger is the filing authority. A bucket can also carry real invoice catalogue evidence, and there is no invoice binding family for these boxes. If invoice IVA exists for the period and would exceed the transaction-ledger cuota the filing is about to use, calculating a zero/subtotal filing would silently under-declare. Refuse, and require the operator to link and classify the transactions that feed the canonical ledger path.Applies to M303 and M390 revisions whose typed screen shapes resolve the seven conceptual slots. M390 declares the same seven concepts M303 does under its own id prefix, so the selected revision supplies the IDs rather than a second Python table. Two implementations of one comparison would be free to drift, and a widening applied to one and not the other is invisible until a filing is wrong – which is exactly how the ES-only counterparty filter and the missing recargo tiers survived on the M303 side.
The annual modelo needs this more than the quarterly one, not less. Its 390-to-303 reconciliation BLOCKING_RULE compares two figures that both root in the same ledger, so it detects a transaction booked into the wrong quarter and cannot detect one that was never recorded at all: both sides are equally short and the rule passes.
- Return type:
- Returns:
A pair. First, the invoices whose IVA was compared against the ledger, so the caller can disclose how their period placement was arrived at. Second, the invoices withheld because their declared category and their counterparty country contradict each other – carried out separately because they reached NO casilla, so the caller must report them rather than describe their placement. Both empty when the modelo is not screened or there was nothing to compare.
The second element survives the early return below: a period whose every invoice was withheld produces no observations at all, and that is precisely the case where staying silent would be worst.
- Parameters:
context (CalculationSourceContext)
period (Period)
operation (PinnedAuthorityOperation)
ledger_observations (Sequence[IvaLedgerObservation])
ports (InvoiceCatalogueReadPorts)
prorrata_apportionment (IvaLedgerProrrataApportionment | None)
screened_bindings (tuple[BindingId, ...] | None)
screened_bindings may be supplied by the source-mesh resolver after it resolves the selected revision. Direct callers that omit it receive the same typed revision-selected query here; no static model-to-binding table is consulted.