pub struct InventoryMovement {Show 33 fields
pub document_number: String,
pub item_number: u32,
pub company_code: String,
pub movement_date: NaiveDate,
pub posting_date: NaiveDate,
pub movement_type: MovementType,
pub material_id: String,
pub description: String,
pub plant: String,
pub storage_location: String,
pub quantity: Decimal,
pub unit: String,
pub value: Decimal,
pub currency: String,
pub unit_cost: Decimal,
pub batch_number: Option<String>,
pub serial_numbers: Vec<String>,
pub reference_doc_type: Option<ReferenceDocType>,
pub reference_doc_number: Option<String>,
pub reference_item: Option<u32>,
pub vendor_id: Option<String>,
pub customer_id: Option<String>,
pub cost_center: Option<String>,
pub gl_account: String,
pub offset_account: String,
pub gl_reference: Option<GLReference>,
pub special_stock: Option<SpecialStockType>,
pub reason_code: Option<String>,
pub created_by: String,
pub created_at: DateTime<Utc>,
pub is_reversed: bool,
pub reversal_doc: Option<String>,
pub notes: Option<String>,
}Expand description
Inventory movement (goods receipt, issue, transfer).
Fields§
§document_number: StringMovement document number.
item_number: u32Movement item number.
company_code: StringCompany code.
movement_date: NaiveDateMovement date.
posting_date: NaiveDatePosting date.
movement_type: MovementTypeMovement type.
material_id: StringMaterial ID.
description: StringMaterial description.
plant: StringPlant.
storage_location: StringStorage location.
quantity: DecimalQuantity.
unit: StringUnit of measure.
value: DecimalMovement value.
currency: StringCurrency.
unit_cost: DecimalUnit cost.
batch_number: Option<String>Batch number.
serial_numbers: Vec<String>Serial numbers.
reference_doc_type: Option<ReferenceDocType>Reference document type.
reference_doc_number: Option<String>Reference document number.
reference_item: Option<u32>Reference item.
vendor_id: Option<String>Vendor (for receipts).
customer_id: Option<String>Customer (for issues).
cost_center: Option<String>Cost center.
gl_account: StringGL account.
offset_account: StringOffset account.
gl_reference: Option<GLReference>GL reference.
special_stock: Option<SpecialStockType>Special stock indicator.
reason_code: Option<String>Reason code.
created_by: StringCreated by.
created_at: DateTime<Utc>Created at.
is_reversed: boolReversed.
reversal_doc: Option<String>Reversal document.
notes: Option<String>Notes.
Implementations§
Source§impl InventoryMovement
impl InventoryMovement
Sourcepub fn new(
document_number: String,
item_number: u32,
company_code: String,
movement_date: NaiveDate,
movement_type: MovementType,
material_id: String,
description: String,
plant: String,
storage_location: String,
quantity: Decimal,
unit: String,
unit_cost: Decimal,
currency: String,
created_by: String,
) -> Self
pub fn new( document_number: String, item_number: u32, company_code: String, movement_date: NaiveDate, movement_type: MovementType, material_id: String, description: String, plant: String, storage_location: String, quantity: Decimal, unit: String, unit_cost: Decimal, currency: String, created_by: String, ) -> Self
Creates a new inventory movement.
Sourcepub fn goods_receipt_po(
document_number: String,
item_number: u32,
company_code: String,
movement_date: NaiveDate,
material_id: String,
description: String,
plant: String,
storage_location: String,
quantity: Decimal,
unit: String,
unit_cost: Decimal,
currency: String,
po_number: String,
po_item: u32,
vendor_id: String,
created_by: String,
) -> Self
pub fn goods_receipt_po( document_number: String, item_number: u32, company_code: String, movement_date: NaiveDate, material_id: String, description: String, plant: String, storage_location: String, quantity: Decimal, unit: String, unit_cost: Decimal, currency: String, po_number: String, po_item: u32, vendor_id: String, created_by: String, ) -> Self
Creates a goods receipt from purchase order.
Sourcepub fn goods_issue_sales(
document_number: String,
item_number: u32,
company_code: String,
movement_date: NaiveDate,
material_id: String,
description: String,
plant: String,
storage_location: String,
quantity: Decimal,
unit: String,
unit_cost: Decimal,
currency: String,
sales_order: String,
sales_item: u32,
customer_id: String,
created_by: String,
) -> Self
pub fn goods_issue_sales( document_number: String, item_number: u32, company_code: String, movement_date: NaiveDate, material_id: String, description: String, plant: String, storage_location: String, quantity: Decimal, unit: String, unit_cost: Decimal, currency: String, sales_order: String, sales_item: u32, customer_id: String, created_by: String, ) -> Self
Creates a goods issue to sales order.
Sourcepub fn with_batch(self, batch_number: String) -> Self
pub fn with_batch(self, batch_number: String) -> Self
Sets batch number.
Sourcepub fn with_serials(self, serial_numbers: Vec<String>) -> Self
pub fn with_serials(self, serial_numbers: Vec<String>) -> Self
Sets serial numbers.
Sourcepub fn with_cost_center(self, cost_center: String) -> Self
pub fn with_cost_center(self, cost_center: String) -> Self
Sets cost center.
Sourcepub fn with_reason(self, reason_code: String) -> Self
pub fn with_reason(self, reason_code: String) -> Self
Sets reason code.
Sourcepub fn with_gl_reference(self, reference: GLReference) -> Self
pub fn with_gl_reference(self, reference: GLReference) -> Self
Sets GL reference.
Sourcepub fn create_reversal(
&self,
reversal_doc_number: String,
created_by: String,
) -> Self
pub fn create_reversal( &self, reversal_doc_number: String, created_by: String, ) -> Self
Creates a reversal movement.
Sourcepub fn quantity_sign(&self) -> i8
pub fn quantity_sign(&self) -> i8
Gets sign for quantity (positive or negative).
Sourcepub fn signed_quantity(&self) -> Decimal
pub fn signed_quantity(&self) -> Decimal
Gets signed quantity.
Trait Implementations§
Source§impl Clone for InventoryMovement
impl Clone for InventoryMovement
Source§fn clone(&self) -> InventoryMovement
fn clone(&self) -> InventoryMovement
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more