pub struct JournalEntryLine {Show 35 fields
pub document_id: Uuid,
pub line_number: u32,
pub gl_account: String,
pub account_code: String,
pub account_description: Option<String>,
pub debit_amount: Decimal,
pub credit_amount: Decimal,
pub local_amount: Decimal,
pub group_amount: Option<Decimal>,
pub transaction_amount: Option<Decimal>,
pub cost_center: Option<String>,
pub profit_center: Option<String>,
pub business_unit: Option<String>,
pub segment: Option<String>,
pub functional_area: Option<String>,
pub line_text: Option<String>,
pub text: Option<String>,
pub reference: Option<String>,
pub value_date: Option<NaiveDate>,
pub tax_code: Option<String>,
pub tax_amount: Option<Decimal>,
pub assignment: Option<String>,
pub offsetting_account: Option<String>,
pub is_suspense: bool,
pub trading_partner: Option<String>,
pub quantity: Option<Decimal>,
pub unit_of_measure: Option<String>,
pub unit: Option<String>,
pub project_code: Option<String>,
pub auxiliary_account_number: Option<String>,
pub auxiliary_account_label: Option<String>,
pub lettrage: Option<String>,
pub lettrage_date: Option<NaiveDate>,
pub transaction_id: Option<String>,
pub predecessor_line_id: Option<String>,
}Expand description
Individual line item within a journal entry.
Each line represents a debit or credit posting to a specific GL account. Line items must be balanced within a journal entry (sum of debits = sum of credits).
Fields§
§document_id: UuidParent document ID (matches header)
line_number: u32Line item number within document (1-based)
gl_account: StringGL account number
account_code: StringAccount code (alias for gl_account for compatibility)
account_description: Option<String>Account description (for display)
debit_amount: DecimalDebit amount in transaction currency (positive or zero)
credit_amount: DecimalCredit amount in transaction currency (positive or zero)
local_amount: DecimalAmount in local/company currency
group_amount: Option<Decimal>Amount in group currency (for consolidation)
transaction_amount: Option<Decimal>SOTA-4 Document/transaction-currency amount (SAP WRBTR) when the JE
posts in a foreign currency. debit_amount/credit_amount/local_amount
remain the company-ledger amount (SAP DMBTR — the ledger and trial balance
aggregate these, unchanged), while this carries the original foreign value
at header.currency / header.exchange_rate. None for company-currency
JEs. Additive: ledger coherence is untouched.
cost_center: Option<String>Cost center assignment
profit_center: Option<String>Profit center assignment
business_unit: Option<String>Business unit / division assignment. An organisational dimension that
rolls up cost centers (a few BUs carry most postings, as in the corpus).
#[serde(default)] so older JSON without the field still deserialises.
segment: Option<String>Segment for segment reporting
functional_area: Option<String>Functional area
line_text: Option<String>Line item text/description
text: Option<String>Text field (alias for line_text for compatibility)
reference: Option<String>Reference field
value_date: Option<NaiveDate>Value date (for interest calculations)
tax_code: Option<String>Tax code
tax_amount: Option<Decimal>Tax amount
assignment: Option<String>Assignment field (for account assignment)
offsetting_account: Option<String>Reference to offsetting account (for network generation)
is_suspense: boolIs this posting to a suspense/clearing account
trading_partner: Option<String>Trading partner company code (for intercompany)
quantity: Option<Decimal>Quantity (for quantity-based postings)
unit_of_measure: Option<String>Unit of measure
unit: Option<String>Unit (alias for unit_of_measure for compatibility)
project_code: Option<String>Project code
auxiliary_account_number: Option<String>Auxiliary account number (FEC column 7: Numéro de compte auxiliaire) Populated for AP/AR lines under French GAAP with the business partner ID.
auxiliary_account_label: Option<String>Auxiliary account label (FEC column 8: Libellé de compte auxiliaire) Populated for AP/AR lines under French GAAP with the business partner name.
lettrage: Option<String>Lettrage code (FEC column 14: Lettrage) Links offset postings in a completed document chain (e.g. invoice ↔ payment).
lettrage_date: Option<NaiveDate>Lettrage date (FEC column 15: Date de lettrage) Date when the matching was performed (typically the payment posting date).
transaction_id: Option<String>Stable per-line transaction identifier.
Deterministically derived from (document_id, line_number) so it stays
consistent across regenerations of the same dataset. Populated lazily
at write time from JournalEntryLine::derive_transaction_id when
not already set.
predecessor_line_id: Option<String>v5.8.0 — predecessor line in a document booking chain.
Set to the transaction_id of the line in a prior journal entry
that this line directly succeeds in a document chain (e.g. a
payment line’s predecessor is the corresponding line in the
vendor invoice JE; a goods-receipt line’s predecessor is the
matching line in the purchase-order JE). None for purely-GL
adjustments, period-close postings, payroll, or the root
(first) document in a chain.
Used by the graphs/je_network.csv flat edge-list output to
trace booking chains across JEs without joining against
document_references.json.
Implementations§
Source§impl JournalEntryLine
impl JournalEntryLine
Sourcepub fn debit(
document_id: Uuid,
line_number: u32,
gl_account: String,
amount: Decimal,
) -> Self
pub fn debit( document_id: Uuid, line_number: u32, gl_account: String, amount: Decimal, ) -> Self
Create a new debit line item.
Sourcepub fn credit(
document_id: Uuid,
line_number: u32,
gl_account: String,
amount: Decimal,
) -> Self
pub fn credit( document_id: Uuid, line_number: u32, gl_account: String, amount: Decimal, ) -> Self
Create a new credit line item.
Sourcepub fn signed_amount(&self) -> Decimal
pub fn signed_amount(&self) -> Decimal
Get the signed amount (positive for debit, negative for credit).
Sourcepub fn derive_transaction_id(document_id: Uuid, line_number: u32) -> String
pub fn derive_transaction_id(document_id: Uuid, line_number: u32) -> String
Derive a stable per-line transaction id from (document_id, line_number).
Deterministic: the same input always returns the same id, so the
value is stable across regenerations of the same dataset and across
crate versions. Uses UUID v5 (SHA-1) under Uuid::NAMESPACE_OID.
Sourcepub fn ensure_transaction_id(&mut self)
pub fn ensure_transaction_id(&mut self)
Populate transaction_id from (document_id, line_number) if unset.
Sourcepub fn account_code(&self) -> &str
pub fn account_code(&self) -> &str
Get the account code (alias for gl_account).
Sourcepub fn account_description(&self) -> &str
pub fn account_description(&self) -> &str
Get the account description (currently returns empty string as not stored).
Trait Implementations§
Source§impl Clone for JournalEntryLine
impl Clone for JournalEntryLine
Source§fn clone(&self) -> JournalEntryLine
fn clone(&self) -> JournalEntryLine
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JournalEntryLine
impl Debug for JournalEntryLine
Source§impl Default for JournalEntryLine
impl Default for JournalEntryLine
Source§impl<'de> Deserialize<'de> for JournalEntryLine
impl<'de> Deserialize<'de> for JournalEntryLine
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for JournalEntryLine
impl RefUnwindSafe for JournalEntryLine
impl Send for JournalEntryLine
impl Sync for JournalEntryLine
impl Unpin for JournalEntryLine
impl UnsafeUnpin for JournalEntryLine
impl UnwindSafe for JournalEntryLine
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.