@extends('layouts.app')
@section('title', __('nav.sub_accounts'))
@section('content')
<div class="alert alert-info">{{ __('messages.accounts_for_companies') }}</div>
<div class="d-flex justify-content-between mb-3"><h1 class="h4">{{ __('nav.sub_accounts') }}</h1>@can('accounts.create')<a class="btn btn-success" href="{{ route('sub-accounts.create') }}">{{ __('messages.create') }}</a>@endcan</div>
<div class="card"><table class="table mb-0"><thead><tr><th>{{ __('messages.name') }}</th><th>{{ __('messages.code') }}</th><th>{{ __('messages.main_account') }}</th><th></th></tr></thead>
<tbody>@forelse($accounts as $a)<tr><td><a href="{{ route('sub-accounts.show',$a) }}">{{ $a->name }}</a></td><td>{{ $a->code }}</td><td>{{ $a->mainAccount?->name }}</td><td><a href="{{ route('sub-accounts.edit',$a) }}">{{ __('messages.edit') }}</a></td></tr>@empty<tr><td colspan="4">{{ __('messages.no_results') }}</td></tr>@endforelse</tbody></table>
@include('partials.pagination', ['paginator' => $accounts])
</div>
@endsection
