pub struct GridInvoice {
pub pid: u32,
pub rechnungsnummer: String,
pub invoice_date: Date,
pub due_date: Date,
pub period_from: Date,
pub period_to: Date,
pub nb_mp_id: String,
pub positions: Vec<InvoicePosition>,
pub total_eur: Decimal,
}Expand description
Result of a grid invoice calculation — pure domain type, no BO4E coupling.
Call a local into_rechnung() helper in the service layer (netzbilanzd /
invoicd) to produce the rubo4e::current::Rechnung required for EDIFACT
serialization and invoic-checker validation.
§PID override
pid defaults to the primary PID for each function:
calculate_nne_invoice→31001(caller sets31005for Gas,31006for selbstausstellt)calculate_mmm_invoice→31002calculate_msb_invoice→31009- GeLi Gas AWH: caller overrides to
31011
Fields§
§pid: u32BDEW Prüfidentifikator — caller may override after construction.
rechnungsnummer: StringUnique invoice reference number.
invoice_date: DateInvoice issue date.
due_date: DatePayment due date (Zahlungsziel, §271 BGB).
period_from: DateStart of billing period (inclusive).
period_to: DateEnd of billing period (inclusive).
nb_mp_id: StringSender MP-ID — Netzbetreiber (or MSB for PID 31009).
positions: Vec<InvoicePosition>Ordered billing positions.
total_eur: DecimalNet total in EUR, rounded to 2 decimal places.
Implementations§
Source§impl GridInvoice
impl GridInvoice
Sourcepub fn positions_count(&self) -> usize
pub fn positions_count(&self) -> usize
Number of billing positions.
Trait Implementations§
Source§impl Clone for GridInvoice
impl Clone for GridInvoice
Source§fn clone(&self) -> GridInvoice
fn clone(&self) -> GridInvoice
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for GridInvoice
impl RefUnwindSafe for GridInvoice
impl Send for GridInvoice
impl Sync for GridInvoice
impl Unpin for GridInvoice
impl UnsafeUnpin for GridInvoice
impl UnwindSafe for GridInvoice
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more