<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title>{{ tran("{DeliverySheet}") }} {{ order.auto_number }}</title>

    <!-- Do not import Bootstrap in this file, it fucks it up -->
    <!-- Note: in order to work in reverse proxy, we cannot use an absolute path beginning with / -->
    {% include 'printouts/_overlay.html' %}
    <style>
      @media print {
        .no-print {
          display: none;
        }
      }
      @media not print {
        #main {
          background-image: url("{{ url_prefix }}/static/delivery_sheet/background/kvd.jpg");
        }
      }
    </style>
  </head>
  <body onload="prune()">

    <div class="print-repeated" id="main">
	    <span class="float" style="top: 15mm; left: 161mm; width: 22mm; text-align: center;">{{ order.auto_number }}</span> <!-- dodací list č. -->
	    <span class="float" style="top: 32.5mm; left: 85mm; width: 19mm;">{{ order._t_human.split()[0] }}</span> <!-- datum vystaveni -->
	    <span class="float" style="top: 32.5mm; left: 140mm; width: 15mm;">{{ order._temperature_air_str }}</span> <!-- teplota vzduchu -->
	    <span class="float" style="top: 32.5mm; left: 190mm; width: 15mm;">{{ order._temperature_concrete_str }}</span> <!-- teplota betonu -->
	    <span class="float" style="top: 44mm; left: 140mm; width: 65mm; height: 30mm;"> <!-- kupující -->
        {% set customer = order._customer_record %}
        <b>{{ order.customer }}</b><br>
        {{ customer.address }}<br>
        {{ customer.zip }} {{ customer.city }}<br>
        <br>
        IČO: {{ customer.company_idnum }}<br>
        DIČ: {{ customer.vat_idnum }}
      </span>
	    <span class="float" style="top: 78mm; left: 140mm; width: 65mm;">{{ order.construction_site }}</span> <!-- stavba -->
	    <span class="float" style="top: 95.5mm; left: 44mm; width: 14mm;">{{ order.r_d_max }}</span> <!-- Dmax -->
	    <span class="float" style="top: 100.5mm; left: 44mm; width: 14mm;">{{ order.r_air_content }}</span> <!-- obsah vzduchu -->
	    <span class="float" style="top: 105.5mm; left: 44mm; width: 14mm;">{{ order.r_vc }}</span> <!-- vodní součinitel -->
      <span class="float multiline" style="top: 111mm; left: 27mm; width: 31mm; height: 16.5mm;">{{ materials["Admixture_multiline"] }}</span><!-- přísada typ 1, 2, 3, 3.5 -->
      <span class="float" style="top: 95.5mm; left: 82mm; width: 24mm;">{{ order.r_consistency_class }}</span> <!-- konzistence -->
      <span class="float" style="top: 100.5mm; left: 82mm; width: 24mm;">{{ materials["Cement_oneline"] }}</span> <!-- cement typ -->
      <span class="float" style="top: 105.5mm; left: 82mm; width: 24mm;">{{ materials["Addition_oneline"] }}</span> <!-- příměs typ -->
	    <span class="float" style="top: 110.5mm; left: 90mm; width: 16mm;">{{ order.r_cl_content }}</span> <!-- obsah chloridů -->
	    <span class="float" style="top: 95.5mm; left: 153mm; width: 49mm;">{{ order.r_name }}</span> <!-- Název výrobku -->
	    <span class="float" style="top: 100.5mm; left: 153mm; width: 49mm;">{{ order.r_exposure_classes }}</span> <!-- Vlivy prostředí -->
	    <span class="float" style="top: 105.5mm; left: 153mm; width: 49mm;">{{ order.r_number }}</span> <!-- Kod -->
	    <span class="float" style="top: 110.5mm; left: 153mm; width: 49mm;">{{ order.r_workability_time }}</span> <!-- doba zpracovatelnosti -->
	    <span class="float" style="top: 115.5mm; left: 153mm; width: 49mm;">{{ order.r_ufi_code }}</span> <!-- UFI kód -->
	    <span class="float" style="top: 122mm; left: 161.5mm; width: 40.5mm; height: 8mm; font-size: 28px;"><b>{{ order.volume }}</b></span> <!-- dodáno množství -->
	    <span class="float" style="top: 131mm; left: 27mm; width: 175mm;">{{ order.comment }}</span> <!-- poznámka -->
	    <span class="float" style="top: 144.5mm; left: 45mm; width: 60mm;">{{ delivery._t_human }}</span> <!-- čas naplnění míchačky -->
	    <span class="float" style="top: 149.5mm; left: 45mm; width: 60mm;">{{ order.audit_changed_by }}</span> <!-- vyrobil -->
	    <span class="float" style="top: 154.5mm; left: 45mm; width: 60mm;">{{ delivery.car_registration_number }}</span> <!-- RZ SPZ -->
	    <span class="float" style="top: 159.5mm; left: 45mm; width: 60mm;">{{ delivery.driver_name }}</span> <!-- převzal řidič -->
	    <span class="float" style="top: 164.5mm; left: 71mm; width: 34mm;">{{ delivery.site_distance or 0 }} km</span> <!-- vzdálenost na stavbu celkem -->
	    <span class="float" style="top: 169.5mm; left: 24mm; width: 20mm;">{{ order._distance_driven_extra or 0 }}</span> <!-- km navíc -->
	    <span class="float" style="top: 169.5mm; left: 71mm; width: 34mm;">{{ unload_time_quarter_hours_str }}</span> <!-- počet 1/4 hodin -->
	    <span class="float" style="top: 174.5mm; left: 69mm; width: 36mm;">{{ delivery._construction_site_arrival_t_human }}</span> <!-- příjezd na stavbu -->
	    <span class="float" style="top: 179.5mm; left: 35mm; width: 25mm;">{{ delivery._unload_start_t_human.split()[1] }}</span> <!-- vykládka od -->
	    <span class="float" style="top: 179.5mm; left: 69mm; width: 36mm;">{{ delivery._unload_end_t_human.split()[1] }}</span> <!-- vykládka do -->
    </div>

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

  </body>
</html>
