<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ tran("{pumping_sheet}") }}, #{{ pump_order.auto_number }}</title>

    <!-- Note: To work in reverse proxy, we cannot use an absolute path beginning with / -->
    <link href="{{ url_prefix }}/static/style.css" rel="stylesheet"/>
    <link href="{{ url_prefix }}/static/vendor/bootstrap.min.css" rel="stylesheet" />
  </head>

  <body>

    <div class="container print-repeated" id="main">

        {% include 'printouts/_logo.html' %}

        <!-- Head -->
        <div class="row mb-2 mt-3">

        <div class="col-6">
          <b>{{ setup.company_name }}</b>
          <div class="small">
              {{ setup.company_address }}<br>
              {{ setup.company_zip }}
              {{ setup.company_city }}<br>
              {{ tran("{company_idnum}") }}: {{ setup.company_idnum }}
              {{ tran("{Vat ID}") }}: {{ setup.company_vat_idnum }}<br>
              {{ setup.company_legal }}
          </div>
        </div>

        <div class="col-6 text-right">
            <h3>{{ tran("{pumping_sheet}") }}, #{{ pump_order.auto_number }}</h3>
        </div>

        </div>

        <!-- Production facility -->
        <div class="row border mb-2">
          <div class="col-4">
              <b>{{ tran("{facility}") }}</b>
              <div class="small">
                  {{ setup.facility_name }}<br>
                  {{ setup.facility_address }}<br>
                  {{ setup.facility_zip }}
                  {{ setup.facility_city }}<br>
                  {{ setup.facility_code }}
              </div>
          </div>
          <div class="col-4">
              <b>{{ tran("{certification}") }}</b>
              <div style="white-space: pre-wrap">{{ setup.certification_text }}</div>
          </div>
          <div class="col-4">
              <b>{{ tran("{t_human}") }}</b><br>
              {{ pump_order._t_human }}
          </div>
        </div>

        <!-- Customer -->
        <div class="row border mb-2">
          <div class="col-4">
              <b>{{ tran("{Customer}") }}</b><br>
              {{ pump_order.customer_name }}<br>
              {{ pump_order.customer_address }}<br>
              {{ pump_order.customer_zip }} {{ pump_order.customer_city }}<br>
              {{ tran("{company_idnum}") }}: {{ pump_order.customer_company_idnum }},
              {{ tran("{Vat ID}") }}: {{ pump_order.customer_vat_idnum }}
          </div>
          <div class="col-4">
              <b>{{ tran("{ConstructionSite}") }}</b><br>
              {{ pump_order.construction_site_name }}<br>
              {{ pump_order.construction_site_address }}<br>
              {{ pump_order.construction_site_zip }} {{ pump_order.construction_site_city }}<br>
          </div>
          <div class="col-4">
              <b>{{ tran("{Pump}") }}</b><br>
              {{ tran("{pump_registration_number}") }}: {{ pump_order.pump_registration_number }}<br>
              {{ pump_order.pump_pump_type }}
              <div class="small">
                  <b>{{ tran("{Driver}") }}</b><br>
                 {{ pump_order.pump_driver }}
                 {{ pump_order.pump_driver_contact }}
              </div>
          </div>
        </div>

        <!-- Data to be filled in by hand -->
        <table class="w-100 table table-bordered small mt-4">
            <tr>
                <td style="padding: 5px;">{{ tran("{amount}") }}</td>
                <td style="padding: 5px;">{{ tran("{paid_in_cash}") }}</td>
                <td colspan=2 style="padding: 5px;">{{ tran("{different_tariff_note}") }}</td>
            </tr>
            <tr>
                <td style="padding: 5px;"><br><br></td>
                <td style="padding: 5px;"></td>
                <td colspan=2 style="padding: 5px;"></td>
            </tr>
            <tr>
                <td style="padding: 5px;">{{ tran("{station_departure}") }}</td>
                <td style="padding: 5px;">{{ tran("{kms}") }}</td>
                <td style="padding: 5px;">{{ tran("{site_arrival}") }}</td>
                <td style="padding: 5px;">{{ tran("{hours}") }}</td>
            </tr>
            <tr>
                <td style="padding: 5px;"><br><br></td>
                <td style="padding: 5px;"></td>
                <td style="padding: 5px;"></td>
                <td style="padding: 5px;"></td>
            </tr>
            <tr>
                <td style="padding: 5px;">{{ tran("{station_arrival}") }}</td>
                <td style="padding: 5px;">{{ tran("{kms}") }}</td>
                <td style="padding: 5px;">{{ tran("{site_departure}") }}</td>
                <td style="padding: 5px;">&nbsp;</td>
            </tr>
            <tr>
                <td style="padding: 5px;"><br><br></td>
                <td style="padding: 5px;"></td>
                <td style="padding: 5px;"></td>
                <td style="padding: 5px;"></td>
            </tr>
            <tr>
                <td colspan=4 style="padding: 5px;">{{ tran("{surcharges_by_pricelists}") }}:</td>
            </tr>
            <tr>
                <td colspan=4 style="padding: 5px;">
                    {% for surcharge in pump_order._surcharges %}
                        <div class="row">
                            <div class="my-2 ml-3 d-flex col-1">
                                <div class="border mr-2 px-3 pt-2 pb-0">{{ surcharge.amount }}</div>
                                <div class="py-2 mr-2">
                                    {{ surcharge.unit_name or "x" }}
                                </div>
                            </div>
                            <div class="my-2 ml-3 py-2 col-6">
                                {{ surcharge.name }}
                            </div>
                        </div>
                    {% endfor %}
                </td>
            </tr>
        </table>

        <!-- naive separator -->
        <div class="mb-5">&nbsp;</div>

        <!-- Footer table -->
        <table class="w-100 table table-bordered">
          <tr>
            <td style="width:70%;">
                <div class="small"><b>{{ tran("{machine_operator}") }}</b></div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="border-top-dashed text-center small">{{ pump_order.car_driver }}</div>
            </td>
            <td rowspan="2" style="width:30%;">
                <div class="small"><b>{{ tran("{took_over}") }}</b></div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="mb-6">&nbsp;</div>
                <div class="border-top-dashed text-center small">{{ tran("{signature_hand}") }}</div>
            </td>
          </tr>
          <tr>
            <td class="small italic" style="white-space: pre-wrap">{{ setup.customer_consent_pump }}</td>
          </tr>
        </table>

        {% include 'printouts/_footer.html' %}

    </div>

    {% include 'printouts/_control_buttons.html' %}

  </body>
</html>
