@extends('layouts.master') @section('title', 'Balance Sheet') @section('content')

Balance Sheet


{{-- --}} @php $count = 1; $debitTotal = 0; $creatidTotal = 0; $priority = ''; $priorityRow = 0; $sectionTotal = 0; $nonCurrentAssets = 0; $currentAssets = 0; $ownerEquity = 0; $currentLiabilities = 0; $nonCurrentLiabilities = 0; $retainAdd=0; $retainAdd2=0; $accountType = ''; @endphp @foreach ($balanceSheet as $value) @if ($priority == '' || $priority != $value->priority) @php $priorityRow = 1; if ($priorityRow == 1 && $priority != '') { if ($priority != $value->priority) { @endphp @if ($priority == '7' && $retainAdd==0) @php $retainAdd=1; @endphp @endif @php echo " '; $accountType = $value->account_type; if ($priority == '1') { $nonCurrentAssets = $sectionTotal; } elseif ($priority == '2') { $currentAssets = $sectionTotal; } elseif ($priority == '7') { $ownerEquity = $sectionTotal; } elseif ($priority == '8') { $currentLiabilities = $sectionTotal; } elseif ($priority == '9') { $nonCurrentLiabilities = $sectionTotal; } $sectionTotal = 0; if ($priority == '2') { echo " '; } } } $priority = $value->priority; if ($priorityRow == 1) { $priorityRow = 0; echo " "; } @endphp @endif {{-- --}} @if ($priority == '1' || $priority == '2') @php $sectionTotal += $value->debit - $value->credit; @endphp @elseif ($priority == '8' || $priority == '9' || $priority == '7') @php $sectionTotal += $value->credit - $value->debit; if($retainAdd2 == 0) { $sectionTotal += $pAndL; $retainAdd2 = 1; } @endphp @endif @php $accountType = $value->account_type; if ($priority == '1') { $nonCurrentAssets = $sectionTotal; } elseif ($priority == '2') { $currentAssets = $sectionTotal; } elseif ($priority == '7') { $ownerEquity = $sectionTotal; } elseif ($priority == '8') { $currentLiabilities = $sectionTotal; } elseif ($priority == '9') { $nonCurrentLiabilities = $sectionTotal; } @endphp @endforeach @if ($retainAdd == 0) @php echo " '; $retainAdd=1; @endphp '; @else '; @endif
#DateAccount Code Description Amount
{{ $count++ }} - Retained Earnings {{ number_format($pAndL, 2, '.', ',') }}
Total $accountType :" . number_format($sectionTotal, 2, '.', ',') . '
Total Current Assets & Non-Current Assets :" . number_format($nonCurrentAssets+$currentAssets, 2, '.', ',') . '
$value->account_type
{{ $count++ }}{{ $value->date }}{{ $value->acc_code }} {{ $value->acc_name }}{{ number_format($value->debit - $value->credit, 2, '.', ',') }}{{ number_format($value->credit - $value->debit, 2, '.', ',') }}
Owner equity
{{ $count++ }} - Retained Earnings {{ number_format($pAndL, 2, '.', ',') }}
Total Owner equity :" . number_format($pAndL, 2, '.', ',') . '
Total Equity, Current Liabilities & Non-Current Liabilities :{{ number_format($ownerEquity+$currentLiabilities+$nonCurrentLiabilities, 2, '.', ',') }}
Total Equity, Current Liabilities & Non-Current Liabilities :{{ number_format($ownerEquity+$currentLiabilities+$nonCurrentLiabilities, 2, '.', ',') }}
@endsection