@extends('layouts.default-canvas') @section('title') {{ __('modules')['dashboard']['hotel']['reservation_tickets'] }} | {{ $reservation->id }} @endsection @section('styles') @endsection @section('content') {{-- Imports --}} @php // Imports use App\Helpers\Environment\SystemFeaturesHelper; // Environments $has_control_hours = SystemFeaturesHelper::getFeatureStatus("control_hours"); $has_express_reservations = SystemFeaturesHelper::getFeatureStatus("express_reservations"); $has_pax_pricing = SystemFeaturesHelper::getFeatureStatus("pax_pricing"); // Dynamic Lang $reservation_ticket = __('tickets')['hotel']['reservation_tickets']; @endphp {{-- Ticket --}}
{{-- Header --}}
{{-- Logo --}}
@if (Auth::user()->profile_photo === null) @else @endif
{{-- Establishment Data --}}
{{-- Name --}}

{{ $hotel->business_name }}

{{-- RFC --}} @if (isset($hotel->tax_id) && !is_null($hotel->tax_id))

{{ $hotel->tax_id }}

@endif {{-- Address --}}

{{ $hotel->business_address }}

{{-- Contacts --}}

{{ config('mail.hotel_address') }}  |  {{ $hotel->business_phone }}


{{-- Content --}}
{{-- Reservation Simple Summary --}}
{{-- Client - Room Summary - Hosting Control --}}
{{-- Client --}} {{-- Name --}}

{{ $reservation_ticket['guest_section'] }} {{ $reservation->client_reference }}

    {{-- Phone --}} @if (!in_array($reservation->client->client_phone, [null, __('neutral_words')['none_2']]))
  • {{ __('entity_fields')['common']['phone'] }}: {{ $reservation->client->client_phone }}
  • @endif {{-- Email --}} @if (!in_array($reservation->client->client_email, [null, __('neutral_words')['none_2']]))
  • {{ __('entity_fields')['common']['email'] }}: {{ $reservation->client->client_email }}
  • @endif {{-- Country --}} @if (!in_array($reservation->client->client_state, [null, __('neutral_words')['none_2']]))
  • {{ $reservation_ticket['guest_origin'] }} {{ strtolower($reservation->client->client_state) }}
  • @endif
{{-- Room Data --}} {{ $reservation_ticket['room_section'] }}
    {{-- Room Type --}}
  • {{ $reservation_ticket['room_type'] }} {{ $reservation->roomType->tr_name }}
  • {{-- Room --}}
  • {{ $reservation_ticket['room_number'] }} {{ $reservation->room->room_name }}
{{-- Hosting Control --}} {{ $reservation_ticket['lodging_section'] }}
    {{-- Nights/Hours - Adults - Children --}}
  • {{-- Stay --}} {{ $reservation_ticket['length_of_stay'] }} @if ($reservation->is_express) {{ $reservation->number_hours }} {{ trans_choice($reservation_ticket['number_hours'], $reservation->number_hours) }} @elseif ($has_control_hours) {{ $reservation->number_nights }} {{ trans_choice($reservation_ticket['number_nights'], $reservation->number_nights) }}, {{ $reservation->number_hours }} {{ trans_choice($reservation_ticket['number_hours'], $reservation->number_hours) }} @else {{ $reservation->number_nights }} {{ trans_choice($reservation_ticket['number_nights'], $reservation->number_nights) }} @endif {{-- Divider --}}  |  {{-- PAX --}} {{ $reservation_ticket['adults'] }}{{ $reservation->number_adults }}  |  {{ $reservation_ticket['children'] }} {{ $reservation->number_children }}
{{-- Folio - Entry - Departure --}}
{{-- Folio --}}

{{ $reservation_ticket['internal_folio'] }} {{ $reservation->id}}

{{-- Control Dates --}} {{-- Entry --}}

{{ $reservation_ticket['entry_date'] }} {{ $reservation->date_entry }} @if ($has_control_hours) {{ __('neutral_words')['at'] }} {{ $reservation->hour_entry }} @endif

{{-- Departure --}}

{{ $reservation_ticket['departure_date'] }} {{ $reservation->date_departure }} @if ($has_control_hours) {{ __('neutral_words')['at'] }} {{ $reservation->hour_departure }} @endif

{{-- Reservation Source --}}

@if ($reservation->source_id != "3") {{ $reservation_ticket['reservation_source'] }} {{ $reservation->source->source_name }} @else {{ $reservation_ticket['agency'] }} {{ $reservation->agency->agency_name }} @endif

{{-- Reservation Source --}}

{{ $reservation_ticket['payment_status'] }} @switch($reservation->payment_status) @case('#fd2319') @default {{ __('neutral_words')['due'] }} @break @case('#ffcf00') {{ __('neutral_words')['advance'] }} @break @case('#37f00f') {{ __('neutral_words')['paid'] }} @break @endswitch

{{-- Reservation Charges & Payments Summary --}}
{{-- Title --}}
{{ $reservation_ticket['charges_section'] }}
@php // Imports use \App\Helpers\Formats\FormatCurrencyHelper; // Relationships $lodging_payments = $reservation->lodgingPayments->where('status', 'Activo'); $consumption_charges = $reservation->consumptionCharges->where('status', 'Activo'); $consumption_payments = $reservation->consumptionPayments->where('status', 'Activo'); $extra_charges = $reservation->extraCharges->where('status', 'Activo'); $extra_payments = $reservation->extraPayments->where('status', 'Activo'); // Totals $consumption_total_charges = $consumption_charges->sum('consumption_price'); $extra_total_charges = $extra_charges->sum('extras_price'); $lodging_total_payments = $lodging_payments->sum('payment_price'); $consumption_total_payments = $consumption_payments->sum('payment_price'); $extra_total_payments = $extra_payments->sum('payment_price'); $lodging_remaining_balance = $reservation->total_price - $lodging_total_payments; $consumption_remaining_balance = $consumption_total_charges - $consumption_total_payments; $extra_remaining_balance = $extra_total_charges - $extra_total_payments; $total_charges = $reservation->total_price + $extra_total_charges + $consumption_total_charges; $total_paid = $lodging_total_payments + $consumption_total_payments + $extra_total_payments; $remaining_balance = $total_charges - $total_paid; // Support $empty_payments = '' . str_repeat('-- -- --', 4) . ''; @endphp {{-- Lodging --}}
{{-- General Summary --}} {{-- Main Header --}} {{-- Charges Sections --}} @if ($reservation->is_express) @else @endif {{-- Payments Sections --}} @forelse ($lodging_payments as $payment) @empty {!! $empty_payments !!} @endforelse
{{ $reservation_ticket['lodging_charges'] }}
{{ $reservation_ticket['charges'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['description'] }}{{ $reservation_ticket['rate_price'] }}{{ $reservation_ticket['lodging_nightly_price'] }}Total
{{ $reservation->date_entry }} {{ $reservation_ticket['lodging_description'] }} @if ($reservation->is_express) {{ $reservation->number_hours }} {{ trans_choice($reservation_ticket['number_hours'], $reservation->number_hours) }} @elseif ($has_control_hours) {{ $reservation->number_nights }} {{ trans_choice($reservation_ticket['number_nights'], $reservation->number_nights) }}, {{ $reservation->number_hours }} {{ trans_choice($reservation_ticket['number_hours'], $reservation->number_hours) }} @else {{ $reservation->number_nights }} {{ trans_choice($reservation_ticket['number_nights'], $reservation->number_nights) }} @endif
@if ($has_pax_pricing) @php $total_pax = (int) $reservation->number_adults; if ($reservation->include_children_in_pax) $total_pax += $reservation->number_children; @endphp ({{ $total_pax }} pax) @endif
{{ FormatCurrencyHelper::formatCurrency($reservation->final_price) }} {{ FormatCurrencyHelper::formatCurrency($reservation->total_price) }}
{{ $reservation_ticket['payments'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['concept'] }} {{ $reservation_ticket['payment_method'] }} {{ $reservation_ticket['amount'] }}
{{ $payment->payment_date->format('Y-m-d H:i') }} {{ $payment->payment_concept }} {{ $payment->payment_method }} {{ FormatCurrencyHelper::formatCurrency($payment->payment_price) }}
{{-- Remaining Summary --}}
{{ $reservation_ticket['amount_paid'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($lodging_total_payments, 2) ) }}
{{ $reservation_ticket['due_balance'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($lodging_remaining_balance, 2) ) }}
{{-- Consumption --}} @if (count($consumption_charges))
{{-- Charges Sections --}} {{-- Main Header --}} {{-- Secondary Header --}} @foreach ($consumption_charges as $charges) @endforeach
{{ $reservation_ticket['consumption_charges'] }}
{{ $reservation_ticket['charges'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['description'] }} Total
{{ $charges->consumption_date->format('Y-m-d H:i') }} {{ $charges->consumption_concept}} {{ FormatCurrencyHelper::formatCurrency($charges->consumption_price) }}
{{-- Charges Summary --}}
{{ $reservation_ticket['total_charge'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($consumption_total_charges, 2) ) }}
{{-- Payments Sections --}} @forelse ($consumption_payments as $payment) @empty {!! $empty_payments !!} @endforelse
{{ $reservation_ticket['payments'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['concept'] }} {{ $reservation_ticket['payment_method'] }} {{ $reservation_ticket['amount'] }}
{{ $payment->payment_date->format('Y-m-d H:i') }} {{ $payment->payment_concept }} {{ $payment->payment_method }} {{ FormatCurrencyHelper::formatCurrency($payment->payment_price) }}
{{-- Remaining Summary --}}
{{ $reservation_ticket['amount_paid'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($consumption_total_payments, 2) ) }}
{{ $reservation_ticket['due_balance'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($consumption_remaining_balance, 2) ) }}
@endif {{-- Extras --}} @if (count($extra_charges))
{{-- Charges Sections --}} {{-- Main Header --}} {{-- Secondary Header --}} @foreach ($extra_charges as $charges) @endforeach
{{ $reservation_ticket['extra_charges'] }}
{{ $reservation_ticket['charges'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['description'] }} Total
{{ $charges->extras_date->format('Y-m-d H:i') }} {{ $charges->extras_concept}} {{ FormatCurrencyHelper::formatCurrency($charges->extras_price) }}
{{-- Charges Summary --}}
{{ $reservation_ticket['total_charge'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($extra_total_charges, 2) ) }}
{{-- Payments Sections --}} @forelse ($extra_payments as $payment) @empty {!! $empty_payments !!} @endforelse
{{ $reservation_ticket['payments'] }}
{{ $reservation_ticket['date'] }} {{ $reservation_ticket['concept'] }} {{ $reservation_ticket['payment_method'] }} {{ $reservation_ticket['amount'] }}
{{ $payment->payment_date->format('Y-m-d H:i') }} {{ $payment->payment_concept }} {{ $payment->payment_method }} {{ FormatCurrencyHelper::formatCurrency($payment->payment_price) }}
{{-- Remaining Summary --}}
{{ $reservation_ticket['amount_paid'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($extra_total_payments, 2) ) }}
{{ $reservation_ticket['due_balance'] }} {{ FormatCurrencyHelper::formatCurrency( number_format($extra_remaining_balance, 2) ) }}
@endif {{-- Total --}}
{{ $reservation_ticket['total_amount'] }} {{ FormatCurrencyHelper::formatCurrency(number_format($total_charges,2,'.',','), false) }}
{{ $reservation_ticket['total_amount_paid'] }} {{ FormatCurrencyHelper::formatCurrency(number_format($total_paid,2,'.',','), false) }}
{{ $reservation_ticket['total_due_balance'] }} {{ FormatCurrencyHelper::formatCurrency(number_format($remaining_balance,2,'.',','), false) }}
{{-- Footer --}}
{{-- Actions --}}
{{-- Basic Actions --}}
{{-- Go back --}} {{ $reservation_ticket['go_back'] }}
{{-- Special Actions --}}
{{-- Invoice Reservation --}} @if ( in_array(Auth::user()->role, ['administrador', 'gerente', 'recepcionista']) && \App\Helpers\Environment\SystemModulesHelper::isEstablishmentTaxDataComplete() && \App\Helpers\Environment\FacturapiHelper::isEnabled() ) @php $billing_url = route('invoices.create', [ "service_type" => App\Enums\Invoicing\BillableService::Reservation->value, "service_id" => $reservation->id ]); @endphp {{ $reservation_ticket['invoice_reservation'] }} @endif {{-- Send Email --}} {{-- Download --}} $reservation->id]) }}"> {{ $reservation_ticket['download_ticket'] }} {{-- Print --}}
@endsection @section('import-scripts') {{-- Sweet Alert --}} {{-- Inactivity Control --}} @endsection @section('page-control-scripts') @php $client_email = __('neutral_words')['none_2'] != $reservation->client->client_email ? $reservation->client->client_email : ""; @endphp @endsection