@extends('layouts.app')
@section('title', __('Vouchers'))
@section('content')<div class="row g-3"><div class="col-lg-4"><div class="card"><div class="card-body p-4"><h6>{{ __('Create Voucher') }}</h6><form method="POST" action="{{ route('vouchers.store') }}">@csrf<select name="type" class="form-select mb-2"><option value="receipt">{{ __('Receipt Voucher') }}</option><option value="payment">{{ __('Payment Voucher') }}</option><option value="journal">{{ __('Journal Voucher') }}</option></select><input name="voucher_date" type="date" class="form-control mb-2" value="{{ now()->toDateString() }}"><input name="party_name" class="form-control mb-2" placeholder="{{ __('Party Name') }}"><input name="account_name" class="form-control mb-2" placeholder="{{ __('Account') }}"><input name="amount" type="number" step="0.01" class="form-control mb-2" placeholder="{{ __('Amount') }}" required><select name="currency_code" class="form-select mb-2">@foreach($currencies as $currency)<option value="{{ $currency->code }}" @selected($currency->is_default)>{{ $currency->code }}</option>@endforeach</select><textarea name="description" class="form-control mb-2" placeholder="{{ __('Description') }}"></textarea><button class="btn btn-success w-100">{{ __('Save Voucher') }}</button></form></div></div></div><div class="col-lg-8"><div class="card"><div class="card-body"><table class="table"><thead><tr><th>#</th><th>{{ __('Date') }}</th><th>{{ __('Type') }}</th><th>{{ __('Party') }}</th><th>{{ __('Amount') }}</th></tr></thead><tbody>@foreach($vouchers as $voucher)<tr><td>{{ $voucher->voucher_number }}</td><td>{{ $voucher->voucher_date->format('d M Y') }}</td><td>{{ ucfirst($voucher->type) }}</td><td>{{ $voucher->party_name }}</td><td>{{ number_format($voucher->amount,2) }} {{ $voucher->currency_code }}</td></tr>@endforeach</tbody></table>{{ $vouchers->links('pagination::bootstrap-5') }}</div></div></div></div>@endsection
