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 does not update the weighted-average unit cost after each goods
receipt. The moving-average formula is:
new_avg_cost = (existing_qty × existing_cost + receipt_qty × receipt_cost)
/ (existing_qty + receipt_qty)TODO: Implement this recalculation in generate_goods_receipt so that
InventoryPosition::valuation.unit_cost reflects the true moving-average
cost after each receipt. Currently the initial cost is held constant for the
life of the position, which over-states (or under-states) the COGS/inventory
value when receipt prices fluctuate.
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 · 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