@php $setting = app('general_setting'); $chartAccount = Modules\Account\Entities\ChartAccount::where('contactable_type', 'App\User')->where('contactable_id', @$staffDetails->user->id)->first(); if ($chartAccount && $chartAccount->transactions()->exists()) { $transactions = $chartAccount->transactions()->Approved()->get(); } $currentBalance = 0 + $staffDetails->opening_balance; @endphp
@isset($transactions) @foreach ($transactions as $key => $payment) @if ($payment->type == "Cr") @php $currentBalance -= $payment->amount; @endphp @else @php $currentBalance += $payment->amount; @endphp @endif @endforeach @endisset
{{ __('account.Date') }} {{ __('account.Description') }} {{ __('account.Debit') }} {{ __('account.Credit') }} {{ __('account.Balance') }}
{{ __('account.Openning Balance') }} {{ single_price($currentBalance) }}
{{ showDate(@$payment->voucherable->date) }} {{ @$payment->voucherable->narration }} @if ($payment->type == "Dr") {{ single_price($payment->amount) }} @endif @if ($payment->type == "Cr") {{ single_price($payment->amount) }} @endif {{ single_price($currentBalance) }}
{{ __('account.Current Balance') }} {{ single_price($currentBalance) }}