+
+
Filter by Employee
+
+
+
+
+
+ All Employees
+ {employees.map(employee => (
+
+ {employee.name} (ID: {employee.id})
+
+ ))}
+
+
+
+
+
+
+
+
+ Employee ID
+ Employee Name
+ Date
+ MM Collection
+ Deposit Amount
+ Difference
+ Running Balance
+ Status
+
+
+
+ {transactions.map((transaction, index) => (
+
+ {transaction.employeeId}
+
+
+
+
+ {transaction.employeeName.charAt(0)}
+
+
+
{transaction.employeeName}
+
+
+ {formatDate(transaction.date)}
+
+ {formatCurrency(transaction.collection)}
+
+
+ {formatCurrency(transaction.deposit)}
+
+
+ = 0 ? 'text-green-600' : 'text-red-600'}`}>
+ {formatCurrency(transaction.difference)}
+
+
+
+ = 0 ? 'text-green-600' : 'text-red-600'}`}>
+ {formatCurrency(Math.abs(transaction.runningBalance))}
+
+
+
+ = 0 ? "default" : "destructive"}
+ className={transaction.difference >= 0 ? "bg-green-100 text-green-800 hover:bg-green-200" : "bg-red-100 text-red-800 hover:bg-red-200"}
+ >
+ {transaction.difference >= 0 ? 'Balanced' : 'Deficit'}
+
+
+
+ ))}
+
+
+
+
+ {transactions.length === 0 && (
+
+
No transaction data available
+
Use the "Insert Employee Data" button to add records
+
+ )}
+
+ );
+};
diff --git a/src/components/OutstandingReportDashboard.tsx b/src/components/OutstandingReportDashboard.tsx
new file mode 100644
index 0000000..70edd81
--- /dev/null
+++ b/src/components/OutstandingReportDashboard.tsx
@@ -0,0 +1,90 @@
+
+import React from 'react';
+import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
+import { Badge } from "@/components/ui/badge";
+import { useEmployeeData } from "@/hooks/useEmployeeData";
+
+export const OutstandingReportDashboard = () => {
+ const { employees, getEmployeeSummary } = useEmployeeData();
+
+ const employeeSummaries = employees.map(employee => {
+ const summary = getEmployeeSummary(employee.id);
+ return {
+ ...employee,
+ ...summary
+ };
+ });
+
+ const formatCurrency = (amount: number) => {
+ return new Intl.NumberFormat('en-IN', {
+ style: 'currency',
+ currency: 'INR'
+ }).format(amount);
+ };
+
+ const formatDate = (date: string) => {
+ return new Date(date).toLocaleDateString('en-IN');
+ };
+
+ return (
+