@extends('layouts.app', ['pageTitle' => 'Journal Entries', 'pageSubtitle' => 'Post manual debit and credit entries'])
@section('content')
<div class="card"><h3 class="section-title">Post Manual Journal</h3><form method="POST" action="{{ route('admin.journals.store') }}" class="form-grid">@csrf
<div class="field"><label>Entry Date</label><input type="date" name="entry_date" value="{{ date('Y-m-d') }}" required></div><div class="field"><label>Debit Account</label><select name="debit_account_id" required>@foreach($accounts as $a)<option value="{{ $a->id }}">{{ $a->code }} - {{ $a->name }}</option>@endforeach</select></div><div class="field"><label>Credit Account</label><select name="credit_account_id" required>@foreach($accounts as $a)<option value="{{ $a->id }}">{{ $a->code }} - {{ $a->name }}</option>@endforeach</select></div><div class="field"><label>Amount</label><input type="number" step="0.01" name="amount" required></div><div class="field"><label>Reference</label><input name="reference"></div><div class="field"><label>Memo</label><input name="memo" required></div><div><button class="btn" type="submit">Post Journal</button></div></form></div>
<div class="card"><h3 class="section-title">Recent Journals</h3><div class="table-wrap"><table><thead><tr><th>No</th><th>Date</th><th>Reference</th><th>Memo</th><th>Source</th><th>Status</th></tr></thead><tbody>@foreach($journals as $j)<tr><td>{{ $j->entry_number }}</td><td>{{ $j->entry_date }}</td><td>{{ $j->reference }}</td><td>{{ $j->memo }}</td><td>{{ $j->source_type }}</td><td><span class="badge">{{ $j->status }}</span></td></tr>@endforeach</tbody></table></div></div>
@endsection
