@extends('layouts.master') @section('content')
Unit ID | @for ($month = 1; $month <= 12; $month++){{ \Carbon\Carbon::createFromDate($cur_year, $month, 1)->format('M-Y') }} | @endfor|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ $truck->UNIT_ID }} | @php $totalProfit = 0; @endphp @for ($month = 1; $month <= 12; $month++) @php $repairAmount = $repairAmounts[$truck->TRUCK_ID][$month] ?? 0; $expenseAmount = $expenseAmounts[$truck->TRUCK_ID][$month] ?? 0; $loadAmount = $loadAmounts[$truck->TRUCK_ID][$month] ?? 0; $profit = $loadAmount - ($repairAmount + $expenseAmount); $totalProfit += $profit; $monthTotals[$month] += $profit; @endphp${{ number_format($profit, 2) }} | @endfor|||||||||||
Total | @for ($month = 1; $month <= 12; $month++) @php $gtotal += $monthTotals[$month]; @endphp${{ number_format($monthTotals[$month], 2) }} | @endfor|||||||||||
Grand Total Profit/Loss: ${{ number_format($gtotal, 2) }} |