@extends('layouts.app')
@section('title','General Ledger')
@section('page_title','General Ledger')
@section('content')
<div class="page-head"><div><h1>General Ledger</h1><p>Drill down to every posted journal line.</p></div></div><div class="card"><div class="card-body"><form class="actions"><div class="field"><label>From</label><input class="control" type="date" name="from" value="{{ $from }}"></div><div class="field"><label>To</label><input class="control" type="date" name="to" value="{{ $to }}"></div><div class="field"><label>Account</label><select class="control" name="account_id"><option value="">All accounts</option>@foreach($accounts as $a)<option value="{{ $a->id }}" @selected(request('account_id')==$a->id)>{{ $a->code }} - {{ $a->name }}</option>@endforeach</select></div><button class="btn btn-primary" style="align-self:end">Run</button></form></div></div><div class="card" style="margin-top:18px"><div class="table-wrap"><table class="table"><thead><tr><th>Date</th><th>Journal</th><th>Account</th><th>Party</th><th>Description</th><th>Debit</th><th>Credit</th></tr></thead><tbody>@forelse($lines as $l)<tr><td>{{ $l->journalEntry->posting_date->format('d M Y') }}</td><td><a href="{{ route('journals.show',$l->journalEntry) }}">{{ $l->journalEntry->journal_number }}</a></td><td>{{ $l->account?->code }} - {{ $l->account?->name }}</td><td>{{ $l->party?->legal_name }} {{ $l->party_ledger }}</td><td>{{ $l->description }}</td><td>{{ number_format((float)$l->debit,2) }}</td><td>{{ number_format((float)$l->credit,2) }}</td></tr>@empty<tr><td colspan="7" class="empty">No transactions.</td></tr>@endforelse</tbody></table></div>{{ $lines->links() }}</div>
@endsection
