@php
$startdate = request('start_date') ?: date('Y-m-01');
$monthYear = (new DateTime($startdate))->format('Y');
@endphp
{{ 'Driver Maintenance & Expense Report' }} ({{ request('year') ? request('year') : $monthYear }})
{{ getAuthCompanyName() }}
{{ getAuthCarrierInfo()->BILL_TO }}
|
{{ date('m/d/Y h:i A') }}
|
Grand Total:
${{ number_format($gtotal, 2) }}
|
| Driver Name |
@for ($month = 1; $month <= 12; $month++)
{{ \Carbon\Carbon::createFromDate($cur_year, $month, 1)->format('M') }} |
@endfor
Total |
@php
$monthlyTotals = array_fill(1, 12, 0);
$gtotal = 0;
@endphp
@foreach ($drivers as $driver)
@php $total = 0; @endphp
| {{ strtoupper($driver->FIRST_NAME) }} {{ strtoupper($driver->LAST_NAME) }} |
@for ($month = 1; $month <= 12; $month++)
@php
$expenseAmount = $expenseAmounts[$driver->DRIVER_ID][$month] ?? 0;
$monthlyTotals[$month] += $expenseAmount;
$color = $expenseAmount > 0 ? 'green' : ($expenseAmount < 0 ? 'red' : '#000');
$total += $expenseAmount;
@endphp
${{ number_format($expenseAmount, 2) }}
|
@endfor
${{ number_format($total, 2) }}
|
@endforeach
| Total |
@for ($month = 1; $month <= 12; $month++)
@php $gtotal += $monthlyTotals[$month]; @endphp
${{ number_format($monthlyTotals[$month], 2) }}
|
@endfor
${{ number_format($gtotal, 2) }}
|
Grand Total : ${{ number_format($gtotal, 2) }}
|
@if(!empty($chartImage))
@else
@endif
@php
$monthNames = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
@endphp