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: StringUnique payment number.
company_code: StringCompany code.
vendor_id: StringVendor ID.
vendor_name: StringVendor name.
payment_date: NaiveDatePayment date.
posting_date: NaiveDatePosting date.
value_date: NaiveDateValue date (bank value date).
payment_type: APPaymentTypePayment type.
status: PaymentStatusPayment status.
amount: CurrencyAmountPayment amount.
bank_charges: DecimalBank charges.
discount_taken: DecimalDiscount taken.
withholding_tax: DecimalWithholding tax.
net_payment: DecimalNet payment amount.
payment_method: APPaymentMethodPayment method.
house_bank: StringHouse bank.
bank_account: StringBank 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
impl APPayment
Sourcepub 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
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.
Sourcepub fn allocate_to_invoice(
&mut self,
invoice_number: String,
amount_paid: Decimal,
discount: Decimal,
withholding: Decimal,
)
pub fn allocate_to_invoice( &mut self, invoice_number: String, amount_paid: Decimal, discount: Decimal, withholding: Decimal, )
Allocates payment to an invoice.
Sourcepub fn with_bank_charges(self, charges: Decimal) -> Self
pub fn with_bank_charges(self, charges: Decimal) -> Self
Sets bank charges.
Sourcepub fn with_check(self, check_number: String) -> Self
pub fn with_check(self, check_number: String) -> Self
Sets check number.
Sourcepub fn with_wire_reference(self, reference: String) -> Self
pub fn with_wire_reference(self, reference: String) -> Self
Sets wire reference.
Sourcepub fn with_vendor_bank(self, bank_account: String) -> Self
pub fn with_vendor_bank(self, bank_account: String) -> Self
Sets vendor bank account.
Sourcepub fn confirm_sent(&mut self, reference: Option<String>)
pub fn confirm_sent(&mut self, reference: Option<String>)
Confirms payment was sent.
Sourcepub fn confirm_cleared(&mut self, value_date: NaiveDate)
pub fn confirm_cleared(&mut self, value_date: NaiveDate)
Confirms payment cleared the bank.
Sourcepub fn total_settlement(&self) -> Decimal
pub fn total_settlement(&self) -> Decimal
Gets total settlement amount (payment + discount + withholding).
Sourcepub fn add_gl_reference(&mut self, reference: GLReference)
pub fn add_gl_reference(&mut self, reference: GLReference)
Adds a GL reference.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for APPayment
impl<'de> Deserialize<'de> for APPayment
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 APPayment
impl RefUnwindSafe for APPayment
impl Send for APPayment
impl Sync for APPayment
impl Unpin for APPayment
impl UnwindSafe for APPayment
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