{{-- Inställningar (DESIGN.md Page patterns 5, Account and settings; #2957 slice 6a, card #3020). Rendered by account.edit (the customer's own company) and admin.company.edit (any company, admin only). Package as a tile row plus the receiver usage bar, the package chooser (a native select replacing the ionRangeSlider), the company details form and card payment; the admin route adds comments, the abandoned/spam marker, extra fields, extra services and campaign codes as cards below. Admin navigation is provided by the shared shell. Params from CompanyController@edit: $company, $packages, $min_receiver, $package_index, $card, $disable. --}} @extends('layouts.nuhet') @php $isAdminRoute = request()->routeIs('admin.company.edit'); $pageTitle = $isAdminRoute ? $company->name : (request('tab') === 'company' ? __('company.nh.detailsTitle') : __('company.nh.subscriptionTitle')); $unpaidInvoice = $company->invoices()->where('paid', 0)->where('duedate', '<', \Carbon\Carbon::now()->subMinute())->first(); $requestedCompanyTab = request()->query('tab'); $initialCompanyTab = in_array($requestedCompanyTab, ['subscription', 'company', 'payment', 'administration'], true) ? $requestedCompanyTab : (request()->has('invoicePage') ? 'payment' : 'subscription'); @endphp @section('_pageTitle', $pageTitle) @section('pagename', $pageTitle) @section('page')

{{ $pageTitle }}

{{ $isAdminRoute ? __('company.nh.adminLead') : __('company.nh.lead') }}

@if ($isAdminRoute && Auth::user()->company_id != $company->id) @can('_companyOverride')
{{ __('company.overrideLogin') }}
@endcan @endif
@if ($isAdminRoute) @else @include('partials.nh-account-tabs') @endif @if ($isAdminRoute) @endif @if ($unpaidInvoice) {{ __('company.form.unpaidInvoiceBox') }} {{ __('company.nh.unpaidAction') }} @endif @if (request()->routeIs('admin.company.edit'))
@include('company.partials.design-rollout')
@endif @include('company.partials.editForm', [ 'company' => $company, 'packages' => $packages, 'min_receiver' => $min_receiver, 'package_index' => $package_index, 'card' => $card ?? null, 'disable' => $disable, 'isAdminRoute' => $isAdminRoute, ]) @if ($isAdminRoute)
@include('company.partials.comments', [ 'data' => $company->comments()->with(['author' => fn ($query) => $query->withTrashed()])->orderBy('sticky', 'desc')->orderBy('created_at', 'desc')->get(), ]) @if (Auth::user()->hasRole('superadmin') || Auth::user()->hasRole('admin')) @include('company.partials.abandonedSpam') @endif @include('company.partials.props', ['props' => $company->props]) @if ($company->package->monthly_cost > 0) {{-- Extra services are only available to paying customers --}} @include('company.partials.extraServices') @endif @include('company.partials.campaignCodes', ['campaignCodes' => $company->campaignCodes])
@endif
@endsection @push('scripts') @endpush