pub struct EntityOpeningBalance {
pub account_code: String,
pub account_type: AccountType,
pub debit: Decimal,
pub credit: Decimal,
}Expand description
v5.3 — One per-account opening-balance record carried across periods. Produced by the prior period’s closing trial balance projection (group-side helper) and consumed by the orchestrator’s opening-balance phase to seed period-N+1 from period-N’s closing instead of generating a fresh opening.
debit and credit are both non-negative; at most one is non-zero
(matches the underlying TrialBalanceLine invariant).
This carrier lives in datasynth-core so both datasynth-runtime
(consumer via ShardContext) and datasynth-group (producer via
extract_opening_balances) can reference it without a dependency
cycle.
Fields§
§account_code: StringGL account code (e.g. "1100" for AR control).
account_type: AccountTypeAccount type — informational; the consumer applies its own sign convention based on it (assets/expenses → debit-positive, liabilities/equity/revenue → credit-positive).
debit: DecimalDebit-side closing amount from the prior period (always non-negative; zero when the line was credit-balanced).
credit: DecimalCredit-side closing amount from the prior period (always non-negative; zero when the line was debit-balanced).
Implementations§
Source§impl EntityOpeningBalance
impl EntityOpeningBalance
Sourcepub fn net_balance(&self) -> Decimal
pub fn net_balance(&self) -> Decimal
Net signed amount per the account’s normal balance side.
Positive for accounts where the larger side matches the normal
side; matches the convention GeneratedOpeningBalance.balances
uses for its closing_balance map.
For Asset / ContraLiability / ContraEquity / Expense (debit-
normal): returns debit - credit. For Liability / Equity /
ContraAsset / Revenue (credit-normal): returns credit - debit.
Trait Implementations§
Source§impl Clone for EntityOpeningBalance
impl Clone for EntityOpeningBalance
Source§fn clone(&self) -> EntityOpeningBalance
fn clone(&self) -> EntityOpeningBalance
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 EntityOpeningBalance
impl Debug for EntityOpeningBalance
Source§impl<'de> Deserialize<'de> for EntityOpeningBalance
impl<'de> Deserialize<'de> for EntityOpeningBalance
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>,
Source§impl PartialEq for EntityOpeningBalance
impl PartialEq for EntityOpeningBalance
Source§fn eq(&self, other: &EntityOpeningBalance) -> bool
fn eq(&self, other: &EntityOpeningBalance) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for EntityOpeningBalance
impl Serialize for EntityOpeningBalance
impl Eq for EntityOpeningBalance
impl StructuralPartialEq for EntityOpeningBalance
Auto Trait Implementations§
impl Freeze for EntityOpeningBalance
impl RefUnwindSafe for EntityOpeningBalance
impl Send for EntityOpeningBalance
impl Sync for EntityOpeningBalance
impl Unpin for EntityOpeningBalance
impl UnsafeUnpin for EntityOpeningBalance
impl UnwindSafe for EntityOpeningBalance
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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.