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

User Payments

@foreach($payments as $payment) @if($payment->estimation->user) @else @php $user = DB::table('users')->where('email', $payment->estimation->email)->first(); @endphp @endif @foreach($payment->estimation->emailUser->where('type', '==', 'userPayment') as $email) @php $serviceTotalFees = json_decode($email->content) @endphp @endforeach @foreach($payment->estimation->emailUser->where('type', '==', 'userPayment') as $email) @php $serviceTotalFees = json_decode($email->content) @endphp @endforeach @endforeach
Estimation ID Name Email Service Payment Type Service Total Payment Transaction Amount Remaining Amount Status Transaction Date
{{$payment->estimation->id}}{{$payment->estimation->user->name ?? ''}} {{$payment->estimation->user->email ?? ''}}{{$user->name ?? ''}} {{$user->email ?? ''}} @if($payment->estimation->services->count() > 1 || $payment->estimation->others != null) multiple @elseif($payment->estimation->services->count() == 1) {{$payment->estimation->services->first()->title ?? ''}} @endif {{$payment->payment_type ?? ''}}${{$serviceTotalFees->serviceTotalFees ?? ''}}${{$payment->payment_transaction ?? ''}} @if($payment->payment_type == 'remaining_payment') ${{$serviceTotalFees->serviceAdvanceFees - $payment->payment_transaction ?? ''}} @else ${{$serviceTotalFees->serviceTotalFees - $payment->payment_transaction ?? ''}} @endif {{$payment->status ?? ''}} {{$payment->created_at->diffForHumans() ?? ''}}
@endsection @section('script') @endsection