@php $display = 1; // dumper($result); @endphp @if (auth()->user()->user_type == 'emp') @php $roleId = auth()->user()->role_id; $routeNames = empPermissions($roleId); @endphp @endif @if (isset($routeNames)) @if (!in_array('Account Reports', $routeNames)) @php $display = 0; @endphp @endif @endif @extends('office-panel.office_layouts.app') @section('content')

{{ __('sidebar.add_transaction') }}

{{ date('F Y') }}

{!! Form::open(['route' => 'ledger.create', 'method' => 'get', 'id' => 'form-search12']) !!} {!! Form::close() !!} {{-- Tabs for Account Types --}} @if (isset($officeAccountType) && count($officeAccountType) < 1)

{{ __('common.data_not_found') }}

@endif {{-- Tab Panes --}}
@foreach ($officeAccountType as $key => $accountType) {{-- {{ $accountType->account_type_id }} --}}
{{-- Opening / Closing Balance --}}
{{ __('common.opening_balance') }}: {{ $accountType->currency }} {{ formatNumber($accountType->opening_balance) }}   |   {{ __('common.closing_balance') }}: {{ $accountType->currency }} {{ formatNumber($accountType->closing_balance) }}
{{-- Form --}} {!! Form::open([ 'route' => 'ledger.store', 'method' => 'post', 'class' => 'add-transaction-form ajax-submit', // 'id' => 'ajax-submit', ]) !!} {!! Form::hidden('account_type_id', $accountType->account_type_id) !!}
{!! Form::label('type', __('common.transaction_type')) !!} {!! Form::select('transaction_type', accountTransactionTypes(), null, [ 'class' => 'form-control select2', ]) !!}
{{--
{!! Form::label('amount', __('common.amount')) !!} {!! Form::text('amount', null, ['class' => 'form-control']) !!}
--}}
{!! Form::label('amount', __('common.amount')) !!}
{{ $accountType->currency }} {!! Form::text('amount', null, ['class' => 'form-control']) !!}
{!! Form::label('notes', __('common.notes')) !!} {!! Form::text('notes', null, ['class' => 'form-control']) !!}

{!! Form::close() !!}
@endforeach
{{-- here i add pagination --}} @if ($display == 1)
{{ date('F Y') . ' Transactions' }}
{{-- --}} @if (isset($result) && count($result) > 0) @php $i = pageIndex($result); @endphp @foreach ($result as $key => $row) {{-- cash in --}} @if ($row->transaction_type == 1) {{-- cash out --}} @elseif ($row->transaction_type == 0) @endif {{-- --}} @endforeach @else @endif
{{ __('common.sr_no') }} {{ __('common.account_type') }} {!! __('common.cash_in') !!} {!! __('common.cash_out') !!}{!! __('common.closing_balance') !!}{{ __('common.notes') }} {!! __('common.created_at') !!}
{!! $i++ !!} {!! $row->account_type_name !!}{!! $row->currency !!} {!! formatNumber($row->amount) !!} {!! $row->currency !!} {!! formatNumber($row->amount) !!}{!! $row->closing_balance !!}{!! $row->notes !!} {!! dateFormat($row->created_at, DISPLAY_DATETIME) !!}
{!! $result->links('pagination::bootstrap-4') !!}
{!! pageDetail($result) !!}
{!! __('common.no_records') !!}
@endif @endsection @section('bottom_script') {{-- --}} @endsection