From 7b29b39f35a5ec9e3c663b00ccc8a6251d4a33b2 Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 24 Jan 2023 06:02:56 +0800 Subject: [PATCH] customer support interface --- .../views/pages/customer_support.blade.php | 101 +++++++++++++++++- 1 file changed, 100 insertions(+), 1 deletion(-) diff --git a/resources/views/pages/customer_support.blade.php b/resources/views/pages/customer_support.blade.php index 6a353141..3d1e8bdb 100644 --- a/resources/views/pages/customer_support.blade.php +++ b/resources/views/pages/customer_support.blade.php @@ -51,12 +51,111 @@ @if(!$booking) @php - $bookings = $company->bookings->whereIn('status', [2, 3])->get(); + $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'}}

+ @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 +
+ @endforeach +
@endif @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--}}