@if(array_key_exists('account_code', $report->getHeaders())) @else @endif @foreach($report->getCategories() as $accountCategory) @foreach($accountCategory->data as $categoryAccount) @foreach($categoryAccount as $accountIndex => $categoryAccountCell) @if(is_array($categoryAccountCell) && isset($categoryAccountCell['name'])) @if($categoryAccountCell['name'] === 'Retained Earnings' && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date'])) {{ $categoryAccountCell['name'] }} @elseif(isset($categoryAccountCell['id']) && isset($categoryAccountCell['start_date']) && isset($categoryAccountCell['end_date'])) {{ $categoryAccountCell['name'] }} @else {{ $categoryAccountCell['name'] }} @endif @else {{ $categoryAccountCell }} @endif @endforeach @endforeach @foreach($accountCategory->types as $accountType) @foreach($accountType->header as $accountTypeHeaderIndex => $accountTypeHeaderCell) {{ $accountTypeHeaderCell }} @endforeach @foreach($accountType->data as $typeAccount) @foreach($typeAccount as $accountIndex => $typeAccountCell) @if(is_array($typeAccountCell) && isset($typeAccountCell['name'])) @if($typeAccountCell['name'] === 'Retained Earnings' && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date'])) {{ $typeAccountCell['name'] }} @elseif(isset($typeAccountCell['id']) && isset($typeAccountCell['start_date']) && isset($typeAccountCell['end_date'])) {{ $typeAccountCell['name'] }} @else {{ $typeAccountCell['name'] }} @endif @else {{ $typeAccountCell }} @endif @endforeach @endforeach @foreach($accountType->summary as $accountTypeSummaryIndex => $accountTypeSummaryCell) {{ $accountTypeSummaryCell }} @endforeach @endforeach @foreach($accountCategory->summary as $accountCategorySummaryIndex => $accountCategorySummaryCell) {{ $accountCategorySummaryCell }} @endforeach @endforeach