@foreach ($items as $key => $item) @php $total_debit = 0; $total_credit = 0; $opening_amount = $item->account_opening; $debit = $item->journals->sum('debit'); $credit = $item->journals->sum('credit'); if ($item->account == 'debit') { $total_debit = $debit + $opening_amount; } else { $total_credit = $credit + $opening_amount; } @endphp @endforeach
@lang('SL') @lang('Account Name') @lang('Account Type') @lang('Total Debit') @lang('Total Credit') @lang('Balance')
{{ ($items->currentpage() - 1) * $items->perpage() + $key + 1 }} {{ $item->name }} {{ $item->type_name }} {{ numberformat($total_debit) }} {{ numberformat($total_credit) }} @if ($item->account == 'debit') {{ numberformat($total_debit - $total_credit) }} @else {{ numberformat($total_credit - $total_debit) }} @endif
@if ($items instanceof \Illuminate\Pagination\LengthAwarePaginator) {{ $items->links('layouts.paginate') }} @endif