updates
This commit is contained in:
@@ -4,6 +4,7 @@ import { invoiceService, Invoice } from '../../services/api';
|
||||
import { toast } from 'react-toastify';
|
||||
import Loading from '../../components/common/Loading';
|
||||
import Pagination from '../../components/common/Pagination';
|
||||
import { ExportButton } from '../../components/common';
|
||||
import { useFormatCurrency } from '../../hooks/useFormatCurrency';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { formatDate } from '../../utils/format';
|
||||
@@ -130,13 +131,36 @@ const InvoiceManagementPage: React.FC = () => {
|
||||
</div>
|
||||
<p className="text-slate-600 mt-3 text-lg font-light">Manage and track all invoices</p>
|
||||
</div>
|
||||
<button
|
||||
onClick={() => navigate('/admin/bookings')}
|
||||
className="flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-amber-500 to-amber-600 text-white rounded-xl font-semibold hover:from-amber-600 hover:to-amber-700 transition-all duration-200 shadow-lg hover:shadow-xl"
|
||||
>
|
||||
<Plus className="w-5 h-5" />
|
||||
Create Invoice from Booking
|
||||
</button>
|
||||
<div className="flex gap-3 items-center">
|
||||
<ExportButton
|
||||
data={invoices.map(i => ({
|
||||
'Invoice Number': i.invoice_number,
|
||||
'Customer Name': i.customer_name,
|
||||
'Customer Email': i.customer_email,
|
||||
'Booking ID': i.booking_id || 'N/A',
|
||||
'Subtotal': formatCurrency(i.subtotal),
|
||||
'Tax Amount': formatCurrency(i.tax_amount),
|
||||
'Discount Amount': formatCurrency(i.discount_amount),
|
||||
'Total Amount': formatCurrency(i.total_amount),
|
||||
'Amount Paid': formatCurrency(i.amount_paid),
|
||||
'Balance Due': formatCurrency(i.balance_due),
|
||||
'Status': i.status,
|
||||
'Issue Date': i.issue_date ? formatDate(i.issue_date) : 'N/A',
|
||||
'Due Date': i.due_date ? formatDate(i.due_date) : 'N/A',
|
||||
'Paid Date': i.paid_date ? formatDate(i.paid_date) : 'N/A',
|
||||
'Is Proforma': i.is_proforma ? 'Yes' : 'No'
|
||||
}))}
|
||||
filename="invoices"
|
||||
title="Invoice Management Report"
|
||||
/>
|
||||
<button
|
||||
onClick={() => navigate('/admin/bookings')}
|
||||
className="flex items-center gap-2 px-6 py-3 bg-gradient-to-r from-amber-500 to-amber-600 text-white rounded-xl font-semibold hover:from-amber-600 hover:to-amber-700 transition-all duration-200 shadow-lg hover:shadow-xl"
|
||||
>
|
||||
<Plus className="w-5 h-5" />
|
||||
Create Invoice from Booking
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user