Skip to main content

APDebitMemo

Struct APDebitMemo 

Source
pub struct APDebitMemo {
Show 29 fields pub debit_memo_number: String, pub company_code: String, pub vendor_id: String, pub vendor_name: String, pub memo_date: NaiveDate, pub posting_date: NaiveDate, pub memo_type: APDebitMemoType, pub status: SubledgerDocumentStatus, pub reason_code: DebitMemoReason, pub reason_description: String, pub lines: Vec<APDebitMemoLine>, pub net_amount: CurrencyAmount, pub tax_amount: CurrencyAmount, pub gross_amount: CurrencyAmount, pub amount_applied: Decimal, pub amount_remaining: Decimal, pub tax_details: Vec<TaxInfo>, pub reference_invoice: Option<String>, pub reference_po: Option<String>, pub reference_gr: Option<String>, pub applied_invoices: Vec<DebitMemoApplication>, pub gl_reference: Option<GLReference>, pub requires_approval: bool, pub approval_status: APApprovalStatus, pub approved_by: Option<String>, pub approved_date: Option<NaiveDate>, pub created_at: DateTime<Utc>, pub created_by: Option<String>, pub notes: Option<String>,
}
Expand description

AP Debit Memo (reduces amount owed to vendor).

Fields§

§debit_memo_number: String

Unique debit memo number.

§company_code: String

Company code.

§vendor_id: String

Vendor ID.

§vendor_name: String

Vendor name.

§memo_date: NaiveDate

Debit memo date.

§posting_date: NaiveDate

Posting date.

§memo_type: APDebitMemoType

Debit memo type.

§status: SubledgerDocumentStatus

Debit memo status.

§reason_code: DebitMemoReason

Reason code.

§reason_description: String

Reason description.

§lines: Vec<APDebitMemoLine>

Debit memo lines.

§net_amount: CurrencyAmount

Net amount (before tax).

§tax_amount: CurrencyAmount

Tax amount.

§gross_amount: CurrencyAmount

Gross amount (total credit to AP).

§amount_applied: Decimal

Amount applied to invoices.

§amount_remaining: Decimal

Amount remaining.

§tax_details: Vec<TaxInfo>

Tax details.

§reference_invoice: Option<String>

Reference invoice (if applicable).

§reference_po: Option<String>

Reference purchase order.

§reference_gr: Option<String>

Reference goods receipt.

§applied_invoices: Vec<DebitMemoApplication>

Applied to invoices.

§gl_reference: Option<GLReference>

GL reference.

§requires_approval: bool

Requires approval.

§approval_status: APApprovalStatus

Approval status.

§approved_by: Option<String>

Approved by.

§approved_date: Option<NaiveDate>

Approval date.

§created_at: DateTime<Utc>

Created timestamp.

§created_by: Option<String>

Created by user.

§notes: Option<String>

Notes.

Implementations§

Source§

impl APDebitMemo

Source

pub fn new( debit_memo_number: String, company_code: String, vendor_id: String, vendor_name: String, memo_date: NaiveDate, reason_code: DebitMemoReason, reason_description: String, currency: String, ) -> Self

Creates a new debit memo.

Source

pub fn for_invoice( debit_memo_number: String, company_code: String, vendor_id: String, vendor_name: String, memo_date: NaiveDate, invoice_number: String, reason_code: DebitMemoReason, reason_description: String, currency: String, ) -> Self

Creates debit memo for a specific invoice.

Source

pub fn add_line(&mut self, line: APDebitMemoLine)

Adds a debit memo line.

Source

pub fn recalculate_totals(&mut self)

Recalculates totals from lines.

Source

pub fn apply_to_invoice(&mut self, invoice_number: String, amount: Decimal)

Applies debit memo to an invoice.

Source

pub fn with_po_reference(self, po_number: String) -> Self

Sets purchase order reference.

Source

pub fn with_gr_reference(self, gr_number: String) -> Self

Sets goods receipt reference.

Source

pub fn approve(&mut self, approver: String, approval_date: NaiveDate)

Approves the debit memo.

Source

pub fn reject(&mut self, reason: String)

Rejects the debit memo.

Source

pub fn set_gl_reference(&mut self, reference: GLReference)

Sets the GL reference.

Source

pub fn check_approval_threshold(&mut self, threshold: Decimal)

Checks if approval is required based on threshold.

Trait Implementations§

Source§

impl Clone for APDebitMemo

Source§

fn clone(&self) -> APDebitMemo

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 APDebitMemo

Source§

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

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

impl<'de> Deserialize<'de> for APDebitMemo

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 APDebitMemo

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>,