pub struct ARAgingReport {
pub company_code: String,
pub as_of_date: NaiveDate,
pub customer_details: Vec<CustomerAging>,
pub bucket_totals: HashMap<AgingBucket, Decimal>,
pub total_ar_balance: Decimal,
pub total_current: Decimal,
pub total_overdue: Decimal,
pub overdue_percentage: Decimal,
pub generated_at: DateTime<Utc>,
}Expand description
AR Aging report for a company.
Fields§
§company_code: StringCompany code.
as_of_date: NaiveDateAs-of date for aging calculation.
customer_details: Vec<CustomerAging>Customer aging details.
bucket_totals: HashMap<AgingBucket, Decimal>Summary by bucket.
total_ar_balance: DecimalTotal AR balance.
total_current: DecimalTotal current.
total_overdue: DecimalTotal overdue.
overdue_percentage: DecimalPercentage overdue.
generated_at: DateTime<Utc>Generated timestamp.
Implementations§
Source§impl ARAgingReport
impl ARAgingReport
Sourcepub fn from_invoices(
company_code: String,
invoices: &[ARInvoice],
as_of_date: NaiveDate,
) -> Self
pub fn from_invoices( company_code: String, invoices: &[ARInvoice], as_of_date: NaiveDate, ) -> Self
Creates an aging report from invoices.
Sourcepub fn customers_in_bucket(
&self,
bucket: AgingBucket,
min_amount: Decimal,
) -> Vec<&CustomerAging>
pub fn customers_in_bucket( &self, bucket: AgingBucket, min_amount: Decimal, ) -> Vec<&CustomerAging>
Gets customers with balance over threshold in specific bucket.
Sourcepub fn top_customers(&self, n: usize) -> Vec<&CustomerAging>
pub fn top_customers(&self, n: usize) -> Vec<&CustomerAging>
Gets top N customers by total balance.
Sourcepub fn over_credit_limit(&self) -> Vec<&CustomerAging>
pub fn over_credit_limit(&self) -> Vec<&CustomerAging>
Gets customers exceeding credit limit.
Trait Implementations§
Source§impl Clone for ARAgingReport
impl Clone for ARAgingReport
Source§fn clone(&self) -> ARAgingReport
fn clone(&self) -> ARAgingReport
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 ARAgingReport
impl Debug for ARAgingReport
Source§impl<'de> Deserialize<'de> for ARAgingReport
impl<'de> Deserialize<'de> for ARAgingReport
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 ARAgingReport
impl RefUnwindSafe for ARAgingReport
impl Send for ARAgingReport
impl Sync for ARAgingReport
impl Unpin for ARAgingReport
impl UnwindSafe for ARAgingReport
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