@extends('admin.layouts.app') @section('title', get_setting('site_name').' | Payroll Adjustment') @section('content') @php $periodLabel = date('F Y', mktime(0, 0, 0, $filterMonth, 1, $filterYear)); $pendingNet = app_round((float) ($periodStats->pending_additions ?? 0) - (float) ($periodStats->pending_deductions ?? 0), 2); @endphp

{{ __('Payroll Adjustment') }}

{{ __('Add one-off additions or deductions. Auto-applies on payslip generate; use Apply for existing payslips.') }}

@if((int) ($periodStats->pending_count ?? 0) > 0)
@csrf
@endif
@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif
{{ (int) ($periodStats->total_count ?? 0) }}
{{ __('Total') }}
{{ (int) ($periodStats->pending_count ?? 0) }}
{{ __('Pending') }}
{{ (int) ($periodStats->applied_count ?? 0) }}
{{ __('Applied') }}
{{ number_format($pendingNet, 2) }}
{{ __('Pending Net') }}
{{ __('Filter Period & Employee') }}
{{ __('Adjustments') }} — {{ $periodLabel }}
{{ $periodAdjustments->total() }} {{ __('record(s)') }} @if($staff_info) @endif
@php $hasPendingRows = $periodAdjustments->contains(fn ($row) => ! $row->isApplied()); @endphp @if($hasPendingRows)
0 {{ __('selected') }}
@endif
@csrf
@if($hasPendingRows) @endif @forelse($periodAdjustments as $row) @php $payslip = $payslipByStaff->get($row->staff_id); $isPending = ! $row->isApplied(); @endphp @if($hasPendingRows) @endif @empty @endforelse
{{ __('Employee') }} {{ __('Category') }} {{ __('Effect') }} {{ __('Amount') }} {{ __('Remarks') }} {{ __('Status') }} {{ __('Payslip') }} {{ __('Action') }}
@if($isPending)
@endif
{{ $row->staff?->user?->name ?? '—' }}
{{ $row->staff?->user_id ?? '—' }} · {{ $row->staff?->designation?->name ?? '—' }}
{{ $row->categoryLabel() }}
@if($summary = $row->calculationSummary())
{{ $summary }}
@endif
{{ $row->adjustment_type === 'deduction' ? __('Deduction') : __('Addition') }} {{ number_format((float) $row->amount, 2) }} {{ $row->remarks }} @if($isPending) {{ __('Pending') }} @else {{ __('Applied') }}
{{ $row->applied_at?->format('Y-m-d H:i') }}
@endif
@if($payslip) {{ $payslip->status }} @else {{ __('Not generated') }} @endif
@if($isPending && $payslip)
@csrf
@endif @if($isPending) {{ __('Delete') }} @endif
{{ __('No adjustments for this period.') }}
@if($periodAdjustments->hasPages()) @endif
{{-- Single employee add --}} {{-- Bulk add multiple employees --}} @endsection @section('script') @endsection