InventoryMovement

Struct InventoryMovement 

Source
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: String

Movement document number.

§item_number: u32

Movement item number.

§company_code: String

Company code.

§movement_date: NaiveDate

Movement date.

§posting_date: NaiveDate

Posting date.

§movement_type: MovementType

Movement type.

§material_id: String

Material ID.

§description: String

Material description.

§plant: String

Plant.

§storage_location: String

Storage location.

§quantity: Decimal

Quantity.

§unit: String

Unit of measure.

§value: Decimal

Movement value.

§currency: String

Currency.

§unit_cost: Decimal

Unit 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: String

GL account.

§offset_account: String

Offset account.

§gl_reference: Option<GLReference>

GL reference.

§special_stock: Option<SpecialStockType>

Special stock indicator.

§reason_code: Option<String>

Reason code.

§created_by: String

Created by.

§created_at: DateTime<Utc>

Created at.

§is_reversed: bool

Reversed.

§reversal_doc: Option<String>

Reversal document.

§notes: Option<String>

Notes.

Implementations§

Source§

impl InventoryMovement

Source

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.

Source

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.

Source

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.

Source

pub fn with_batch(self, batch_number: String) -> Self

Sets batch number.

Source

pub fn with_serials(self, serial_numbers: Vec<String>) -> Self

Sets serial numbers.

Source

pub fn with_cost_center(self, cost_center: String) -> Self

Sets cost center.

Source

pub fn with_reason(self, reason_code: String) -> Self

Sets reason code.

Source

pub fn with_gl_reference(self, reference: GLReference) -> Self

Sets GL reference.

Source

pub fn reverse(&mut self, reversal_doc: String)

Marks as reversed.

Source

pub fn create_reversal( &self, reversal_doc_number: String, created_by: String, ) -> Self

Creates a reversal movement.

Source

pub fn quantity_sign(&self) -> i8

Gets sign for quantity (positive or negative).

Source

pub fn signed_quantity(&self) -> Decimal

Gets signed quantity.

Trait Implementations§

Source§

impl Clone for InventoryMovement

Source§

fn clone(&self) -> InventoryMovement

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InventoryMovement

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for InventoryMovement

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for InventoryMovement

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,