pub struct PurchaseOrder {Show 18 fields
pub header: DocumentHeader,
pub po_type: PurchaseOrderType,
pub vendor_id: String,
pub purchasing_org: String,
pub purchasing_group: String,
pub payment_terms: String,
pub incoterms: Option<String>,
pub incoterms_location: Option<String>,
pub items: Vec<PurchaseOrderItem>,
pub total_net_amount: Decimal,
pub total_tax_amount: Decimal,
pub total_gross_amount: Decimal,
pub is_complete: bool,
pub is_closed: bool,
pub requisition_id: Option<String>,
pub contract_id: Option<String>,
pub release_status: Option<String>,
pub output_complete: bool,
}Expand description
Purchase Order document.
Fields§
§header: DocumentHeaderDocument header
po_type: PurchaseOrderTypePO type
vendor_id: StringVendor ID
purchasing_org: StringPurchasing organization
purchasing_group: StringPurchasing group
payment_terms: StringPayment terms
incoterms: Option<String>Incoterms
incoterms_location: Option<String>Incoterms location
items: Vec<PurchaseOrderItem>Line items
total_net_amount: DecimalTotal net amount
total_tax_amount: DecimalTotal tax amount
total_gross_amount: DecimalTotal gross amount
is_complete: boolIs this PO completely delivered?
is_closed: boolIs this PO closed?
requisition_id: Option<String>Related purchase requisition
contract_id: Option<String>Contract reference
release_status: Option<String>Release status (for framework orders)
output_complete: boolOutput control - PO printed/sent
Implementations§
Source§impl PurchaseOrder
impl PurchaseOrder
Sourcepub fn new(
po_id: impl Into<String>,
company_code: impl Into<String>,
vendor_id: impl Into<String>,
fiscal_year: u16,
fiscal_period: u8,
document_date: NaiveDate,
created_by: impl Into<String>,
) -> Self
pub fn new( po_id: impl Into<String>, company_code: impl Into<String>, vendor_id: impl Into<String>, fiscal_year: u16, fiscal_period: u8, document_date: NaiveDate, created_by: impl Into<String>, ) -> Self
Create a new purchase order.
Sourcepub fn with_po_type(self, po_type: PurchaseOrderType) -> Self
pub fn with_po_type(self, po_type: PurchaseOrderType) -> Self
Set PO type.
Sourcepub fn with_purchasing_org(self, org: impl Into<String>) -> Self
pub fn with_purchasing_org(self, org: impl Into<String>) -> Self
Set purchasing organization.
Sourcepub fn with_purchasing_group(self, group: impl Into<String>) -> Self
pub fn with_purchasing_group(self, group: impl Into<String>) -> Self
Set purchasing group.
Sourcepub fn with_payment_terms(self, terms: impl Into<String>) -> Self
pub fn with_payment_terms(self, terms: impl Into<String>) -> Self
Set payment terms.
Sourcepub fn with_incoterms(
self,
incoterms: impl Into<String>,
location: impl Into<String>,
) -> Self
pub fn with_incoterms( self, incoterms: impl Into<String>, location: impl Into<String>, ) -> Self
Set incoterms.
Sourcepub fn add_item(&mut self, item: PurchaseOrderItem)
pub fn add_item(&mut self, item: PurchaseOrderItem)
Add a line item.
Sourcepub fn recalculate_totals(&mut self)
pub fn recalculate_totals(&mut self)
Recalculate totals from items.
Sourcepub fn check_complete(&mut self)
pub fn check_complete(&mut self)
Check if all items are fully received.
Sourcepub fn open_gr_amount(&self) -> Decimal
pub fn open_gr_amount(&self) -> Decimal
Get total open amount for goods receipt.
Sourcepub fn open_iv_amount(&self) -> Decimal
pub fn open_iv_amount(&self) -> Decimal
Get total open amount for invoice.
Trait Implementations§
Source§impl Clone for PurchaseOrder
impl Clone for PurchaseOrder
Source§fn clone(&self) -> PurchaseOrder
fn clone(&self) -> PurchaseOrder
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 PurchaseOrder
impl Debug for PurchaseOrder
Source§impl<'de> Deserialize<'de> for PurchaseOrder
impl<'de> Deserialize<'de> for PurchaseOrder
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 PurchaseOrder
impl RefUnwindSafe for PurchaseOrder
impl Send for PurchaseOrder
impl Sync for PurchaseOrder
impl Unpin for PurchaseOrder
impl UnwindSafe for PurchaseOrder
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