cadrumo.domain.transactions.dates module¶
Ledger date semantics: which dates a transaction can file an observation under.
A period-scoped ledger read has to decide, for one stored transaction, whether it can contribute anything to a filing window. That question has two answers and they are not the same date. Most rows file on their ledger filing date, but an IVA criterio-de-caja row’s devengo and collection dates are set by law independently of when the movement was booked, so a row booked in one quarter can carry an observation in another.
These are the single owners of both answers. The plaintext routing index
(TransactionDateIndexRow) records
what they return, and the period partition selects candidates by overlap
against the span rather than by equality against the filing date.
See also
TransactionLedger row whose cash-accounting timing facts these read.
LedgerDatePartitionPartition contract the eligible span feeds.
- transaction_filing_date(transaction)[source]¶
Return the ledger filing date:
value_datewhen present, elsebooked_date.This is the date every period-scoped ledger aggregator without a tax-timing override filters on, and the date the plaintext routing index records per transaction.
- Return type:
- Parameters:
transaction (Transaction)
- transaction_eligible_date_span(transaction)[source]¶
Return the inclusive
(earliest, latest)span of every date this row can file under.A period-scoped read cannot select candidates on
transaction_filing_date()alone. Under the IVA criterio de caja (LIVA art. 163 decies and following) one transaction produces observations on dates independent of its ledger filing date: the art. 75 devengooperation_date, eachcash_accounting_payment_evidencecollection date, and the 31 December statutory fallback of the year following the operation. A row booked in Q2 can therefore carry a Q1 observation, and selecting on the filing date alone drops it with no diagnostic.The span is a deliberately CONSERVATIVE superset: it always covers the filing date, and for a cash-accounting row it stretches to the statutory fallback date without re-deriving the settlement remainder arithmetic that decides whether that date actually carries a part. Over-selection costs one extra decrypt that the consuming aggregator’s own date gate then rejects; under-selection is a silent under-declaration, so the asymmetry is resolved in favour of the wider span.
- Return type:
- Returns:
The inclusive
(earliest, latest)date span, both equal to the filing date for a row with no cash-accounting timing override.- Parameters:
transaction (Transaction)