@if (isset($statistics) && $statistics && isset($statistics->items) && $statistics->items)
@if (is_array($date))
@date($date[0]) - @date($date[1])
@else
@t('Statistics for') @date($date)
@endif
{!! Form::select(
'method',
[
'manual' => __('Manual Orders'),
'automatic' => __('Automatic Orders')
],
$method,
[
'empty' => __('All'),
'class' => 'method ajax-select form-control',
'data-name' => 'method',
'data-target' => '.modal-body',
'data-url' => Router::removeVar(Router::url(), 'method'),
'data-target-class' => 'done'
]
) !!}
@php
$total = 0;
$qty_total = 0;
@endphp
@if ($category_groups)
@foreach ($category_groups as $key => $value)
@if (count(array_intersect(oa($value->categories), array_keys(oa($statistics->items)))) == 0)
@continue
@endif
{{ $value->name }}
@t('Category') |
@t('Qty') |
@t('Total') |
@php
$group_total = 0;
$group_qty_total = 0;
@endphp
@foreach ($statistics->items as $category_id => $products)
@if (!in_array($category_id, $value->categories))
@continue
@endif
@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
@php
$group_total += $category_total;
$group_qty_total += $category_qty_total;
@endphp
{{ $categories->{$category_id}->name }} |
{{ $category_qty_total }}
|
{{ amount($category_total, ['Currency' => oa($currency)]) }}
|
@endforeach
|
{{ $group_qty_total }}
|
{{ amount($group_total, ['Currency' => oa($currency)]) }}
|
@endforeach
@else
@t('Category') |
@t('Qty') |
@t('Total') |
@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
{{ $categories->{$category_id}->name }} |
{{ $category_qty_total }}
|
{{ amount($category_total, ['Currency' => oa($currency)]) }}
|
@endforeach
@endif
@t('Total') |
{{ amount($statistics->totals->amount, ['Currency' => oa($currency)]) }}
|
@t('Paid Total') |
{{ amount($statistics->totals->paid_amount, ['Currency' => oa($currency)]) }}
|
@t('Net Total') |
{{ amount($statistics->totals->net_amount, ['Currency' => oa($currency)]) }}
|
@if (isset($statistics->totals->discount) && $statistics->totals->discount)
@t('Discounts') |
{{ amount($statistics->totals->discount, ['Currency' => oa($currency)]) }}
|
@endif
@if (isset($statistics->totals->remainder_total) && $statistics->totals->remainder_total)
@t('Remaining balance') |
{{ amount($statistics->totals->remainder_total, ['Currency' => oa($currency)]) }}
|
@t('Potential Net Total *') |
{{ amount(
$statistics->totals->net_amount +
$statistics->totals->remainder_total -
$statistics->totals->remainder_fees,
['Currency' => oa($currency)]
) }}
|
@endif
@endif