pub struct VendorInvoiceItem {
pub base: DocumentLineItem,
pub po_number: Option<String>,
pub po_item: Option<u16>,
pub gr_number: Option<String>,
pub gr_item: Option<u16>,
pub invoiced_quantity: Decimal,
pub match_status: ThreeWayMatchStatus,
pub price_variance: Decimal,
pub quantity_variance: Decimal,
pub tax_code: Option<String>,
pub withholding_tax: bool,
pub withholding_tax_amount: Decimal,
}Expand description
Vendor Invoice line item.
Fields§
§base: DocumentLineItemBase line item fields
po_number: Option<String>Reference PO number
po_item: Option<u16>Reference PO item
gr_number: Option<String>Reference GR number
gr_item: Option<u16>Reference GR item
invoiced_quantity: DecimalInvoiced quantity
match_status: ThreeWayMatchStatusThree-way match status
price_variance: DecimalPrice variance amount
quantity_variance: DecimalQuantity variance
tax_code: Option<String>Tax code
withholding_tax: boolWithholding tax applicable
withholding_tax_amount: DecimalWithholding tax amount
Implementations§
Source§impl VendorInvoiceItem
impl VendorInvoiceItem
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 vendor invoice item.
Sourcepub fn from_po_gr(
line_number: u16,
description: impl Into<String>,
quantity: Decimal,
unit_price: Decimal,
po_number: impl Into<String>,
po_item: u16,
gr_number: Option<String>,
gr_item: Option<u16>,
) -> Self
pub fn from_po_gr( line_number: u16, description: impl Into<String>, quantity: Decimal, unit_price: Decimal, po_number: impl Into<String>, po_item: u16, gr_number: Option<String>, gr_item: Option<u16>, ) -> Self
Create from PO/GR reference.
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_withholding_tax(self, amount: Decimal) -> Self
pub fn with_withholding_tax(self, amount: Decimal) -> Self
Set withholding tax.
Sourcepub fn with_match_status(self, status: ThreeWayMatchStatus) -> Self
pub fn with_match_status(self, status: ThreeWayMatchStatus) -> Self
Set match status.
Sourcepub fn calculate_price_variance(&mut self, po_price: Decimal)
pub fn calculate_price_variance(&mut self, po_price: Decimal)
Calculate price variance.
Sourcepub fn calculate_quantity_variance(&mut self, gr_quantity: Decimal)
pub fn calculate_quantity_variance(&mut self, gr_quantity: Decimal)
Calculate quantity variance.
Trait Implementations§
Source§impl Clone for VendorInvoiceItem
impl Clone for VendorInvoiceItem
Source§fn clone(&self) -> VendorInvoiceItem
fn clone(&self) -> VendorInvoiceItem
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 VendorInvoiceItem
impl Debug for VendorInvoiceItem
Source§impl<'de> Deserialize<'de> for VendorInvoiceItem
impl<'de> Deserialize<'de> for VendorInvoiceItem
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 VendorInvoiceItem
impl RefUnwindSafe for VendorInvoiceItem
impl Send for VendorInvoiceItem
impl Sync for VendorInvoiceItem
impl Unpin for VendorInvoiceItem
impl UnwindSafe for VendorInvoiceItem
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