{% set classPrice = constraintsFieldsVehicle.priceDiscount == false ? 'w-7' : 'w-5' %} {% set classReference = 'w-4' %} {% set classVehicleType = 'w-4' %} {% set classVin = 'w-9' %} {% set classImmat = "w-6" %} {% set classVo = 'w-5' %} {% set classSmallWidth = 'w-4' %} {% set classMediumWidth = 'w-5' %} {% set classColor = 'w-5' %} {% set classOrigin = 'w-5' %} {% set classBrandModelVersion = '' %} {% set classEquipment = '' %} {% set paddingSmall = 'p-3' %} {% set paddingMedium = 'p-4' %} {% set paddingLarge = 'p-5' %} {% set formattedData = {} %} {% set withEquipment = true %} {% for vehicleSelling in sellingData.vehicleSellings %} {% set isVN = vehicleSelling.vehicleData.voVnType == 'VN' %} {% set warrantyLabel = vehicleSelling.vehicleData.distanceTraveledWarranty is defined and vehicleSelling.vehicleData.distanceTraveledWarranty == true ? 'vehicle.warranty.yes_short'|trans({}, 'DocumentTrans') : 'vehicle.warranty.no_short'|trans({}, 'DocumentTrans') %} {% set taxHorsePowerLabel = vehicleSelling.vehicleData.taxHorsepower is not null ? ' CV' : null %} {% set airQualityCertification = vehicleSelling.vehicleData.airQualityCertification is not null ? vehicleSelling.vehicleData : null %} {% set priceDiscountValue = vehicleSelling.priceDiscount not in valueNull ? '-' ~ vehicleSelling.priceDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol : '0,00 ' ~ currencySymbol %} {% set rowspanValue = vehicleSelling.vehicleData.equipmentsTypeIsEnabled in valueNull ? 2 : 1 %} {% set vehicleFields = { 'voVnType': { 'label': 'vehicle.type', 'class': classVehicleType, 'padding': paddingMedium, 'value': ["voVnType", "vehicleType"], 'content': vehicleSelling.vehicleData.voVnType ~ " / " ~ vehicleSelling.vehicleData.vehicleType, }, 'reference': { 'label': 'vehicle.reference_short', 'class': classReference, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.reference, }, 'brand_model_version': { 'label': { 'brand': 'vehicle.brand', 'model': 'vehicle.model', 'version': 'vehicle.version'}, 'class': classBrandModelVersion, 'padding': paddingLarge ~ ' w-break', 'content': vehicleSelling.vehicleData.brand ~ ' ' ~ vehicleSelling.vehicleData.model ~ ' ' ~ vehicleSelling.vehicleData.version, }, 'licenseNumber': { 'label': 'vehicle.license_number', 'class': classImmat, 'padding': paddingMedium, 'content': vehicleSelling.vehicleData.licenseNumber, }, 'vin': { 'label': 'vehicle.serial_number', 'class': classVin, 'padding': paddingMedium, 'content': vehicleSelling.vehicleData.vin, }, 'vo': { 'label': 'vehicle.vo', 'class': classVo, 'padding': paddingMedium, 'content': isVN == false or displayVo == true ? vehicleSelling.vehicleData.vo : null }, 'distanceTraveled': { 'label': 'vehicle.mileage', 'class': classMediumWidth, 'rowspan': rowspanValue, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.distanceTraveled is not null ? vehicleSelling.vehicleData.distanceTraveled ~ ' km ' ~ warrantyLabel : null }, 'dateOfDistribution': { 'label': 'vehicle.date_of_distribution', 'class': classMediumWidth, 'rowspan': rowspanValue, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.dateOfDistribution is not null ? vehicleSelling.vehicleData.dateOfDistribution|date('d/m/Y') : ' ', }, 'color': { 'label': 'vehicle.color', 'class': classColor, 'rowspan': rowspanValue, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.color }, 'taxHorsepower': { 'label': 'vehicle.tax_horsepower', 'class': classSmallWidth, 'rowspan': rowspanValue, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.taxHorsepower ~ taxHorsePowerLabel }, 'extraUrbanKmConsumption': { 'label': 'vehicle.extra_urban_km_consumption', 'class': classSmallWidth, 'rowspan': rowspanValue, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.extraUrbanKmConsumption }, 'storage': { 'label': 'vehicle.storage', 'class': classSmallWidth, 'rowspan': rowspanValue, 'padding': paddingLarge, 'content': vehicleSelling.storage }, 'originName': { 'label': 'vehicle.origin', 'class': classOrigin, 'rowspan': rowspanValue, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.follow.originName }, 'europeanNorm': { 'label': 'vehicle.european_norm', 'class': classSmallWidth, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.europeanNorm|trans({}, 'EuropeanNormTrans') }, 'airQualityCertification': { 'label': 'vehicle.air_quality_certification', 'class': classSmallWidth, 'padding': paddingLarge, 'type': 'image', 'content': airQualityCertification }, 'estimateCost': { 'label': 'vehicle.estimate_cost', 'class': classMediumWidth, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.estimateCost|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol, }, 'sellPriceWithoutTaxWithoutDiscount': { 'label': 'administrative.short_price_without_tax', 'class': classPrice, 'padding': paddingLarge, 'content': vehicleSelling.sellPriceWithoutTaxWithoutDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol, }, 'priceDiscount': { 'label': 'administrative.price_without_tax_discount', 'class': classMediumWidth, 'padding': paddingLarge, 'content': priceDiscountValue, }, 'sellPriceWithoutTax': { 'label': 'administrative.short_price_without_tax_discount', 'class': classMediumWidth, 'padding': paddingLarge, 'content': vehicleSelling.sellPriceWithoutTax|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol, }, 'taxName': { 'label': 'administrative.tax', 'class': classPrice, 'padding': paddingLarge, 'content': vehicleSelling.taxName|trans({}, 'DocumentTrans') }, 'sellPriceWithTax': { 'label': 'administrative.short_price_with_tax', 'class': classPrice, 'padding': paddingLarge, 'content': vehicleSelling.sellPriceWithTax|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol, }, 'option_optional': { 'class': classEquipment, 'padding': paddingLarge, 'colspan': colSpanValue, 'content': vehicleSelling.vehicleData.equipmentsTypeIsEnabled.option_optional is not null ? vehicleSelling.vehicleData.equipmentsTypeIsEnabled.option_optional : null, 'type': 'equipment', }, } %} {% set formattedData = formattedData|merge({0:vehicleFields}) %} {% endfor %} {% set fieldsFormatted = formattedData[0] %} {% for fields in formattedData %} {% for key,value in fields %} {% if value.content not in valueNull or (value.type is defined and value.type == 'image' and value.content not in valueNull) %} {% set fieldsFormatted = fieldsFormatted|merge({(key):value}) %} {% endif %} {% endfor %} {% endfor %} {% if fieldsFormatted.priceDiscount.content in valueNull %} {% set fieldsFormatted = fieldsFormatted|merge({'sellPriceWithoutTax':'0'}) %} {% endif %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\header_table_vehicle.html.twig' %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\content_table_vehicle.html.twig' %} {% include 'AppBundle:Documents:v2\\Include\\Administrative\\footer_table_vehicle.html.twig' %}