pub struct PurchaseOrder {Show 29 fields
pub id: PurchaseOrderId,
pub po_number: String,
pub supplier_id: Uuid,
pub status: PurchaseOrderStatus,
pub order_date: DateTime<Utc>,
pub expected_date: Option<DateTime<Utc>>,
pub delivered_date: Option<DateTime<Utc>>,
pub ship_to_address: Option<String>,
pub ship_to_city: Option<String>,
pub ship_to_state: Option<String>,
pub ship_to_postal_code: Option<String>,
pub ship_to_country: Option<String>,
pub payment_terms: PaymentTerms,
pub currency: CurrencyCode,
pub subtotal: Decimal,
pub tax_amount: Decimal,
pub shipping_cost: Decimal,
pub discount_amount: Decimal,
pub total: Decimal,
pub amount_paid: Decimal,
pub supplier_reference: Option<String>,
pub notes: Option<String>,
pub supplier_notes: Option<String>,
pub approved_by: Option<String>,
pub approved_at: Option<DateTime<Utc>>,
pub items: Vec<PurchaseOrderItem>,
pub sent_at: Option<DateTime<Utc>>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
A purchase order
Fields§
§id: PurchaseOrderIdUnique ID
po_number: StringHuman-readable PO number
supplier_id: UuidSupplier ID
status: PurchaseOrderStatusPO status
order_date: DateTime<Utc>Order date
expected_date: Option<DateTime<Utc>>Expected delivery date
delivered_date: Option<DateTime<Utc>>Actual delivery date
ship_to_address: Option<String>Ship to address
ship_to_city: Option<String>Ship to city
ship_to_state: Option<String>Ship to state
ship_to_postal_code: Option<String>Ship to postal code
ship_to_country: Option<String>Ship to country
payment_terms: PaymentTermsPayment terms
currency: CurrencyCodeCurrency
subtotal: DecimalSubtotal (sum of line items)
tax_amount: DecimalTax amount
shipping_cost: DecimalShipping cost
discount_amount: DecimalDiscount amount
total: DecimalTotal amount
amount_paid: DecimalAmount paid
supplier_reference: Option<String>Supplier reference number
notes: Option<String>Internal notes
supplier_notes: Option<String>Supplier notes (visible to supplier)
approved_by: Option<String>Who approved the PO
approved_at: Option<DateTime<Utc>>When approved
items: Vec<PurchaseOrderItem>Line items
sent_at: Option<DateTime<Utc>>When sent to supplier
created_at: DateTime<Utc>When created
updated_at: DateTime<Utc>When last updated
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 (const: unstable) · 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<PurchaseOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<PurchaseOrder, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for PurchaseOrder
impl Serialize for PurchaseOrder
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Source§impl Validate for PurchaseOrder
impl Validate for PurchaseOrder
Source§fn validate(&self) -> Result<(), CommerceError>
fn validate(&self) -> Result<(), CommerceError>
Validate a purchase order.
Requires a non-nil supplier, a PO number, a valid currency code, non-negative charge amounts, and valid line items (positive quantities and non-negative costs).
Auto Trait Implementations§
impl Freeze for PurchaseOrder
impl RefUnwindSafe for PurchaseOrder
impl Send for PurchaseOrder
impl Sync for PurchaseOrder
impl Unpin for PurchaseOrder
impl UnsafeUnpin 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