mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
feat: AR/AP aging summary report.
This commit is contained in:
@@ -52,8 +52,6 @@ export default class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
this.query.agingDaysBefore,
|
||||
this.query.agingPeriods
|
||||
);
|
||||
this.initContactsAgingPeriods();
|
||||
this.calcUnpaidInvoicesAgingPeriods();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,8 +75,8 @@ export default class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
* @param {ICustomer[]} customers
|
||||
* @return {IARAgingSummaryCustomer[]}
|
||||
*/
|
||||
private customersWalker(): IARAgingSummaryCustomer[] {
|
||||
return this.contacts
|
||||
private customersWalker(customers: ICustomer[]): IARAgingSummaryCustomer[] {
|
||||
return customers
|
||||
.map((customer) => this.customerData(customer))
|
||||
.filter(
|
||||
(customer: IARAgingSummaryCustomer) =>
|
||||
@@ -91,9 +89,12 @@ export default class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
* @return {IARAgingSummaryData}
|
||||
*/
|
||||
public reportData(): IARAgingSummaryData {
|
||||
const customersAgingPeriods = this.customersWalker(this.contacts);
|
||||
const totalAgingPeriods = this.getTotalAgingPeriods(customersAgingPeriods);
|
||||
|
||||
return {
|
||||
customers: this.customersWalker(),
|
||||
total: this.getTotalAgingPeriods(),
|
||||
customers: customersAgingPeriods,
|
||||
total: totalAgingPeriods,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user