{{ getAuthCompanyName() }}- Truck#({{$truck->UNIT_ID}})
Maintenance Log
Year: {{$truck->year}} |
Status: {{$truck->status}} |
Operator: {{$truck->driver_name}} |
@php
if(!empty(getDayCount($truck->LIC_1_EXP_DATE))){
$licday = getDayCount($truck->LIC_1_EXP_DATE);
$dis ='';
}else{
$licday = '';
$abs = '';
$dis = 'display:none';
}
@endphp
Registration Expiration: {{ ($truck->LIC_1_EXP_DATE && $truck->LIC_1_EXP_DATE != '0000-00-00 00:00:00') ? date('m/d/Y',strtotime($truck->LIC_1_EXP_DATE)) : ''}}@if ($licday > 0)
(-{{ $licday }} days ago)
@else
({{ $licday == 0 ? 'Today' : abs((int)$licday) . ' days left' }})
@endif |
Make: {{$truck->MAKE}} |
Location: {{$truck->current_address}} |
Last Annual PM Service Date: {{ ($truck->LAST_SERVICE && $truck->LAST_SERVICE != '0000-00-00 00:00:00') ? date('m/d/Y', strtotime($truck->LAST_SERVICE)) : ''}} |
Model: {{$truck->MODEL}} |
VIN: {{$truck->VIN}} |
Acquisition Date:{{ ($truck->ACQUISITION_DATE && $truck->ACQUISITION_DATE != '0000-00-00 00:00:00') ? date('m/d/Y', strtotime($truck->ACQUISITION_DATE)) : '' }} |
|
Plate / Reg #: {{$truck->PLATE}} |
|
|
|
@php
$totalSum = 0;
$totalSum2 = 0;
@endphp
@foreach ($vehicle_maintenances as $item)
@php
$arr = [];
if (!empty($item->service_provider)) {
$arr = explode(",", $item->service_provider);
}
$total = $item->part + $item->labor;
$totalSum2 += $total;
@endphp
@endforeach
Total Part Cost: ${{ number_format($sum->total_part, 2) }} |
Total Maintenance Cost ${{ number_format($totalSum2, 2) }} |
Total Labor Cost: ${{ number_format($sum->total_labour, 2) }} |
|
Month |
@for ($month = 1; $month <= 12; $month++)
{{ \Carbon\Carbon::createFromDate($cur_year, $month, 1)->format('M-Y') }} |
@endfor
REPAIR TYPE |
@php
$repairSubtotals = array_fill(1, 12, 0);
@endphp
@foreach ($repairTypes as $repairType)
{{ strtoupper($repairType->NAME) }} |
@for ($month = 1; $month <= 12; $month++)
@php
$key = sprintf('%02d-%d', $month, $cur_year);
$amount = $repairAmounts[$repairType->REPID][$key] ?? '0';
$amount = floatval($amount);
$repairSubtotals[$month] += $amount;
$color = $amount > 0 ? 'green' : ($amount < 0 ? 'red' : 'black');
@endphp
@if($amount > 0) ${{ number_format($amount, 2) }} @endif
|
@endfor
@endforeach
REPAIR SUBTOTAL |
@for ($month = 1; $month <= 12; $month++)
@php
$amount = $repairSubtotals[$month] ?? 0;
$color = $amount > 0 ? 'red' : 'black';
$color = $amount > 0 ? 'green' : ($amount < 0 ? 'red' : '#000');
@endphp
@if($amount > 0)
${{ number_format($amount, 2) }}
@endif
|
@endfor
EXPENSE TYPE |
@php
$expenseSubtotals = array_fill(1, 12, 0);
@endphp
@foreach ($expenseTypes as $expenseType)
{{ strtoupper($expenseType->NAME) }} |
@for ($month = 1; $month <= 12; $month++)
@php
$key = sprintf('%02d-%d', $month, $cur_year);
$amount = $expenseAmounts[$expenseType->EXPID][$key] ?? 0;
$expenseSubtotals[$month] += $amount;
$color = $expenseSubtotals[$month] > 0 ? 'green' : ($expenseSubtotals[$month] < 0 ? 'red' : '#000');
@endphp
@if(!empty($amount)) ${{ number_format($amount,2) }} @endif |
@endfor
@endforeach
EXPENSE SUBTOTAL |
@for ($month = 1; $month <= 12; $month++)
@php
$amount = $expenseSubtotals[$month] ?? 0;
$color = $amount > 0 ? 'green' : ($amount < 0 ? 'red' : '#000');
@endphp
@if($amount > 0)
${{ number_format($amount, 2) }}
@endif
|
@endfor
TOTAL COST |
@for ($month = 1; $month <= 12; $month++)
@php
$color = $monthlyTotals[$month] > 0 ? 'green' : ($monthlyTotals[$month] < 0 ? 'red' : '#000');
@endphp
${{ number_format($monthlyTotals[$month], 2) }} |
@endfor
Vehicle Maintenance Log
Description |
Status |
Date |
Odometer |
Type |
Vendor |
Part |
Labor Cost |
Total Cost |
@php
$totalSum = 0;
@endphp
@foreach ($vehicle_maintenances as $item)
@php
$arr = [];
if (!empty($item->service_provider)) {
$arr = explode(",", $item->service_provider);
}
$total = $item->part + $item->labor;
$totalSum += $total;
@endphp
{{ strtoupper($item->description)}} |
{{$item->status}} |
{{date('m/d/Y',strtotime($item->date))}} |
{{$item->odometer}} |
{{strtoupper($item->repair_name)}}
|
{{strtoupper($item->vendorname)}} |
{{number_format($item->part,2)}} |
{{number_format($item->labor,2)}} |
${{number_format($total, 2)}} |
@endforeach
TOTAL
| |
|
|
|
|
|
|
${{number_format($totalSum, 2)}} |
Pie Chart