pub struct DocumentLineItem {Show 19 fields
pub line_number: u16,
pub material_id: Option<String>,
pub description: String,
pub quantity: Decimal,
pub uom: String,
pub unit_price: Decimal,
pub net_amount: Decimal,
pub tax_amount: Decimal,
pub gross_amount: Decimal,
pub gl_account: Option<String>,
pub cost_center: Option<String>,
pub profit_center: Option<String>,
pub internal_order: Option<String>,
pub wbs_element: Option<String>,
pub delivery_date: Option<NaiveDate>,
pub plant: Option<String>,
pub storage_location: Option<String>,
pub line_text: Option<String>,
pub is_cancelled: bool,
}Expand description
Document line item common fields.
Fields§
§line_number: u16Line item number
material_id: Option<String>Material/service ID (if applicable)
description: StringDescription
quantity: DecimalQuantity
uom: StringUnit of measure
unit_price: DecimalUnit price
net_amount: DecimalNet amount (quantity * unit_price)
tax_amount: DecimalTax amount
gross_amount: DecimalGross amount (net + tax)
gl_account: Option<String>GL account (for posting)
cost_center: Option<String>Cost center
profit_center: Option<String>Profit center
internal_order: Option<String>Internal order
wbs_element: Option<String>WBS element
delivery_date: Option<NaiveDate>Delivery date (for scheduling)
plant: Option<String>Plant/location
storage_location: Option<String>Storage location
line_text: Option<String>Line text
is_cancelled: boolIs this line cancelled?
Implementations§
Source§impl DocumentLineItem
impl DocumentLineItem
Sourcepub fn new(
line_number: u16,
description: impl Into<String>,
quantity: Decimal,
unit_price: Decimal,
) -> Self
pub fn new( line_number: u16, description: impl Into<String>, quantity: Decimal, unit_price: Decimal, ) -> Self
Create a new line item.
Sourcepub fn with_material(self, material_id: impl Into<String>) -> Self
pub fn with_material(self, material_id: impl Into<String>) -> Self
Set material ID.
Sourcepub fn with_gl_account(self, account: impl Into<String>) -> Self
pub fn with_gl_account(self, account: impl Into<String>) -> Self
Set GL account.
Sourcepub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
pub fn with_cost_center(self, cost_center: impl Into<String>) -> Self
Set cost center.
Sourcepub fn with_delivery_date(self, date: NaiveDate) -> Self
pub fn with_delivery_date(self, date: NaiveDate) -> Self
Set delivery date.
Sourcepub fn recalculate(&mut self)
pub fn recalculate(&mut self)
Recalculate amounts.
Trait Implementations§
Source§impl Clone for DocumentLineItem
impl Clone for DocumentLineItem
Source§fn clone(&self) -> DocumentLineItem
fn clone(&self) -> DocumentLineItem
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 DocumentLineItem
impl Debug for DocumentLineItem
Source§impl<'de> Deserialize<'de> for DocumentLineItem
impl<'de> Deserialize<'de> for DocumentLineItem
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 DocumentLineItem
impl RefUnwindSafe for DocumentLineItem
impl Send for DocumentLineItem
impl Sync for DocumentLineItem
impl Unpin for DocumentLineItem
impl UnwindSafe for DocumentLineItem
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