pub struct InvoicePosition {
pub number: u32,
pub text: String,
pub kind: BillingPositionKind,
pub quantity: Decimal,
pub unit: QuantityUnit,
pub unit_price_eur: Decimal,
pub net_eur: Decimal,
pub artikel_id: Option<String>,
pub lastvariable_preisposition_json: Option<Value>,
pub trace: CalculationTrace,
}Expand description
One line item in a grid settlement.
Carries raw numbers for the service layer to map into the required format
(BO4E Rechnungsposition, EN16931 UBL, etc.).
Invariant: net_eur == (quantity × unit_price_eur).round_dp(5).
Fields§
§number: u321-based sequence number.
text: StringHuman-readable position description.
kind: BillingPositionKindSemantic position kind — used by the service layer to set
Rechnungsposition.artikelnummer (BDEW INVOIC AHB requirement).
quantity: DecimalMetered or contracted quantity.
unit: QuantityUnitUnit of measure.
unit_price_eur: DecimalUnit price in EUR (already converted from ct where applicable).
net_eur: DecimalNet amount in EUR, rounded to 5 decimal places.
May be negative for credit positions (Mindermengen, Gutschriften).
artikel_id: Option<String>BDEW Artikel-ID for positions that use the new format (post-BK6-20-160).
Used for:
- NNE Strom (GPKE PIDs 31001/31006): BNetzA Netznutzungspreisblatt article IDs
(e.g.
"1-02-5-001"for NS Grundpreis-/Arbeitspreissystem Arbeitspreis). The service layer populates this from thePreisblattNetznutzungArtikel-ID. - AWH Gas Sperrprozesse (PID 31011):
"2-01-7-001"(Sperrung) /"2-01-7-002"(Entsperrung) populated automatically bycalculate_gas_awh_invoice(). - MSB (PID 31009):
"4-02-0-xxx"format from section 3.5 of the codelist, populated by the service layer from the product/Konfigurationsprodukt code.
For Gas NNE, MMM, Konzessionsabgabe and Blindmehrarbeit, the classic
artikelnummer (via BillingPositionKind) takes precedence; this field is None.
Source: BDEW Codeliste Artikelnummern und Artikel-ID v5.6 (valid 01.09.2025).
lastvariable_preisposition_json: Option<Value>§14a Modul 3: serialized LastvariablePreisposition BO4E COM for this position.
Set when kind == NneArbeitModul3. Carries the pricing formula parameters
(SPOTPREIS method, preisreferenz, preisBezugseinheit) from the
PreisblattNetznutzung.lastvariablePreispositionen used to derive unit_price_eur.
Stored as raw serde_json::Value so that grid-billing remains rubo4e-free.
The service layer (netzbilanzd, billingd) can deserialize to
rubo4e::current::LastvariablePreisposition for Rechnungsposition.zusatzAttribute
embedding, enabling ERP-side validation and portal display of the per-dispatch
tariff breakdown.
None for all other position kinds.
trace: CalculationTraceFull audit trace for this position.
Answers “why is this amount here?” and carries all legal references.
Trait Implementations§
Source§impl Clone for InvoicePosition
impl Clone for InvoicePosition
Source§fn clone(&self) -> InvoicePosition
fn clone(&self) -> InvoicePosition
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more