{{-- Partial: Lista agrupada de planillas por quincena (acordeón) --}} @if ($groups->isEmpty())

{{ _trans('payroll.No payroll records found') }}

@else
@foreach ($groups as $group) @php $safeKey = str_replace(['-', '.', ' '], '_', $group['key']); @endphp
{{-- Header de la quincena --}}
{{-- Botones de acción del grupo (fuera del accordion-button) --}}
{{-- Exportar Excel --}} @if (hasPermission('salary_read')) @endif {{-- Eliminar planilla completa --}} @if (hasPermission('salary_delete') && $group['can_delete_all']) @endif
{{-- Contenido plegable: tabla de empleados --}}
@forelse ($group['items'] as $item) {{-- ID / Código empleado --}} {{-- Nombre --}} {{-- Salario Bruto --}} {{-- Tipo de recibo --}} {{-- Cálculo (detalles si está calculado) --}} {{-- Estado --}} {{-- Acciones --}} @empty @endforelse
ID {{ _trans('common.Name') }} {{ _trans('payroll.Salary') }} {{ _trans('payroll.Type') }} {{ _trans('payroll.Calculation') }} {{ _trans('common.Status') }} {{ _trans('common.Action') }}
@if (hasPermission('salary_read')) #{{ $item['employee_id'] ?: '0000' }} @else #{{ $item['employee_id'] ?: '0000' }} @endif {{ $item['employee_name'] }} ${{ number_format($item['salary'], 2) }} {{ $item['type'] }} @if (!$item['is_calculated']) {{ _trans('common.No') }} @else
{{ _trans('payroll.Addition') }}: ${{ number_format($item['allowance_amount'], 2) }}
{{ _trans('payroll.Deduction') }}: ${{ number_format($item['deduction_amount'] + $item['absent_amount'] + $item['advance_amount'], 2) }}
{{ _trans('payroll.Adjust Salary') }}: ${{ number_format($item['adjust'], 2) }}
{{ _trans('payroll.Net Salary') }}: ${{ number_format($item['net_salary'], 2) }}
@endif
{{ $item['status_name'] }}
{{ _trans('common.No data found') }}
@endforeach
@endif