Sales Outlook Report
@if(!$hideFilters)
@error('fromDate')
{{ $message }}
@enderror
@error('toDate')
{{ $message }}
@enderror
* Date range maximum: 2 years
@endif
@if($fromDate && $toDate && count($data) > 0)
@foreach($months as $month) @endforeach @php $columnTotals = []; $grandTotal = 0; @endphp @foreach($data as $row) @foreach($months as $month) @php // Display value (customer or base depending on toggle) $displayValue = $showBaseCurrency ? ($row['months_base'][$month['key']] ?? 0) : ($row['months'][$month['key']] ?? 0); // Always use base for totals $baseValue = $row['months_base'][$month['key']] ?? 0; if (!isset($columnTotals[$month['key']])) { $columnTotals[$month['key']] = 0; } $columnTotals[$month['key']] += $baseValue; @endphp @endforeach @php // Display total (customer or base depending on toggle) $displayTotal = $showBaseCurrency ? $row['total_base'] : $row['total']; // Always use base for grand total $grandTotal += $row['total_base']; @endphp @endforeach @foreach($months as $month) @endforeach
Customer Currency{{ $month['label'] }}Total
{{ $row['customer_name'] }} {{ $showBaseCurrency ? 'GBP' : $row['currency'] }} @if($displayValue > 0) @if($metric === 'sales_value') {{ number_format($displayValue, 2) }} @else {{ number_format($displayValue, 0) }} @endif @else - @endif @if($metric === 'sales_value') {{ number_format($displayTotal, 2) }} @else {{ number_format($displayTotal, 0) }} @endif
GRAND TOTAL GBP @if($metric === 'sales_value') {{ number_format($columnTotals[$month['key']] ?? 0, 2) }} @else {{ number_format($columnTotals[$month['key']] ?? 0, 0) }} @endif @if($metric === 'sales_value') {{ number_format($grandTotal, 2) }} @else {{ number_format($grandTotal, 0) }} @endif
@elseif($fromDate && $toDate)
No data found for the selected date range and filters.
@else
Please select a date range and click "Go" to view the report.
@endif