@php $pagecount = count($transactionsChunk); $current = 1; @endphp @if ($pagecount === 0)

{{ session('active-company-name') }}

{{ __('Ledger Report') }}

{{ __('Account') }}: {{ $subject->formattedName() }}

تاریخ گزارش: {{ formatDate(now()) }}

صفحه: {{ formatNumber($current) }} از {{ formatNumber($pagecount) }}

{{ __('Document') }} {{ __('Date') }} {{ __('Description') }} {{ __('Debit') }} {{ __('Credit') }} {{ __('Balance') }}

{{ __('No transactions available.') }}

@else @foreach ($transactionsChunk as $transactions)

{{ session('active-company-name') }}

{{ __('Ledger Report') }}

{{ __('Account') }}: {{ $subject->formattedName() }}

تاریخ گزارش: {{ formatDate(now()) }}

صفحه: {{ formatNumber($current) }} از {{ formatNumber($pagecount) }}

@php $balance = 0; @endphp @foreach ($transactions as $transaction) @php $debit = $transaction->value < 0 ? -1 * $transaction->value : 0; $credit = $transaction->value > 0 ? $transaction->value : 0; $balance += $credit - $debit; @endphp @endforeach
{{ __('Document') }} {{ __('Date') }} {{ __('Description') }} {{ __('Debit') }} {{ __('Credit') }} {{ __('Balance') }}
{{ formatNumber($transaction->document?->number) }} {{ formatMinimalDate($transaction->document?->date) }} {{ $transaction->desc }}{{ formatNumber($debit) }} {{ formatNumber($credit) }} {{ formatNumber($balance) }}
@php $current++; @endphp @endforeach @endif