Skip to main content

SettleOutput

Struct SettleOutput 

Source
#[non_exhaustive]
pub struct SettleOutput { pub settlement_eur: Option<Decimal>, pub eligible_kwh: Option<Decimal>, pub positions: Vec<SettlePosition>, pub status: SettlementStatus, pub pflichtzahlung_eur: Option<Decimal>, pub pflichtzahlung_faelligkeitsdatum: Option<Date>, pub verlaengerungsanspruch_qh: u64, pub dezentrale_einspeisung_anspruch_verloren: bool, pub billing_days_fraction_applied: Option<Decimal>, pub faelligkeitsdatum: Option<Date>, }
Expand description

Output of a settlement calculation.

Default is “nothing settled”: NoData, no amount, no positions. Every early exit in the engine builds on it with ..SettleOutput::default() rather than restating ten fields — which is how a field added to this struct stays correct at the twenty-eight places that return one.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§settlement_eur: Option<Decimal>

Total settlement amount in EUR (sum of all positions).

None when status is NoData or PriceMissing. Some(Decimal::ZERO) when status is Sanctioned or Eigenverbrauch.

§eligible_kwh: Option<Decimal>

Effective kWh used in the calculation.

  • May be less than einspeisemenge_kwh when KWKG hour-limit is approached.
  • Excludes kwh_during_negative_epex when the §27 negative-price rule applies.
§positions: Vec<SettlePosition>

Individual billing positions that make up settlement_eur.

Empty when status is NoData, PriceMissing, Sanctioned, or Eigenverbrauch.

Multi-component models produce multiple positions:

  • Mieterstrom: base Vergütung + §21 Abs. 3 Zuschlag
  • Direktvermarktung/Ausschreibung: Gleitende Marktprämie + §§53b–54 AW-Abzüge
  • Flexibilitaet: base Vergütung + §50 Flex-Prämie
  • Multi-block plants (§24 Anlagenerweiterung): one position per active block

Use .to_line_item() on each position to convert to billing::LineItem for invoice / BillingDocument generation.

§status: SettlementStatus

Computation outcome.

§pflichtzahlung_eur: Option<Decimal>

§52 EEG 2023 penalty amount owed by plant operator to NB (separate from Vergütung).

None when input.pflichtverstoss was not set. Some(Decimal::ZERO) when there is no violation. Positive = operator owes NB (the NB may net this against Vergütung per §52 Abs. 6).

This amount is NOT deducted from settlement_eur.

§pflichtzahlung_faelligkeitsdatum: Option<Date>

§52 Abs. 6 Satz 1 EEG 2023 — Fälligkeitsdatum for the §52 penalty payment.

The 15th calendar day of the month following the billing month — same formula as faelligkeitsdatum (§26 Abs. 1), but legally distinct.

„Die Zahlungen werden zum 15. Kalendertag des Kalendermonats fällig, der auf den nach den Absätzen 2 und 4 jeweils maßgeblichen Kalendermonat folgt.“

For violations with §52 Abs. 4 extra months (Nr. 5, 7: +3m; Nr. 9: +1m; Nr. 12: +6m), the Fälligkeitsdatum is the 15th after the last relevant month. This field computes the 15th after the billing month as the base date.

None when billing_date is not set or pflichtzahlung_eur is None.

§verlaengerungsanspruch_qh: u64

§51a EEG 2023 — quarter-hours by which the Vergütungszeitraum is extended.

Non-zero only when input.negative_price_quarter_hours was provided AND §51 actually reduced the Vergütung in this period. Solar PV: ceil(lost_qh / 2) · Others: lost_qh (1:1 factor).

§dezentrale_einspeisung_anspruch_verloren: bool

§52 Abs. 7 EEG 2023 — whether violations cause loss of dezentrale Einspeisung entgelt.

When true, the operator loses the entitlement to the Entgelt für dezentrale Einspeisung under §18 StromNEV for the entire calendar year in which any §52 violation occurred.

Legal basis: §52 Abs. 7 EEG 2023: „Bei Pflichtverstößen nach Absatz 1 verlieren die Anlagenbetreiber zusätzlich für das gesamte Kalenderjahr den Anspruch auf ein Entgelt für dezentrale Einspeisung nach §18 der Stromnetzentgeltverordnung.“

true when pflichtzahlung_eur.is_some_and(|p| p > 0). The NB should also withhold the §18 StromNEV payment for this plant for the year.

§billing_days_fraction_applied: Option<Decimal>

§25 Abs. 1 Satz 3 EEG — billing_days_fraction that was actually applied.

The fraction applied to settlement_eur and position amounts in this settlement. Either the value provided in SettleInput.billing_days_fraction or the auto-computed value from billing_date, inbetriebnahme, and foerderendedatum.

None when the fraction is 1.0 (full month, no proration applied). Some(f) when partial-month proration was applied.

Store in the settlement receipt for § 147 AO / GoBD audit trail.

§faelligkeitsdatum: Option<Date>

§26 Abs. 1 EEG 2023 — Fälligkeitsdatum for this period’s advance payment.

The 15th calendar day of the month following the billing month. Per §26 Abs. 1 EEG 2023: „Auf die zu erwartenden Zahlungen nach §19 Abs. 1 sind monatlich jeweils zum 15. Kalendertag für den Vormonat Abschläge in angemessenem Umfang zu leisten.“

Billing monthFälligkeitsdatum
June 20242024-07-15
December 20242025-01-15 (year rolls over)
February 20252025-03-15

Populated when SettleInput.billing_date is provided. None otherwise.

Note: This is the statutory latest due date for monthly advance payments. The final annual settlement (Endabrechnung) falls under §26 Abs. 2, whose due date depends on the operator’s §71 data submission obligations.

Trait Implementations§

Source§

impl Clone for SettleOutput

Source§

fn clone(&self) -> SettleOutput

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SettleOutput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SettleOutput

Source§

fn default() -> SettleOutput

Returns the “default value” for a type. Read more
Source§

impl Eq for SettleOutput

Source§

impl PartialEq for SettleOutput

Source§

fn eq(&self, other: &SettleOutput) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for SettleOutput

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.