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 (const: unstable) · 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 UnsafeUnpin 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.