@if (isset($statistics) && $statistics && isset($statistics->items) && $statistics->items)
@if (is_array($date))

@t('Statistics for') @date($date[0]) - @date($date[1])

@else

@t('Statistics for') @date($date)

@endif @php $total = 0; $qty_total = 0; @endphp @foreach ($statistics->items as $category_id => $products) @php $category_total = 0; $category_qty_total = 0; @endphp @foreach ($products as $product) @php $total += $product->total; $category_total += $product->total; $category_qty_total += $product->qty; $qty_total += $product->qty; @endphp @endforeach @endforeach
{{ $categories->{$category_id}->name }} @t('Qty') @t('Total')
@if ($categories->{$category_id}->extra->items == 1) {{ $categories->{$category_id}->name }} @else {{ $product->product_name }} @endif {{ $product->qty }} @if (mb_strlen($product->product_qty) > 0) / {{ $product->product_qty }} @endif {{ amount($product->total, ['Currency' => oa($currency)]) }}
@t('Total Per Category:') {{ $category_qty_total }} {{ amount($category_total, ['Currency' => oa($currency)]) }}
@t('Total') {{ $qty_total }} @t('Total: %s', amount($total, ['Currency' => oa($currency)]))

@endif