pub struct GoodsReceipt {Show 15 fields
pub header: DocumentHeader,
pub gr_type: GoodsReceiptType,
pub items: Vec<GoodsReceiptItem>,
pub total_quantity: Decimal,
pub total_value: Decimal,
pub purchase_order_id: Option<String>,
pub vendor_id: Option<String>,
pub bill_of_lading: Option<String>,
pub delivery_note: Option<String>,
pub plant: String,
pub storage_location: String,
pub material_doc_year: u16,
pub is_posted: bool,
pub is_cancelled: bool,
pub cancellation_doc: Option<String>,
}Expand description
Goods Receipt document.
Fields§
§header: DocumentHeaderDocument header
gr_type: GoodsReceiptTypeGR type
items: Vec<GoodsReceiptItem>Line items
total_quantity: DecimalTotal quantity received
total_value: DecimalTotal value
purchase_order_id: Option<String>Reference PO (primary)
vendor_id: Option<String>Vendor (for info)
bill_of_lading: Option<String>Bill of lading
delivery_note: Option<String>Delivery note from vendor
plant: StringReceiving plant
storage_location: StringReceiving storage location
material_doc_year: u16Material document year
is_posted: boolIs this GR posted?
is_cancelled: boolIs this GR cancelled/reversed?
cancellation_doc: Option<String>Cancellation GR reference
Implementations§
Source§impl GoodsReceipt
impl GoodsReceipt
Sourcepub fn new(
gr_id: impl Into<String>,
company_code: impl Into<String>,
plant: impl Into<String>,
storage_location: impl Into<String>,
fiscal_year: u16,
fiscal_period: u8,
document_date: NaiveDate,
created_by: impl Into<String>,
) -> Self
pub fn new( gr_id: impl Into<String>, company_code: impl Into<String>, plant: impl Into<String>, storage_location: impl Into<String>, fiscal_year: u16, fiscal_period: u8, document_date: NaiveDate, created_by: impl Into<String>, ) -> Self
Create a new goods receipt.
Sourcepub fn from_purchase_order(
gr_id: impl Into<String>,
company_code: impl Into<String>,
purchase_order_id: impl Into<String>,
vendor_id: impl Into<String>,
plant: impl Into<String>,
storage_location: impl Into<String>,
fiscal_year: u16,
fiscal_period: u8,
document_date: NaiveDate,
created_by: impl Into<String>,
) -> Self
pub fn from_purchase_order( gr_id: impl Into<String>, company_code: impl Into<String>, purchase_order_id: impl Into<String>, vendor_id: impl Into<String>, plant: impl Into<String>, storage_location: impl Into<String>, fiscal_year: u16, fiscal_period: u8, document_date: NaiveDate, created_by: impl Into<String>, ) -> Self
Create from PO reference.
Sourcepub fn with_gr_type(self, gr_type: GoodsReceiptType) -> Self
pub fn with_gr_type(self, gr_type: GoodsReceiptType) -> Self
Set GR type.
Sourcepub fn with_delivery_note(self, note: impl Into<String>) -> Self
pub fn with_delivery_note(self, note: impl Into<String>) -> Self
Set delivery note.
Sourcepub fn with_bill_of_lading(self, bol: impl Into<String>) -> Self
pub fn with_bill_of_lading(self, bol: impl Into<String>) -> Self
Set bill of lading.
Sourcepub fn add_item(&mut self, item: GoodsReceiptItem)
pub fn add_item(&mut self, item: GoodsReceiptItem)
Add a line item.
Sourcepub fn recalculate_totals(&mut self)
pub fn recalculate_totals(&mut self)
Recalculate totals.
Sourcepub fn post(&mut self, user: impl Into<String>, posting_date: NaiveDate)
pub fn post(&mut self, user: impl Into<String>, posting_date: NaiveDate)
Post the GR and generate GL entry.
Trait Implementations§
Source§impl Clone for GoodsReceipt
impl Clone for GoodsReceipt
Source§fn clone(&self) -> GoodsReceipt
fn clone(&self) -> GoodsReceipt
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 GoodsReceipt
impl Debug for GoodsReceipt
Source§impl<'de> Deserialize<'de> for GoodsReceipt
impl<'de> Deserialize<'de> for GoodsReceipt
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for GoodsReceipt
impl RefUnwindSafe for GoodsReceipt
impl Send for GoodsReceipt
impl Sync for GoodsReceipt
impl Unpin for GoodsReceipt
impl UnwindSafe for GoodsReceipt
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