{{ $lang->data['print_sales_report'] ?? 'Print Sales Report' }} @php $invoices = \App\Models\Invoice::whereDate('date', '>=', $start_date) ->whereDate('date', '<=', $end_date) ->latest(); if ($staff != '') { $invoices->where('salesman_id', $staff); } else { $staff_ids = \App\Models\User::whereIn('user_type', [4]) ->whereBranchId(Auth::user()->id) ->pluck('id'); $invoices->whereIn('salesman_id', $staff_ids); } $invoices = $invoices->get(); @endphp

Staff Report

[{{ Auth::user()->name }}]

@if ($staff != '') @php $staffUser = \App\Models\User::where('id', $staff)->first(); @endphp @else @endif
{{ \Carbon\Carbon::parse($start_date)->format('d/m/Y') }} {{ \Carbon\Carbon::parse($end_date)->format('d/m/Y') }} {{ $staffUser->name }} All Staff


@if (!$staff) @endif @foreach ($invoices as $item) @if (!$staff) @endif @endforeach
Date Invoice # Customer Taxable Amount Discount Tax Amount Gross TotalStaff
{{ Carbon\Carbon::parse($item->date)->format('d/m/Y') }} #{{ $item->invoice_number }} [{{ $item->customer_file_number ?? '' }}] {{ $item->customer_name ?? '' }} {{ getFormattedCurrency($item->taxable_amount) }} {{ getFormattedCurrency($item->discount) }} {{ getFormattedCurrency($item->tax_amount) }} {{ getFormattedCurrency($item->total) }} {{ $item->salesman->name ?? '' }}


Total Invoices: {{ $invoices->count() }} Total Sales: {{ getFormattedCurrency($invoices->sum('total') ?? 0) }} Total Discount: {{ getFormattedCurrency($invoices->sum('discount')) }} Total Tax: {{ getFormattedCurrency($invoices->sum('tax_amount')) }}