{{-- Add User--}}
| ID | Service Of User | User Name | User Email | Service Total Payment | Service Remaining Payment | Crew Name | Crew Progress | Status | View | All Services | {{--Action | --}}|||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| {{$estimation->id ?? ''}} | @if($estimation->services->count() > 1 || $estimation->others != null) Multiple @elseif($estimation->services->count() == 1) {{$estimation->services->first()->title}} @endif | @if($estimation->user){{$estimation->user->name ?? ''}} | @else{{$estimation->first_name .' '. $estimation->last_name ?? ''}} | @endif @if($estimation->user){{$estimation->user->email ?? ''}} | @else{{$estimation->email ?? ''}} | @endif @foreach($estimation->emailUser->where('type', 'userPayment') as $email) @php $serviceTotalFees = json_decode($email->content) @endphp${{$serviceTotalFees->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 @foreach($estimation->emailUser->where('type', 'crewVisit') as $email) @php $crewName = json_decode($email->content) @endphp{{$crewName->crewName ?? ''}} | @endforeach{{$estimation->crew_progress ?? ''}} | {{$estimation->status ?? ''}} | {{----}}
{{-- --}}
{{-- --}}
{{-- --}}
{{-- --}}
{{-- | --}}
@foreach($estimation->userPayment as $payment) @if($payment->payment_type == 'advance_payment' && $estimation->crew_progress == '90%') @endif @endforeach | {{----}} {{-- --}} {{-- @foreach($estimation->userPayment as $payment)--}} {{-- @if($payment->payment_type == 'advance_payment' && $estimation->crew_progress == '90%')--}} {{-- --}} {{-- @endif--}} {{-- @endforeach--}} {{-- | --}}@if($services->count() > 1) View All Services @else single @endif |