From 11c88968ad5ceffa87a1c585ae49d380105fe6ce Mon Sep 17 00:00:00 2001 From: Omair Saleh Date: Tue, 24 Jan 2023 06:15:48 +0800 Subject: [PATCH] customer support interface --- .../views/pages/customer_support.blade.php | 119 +++++++++--------- 1 file changed, 61 insertions(+), 58 deletions(-) diff --git a/resources/views/pages/customer_support.blade.php b/resources/views/pages/customer_support.blade.php index 6b420e0f..31c870dd 100644 --- a/resources/views/pages/customer_support.blade.php +++ b/resources/views/pages/customer_support.blade.php @@ -34,7 +34,7 @@ $primaryEmployee = $employees->first(); $identification = $company->documents->whereIn('document_type', \App\Classes\ValueObjects\Constants\DocumentType::IDENTIFICATION_DOCUMENTS)->first() @endphp -
+

Customer Account

Marking: {{$company->reference}}

Account Type: {{$company->type === 1 ? 'Business' : 'Personal'}}

@@ -44,71 +44,74 @@

Phone: {{$company->contacts->pluck('phone')->implode(', ')}}

Registration Date: {{$company->created_at->format('d-m-Y')}}

-
+

Customer Verification

Email Verification Status: {{ $primaryEmployee->status === 2 ? 'Verified' : 'Pending Verification'}}

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

@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'}}

- @if($payments)

Payment History:

@endif - @foreach($payments as $payment) - @php - $bill = $payment->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::BILL)->first(); - $transferProof = null; - $status = 'Pending Submission'; +
+

Customer Bookings

+ @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'}}

+ @if($payments)

Payment History:

@endif + @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) { - if($bill->status === 1) { - $status = 'Pending Transfer Proof'; + if($payment->status === 1) { + $status = 'Pending Approval'; } - if(in_array($bill->status, [2, 3])) { - $status = 'Transfer Complete'; - $transferProof = $bill->documents()->first(); + if($payment->status === 2) { + $status = 'Pending Confirmation'; } - } - @endphp -
-

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

-

Status: {{$status}}

-

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

- @if($bill) -

Supplier: {{$bill->issuerCompany->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 -
+ if(in_array($payment->status, [4, 5])) { + $status = 'Rejected/Failed Payment'; + } + + if($bill) { + 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->original_currency->short_code}}

+

Status: {{$status}}

+

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

+ @if($bill) +

Supplier: {{$bill->issuerCompany->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) @@ -117,7 +120,7 @@ $purchaseOrder = $booking->transactions()->where('type', \App\Classes\ValueObjects\Constants\TransactionType::PURCHASE_ORDER)->first(); @endphp
-

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

+

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'}}

@@ -153,7 +156,7 @@ } @endphp -
+

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

Status: {{$status}}

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