diff --git a/src/components/EmployeePaymentReport.tsx b/src/components/EmployeePaymentReport.tsx
index f9566fb..8aac2ec 100644
--- a/src/components/EmployeePaymentReport.tsx
+++ b/src/components/EmployeePaymentReport.tsx
@@ -2,7 +2,8 @@
import React, { useState } from 'react';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from "@/components/ui/select";
-import { Badge } from "@/components/ui/badge";
+import { Card, CardContent } from "@/components/ui/card";
+import { X } from "lucide-react";
import { useEmployeeData } from "@/hooks/useEmployeeData";
export const EmployeePaymentReport = () => {
@@ -41,10 +42,74 @@ export const EmployeePaymentReport = () => {
const transactions = getTransactionsToShow();
+ // Calculate totals
+ const totalCollection = transactions.reduce((sum, t) => sum + t.collection, 0);
+ const totalDeposit = transactions.reduce((sum, t) => sum + t.deposit, 0);
+ const totalDifference = totalCollection - totalDeposit;
+
return (
+ {/* Header */}
-
Filter by Employee
+ Employee Payment Report
+
+
+
+ {/* Summary Cards */}
+
+
+
+
+
+
+
Total Collection
+
(MM) Amount
+
{formatCurrency(totalCollection)}
+
+
+
+
+
+
+
+
+
+
+
Total Deposit
+
Amount
+
{formatCurrency(totalDeposit)}
+
+
+
+
+
+
+
+
+
+
+
Difference
+
Amount
+
{formatCurrency(totalDifference)}
+
+
+
+
+
+
+ {/* Filter */}
+
+
@@ -60,69 +125,77 @@ export const EmployeePaymentReport = () => {
-
+ {/* Data Table */}
+
-
- Employee ID
- Employee Name
- Date
- MM Collection
- Deposit Amount
- Difference
- Running Balance
- Status
+
+ Location
+ Emp. ID
+ Emp. Name
+ Collections (MM)
+ Date
+ Cash Deposit
+ Deposit Date
+ Difference
{transactions.map((transaction, index) => (
-
- {transaction.employeeId}
-
-
-
-
- {transaction.employeeName.charAt(0)}
-
-
-
{transaction.employeeName}
-
+
+ BGRoad, Karnataka
+ {transaction.employeeId.replace('EMP00', '')}
+ {transaction.employeeName}
+
+ {transaction.collection > 0 ? transaction.collection.toLocaleString() : '-'}
- {formatDate(transaction.date)}
-
- {formatCurrency(transaction.collection)}
+
+ {transaction.collection > 0 ? formatDate(transaction.date) : '-'}
-
- {formatCurrency(transaction.deposit)}
+
+ {transaction.deposit > 0 ? transaction.deposit.toLocaleString() : '-'}
+
+
+ {transaction.deposit > 0 ? formatDate(transaction.date) : '-'}
- = 0 ? 'text-green-600' : 'text-red-600'}`}>
- {formatCurrency(transaction.difference)}
+ 0 ? 'text-green-600' : 'text-red-600'}`}>
+ {transaction.difference === 0 ? '-' : transaction.difference.toLocaleString()}
-
- = 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'}
-
-
))}
+ {/* Pagination */}
+
+
+ Show
+
+ 10
+ 25
+ 50
+
+ Rows
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ ...
+ 10
+ →
+
+
+
{transactions.length === 0 && (
-
No transaction data available
-
Use the "Insert Employee Data" button to add records
+
No transaction data available
+
Use the "Insert Employee Data" button to add records
)}
diff --git a/src/components/LoginPage.tsx b/src/components/LoginPage.tsx
new file mode 100644
index 0000000..ca06a1f
--- /dev/null
+++ b/src/components/LoginPage.tsx
@@ -0,0 +1,84 @@
+
+import React, { useState } from 'react';
+import { Button } from "@/components/ui/button";
+import { Input } from "@/components/ui/input";
+import { Checkbox } from "@/components/ui/checkbox";
+
+interface LoginPageProps {
+ onLogin: () => void;
+}
+
+export const LoginPage = ({ onLogin }: LoginPageProps) => {
+ const [email, setEmail] = useState('admin@123.com');
+ const [password, setPassword] = useState('');
+ const [rememberMe, setRememberMe] = useState(false);
+
+ const handleLogin = (e: React.FormEvent) => {
+ e.preventDefault();
+ onLogin();
+ };
+
+ return (
+
+ {/* Left side with purple gradient */}
+
+
+
Cash Management Dashboard
+
Real-time Cash Reconciliation – Ensuring Accuracy & Transparency
+
+
+
+ {/* Right side with login form */}
+
+
+
Sign In to Your Dashboard
+
+
+
+
+
+ );
+};
diff --git a/src/components/OutstandingReportDashboard.tsx b/src/components/OutstandingReportDashboard.tsx
index 70edd81..12d0aaf 100644
--- a/src/components/OutstandingReportDashboard.tsx
+++ b/src/components/OutstandingReportDashboard.tsx
@@ -2,6 +2,7 @@
import React from 'react';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { Badge } from "@/components/ui/badge";
+import { Card, CardContent } from "@/components/ui/card";
import { useEmployeeData } from "@/hooks/useEmployeeData";
export const OutstandingReportDashboard = () => {
@@ -26,63 +27,132 @@ export const OutstandingReportDashboard = () => {
return new Date(date).toLocaleDateString('en-IN');
};
+ // Calculate totals
+ const totalCollection = employeeSummaries.reduce((sum, emp) => sum + emp.totalCollection, 0);
+ const totalDeposit = employeeSummaries.reduce((sum, emp) => sum + emp.totalDeposit, 0);
+ const totalDifference = totalCollection - totalDeposit;
+
return (
-
+
+ Outstanding Report (All Locations)
+
+
+ {/* Summary Cards */}
+
+
+
+
+
+
+
Total Collection (MM)
+
(All Locations)
+
{formatCurrency(totalCollection)}
+
+
+
+
+
+
+
+
+
+
+
Total Deposit Amount
+
(All Locations)
+
{formatCurrency(totalDeposit)}
+
+
+
+
+
+
+
+
+
+
+
Difference Amount
+
(All Locations)
+
{formatCurrency(totalDifference)}
+
+
+
+
+
+
+ {/* Data Table */}
+
-
- Employee ID
- Employee Name
- Net Collection Till Date
- Most Recent Transaction
- Outstanding Amount
- Status
+
+ Location
+ Emp. ID
+ Emp. Name
+ Collections (MM)
+ Date
+ Difference
{employeeSummaries.map((employee) => (
-
- {employee.id}
-
-
-
-
- {employee.name.charAt(0)}
-
-
-
{employee.name}
-
+
+ BGRoad, Karnataka
+ {employee.id.replace('EMP00', '')}
+ {employee.name}
+
+ {employee.totalCollection.toLocaleString()}
-
- {formatCurrency(employee.totalCollection)}
+
+ {employee.lastTransactionDate ? formatDate(employee.lastTransactionDate) : '26 Mar 2025'}
- {employee.lastTransactionDate ? formatDate(employee.lastTransactionDate) : 'No transactions'}
-
-
- 0 ? 'text-red-600' : 'text-green-600'}`}>
- {formatCurrency(Math.abs(employee.outstandingAmount))}
+ 0 ? 'text-red-600' : 'text-green-600'}`}>
+ {employee.outstandingAmount > 0 ? employee.outstandingAmount.toLocaleString() : `(${Math.abs(employee.outstandingAmount).toLocaleString()})`}
-
- 0 ? "destructive" : "default"}
- className={employee.outstandingAmount > 0 ? "bg-red-100 text-red-800 hover:bg-red-200" : "bg-green-100 text-green-800 hover:bg-green-200"}
- >
- {employee.outstandingAmount > 0 ? 'Pending' : 'Clear'}
-
-
))}
+
+ {/* Pagination */}
+
+
+ Show
+
+ 10
+ 25
+ 50
+
+ Rows
+
+
+ 1
+ 2
+ 3
+ 4
+ 5
+ ...
+ 10
+ →
+
+
{employeeSummaries.length === 0 && (
-
No employee data available
-
Use the "Insert Employee Data" button to add records
+
No employee data available
+
Use the "Insert Employee Data" button to add records
)}
diff --git a/src/pages/Index.tsx b/src/pages/Index.tsx
index 0b16b97..ae1fa82 100644
--- a/src/pages/Index.tsx
+++ b/src/pages/Index.tsx
@@ -6,9 +6,11 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { OutstandingReportDashboard } from "@/components/OutstandingReportDashboard";
import { EmployeePaymentReport } from "@/components/EmployeePaymentReport";
import { AdminDataEntryModal } from "@/components/AdminDataEntryModal";
-import { Plus } from "lucide-react";
+import { LoginPage } from "@/components/LoginPage";
+import { Plus, LogOut } from "lucide-react";
const Index = () => {
+ const [isAuthenticated, setIsAuthenticated] = useState(false);
const [isModalOpen, setIsModalOpen] = useState(false);
const [refreshTrigger, setRefreshTrigger] = useState(0);
@@ -17,64 +19,69 @@ const Index = () => {
setIsModalOpen(false);
};
+ const handleLogin = () => {
+ setIsAuthenticated(true);
+ };
+
+ const handleLogout = () => {
+ setIsAuthenticated(false);
+ };
+
+ if (!isAuthenticated) {
+ return
;
+ }
+
return (
-
+
+ {/* Header */}
+
+
+
+
Dashboard
+
Outstanding Report
+
+
+ setIsModalOpen(true)}
+ className="bg-orange-500 hover:bg-orange-600 text-white px-6 py-2 rounded-lg font-medium"
+ >
+ Insert Employee Data
+
+
+
+ Logout
+
+
+
+
+
-
-
- Employee Collection Management
-
-
- Track and manage employee collections and deposits
-
-
-
-
-
setIsModalOpen(true)}
- className="bg-blue-600 hover:bg-blue-700 text-white px-6 py-3 rounded-lg shadow-lg hover:shadow-xl transition-all duration-200 flex items-center gap-2"
- >
-
- Insert Employee Data
-
-
-
-
+
- Outstanding Report Dashboard
+ Outstanding Report
Employee Payment Report
-
-
-
- Outstanding Report Dashboard
-
-
-
-
-
+
+
-
-
-
- Employee Payment Report Dashboard
-
-
-
-
-
+
+