Customer File Number |
Customer Name |
Customer Email |
Customer Adrress |
{{ $selected_customer->file_number }} |
{{ getCountryCode() }} {{ $selected_customer->phone_number_1 }} @if ($selected_customer->phone_number_2)
, {{ getCountryCode() }} {{ $selected_customer->phone_number_2 }}
@endif
|
{{ $selected_customer->email ?? '-' }} |
{{ $selected_customer->address ?? '-' }} |
@php
$total = \App\Models\Invoice::where('customer_id', $selected_customer->id)->sum('total');
$paid = \App\Models\InvoicePayment::where('customer_id', $selected_customer->id)->sum('paid_amount');
$invoice_paid = \App\Models\InvoicePayment::where('customer_id', $selected_customer->id)
->where('payment_type', 1)
->sum('paid_amount');
$opening_received = \App\Models\InvoicePayment::where('customer_id', $selected_customer->id)
->where('payment_type', 2)
->sum('paid_amount');
$opening_balance = $selected_customer->opening_balance != '' ? $selected_customer->opening_balance : 0;
$discount = \App\Models\CustomerPaymentDiscount::where('customer_id', $selected_customer->id)->sum('amount');
@endphp
Opening Balance |
Total Invoices |
Total Amount |
Paid Amount |
Payment Discount |
Balance Amount |
{{ getFormattedCurrency($opening_balance) }} |
{{ \App\Models\Invoice::where('customer_id', $selected_customer->id)->count() }}
|
{{ getFormattedCurrency($total) }} |
{{ getFormattedCurrency($paid) }} |
{{ getFormattedCurrency($discount) }} |
{{ getFormattedCurrency($total + $selected_customer->opening_balance - ($paid + $discount)) }}
|