<body style="padding: 0;margin: 0;">
<div id="mail" style="padding: 0 20px;width: 600px;margin: 0 auto;font-family: Arial, sans-serif;font-size: 16px;color: #222;">
    <div class="top-info" style="width: 430px;margin: 0 auto;border-bottom: 2px solid #aaa;line-height: 36px;text-align: center;font-size: 14px;">Proszę nie odpowiadać na tę wiadomość.</div>

    <div class="header">
        <div class="top" style="margin-top: 30px;padding: 0 20px;">
            <div class="logo" style="float: left;line-height: 36px;">
                <a href="{{ homepage_url }}"><img src="{{ asset('bundles/app/img/logo.png', null, true) }}"></a>
            </div>

            <div class="clear" style="clear: both;"></div>
        </div>

        <div class="welcome" style="margin-top: 20px; margin-left:20px">
            Dziękujemy za wysłanie zapytania o transport morski drobnicy.
        </div>
    </div>

    <div class="table" style="padding: 0 20px;margin-top: 25px;width: 100%;font-size: 14px;">
        <table style="width: 100%;border: 0;border-collapse: collapse;">
            <tr style="line-height: 36px;">
                <th colspan="2" style="border: 1px solid #bbb;background-color: #8397b0;font-weight: bold;text-align: center;font-size: 16px;">Podsumowanie zapytania</th>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Firma</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{% if application.company is empty %} - {% else %} {{ application.company }} {% endif %}</td>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Imię i nazwisko</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.fullName }}</td>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">E-mail</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.email }}</td>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Telefon</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{% if application.phone is empty %} - {% else %} {{ application.phone }} {% endif %}</td>
            </tr>
            <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Port załadunku</td>
                <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">{{ application.connection.loading.name }}</td>
            </tr>
            <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Port rozładunku</td>
                <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">{{ application.connection.unloading.name }}</td>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Waga</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.weight }} kg</td>
            </tr>
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Objętość</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.volume }} m&#179;</td>
            </tr>
            {% set x = '' %}{% if application.connection.useeuro == true %}{% set x = ' EURO' %}{% else %}{% set x = ' USD' %}{% endif %}
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Opłata dokumentacyjna</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.documentary ? application.documentary ~ x : 'NIE' }}</td>
            </tr>
            {% if application.connection.loading.country == 'Polska' %}
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Koszty magazynowe</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.warehouse ? application.warehouse|round(0, 'floor') ~ x : 'NIE' }}</td>
                </tr>
            {% else %}
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Koszty terminalowe THC</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.thc ? application.thc|round(0, 'floor') ~ x : 'NIE' }}</td>
                </tr>
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Podjęcie towaru z magazynu</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.isps ? application.isps ~ x : 'NIE' }}</td>
                </tr>
            {% endif %}
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Odprawa celna</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.customs ? application.customs ~ x : 'NIE' }}</td>
            </tr>
            {% if application.connection.loading.country != 'Polska' %}
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Dodatkowy transport drogowy</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.transport ? 'TAK' : 'NIE' }}</td>
                </tr>
            {% endif %}
            {% if application.transport %}
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Miasto</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.city }}</td>
                </tr>
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Kod pocztowy</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.postalCode }}</td>
                </tr>
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Wymiary</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.firstDimension ~ ' x ' ~ application.secondDimension ~ ' x ' ~ application.thirdDimension }}</td>
                </tr>
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Ilość sztuk</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">
                        {{ application.quantity }}
                        {% if application.quantityType == 'pallets' %}palet{% endif %}
                        {% if application.quantityType == 'packages' %}kartonów/paczek{% endif %}
                        {% if application.quantityType == 'unknown' %}nie wiem{% endif %}
                    </td>
                </tr>
            {% endif %}
            <tr style="line-height: 36px;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Koszt frachtu</td>
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">{{ application.connectionCost|round }} USD</td>
            </tr>
            {% if application.voucher %}
                <tr style="line-height: 36px;">
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Kod rabatowy</td>
                    <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">-{{ application.voucher.value }}%</td>
                </tr>
            {% endif %}
 {% set transportCost = application.documentary + application.customs %}

    {% if application.connection.loading.country == 'Polska' %}
        {% set transportCost = transportCost + application.warehouse|round(0, 'floor') %}
    {% else %}
        {% set transportCost = transportCost + application.thc|round(0, 'floor') + application.isps|round(0, 'floor')  %}
    {% endif %}
            {% if application.connection.useeuro == true %}
            <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Całkowity koszt USD</td>
                <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">
                    {{ application.connectionCost|round }} USD
                </td>
            </tr>
            <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Całkowity koszt EURO</td>
                <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">
                    {{ transportCost|round }} EURO
                </td>
            </tr>
          
            {% else %}


              <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                  <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Całkowity koszt USD</td>
                  <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">
                      {{ application.cost|round }} USD
                  </td>
              </tr>
            {% endif %}

            {% if application.connection.useeuro == true %}
            <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Całkowity szacowany koszt w PLN</td>
                <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">{{ ((application.connectionCost * application.exchangeRate)|round )+(( transportCost * application.exchangeRateeuro)|round) }} PLN</td>
            </tr>

            {% else %}

              <tr class="highlighted" style="line-height: 36px;font-weight: bold;background-color: #d5dce6;">
                  <td style="border: 1px solid #bbb;width: 50%;padding-left: 10px;">Całkowity szacowany koszt w PLN</td>
                  <td class="large" style="border: 1px solid #bbb;width: 50%;padding-left: 10px;font-size: 16px;">{{ (application.cost * application.exchangeRate)|round(0, 'floor') }} PLN</td>
              </tr>
            {% endif %}

        </table>
    </div>

    <div class="footer" style="margin-top: 25px;">
        <div class="message" style="margin-left:20px">
            Nasz konsultant skontaktuje się przez telefon/email w przeciągu dwóch dni roboczych.<br><br>
            Kalkulacja kosztów transportu jest aktualna w dniu wysłania.<br>
            <br>
            <br>
            Pozdrawia zespół,<br>
            <strong>Drobnicy Morskiej</strong><br>

            <div class="dashes" style="line-height: 33px;">--</div>

            <strong>Kontakt:</strong><br>
            Wojciech Froelich<br>
            tel. +48 58 785 38 01<br>
            tel.kom. +48 661 551 055<br>
            e-mail: w.froelich@drobnicamorska.pl<br>
        </div>

    </div>
</body>
