@extends('layouts.backend') @section('content')

{{ __('Payroll Run') }}

@if($run->status === 'draft' && ($canFinalizePayroll ?? false))
@csrf
@endif {{ __('Back') }}
@include('partials.flash')
{{ __('Period:') }} {{ $run->period_label ?: '-' }}
{{ __('Range:') }} {{ $run->period_start }} to {{ $run->period_end }}
{{ __('Gross:') }} {{ number_format((float)$run->gross_total, 2) }}
{{ __('Deductions:') }} {{ number_format((float)$run->deduction_total, 2) }}
{{ __('Net:') }} {{ number_format((float)$run->net_total, 2) }}
{{ __('Status:') }} {{ __(ucfirst($run->status)) }}
{{ __('Finalized By:') }} {{ $run->processor?->name ?: '-' }}
@if($run->status === 'draft')
{{ __('Review all payroll items below. Final submission will mark this run as processed and post provident fund transactions.') }}
@endif
@forelse($run->items as $item) @empty @endforelse
{{ __('Employee') }}{{ __('Department') }}{{ __('Basic') }}{{ __('Allowances') }}{{ __('Bonus') }}{{ __('Loan') }}{{ __('Other Ded.') }}{{ __('PF Employee') }}{{ __('PF Employer') }}{{ __('Tax') }}{{ __('Net') }}{{ __('Status') }}{{ __('Actions') }}
{{ trim($item->employee?->first_name.' '.$item->employee?->last_name) }} ({{ $item->employee?->employee_code }}) {{ $item->employee?->department?->name ?: '-' }} {{ number_format((float)$item->basic_salary, 2) }} {{ number_format((float)$item->allowance_total, 2) }} {{ number_format((float)$item->bonus_total, 2) }} {{ number_format((float)$item->loan_deduction, 2) }} {{ number_format((float)$item->other_deduction, 2) }} {{ number_format((float)$item->provident_fund_deduction, 2) }} {{ number_format((float)$item->employer_pf_contribution, 2) }} {{ number_format((float)$item->tax_deduction, 2) }} {{ number_format((float)$item->net_payable, 2) }} {{ __(ucfirst($item->payment_status)) }}
{{ __('No payroll items found.') }}
@endsection