<div class="block-table03 clearfix">
<table class="table03 marginT30">
{% for currentSale in currentSales %}
{% set sale = currentSale.sale %}
<tr class="sale-item {{ sale.type|lower }} {{ sale.exclusive ? 'exclu' : 'nonexclu' }} {{ currentSale.count_active_vehicles == 0 ? 'disabled' : '' }}">
<td>
<div class="nom-vente">
<a href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}" title="" class="inbl">
{% if sale is defined and sale is not null and sale.type is constant('TYPE_ONLINE', sale) %}
<span><i class="icon-vente-web"></i></span>
<span>
<span class="txttransform bold">
{{ sale.displayedNameWithoutDate }}
{% include '/Frontend/pro/_flag.html.twig' with {'country': sale.country} %}
{% if sale.isTypePhysical %}
{{ sale.startDate|date('d/m/Y') }}
{% endif %}
</span>
<span class="marginR10 font14">{{ sale.salingType|trans }}</span>
<span>{{ currentSale.count_vehicles }} <i class="icon-nb-vehicules"></i></span>
</span>
{% else %}
<span><i class="icon-vente-en-salle"></i></span>
<span>
<span class="txttransform bold">
{{ sale.displayedNameWithoutDate }}
{% include '/Frontend/pro/_flag.html.twig' with {'country': sale.country} %}
{% if sale.isTypePhysical %}
{{ sale.startDate|date('d/m/Y') }}
{% endif %}
</span>
<span
class="marginR10 font14">{{ "frontend.home_content.pro.sale.description"|trans }}</span>
<span>{{ currentSale.count_vehicles }} <i class="icon-nb-vehicules"></i></span>
<span class="block font14">
{% if sale.room is not null and sale.type is constant('TYPE_PHYSICAL', sale) and sale.status != constant('STATUS_CLOSED', sale) %}
{% if sale.hasPriorExposition or sale.dayExpositionTime is not null %}
{{ 'frontend.home_content.pro.exposing.room'|trans }}
{{ sale.expositionStartDate|date('d/m') }}
{{ 'frontend.home_content.exposing.from'|trans }}
{{ sale.expositionStartDate|date('H:i') }}
{{ 'frontend.home_content.exposing.to'|trans }}
{{ sale.expositionEndDate|date('H:i') }}
{% if sale.dayExpositionTime is not null %}
{{ 'frontend.home_content.exposing.and'|trans }}
{{ sale.startDate|date('d/m') }}
{{ 'frontend.home_content.exposing.and.from'|trans }}
{{ sale.dayExpositionDateTime|date('H:i') }}
{% endif %}
{% elseif sale.room.isInternet %}
{% include '/Frontend/home/_internet_room.html.twig' with { 'room': sale.room, 'roomCode': sale.room.code|trim|lower, 'id': sale.id } %}
{% endif %}
{% endif %}
</span>
</span>
{% endif %}
</a>
</div>
<div class="marginT20">
{% if sale.type is constant('TYPE_ONLINE', sale) %}
{% if sale.startDate|date('U') > 'now'|date('U') %}
{% if sale.provider is defined and constant('App\\Api\\RMS\\SaleEventDataPersister::PROVIDER_NAME') == sale.provider %}
<p class="marginT20">
{{ 'frontend.home_content.pro.sale.opening'|trans({'%day%':sale.startDate|locale_date(pattern='dd/MM/yyyy'), '%time%' : sale.endDate|locale_date(pattern='HH:mm')}) }}
</p>
{% else %}
{% set hideDay = date('now').diff(sale.startDate)|date("%d") < 1 %}
{% set hideHours = date('now').diff(sale.startDate)|date("%d") < 1 and date('now').diff(sale.startDate)|date("%H") == 0 %}
<span
class="block marginB10">{{ 'frontend.home_content.pro.bid_opening'|trans }}<br>{{ 'frontend.home_content.pro.exposing.in_progress :'|trans }}</span>
<span class="inbl marginR10"><i class="icon-compteur-noir"></i></span>
<span
class="countdown-homepage-sale {{ hideDay ? 'hide-day':'hide-secondes' }} {{ hideHours ? 'hide-hours' }}"
data-lang="{{ app.request.locale }}"
data-target-date="{{ sale.startDate|date('Y/m/d H:i:s') }}"
data-server-date="{{ path('frontend_server_date') }}"></span>
{% endif %}
{% else %}
{% set hideDay = date('now').diff(sale.endDate)|date("%d") < 1 %}
{% set hideHours = date('now').diff(sale.endDate)|date("%d") < 1 and date('now').diff(sale.endDate)|date("%H") == 0 %}
{% set hideMinutes = date('now').diff(sale.endDate)|date("%d") < 1 and date('now').diff(sale.endDate)|date("%H") == 0 and date('now').diff(sale.endDate)|date("%i") == 0 %}
{% if hideHours %}
<span
class="block texte01 marginB10">{{ 'frontend.home_content.pro.last_minutes :'|trans }}</span>
{% else %}
<span
class="block marginB10">{{ 'frontend.home_content.pro.logged_in.sale.auction_in_progress'|trans }}</span>
{% endif %}
{% if not (sale.provider is defined and constant('App\\Api\\RMS\\SaleEventDataPersister::PROVIDER_NAME') == sale.provider) %}
<span class="inbl marginR10"><i
class="icon-compteur-{{ hideHours ? 'orange':'noir' }}"></i></span>
<span
class="countdown-homepage-sale {{ hideDay ? 'hide-day' }} {{ hideHours ? 'hide-hours texte01' }} {{ hideMinutes ? 'hide-minutes texte01' }}"
data-lang="{{ app.request.locale }}"
data-target-date="{{ sale.endDate|date('Y/m/d H:i:s') }}"
data-server-date="{{ path('frontend_server_date') }}"></span>
{% endif %}
{% endif %}
{% if sale.provider is defined and constant('App\\Api\\RMS\\SaleEventDataPersister::PROVIDER_NAME') == sale.provider and datesForExternalSales[sale.id] is defined %}
{% set maxDate = datesForExternalSales[sale.id].max_closedAt %}
{% set minDate = datesForExternalSales[sale.id].min_closedAt %}
<p class="marginT20">
{{ 'frontend.home_content.pro.sale.closing'|trans ~ ' : ' ~ 'frontend.header_sale.label.from'|trans }}
{{ minDate|locale_date(pattern='dd MMMM yyyy', locale=app.request.locale) ~ ' ' ~ 'frontend.home_content.pro.logged_in.sale.to'|trans ~ ' ' ~ minDate|locale_date(pattern='HH:mm') }}
{{ 'frontend.header_sale.label.until'|trans }}
{{ maxDate|locale_date(pattern='dd MMMM yyyy', locale=app.request.locale) ~ ' ' ~ 'frontend.home_content.pro.logged_in.sale.to'|trans ~ ' ' ~ maxDate|locale_date(pattern='HH:mm') }}
<span class="bubule">?<span class="bul-cont">{{ 'frontend.home_content.pro.logged_in.sale.rms.date'|trans }}</span></span>
</p>
{% else %}
<p class="marginT20">
{{ 'frontend.home_content.pro.sale.closing'|trans ~ ' : ' ~ sale.endDate|locale_date(pattern='dd MMMM yyyy', locale=app.request.locale) ~ ' ' ~ 'frontend.home_content.pro.logged_in.sale.to'|trans ~ ' ' ~ sale.endDate|locale_date(pattern='HH:mm') }}
</p>
{% endif %}
<p class="marginT20 block-btn">
{% if sale.startDate|date('U') > 'now'|date('U') %}
<a href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}"
class="lien12 {{ 'salle-' ~ sale.room.code|lower }}">{{ 'frontend.home_content.sale.button.show'|trans }}
<span>{{ 'frontend.home_content.pro.logged_in.sale.submit_order'|trans }}</span></a>
{% else %}
<a href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}"
class="lien12 {{ 'salle-' ~ sale.room.code|lower }} {% if app.user is null %}non-connecte{% endif %}">{{ 'frontend.home_content.sale.button.show'|trans }} {% if app.user is not null and app.user is pro %}
<span>{{ 'frontend.home_content.pro.logged_in.sale.bidder'|trans }}</span>{% endif %}
</a>
{% endif %}
</p>
{% elseif sale.type is constant('TYPE_PHYSICAL', sale) %}
{% if sale.events|length < 1 %}
{% set hideDay = date('now').diff(sale.startDate)|date("%d") < 1 %}
{% set hideHours = date('now').diff(sale.startDate)|date("%d") < 1 and date('now').diff(sale.startDate)|date("%H") == 0 %}
<span
class="block marginB10">{{ 'frontend.home_content.pro.logged_in.sale.live_opening'|trans }}</span>
<span class="inbl marginR10"><i class="icon-compteur-noir"></i></span>
<span
class="countdown-homepage-sale {{ hideDay ? 'hide-day':'hide-secondes' }} {{ hideHours ? 'hide-hours' }}"
data-lang="{{ app.request.locale }}"
data-target-date="{{ sale.startDate|date('Y/m/d H:i:s') }}"
data-server-date="{{ path('frontend_server_date') }}"></span>
{% elseif sale.events.first.startDateTime|date('U') > 'now'|date('U') %}
{% set hideDay = date('now').diff(sale.events.first.startDateTime)|date("%d") < 1 %}
{% set hideHours = date('now').diff(sale.events.first.startDateTime)|date("%d") < 1 and date('now').diff(sale.events.first.startDateTime)|date("%H") == 0 %}
<span
class="block marginB10">{{ 'frontend.home_content.pro.logged_in.sale.live_opening'|trans }}</span>
<span class="inbl marginR10"><i class="icon-compteur-noir"></i></span>
<span
class="countdown-homepage-sale {{ hideDay ? 'hide-day':'hide-secondes' }} {{ hideHours ? 'hide-hours' }}"
data-lang="{{ app.request.locale }}"
data-target-date="{{ sale.events.first.startDateTime|date('Y/m/d H:i:s') }}"
data-server-date="{{ path('frontend_server_date') }}"></span>
{% else %}
{% set hideHours = date('now').diff(sale.endDate)|date("%d") < 1 and date('now').diff(sale.endDate)|date("%H") == 0 %}
{% if sale.status == constant('STATUS_CLOSED', sale) %}
<span
class="block {{ hideHours ? 'texte01' }} marginB10">{{ 'frontend.home_content.pro.logged_in.sale.last_lots.title'|trans }}</span>
<span class="inbl marginR10"><i
class="icon-compteur-{{ hideHours ? 'orange':'noir' }}"></i></span>
<span
class="countdown-homepage-sale hide-day {{ hideHours ? 'hide-hours texte01' }}"
data-lang="{{ app.request.locale }}"
data-target-date="{{ sale.endDate|date('Y/m/d H:i:s') }}"
data-server-date="{{ path('frontend_server_date') }}"></span>
{% else %}
{{ 'frontend.home_content.pro.logged_in.sale.live_in_progress'|trans }}
{% endif %}
{% endif %}
{% endif %}
</div>
{% if sale is defined and sale is not null and sale.type is constant('TYPE_PHYSICAL', sale) %}
<ul class="horaires">
{% for event in sale.events %}
<li>
<a href="{{ path('frontend_vehicle_list_by_event', {'event': event.id}) }}">
<span>{{ event.startTime|date('H:i') }}</span>
<span>{{ event.title.name }} ({{ attribute(currentSale.count_vehicles_by_event, event.id) }})</span>
</a>
{% if event.lotsImport %}
{% set country = sale.country %}
{% set room = sale.room.code %}
{% include 'Frontend/vehicle/_bubule_lot_imported.html.twig' with {'country': country, 'room': room, 'home': true} %}
{% endif %}
</li>
{% endfor %}
</ul>
<div class="marginT20 block-btn">
<span class="inbl marginB10"><a
href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}"
class="lien12 marginR20 {{ 'salle-' ~ sale.room.code|lower }}">{{ 'frontend.home_content.sale.button.show'|trans }} <span>{{ 'frontend.home_content.pro.logged_in.sale.submit_order'|trans }}</span></a></span>
{% if nextLive is not null and nextLive.id == sale.id and this_sale_has_started(sale) and sale.status != constant('STATUS_CLOSED', sale) %}
<div class="inbl">
<span><i class="icon-live05 marginR10"></i></span>
<a href="{{ (app.user is null ) ? getADUrl() : path('vpauto_frontend_live', {'saleId': sale.id}) }}" class="lien04">{{ 'frontend.home_content.pro.logged_in.sale.bidder'|trans }}</a>
</div>
{% endif %}
</div>
{% endif %}
</td>
<td>
<ul class="elmt-liste-bloc m-hide">
{% for vehicle in currentSale.highlight_vehicles.vehicles %}
{% if vehicle.sale is not null %}
<li class="grid-33 tab-l-50 tab-p-100">
<article class="element">
<a href="{{ path('frontend_vehicle_view', { 'id': vehicle.id, 'slug': vehicle.slug, 'from': 'home' }) }}"
rel="nofollow"
class="{{ vehicle.sale.room.code|lower ~ '-' ~ vehicle.maker|replace({' ': ''})|lower }}">
<div class="elmt-content">
<div class="elmt-photo">
<img
src="{{ asset(resizePhoto(vehicle.photos|main(sale=vehicle.sale),300, vehicle)|default('bundles/vpauto/frontend/images/photo-defaut-640.jpg')) }}"
alt="{{ vehicle.modelGroup }}"
loading="lazy"
{% if vehicle.photos|main(sale=vehicle.sale) is null %}class="thumbdefault"{% endif %}>
<div class="overlay01"></div>
</div>
<div class="elmt-marque">
<h2>{{ vehicle.maker }}</h2>
</div>
{% if vehicle.sale.type is constant('TYPE_PHYSICAL', vehicle.sale) and vehicle.sale.country|lower == 'portugal' %}
<span class="elmt-ville setubal">
{% include '/Frontend/pro/_location.html.twig' with {'country': vehicle.sale.country, 'dept': true} %}
</span>
{% endif %}
</div>
{% set userHighest = attribute(currentSale.highlight_vehicles.highest_offers, vehicle.id) %}
<div class="elmt-infos grid-container">
<div class="elmt-modele">
<h3>{{ vehicle.model }}</h3>
{% if vehicle.broken == 1 %}({{ 'frontend.vehicle.list.vehicle_row.broken'|trans }})</h3>{% endif %}
<div>
<span>{{ vehicle.millesime|default('NC'|trans) }}</span> -
<span>{{ vehicle.kilometers|default('NC'|trans) }} Km</span>
</div>
</div>
<div class="elmt-prix">
{% if vehicle.sale is onlineCompliant %}
{% if app.user is not null %}
<span
class="{% if vehicle.salingState == constant('SALING_STATE_ADJUGE', vehicle) %}hidden{% endif %}">
{% if vehicle.sale.salingType != constant('SALING_STATE_BUYOUT', vehicle.sale) %}
{% if vehicle.bidCount > 0 and not vehicle.auction.isBefore %}
<span>{{ 'frontend.vehicle.list.vehicle_row.runningAuctions'|trans|capitalize }}</span>
<span>{{ vehicle.finalAmount|number_format(0, '', '')|default('NC'|trans) }}€</span>
{% elseif vehicle.startingPriceAvailable or vehicle.sale.provider is defined %}
<span>{{ 'frontend.vehicle.list.vehicle_row.startingPrice'|trans|capitalize }}</span>
<span>{{ vehicle.startingPrice|default('NC'|trans) }}€</span>
{% elseif vehicle.photos|main(sale=vehicle.sale) is null or vehicle.estimationPriceMin is empty or 0 == vehicle.estimationPriceMin %}
<span>{{ 'frontend.vehicle.list.vehicle_row.under_estimation'|trans|capitalize }} </span>
{% else %}
<span>{{ "frontend.vehicle.view.estimate"|trans|capitalize }}</span>
<span class="prix">{{ vehicle.estimationPriceMin|round(-2) }}€ - {{ vehicle.estimationPrice|round(-2) }}€</span>
{% endif %}
{% if userHighest is not null %}
<br>
<span>{{ 'frontend.vehicle.list.vehicle_row.user.maxAmount'|trans|capitalize }}</span>
<span>{{ userHighest.amount|number_format(0, '', '')|default('NC'|trans) }}€</span>
{% endif %}
{% else %}
{% if vehicle.buyoutPrice > 0 %}
<span>{{ 'frontend.vehicle.list.vehicle_row.buyout'|trans|lower|capitalize }}</span>
<span>{{ vehicle.buyoutPrice|default('NC'|trans) }}€</span>
{% elseif vehicle.photos|main(sale=vehicle.sale) is null or vehicle.estimationPriceMin is empty or 0 == vehicle.estimationPriceMin %}
<span>{{ "frontend.vehicle.list.vehicle_row.under_estimation"|trans|capitalize }} </span>
{% else %}
<span>{{ "frontend.vehicle.view.estimate"|trans|capitalize }}</span>
<span class="prix">{{ vehicle.estimationPriceMin|round(-2) }}€ - {{ vehicle.estimationPrice|round(-2) }}€</span>
{% endif %}
{% endif %}
</span>
{% endif %}
{% else %}
{% if vehicle.startingPriceAvailable %}
<span>{{ 'frontend.vehicle.list.vehicle_row.startingPrice'|trans }}</span>
<span class="prix">
{% if vehicle.startingPrice > 0 %}
{{ vehicle.startingPrice|default('NC'|trans) }}€
{% else %}
{% if vehicle.estimationPrice > 0 %}
{{ vehicle.estimationPrice|default('NC'|trans) }}€
{% else %}
NC
{% endif %}
{% endif %}
</span>
{% if userHighest is not null and vehicle.sale.type is constant('TYPE_PHYSICAL', vehicle.sale) %}
<br>
<span>{{ 'frontend.vehicle.list.vehicle_row.user.maxAmount'|trans|capitalize }}</span>
<span>{{ userHighest.amount|number_format(0, '', '')|default('NC'|trans) }}€</span>
{% endif %}
<span
class="fees-notice">({{ 'frontend.vehicle.list.vehicle_row.sale_fees_included'|trans }})</span>
{% elseif vehicle.sale.salingType == constant('SALING_STATE_TENDER', vehicle.sale) %}
<span>{{ 'frontend.vehicle.list.vehicle_row.startingPrice'|trans|capitalize }}</span>
<span class="prix">
{{ vehicle.startingPrice|default('NC'|trans) }}€
</span>
{% elseif vehicle.photos|main(sale=vehicle.sale) is null or vehicle.estimationPriceMin is empty or 0 == vehicle.estimationPriceMin %}
<span>{{ "frontend.vehicle.list.vehicle_row.under_estimation"|trans|capitalize }} </span>
{% else %}
<span>{{ "frontend.vehicle.view.estimate"|trans|capitalize }}</span>
<span class="prix">{{ vehicle.estimationPriceMin|round(-2) }}€ - {{ vehicle.estimationPrice|round(-2) }}€</span>
{% endif %}
{% endif %}
</div>
{% if sale.provider is defined and constant('App\\Api\\RMS\\SaleEventDataPersister::PROVIDER_NAME') == sale.provider %}
<div class="elmt-temps">
{{ 'frontend.home_content.pro.sale.closing'|trans ~ ' : ' ~ vehicle.auction.closedAt|locale_date(pattern='dd/MM', locale=app.request.locale) ~ ' ' ~ 'frontend.vehicle.list.vehicle_row.sale.to'|trans ~ ' ' ~ vehicle.auction.closedAt|locale_date(pattern='HH:mm') }}
</div>
{% endif %}
</div>
</a>
</article>
</li>
{% endif %}
{% endfor %}
</ul>
</td>
</tr>
{% endfor %}
</table>
</div>
{% if app.user is not null and is_granted('IS_AUTHENTICATED_REMEMBERED') %}
<div class="block-table03 clearfix">
<h2 class="titre01-1 titre-content-table03">
<span>
<strong>{{ 'frontend.home_content.pro.logged_in.list.title.ended'|trans }}</strong>
<span class="fleche">
<span class="ligne1"></span>
<span class="ligne2"></span>
</span>
</span>
</h2>
<div class="content-table03 none">
<table class="table03 marginT30">
{% for sale in afterSales %}
{% if sale is defined and sale is not null and sale.type is constant('TYPE_ONLINE', sale) %}
<tr>
<td>
<div class="nom-vente">
<a href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}">
<span><i class="icon-vente-web"></i></span>
<span>
<span class="txttransform bold">{{ sale.displayedName }}</span>
<span>{{ sale.salingType|trans }}</span>
</span>
</a>
</div>
<p class="marginT20">
<span class="texte02">{{ 'frontend.home_content.pro.sale.closed'|trans }}</span>
{{ 'frontend.home_content.pro.sale.closed.since'|trans ~ ' ' ~ sale.endDate|locale_date(pattern='dd MMMM', locale=app.request.locale) ~ ' ' ~ 'frontend.home_content.pro.logged_in.sale.to'|trans ~ ' ' ~ sale.endDate|locale_date(pattern='HH:mm') }}
</p>
</td>
<td class="vente-cloturee">
<p><a href="{{ path('frontend_search_by_sale', {'sale': sale.id}) }}"
class="lien12 {{ 'salle-' ~ sale.room.code|lower }}">{{ 'frontend.home_content.sale.button.show'|trans }}</a>
</p>
</td>
</tr>
{% endif %}
{% endfor %}
</table>
{% if afterSales == null %}
<p class="titre03 paddingLR10">
<strong>{{ 'frontend.home_content.pro.logged_in.sale.ended.no_result'|trans }}</strong></p>
{% endif %}
</div>
</div>
{% endif %}