pub struct SalesOrder {Show 29 fields
pub header: DocumentHeader,
pub so_type: SalesOrderType,
pub customer_id: String,
pub sold_to: Option<String>,
pub ship_to: Option<String>,
pub bill_to: Option<String>,
pub payer: Option<String>,
pub sales_org: String,
pub distribution_channel: String,
pub division: String,
pub sales_office: Option<String>,
pub sales_group: Option<String>,
pub items: Vec<SalesOrderItem>,
pub total_net_amount: Decimal,
pub total_tax_amount: Decimal,
pub total_gross_amount: Decimal,
pub payment_terms: String,
pub incoterms: Option<String>,
pub shipping_condition: Option<String>,
pub requested_delivery_date: Option<NaiveDate>,
pub customer_po_number: Option<String>,
pub is_complete: bool,
pub credit_status: CreditStatus,
pub credit_block_reason: Option<String>,
pub is_delivery_released: bool,
pub is_billing_released: bool,
pub quote_id: Option<String>,
pub contract_id: Option<String>,
pub customer_name: Option<String>,
}Expand description
Sales Order document.
Fields§
§header: DocumentHeaderDocument header
so_type: SalesOrderTypeSO type
customer_id: StringCustomer ID
sold_to: Option<String>Sold-to party (if different from customer)
ship_to: Option<String>Ship-to party
bill_to: Option<String>Bill-to party
payer: Option<String>Payer
sales_org: StringSales organization
distribution_channel: StringDistribution channel
division: StringDivision
sales_office: Option<String>Sales office
sales_group: Option<String>Sales group
items: Vec<SalesOrderItem>Line items
total_net_amount: DecimalTotal net amount
total_tax_amount: DecimalTotal tax amount
total_gross_amount: DecimalTotal gross amount
payment_terms: StringPayment terms
incoterms: Option<String>Incoterms
shipping_condition: Option<String>Shipping condition
requested_delivery_date: Option<NaiveDate>Requested delivery date
customer_po_number: Option<String>Customer PO number
is_complete: boolIs this order complete?
credit_status: CreditStatusCredit status
credit_block_reason: Option<String>Credit block reason
is_delivery_released: boolIs order released for delivery?
is_billing_released: boolIs order released for billing?
quote_id: Option<String>Related quote (if from quote)
contract_id: Option<String>Contract reference
customer_name: Option<String>Customer display name (denormalized, DS-011)
Implementations§
Source§impl SalesOrder
impl SalesOrder
Sourcepub fn new(
so_id: impl Into<String>,
company_code: impl Into<String>,
customer_id: impl Into<String>,
fiscal_year: u16,
fiscal_period: u8,
document_date: NaiveDate,
created_by: impl Into<String>,
) -> Self
pub fn new( so_id: impl Into<String>, company_code: impl Into<String>, customer_id: impl Into<String>, fiscal_year: u16, fiscal_period: u8, document_date: NaiveDate, created_by: impl Into<String>, ) -> Self
Create a new sales order.
Sourcepub fn with_so_type(self, so_type: SalesOrderType) -> Self
pub fn with_so_type(self, so_type: SalesOrderType) -> Self
Set SO type.
Sourcepub fn with_sales_org(
self,
sales_org: impl Into<String>,
dist_channel: impl Into<String>,
division: impl Into<String>,
) -> Self
pub fn with_sales_org( self, sales_org: impl Into<String>, dist_channel: impl Into<String>, division: impl Into<String>, ) -> Self
Set sales organization.
Sourcepub fn with_partners(
self,
sold_to: impl Into<String>,
ship_to: impl Into<String>,
bill_to: impl Into<String>,
) -> Self
pub fn with_partners( self, sold_to: impl Into<String>, ship_to: impl Into<String>, bill_to: impl Into<String>, ) -> Self
Set partner functions.
Sourcepub fn with_customer_po(self, po_number: impl Into<String>) -> Self
pub fn with_customer_po(self, po_number: impl Into<String>) -> Self
Set customer PO.
Sourcepub fn with_requested_delivery_date(self, date: NaiveDate) -> Self
pub fn with_requested_delivery_date(self, date: NaiveDate) -> Self
Set requested delivery date.
Sourcepub fn add_item(&mut self, item: SalesOrderItem)
pub fn add_item(&mut self, item: SalesOrderItem)
Add a line item.
Sourcepub fn recalculate_totals(&mut self)
pub fn recalculate_totals(&mut self)
Recalculate totals.
Sourcepub fn check_credit(&mut self, passed: bool, block_reason: Option<String>)
pub fn check_credit(&mut self, passed: bool, block_reason: Option<String>)
Perform credit check.
Sourcepub fn release_credit_block(&mut self, user: impl Into<String>)
pub fn release_credit_block(&mut self, user: impl Into<String>)
Release credit block.
Sourcepub fn release_for_delivery(&mut self)
pub fn release_for_delivery(&mut self)
Release for delivery.
Sourcepub fn release_for_billing(&mut self)
pub fn release_for_billing(&mut self)
Release for billing.
Sourcepub fn check_complete(&mut self)
pub fn check_complete(&mut self)
Check if order is complete.
Sourcepub fn open_delivery_value(&self) -> Decimal
pub fn open_delivery_value(&self) -> Decimal
Get total open delivery value.
Sourcepub fn open_billing_value(&self) -> Decimal
pub fn open_billing_value(&self) -> Decimal
Get total open billing value.
Trait Implementations§
Source§impl Clone for SalesOrder
impl Clone for SalesOrder
Source§fn clone(&self) -> SalesOrder
fn clone(&self) -> SalesOrder
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SalesOrder
impl Debug for SalesOrder
Source§impl<'de> Deserialize<'de> for SalesOrder
impl<'de> Deserialize<'de> for SalesOrder
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>,
Auto Trait Implementations§
impl Freeze for SalesOrder
impl RefUnwindSafe for SalesOrder
impl Send for SalesOrder
impl Sync for SalesOrder
impl Unpin for SalesOrder
impl UnsafeUnpin for SalesOrder
impl UnwindSafe for SalesOrder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.