@extends('layouts.admin') @section('main-content') @php $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
Munkák szervezése
{{-- Szervezendő feladatok --}}

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

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

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

{{ $selected_task->offer->offer_number ?? $selected_task->offer->id }} {{ $selected_task->process->client->full_name }}

@csrf
{{ $selected_task->process->address->full_address }}
@if($selected_task->process->client->phone) {{ $phone }}@endif
{{$selected_task->description ?? ''}} {{-- {!! $selected_task->calEvent('main_calendar', 'fullcalendar')['title'] ?? '' !!} --}} @if(App\Models\Offer::find($selected_task->offer_id)->final_payment_method == 'cash_locally')
Fennmaradó összeget a helyszínen fizetik ({{ number_format($selected_task->offer->remaining_amount ?? 0, 0, '', ' ').' Ft.'}}) @endif
{!! ($selected_task->offer->supplier_offers->unique('id')->implode('stock', ', ')) ? 'Polc: ' . $selected_task->offer->supplier_offers->unique('id')->implode('stock', ', ') : '' !!}
{!! ($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', '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 {{-- Naptár --}}
{{-- Dokumentumok --}} @if ($selected_task) @php $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_work_organize'])
{{-- Járművek szerkesztése --}}

Járművek szerkesztése

@csrf
{{-- Jármű kiválasztása szerkesztésre --}}
@include('work.work_vehicle_select', ['work' => $selected_task])
{{-- Dolgozók szerkesztése a járműben --}}
@endif
@endsection @push('scripts') @endpush