@extends('layouts.admin') @section('main-content') @php $setting_notification_email = App\Models\Setting::where('name', 'work_notification_email')->first(); $setting_notification_sms = App\Models\Setting::where('name', 'work_notification_sms')->first(); $work = $selected_task; $phone = $work?->process?->contact_phone ? $work?->process?->contact_phone : $work?->process?->client?->phone ?? ''; $phone = substr_replace($phone, ' ', 3, 0); $phone = substr_replace($phone, ' ', 6, 0); $phone = substr_replace($phone, ' ', 10, 0); $worksheet = App\Models\Worksheet::where('offer_id', $work?->offer?->id)->get(); $issue_ticket = $work?->issue_ticket; @endphp
Munkák szervezése
{{-- Szervezendő feladatok --}}

@foreach($tasks->chunk(6) as $chunk)
@foreach($chunk as $task) @php $route = $task->offer_id ? 'works.organize' : 'tasks.edit'; @endphp
{{--
Header
--}}
@if(!$task->task_id)
{{ $task->process->contact_name ? $task->process->contact_name : $task->process->client->full_name }}

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

@else
{{ $task->task->title }}

{{ $task->task->description }}

@endif
@endforeach
@endforeach
{{-- Adatok & Form --}} @if ($work)
@if(!$issue_ticket) {{ $work?->offer?->offer_number ?? null }} @else {{$issue_ticket->issue_number}} @endif {{ $work?->process?->client?->company_name ? $work?->process?->client?->company_name.' -' : '' }} {{ $work?->process?->project_name ? $work?->process?->project_name.',' : '' }} {{ $work?->process?->contact_name ? $work?->process?->contact_name : $work?->process?->client?->full_name }}
{{ $work->process->address->full_address }}

@if($work->process->contact_phone || $work->process->client->phone) {{ $phone }} @endif

@csrf
@if(!$issue_ticket)
Munkavégzés leírása:
{{$work->offer->work_description ?? ''}}
Feladat leírása:
{{$work->description ?? ''}}
{{$work->order_description ?? ''}}
Feladathoz megjegyzés:
{!! ($work->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ')) ? $work->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ') : ''; !!}
@else
Hibabejelentés leírása:
{{$issue_ticket->description ?? ''}}
Hibajavítás leírása:
{{$issue_ticket->fix_description ?? ''}}
@if(isset($issue_ticket->history))
@include('issue_ticket.history', [$issue_ticket]) @endif
Feladat leírása:
{{$work->description ?? ''}}
Feladathoz megjegyzés:
{!! ($work->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ')) ? $work->comments()->get()->map(function ($comment) { return $comment->comment; })->implode('. ') : ''; !!}
@endif {{-- {!! $work->calEvent('main_calendar', 'fullcalendar')['title'] ?? '' !!} --}} @if(App\Models\Offer::find($work->offer_id)->final_payment_method == 'cash_locally')
Fennmaradó összeget a helyszínen fizetik ({{ number_format($work->offer->remaining_amount ?? 0, 0, '', ' ').' Ft.'}}) @endif

@if(!$issue_ticket)
{!! ($work->offer->supplier_offers->unique('id')->implode('stock', ', ')) ? 'Polc: ' . $work->offer->supplier_offers->unique('id')->implode('stock', ', ') : '' !!}
@endif {{--
{{ App\Models\SaleItem::find(array_keys($work->offer->products))->map(function($saleItem){ return $saleItem->short_name; })->implode(', ') }} {{ App\Models\SaleItem::find(array_keys($work->offer->services))->map(function($saleItem){ return $saleItem->short_name; })->implode(', ') }}
--}} {{--
@php $documents = collect($work->offer->getDocuments())->whereIn('type', ['survey', 'plan', 'location', 'technical_description'])->map(function ($document) { return $document->typeLang . ': '.$document->name.''; })->implode('
'); @endphp {!! ($documents) ?? '' !!}
--}} @if(!$issue_ticket)
@php $documents = collect($work->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) ?? '' !!}
@endif
@include('comments.panel', ['comment_target' => $work])
{{-- @if ($work->status != 'organize') --}}
{{-- @endif --}}
@error('start_date') {{ $message }} @enderror
@error('end_date') {{ $message }} @enderror
{{--
@error('notification_date') {{ $message }} @enderror
--}} {{-- Újra szervezésre került (dátum) --}} @if($setting_notification_email->value == true)
can_send_notification) checked @endif >
@endif @if($setting_notification_sms->value == true)
can_send_notification) checked @endif >
@endif
@endif {{-- Naptár --}}
{{-- Dokumentumok --}} @if ($work) @php $document_types = []; // 'offer_mail', 'location', 'technical_description', 'email', 'warranty' //'control' $document_model = $issue_ticket ? 'IssueTicket' : 'Offer'; $document_id = $issue_ticket ? $issue_ticket->id : $work->offer->id; $offer = $work->offer; if(!$issue_ticket) $documents = $work->offer->getDocuments(); else $documents = App\Models\Document::where('target_type', 'App\Models\\'.$document_model)->where('target_id', $issue_ticket->id)->get(); @endphp {{-- Jogosultságok alapján a dokumentum típusok leküldése --}} @if(!$issue_ticket) @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 @endif @can('show-document-issue_ticket') @php array_push($document_types, 'issue_ticket') @endphp @endcan

Dokumentumok

@include('process.tables.documents', [ 'documents' => $documents, 'types' => $document_types, 'model' => $document_model, 'id' => $document_id, 'table_id' => 'dt_work_organize', 'modal_type' => 'work_organize' ]) {{--

Munkalapok

@include('process.tables.worksheets', [ 'work' => $work, 'table_id' => 'dt_worksheet', 'hide_button' => ['worksheet_create'], ]) --}} @if($worksheet->count() != 0)

Munkalapok / jegyzőkönyvek

@include('process.tables.worksheets', [ 'worksheet' => $worksheet, 'table_id' => 'dt_worksheet', 'hide_button' => ['worksheet_create'], ]) @endif
{{-- Járművek szerkesztése --}}

Járművek szerkesztése

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