pub struct InventoryGenerator { /* private fields */ }Expand description
Generator for inventory transactions.
Implementations§
Source§impl InventoryGenerator
impl InventoryGenerator
Sourcepub fn new(config: InventoryGeneratorConfig, rng: ChaCha8Rng) -> Self
pub fn new(config: InventoryGeneratorConfig, rng: ChaCha8Rng) -> Self
Creates a new inventory generator.
Sourcepub fn generate_position(
&mut self,
company_code: &str,
plant: &str,
storage_location: &str,
material_id: &str,
description: &str,
initial_quantity: Decimal,
unit_cost: Option<Decimal>,
_currency: &str,
) -> InventoryPosition
pub fn generate_position( &mut self, company_code: &str, plant: &str, storage_location: &str, material_id: &str, description: &str, initial_quantity: Decimal, unit_cost: Option<Decimal>, _currency: &str, ) -> InventoryPosition
Generates an initial inventory position.
Sourcepub fn generate_goods_receipt(
&mut self,
position: &InventoryPosition,
receipt_date: NaiveDate,
quantity: Decimal,
unit_cost: Decimal,
po_number: Option<&str>,
) -> (InventoryMovement, JournalEntry)
pub fn generate_goods_receipt( &mut self, position: &InventoryPosition, receipt_date: NaiveDate, quantity: Decimal, unit_cost: Decimal, po_number: Option<&str>, ) -> (InventoryMovement, JournalEntry)
Generates a goods receipt (inventory increase).
Sourcepub fn generate_goods_issue(
&mut self,
position: &InventoryPosition,
issue_date: NaiveDate,
quantity: Decimal,
cost_center: Option<&str>,
production_order: Option<&str>,
) -> (InventoryMovement, JournalEntry)
pub fn generate_goods_issue( &mut self, position: &InventoryPosition, issue_date: NaiveDate, quantity: Decimal, cost_center: Option<&str>, production_order: Option<&str>, ) -> (InventoryMovement, JournalEntry)
Generates a goods issue (inventory decrease).
Sourcepub fn generate_transfer(
&mut self,
position: &InventoryPosition,
transfer_date: NaiveDate,
quantity: Decimal,
to_plant: &str,
to_storage_location: &str,
) -> (InventoryMovement, InventoryMovement, JournalEntry)
pub fn generate_transfer( &mut self, position: &InventoryPosition, transfer_date: NaiveDate, quantity: Decimal, to_plant: &str, to_storage_location: &str, ) -> (InventoryMovement, InventoryMovement, JournalEntry)
Generates a stock transfer between locations.
Sourcepub fn generate_adjustment(
&mut self,
position: &InventoryPosition,
adjustment_date: NaiveDate,
quantity_change: Decimal,
reason: &str,
) -> (InventoryMovement, JournalEntry)
pub fn generate_adjustment( &mut self, position: &InventoryPosition, adjustment_date: NaiveDate, quantity_change: Decimal, reason: &str, ) -> (InventoryMovement, JournalEntry)
Generates an inventory adjustment.
Auto Trait Implementations§
impl Freeze for InventoryGenerator
impl RefUnwindSafe for InventoryGenerator
impl Send for InventoryGenerator
impl Sync for InventoryGenerator
impl Unpin for InventoryGenerator
impl UnwindSafe for InventoryGenerator
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