diff --git a/resources/views/pages/customer_support.blade.php b/resources/views/pages/customer_support.blade.php index bead34f1..713bb3a5 100644 --- a/resources/views/pages/customer_support.blade.php +++ b/resources/views/pages/customer_support.blade.php @@ -50,7 +50,76 @@

Identification Verification Status: {{$identification ? ($identification->status === 2 ? 'Verified' : 'Pending Verification') : 'Not Submitted'}}

@endif + @if($booking) + @php + $payments = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PAYMENT)->get(); + $purchaseOrder = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PURCHASE_ORDER)->first(); + @endphp +
+

Booking Reference: {{$booking->marking}}

+

Amount: {{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}

+

Status: {{$booking->status === 3 ? 'Complete' : 'In Progress'}}

+

Purchase Order Status: {{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}

+ @foreach($payments as $payment) + @php + $bill = $payment->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::BILL)->first(); + $transferProof = null; + $status = 'Pending Submission'; + + if($payment->status === 1) { + $status = 'Pending Approval'; + } + + if($payment->status === 2) { + $status = 'Pending Confirmation'; + } + + if(in_array($payment->status, [4, 5])) { + $status = 'Rejected/Failed Payment'; + } + + if($bill->status === 1) { + $status = 'Pending Transfer Proof'; + } + + if(in_array($bill->status, [2, 3])) { + $status = 'Transfer Complete'; + $transferProof = $bill->documents()->first(); + } + + @endphp +

Amount: {{$payment->original_amount.' '.$payment->originalCurrency->short_code}}

+

Status: {{$status}}

+

Payment Date: {{$payment->created_at->format('d-m-Y')}}

+ @if($bill) +

Supplier: {{$bill->issuer->name}}

+

Supplier Order Date: {{$bill->created_at->format('d-m-Y')}}

+ @if($transferProof)

Transfer Proof Upload Date: {{$transferProof->created_at->format('d-m-Y')}}

@endif + @endif + @endforeach +
+ @endif + @if(!$booking) + @php + $bookings = $company->bookings->whereIn('status', [2, 3])->get(); + @endphp +
+ @foreach($bookings as $booking) + @php + $payments = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PAYMENT)->get(); + $purchaseOrder = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PURCHASE_ORDER)->first(); + @endphp +
+

Booking Reference: {{$booking->marking}}

+

Amount: {{$booking->fix_amount.' '.$booking->fixedCurrency->short_code}}

+

Status: {{$booking->status === 3 ? 'Complete' : 'In Progress'}}

+

Purchase Order Status: {{$purchaseOrder ? ($purchaseOrder->status === 3 ? 'Approved' : ($purchaseOrder->status === 1 ? 'Pending Approval' : 'Incomplete Submission')) : 'Pending Submission'}}

+ +
+ @endforeach +
+ @endif