@extends('layouts.admin') @section('main-content') @php $survey_count = $survey_count + 1; $phone = $selected_task->process->contact_phone ? $selected_task->process->contact_phone : $selected_task->process->client->phone ?? ''; $phone = substr_replace($phone, ' ', 3, 0); $phone = substr_replace($phone, ' ', 6, 0); $phone = substr_replace($phone, ' ', 10, 0); $next_survey_number = App\Models\Survey::getNextSurveyNumber(); // 'FELM/'.date('Y').'/'.$survey_count @endphp
Felmérések szervezése
{{-- Selectable tasks --}}

@foreach($tasks->chunk(6) as $chunk)
@foreach($chunk as $task)
{{--
Header
--}}
{{--
{{ $task->process->client->full_name }}
--}}
{{ $task->process->contact_name ? $task->process->contact_name : $task->process->client->full_name }}

{{ $task->process->address->full_address }}

@endforeach
@endforeach
{{-- Data & Form --}} @if ($selected_task)

{{ $selected_task->offer->offer_number ?? null }} {{ $selected_task->process->client->company_name ? $selected_task->process->client->company_name.' -' : '' }} {{ $selected_task->process->project_name ? $selected_task->process->project_name.',' : '' }} {{ $selected_task->process->contact_name ? $selected_task->process->contact_name : $selected_task->process->client->full_name }}

@csrf {{--
Ügyfél neve: {{ $selected_task->process->client->full_name }}
--}}
{{ $selected_task->process->address->full_address }}
{{--
{{ $selected_task->process->client->phone }}
--}}
@if($selected_task->process->contact_phone || $selected_task->process->client->phone) {{ $phone }}@endif
{{$selected_task->description ?? ''}} {{-- {!! $selected_task->calEvent('main_calendar', 'fullcalendar')['title'] ?? '' !!} --}}
{!! ($selected_task->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ')) ? $selected_task->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ') : ''; !!}
{{$selected_task->offer->work_description ?? ''}}
{{$selected_task->order_description ?? ''}}
{{-- App\Models\SaleItem::find(array_keys($selected_task->offer->products))->map(function($saleItem){ return $saleItem->short_name; })->implode(', ') --}} {{-- App\Models\SaleItem::find(array_keys($selected_task->offer->services))->map(function($saleItem){ return $saleItem->short_name; })->implode(', ') --}}
{{--
@php $documents = collect($selected_task->offer->getDocuments())->whereIn('type', ['survey', 'plan', 'location', 'technical_description'])->map(function ($document) { return $document->typeLang . ': '.$document->name.''; })->implode('
'); @endphp {!! ($documents) ?? '' !!}
--}}
@php $documents = collect($selected_task->offer->getDocuments())->whereIn('type', ['survey', 'plan', 'location', 'technical_description']); $sortedDocuments = $documents->sortBy(function ($document) { $types = ['survey', 'location', 'plan', 'technical_description']; $type = in_array($document->type, $types) ? array_search($document->type, $types) : -1; return $type; })->map(function ($document) { return $document->typeLang . ': ' . $document->name . ''; })->implode('
'); @endphp {!! ($sortedDocuments) ?? '' !!}
@include('comments.panel', ['comment_target' => $selected_task])
@error('start_date') {{ $message }} @enderror
@error('end_date') {{ $message }} @enderror
{{-- Újra szervezésre került (dátum) --}}
@endif {{-- Calendar --}}
{{-- Documents --}} @if ($selected_task) @php // $disabled = false; // !in_array($offer->status, ['offer_preparing', null]); $document_types = []; // 'offer_mail', 'location', 'technical_description', 'email', 'warranty' // 'control' $document_model = 'Offer'; $document_id = $selected_task->offer->id; $offer = $selected_task->offer; @endphp {{-- Jogosultságok alapján a dokumentum típusok leküldése --}} @can('show-document-survey') @php array_push($document_types, 'survey') @endphp @endcan @can('show-document-plan') @php array_push($document_types, 'plan') @endphp @endcan @can('show-document-location') @php array_push($document_types, 'location') @endphp @endcan @can('show-document-technical_description') @php array_push($document_types, 'technical_description') @endphp @endcan

Dokumentumok

@include('process.tables.documents', ['documents' => $selected_task->offer->getDocuments(), 'types' => $document_types, 'model' => $document_model, 'id' => $document_id, 'table_id' => 'dt_survey_organize', 'modal_type' => 'survey_organize'])
@endif
@endsection @push('scripts') @endpush