pub struct BadDebtReserve {
pub company_code: String,
pub as_of_date: NaiveDate,
pub reserve_rates: HashMap<AgingBucket, Decimal>,
pub reserves_by_bucket: HashMap<AgingBucket, Decimal>,
pub total_reserve: Decimal,
pub total_ar_balance: Decimal,
pub reserve_percentage: Decimal,
}Expand description
Bad debt reserve calculation.
Fields§
§company_code: StringCompany code.
as_of_date: NaiveDateAs-of date.
reserve_rates: HashMap<AgingBucket, Decimal>Reserve percentages by bucket.
reserves_by_bucket: HashMap<AgingBucket, Decimal>Calculated reserves by bucket.
total_reserve: DecimalTotal reserve.
total_ar_balance: DecimalTotal AR balance.
reserve_percentage: DecimalReserve as percentage of AR.
Implementations§
Source§impl BadDebtReserve
impl BadDebtReserve
Sourcepub fn calculate(
aging_report: &ARAgingReport,
reserve_rates: HashMap<AgingBucket, Decimal>,
) -> Self
pub fn calculate( aging_report: &ARAgingReport, reserve_rates: HashMap<AgingBucket, Decimal>, ) -> Self
Calculates bad debt reserve from aging report.
Sourcepub fn default_rates() -> HashMap<AgingBucket, Decimal>
pub fn default_rates() -> HashMap<AgingBucket, Decimal>
Default reserve rates.
Trait Implementations§
Source§impl Clone for BadDebtReserve
impl Clone for BadDebtReserve
Source§fn clone(&self) -> BadDebtReserve
fn clone(&self) -> BadDebtReserve
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 BadDebtReserve
impl Debug for BadDebtReserve
Source§impl<'de> Deserialize<'de> for BadDebtReserve
impl<'de> Deserialize<'de> for BadDebtReserve
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 BadDebtReserve
impl RefUnwindSafe for BadDebtReserve
impl Send for BadDebtReserve
impl Sync for BadDebtReserve
impl Unpin for BadDebtReserve
impl UnsafeUnpin for BadDebtReserve
impl UnwindSafe for BadDebtReserve
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