@extends('layouts.app') @section('content') @php $hasCatalogFilters = collect(request()->filters ?? []) ->filter(fn ($value) => $value !== null && $value !== '') ->isNotEmpty() || filled(request()->s) || filled(request()->sortBy) || filled(request()->order); @endphp

{{ $contractor ? 'Редактирование подрядчика' : 'Добавление подрядчика' }}

@if(session('success')) @endif @if(session('contractor_import_errors')) @endif @if($errors->any()) @endif
@csrf @include('partials.input', ['name' => 'name', 'title' => 'Наименование подрядчика', 'required' => true, 'value' => $contractor->name ?? '']) @include('partials.input', ['name' => 'legal_name', 'title' => 'Юридическое имя', 'required' => true, 'value' => $contractor->legal_name ?? '']) @include('partials.input', ['name' => 'contract_number', 'title' => '№ договора', 'required' => true, 'value' => $contractor->contract_number ?? '']) @include('partials.input', ['name' => 'contract_date', 'title' => 'Дата договора', 'type' => 'date', 'required' => true, 'value' => optional($contractor?->contract_date)->format('Y-m-d')]) @include('partials.input', ['name' => 'director_name', 'title' => 'ФИО руководителя', 'required' => true, 'value' => $contractor->director_name ?? '']) @include('partials.select', ['name' => 'organization_form', 'title' => 'Форма организации', 'required' => true, 'options' => $organizationForms, 'value' => $contractor->organization_form ?? null, 'first_empty' => true]) @include('partials.select', ['name' => 'tax_rate', 'title' => 'Налог', 'required' => true, 'options' => $taxRates, 'value' => $contractor->tax_rate ?? null, 'first_empty' => true]) @include('partials.textarea', ['name' => 'contract_header', 'title' => 'Шапка в договоре', 'required' => true, 'size' => 8, 'value' => $contractor->contract_header ?? ''])
hidden ?? false))>
@include('partials.submit', ['name' => 'Сохранить', 'back_url' => $back_url ?? route('contractors.index')])
@if($contractor)
Год каталога: {{ $catalogYear }}
@csrf
@include('partials.table', [ 'id' => 'contractor_prices', 'header' => $priceHeader, 'strings' => $priceRows, 'searchFields' => $priceSearchFields, 'sortBy' => $priceSortBy, 'orderBy' => $priceOrderBy, 'filters' => $priceFilters, 'ranges' => $priceRanges, 'dates' => [], 'enableColumnFilters' => true, 'nav' => $nav ?? null, ])
@endif
@endsection @push('scripts') @endpush