Payment discrepancy report updates

This commit is contained in:
Stephanos A
2026-07-20 21:50:34 +03:00
parent e2f2158a09
commit 99eb35ff75
7 changed files with 733 additions and 7 deletions

View File

@@ -121,9 +121,10 @@ const navigationSections: { title: string; items: NavItem[] }[] = [
{
title: 'Analytics & Reports',
items: [
{ name: 'Overall', href: '/reports', icon: BarChart3, permission: PERMS.reports.view },
{ name: 'Overall', href: '/reports/overall', icon: BarChart3, permission: PERMS.reports.view },
{ name: 'Seats', href: '/reports/seats', icon: Armchair, permission: PERMS.reports.view },
{ name: 'Passengers', href: '/reports/passengers', icon: Users, permission: PERMS.reports.view },
{ name: 'Payments', href: '/reports/payments', icon: CreditCard, permission: PERMS.reports.view },
{ name: 'Payment Discrepancy', href: '/reports/payment-discrepancy', icon: AlertTriangle, permission: PERMS.reports.view },
// { name: 'Operational Reports', href: '/operational-reports', icon: FileText, permission: PERMS.reports.view },
]
@@ -221,11 +222,12 @@ export default function Sidebar() {
// Special handling for Settings to avoid conflict with User Management
let isActive;
if (item.href === '/settings') {
// Settings is active only for exact match or non-users sub-routes
isActive = pathname === '/settings' ||
isActive = pathname === '/settings' ||
(pathname?.startsWith('/settings/') && !pathname.startsWith('/settings/users'));
} else if (item.href === '/payments') {
// Exact match only — avoid colliding with /reports/payments
isActive = pathname === '/payments' || pathname?.startsWith('/payments/');
} else {
// Standard matching for other items
isActive = pathname === item.href || pathname?.startsWith(item.href + '/');
}
return (