Compare commits
2 Commits
a043bf045e
...
5749a54e2d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5749a54e2d | ||
|
|
ecb9d8d7c8 |
@@ -36,10 +36,10 @@ export class DashboardService {
|
|||||||
// Calculate total tax (mock logic for now, should sum up tax fields)
|
// Calculate total tax (mock logic for now, should sum up tax fields)
|
||||||
const invoices = await this.invoiceRepository.find({
|
const invoices = await this.invoiceRepository.find({
|
||||||
where: { tenant_id: tenantId, status: InvoiceStatus.APPROVED },
|
where: { tenant_id: tenantId, status: InvoiceStatus.APPROVED },
|
||||||
select: ['total_tax'],
|
select: ['tax_amount'],
|
||||||
});
|
});
|
||||||
|
|
||||||
const totalTax = invoices.reduce((sum, inv) => sum + Number(inv.total_tax || 0), 0);
|
const totalTax = invoices.reduce((sum, inv: any) => sum + Number(inv.tax_amount || 0), 0);
|
||||||
|
|
||||||
// Get recent activities (last 5 invoices)
|
// Get recent activities (last 5 invoices)
|
||||||
const recentInvoices = await this.invoiceRepository.find({
|
const recentInvoices = await this.invoiceRepository.find({
|
||||||
|
|||||||
Reference in New Issue
Block a user