@extends('admin.layouts.app') @section('content')
{{-- Orange Header --}}

Salary Report

{{-- FILTER FORM --}}
@csrf {{-- For Month --}}

For Month

{{-- Selection By Label --}}

Selection By

{{-- 4 columns: Branch | Department | Designation | Employee --}}
{{-- BRANCH --}}
@forelse($branches as $b) @empty

No branches

@endforelse
{{-- DEPARTMENT --}}
@forelse($departments as $d) @empty

No departments

@endforelse
{{-- DESIGNATION --}}
@forelse($designations as $dg) @empty

No designations

@endforelse
{{-- EMPLOYEE --}}
@forelse($employees as $emp) @empty

No employees

@endforelse
{{-- Select Report --}}

Select Report

{{-- Action Buttons --}}
Close
{{-- ===== REPORT TABLE ===== --}} @if(isset($showReport) && $showReport && isset($reportData))

Monthly Salary Statement — {{ \Carbon\Carbon::parse($forMonth)->format('F Y') }}

@if(isset($isFromDB) && $isFromDB) From Database @else Live Calculation — Run Monthly Process to save @endif
@if($reportData->isEmpty())
No employee data found for the selected filters.
@else
{{-- --}} @php $grandNet = 0; $i = 1; @endphp @foreach($reportData as $row) @php $grandNet += $row['net_salary']; @endphp {{-- --}} @endforeach
# Employee Department Designation Days Prsnt Late Pybl OT Hrs OT Amt Basic(Pro) Bonus Gross PF ESI PT TDSLoan Ded.Total Ded. Net Salary Pay Slip
{{ $i++ }}
{{ $row['employee']->name }}
{{ $row['employee']->employee_code ?? '' }}
{{ $row['employee']->department->name ?? '—' }} {{ $row['employee']->designation->name ?? '—' }} {{ $row['total_days'] }} {{ $row['present_days'] }} {{ $row['late_days'] }} {{ $row['payable_days'] }} {{ $row['ot_hours'] > 0 ? $row['ot_hours'] : '-' }} {{ $row['ot_amount'] > 0 ? number_format($row['ot_amount'], 2) : '-' }} {{ number_format($row['basic_salary'], 2) }} {{ number_format($row['total_bonus'], 2) }} @if($row['bonuses']->count())
@foreach($row['bonuses'] as $b)({{ $b->bonus_name }})@endforeach
@endif
{{ number_format($row['total_additions'], 2) }} {{ number_format($row['pf_amount'], 2) }} {{ number_format($row['esi_amount'], 2) }} {{ number_format($row['pt_amount'], 2) }} {{ number_format($row['tds'], 2) }} {{ number_format($row['total_loan_ded'], 2) }} @if($row['loans']->count())
@foreach($row['loans'] as $l)({{ $l->loan_type }})@endforeach
@endif
{{ number_format($row['total_deductions'], 2) }} {{ number_format($row['net_salary'], 2) }} @if(!empty($row['payslip_id'])) View @else @endif
Grand Total Net Salary: {{ number_format($grandNet, 2) }}
{{-- Summary Cards --}}

Total Employees

{{ $reportData->count() }}

Total Gross

{{ number_format($reportData->sum('total_additions'), 2) }}

Total Deductions

{{ number_format($reportData->sum('total_deductions'), 2) }}

Total Net Payable

{{ number_format($grandNet, 2) }}

@endif
@endif
@push('scripts') @endpush @endsection