No double billing

The guarantee

Quartura bills every quarter-hour of a Messpunkt exactly once per tariff component. Delivering, validating or rating the same values again moves no money. A correction books only the difference to what is already booked; when it concerns a closed month, it books in the first open month. Every amount stands in the ledger as a balanced transfer, and the extract shows exactly what the ledger holds.

The slot as the billing unit

The unit of billing is the slot: one Messpunkt, one tariff component, one quarter-hour. Energy components rate the validated quantity in Wh at an exact price per Wh. Base and metering fees are shares of their period, such as the month; each slot carries its share, rounded to a whole unit. Amounts are integers in units of 10⁻⁸ CHF, never floating point.

Every rating of a slot records its input hash: a fingerprint over the version of the measured value and its Wertestatus, the version of the price, the tariff binding and the version of the rating method. The input hash says what an amount stands on.

Rating again moves no money

  • Quartura recognises an identical delivery on receipt; it creates no new measured value.
  • When a slot already stands on the same input hash, the rating moves no money.
  • When a new version yields the same amount, for example a new validation of the same values under a new rule set, the input hash changes and the booking stays.
  • Every rating is booked exactly once. The ledger never confirms more transfers for a rating than its slots have legs.

The Wertestatus decides the kind of booking: a W is posted. An E or V first stands as a pending transfer; a V never pays. When a W follows later, the pending transfer is posted with the W's amount, or the difference to it.

Double-entry ledger

Every amount is a balanced transfer between the Messpunkt's receivable for a tariff component and the tariff component's counter account. Per currency, debits equal credits, and the balances the ledger keeps for its accounts agree with the sum of the transfers. Per slot, posted plus pending equals the latest rated amount.

What is posted is never changed. When an amount changes, a further transfer moves the difference or voids the pending transfer; afterwards, per slot, posted plus pending again equals the latest rated amount.

Period close

An authorised person closes a month. The close surveys every Messpunkt and waits for the postings still in flight: an open posting blocks the close, it is not skipped. The close reports only when all postings have landed. No rating of the month is left without its posting, unless the ledger has held it because of a discrepancy; the close then shows it as held.

At the close, every E of the month is posted as final, unless it is held or its Messpunkt is listed in the close's report; the report names what is left open. A V stays pending and pays nothing. After that, the following month is the first open month. A late W or any other correction of a closed month books in the first open month, as the difference to what was booked, with its booking month and its delivery month. A correction keeps the rules of its delivery month, even when it books in a later month; a changed rule applies from its month.

Extract

The extract per Messpunkt and month shows every posted unit of the month, no more and no less. It reads each slot as the slot itself stands after every step. The rounding of an extract line is reported, never booked.

The extract as of a close stays as of that close. A later correction appears in the extract of its booking month, not retroactively in the closed month.

Proof

Platform scenarios check the guarantee from delivery to extract, on synthetic data:

  • billing-redelivery-idempotent: The same days are delivered and validated twice, rated twice, and no money moves.
  • billing-crash-then-silence: A close that starts while the last postings are in flight waits for them and posts nothing twice.
  • billing-e-billable: An E is posted as final at the close, a V stays pending, and the late W of the V's day books in the first open month.
  • billing-extract-rounding: A changed rounding rule applies from its month, a correction keeps the rule of its delivery month, and the extract as of a close does not take it in.
  • billing-xs-month: A month of ten Messpunkte runs from delivery through validation, rating and the ledger to a closed month and an extract per customer.

Each of these scenarios checks the same invariants at its end, over everything the run rated and posted:

  • rerating-is-idempotent: A rating on an input hash the slot already stands on moves no money; every rating happens exactly once; never more transfers than legs.
  • no-intent-left-at-close: No rating of a closed month is left without its posting, or its hold because of a discrepancy, before the close.
  • ledger-matches-rating: Per slot, posted plus pending equals the latest rated amount.
  • ledger-nets-to-zero: Per currency, debits equal credits, and the ledger's balances agree.
  • extract-covers-ledger: Every posted unit appears in the extract of its month, no more and no less.
  • slot-fold-agreement: What the extract reads of a slot agrees with the slot's own state after every step.
  • provisional-never-pays: Nothing posted stands on a V or a provisional price; an E is posted as final only by the close or as a difference on a slot that is already final, and at the close every E of the month is posted, held or named in the report.
  • rated-values-match-hash: Every rated value yields, from its price, quantity, versions and Wertestatus, exactly the input hash its rating stands on.
  • rounding-difference-never-booked: The rounding of an extract line is in no transfer; the ledger holds the unrounded amount.

How it works

A validated measured value with its Wertestatus leads to the rating of every slot it concerns, with its input hash. Every rating becomes a posting intent. When the slot already stands on that hash or its amount stays the same, the intent carries no transfer; otherwise the ledger books it: a W as posted, an E or V as pending. The period close waits for every open posting intent, posts the E as final unless held, and leaves the V pending. The extract reads the result per Messpunkt and month. A later correction of a closed month takes the same path and books in the first open month.