@extends('layouts.master') @section('css') @endsection @section('title') Salary Report - {{ $staff->name }} @endsection @section('content') @php $totalSalaryNew = $totalSalary; $deductionTotalNew = $deductionTotal; @endphp
@csrf
Salary - {{ $staff->name }}
@if ($alreadyGenerated) Salary already generated for this month @endif
{{-- --}}
Total Working Days {{ $totalCompanyWorkingDays }}
Duty Time @if ($staff->duty_start_time != null) {{ \Carbon\Carbon::parse($staff->duty_start_time)->format('h:i A') }} - {{ \Carbon\Carbon::parse($staff->duty_end_time)->format('h:i A') }} @endif
Duty Duration {{ $dutyDurationCombined }}
Paid Leaves {{ $staff->paid_leave_count }}
Working Details
Worked Days {{ $totalWorkDays }}
Working Hours {{ $totalWorkingHours }}
Average Working Hours {{ $averageWorkingHours }}
Absent Days {{ $absentDays }}
UnPaid Leaves {{ $unPaidDays }}

@foreach ($workingHourOfDay as $key => $day) @php $dayPunch = $punchesOfDay->where('date', $key)->first(); $invalidPunches = $dayPunch['invalidPunches']; $validPunches = $dayPunch['validPunches']; if (count($invalidPunches) > 0) { $invalidPunchExist = true; } else { $invalidPunchExist = false; } @endphp @php $dayWorkedHours = $day->sum(['workedHours']); $dayWorkedHour = intval($dayWorkedHours); $dayWorkedMinutes = round(($dayWorkedHours - $dayWorkedHour) * 60); $dayMissedHours = $day->sum(['missedHours']); $dayMissedHour = intval($dayMissedHours); $dayMissedMinutes = round(($dayMissedHours - $dayMissedHour) * 60); $dayOtHours = $day->sum(['otHours']); $dayOtHour = intval($dayOtHours); $dayOtMinutes = round(($dayOtHours - $dayOtHour) * 60); $dayLateHours = $day->sum(['lateHours']); $dayLateHour = intval($dayLateHours); $dayLateMinutes = round(($dayLateHours - $dayLateHour) * 60); @endphp @foreach ($day as $dayShift) @php $dayShiftWorkHour = intval($dayShift['workedHours']); $dayShiftWorkMinutes = round( ($dayShift['workedHours'] - $dayShiftWorkHour) * 60, ); $dayShiftMissedHour = intval($dayShift['missedHours']); $dayShiftMissedMinutes = round( ($dayShift['missedHours'] - $dayShiftMissedHour) * 60, ); $dayShiftOtHour = intval($dayShift['otHours']); $dayShiftOtMinutes = round( ($dayShift['otHours'] - $dayShiftOtHour) * 60, ); $dayShiftLateHour = intval($dayShift['lateHours']); $dayShiftLateMinutes = round( ($dayShift['lateHours'] - $dayShiftLateHour) * 60, ); @endphp @endforeach @if (count($validPunches) > 0) @endif @if (count($invalidPunches) > 0) @endif @endforeach @php $totalWorkedHour = intval($totalWorkingHours); $totalWorkedMinutes = round(($totalWorkingHours - $totalWorkedHour) * 60); $totalMissedHour = intval($missedHours); $totalMissedMinutes = round(($missedHours - $totalMissedHour) * 60); $totalOtHour = intval($otHours); $totalOtMinutes = round(($otHours - $totalOtHour) * 60); $totalLateHour = intval($lateHours); $totalLateMinutes = round(($lateHours - $totalLateHour) * 60); @endphp
Working Days Hour Missed Hours OT Hours Late Hours Action
{{ $key }} {{ $dayWorkedHour . ' Hr ' . $dayWorkedMinutes . ' Min' }} {{ $dayMissedHour . ' Hr ' . $dayMissedMinutes . ' Min' }} {{ $dayOtHour . ' Hr ' . $dayOtMinutes . ' Min' }} {{ $dayLateHour . ' Hr ' . $dayLateMinutes . ' Min' }}
Total {{ $totalWorkedHour . ' Hr ' . $totalWorkedMinutes . ' Min' }} {{ $totalMissedHour . ' Hr ' . $totalMissedMinutes . ' Min' }} {{ $totalOtHour . ' Hr ' . $totalOtMinutes . ' Min' }} {{ $totalLateHour . ' Hr ' . $totalLateMinutes . ' Min' }}
@if (!$alreadyGenerated)
Salary Details
{{-- --}}
@if ($allowances->count() > 0) @foreach ($allowances as $allowance) @endforeach @endif @foreach ($salaryAllowances as $salaryAllowance) @if ($allowances->where('salary_allowance_id', $salaryAllowance->id)->count() > 0) @continue @endif @endforeach
Earnings Amount Total
Base Salary
{{ $allowance->salaryAllowance->name }}
Gross Salary {{ round($grossSalary, 2) }}
Over Time
@foreach ($salaryDeductions as $salaryDeduction) @endforeach
Deductions Amount Total
Leave Deduction
Time Deduction
Time/Leave Deduction {{ round($leaveDeduction + $hourlyDeduction, 2) }}
Other Earnings {{ round($ot, 2) }}
Other Deductions {{ 0 }}
Add Earnings Add Deductions
Total Earnings {{ round($totalSalaryNew, 2) }}
Total Deductions {{ round($deductionTotalNew, 2) }}
Net Salary {{ round($netSalary, 2) }}
@endif
@endsection @section('script') @endsection