@extends('garage.layouts.app') @section('title', 'Vouchers') @section('content')
@if($type || $status || $fromDate || $toDate || $search) Clear @endif
@forelse($vouchers as $voucher) @empty @endforelse
Voucher No Date Type Narration Amount Status Actions
{{ $voucher->voucher_no }} {{ \Carbon\Carbon::parse($voucher->voucher_date)->format('M d, Y') }} @php $typeColors = [ 'journal' => 'primary', 'receipt' => 'success', 'payment' => 'danger', 'contra' => 'info' ]; $typeColor = $typeColors[$voucher->voucher_type] ?? 'secondary'; @endphp {{ ucfirst($voucher->voucher_type) }}
{{ \Illuminate\Support\Str::limit($voucher->narration ?? 'No narration', 50) }}
@if($voucher->reference_no) Ref: {{ $voucher->reference_no }} @endif
PKR {{ number_format($voucher->total_amount, 2) }} @php $statusColors = [ 'draft' => 'warning', 'posted' => 'success', 'cancelled' => 'danger' ]; $statusColor = $statusColors[$voucher->status] ?? 'secondary'; @endphp {{ ucfirst($voucher->status) }}
@if(in_array($voucher->status, ['draft','posted'])) @endif @if($voucher->status === 'draft')
@csrf @method('DELETE')
@endif
No vouchers found
@if($vouchers->hasPages())
{{ $vouchers->links() }}
@endif
@endsection