@extends('layouts.app') @section('content')

Chart of Accounts — Tree

Table View Add Root Account
@if (session('success'))
{{ session('success') }}
@endif @if (session('error'))
{{ session('error') }}
@endif
@php $render = function($node) use (&$render, $project) { $hasChildren = $node->children->isNotEmpty(); echo '
  • '; if ($hasChildren) { echo '
    '; echo ''. e($node->code) .''. e($node->name) .''; echo '
      '; foreach ($node->children as $child) { $render($child); } echo '
    '; } else { echo '
    '. e($node->code) .''. e($node->name) .''; echo ''. number_format($node->balance, 2) .''; echo 'Edit'; echo 'Add
    '; } echo '
  • '; }; @endphp
      @foreach($roots as $root) @php $render($root); @endphp @endforeach
    Tips
    • Click a group to expand/collapse its child accounts.
    • Use “Add” to create a child under a selected account.
    • Switch to table view for bulk actions and balances.
    @endsection