Compare commits

...

2 Commits

Author SHA1 Message Date
Hamza-Ayed
5749a54e2d Fix frontend production API URL 2026-04-18 00:27:55 +03:00
Hamza-Ayed
ecb9d8d7c8 Fix total_tax field name in dashboard service 2026-04-18 00:11:22 +03:00

View File

@@ -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({