updates
This commit is contained in:
@@ -1,13 +1,10 @@
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import {
|
||||
BarChart3,
|
||||
CreditCard,
|
||||
Receipt,
|
||||
TrendingUp,
|
||||
RefreshCw,
|
||||
DollarSign,
|
||||
FileText,
|
||||
Calendar,
|
||||
AlertCircle
|
||||
} from 'lucide-react';
|
||||
import { reportService, ReportData, paymentService, invoiceService } from '../../services/api';
|
||||
@@ -15,7 +12,6 @@ import type { Payment } from '../../services/api/paymentService';
|
||||
import type { Invoice } from '../../services/api/invoiceService';
|
||||
import { toast } from 'react-toastify';
|
||||
import { Loading, EmptyState, ExportButton } from '../../components/common';
|
||||
import CurrencyIcon from '../../components/common/CurrencyIcon';
|
||||
import { formatDate } from '../../utils/format';
|
||||
import { useFormatCurrency } from '../../hooks/useFormatCurrency';
|
||||
import { useAsync } from '../../hooks/useAsync';
|
||||
@@ -104,7 +100,7 @@ const AccountantDashboardPage: React.FC = () => {
|
||||
|
||||
setFinancialSummary(prev => ({
|
||||
...prev,
|
||||
totalInvoices: response.data.invoices.length,
|
||||
totalInvoices: response.data.invoices?.length || 0,
|
||||
paidInvoices: paidInvoices.length,
|
||||
overdueInvoices: overdueInvoices.length,
|
||||
}));
|
||||
@@ -230,7 +226,7 @@ const AccountantDashboardPage: React.FC = () => {
|
||||
'Invoice Number': i.invoice_number,
|
||||
'Customer': i.customer_name,
|
||||
'Total Amount': formatCurrency(i.total_amount),
|
||||
'Amount Due': formatCurrency(i.amount_due),
|
||||
'Amount Due': formatCurrency(i.amount_due ?? i.balance_due),
|
||||
'Status': i.status,
|
||||
'Due Date': i.due_date ? formatDate(i.due_date) : 'N/A',
|
||||
'Issue Date': i.issue_date ? formatDate(i.issue_date) : 'N/A'
|
||||
|
||||
Reference in New Issue
Block a user