Skip to main content

EliminationGenerator

Struct EliminationGenerator 

Source
pub struct EliminationGenerator { /* private fields */ }
Expand description

Generator for consolidation elimination entries.

Implementations§

Source§

impl EliminationGenerator

Source

pub fn new( config: EliminationConfig, ownership_structure: OwnershipStructure, ) -> Self

Create a new elimination generator.

Source

pub fn generate_eliminations( &mut self, fiscal_period: &str, entry_date: NaiveDate, ic_balances: &[ICAggregatedBalance], ic_transactions: &[ICMatchedPair], investment_amounts: &HashMap<String, Decimal>, equity_amounts: &HashMap<String, HashMap<String, Decimal>>, ) -> &ConsolidationJournal

Generate all eliminations for a period.

Source

pub fn generate_ic_balance_eliminations( &mut self, fiscal_period: &str, entry_date: NaiveDate, balances: &[ICAggregatedBalance], )

Generate IC balance eliminations (receivables vs payables).

Source

pub fn generate_ic_revenue_expense_eliminations( &mut self, fiscal_period: &str, entry_date: NaiveDate, transactions: &[ICMatchedPair], )

Generate IC revenue/expense eliminations.

Source

pub fn generate_unrealized_profit_eliminations( &mut self, fiscal_period: &str, entry_date: NaiveDate, transactions: &[ICMatchedPair], )

Generate unrealized profit in inventory eliminations.

Source

pub fn generate_investment_equity_eliminations( &mut self, fiscal_period: &str, entry_date: NaiveDate, investment_amounts: &HashMap<String, Decimal>, equity_amounts: &HashMap<String, HashMap<String, Decimal>>, )

Generate investment/equity eliminations.

Source

pub fn generate_dividend_elimination( &mut self, fiscal_period: &str, entry_date: NaiveDate, paying_company: &str, receiving_company: &str, dividend_amount: Decimal, ) -> EliminationEntry

Generate dividend elimination entry.

Source

pub fn generate_minority_interest_allocation( &mut self, fiscal_period: &str, entry_date: NaiveDate, subsidiary: &str, net_income: Decimal, minority_percentage: Decimal, ) -> Option<EliminationEntry>

Generate minority interest allocation for period profit/loss.

Source

pub fn get_journal(&self, fiscal_period: &str) -> Option<&ConsolidationJournal>

Get consolidation journal for a period.

Source

pub fn get_all_journals(&self) -> &HashMap<String, ConsolidationJournal>

Get all journals.

Source

pub fn finalize_journal( &mut self, fiscal_period: &str, approved_by: String, ) -> Option<&ConsolidationJournal>

Finalize and approve a journal.

Source

pub fn post_journal( &mut self, fiscal_period: &str, ) -> Option<&ConsolidationJournal>

Post a journal.

Source

pub fn get_summary( &self, fiscal_period: &str, ) -> Option<EliminationSummaryReport>

Get elimination summary for a period.

Source

pub fn reset(&mut self)

Reset counters and clear journals.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V