pub struct InventoryMovementGenerator { /* private fields */ }Expand description
Generates InventoryMovement records for warehouse stock flow.
Implementations§
Source§impl InventoryMovementGenerator
impl InventoryMovementGenerator
Sourcepub fn generate(
&mut self,
company_code: &str,
material_ids: &[(String, String)],
period_start: NaiveDate,
period_end: NaiveDate,
movements_per_material: u32,
currency: &str,
) -> Vec<InventoryMovement>
pub fn generate( &mut self, company_code: &str, material_ids: &[(String, String)], period_start: NaiveDate, period_end: NaiveDate, movements_per_material: u32, currency: &str, ) -> Vec<InventoryMovement>
Generate inventory movements for the given period.
Creates a mix of movement types distributed across the period for each material in the pool.
§Arguments
company_code- Company / entity code.material_ids- Available materials as(material_id, description)tuples.period_start- Start of the generation period.period_end- End of the generation period.movements_per_material- Average number of movements per material.currency- Currency code for value calculations.
Sourcepub fn generate_with_production_orders(
&mut self,
company_code: &str,
material_ids: &[(String, String)],
period_start: NaiveDate,
period_end: NaiveDate,
movements_per_material: u32,
currency: &str,
production_order_ids: &[String],
) -> Vec<InventoryMovement>
pub fn generate_with_production_orders( &mut self, company_code: &str, material_ids: &[(String, String)], period_start: NaiveDate, period_end: NaiveDate, movements_per_material: u32, currency: &str, production_order_ids: &[String], ) -> Vec<InventoryMovement>
Generate inventory movements, linking GoodsIssue movements to real production order IDs.
When production_order_ids is non-empty, GoodsIssue movements use actual IDs
(cycling through the list) instead of fabricated PRD-{random} strings.
§Arguments
company_code- Company / entity code.material_ids- Available materials as(material_id, description)tuples.period_start- Start of the generation period.period_end- End of the generation period.movements_per_material- Average number of movements per material.currency- Currency code for value calculations.production_order_ids- Real production order IDs to use for GoodsIssue reference docs.
Auto Trait Implementations§
impl !Freeze for InventoryMovementGenerator
impl RefUnwindSafe for InventoryMovementGenerator
impl Send for InventoryMovementGenerator
impl Sync for InventoryMovementGenerator
impl Unpin for InventoryMovementGenerator
impl UnsafeUnpin for InventoryMovementGenerator
impl UnwindSafe for InventoryMovementGenerator
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.