{{ getAuthCompanyName() }} - Truck#({{$truck->UNIT_ID}})
{{$selectedYear}} Profit and Loss Summary Report
Year: {{$truck->year}} |
Status: {{$truck->status}} |
Operator: {{$truck->driver_name}} |
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)) : ''}} |
Make: {{$truck->MAKE}} |
Tank capacity: {{$truck->TANK_CAPACITY}} |
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}} |
|
|
|
Type |
Total Record |
@php
$repairSubtotals = array_fill(1, 12, 0);
$gtotal = 0;
$expenseSubtotals = array_fill(1, 12, 0);
$driverpaySubtotals = array_fill(1, 12, 0);
@endphp
@foreach ($repairTypes as $repairType)
@for ($month = 1; $month <= 12; $month++)
@php
$key = sprintf('%02d-%d', $month, $cur_year);
$amount = $repairAmounts[$repairType->REPID][$key] ?? 0;
$repairSubtotals[$month] += $amount;
// $color = $amount > 0 ? 'green' : ($amount < 0 ? 'red' : '#000');
$color = 'red';
@endphp
@endfor
@endforeach
@foreach ($expenseTypes as $expenseType)
@if($type->EXPID == $expenseType->EXPID)
@endif
@for ($month = 1; $month <= 12; $month++)
@php
$key = sprintf('%02d-%d', $month, $cur_year);
$amount = $expenseAmounts[$expenseType->EXPID][$key] ?? 0;
$expenseSubtotals[$month] += $amount;
if ($type->EXPID == $expenseType->EXPID) {
$driverpaySubtotals[$month] += $amount;
}
$color = 'red';
@endphp
@endfor
@endforeach
@php
$repairTotal = array_sum($repairSubtotals);
$expenseTotal = array_sum($expenseSubtotals);
$driverpayTotal =array_sum($driverpaySubtotals);
$incomeTotal = array_sum(array_values($loadAmounts['income'] ?? []));
$maintenanceTotal = $repairTotal + $expenseTotal + $driverpayTotal ;
$profitTotal = $incomeTotal - $maintenanceTotal;
@endphp
REPAIR |
${{ number_format($repairTotal, 2) }} |
EXPENSE |
${{ number_format($expenseTotal, 2) }} |
DRIVER PAY + LOAD DRIVER PAY |
${{ number_format($driverpayTotal, 2) }} |
INCOME |
${{ number_format($incomeTotal, 2) }} |
TOTAL MAINTENANCE + EXPENSES |
${{ number_format($maintenanceTotal, 2) }} |
PROFIT |
${{ number_format($profitTotal, 2) }}
|
GRAND TOTAL |
${{ number_format($profitTotal, 2) }}
|