@extends('admin.layouts.app') @section('section')

Completed Estimations

{{-- Add User--}}
{{-- --}} @foreach($completedEstimations as $estimation) @if($estimation->user) @else @endif @if($estimation->user) @else @endif @foreach($estimation->emailUser->where('type', 'userPayment') as $email) @php $serviceTotalFees = json_decode($email->content) @endphp @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 @endforeach @foreach($estimation->emailUser->where('type', 'crewVisit') as $email) @php $crewName = json_decode($email->content) @endphp @endforeach {{-- --}} @endforeach()
ID Service Of User User Name User Email Service Total Payment Service Remaining Payment Crew Name Status ViewAction
{{$estimation->id ?? ''}} @if($estimation->services->count() > 1 || $estimation->others != null) Multiple @elseif($estimation->services->count() == 1) {{$estimation->services->first()->title}} @endif {{$estimation->user->name ?? ''}}{{$estimation->first_name .' '. $estimation->last_name ?? ''}}{{$estimation->user->email ?? ''}}{{$estimation->email ?? ''}}${{$serviceTotalFees->serviceTotalFees ?? ''}} @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 {{$crewName->crewName ?? ''}}{{$estimation->status ?? ''}}--}} {{-- --}} {{--
@endsection @section('script') @endsection