@if($companyCustomerInvoice->status == 1)
PAID
@else
UNPAID
@endif
@php $company = $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->company: ''; $logoPath = public_path('storage/documents/'.$company->logo); $defaultLogoPath = public_path('website/img/logo/logo.png'); @endphp @if($company && $company->logo && file_exists($logoPath)) @else @endif
{{ $company->name }}
Tel: {{ $company->phone }}
Email: {{ $company->email }}
Invoice #{{ $companyCustomerInvoice->ref_no }}
Date Issues: {{ \Carbon\Carbon::parse($companyCustomerInvoice->from_date)->format('M d Y') }}
Date Due: {{ \Carbon\Carbon::parse($companyCustomerInvoice->to_date)->format('M d Y') }}

Invoice From
Name: {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->company? $companyCustomerInvoice->companyCustomer->company->name: '': '' }}
Phone: {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->company? $companyCustomerInvoice->companyCustomer->company->phone: '': '' }}
Email: {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->company? $companyCustomerInvoice->companyCustomer->company->email: '': '' }}
Invoice To:
Name: {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->names: '' }}
Phone: {{ $companyCustomerInvoice->companyCustomer? $companyCustomerInvoice->companyCustomer->phone: '' }}
Account Number: {{ $companyCustomerInvoice->ref_no }}

Item
{{ $companyCustomerInvoice->companyCustomerServicePlan? $companyCustomerInvoice->companyCustomerServicePlan->companyServicePlan? $companyCustomerInvoice->companyCustomerServicePlan->companyServicePlan->name: '': '' }}
Description
Payment for the "{{ $companyCustomerInvoice->companyCustomerServicePlan? $companyCustomerInvoice->companyCustomerServicePlan->companyServicePlan? $companyCustomerInvoice->companyCustomerServicePlan->companyServicePlan->name: '': '' }}" service plan for the period spanning from {{ \Carbon\Carbon::parse($companyCustomerInvoice->from_date)->format('M d Y') }} to {{ \Carbon\Carbon::parse($companyCustomerInvoice->to_date)->format('M d Y') }}
Cost
Ksh {{ number_format($companyCustomerInvoice->amount, 2) }}
@if($companyCustomerInvoice->status == 0 && $companyCustomerInvoice->companyCustomerServicePlan && $companyCustomerInvoice->companyCustomerServicePlan->companyRouter && $companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount && $companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->payment_method_id != "")
Payment Instructions
@if($companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->mpesa_type_id == 2)
M-PESA Paybill: {{ $companyCustomerInvoice->companyCustomerServicePlan? $companyCustomerInvoice->companyCustomerServicePlan->companyRouter? $companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount? $companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->phone_paybill_till_number: '': '': '' }}
Account Number: {{ $companyCustomerInvoice->ref_no }}
Amount: Ksh {{ number_format($companyCustomerInvoice->amount) }}
@else
@if($companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->mpesa_type_id == 1) Phone: @elseif($companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->mpesa_type_id == 3) Till Number @else Paybil Number @endif {{ $companyCustomerInvoice->companyCustomerServicePlan->companyRouter->CompanyPaymentAccount->phone_paybill_till_number?? '' }}
Account Number: {{ $companyCustomerInvoice->ref_no }}
Amount: Ksh {{ number_format($companyCustomerInvoice->amount) }}
@endif
@else
Payments @foreach($companyCustomerInvoice->companyCustomerInvoicePayments as $companyCustomerInvoicePayment) @endforeach
Ref No:
Payment Mode:
Amount:
Transaction Code:
Date Paid:
{{ $companyCustomerInvoicePayment->companyGroupedTransaction? $companyCustomerInvoicePayment->companyGroupedTransaction->ref_no: '' }}
{{ $companyCustomerInvoicePayment->companyGroupedTransaction? $companyCustomerInvoicePayment->companyGroupedTransaction->paymentMode? $companyCustomerInvoicePayment->companyGroupedTransaction->paymentMode->name: '': '' }}
{{ number_format($companyCustomerInvoicePayment->amount) }}
{{ $companyCustomerInvoicePayment->companyGroupedTransaction? $companyCustomerInvoicePayment->companyGroupedTransaction->transaction_code: '' }}
{{ \Carbon\Carbon::parse($companyCustomerInvoicePayment->created_at)->format('M d Y') }}
@endif