pub struct ICGenerator { /* private fields */ }Expand description
Generator for intercompany transactions.
Implementations§
Source§impl ICGenerator
impl ICGenerator
Sourcepub fn new_with_framework(
config: ICGeneratorConfig,
ownership_structure: OwnershipStructure,
seed: u64,
framework: &str,
) -> Self
pub fn new_with_framework( config: ICGeneratorConfig, ownership_structure: OwnershipStructure, seed: u64, framework: &str, ) -> Self
Create a new IC generator for a specific accounting framework.
Sourcepub fn new(
config: ICGeneratorConfig,
ownership_structure: OwnershipStructure,
seed: u64,
) -> Self
pub fn new( config: ICGeneratorConfig, ownership_structure: OwnershipStructure, seed: u64, ) -> Self
Create a new IC generator (defaults to US GAAP).
Sourcepub fn add_transfer_pricing_policy(
&mut self,
relationship_id: String,
policy: TransferPricingPolicy,
)
pub fn add_transfer_pricing_policy( &mut self, relationship_id: String, policy: TransferPricingPolicy, )
Add a transfer pricing policy.
Sourcepub fn generate_ic_transaction(
&mut self,
date: NaiveDate,
_fiscal_period: &str,
) -> Option<ICMatchedPair>
pub fn generate_ic_transaction( &mut self, date: NaiveDate, _fiscal_period: &str, ) -> Option<ICMatchedPair>
Generate a single IC matched pair.
Sourcepub fn generate_journal_entries(
&mut self,
pair: &ICMatchedPair,
fiscal_year: i32,
fiscal_period: u32,
) -> (JournalEntry, JournalEntry)
pub fn generate_journal_entries( &mut self, pair: &ICMatchedPair, fiscal_year: i32, fiscal_period: u32, ) -> (JournalEntry, JournalEntry)
Generate IC journal entries from a matched pair.
Sourcepub fn generate_ic_loan(
&mut self,
lender: String,
borrower: String,
start_date: NaiveDate,
term_months: u32,
) -> ICLoan
pub fn generate_ic_loan( &mut self, lender: String, borrower: String, start_date: NaiveDate, term_months: u32, ) -> ICLoan
Generate an IC loan.
Sourcepub fn generate_loan_interest_entries(
&mut self,
as_of_date: NaiveDate,
fiscal_year: i32,
fiscal_period: u32,
) -> Vec<(JournalEntry, JournalEntry)>
pub fn generate_loan_interest_entries( &mut self, as_of_date: NaiveDate, fiscal_year: i32, fiscal_period: u32, ) -> Vec<(JournalEntry, JournalEntry)>
Generate interest entries for active loans.
Sourcepub fn get_matched_pairs(&self) -> &[ICMatchedPair]
pub fn get_matched_pairs(&self) -> &[ICMatchedPair]
Get all generated matched pairs.
Sourcepub fn get_open_pairs(&self) -> Vec<&ICMatchedPair>
pub fn get_open_pairs(&self) -> Vec<&ICMatchedPair>
Get open (unsettled) matched pairs.
Sourcepub fn get_active_loans(&self) -> &[ICLoan]
pub fn get_active_loans(&self) -> &[ICLoan]
Get active loans.
Sourcepub fn generate_transactions_for_period(
&mut self,
start_date: NaiveDate,
end_date: NaiveDate,
transactions_per_day: usize,
) -> Vec<ICMatchedPair>
pub fn generate_transactions_for_period( &mut self, start_date: NaiveDate, end_date: NaiveDate, transactions_per_day: usize, ) -> Vec<ICMatchedPair>
Generate multiple IC transactions for a date range.
Sourcepub fn reset_counters(&mut self)
pub fn reset_counters(&mut self)
Reset counters (for testing).
Sourcepub fn generate_ic_document_chains(
&mut self,
pairs: &[ICMatchedPair],
) -> ICDocumentChains
pub fn generate_ic_document_chains( &mut self, pairs: &[ICMatchedPair], ) -> ICDocumentChains
Generate P2P/O2C source documents from IC matched pairs.
For each eligible pair (GoodsSale, ServiceProvided, ManagementFee, Royalty, or ExpenseRecharge) this creates:
- Seller side: a
CustomerInvoicebilled to the buyer company - Buyer side: a
PurchaseOrder,GoodsReceipt, andVendorInvoicereferencing the seller company
All documents carry the IC reference in header.reference so
downstream processes can trace them back to the originating
ICMatchedPair.
Auto Trait Implementations§
impl Freeze for ICGenerator
impl !RefUnwindSafe for ICGenerator
impl Send for ICGenerator
impl Sync for ICGenerator
impl Unpin for ICGenerator
impl UnsafeUnpin for ICGenerator
impl !UnwindSafe for ICGenerator
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.