@extends('index') @section('content')
@csrf
Good job!
Good job!
@if(!empty($dfrom) && !empty($dto)) @endif @php $index = 1; $balance = $oBalance; @endphp @if($oBalance != 0) @endif @if($transaction->count()) @foreach($transaction as $item) @php $balance += $item->debit; $balance -= $item->credit; // For cash ledger, display as-is (debit=inflow, credit=outflow) $displayDebit = $item->debit; $displayCredit = $item->credit; @endphp @endforeach @endif @if($cBalance != 0) @endif
Date From: {{date("d-m-Y", strtotime($dfrom))}} Date To: {{date("d-m-Y", strtotime($dto))}}
Available Cash: Rs. {{number_format($cashBalance)}}
Sr. Date Transaction Transaction Type Debit Credit Balance Action
{{$index++}} {{\Carbon\Carbon::parse($dfrom)->format('d-m-Y')}} Opening Balance Opening Balance {{ $oBalance < 0 ? number_format(abs($oBalance)) : '' }} {{ $oBalance > 0 ? number_format(abs($oBalance)) : '' }} {{ number_format($oBalance) }}
{{$index++}} {{\Carbon\Carbon::parse($item->transaction_date)->format('d-m-Y')}} {{ucfirst($item->transaction_to)}} {{ucfirst($item->transaction_type)}} {{isset($displayDebit) ? number_format($displayDebit) : ''}} {{isset($displayCredit) ? number_format($displayCredit) : ''}} {{number_format($balance)}} @if($item->transaction_to == 'employee') View @elseif($item->transaction_to == 'vendor') View @elseif($item->transaction_to == 'expense') View @elseif($item->transaction_to == 'customer') View @else View @endif
{{$index++}} {{\Carbon\Carbon::parse($dto)->format('d-m-Y')}} Closing Balance Closing Balance {{ $cBalance < 0 ? number_format(abs($cBalance)) : '' }} {{ $cBalance > 0 ? number_format(abs($cBalance)) : '' }} {{ $balance ? number_format($balance += $cBalance) : number_format($oBalance + $cBalance) }}
Sr. Date Transaction Transaction Type Debit Credit Balance Action
@endsection