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”)