pub struct FAGenerator { /* private fields */ }Expand description
Generator for Fixed Assets transactions.
Implementations§
Source§impl FAGenerator
impl FAGenerator
Sourcepub fn new(config: FAGeneratorConfig, rng: ChaCha8Rng) -> Self
pub fn new(config: FAGeneratorConfig, rng: ChaCha8Rng) -> Self
Creates a new FA generator.
Sourcepub fn with_seed(config: FAGeneratorConfig, seed: u64) -> Self
pub fn with_seed(config: FAGeneratorConfig, seed: u64) -> Self
Creates a new FA generator from a seed, constructing the RNG internally.
Sourcepub fn generate_asset_acquisition(
&mut self,
company_code: &str,
asset_class_str: &str,
description: &str,
acquisition_date: NaiveDate,
currency: &str,
cost_center: Option<&str>,
) -> (FixedAssetRecord, JournalEntry)
pub fn generate_asset_acquisition( &mut self, company_code: &str, asset_class_str: &str, description: &str, acquisition_date: NaiveDate, currency: &str, cost_center: Option<&str>, ) -> (FixedAssetRecord, JournalEntry)
Generates a new fixed asset acquisition.
Sourcepub fn run_depreciation(
&mut self,
company_code: &str,
assets: &[&FixedAssetRecord],
period_date: NaiveDate,
fiscal_year: i32,
fiscal_period: u32,
) -> (DepreciationRun, Vec<JournalEntry>)
pub fn run_depreciation( &mut self, company_code: &str, assets: &[&FixedAssetRecord], period_date: NaiveDate, fiscal_year: i32, fiscal_period: u32, ) -> (DepreciationRun, Vec<JournalEntry>)
Runs depreciation for a period.
Sourcepub fn generate_disposal(
&mut self,
asset: &FixedAssetRecord,
disposal_date: NaiveDate,
disposal_type: DisposalType,
proceeds: Decimal,
) -> (AssetDisposal, JournalEntry)
pub fn generate_disposal( &mut self, asset: &FixedAssetRecord, disposal_date: NaiveDate, disposal_type: DisposalType, proceeds: Decimal, ) -> (AssetDisposal, JournalEntry)
Generates an asset disposal.
Auto Trait Implementations§
impl Freeze for FAGenerator
impl RefUnwindSafe for FAGenerator
impl Send for FAGenerator
impl Sync for FAGenerator
impl Unpin for FAGenerator
impl UnsafeUnpin for FAGenerator
impl UnwindSafe for FAGenerator
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
Mutably borrows from an owned value. Read more
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>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
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
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.