@extends('layouts.admin_fullwidth') @section('page-title', 'Employee Master – ' . ($currentMonthLabel ?? '')) @section('page-subtitle', 'Month-wise consolidated conveyance for all employees') @section('content') @php use Carbon\Carbon; use Carbon\CarbonPeriod; $headerPeriod = CarbonPeriod::create($monthStart, $monthEnd); $today = Carbon::today()->toDateString(); @endphp
| Employee | ₹ | @php $dayIndex = 0; @endphp @foreach ($headerPeriod as $date) @php $isSunday = $date->isSunday(); $isToday = $date->toDateString() === $today; $dayIndex++; $band = ($dayIndex % 5 === 0); @endphp
{{ $date->format('d') }}
{{ $date->format('D') }}
|
@endforeach
|---|---|---|
| {{ $emp->name }} | {{-- EMPLOYEE TOTAL --}}{{ number_format($totals[$emp->id] ?? 0, 2) }} | @php $dayIndex = 0; @endphp @foreach ($rowPeriod as $day) @php $dayStr = $day->toDateString(); $entry = $data[$emp->id][$dayStr] ?? null; $isSunday = $day->isSunday(); $isToday = $dayStr === $today; $dayIndex++; $band = ($dayIndex % 5 === 0); @endphp
@if ($entry)
{{ (int) $entry['amount'] }}
@if (!empty($entry['is_return']))
R*
@endif
@else
—
@endif
|
@endforeach
| Total | {{ number_format($grandTotal ?? 0, 2) }} | @php $dayIndex = 0; @endphp @foreach ($footerPeriod as $day) @php $dayStr = $day->toDateString(); $colTotal = $dayTotals[$dayStr] ?? 0; $isSunday = $day->isSunday(); $isToday = $dayStr === $today; $dayIndex++; $band = ($dayIndex % 5 === 0); @endphp@if ($colTotal > 0) {{ (int) $colTotal }} @else — @endif | @endforeach