{% macro getVo(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'previousValue': 'n°'}|merge(options|default({})) %} {% set value = object.vo is defined ? object.vo : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getBrand(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {}|merge(options|default({})) %} {% set value = object.brand is defined ? object.brand : '' %} {% set value = globalF.truncateValue(value, options) %} {{ value }} {% endmacro %} {% macro getModel(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {}|merge(options|default({})) %} {% set value = object.model is defined ? object.model : '' %} {% set value = globalF.truncateValue(value, options) %} {{ value }} {% endmacro %} {% macro getVersion(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {}|merge(options|default({})) %} {% set value = object.version is defined ? object.version : '' %} {% set value = globalF.truncateValue(value, options) %} {{ value }} {% endmacro %} {% macro getLicenseNumber(object, options) %} {% set value = object.licenseNumber is defined ? object.licenseNumber : '' %} {{ value }} {% endmacro %} {% macro getDateOfDistribution(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = options|merge({}) %} {% set value = object.dateOfDistribution is defined ? object.dateOfDistribution : '' %} {% set value = globalF.formatDate(value, options) %} {{ value }} {% endmacro %} {% macro getDistanceTraveled(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'vehicle.mileage'|trans({}, 'DocumentTrans')}|merge(options|default({})) %} {% set value = object.distanceTraveled is defined ? object.distanceTraveled : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getEnergy(object, options) %} {% set options = {}|merge(options|default({})) %} {% set value = object.energy is defined ? object.energy : '' %} {% if value is not empty and options.slice is defined %} {% set value = value[:options.slice] %} {% endif %} {{ value }} {% endmacro %} {% macro getGearbox(object, options) %} {% set value = object.gearbox is defined ? object.gearbox : '' %} {{ value }} {% endmacro %} {% macro getColor(object, options) %} {% set value = object.color is defined ? object.color : '' %} {{ value }} {% endmacro %} {% macro getSeats(object, options) %} {% set value = object.seats is defined ? object.seats : '' %} {{ value }} {% endmacro %} {% macro getExtraUrbanKmConsumption(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'vehicle.extra_urban_km_consumption_suffix'|trans({}, 'DocumentTrans')}|merge(options|default({})) %} {% set value = object.extraUrbanKmConsumption is defined ? object.extraUrbanKmConsumption : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getExtraUrbanKmConsumptionLetter(object, options) %} {% set options = {}|merge(options|default({})) %} {% set value = object.extraUrbanKmConsumption is defined ? object.extraUrbanKmConsumption : '' %} {% if value is not empty %} {% if value <= 100 %} {% set value = 'A' %} {% set text = 'inférieures à 100 g/km' %} {% elseif value >= 101 and value <= 120 %} {% set value = 'B' %} {% set text = 'de 101 à 120 g/km' %} {% elseif value >= 121 and value <= 140 %} {% set value = 'C' %} {% set text = 'de 121 à 140 g/km' %} {% elseif value >= 141 and value <= 160 %} {% set value = 'D' %} {% set text = 'de 141 à 160 g/km' %} {% elseif value >= 161 and value <= 200 %} {% set value = 'E' %} {% set text = 'de 161 à 200 g/km' %} {% elseif value >= 201 and value <= 250 %} {% set value = 'F' %} {% set text = 'de 201 à 250 g/km' %} {% elseif value >= 251 %} {% set value = 'G' %} {% set text = 'supérieures à 250 g/km' %} {% endif %} {% endif %} {{ value }} {% endmacro %} {% macro getExtraUrbanKmConsumptionDesc(object, options) %} {% set options = {}|merge(options|default({})) %} {% set value = object.extraUrbanKmConsumption is defined ? object.extraUrbanKmConsumption : '' %} {% if value is not empty %} {% if value <= 100 %} {% set value = 'inférieures à 100 g/km' %} {% elseif value >= 101 and value <= 120 %} {% set value = 'de 101 à 120 g/km' %} {% elseif value >= 121 and value <= 140 %} {% set value = 'de 121 à 140 g/km' %} {% elseif value >= 141 and value <= 160 %} {% set value = 'de 141 à 160 g/km' %} {% elseif value >= 161 and value <= 200 %} {% set value = 'de 161 à 200 g/km' %} {% elseif value >= 201 and value <= 250 %} {% set value = 'de 201 à 250 g/km' %} {% elseif value >= 251 %} {% set value = 'supérieures à 250 g/km' %} {% endif %} {% endif %} {{ value }} {% endmacro %} {% macro getUrbanConsumption(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'l/100 km'}|merge(options|default({})) %} {% set value = object.urbanConsumption is defined ? object.urbanConsumption : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getMixteConsumption(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'l/100 km'}|merge(options|default({})) %} {% set value = object.mixteConsumption is defined ? object.mixteConsumption : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getExtraUrbanConsumption(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'l/100 km'}|merge(options|default({})) %} {% set value = object.extraUrbanConsumption is defined ? object.extraUrbanConsumption : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getTaxHorsePower(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'vehicle.tax_horsepower_suffix'|trans({}, 'DocumentTrans')}|merge(options|default({})) %} {% set value = object.taxHorsepower is defined ? object.taxHorsepower : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getHorsePower(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'ch'}|merge(options|default({})) %} {% set value = object.horsepower is defined ? object.horsepower : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getWarranty(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {}|merge(options|default({})) %} {% set warrantyType = object.warrantyType is defined ? object.warrantyType : '' %} {% if warrantyType == constant("AppBundle\\Entity\\Vehicle\\Vehicle::VEHICLE_WARRANTY_TYPE_WITH") and object.warrantyLabel is defined %} {% set value = object.warrantyLabel %} {% elseif warrantyType == constant("AppBundle\\Entity\\Vehicle\\Vehicle::VEHICLE_WARRANTY_TYPE_MANUFACTURER") %} {% set value = 'vehicle.warranty.type.manufacturer'|trans({}, 'DocumentTrans') %} {% elseif warrantyType == constant("AppBundle\\Entity\\Vehicle\\Vehicle::VEHICLE_WARRANTY_TYPE_WITHOUT") %} {% set value = 'vehicle.warranty.type.without'|trans({}, 'DocumentTrans') %} {% else %} {% set value = '' %} {% endif %} {% set value = globalF.truncateValue(value, options) %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getDistanceTraveledWarranty(object, options) %} {% set value = object.distanceTraveledWarranty is defined and object.distanceTraveledWarranty == true ? 'vehicle.warranty.yes'|trans({}, 'DocumentTrans') : 'vehicle.warranty.no'|trans({}, 'DocumentTrans') %} {{ value }} {% endmacro %} {% macro getNbEquipmentOptional(object, options) %} {% set equipmentOptionalList = object.equipmentOptional is defined ? object.equipmentOptional : '' %} {{ equipmentOptionalList|length }} {% endmacro %} {% macro getNbEquipmentStandard(object, options) %} {% set equipmentStandardList = object.equipmentStandard is defined ? object.equipmentStandard : '' %} {{ equipmentStandardList|length }} {% endmacro %} {% macro getEquipmentOptionalList(object, options) %} {% import _self as vehicleF %} {% set equipmentOptionalList = object.equipmentOptional is defined ? object.equipmentOptional : '' %} {% if options.isTwoColumn is defined and options.isTwoColumn == true %} {{ vehicleF.getEquipmentTwoColumnsList(equipmentOptionalList, options) }} {% else %} {{ vehicleF.getEquipmentOneColumnList(equipmentOptionalList, options) }} {% endif %} {% endmacro %} {% macro getEquipmentStandardList(object, options) %} {% import _self as vehicleF %} {% set equipmentStandardList = object.equipmentStandard is defined ? object.equipmentStandard : '' %} {% if options.isTwoColumn is defined and options.isTwoColumn == true %} {{ vehicleF.getEquipmentTwoColumnsList(equipmentStandardList, options) }} {% else %} {{ vehicleF.getEquipmentOneColumnList(equipmentStandardList, options) }} {% endif %} {% endmacro %} {% macro getRandomEquipmentList(object, options) %} {% import _self as vehicleF %} {% set randomEquipmentList = object.getEquipmentList is defined ? object.getEquipmentList : '' %} {% if randomEquipmentList != '' %} {% set vehicleManager = get_service('app_bundle.manager.vehicle') %} {% set randomEquipmentList = vehicleManager.shuffleOptionList(randomEquipmentList) %} {% set randomEquipmentList = vehicleManager.getOptionListWithSize(randomEquipmentList, options) %} {% endif %} {% if options.isTwoColumn is defined and options.isTwoColumn == true %} {{ vehicleF.getEquipmentTwoColumnsList(randomEquipmentList, options) }} {% else %} {{ vehicleF.getEquipmentOneColumnList(randomEquipmentList, options) }} {% endif %} {% endmacro %} {% macro getEquipmentTwoColumnsList(equipmentList, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'maxElt': 10000000}|merge(options|default({})) %} {% if options.maxElt > 0 %} {% set i = 0 %} {% set firstColumn = options.firstColumn is defined ? options.firstColumn : '' %} {% set secondColumn = options.secondColumn is defined ? options.secondColumn : '' %} {% for eq in equipmentList if i < options.maxElt %} {% if options.toDisplay and eq.toDisplay == false %} {% else %} {% if eq is not empty %} {% set afterValueInit = options.afterValue is defined ? options.afterValue : '' %} {% if options.displayPrice is defined and options.displayPrice == true %} {% set price = '' %} {% set price %} {% include 'AppBundle:Utility:localized_currency.html.twig' with { 'value': eq.price, 'group': eq.option.group, 'removeEmptyDecimal': true } %} {% endset %} {% set price = ' ' ~ price ~ '' %} {% set options = options|merge({'afterValue' : price ~ afterValueInit }) %} {% endif %} {% if options.isNotTruncate is not defined %} {% set value = globalF.truncateValue(eq, options) %} {% else %} {% set value = eq %} {% endif %} {% set value = globalF.displayLabel(value, options) %} {% set i = i + 1 %} {% if i is not odd %} {% if i == options.maxElt %} {% set secondColumn = secondColumn ~ '

...

' %} {% else %} {% set secondColumn = secondColumn ~ value %} {% endif %} {% else %} {% set firstColumn = firstColumn ~ value %} {% endif %} {% if i == options.maxElt and i is odd %} {% set secondColumn = secondColumn ~ '

...

' %} {% endif %} {% set options = options|merge({'afterValue' : afterValueInit }) %} {% endif %} {% endif %} {% endfor %} {% set value = firstColumn ~ '' ~ '' ~ secondColumn ~ '' %} {{ value|raw }} {% endif %} {% endmacro %} {% macro getEquipmentOneColumnList(equipmentList, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'maxElt': 10000000}|merge(options|default({})) %} {% if options.maxElt > 0 %} {% set i = 0 %} {% for eq in equipmentList if i < options.maxElt %} {% if options.toDisplay and eq.toDisplay == false %} {% else %} {% if eq is not empty %} {% set afterValueInit = options.afterValue is defined ? options.afterValue : '' %} {% if options.displayPrice is defined and options.displayPrice == true %} {% set price = '' %} {% set price %} {% include 'AppBundle:Utility:localized_currency.html.twig' with { 'value': eq.price, 'group': eq.option.group, 'removeEmptyDecimal': true } %} {% endset %} {% set price = ' ' ~ price ~ '' %} {% set options = options|merge({'afterValue' : price ~ afterValueInit }) %} {% endif %} {% if options.isNotTruncate is not defined %} {% set value = globalF.truncateValue(eq, options) %} {% else %} {% set value = eq %} {% endif %} {% set value = globalF.displayLabel(value, options) %} {% set i = i + 1 %} {% if i > options.maxElt %} {% set value = '

...

' %} {% endif %} {{ value|raw }} {% set options = options|merge({'afterValue' : afterValueInit }) %} {% endif %} {% endif %} {% endfor %} {% endif %} {% endmacro %} {% macro getPriceSeller(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'ttc', 'localizeCurrency': true}|merge(options|default({})) %} {% set value = object.priceSeller is defined ? object.priceSeller : '' %} {% if options.localizeCurrency == true %} {% set value %} {% include 'AppBundle:Utility:localized_currency.html.twig' with { 'value': value, 'group': object.group, 'removeEmptyDecimal': true } %} {% endset %} {% endif %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getPricePublic(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'ttc', 'localizeCurrency': true}|merge(options|default({})) %} {% set value = object.pricePublic is defined ? object.pricePublic : '' %} {% if options.localizeCurrency == true %} {% set value %} {% include 'AppBundle:Utility:localized_currency.html.twig' with { 'value': value, 'group': object.group, 'removeEmptyDecimal': true } %} {% endset %} {% endif %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getPricePublicWithoutTax(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'ht', 'localizeCurrency': true}|merge(options|default({})) %} {% set value = object.pricePublicWithoutTax is defined ? object.pricePublicWithoutTax : '' %} {% if options.localizeCurrency == true %} {% set value %} {% include 'AppBundle:Utility:localized_currency.html.twig' with { 'value': value, 'group': object.group, 'removeEmptyDecimal': true } %} {% endset %} {% endif %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getVin(object, options) %} {% set value = object.vin is defined ? object.vin : '' %} {{ value }} {% endmacro %} {% macro getCountry(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set value = object.country is defined ? globalF.getCountry(object.country, {'countries': options.countries}) : '' %} {{ globalF.formatDate(currentDate, {'timezone': timezone}) }} {{ value }} {% endmacro %} {% macro getWarrantyDuration(object, options) %} {% set afterValue = options.afterValue is defined and options.afterValue is not empty ? options.afterValue : ' mois' %} {% set value = object.warrantyType is defined and object.warrantyType in [constant("AppBundle\\Entity\\Vehicle\\Vehicle::VEHICLE_WARRANTY_TYPE_WITH"), constant("AppBundle\\Entity\\Vehicle\\Vehicle::VEHICLE_WARRANTY_TYPE_MANUFACTURER")] and object.warrantyDuration is not empty ? object.warrantyDuration ~ afterValue : "" %} {{ value|raw }} {% endmacro %} {% macro getTitleWithIsRecoverableVat(object, options) %} {% set previousValue = options.previousValue is defined and options.previousValue is not empty ? options.previousValue : '' %} {% set afterValue = options.afterValue is defined and options.afterValue is not empty ? options.afterValue : '' %} {% set value = object.isRecoverableVat is defined and object.isRecoverableVat == true ? ' - TVA récupérable' : '' %} {% if previousValue is defined and previousValue is not empty %} {% set value = previousValue ~ ' ' ~ value %} {% endif %} {% if afterValue is defined and afterValue is not empty %} {% set value = value ~ ' ' ~ afterValue %} {% endif %} {{ value|raw }} {% endmacro %} {% macro getYear(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = options|merge({'dateFormat' : 'yyyy'}) %} {% set value = object.year is defined ? object.year : '' %} {% set value = globalF.formatDate(value, options) %} {{ value }} {% endmacro %} {% macro getTypeVoVn(object, options) %} {% set value = object.typeVoVn is defined ? object.typeVoVn : '' %} {{ value }} {% endmacro %} {% macro getVehicleType(object, options) %} {% set value = object.vehicleType is defined ? object.vehicleType : '' %} {{ value }} {% endmacro %} {% macro getGender(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {}|merge(options|default({})) %} {% set value = object.gender is defined ? object.gender : '' %} {% set value = globalF.truncateValue(value, options) %} {{ value }} {% endmacro %} {% macro getWarrantyEndDate(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set value = object.warrantyEndDate is defined ? object.warrantyEndDate : '' %} {% set value = globalF.formatDate(value, options) %} {{ value }} {% endmacro %} {% macro getWarrantyKilometric(object, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set options = {'afterValue': 'km'}|merge(options|default({})) %} {% set value = object.warrantyKilometric is defined ? object.warrantyKilometric : '' %} {% set value = globalF.displayLabel(value, options) %} {{ value }} {% endmacro %} {% macro getBodyWork(object, options) %} {% set value = object.bodywork is defined ? object.bodywork : '' %} {{ value }} {% endmacro %} {% macro getOrigin(object, options) %} {% set value = object.origin is defined ? object.origin : '' %} {{ value }} {% endmacro %} {% macro getFirstHand(object, options) %} {% set value = object.firstHand is defined ? object.firstHand : '' %} {% if value == 1 %} {% set value = 'yes'|trans({}, 'DocumentTrans')|capitalize %} {% else %} {% set value = 'no'|trans({}, 'DocumentTrans')|capitalize %} {% endif %} {{ value }} {% endmacro %} {% macro getEstimateCost(object, options) %} {% set value = object.estimateCost is defined ? object.estimateCost|number_format(2, ',', ' ') : '' %} {{ value }} {% endmacro %} {% macro getTypeVoVn(object, options) %} {% set value = object.typeVoVn is defined ? object.typeVoVn : '' %} {{ value }} {% endmacro %} {% macro getVoVnType(object, options) %} {% set value = object.voVnType is defined ? object.voVnType : '' %} {{ value }} {% endmacro %} {% macro getVehicleType(object, options) %} {% set value = object.vehicleType is defined ? object.vehicleType : '' %} {{ value }} {% endmacro %} {% macro getInternalReference(object, options) %} {% set value = object.internalReference is defined ? object.internalReference : '' %} {{ value }} {% endmacro %} {% macro getAirQualityCertificationUrl(object, options) %} {% import 'AppBundle:Documents:Import\\air_quality_certification.html.twig' as airQualityCertificationF %} {% import 'AppBundle:Documents:v2\\Import\\init_variables.html.twig' as initVariablesF %} {% set value = airQualityCertificationF.getValue(object.airQualityCertification)|trim %} {% if value is not empty %} {% set value = initVariablesF.getAirQualityCertificationImagesUri(value ~ '.png') %} {% endif %} {{ value }} {% endmacro %} {% macro getEuropeanNorm(object, options) %} {% set value = object.europeanNorm is defined ? object.europeanNorm : '' %} {% if value is not empty %} Euro {{ value|slice(-1,1) }} {% endif %} {% endmacro %} {% macro getReference(object, options) %} {% set value = object.reference is defined ? object.reference : '' %} {{ value }} {% endmacro %} {% macro getInsideColor(object, options) %} {% set value = object.insideColor is defined ? object.insideColor : '' %} {{ value }} {% endmacro %} {% macro getEquipmentOptionalListCustom(object, options) %} {% import _self as vehicleF %} {% set equipmentOptionalList = object.equipmentOptional is defined ? object.equipmentOptional : '' %} {{ vehicleF.getEquipmentListCustom(equipmentOptionalList, options) }} {% endmacro %} {% macro getEquipmentListCustom(equipmentList, options) %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% if equipmentList is not empty %} {% set i = 0 %} {% set j = 0 %} {% for equipment in equipmentList %} {% if j <= options.maxCharacters %} {% if i != options.maxElt %} {% set value = equipment.option.name %} {% if equipment.price is defined and equipment.price is not empty %} {% endif %} {% set i = i + 1 %} {% set j = j + value|length %} {% if j >= options.maxCharacters or i == options.maxElt %} {% endif %} {% endif %} {% endif %} {% endfor %}

- {{ value }}

{{ equipment.price }} {{ currencySymbol }}

...

{% endif %} {% endmacro %} {% macro getEquipmentStandardListCustom(object, options) %} {% import _self as vehicleF %} {% import 'AppBundle:Documents:v2\\Import\\global.html.twig' as globalF %} {% set equipmentStandardList = object.equipmentStandard is defined ? object.equipmentStandard : '' %} {% if equipmentStandardList is not empty %} {% set i = 0 %} {% set j = 0 %} {% set firstColumn = options.firstColumn is defined ? options.firstColumn : '' %} {% set secondColumn = options.secondColumn is defined ? options.secondColumn : '' %} {% for eq in equipmentStandardList %} {% if j <= options.maxCharacters %} {% if i != options.maxElt %} {% if eq is not empty %} {% set afterValueInit = options.afterValue is defined ? options.afterValue : '' %} {% set value = globalF.displayLabel(eq, options) %} {% set i = i + 1 %} {% set j = j + eq|length %} {% if j >= options.maxCharacters or i == options.maxElt %} {% if i is not odd %} {% set secondColumn = secondColumn ~ '

...

' %} {% else %} {% set firstColumn = firstColumn ~ '

...

' %} {% endif %} {% elseif i is not odd %} {% set secondColumn = secondColumn ~ value %} {% else %} {% set firstColumn = firstColumn ~ value %} {% endif %} {% set options = options|merge({'afterValue' : afterValueInit }) %} {% endif %} {% endif %} {% endif %} {% endfor %} {% set value = firstColumn ~ '' ~ '' ~ secondColumn ~ '' %} {{ value|raw }} {% endif %} {% endmacro %} {% macro getDistanceTraveledWarrantyLabel(vehicle) %} {% if vehicle.distanceTraveledWarranty %} {% set value = 'Au compteur garanti' %} {% else %} {% set value = 'Au compteur non garanti' %} {% endif %} {{ value }} {% endmacro %}