pub struct OpeningBalanceSpec {
pub company_code: String,
pub as_of_date: NaiveDate,
pub fiscal_year: i32,
pub currency: String,
pub total_assets: Decimal,
pub industry: IndustryType,
pub asset_composition: AssetComposition,
pub capital_structure: CapitalStructure,
pub target_ratios: TargetRatios,
pub account_overrides: HashMap<String, AccountSpec>,
}Expand description
Specification for generating opening balances.
Fields§
§company_code: StringCompany code.
as_of_date: NaiveDateOpening balance date (typically start of fiscal year).
fiscal_year: i32Fiscal year.
currency: StringCurrency.
total_assets: DecimalTotal assets target.
industry: IndustryTypeIndustry sector for composition.
asset_composition: AssetCompositionAsset composition specification.
capital_structure: CapitalStructureLiability and equity specification.
target_ratios: TargetRatiosTarget financial ratios.
account_overrides: HashMap<String, AccountSpec>Individual account specifications (overrides).
Implementations§
Source§impl OpeningBalanceSpec
impl OpeningBalanceSpec
Sourcepub fn new(
company_code: String,
as_of_date: NaiveDate,
fiscal_year: i32,
currency: String,
total_assets: Decimal,
industry: IndustryType,
) -> Self
pub fn new( company_code: String, as_of_date: NaiveDate, fiscal_year: i32, currency: String, total_assets: Decimal, industry: IndustryType, ) -> Self
Create a new opening balance specification.
Sourcepub fn for_industry(total_assets: Decimal, industry: IndustryType) -> Self
pub fn for_industry(total_assets: Decimal, industry: IndustryType) -> Self
Create a specification for a given industry with default parameters. This is a convenience method for creating industry-specific opening balances.
Sourcepub fn validate(&self) -> Result<(), Vec<String>>
pub fn validate(&self) -> Result<(), Vec<String>>
Validate that the specification is coherent (A = L + E).
Sourcepub fn calculate_total_liabilities(&self) -> Decimal
pub fn calculate_total_liabilities(&self) -> Decimal
Calculate total liabilities based on capital structure.
Sourcepub fn calculate_total_equity(&self) -> Decimal
pub fn calculate_total_equity(&self) -> Decimal
Calculate total equity based on capital structure.
Sourcepub fn calculate_current_assets(&self) -> Decimal
pub fn calculate_current_assets(&self) -> Decimal
Calculate current assets based on composition.
Sourcepub fn calculate_non_current_assets(&self) -> Decimal
pub fn calculate_non_current_assets(&self) -> Decimal
Calculate non-current assets based on composition.
Sourcepub fn calculate_current_liabilities(&self) -> Decimal
pub fn calculate_current_liabilities(&self) -> Decimal
Calculate current liabilities to achieve target current ratio.
Trait Implementations§
Source§impl Clone for OpeningBalanceSpec
impl Clone for OpeningBalanceSpec
Source§fn clone(&self) -> OpeningBalanceSpec
fn clone(&self) -> OpeningBalanceSpec
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 OpeningBalanceSpec
impl Debug for OpeningBalanceSpec
Source§impl<'de> Deserialize<'de> for OpeningBalanceSpec
impl<'de> Deserialize<'de> for OpeningBalanceSpec
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 OpeningBalanceSpec
impl RefUnwindSafe for OpeningBalanceSpec
impl Send for OpeningBalanceSpec
impl Sync for OpeningBalanceSpec
impl Unpin for OpeningBalanceSpec
impl UnsafeUnpin for OpeningBalanceSpec
impl UnwindSafe for OpeningBalanceSpec
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.