{{ __('main.daily_sales_report') }}
@if (Auth::user()->user_type == 2)
@endif
{{ __('main.daily_sales') }}
@php $total_balance = 0; $total_payment = 0; @endphp @foreach ($invoices as $item) @endforeach
{{ __('main.invoice_no') }} {{ __('main.file_no') }} {{ __('main.qty') }} {{ __('main.amount') }} {{ __('main.payment') }} {{ __('main.balance') }}
#{{ $item->invoice_number }}
{{ $item->customer_file_number }}
@php $localquantity = \App\Models\InvoiceDetail::where('invoice_id', $item->id)->sum('quantity'); @endphp
{{ $localquantity }}
{{ getFormattedCurrency($item->total) }}
@php $payment = \App\Models\InvoicePayment::where('invoice_id', $item->id) ->whereDate('date', \Carbon\Carbon::parse($date)) ->sum('paid_amount'); $total_balance += $item->total - $payment; $total_payment += $payment; @endphp
{{ getFormattedCurrency($payment) }}
{{ getFormattedCurrency($item->total - $payment) }}
{{ __('main.total_amount') }}:
{{ getFormattedCurrency($invoices->sum('total')) }}
{{ __('main.total_payment') }} :
{{ getFormattedCurrency($total_payment) }}
{{ __('main.total_balance') }}:
{{ getFormattedCurrency($total_balance) }}

{{ __('main.other_data') }}
@php if ($branch == '') { $opening_balance = \App\Models\InvoicePayment::whereDate('date', $date) ->where('payment_type', 2) ->sum('paid_amount'); $all_payment = \App\Models\InvoicePayment::whereDate('date', $date) ->where('payment_type', 1) ->sum('paid_amount'); $max_payment = \App\Models\InvoicePayment::whereDate('date', $date)->sum('paid_amount'); } else { $opening_balance = \App\Models\InvoicePayment::whereCreatedBy($branch) ->whereDate('date', $date) ->where('payment_type', 2) ->sum('paid_amount'); $all_payment = \App\Models\InvoicePayment::whereCreatedBy($branch) ->whereDate('date', $date) ->where('payment_type', 1) ->sum('paid_amount'); $max_payment = \App\Models\InvoicePayment::whereCreatedBy($branch) ->whereDate('date', $date) ->sum('paid_amount'); } @endphp
{{ __('main.particulars') }} {{ __('main.value') }} ...  ...
{{ __('main.no_of_invoices') }}
{{ $no_of_invoices }}
{{ __('main.opening_balance_received') }}
{{ getFormattedCurrency($opening_balance) }}
{{ __('main.total_sales') }}
{{ getFormattedCurrency($total_sales) }}
{{ __('main.old_invoice_balance_received') }}
{{ getFormattedCurrency($all_payment - $total_payment) }}
{{ __('main.total_expense') }}
{{ getFormattedCurrency($total_expense) }}
{{ __('main.total_payment_received') }}
{{ getFormattedCurrency($max_payment) }}