@php $initialLines = collect(old('lines', [ ['account' => '', 'debit' => '', 'credit' => '', 'description' => '', 'department_id' => ''], ['account' => '', 'debit' => '', 'credit' => '', 'description' => '', 'department_id' => ''], ]))->values()->map(fn ($line, $index) => [ 'key' => $index, 'account' => (string) ($line['account'] ?? ''), 'debit' => (string) ($line['debit'] ?? ''), 'credit' => (string) ($line['credit'] ?? ''), 'description' => (string) ($line['description'] ?? ''), 'department_id' => (string) ($line['department_id'] ?? ''), ])->all(); $accountGroups = $accounts ->groupBy(fn ($account) => $account->account_type_label) ->map(fn ($group) => $group->mapWithKeys(fn ($account) => [$account->code => $account->code.' · '.$account->name])); @endphp @if ($errors->any())
The entry could not be saved
    @foreach ($errors->all() as $error)
  • {{ $error }}
  • @endforeach
@endif
@csrf
Debits Credits Balanced Out of balance
Cancel