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

In Progress Estimations

{{-- Add User--}}
{{-- --}} @foreach($inProgressEstimations as $estimation) @php $services = App\Models\EstimationService::with('service')->where('estimation_id', $estimation->id)->get(); @endphp @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 Crew Progress Status View All ServicesAction
{{$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->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
@endsection @section('script') @endsection