@extends('layouts.master') @section('title', 'Account Ledger') @section('page-header') Account Ledger @stop @push('style') @endpush @section('content')
@include('partials._alert_message')

@yield('page-header')

@include('includes.input-groups.select-group', ['modelVariable' => 'accounts', 'edit_id' => request('account_id'), 'is_required' => true])
@include('includes.input-groups.date-range', ['date1' => request('from',date('Y-m-d')), 'date2' => request('to',date('Y-m-d')), 'is_read_only' => true])
@if (request('account_id')) @php if ($selected_account->accountGroup->balance_type == 'Debit') { $balance = ($debit_balance + $paginate_debit_balance) - ($credit_balance + $paginate_credit_balance); } else { $balance = ($credit_balance + $paginate_credit_balance) - ($debit_balance + $paginate_debit_balance); } @endphp @else @endif @php $total_debit = 0; $total_credit = 0; $total_balance = 0; @endphp @foreach ($transactions as $transaction) @php if ($selected_account->accountGroup->balance_type == 'Debit') { $total_balance = $balance += ($transaction->debit_amount - $transaction->credit_amount); } else { $total_balance = $balance += ($transaction->credit_amount - $transaction->debit_amount); } $total_debit += $transaction->debit_amount; $total_credit += $transaction->credit_amount; @endphp @endforeach @if($transactions->currentPage() == $transactions->lastPage()) @endif
Sl Date Voucher No Description Dr. Cr. Balance
Opening Balance {{ number_format($balance, 2) }}
NO RECORDS FOUND!
{{ $loop->iteration }} {{ $transaction->date }} {{ $transaction->invoice_no }} {{ $transaction->description }} {{ number_format($transaction->debit_amount, 2) }} {{ number_format($transaction->credit_amount, 2) }} {{ number_format($balance, 2) }}
Total In Page {{ number_format($total_debit, 2) }} {{ number_format($total_credit, 2) }}
Grand Total {{ number_format($grand_total_debit_balance, 2) }} {{ number_format($grand_total_credit_balance, 2) }}
Balance {{ number_format($total_balance, 2) }}
@include('partials._paginate', ['data' => $transactions])
@endsection @section('js') @endsection