dbfdg @extends('layouts.admin') @section('page-title') {{ __('Ledger Summary') }} @endsection @section('breadcrumb') @endsection @push('script-page') @endpush @section('action-btn')
{{-- --}}
@endsection @php $selectAcc = [[ "id" => 0, "code" => '', "name" => "Select", "parent" => 0, ]]; $accounts = array_merge($selectAcc, $accounts); @endphp @section('content')
{{ Form::open(['route' => ['report.ledger'], 'method' => 'GET', 'id' => 'report_ledger']) }}
{{ Form::label('start_date', __('Start Date'), ['class' => 'form-label']) }} {{ Form::date('start_date', $filter['startDateRange'], ['class' => 'month-btn form-control']) }}
{{ Form::label('end_date', __('End Date'), ['class' => 'form-label']) }} {{ Form::date('end_date', $filter['endDateRange'], ['class' => 'month-btn form-control']) }}
{{ Form::label('account', __('Account'), ['class' => 'form-label']) }} {{-- {{ Form::select('account', $accounts, isset($_GET['account']) ? $_GET['account'] : '', ['class' => 'form-control select']) }} --}}
{{ Form::close() }}
{{--
{{ __('Report') }} :
{{ __('Ledger Summary') }}
{{ __('Duration') }} :
{{ $filter['startDateRange'] . ' to ' . $filter['endDateRange'] }}
--}} {{-- @if (!empty($account))
{{ __('Account Name') }} :
{{ $account->name }}
{{ __('Account Code') }} :
{{ $account->code }}
{{ __('Total Debit') }} :
{{ \Auth::user()->priceFormat($filter['debit']) }}
{{ __('Total Credit') }} :
{{ \Auth::user()->priceFormat($filter['credit']) }}
{{ __('Balance') }} :
{{ $filter['balance'] > 0 ? __('Cr') . '. ' . \Auth::user()->priceFormat(abs($filter['balance'])) : __('Dr') . '. ' . \Auth::user()->priceFormat(abs($filter['balance'])) }}
@endif --}}
@php $balance = 0; $totalDebit = 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 @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) }}
@endsection