@extends('layouts.app') @section('title') {{ __('entity_forms')['otas_connection']['common']['availability'] }} @endsection @section('content') {{-- Styles --}} {{-- Custom Styles --}} {{-- Body --}} {{-- Availability Form --}}
@csrf @php $counted_otas = count($activated_otas); $initial_occupation_percentage = $allotment_summary->occupation_percentage; @endphp {{-- Superior Cards --}}
{{-- Title --}}

{{ __('entity_forms')['otas_connection']['common']['availability'] }} ({{ $date }})

{{ __('neutral_words')['occupation'] }}
{{ $counted_otas ? $allotment_summary->occupation_percentage : 0 }}%
{{-- Actived OTAs --}}
{{ __('entity_forms')['otas_connection']['common']['availability'] }}
@forelse ($activated_otas as $ota)
{{ $allotment_summary->allotment_room_summary[$ota->sample_name] ?? 0 }}
{{ $ota->name }}
@empty

- {{ __('entity_forms')['otas_connection']['common']['no_active_channels'] }} -

@endforelse
{{-- Table Structure --}}
@php $default_col_width = $counted_otas > 0 ? (66 / min($counted_otas, 4)) : 66; $assigned_col_width = $counted_otas <= 4 ? $default_col_width : 16.5; $table_min_width = 34 + (16.5 * $counted_otas); @endphp {{-- Header --}} {{-- Default Header --}} {{-- OTAs Headers --}} @forelse ($activated_otas as $ota) @empty @endforelse {{-- Spacer --}} @forelse ($room_types as $type) @php // Visual Control $total_rooms = $room_types->sum(fn($roomType) => $roomType->rooms->count()); // Input Control $room_type_data = $allotment_summary->room_types_configuration[$type->id] ?? null; $room_type_configuration = $room_type_data ? collect($room_type_data) : null; $type_not_registered = is_null($room_type_configuration); $has_open_availability = (int) $allotment_summary->occupation_percentage >= $occupation_limit ? false // Just in case occupation limit was exceded : ($type_not_registered ? true : filter_var($room_type_configuration['has_open_availability'], FILTER_VALIDATE_BOOLEAN)); $ota_availability_summary = $type_not_registered ? [] : ($room_type_configuration['ota_availability_summary'] ?? []); $ota_occupancy_summary = $type_not_registered ? [] : ($room_type_configuration['ota_occupancy_summary'] ?? []); @endphp @foreach ($type->rooms as $secondary_index => $room) @php $is_last_room_in_type = $loop->last; // ← ahora aquí @endphp @if ($secondary_index === 0) @endif @forelse ($activated_otas as $ota) @empty @endforelse @endforeach @empty @endforelse
{{ __('entities')['hotel']['room_type'] }} {{ __('entities')['hotel']['room'] }} {{ $ota->name }} {{-- rowspan="{{ count($room_types) }}" --}} {{ __('entity_forms')['otas_connection']['common']['channels'] }}
@if ($counted_otas)    @endif
@if ($counted_otas)
  {{ __('entity_forms')['otas_connection']['common']['channels'] }}
@endif
{{ $room->room_name }} @if (in_array($ota->sample_name, $room->available_on_otas ?? [])) @php // Control Data $availability_rooms_configuration = $ota_availability_summary[$ota->sample_name] ?? []; // Control Statuses $is_available = in_array($room->id, $availability_rooms_configuration) // Checked -> Reserved/Not Available, Not Checked -> Available || $type_not_registered; // $type_not_registered is used when there is no assignment event for the date in question or when the RType has just been added to the calendar. if ($is_available) { $room_status = 'available'; } else { $is_reserved = in_array($room->id, $ota_occupancy_summary); $room_status = $is_reserved ? 'reserved' : 'deactivated'; } @endphp {{-- Switch --}} {{-- Status Label --}} @else -- -- -- @endif {{ __('entity_forms')['otas_connection']['common']['no_active_channels'] }}
- {{ __('entity_forms')['otas_connection']['common']['no_configured_rooms'] }} -
{{-- Form Modal --}} {{-- Scripts --}} {{-- Import JQuery --}} {{-- Page Behavior --}} {{-- Special Functions --}} @endsection @section('footer') @include('shared.components.footer.basic-footer') @endsection