{{ $title }} @if($from && $to) ( {{ $from }} → {{ $to }} ) @else (No dates selected) @endif
@if(!empty($daily)) @php $totalIncome = collect($daily)->sum('income'); $totalExpense = collect($daily)->sum('expense'); $netProfit = $totalIncome - $totalExpense; @endphp
@foreach($daily as $date => $data) @php $profit = ($data['income'] ?? 0) - ($data['expense'] ?? 0); @endphp @endforeach
Date Income Expense Daily P/L
Total {{ number_format($totalIncome, 2) }} {{ number_format($totalExpense, 2) }} {{ number_format($netProfit, 2) }}
{{ $date }} @if(!empty($data['income_items']))
    @foreach($data['income_items'] as $item)
  • {{ $item->name }}: {{ number_format($item->amount, 2) }}
  • @endforeach
@else {{ number_format($data['income'] ?? 0, 2) }} @endif
@if(!empty($data['expense_items']))
    @foreach($data['expense_items'] as $item)
  • {{ $item->name }}: {{ number_format($item->amount, 2) }}
  • @endforeach
@else {{ number_format($data['expense'] ?? 0, 2) }} @endif
{{ number_format($profit, 2) }}
@else

No data available for this period

@endif