pub struct TreasuryAccounting;Expand description
Generates journal entries for treasury instruments.
Follows the same static-method pattern as ManufacturingCostAccounting:
a zero-sized struct with associated functions that accept domain objects
and return balanced Vec<JournalEntry>.
Implementations§
Source§impl TreasuryAccounting
impl TreasuryAccounting
Sourcepub fn generate_debt_jes(
instruments: &[DebtInstrument],
period_end: NaiveDate,
) -> Vec<JournalEntry>
pub fn generate_debt_jes( instruments: &[DebtInstrument], period_end: NaiveDate, ) -> Vec<JournalEntry>
Generate interest accrual JEs for active debt instruments.
For each instrument where period_end <= maturity_date, posts:
DR Interest Expense (“7100”)
CR Interest Payable (“2160”)
Amount = principal * (annual_interest_rate / 4) — quarterly approximation.
Sourcepub fn generate_hedge_jes(
instruments: &[HedgingInstrument],
relationships: &[HedgeRelationship],
period_end: NaiveDate,
entity_id: &str,
) -> Vec<JournalEntry>
pub fn generate_hedge_jes( instruments: &[HedgingInstrument], relationships: &[HedgeRelationship], period_end: NaiveDate, entity_id: &str, ) -> Vec<JournalEntry>
Generate hedge accounting JEs for hedging instruments.
For each active instrument with non-zero fair value:
- Cash flow hedge: DR/CR Derivative Asset/Liability vs OCI (“3510”)
- Fair value hedge: DR/CR Derivative Asset/Liability vs FX Gain/Loss (“7500”)
If the hedge relationship is ineffective and ineffectiveness_amount > 0,
an additional JE recognises ineffectiveness in P&L.
Sourcepub fn generate_cash_pool_sweep_jes(
sweeps: &[CashPoolSweep],
header_entity: &str,
) -> Vec<JournalEntry>
pub fn generate_cash_pool_sweep_jes( sweeps: &[CashPoolSweep], header_entity: &str, ) -> Vec<JournalEntry>
Generate intercompany JEs for cash pool sweeps.
For each sweep with a non-zero amount: DR Cash Pool IC Receivable (“1155”) CR Cash Pool IC Payable (“2055”)
Auto Trait Implementations§
impl Freeze for TreasuryAccounting
impl RefUnwindSafe for TreasuryAccounting
impl Send for TreasuryAccounting
impl Sync for TreasuryAccounting
impl Unpin for TreasuryAccounting
impl UnsafeUnpin for TreasuryAccounting
impl UnwindSafe for TreasuryAccounting
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> 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.