pub struct SalesOrder {Show 28 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>,
}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
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 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more