@php $debitTotal = round(collect($lines)->sum(fn ($line) => (float) ($line['debit'] ?? 0)), 2); $creditTotal = round(collect($lines)->sum(fn ($line) => (float) ($line['credit'] ?? 0)), 2); $difference = round($debitTotal - $creditTotal, 2); @endphp
{{ __('app.accounts.opening.desc') }}
| {{ __('app.accounts.fields.account') }} | {{ __('app.accounts.fields.memo') }} | {{ __('app.accounts.fields.debit') }} | {{ __('app.accounts.fields.credit') }} |
|---|---|---|---|
| {{ $line->account?->code }} {{ $line->account?->localizedName() }} | {{ $line->memo ?: '—' }} | {{ (float) $line->debit > 0 ? number_format((float) $line->debit, 2) : '—' }} | {{ (float) $line->credit > 0 ? number_format((float) $line->credit, 2) : '—' }} |
| {{ __('app.accounts.vouchers.form.totals') }} | {{ number_format((float) $opening->lines->sum('debit'), 2) }} | {{ number_format((float) $opening->lines->sum('credit'), 2) }} | |