pub struct PaymentHistory {
pub total_invoices: u32,
pub on_time_payments: u32,
pub early_payments: u32,
pub late_payments: u32,
pub total_amount: Decimal,
pub average_days_to_pay: f64,
pub last_payment_date: Option<NaiveDate>,
pub total_discounts: Decimal,
}Expand description
Payment history summary for a vendor.
Fields§
§total_invoices: u32Total number of invoices paid
on_time_payments: u32Number of invoices paid on time
early_payments: u32Number of early payments (discount taken)
late_payments: u32Number of late payments
total_amount: DecimalTotal payment amount
average_days_to_pay: f64Average days to payment
last_payment_date: Option<NaiveDate>Last payment date
total_discounts: DecimalTotal discounts captured
Implementations§
Source§impl PaymentHistory
impl PaymentHistory
Sourcepub fn on_time_rate(&self) -> f64
pub fn on_time_rate(&self) -> f64
Calculate on-time payment rate.
Sourcepub fn early_payment_rate(&self) -> f64
pub fn early_payment_rate(&self) -> f64
Calculate early payment rate.
Trait Implementations§
Source§impl Clone for PaymentHistory
impl Clone for PaymentHistory
Source§fn clone(&self) -> PaymentHistory
fn clone(&self) -> PaymentHistory
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PaymentHistory
impl Debug for PaymentHistory
Source§impl Default for PaymentHistory
impl Default for PaymentHistory
Source§impl<'de> Deserialize<'de> for PaymentHistory
impl<'de> Deserialize<'de> for PaymentHistory
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 PaymentHistory
impl RefUnwindSafe for PaymentHistory
impl Send for PaymentHistory
impl Sync for PaymentHistory
impl Unpin for PaymentHistory
impl UnwindSafe for PaymentHistory
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