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.