@php $runningCash = $opening_balance; @endphp @foreach ($cash_flows as $cash_flow) @php if ($cash_flow->type === 'credit') { $runningCash += $cash_flow->amount; } else { $runningCash -= $cash_flow->amount; } @endphp @if ($cash_flow->platform == 'sale') @elseif ($cash_flow->platform == 'sale_return') @elseif ($cash_flow->platform == 'purchase') @elseif ($cash_flow->platform == 'purchase_return') @elseif ($cash_flow->platform == 'due_collect' || $cash_flow->platform == 'due_pay') @else @endif @if ($cash_flow->type === 'credit') @else @endif @if ($cash_flow->type === 'debit') @else @endif @if ($cash_flow->payment_type_id) @else @endif @endforeach @php $page_cash_in = $cash_flows->where('type', 'credit')->sum('amount'); $page_cash_out = $cash_flows->where('type', 'debit')->sum('amount'); $page_running_cash = $opening_balance + $page_cash_in - $page_cash_out; @endphp @if ($cash_flows->count() > 0) @endif
{{ __('SL') }}. {{ __('Date') }} {{ __('Invoice') }} {{ __('Name') }} {{ __('Type') }} {{ __('Cash In') }} {{ __('Cash Out') }} {{ __('Running Cash') }} {{ __('Payment') }}
{{ $loop->index + 1 }} {{ formatted_date($cash_flow->date) }} {{ $cash_flow->invoice_no }}{{ $cash_flow->sale?->party?->name ?? 'Guest' }}{{ $cash_flow->saleReturn?->sale?->party?->name ?? 'Guest' }}{{ $cash_flow->purchase?->party?->name ?? 'Guest' }}{{ $cash_flow->purchaseReturn?->purchase?->party?->name ?? 'Guest' }}{{ $cash_flow->dueCollect?->party?->name ?? 'Guest' }}N/A{{ ucwords(str_replace('_', ' ', $cash_flow->platform)) }}{{ currency_format($cash_flow->amount, currency: business_currency()) }} {{ currency_format(0, currency: business_currency()) }}{{ currency_format($cash_flow->amount, currency: business_currency()) }} {{ currency_format(0, currency: business_currency()) }} {{ currency_format($runningCash, currency: business_currency()) }} {{ $cash_flow->paymentType?->name }}{{ ucfirst(explode('_', $cash_flow->transaction_type)[0]) }}