|
@if($estimation->services->count() > 1 || $estimation->others != null)
Multiple
@elseif($estimation->services->count() == 1)
{{$estimation->services->first()->title ?? ''}}
@endif
|
{{$estimation->estimation_time ?? ''}} |
{{ $estimation->created_at->format('m/d/Y') ?? '' }} |
{{-- Show The Amount --}}
@foreach($estimation->emailUser->where('type', '==', 'userPayment') as $email)
@php
$emailContent = json_decode($email->content);
@endphp
$ {{$emailContent->serviceAdvanceFees ?? ''}} |
@endforeach
@foreach($estimation->emailUser->where('type', '==', 'userPayment') as $email)
@php
$emailContent = json_decode($email->content);
@endphp
$ {{$emailContent->serviceTotalFees ?? ''}} |
@endforeach
@foreach ($estimation->emailUser->where('type', 'userPayment') as $email)
@php
$emailContent = json_decode($email->content);
$estimationId = $estimation->id;
$filteredPayments = $estimation->userPayment->where('estimation_id', $estimationId)
->where('status', 'paid')
->pluck('payment_type')
->toArray();
@endphp
@if (in_array('advance_payment', $filteredPayments))
@if (in_array('remaining_payment', $filteredPayments))
$ 0
@elseif (in_array('full_payment', $filteredPayments))
$ 0
@else
$ {{ $emailContent->serviceTotalFees - $emailContent->serviceAdvanceFees ?? '' }}
@endif
@elseif (in_array('full_payment', $filteredPayments))
$ 0
@else
$ {{ $emailContent->serviceTotalFees ?? '' }}
@endif
|
@endforeach
{{-- Show The Payment Status --}}
@php
$hasFullPayment = false;
$hasAdvancePayment = false;
$hasRemainingPayment = false;
@endphp
@foreach($estimation->userPayment as $payment)
@if($payment->status == 'paid')
@if($payment->payment_type == 'full_payment')
@php
$hasFullPayment = true;
@endphp
@elseif($payment->payment_type == 'advance_payment')
@php
$hasAdvancePayment = true;
@endphp
@elseif($payment->payment_type == 'remaining_payment')
@php
$hasRemainingPayment = true;
@endphp
@endif
@endif
@endforeach
@if($hasFullPayment)
Paid
@elseif($hasAdvancePayment && $hasRemainingPayment)
Paid
@elseif($hasAdvancePayment)
Remaining Payment
@else
Pay
@endif
|
|
@else