Skip to main content

APPayment

Struct APPayment 

Source
pub struct APPayment {
Show 28 fields pub payment_number: String, pub company_code: String, pub vendor_id: String, pub vendor_name: String, pub payment_date: NaiveDate, pub posting_date: NaiveDate, pub value_date: NaiveDate, pub payment_type: APPaymentType, pub status: PaymentStatus, pub amount: CurrencyAmount, pub bank_charges: Decimal, pub discount_taken: Decimal, pub withholding_tax: Decimal, pub net_payment: Decimal, pub payment_method: APPaymentMethod, pub house_bank: String, pub bank_account: String, pub vendor_bank_account: Option<String>, pub check_number: Option<String>, pub wire_reference: Option<String>, pub paid_invoices: Vec<PaymentAllocation>, pub gl_references: Vec<GLReference>, pub payment_run_id: Option<String>, pub created_at: DateTime<Utc>, pub created_by: Option<String>, pub approved_by: Option<String>, pub approved_date: Option<NaiveDate>, pub notes: Option<String>,
}
Expand description

AP Payment (payment to vendor).

Fields§

§payment_number: String

Unique payment number.

§company_code: String

Company code.

§vendor_id: String

Vendor ID.

§vendor_name: String

Vendor name.

§payment_date: NaiveDate

Payment date.

§posting_date: NaiveDate

Posting date.

§value_date: NaiveDate

Value date (bank value date).

§payment_type: APPaymentType

Payment type.

§status: PaymentStatus

Payment status.

§amount: CurrencyAmount

Payment amount.

§bank_charges: Decimal

Bank charges.

§discount_taken: Decimal

Discount taken.

§withholding_tax: Decimal

Withholding tax.

§net_payment: Decimal

Net payment amount.

§payment_method: APPaymentMethod

Payment method.

§house_bank: String

House bank.

§bank_account: String

Bank account.

§vendor_bank_account: Option<String>

Vendor bank account.

§check_number: Option<String>

Check number (if check payment).

§wire_reference: Option<String>

Wire reference.

§paid_invoices: Vec<PaymentAllocation>

Paid invoices.

§gl_references: Vec<GLReference>

GL references.

§payment_run_id: Option<String>

Payment run ID.

§created_at: DateTime<Utc>

Created timestamp.

§created_by: Option<String>

Created by user.

§approved_by: Option<String>

Approved by.

§approved_date: Option<NaiveDate>

Approval date.

§notes: Option<String>

Notes.

Implementations§

Source§

impl APPayment

Source

pub fn new( payment_number: String, company_code: String, vendor_id: String, vendor_name: String, payment_date: NaiveDate, amount: Decimal, currency: String, payment_method: APPaymentMethod, house_bank: String, bank_account: String, ) -> Self

Creates a new AP payment.

Source

pub fn allocate_to_invoice( &mut self, invoice_number: String, amount_paid: Decimal, discount: Decimal, withholding: Decimal, )

Allocates payment to an invoice.

Source

pub fn with_bank_charges(self, charges: Decimal) -> Self

Sets bank charges.

Source

pub fn with_check(self, check_number: String) -> Self

Sets check number.

Source

pub fn with_wire_reference(self, reference: String) -> Self

Sets wire reference.

Source

pub fn with_vendor_bank(self, bank_account: String) -> Self

Sets vendor bank account.

Source

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

Approves the payment.

Source

pub fn release(&mut self)

Releases the payment for processing.

Source

pub fn confirm_sent(&mut self, reference: Option<String>)

Confirms payment was sent.

Source

pub fn confirm_cleared(&mut self, value_date: NaiveDate)

Confirms payment cleared the bank.

Source

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

Voids the payment.

Source

pub fn total_settlement(&self) -> Decimal

Gets total settlement amount (payment + discount + withholding).

Source

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

Adds a GL reference.

Trait Implementations§

Source§

impl Clone for APPayment

Source§

fn clone(&self) -> APPayment

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 APPayment

Source§

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

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

impl<'de> Deserialize<'de> for APPayment

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 APPayment

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