{% set classPrice = constraintsFieldsVehicle.priceDiscount == false ? 'w-7' : 'w-5' %} {% set classReference = 'w-5' %} {% set classVehicleType = 'w-4' %} {% set classVin = constraintsFieldsVehicle.estimateCost == false ? 'w-9' : 'w-7' %} {% 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 paddingSmall = 'p-3' %} {% set paddingMedium = 'p-4' %} {% set paddingLarge = 'p-5' %} {% set formattedData = {} %} {% 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 priceDiscountValue = vehicleSelling.priceDiscount not in valueNull ? '-' ~ vehicleSelling.priceDiscount|number_format(2, ',', ' ') ~ ' ' ~ currencySymbol : '0,00 ' ~ currencySymbol %} {% set vehicleFields = { 'reference': { 'label': 'vehicle.reference_short', 'class': classReference, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.internalReference, }, 'vin': { 'label': 'vehicle.serial_number', 'class': classVin, 'display': true, 'padding': paddingMedium, 'content': vehicleSelling.vehicleData.vin, }, 'licenseNumber': { 'label': 'vehicle.license_number', 'class': classImmat, 'padding': paddingMedium, 'content': vehicleSelling.vehicleData.licenseNumber, }, '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, }, 'color': { 'label': 'vehicle.color', 'class': classColor, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.color }, 'distanceTraveled': { 'label': 'vehicle.mileage', 'class': classMediumWidth, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.distanceTraveled is not null ? vehicleSelling.vehicleData.distanceTraveled ~ ' km ' : null }, 'dateOfDistribution': { 'label': 'vehicle.date_of_distribution', 'class': classMediumWidth, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.dateOfDistribution|date('d/m/Y'), }, 'taxHorsepower': { 'label': 'vehicle.tax_horsepower', 'class': classSmallWidth, 'padding': paddingSmall, 'content': vehicleSelling.vehicleData.taxHorsepower ~ taxHorsePowerLabel }, 'extraUrbanKmConsumption': { 'label': 'vehicle.co2', 'class': classSmallWidth, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.extraUrbanKmConsumption not in valueNull ? vehicleSelling.vehicleData.extraUrbanKmConsumption ~ ' g/km' : null }, 'state': { 'label': 'filter.label_state'|trans({}, 'VehicleTrans'), 'class': classMediumWidth, 'padding': paddingLarge, 'content': vehicleSelling.vehicleData.state|trans({}, 'VehicleTrans') }, '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, }, } %} {% 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' %}