@extends('layouts.app')
@section('title', 'Record Income')
@section('page_title', 'Record Income')
@section('breadcrumbs')
    <li class="breadcrumb-item"><a href="{{ route('journals.index') }}">Journals</a></li><li class="breadcrumb-item active">Income</li>
@endsection

@section('content')
    <div class="card"><div class="card-body">
        <form method="POST" action="{{ route('journals.income.store') }}">
            @csrf
            <div class="row g-3">
                <div class="col-md-3"><label class="form-label">Date</label>
                    <input type="date" name="date" value="{{ now()->format('Y-m-d') }}" class="form-control" required></div>
                <div class="col-md-5"><label class="form-label">Income Account (Credit)</label>
                    <select name="income_account_id" class="form-select" required>
                        @foreach($incomeAccounts as $a)<option value="{{ $a->id }}">{{ $a->label }}</option>@endforeach
                    </select></div>
                <div class="col-md-4"><label class="form-label">Deposit To (Debit)</label>
                    <select name="deposit_account_id" class="form-select" required>
                        @foreach($depositAccounts as $a)<option value="{{ $a->id }}">{{ $a->label }}</option>@endforeach
                    </select></div>
                <div class="col-md-3"><label class="form-label">Amount</label>
                    <input type="number" step="0.01" name="amount" class="form-control" required></div>
                <div class="col-md-6"><label class="form-label">Description</label>
                    <input type="text" name="description" class="form-control" required></div>
                <div class="col-md-3"><label class="form-label">Reference</label>
                    <input type="text" name="reference" class="form-control"></div>
            </div>
            <div class="mt-3"><button class="btn btn-success"><i class="bi bi-check-lg me-1"></i>Record Income</button>
                <a href="{{ route('journals.index') }}" class="btn btn-light border">Cancel</a></div>
        </form>
    </div></div>
@endsection
