@include('partials.head', ['title' => $pageTitle])
@include('partials.sidebar')
@include('partials.navbar')

{{ $pageTitle }}

{{ $pagesubTitle }}

Back to History
@if (session('error')) @endif @php $isWalkIn = $withdrawal->fulfillment_type === 'WALK_IN'; $wStatus = $withdrawal->status ?? 'PENDING'; $statusBadges = [ 'COMPLETED' => 'is-success', 'DELIVERED' => 'is-success', 'PROCESSING' => 'is-pending', 'SHIPPED' => 'is-pending', 'READY_FOR_PICKUP' => 'is-pending', 'PENDING' => 'is-pending', 'REJECTED' => 'is-fail', 'CANCELLED' => 'is-fail', ]; $statusClass = $statusBadges[$wStatus] ?? 'is-pending'; $statusLabel = ucwords(strtolower(str_replace('_', ' ', $wStatus))); $statusIcon = match ($statusClass) { 'is-success' => 'fa-solid fa-circle-check', 'is-fail' => 'fa-solid fa-circle-xmark', default => 'fa-solid fa-clock', }; $feeStatus = $withdrawal->fee_payment_status ?? 'PENDING'; $feeStatusBadges = [ 'SUCCESS' => 'is-success', 'PAID' => 'is-success', 'WAIVED' => 'is-success', 'FAILED' => 'is-fail', ]; $feeStatusClass = $feeStatusBadges[$feeStatus] ?? 'is-pending'; $invImage = $withdrawal->inventory?->file?->file_url ?? $withdrawal->inventory?->file?->file_path ?? null; @endphp
Withdrawal Receipt

YAPEIM GOLD

Withdrawal {{ $statusLabel }}
Ref: {{ $withdrawal->trx_ref }}

Date & Time {{ optional($withdrawal->created_at)->format('d M Y, h:i A') }}
Customer Name {{ $user->user_name }}
Account ID {{ $withdrawal->user_id_no }}
Collection Method {{ $isWalkIn ? 'Walk-In Collection' : 'Online Postage' }}
Fee Payment Status {{ ucfirst(strtolower($feeStatus)) }}
@if ($withdrawal->tracking_number)
Tracking No. {{ $withdrawal->courier_name ? $withdrawal->courier_name . ' — ' : '' }}{{ $withdrawal->tracking_number }}
@endif

{{ $isWalkIn ? 'Pickup Location' : 'Delivery Address' }}
@if ($isWalkIn)
Branch {{ $withdrawal->branch->name ?? '-' }}
Address {{ collect([$withdrawal->branch->address ?? null, $withdrawal->branch->city ?? null, $withdrawal->branch->state ?? null, $withdrawal->branch->postcode ?? null])->filter()->implode(', ') ?: '-' }}
@else
Recipient {{ $withdrawal->recipient_name ?: '-' }}
Phone {{ $withdrawal->recipient_phone ?: '-' }}
Shipping Address {{ collect([$withdrawal->shipping_address, $withdrawal->shipping_postcode, $withdrawal->shipping_city, $withdrawal->shipping_state])->filter()->implode(', ') ?: '-' }}
@endif

Gold Item Details
@if ($invImage) {{ $withdrawal->type }} @else @endif
Gold {{ $withdrawal->gold_type }} {{ $withdrawal->type ?: 'Gold Item' }}
{{ $withdrawal->inv_id }}
Weight {{ number_format($withdrawal->weight_gram, 2) }} g
Minting Fee RM {{ number_format($withdrawal->minting_fee_total, 2) }} (RM {{ number_format($withdrawal->minting_fee_per_gram, 2) }}/g)
@if (!$isWalkIn)
Postage (Courier Base) RM {{ number_format($withdrawal->postage_base_fee, 2) }}
@if ($withdrawal->is_takaful && $withdrawal->takaful_fee_total > 0)
Takaful Protection RM {{ number_format($withdrawal->takaful_fee_total, 2) }} (RM {{ number_format($withdrawal->takaful_fee_per_gram, 2) }}/g)
@endif @endif
Total Fee Paid RM {{ number_format($withdrawal->fee_total, 2) }}

This is a system-generated receipt and is valid without a signature or stamp. Printed on {{ now()->format('d M Y, h:i A') }}.

@include('partials.footer')