{{ $customer->file_number }}
{{ $customer->first_name }}
{{ getCountryCode() }} {{ $customer->phone_number_1 }} @if ($customer->phone_number_2) , {{ getCountryCode() }} {{ $customer->phone_number_2 }} @endif

{{ __('main.total_invoices') }}
{{ \App\Models\Invoice::where('customer_id', $customer->id)->count() }}
@php $total = \App\Models\Invoice::where('customer_id', $customer->id)->sum('total'); $paid = \App\Models\InvoicePayment::where('customer_id', $customer->id)->sum('paid_amount'); $invoice_paid = \App\Models\InvoicePayment::where('customer_id', $customer->id) ->where('payment_type', 1) ->sum('paid_amount'); $opening_received = \App\Models\InvoicePayment::where('customer_id', $customer->id) ->where('payment_type', 2) ->sum('paid_amount'); $opening_balance = $customer->opening_balance != '' ? $customer->opening_balance : 0; $discount = \App\Models\CustomerPaymentDiscount::where('customer_id', $customer->id)->sum('amount'); $salesreturn = \App\Models\SalesReturnPayment::where('customer_id', $customer->id)->sum('paid_amount'); @endphp
{{ __('main.ob_balance') }}
{{ getFormattedCurrency($opening_balance - $opening_received) }}
{{ __('main.invoice_balance') }}
{{ getFormattedCurrency($total - $invoice_paid) }}
{{ __('main.total_balance') }}
{{ $customer->getBalance() }}
@if (isset($customer->group) && $customer->group->name != '')
{{ __('main.group') }}
{{ $customer->group->name ?? '' }}
@endif @if ($customer->family_name != '')
{{ __('main.family') }}
{{ $customer->family_name ?? '' }}
@endif @if ($customer->email != '')
{{ __('main.email') }}
{{ $customer->email ?? '' }}
@endif @if ($customer->address != '')
{{ __('main.address') }}
{{ $customer->address ?? '' }}
@endif