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

{{ $customer->user_name ?: '-' }}

{{ $customer->user_email ?: '-' }}
{{ $customer->ekyc_flag ? 'eKYC Verified' : 'eKYC Pending' }}
{{-- 1. Account Information --}}
Account Information
Full Name
{{ $customer->user_name ?: '-' }}
Email Address
{{ $customer->user_email ?: '-' }}
User ID (ID No)
{{ $customer->user_id ?: '-' }}
ID Type
{{ $customer->id_type ?: '-' }}
Referral Code
{{ $customer->referral_code ?: '-' }}
Referrer / Introducer
@if ($referrer) {{ $referrer->user_name }} ({{ $customer->referrer_code }}) @elseif ($customer->referrer_code) {{ $customer->referrer_code }} @elseif (optional($customer->details)->introducer_id) {{ $customer->details->introducer_id }} @else - @endif
eKYC Attempt(s)
{{ $customer->ekyc_attempt ?? '0' }}
Email Verified At
{{ $customer->email_verified_at ? \Carbon\Carbon::parse($customer->email_verified_at)->format('d M Y, h:i A') : 'Not verified' }}
Registered On
{{ $customer->created_at ? \Carbon\Carbon::parse($customer->created_at)->format('d M Y, h:i A') : '-' }}

{{-- 2. Personal Information --}}
Personal Information
@if ($customer->details)
Mobile Number
{{ $customer->details->mobile_no ?: ($customer->details->mobileno ?: '-') }}
Gender
{{ $customer->details->gender === 'P' || strtolower($customer->details->gender) === 'female' ? 'Female' : ($customer->details->gender === 'L' || strtolower($customer->details->gender) === 'male' ? 'Male' : ($customer->details->gender ?: '-')) }}
Race
{{ $customer->details->race_id ?: '-' }}
Religion
{{ $customer->details->religion_id ?: '-' }}
Marital Status
{{ $customer->details->maritial_id ?: '-' }}

{{-- 3. Address Information --}}
Address Information
Full Address
{{ $customer->details->address1 ?: '-' }} @if ($customer->details->address2)
{{ $customer->details->address2 }} @endif @if ($customer->details->address3)
{{ $customer->details->address3 }} @endif
Postcode
{{ $customer->details->postcode ?: '-' }}
City
{{ $customer->details->city ?: '-' }}
State
{{ optional($customer->details->stateInfo)->shortname ?: (optional($customer->details->stateInfo)->name ?: ($customer->details->state ?: '-')) }}
Country
{{ optional($customer->details->countryInfo)->name ?: ($customer->details->country ?: '-') }}

{{-- 4. Demographic, Employment & Tax Information --}}
Employment & Income Information
Occupation
{{ optional($customer->details->occupation)->desc ?: ($customer->details->occupation_id ?: '-') }}
Type of Industry
{{ optional($customer->details->industry)->desc ?: ($customer->details->industry_id ?: '-') }}
Primary Source of Income
{{ optional($customer->details->sourceIncome)->desc ?: ($customer->details->primary_income_id ?: '-') }}
Estimated Yearly Income
{{ optional($customer->details->yearlyIncome)->desc ?: ($customer->details->yearly_income_id ?: '-') }}
Tax Identification Number (TIN)
{{ $customer->details->tin ?: '-' }}
US Person / IRS Declaration
@if ($customer->details->irs) Yes (US Person) @else No @endif
@else

No personal details on file for this customer.

@endif
{{-- 5. Bank Account Information --}}
Bank Account Information
@if ($customer->bank)
Bank Name
{{ optional($customer->bank->bankInfo)->bank_name ?: ($customer->bank->bank_acct_code ?: '-') }}
Account Type
{{ optional($customer->bank->acctType)->description ?: ($customer->bank->bank_acct_type ?: '-') }}
Account Number
{{ $customer->bank->account_no ?: '-' }}
@else

No bank account linked to this customer yet.

@endif

Gold Wallet

@if ($customer->goldwallet) Wallet ID: {{ $customer->goldwallet->id ?: '-' }} @endif
@if ($customer->goldwallet)
Gold Balance (999)
{{ number_format((float) $customer->goldwallet->current_gold_gram_999, 4) }} g
Previous: {{ number_format((float) $customer->goldwallet->prev_gold_gram_999, 4) }} g
Gold Balance (916)
{{ number_format((float) $customer->goldwallet->current_gold_gram_916, 4) }} g
Previous: {{ number_format((float) $customer->goldwallet->prev_gold_gram_916, 4) }} g
Cash Balance
RM {{ number_format((float) $customer->goldwallet->current_cash_balance, 2) }}
Previous: RM {{ number_format((float) $customer->goldwallet->prev_cash_balance, 2) }}
@else

No gold wallet found for this customer.

@endif

Recent Transactions

@forelse ($customer_transactions as $trx) @empty @endforelse
Trx Ref Type Amount (RM) Weight (g) Payment Method Status Date
{{ $trx->trx_ref }}
{{ $trx->transaction_type ?: '-' }}
{{ number_format((float) $trx->trx_amount, 2) }}
{{ number_format((float) $trx->total_weight_gram, 4) }}
{{ $trx->payment_method ?: '-' }}
@php $trxStatusKey = strtolower($trx->transaction_status ?? ''); $trxStatusVariant = in_array($trxStatusKey, [ 'success', 'completed', 'approved', ]) ? 'success' : (in_array($trxStatusKey, [ 'failed', 'rejected', 'cancelled', ]) ? 'danger' : (in_array($trxStatusKey, [ 'pending', 'processing', ]) ? 'warning' : 'neutral')); @endphp {{ $trx->transaction_status ?? '-' }}
{{ $trx->created_at ? \Carbon\Carbon::parse($trx->created_at)->format('d M Y, h:i A') : '-' }}
No transactions found for this customer.

Gold Withdrawal Requests

@forelse ($customer_withdrawals as $w) @empty @endforelse
Trx Ref / Inv ID Item Withdrawn Gold Purity Weight Fulfillment / Branch Fees (MYR) Status Request Date
{{ $w->trx_ref }} @if ($w->inv_id) Inv: {{ $w->inv_id }} @endif
{{ $w->type ?: ($w->inventory->type ?? 'Gold Item') }}
{{ $w->gold_type ?: ($w->inventory->gold_type ?? '999.9') }}
{{ number_format((float) ($w->weight_gram ?: ($w->inventory->weight ?? 0)), 4) }} g
@if ($w->branch) {{ $w->branch->name }} @elseif ($w->fulfillment_type == 'POSTAGE') Postage Delivery @else {{ $w->fulfillment_type ?: 'Walk-in Collection' }} @endif
MYR {{ number_format((float) ($w->fee_total ?? $w->minting_fee_total ?? 0), 2) }} @if ($w->minting_fee_total > 0) Minting: {{ number_format((float) $w->minting_fee_total, 2) }} @endif
@php $wStatus = strtoupper($w->status ?? ''); @endphp @if (in_array($wStatus, ['APPROVED', 'COMPLETED', 'PICKED_UP', 'PICKED UP', 'SUCCESS'])) {{ $w->status }} @elseif (in_array($wStatus, ['PENDING', 'IN_TRANSIT', 'RECEIVED'])) {{ $w->status }} @elseif (in_array($wStatus, ['CANCEL', 'CANCELLED', 'FAIL', 'FAILED', 'REJECTED'])) {{ $w->status }} @else {{ $w->status ?: 'PENDING' }} @endif
{{ $w->created_at ? \Carbon\Carbon::parse($w->created_at)->format('d M Y, h:i A') : '-' }}
No gold withdrawal requests recorded for this customer.
@endsection @section('styles') @endsection @section('scripts') @endsection