{{-- div for Company --}} {{ $trialbalanceLoadTableArr['company']->name }}
{{ $trialbalanceLoadTableArr['company']->address }}
Trial Balance
As on {{ date('jS F, Y',strtotime($trialbalanceLoadTableArr['dateTo'])) }}
{{-- div for Reporting Info --}}
Project Name:     {{$trialbalanceLoadTableArr['projectName']}} Reporting Date :     {{date('d-m-Y',strtotime($trialbalanceLoadTableArr['dateFrom']))." to ".date('d-m-Y',strtotime($trialbalanceLoadTableArr['dateTo']))}}
Project Type:       {{$trialbalanceLoadTableArr['projectType']}} Print Date:       {{\Carbon\Carbon::now()->format('d-m-Y g:i A')}}
Branch Name:     {{$trialbalanceLoadTableArr['branchName']}}

{{-- Extra column for Notes --}} @foreach ($firstLevelLedgers as $key => $ledgerFirst) @php $secondLedgers = $secondLevelLedgers->where('parentId', $ledgerFirst->id)->pluck('id')->toArray(); $secondLedgers = $thirdLevelLedgers->whereIn('parentId', $secondLedgers)->pluck('id')->toArray(); $secondLedgers = $fourthLevelLedgers->whereIn('parentId', $secondLedgers)->pluck('id')->toArray(); $secondLedgers = $ledgerWiseData->whereIn('parentId', $secondLedgers); @endphp @foreach ($secondLevelLedgers->where('parentId', $ledgerFirst->id) as $key => $ledgerSecond) @php $thirdLedgers = $thirdLevelLedgers->where('parentId', $ledgerSecond->id)->pluck('id')->toArray(); $thirdLedgers = $fourthLevelLedgers->whereIn('parentId', $thirdLedgers)->pluck('id')->toArray(); $thirdLedgers = $ledgerWiseData->whereIn('parentId', $thirdLedgers); @endphp @foreach ($thirdLevelLedgers->where('parentId', $ledgerSecond->id) as $key => $ledgerThird) @php $fourthLedgers = $fourthLevelLedgers->where('parentId', $ledgerThird->id)->pluck('id')->toArray(); $fourthLedgers = $ledgerWiseData->whereIn('parentId', $fourthLedgers); @endphp @if ($fourthLevelLedgers->where('parentId', $ledgerThird->id)->count() > 0) @foreach ($fourthLevelLedgers->where('parentId', $ledgerThird->id) as $key => $ledgerFourth) @php $finalLedgers = $ledgerWiseData->where('parentId', $ledgerFourth->id); @endphp @if ($ledgerWiseData->where('parentId', $ledgerFourth->id)->count() > 0) @foreach ($ledgerWiseData->where('parentId', $ledgerFourth->id) as $key => $ledgerFinal) @endforeach @endif @endforeach @endif @endforeach @endforeach @endforeach @php $totalOpDebit = $totalBalanceArr['totalOpDebit']; $totalOpCredit = $totalBalanceArr['totalOpCredit']; $totalCurrentDebit = $totalBalanceArr['totalCurrentDebit']; $totalCurrentCredit = $totalBalanceArr['totalCurrentCredit']; $totalCumulativeDebit = $totalBalanceArr['totalCumulativeDebit']; $totalCumulativeCredit = $totalBalanceArr['totalCumulativeCredit']; if ($roundUp == 1) { $totalOpDebit = round($totalOpDebit); $totalOpCredit = round($totalOpCredit); $totalCurrentDebit = round($totalCurrentDebit); $totalCurrentCredit = round($totalCurrentCredit); $totalCumulativeDebit = round($totalCumulativeDebit); $totalCumulativeCredit = round($totalCumulativeCredit); } @endphp {{-- Extra column for Notes --}}
Particulars NotesBalance at the begining During this period Closing Balance (Cumulative)
Dr Cr Dr Cr Dr Cr
{{ strtoupper($ledgerFirst->name) }} [{{ $ledgerFirst->code }}] {{ number_format($secondLedgers->sum('openingDebit'), 2) }} {{ number_format($secondLedgers->sum('openingCredit'), 2) }} {{ number_format($secondLedgers->sum('currentPeriodDebitAmount'), 2) }} {{ number_format($secondLedgers->sum('currentPeriodCreditAmount'), 2) }} {{ number_format($secondLedgers->sum('cumulativeDebitAmount'), 2) }} {{ number_format($secondLedgers->sum('cumulativeCreditAmount'), 2) }}
{{ strtoupper($ledgerSecond->name) }} [{{ $ledgerSecond->code }}] {{ number_format($thirdLedgers->sum('openingDebit'), 2) }} {{ number_format($thirdLedgers->sum('openingCredit'), 2) }} {{ number_format($thirdLedgers->sum('currentPeriodDebitAmount'), 2) }} {{ number_format($thirdLedgers->sum('currentPeriodCreditAmount'), 2) }} {{ number_format($thirdLedgers->sum('cumulativeDebitAmount'), 2) }} {{ number_format($thirdLedgers->sum('cumulativeCreditAmount'), 2) }}
{{ strtoupper($ledgerThird->name) }} [{{ $ledgerThird->code }}] {{ number_format($fourthLedgers->sum('openingDebit'), 2) }} {{ number_format($fourthLedgers->sum('openingCredit'), 2) }} {{ number_format($fourthLedgers->sum('currentPeriodDebitAmount'), 2) }} {{ number_format($fourthLedgers->sum('currentPeriodCreditAmount'), 2) }} {{ number_format($fourthLedgers->sum('cumulativeDebitAmount'), 2) }} {{ number_format($fourthLedgers->sum('cumulativeCreditAmount'), 2) }}
{{ strtoupper($ledgerFourth->name) }} [{{ $ledgerFourth->code }}] {{ number_format($finalLedgers->sum('openingDebit'), 2) }} {{ number_format($finalLedgers->sum('openingCredit'), 2) }} {{ number_format($finalLedgers->sum('currentPeriodDebitAmount'), 2) }} {{ number_format($finalLedgers->sum('currentPeriodCreditAmount'), 2) }} {{ number_format($finalLedgers->sum('cumulativeDebitAmount'), 2) }} {{ number_format($finalLedgers->sum('cumulativeCreditAmount'), 2) }}
{{ $ledgerFinal['name'] }} [{{ $ledgerFinal['code'] }}] {{ number_format($ledgerFinal['openingDebit'], 2) }} {{ number_format($ledgerFinal['openingCredit'], 2) }} {{ number_format($ledgerFinal['currentPeriodDebitAmount'], 2) }} {{ number_format($ledgerFinal['currentPeriodCreditAmount'], 2) }} {{ number_format($ledgerFinal['cumulativeDebitAmount'], 2) }} {{ number_format($ledgerFinal['cumulativeCreditAmount'], 2) }}
Total {{ number_format($totalOpDebit, 2) }} {{ number_format($totalOpCredit, 2) }} {{ number_format($totalCurrentDebit, 2) }} {{ number_format($totalCurrentCredit, 2) }} {{ number_format($totalCumulativeDebit, 2) }} {{ number_format($totalCumulativeCredit, 2) }}
@if ($withZero == 0) @endif