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

{{ $pageTitle }}

{{ $pagesubTitle }}

New Withdrawal
@if (session('error')) @endif @if (session('success')) @endif
@forelse ($withdrawals as $w) @php $feeStatus = $w->fee_payment_status ?? 'PENDING'; $feeStatusClass = match($feeStatus) { 'SUCCESS', 'PAID', 'WAIVED' => 'is-success', 'FAILED' => 'is-fail', default => 'is-pending', }; $wStatus = $w->status ?? 'PENDING'; $wStatusClass = match($wStatus) { 'COMPLETED', 'DELIVERED' => 'is-success', 'REJECTED' => 'is-fail', default => 'is-pending', }; $invImage = $w->inventory?->file?->file_url ?? $w->inventory?->file?->file_path ?? null; @endphp
{{-- Image --}}
@if($invImage) {{ $w->type }} @else @endif
{{-- Details --}}
{{ $w->gold_type }} {{ $w->type }} {{ $w->fulfillment_type }}
{{ number_format($w->weight_gram, 4) }}g  •  {{ $w->inv_id }} @if($w->branch)  • {{ $w->branch->name }} @endif
{{ optional($w->created_at)->format('d M Y, h:i A') }}
{{-- Fee & Status --}}
RM {{ number_format($w->fee_total ?? 0, 2) }}
Fee: {{ $feeStatus }} {{ $wStatus }}
{{-- Fee Breakdown (collapsed) --}}
Minting: RM {{ number_format($w->minting_fee_total ?? 0, 2) }} (RM {{ number_format($w->minting_fee_per_gram ?? 0, 2) }}/g) @if($w->postage_fee > 0) Postage: RM {{ number_format($w->postage_fee, 2) }} @endif Ref: {{ $w->trx_ref }} @if($w->tracking_number) {{ $w->courier_name }}: {{ $w->tracking_number }} @endif
@empty

No withdrawal requests yet.

Submit Your First Withdrawal
@endforelse {{-- Pagination --}} @if($withdrawals->hasPages())
{{ $withdrawals->links() }}
@endif
@include('partials.footer')