{% block content %}
{% set zonesKeys = [] %} {% set zonesWithPendingCountries = [] %} {#{% set totalZones = currentZones|length %}#} {% set totalZones = maxColumns %} {% set pendingCountries = [] %} {% set countriesInZone = true %} {% if totalZones <= 10 %} {% set fontSizeTable = '0.7rem' %} {% set fontSizeCountry = '0.5rem' %} {% elseif totalZones > 10 and totalZones <= 20 %} {% set fontSizeTable = '0.5rem' %} {% set fontSizeCountry = '0.4rem' %} {% elseif totalZones > 20 and totalZones <= 30 %} {% set countriesInZone = false %} {% set fontSizeTable = '0.3rem' %} {% set fontSizeCountry = '0.15rem' %} {% else %} {% set countriesInZone = false %} {% set fontSizeTable = '0.2rem' %} {% set fontSizeCountry = '0.05rem' %} {% endif %} {% for currentZones in zones %}
{% for zone, countries in currentZones %} {% set zonesKeys = zonesKeys|merge([zone]) %} {% endfor %} {% for rate in ratesByWeight %} {% set weightByZones = rate.result |json_decode(true) %} {% set currentValue = 0 %} {% for zone, value in weightByZones %} {% set currentValue = value %} {% set suse = 0 %} {% if courierCode == 'TNT' %} {% set suse = 0.02 * rate.name %} {% if suse < 0.50 %} {% set suse = 0.50 %} {% elseif suse > 10 %} {% set suse = 10 %} {% endif %} {% set currentValue = currentValue + suse %} {% endif %} {% if fuelSurcharge > 0 and fuelSurcharge is not null %} {% set currentValue = (currentValue * (1+(fuelSurcharge/100)))|round(2) %} {% endif %} {% if margin > 0 %} {% set currentValue = (currentValue/(1-(margin/100)))|round(2) %} {% endif %} {% endfor %} {% endfor %} {% for zone, countries in zonesWithPendingCountries %} {% endfor %}
Peso
{% set countries = countries|split(',') %} {% set totalCountries = countries|length %} {% for c in countries %} {% if loop.index < 10 and countriesInZone == true %}

{{ c|length > 11 ? c|slice(0, 11) ~ '...' : c }}

{% else %} {% set pendingCountries = pendingCountries|merge([c]) %} {% if loop.index == (totalCountries-1) %} {% set zonesWithPendingCountries = zonesWithPendingCountries|merge({ (zone ~ ' ') : [pendingCountries] }) %} {% if countriesInZone == true %}

Otros países*

{% endif %} {% endif %} {% endif %} {% endfor %} {% set pendingCountries = [] %}
{{ zone }}
{{ rate.name }}kg.{{ currentValue }}
Zonas Otros países*
{{ zone }} {{ countries[0]|join(',') }}
{% endblock %}
{% endblock %}