pub struct O2CGenerator { /* private fields */ }Expand description
Generator for O2C document flows.
Implementations§
Source§impl O2CGenerator
impl O2CGenerator
Sourcepub fn with_config(seed: u64, config: O2CGeneratorConfig) -> Self
pub fn with_config(seed: u64, config: O2CGeneratorConfig) -> Self
Create a new O2C generator with custom configuration.
Sourcepub fn generate_chain(
&mut self,
company_code: &str,
customer: &Customer,
materials: &[&Material],
so_date: NaiveDate,
fiscal_year: u16,
fiscal_period: u8,
created_by: &str,
) -> O2CDocumentChain
pub fn generate_chain( &mut self, company_code: &str, customer: &Customer, materials: &[&Material], so_date: NaiveDate, fiscal_year: u16, fiscal_period: u8, created_by: &str, ) -> O2CDocumentChain
Generate a complete O2C chain.
Sourcepub fn generate_sales_order(
&mut self,
company_code: &str,
customer: &Customer,
materials: &[&Material],
so_date: NaiveDate,
fiscal_year: u16,
fiscal_period: u8,
created_by: &str,
) -> SalesOrder
pub fn generate_sales_order( &mut self, company_code: &str, customer: &Customer, materials: &[&Material], so_date: NaiveDate, fiscal_year: u16, fiscal_period: u8, created_by: &str, ) -> SalesOrder
Generate a sales order.
Sourcepub fn generate_chains(
&mut self,
count: usize,
company_code: &str,
customers: &CustomerPool,
materials: &MaterialPool,
date_range: (NaiveDate, NaiveDate),
fiscal_year: u16,
created_by: &str,
) -> Vec<O2CDocumentChain>
pub fn generate_chains( &mut self, count: usize, company_code: &str, customers: &CustomerPool, materials: &MaterialPool, date_range: (NaiveDate, NaiveDate), fiscal_year: u16, created_by: &str, ) -> Vec<O2CDocumentChain>
Generate multiple O2C chains.
Sourcepub fn generate_partial_payment(
&mut self,
invoice: &CustomerInvoice,
company_code: &str,
customer: &Customer,
payment_date: NaiveDate,
fiscal_year: u16,
fiscal_period: u8,
created_by: &str,
payment_percent: f64,
) -> (Payment, Decimal, Option<NaiveDate>)
pub fn generate_partial_payment( &mut self, invoice: &CustomerInvoice, company_code: &str, customer: &Customer, payment_date: NaiveDate, fiscal_year: u16, fiscal_period: u8, created_by: &str, payment_percent: f64, ) -> (Payment, Decimal, Option<NaiveDate>)
Generate a partial payment for an invoice.
Sourcepub fn generate_short_payment(
&mut self,
invoice: &CustomerInvoice,
company_code: &str,
customer: &Customer,
payment_date: NaiveDate,
fiscal_year: u16,
fiscal_period: u8,
created_by: &str,
) -> (Payment, ShortPayment)
pub fn generate_short_payment( &mut self, invoice: &CustomerInvoice, company_code: &str, customer: &Customer, payment_date: NaiveDate, fiscal_year: u16, fiscal_period: u8, created_by: &str, ) -> (Payment, ShortPayment)
Generate a short payment for an invoice.
Sourcepub fn generate_on_account_payment(
&mut self,
company_code: &str,
customer: &Customer,
payment_date: NaiveDate,
fiscal_year: u16,
fiscal_period: u8,
created_by: &str,
currency: &str,
amount: Decimal,
) -> (Payment, OnAccountPayment)
pub fn generate_on_account_payment( &mut self, company_code: &str, customer: &Customer, payment_date: NaiveDate, fiscal_year: u16, fiscal_period: u8, created_by: &str, currency: &str, amount: Decimal, ) -> (Payment, OnAccountPayment)
Generate an on-account payment.
Sourcepub fn generate_payment_correction(
&mut self,
original_payment: &Payment,
company_code: &str,
customer_id: &str,
correction_date: NaiveDate,
currency: &str,
) -> PaymentCorrection
pub fn generate_payment_correction( &mut self, original_payment: &Payment, company_code: &str, customer_id: &str, correction_date: NaiveDate, currency: &str, ) -> PaymentCorrection
Generate a payment correction (NSF or chargeback).
Auto Trait Implementations§
impl Freeze for O2CGenerator
impl RefUnwindSafe for O2CGenerator
impl Send for O2CGenerator
impl Sync for O2CGenerator
impl Unpin for O2CGenerator
impl UnwindSafe for O2CGenerator
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