@extends('layouts.admin') @section('page-title') {{ __('Ledger Summary') }} @endsection @section('breadcrumb') @endsection @push('script-page') @endpush @section('action-btn')
@endsection @section('content')
{{ Form::open(['route' => ['report.ledger'], 'method' => 'GET', 'id' => 'report_ledger']) }}
{{ Form::label('start_date', __('Start Date'), ['class' => 'text-type']) }} {{ Form::date('start_date', $filter['startDateRange'], ['class' => 'month-btn form-control']) }}
{{ Form::label('end_date', __('End Date'), ['class' => 'text-type']) }} {{ Form::date('end_date', $filter['endDateRange'], ['class' => 'month-btn form-control']) }}
{{ Form::label('account', __('Account'), ['class' => 'text-type']) }} {{-- {{ Form::select('account',$accounts,isset($_GET['account'])?$_GET['account']:'', array('class' => 'form-control select')) }} --}}
{{ Form::close() }}
@php $balance = 0; $debit = 0; $credit = 0; $totalCredit = 0; $accountArrays = []; foreach ($chart_accounts as $key => $account) { $chartDatas = App\Models\Utility::getAccountData($account['id'], $filter['startDateRange'], $filter['endDateRange']); $chartDatas = $chartDatas->toArray(); $accountArrays[] = $chartDatas; } @endphp @foreach ($accountArrays as $accounts) @foreach ($accounts as $account) @if ($account->reference == 'Invoice') @php $total = $account->debit + $account->credit; $balance += $total; $totalCredit += $total; @endphp @endif @if ($account->reference == 'Invoice Payment') @php $total = $account->debit + $account->credit; $balance -= $total; @endphp @endif @if ($account->reference == 'Revenue') @php $total = $account->debit + $account->credit; $balance += $total; @endphp @endif @if ( $account->reference == 'Bill' || $account->reference == 'Bill Account' || $account->reference == 'Expense' || $account->reference == 'Expense Account') @if ($account->reference == 'Bill' || $account->reference == 'Bill Account') @php $total = $account->debit + $account->credit; $balance -= $total; @endphp @endif @if ($account->reference == 'Bill Payment' || $account->reference == 'Expense Payment') @if ($account->reference == 'Bill Payment') @php $total = $account->debit + $account->credit; $balance -= $total; @endphp @endif @if ($account->reference == 'Payment') @php $total = $account->debit + $account->credit; $balance -= $total; @endphp @endif @if ($account->reference == 'Journal') @php $total = $account->credit - $account->debit; $balance += $total; @endphp @endif @if ($account->reference == 'Bank Account') @php $total = $account->credit - $account->debit; $balance += $total; @endphp @endif @endforeach @endforeach
{{ __('Account Name') }} {{ __('Name') }} {{ __('Transaction Type') }} {{ __('Transaction Date') }} {{ __('Debit') }} {{ __('Credit') }} {{ __('Balance') }}
{{ $account->account_name }} {{ $account->user_name }} {{ \Auth::user()->invoiceNumberFormat($account->ids) }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }} {{ \Auth::user()->invoiceNumberFormat($account->ids) }}{{ __(' Manually Payment') }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }} {{ __(' Revenue') }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }}{{ \Auth::user()->billNumberFormat($account->ids) }} @else {{ \Auth::user()->expenseNumberFormat($account->ids) }} @endif {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }}{{ \Auth::user()->billNumberFormat($account->ids) }}{{ __(' Manually Payment') }} @else {{ \Auth::user()->expenseNumberFormat($account->ids) }}{{ __(' Manually Payment') }} @endif {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }} {{ __('Payment') }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ '-' }} {{ AUth::user()->journalNumberFormat($account->reference_id) }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
{{ $account->account_name }} {{ $account->user_name }} {{ AUth::user()->journalNumberFormat($account->reference_id) }} {{ $account->date }} {{ \Auth::user()->priceFormat($account->debit) }}{{ \Auth::user()->priceFormat($account->credit) }} {{ \Auth::user()->priceFormat($balance) }}
@endsection