pub enum InvoiceType {
Initial,
CreditNote,
Correction {
original_invoice_id: String,
reason: Option<String>,
},
Cancellation {
original_invoice_id: String,
},
Final,
AdvancePayment,
PartialInvoice,
}Expand description
Whether this is an initial invoice, a correction, a cancellation, or a final settlement.
German energy suppliers frequently perform:
Initial invoice → Correction (corrected meter reading)
→ Cancellation (full reversal)
→ Final (annual Schlussabrechnung)§§ 147 AO / GoBD compliance
Corrections must reference the original invoice ID for the 3-year audit trail. Cancellations reverse the original to EUR 0.
Variants§
Initial
Standard billing run (Abschlagsrechnung, periodic invoice).
CreditNote
Credit note (Gutschrift) — outgoing payment to a third party.
Used for:
- EEG feed-in settlement (payment to generator)
- EINSPEISUNG Direktvermarktung settlement
- Reverse-charge scenarios
rechnungsart = "GUTSCHRIFT"
Correction
Correction superseding an earlier invoice (§ 147 AO / GoBD).
The original invoice must be referenced in the accounting system.
The net effect is: original + correction = corrected total.
Fields
Cancellation
Full reversal of an earlier invoice (Stornorechnung).
All positions are sign-inverted to bring the original to EUR 0.
Final
Annual final settlement (Schlussabrechnung / Jahresabrechnung).
Reconciles advance payments against measured consumption.
Include paid Abschläge in BillingContext::abschlage — they will be
deducted from Invoice::zahlbetrag_eur.
AdvancePayment
Advance payment request (Abschlagsrechnung).
Use this for estimated periodic billing where no final meter reading
is available yet. The customer pays on account; the annual settlement
(InvoiceType::Final) reconciles the difference.
BO4E rechnungsart = "ABSCHLAGSRECHNUNG"
§Distinction from Initial
Initial represents billing for actual metered consumption — it maps
to "RECHNUNG". AdvancePayment represents estimated advance payments
that will be settled annually.
PartialInvoice
Partial delivery invoice (Teilrechnung) for incomplete supply periods.
Used when a customer switches supplier mid-period, moves in/out, or when a meter replacement creates a split period. The departing or arriving supplier issues a Teilrechnung for the exact days of actual supply.
§Legal basis
§41 EnWG Abs. 1: the invoice must cover the actual supply period. StromGVV §17 / GasGVV §14: Lieferungsende is billed on the day of change.
rechnungsart = "TEILRECHNUNG"
Implementations§
Source§impl InvoiceType
impl InvoiceType
Sourcepub fn rechnungsart(&self) -> &'static str
pub fn rechnungsart(&self) -> &'static str
Process-level Rechnungsart label (mako vocabulary, superset of BO4E).
Emitted as the rechnungsart ZusatzAttribut for invoice types the BO4E
Rechnungstyp enum cannot express losslessly.
Sourcepub fn original_invoice_id(&self) -> Option<&str>
pub fn original_invoice_id(&self) -> Option<&str>
Returns the original invoice ID for corrections and cancellations.
Sourcepub fn is_reversal(&self) -> bool
pub fn is_reversal(&self) -> bool
true when this invoice reverses all positions of the original.
Sourcepub fn settles_advances(&self) -> bool
pub fn settles_advances(&self) -> bool
true when this document discharges the advances the context carries.
§ 40 Abs. 1 EnWG makes the settling invoice itemise and deduct each
advance payment. An AdvancePayment is the
document that collects one, so it discharges none: netting the
advances already paid against it would reduce the very request that asks
for the next.
Trait Implementations§
Source§impl Clone for InvoiceType
impl Clone for InvoiceType
Source§fn clone(&self) -> InvoiceType
fn clone(&self) -> InvoiceType
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more