pub struct InventoryGeneratorConfig {
pub default_valuation_method: ValuationMethod,
pub avg_unit_cost: Decimal,
pub cost_variation: Decimal,
pub avg_movement_quantity: Decimal,
pub quantity_variation: Decimal,
}Expand description
Configuration for inventory generation.
§Moving-average valuation note
When default_valuation_method is ValuationMethod::MovingAverage, the
generator updates the weighted-average unit cost after each goods receipt via
InventoryPosition::add_quantity. The moving-average formula is:
new_avg_cost = (existing_qty × existing_cost + receipt_qty × receipt_cost)
/ (existing_qty + receipt_qty)generate_goods_receipt now accepts &mut InventoryPosition so it can update
the position in-place, ensuring valuation.unit_cost reflects the true
moving-average after each receipt.
Fields§
§default_valuation_method: ValuationMethodDefault valuation method.
avg_unit_cost: DecimalAverage unit cost.
cost_variation: DecimalUnit cost variation.
avg_movement_quantity: DecimalAverage movement quantity.
quantity_variation: DecimalQuantity variation.
Trait Implementations§
Source§impl Clone for InventoryGeneratorConfig
impl Clone for InventoryGeneratorConfig
Source§fn clone(&self) -> InventoryGeneratorConfig
fn clone(&self) -> InventoryGeneratorConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InventoryGeneratorConfig
impl Debug for InventoryGeneratorConfig
Auto Trait Implementations§
impl Freeze for InventoryGeneratorConfig
impl RefUnwindSafe for InventoryGeneratorConfig
impl Send for InventoryGeneratorConfig
impl Sync for InventoryGeneratorConfig
impl Unpin for InventoryGeneratorConfig
impl UnsafeUnpin for InventoryGeneratorConfig
impl UnwindSafe for InventoryGeneratorConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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.