@if (hasPermission('payroll_menu'))
    <li class="sidebar-menu-item {{ set_menu([route('hrm.payroll_items.index'), route('deduction.index')]) }}">
        <a href="javascript:void(0)"
            class="parent-item-content has-arrow {{ menu_active_by_route(['hrm.payroll_items.index', 'hrm.payroll_setup.index', 'hrm.payroll_setup.user_setup', 'hrm.payroll_setup.user_commission_setup', 'hrm.payroll_advance_type.index', 'hrm.payroll_advance_salary.index', 'hrm.payroll_advance_salary.create', 'hrm.payroll_advance_salary.edit', 'hrm.payroll_advance_salary.show', 'hrm.payroll_salary.index', 'hrm.payroll_salary.show', 'hrm.payroll_salary.invoice', 'deduction.index']) }}">
            <i class="las la-comment-dollar"></i>
            <span class="on-half-expanded">{{ _trans('payroll.Payroll') }}</span>
        </a>
        <ul
            class="child-menu-list {{ set_active(['hrm/payroll*', 'hrm/payroll/reports*', 'admin/special-attendance/deduction*']) }}">

            @if (hasPermission('commission_read'))
                <li class="nav-item {{ menu_active_by_route(['hrm.payroll_items.index']) }}">
                    <a href="{{ route('hrm.payroll_items.index') }}" class="">
                        <span> {{ _trans('payroll.Commission') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('setup_read'))
                <li
                    class="nav-item {{ menu_active_by_route(['hrm.payroll_setup.index', 'hrm.payroll_setup.user_setup', 'hrm.payroll_setup.user_commission_setup']) }}">
                    <a href="{{ route('hrm.payroll_setup.index') }}" class="">
                        <span> {{ _trans('payroll.Setup') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('advance_type_read'))
                <li class="nav-item {{ menu_active_by_route(['hrm.payroll_advance_type.index']) }}">
                    <a href="{{ route('hrm.payroll_advance_type.index') }}" class="">
                        <span> {{ _trans('payroll.Advance Type') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('advance_read'))
                <li
                    class="nav-item {{ menu_active_by_route(['hrm.payroll_advance_salary.index', 'hrm.payroll_advance_salary.create', 'hrm.payroll_advance_salary.edit', 'hrm.payroll_advance_salary.show']) }}">
                    <a href="{{ route('hrm.payroll_advance_salary.index') }}" class="">
                        <span> {{ _trans('payroll.Advance') }}</span>
                    </a>
                </li>
            @endif

            {{-- @if (isModuleActive('Tardy'))
                @if (hasPermission('deduction_generate_read') && hasFeature('attendance_deduction'))
                    <li
                        class="nav-item {{ menu_active_by_route(['deduction.index', 'hrm.payroll_salary.show', 'hrm.payroll_salary.invoice']) }}">
                        <a href="{{ route('deduction.index') }}" class="">
                            @if (Str::lower(config('app.style')) == 'demo')
                                <span class="text-warning"> {{ _trans('payroll.Attendance Deduction') }}</span>
                            @else
                                <span> {{ _trans('payroll.Attendance Deduction') }}</span>
                            @endif
                        </a>
                    </li>
                @endif
            @endif --}}

            @if (hasPermission('salary_read'))
                <li
                    class="nav-item {{ menu_active_by_route(['hrm.payroll_salary.index', 'hrm.payroll_salary.show', 'hrm.payroll_salary.invoice']) }}">
                    <a href="{{ route('hrm.payroll_salary.index') }}" class="">
                        <span> {{ _trans('payroll.Salary Generate') }}</span>
                    </a>
                </li>
            @endif

            @if (hasPermission('salary_read'))
                <li class="nav-item {{ menu_active_by_route(['hrm.payroll_salary.salary-report']) }}">
                    <a href="{{ route('hrm.payroll_salary.salary-report') }}" class="">
                        <span> {{ _trans('payroll.Salary Report') }}</span>
                    </a>
                </li>
            @endif
        </ul>
    </li>
@endif
