@extends('layouts.app') @section('title', $chartOfAccount ? 'Edit Chart of Account' : 'Add Chart of Account') @php $coaTypes = \App\Models\PC\ChartOfAccount::TYPE_VALUES; $typeOptions = array_combine($coaTypes, $coaTypes); $parentSelectOptions = $parentOptions->mapWithKeys(fn ($r) => [$r->id => $r->code.' — '.$r->title])->all(); @endphp @section('contents')
@csrf @if ($chartOfAccount) @method('PUT') @endif

{{ $chartOfAccount ? 'Edit Chart of Account' : 'Add Chart of Account' }}

@if (canField('chart_of_account', 'code', 'view'))
@elseif ($chartOfAccount) @endif @if (canField('chart_of_account', 'title', 'view'))
@error('title') {{ $message }} @enderror
@elseif ($chartOfAccount) @endif

Hierarchy is optional; parent is not restricted by field permissions (system field).

@if (canField('chart_of_account', 'label', 'view'))
@elseif ($chartOfAccount) @endif @if (canField('chart_of_account', 'budget_type', 'view'))
@elseif ($chartOfAccount) @endif @if (canField('chart_of_account', 'types', 'view'))
@elseif ($chartOfAccount) @endif @if (canField('chart_of_account', 'sort_order', 'view'))
@elseif ($chartOfAccount) @endif
@endsection @push('scripts') @endpush