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: StringUnique debit memo number.
company_code: StringCompany code.
vendor_id: StringVendor ID.
vendor_name: StringVendor name.
memo_date: NaiveDateDebit memo date.
posting_date: NaiveDatePosting date.
memo_type: APDebitMemoTypeDebit memo type.
status: SubledgerDocumentStatusDebit memo status.
reason_code: DebitMemoReasonReason code.
reason_description: StringReason description.
lines: Vec<APDebitMemoLine>Debit memo lines.
net_amount: CurrencyAmountNet amount (before tax).
tax_amount: CurrencyAmountTax amount.
gross_amount: CurrencyAmountGross amount (total credit to AP).
amount_applied: DecimalAmount applied to invoices.
amount_remaining: DecimalAmount 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: boolRequires approval.
approval_status: APApprovalStatusApproval 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
impl APDebitMemo
Sourcepub 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
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.
Sourcepub 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
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.
Sourcepub fn add_line(&mut self, line: APDebitMemoLine)
pub fn add_line(&mut self, line: APDebitMemoLine)
Adds a debit memo line.
Sourcepub fn recalculate_totals(&mut self)
pub fn recalculate_totals(&mut self)
Recalculates totals from lines.
Sourcepub fn apply_to_invoice(&mut self, invoice_number: String, amount: Decimal)
pub fn apply_to_invoice(&mut self, invoice_number: String, amount: Decimal)
Applies debit memo to an invoice.
Sourcepub fn with_po_reference(self, po_number: String) -> Self
pub fn with_po_reference(self, po_number: String) -> Self
Sets purchase order reference.
Sourcepub fn with_gr_reference(self, gr_number: String) -> Self
pub fn with_gr_reference(self, gr_number: String) -> Self
Sets goods receipt reference.
Sourcepub fn set_gl_reference(&mut self, reference: GLReference)
pub fn set_gl_reference(&mut self, reference: GLReference)
Sets the GL reference.
Sourcepub fn check_approval_threshold(&mut self, threshold: Decimal)
pub fn check_approval_threshold(&mut self, threshold: Decimal)
Checks if approval is required based on threshold.
Trait Implementations§
Source§impl Clone for APDebitMemo
impl Clone for APDebitMemo
Source§fn clone(&self) -> APDebitMemo
fn clone(&self) -> APDebitMemo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for APDebitMemo
impl Debug for APDebitMemo
Source§impl<'de> Deserialize<'de> for APDebitMemo
impl<'de> Deserialize<'de> for APDebitMemo
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>,
Auto Trait Implementations§
impl Freeze for APDebitMemo
impl RefUnwindSafe for APDebitMemo
impl Send for APDebitMemo
impl Sync for APDebitMemo
impl Unpin for APDebitMemo
impl UnsafeUnpin for APDebitMemo
impl UnwindSafe for APDebitMemo
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.