@php
    $bankingCompanyId = auth()->user()->company_id;
    $useChequePrinting = \App\Models\Setting::get($bankingCompanyId, 'use_cheque_printing', '0') === '1';
    $useChequeRegister = \App\Models\Setting::get($bankingCompanyId, 'use_cheque_register', '0') === '1';
    $canViewBanking = auth()->user()->hasPermission('banking', 'view');
@endphp

@if($canViewBanking)
    @if(($variant ?? 'sidebar') === 'dropdown')
        <li><a class="dropdown-item {{ request()->routeIs('banking.reconciliation') ? 'active' : '' }}" href="{{ route('banking.reconciliation') }}"><i class="bi bi-check2-square me-2"></i>Bank Reconciliation</a></li>
        @if($useChequePrinting)
        <li><a class="dropdown-item {{ request()->routeIs('banking.cheque-formats.*') ? 'active' : '' }}" href="{{ route('banking.cheque-formats.index') }}"><i class="bi bi-file-earmark-ruled me-2"></i>Cheque Format</a></li>
        <li><a class="dropdown-item {{ request()->routeIs('banking.cheque-print.*') ? 'active' : '' }}" href="{{ route('banking.cheque-print.index') }}"><i class="bi bi-printer me-2"></i>Cheque Print</a></li>
        @endif
        @if($useChequeRegister)
        <li><a class="dropdown-item {{ request()->routeIs('banking.cheque-books.*') ? 'active' : '' }}" href="{{ route('banking.cheque-books.index') }}"><i class="bi bi-journal-bookmark me-2"></i>Cheque Books</a></li>
        <li><a class="dropdown-item {{ request()->routeIs('banking.issued-void-cheques.*') ? 'active' : '' }}" href="{{ route('banking.issued-void-cheques.index') }}"><i class="bi bi-card-checklist me-2"></i>Issued &amp; Void Cheques</a></li>
        @endif
    @else
        <a href="{{ route('banking.reconciliation') }}"
           class="nav-item-link {{ request()->routeIs('banking.reconciliation') ? 'active' : '' }}">
            <i class="bi bi-check2-square"></i><span>Bank Reconciliation</span>
        </a>
        @if($useChequePrinting)
        <a href="{{ route('banking.cheque-formats.index') }}"
           class="nav-item-link {{ request()->routeIs('banking.cheque-formats.*') ? 'active' : '' }}">
            <i class="bi bi-file-earmark-ruled"></i><span>Cheque Format</span>
        </a>
        <a href="{{ route('banking.cheque-print.index') }}"
           class="nav-item-link {{ request()->routeIs('banking.cheque-print.*') ? 'active' : '' }}">
            <i class="bi bi-printer"></i><span>Cheque Print</span>
        </a>
        @endif
        @if($useChequeRegister)
        <a href="{{ route('banking.cheque-books.index') }}"
           class="nav-item-link {{ request()->routeIs('banking.cheque-books.*') ? 'active' : '' }}">
            <i class="bi bi-journal-bookmark"></i><span>Cheque Books</span>
        </a>
        <a href="{{ route('banking.issued-void-cheques.index') }}"
           class="nav-item-link {{ request()->routeIs('banking.issued-void-cheques.*') ? 'active' : '' }}">
            <i class="bi bi-card-checklist"></i><span>Issued &amp; Void Cheques</span>
        </a>
        @endif
    @endif
@endif
