@if($isDownload && $isDownload == true) @endif
@php $colspan = 4; @endphp
{!! __('report.total_amount_this_month') !!}
{!! numberFormat($result['total_amount_current'], 1, true) !!}
{!! __('report.total_amount_last_month') !!}
{{ numberFormat($result['total_amount_last'], 1, true) }}
{!! __('report.total_pcs_this_month') !!}
{{ numberFormat($result['total_qty_current'], 1, false, false, 0) }}
{!! __('report.total_pcs_last_month') !!}
{{ numberFormat($result['total_qty_last'], 1, false, false, 0) }}
{!! __('report.most_sale_this_month') !!}
{!! $result['most_sale_current'] != '' ? $result['most_sale_current'] : '--' !!}
{!! __('report.most_sale_last_month') !!}
{!! $result['most_sale_last'] != '' ? $result['most_sale_last'] : '--' !!}
{!! __('report.worst_sale_this_month') !!}
{!! $result['w_sale_current'] != '' ? $result['w_sale_current'] : '--' !!}
{!! __('report.worst_sale_last_month') !!}
{!! $result['w_sale_last'] != '' ? $result['w_sale_last'] : '--' !!}
@if ($isDownload) @else @endif

{{ __('report.product_sale') }}

{{ __('report.from') }}:  {{ dateFormat($inputs['from_date'], DISPLAY_DATETIME3) }} {{ __('report.to') }}:  {{ dateFormat($inputs['to_date'], DISPLAY_DATETIME3) }}
@if (count($result['categories']) > 0) @foreach ($result['categories'] as $catDetail) @if (count($categoryItems) > 0)
{{ $catDetail->name }}
{!! numberFormat($wholeSale, 1, true) !!}Pcs {{ numberFormat($wholeQty, 1, false, false, 0) }}
{{--

{{ $catDetail->name }}

{{$wholeQty}}

---

{{numberFormat($wholeSale,1,false)}}

--}}
@if (count($categoryItems) > 0) @foreach ($categoryItems as $catItems) @php $totalQty = $catItems['current_month_stats']['total_qty'] ?? 0; $lastMonthtotalPrice = isset($catItems['last_month_stats']['total_price']) ? $catItems['last_month_stats']['total_price'] : 0; $currentMonthTotalPrice = isset($catItems['current_month_stats']['total_price']) ? $catItems['current_month_stats']['total_price'] : 0; @endphp @endforeach @endif
{!! __('report.name') !!} {!! __('report.pc_this_month') !!} {!! __('report.sale_last_month') !!} {!! __('report.sale_this_month') !!}
{{ $catItems['name'] }} {{ $totalQty }} {{ numberFormat($lastMonthtotalPrice, 1, false) }} {{ numberFormat($currentMonthTotalPrice, 1, false) }}
@endif @if ($index++ % 3 == 0 && $isDownload && $isDownload == true)
@endif @endforeach @endif