@extends('layouts.app') @section('title', 'Rekod Kerusi Roda') @section('content')
Admin

Rekod Kerusi Roda

{{ $allocation->pusatMengundi?->code }} — {{ $allocation->pusatMengundi?->name }}

Kembali
@include('admin.management._nav') @php $taken = $service->takenQuantity($allocation); $returned = $service->returnedQuantity($allocation); $outstanding = $service->outstandingQuantity($allocation); $available = $service->availableQuantity($allocation); @endphp
@foreach ([ ['label' => 'Peruntukan', 'value' => $allocation->allocated_quantity, 'tone' => 'primary'], ['label' => 'Diambil', 'value' => $taken, 'tone' => 'info'], ['label' => 'Dipulang', 'value' => $returned, 'tone' => 'success'], ['label' => 'Belum dipulang', 'value' => $outstanding, 'tone' => 'warning'], ['label' => 'Baki boleh diambil','value' => $available, 'tone' => 'secondary'], ] as $card)
{{ $card['label'] }}
{{ $card['value'] }}
@endforeach
{{-- Kiri: 3 panel borang --}}
{{-- Kemaskini Peruntukan --}}

Kemaskini Peruntukan

@csrf @method('PATCH')
Minimum {{ $outstanding }} (kerusi belum dipulang).
@error('allocated_quantity')
{{ $message }}
@enderror
{{-- Rekod Ambil --}}

Rekod Ambil

Baki boleh diambil: {{ $available }}

@if ($available === 0)
Tiada baki kerusi roda untuk diambil.
@else
@csrf
Maks: {{ $available }}
@error('quantity')
{{ $message }}
@enderror
@error('taken_at')
{{ $message }}
@enderror
@error('taken_by_name')
{{ $message }}
@enderror
@endif
{{-- Rekod Pulang --}}

Rekod Pulang

Belum dipulang: {{ $outstanding }}

@if ($outstanding === 0)
Tiada kerusi roda yang perlu dipulangkan.
@else
@csrf
Maks: {{ $outstanding }}
@error('quantity')
{{ $message }}
@enderror
@error('returned_at')
{{ $message }}
@enderror
@error('returned_by_name')
{{ $message }}
@enderror
@error('return_condition')
{{ $message }}
@enderror
@endif
{{-- Kanan: Sejarah transaksi --}}
Sejarah Transaksi
@forelse ($allocation->transactions->sortByDesc('created_at') as $tx) @empty @endforelse
Jenis Jml Masa Nama Keadaan Direkod Oleh Nota
@if ($tx->transaction_type === 'taken') Ambil @else Pulang @endif {{ $tx->quantity }} {{ ($tx->taken_at ?? $tx->returned_at)?->format('d/m/Y H:i') ?? '-' }} @if ($tx->transaction_type === 'taken') {{ $tx->taken_by_name ?: '-' }} @else {{ $tx->returned_by_name ?: '-' }} @endif @if ($tx->transaction_type === 'returned' && $tx->return_condition) {{ ucfirst($tx->return_condition) }} @else @endif {{ $tx->recordedBy?->name ?: '-' }} {{ $tx->notes ?: '-' }}
Tiada transaksi direkodkan.
@endsection