@php $disabled = false; //!in_array($order->status, ['order_preparing', null]) $document_types = ['offer_mail', 'location', 'technical_description', 'email', 'warranty', 'survey']; //'control' $document_model = 'Offer'; $document_id = $offer->id; @endphp {{-- Jogosultságok alapján a dokumentum típusok leküldése --}} @can('show-document-plan') @php array_push($document_types, 'plan') @endphp @endcan @can('show-document-offer_mail') @php array_push($document_types, 'offer_mail') @endphp @endcan @can('show-document-location') @php array_push($document_types, 'location') @endphp @endcan @can('show-document-worksheet') @php array_push($document_types, 'worksheet') @endphp @endcan @can('show-document-handover_report') @php array_push($document_types, 'handover_report') @endphp @endcan @can('show-document-technical_description') @php array_push($document_types, 'technical_description') @endphp @endcan @can('show-document-email') @php array_push($document_types, 'email') @endphp @endcan @can('show-document-warranty') @php array_push($document_types, 'warranty') @endphp @endcan @can('show-document-survey') @php array_push($document_types, 'survey') @endphp @endcan @can('show-document-other') @php array_push($document_types, 'other') @endphp @endcan @if (isset($offer->id) && $offer->client_response) @php switch ($offer->client_response) { case 'accepted': $message = 'Az ügyfél elfogadta az ajánlatot!'; break; case 'request_modification': $message = 'Az ügyfél visszahívást kér!'; break; case 'request_survey': $message = 'Az ügyfél felmérést kér!'; break; case 'rejected': $message = 'Az ügyfél elállt a megrendeléstől!'; break; default: $message = 'Az ügyfél visszahívást kér!'; break; } @endphp @endif @if(!$order->approved && isset($order->id)) @endif {{-- A megrendelés ellenőrzésre vár START --}} @php if(isset($order->id)) (App\Models\Order::where('id', $order->id) ->whereNotNull('contract_signed_at')->where('post_order_survey_check_required', true) ->whereHas('surveys', function ($q) { $q->whereIn('status', ['completed']) ->where(function ($k) { $k->whereNotNull('offers.contract_signed_at') ->where('surveys.created_at', '>=', $k->raw('offers.contract_signed_at')); }); }) ->first()) ? $has_completed_post_order_survey = true : $has_completed_post_order_survey = false; @endphp @if($order->post_order_survey_check_required && isset($order->id) && $has_completed_post_order_survey) @endif {{-- A megrendelés ellenőrzésre vár END --}} @if($order->status == 'contract_signed' || $order->status == 'advance_invoice_sent' || $order->status == 'materials_received' || $order->status == 'material_invoice_paid' || $order->status == 'completed') @if($order->remaining_amount >= '5.00') @php $paid_amount = $order->payments()->where('completed', '1')->sum('amount'); @endphp @endif @endif

@include('process.forms.order')
@if($order->id)

Dokumentumok

@include('process.tables.documents', ['documents' => $offer->getDocuments(), 'types' => $document_types, 'model' => $document_model, 'id' => $document_id, 'table_id' => 'dt_order'])
@if(!in_array($order->status, [ 'contract_preparing', 'awaiting_approval', 'contract_sent', 'contract_rejected', ])) @can('show-payment')
Fizetések/Számlák
@include('process.tables.payments', ['payments' => $order->payments, 'table_id' => 'dt_order'])
@endcan @endif @if(!in_array($order->status, [ 'contract_preparing', 'awaiting_approval', 'contract_sent', 'contract_rejected', 'contract_signed', 'advance_invoice_sent', ])) @can('show-supplier-offer')

Beszállítói megrendelések

@include('process.tables.supplier_orders', ['supplier_orders' => $order->supplier_orders, 'table_id' => 'dt_order'])
@endcan @endif

Felmérések

@include('process.tables.surveys', ['surveys' => $order->surveys, 'table_id' => 'dt_order'])
@if(!in_array($order->status, [ 'contract_preparing', 'awaiting_approval', 'contract_sent', 'contract_rejected', 'contract_signed', 'advance_invoice_sent', //'advance_invoice_paid', 'materials_received', 'material_invoice_sent', ]))

Munkák

@include('process.tables.works', ['works' => $order->works, 'table_id' => 'dt_order'])
@endif @if( $order->status == 'contract_preparing')
@endif @if( $order->status == 'contract_sent')

Ügyfél válasza a szerződésre:

@csrf
{{--
@csrf
--}}
@endif @endif