@extends('layouts.admin') @section('main-content') @php $survey_count = $survey_count + 1; $phone = $selected_task->process->client->phone ?? ''; $phone = substr_replace($phone, ' ', 3, 0); $phone = substr_replace($phone, ' ', 6, 0); $phone = substr_replace($phone, ' ', 10, 0); @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->address->full_address }}

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

{{ $selected_task->offer->offer_number ?? $selected_task->offer->id }} {{ $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->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('. ') : ''; !!}
{{ 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', 'plan', 'technical_description'])->map(function ($document) { return ''.$document->name.''; })->implode('
'); @endphp {!! ($documents) ?? '' !!}
@include('comments.panel', ['comment_target' => $selected_task])
@if ($selected_task->status != 'organize')
@endif
@error('start_date') {{ $message }} @enderror
@error('end_date') {{ $message }} @enderror
@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'])
@endif
@endsection @push('scripts') @endpush