@php
$isEdit = isset($entry);
$lines = old('account_id') ? null : ($entry->lines ?? collect());
@endphp
{{ __('reports.gl_manage.journal.lines') }}
@if($errors->has('lines'))
{{ $errors->first('lines') }}
@endif
| {{ __('reports.columns.account') }} |
{{ __('reports.gl_manage.columns.memo') }} |
{{ __('reports.columns.debit') }} |
{{ __('reports.columns.credit') }} |
|
@php
$rowsCount = 0;
@endphp
@if(old('account_id'))
@foreach(old('account_id') as $i => $accId)
@php $rowsCount++; @endphp
@include('admin.gl.journal._line_row', [
'i' => $i,
'accounts' => $accounts,
'accountId' => $accId,
'memo' => old('memo.' . $i),
'debit' => old('debit.' . $i),
'credit' => old('credit.' . $i),
])
@endforeach
@else
@foreach(($entry->lines ?? collect()) as $i => $line)
@php $rowsCount++; @endphp
@include('admin.gl.journal._line_row', [
'i' => $i,
'accounts' => $accounts,
'accountId' => $line->account_id,
'memo' => $line->description,
'debit' => $line->debit,
'credit' => $line->credit,
])
@endforeach
@endif
@for($i = $rowsCount; $i < max(2, $rowsCount); $i++)
@include('admin.gl.journal._line_row', [
'i' => $i,
'accounts' => $accounts,
'accountId' => null,
'memo' => null,
'debit' => null,
'credit' => null,
])
@endfor
| {{ __('reports.labels.totals') }} |
0.00 |
0.00 |
|
@if(!$isEdit)
@endif
@include('admin.gl.journal._line_row', [
'i' => 999999,
'accounts' => $accounts,
'accountId' => null,
'memo' => null,
'debit' => null,
'credit' => null,
'template' => true,
])