{% import 'shared/componnents/_macros/_alerts.html.twig' as alerts %} {% set form = form ?? null %} {% set hotel_contract = hotel_contract ?? null %} {% set hotel = hotel ?? null %} {% if form.calendar.start.vars.errors|length or form.commonRoomPeriodPension.hotelRoom.vars.errors|length %} {% set errors_validator = form_errors(form.calendar.start) ~ form_errors(form.commonRoomPeriodPension.hotelRoom) %} {{ alerts.notification(errors_validator, 'info') }} {% endif %} {% set formHasNoErrors = false %} {% if 0 == hotel.hotelPensions|length %} {% set formHasNoErrors = true %} {{ alerts.alert('please_create_pension_for_this_hotel'|trans, 'danger', 'fa fa-fw fa-warning', 'Warning !', path('app_hotel_pension_index', {'hotelId': hotel.id})) }} {% endif %} {% if 0 == hotel_contract.hotelContractPeriods|length %} {% set formHasNoErrors = true %} {{ alerts.alert('please_create_period_for_this_contract'|trans, 'danger', 'fa fa-fw fa-warning', 'Warning !', path('app_hotel_contract_period_index', {'hotelId': hotel.id, 'hotelContractId': hotel_contract.id})) }} {% endif %} {% if false == hasAtLeastOneAgency() %} {% set formHasNoErrors = true %} {{ alerts.alert('please_create_at_least_one_agency'|trans, 'danger', 'fa fa-fw fa-warning', 'Warning !', path('app_agency_index')) }} {% endif %} {% if not formHasNoErrors %} {% include 'hotel_contract_minimum_stay/_form.html.twig' with { 'path': path('app_hotel_contract_minimum_stay_index', {'hotelId': hotel.id, 'hotelContractId': hotel_contract.id}), 'path_list': path('app_hotel_contract_detail', {'hotelId': hotel.id, 'hotelContractId': hotel_contract.id}), 'label_btn': 'Ajouter', 'class_alert': 'success', 'entity_name': 'HotelContractMinimumStay' } %} {% endif %}