VendorInvoiceItem

Struct VendorInvoiceItem 

Source
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: DocumentLineItem

Base 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: Decimal

Invoiced quantity

§match_status: ThreeWayMatchStatus

Three-way match status

§price_variance: Decimal

Price variance amount

§quantity_variance: Decimal

Quantity variance

§tax_code: Option<String>

Tax code

§withholding_tax: bool

Withholding tax applicable

§withholding_tax_amount: Decimal

Withholding tax amount

Implementations§

Source§

impl VendorInvoiceItem

Source

pub fn new( line_number: u16, description: impl Into<String>, quantity: Decimal, unit_price: Decimal, ) -> Self

Create a new vendor invoice item.

Source

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.

Source

pub fn with_gl_account(self, account: impl Into<String>) -> Self

Set GL account.

Source

pub fn with_cost_center(self, cost_center: impl Into<String>) -> Self

Set cost center.

Source

pub fn with_tax(self, tax_code: impl Into<String>, tax_amount: Decimal) -> Self

Set tax.

Source

pub fn with_withholding_tax(self, amount: Decimal) -> Self

Set withholding tax.

Source

pub fn with_match_status(self, status: ThreeWayMatchStatus) -> Self

Set match status.

Source

pub fn calculate_price_variance(&mut self, po_price: Decimal)

Calculate price variance.

Source

pub fn calculate_quantity_variance(&mut self, gr_quantity: Decimal)

Calculate quantity variance.

Trait Implementations§

Source§

impl Clone for VendorInvoiceItem

Source§

fn clone(&self) -> VendorInvoiceItem

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VendorInvoiceItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for VendorInvoiceItem

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for VendorInvoiceItem

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,