{{$lang->data['print_sales_report'] ?? 'Print Sales Report'}} @php $branch = ''; $invoices = \App\Models\Invoice::whereDate('date','>=',$start_date)->whereDate('date','<=',$end_date)->latest(); if($branch != '') { $invoices->where('created_by',$this->branch); } $invoices = $invoices->get(); @endphp

Sales Report

@if($branch != '') @php $branchUser = \App\Models\User::where('id',$branch)->first(); @endphp

[{{ $branchUser->name; }}]

@endif
{{ \Carbon\Carbon::parse($start_date)->format('d/m/Y') }} {{ \Carbon\Carbon::parse($end_date)->format('d/m/Y') }}


@foreach ($invoices as $item) @endforeach
Date Invoice # Customer Taxable Amount Discount Tax Amount Gross Total Branch
{{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->createdBy->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'))}}