mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 12:50:38 +00:00
feat: AR aging summary sheet frontend.
This commit is contained in:
@@ -96,12 +96,14 @@ export default class ARAgingSummarySheet extends AgingSummaryReport {
|
||||
const customersAgingPeriods = this.customersWalker(this.contacts);
|
||||
const totalAgingPeriods = this.getTotalAgingPeriods(customersAgingPeriods);
|
||||
const totalCurrent = this.getTotalCurrent(customersAgingPeriods);
|
||||
const totalCustomersTotal = this.getTotalContactsTotals(customersAgingPeriods);
|
||||
|
||||
return {
|
||||
customers: customersAgingPeriods,
|
||||
total: {
|
||||
current: this.formatTotalAmount(totalCurrent),
|
||||
aging: totalAgingPeriods,
|
||||
total: this.formatTotalAmount(totalCustomersTotal),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -79,7 +79,6 @@ export default abstract class AgingSummaryReport extends AgingReport {
|
||||
return {
|
||||
...agingPeriod,
|
||||
total,
|
||||
formattedAmount: this.formatAmount(total),
|
||||
};
|
||||
});
|
||||
return newAgingPeriods;
|
||||
@@ -198,4 +197,11 @@ export default abstract class AgingSummaryReport extends AgingReport {
|
||||
protected getAgingPeriodsTotal(agingPeriods: IAgingPeriodTotal[]): number {
|
||||
return sumBy(agingPeriods, 'total');
|
||||
}
|
||||
|
||||
|
||||
protected getTotalContactsTotals(
|
||||
customersSummary: IARAgingSummaryCustomer[]
|
||||
): number {
|
||||
return sumBy(customersSummary, (summary) => summary.total.total);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -220,8 +220,8 @@ export default class InventoryAdjustmentService {
|
||||
|
||||
/**
|
||||
* Publish the inventory adjustment transaction.
|
||||
* @param tenantId
|
||||
* @param inventoryAdjustmentId
|
||||
* @param tenantId
|
||||
* @param inventoryAdjustmentId
|
||||
*/
|
||||
async publishInventoryAdjustment(
|
||||
tenantId: number,
|
||||
@@ -239,11 +239,9 @@ export default class InventoryAdjustmentService {
|
||||
inventoryAdjustmentId,
|
||||
});
|
||||
// Publish the inventory adjustment transaction.
|
||||
await InventoryAdjustment.query()
|
||||
.findById(inventoryAdjustmentId)
|
||||
.patch({
|
||||
publishedAt: moment().toMySqlDateTime(),
|
||||
});
|
||||
await InventoryAdjustment.query().findById(inventoryAdjustmentId).patch({
|
||||
publishedAt: moment().toMySqlDateTime(),
|
||||
});
|
||||
|
||||
// Retrieve the inventory adjustment after the modification.
|
||||
const inventoryAdjustment = await InventoryAdjustment.query()
|
||||
|
||||
Reference in New Issue
Block a user