<!DOCTYPE html>
<html dir="{{ direction }}" lang="{{ lang }}">
<head>
<meta charset="UTF-8" />
<title>Encomendas</title>
<base href="{{ base }}" />
<link href="view/javascript/bootstrap/css/bootstrap.css" rel="stylesheet" media="all" />
<script type="text/javascript" src="view/javascript/jquery/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="view/javascript/bootstrap/js/bootstrap.min.js"></script>
<link href="view/javascript/font-awesome/css/font-awesome.min.css" type="text/css" rel="stylesheet" />
<link type="text/css" href="view/stylesheet/stylesheet.css" rel="stylesheet" media="all" />
</head>
<body>
<div class="container">
  {% for order in orders %}
  <div style="page-break-after: always;"><br>
    <h4>Encomenda #{{ order.order_id }}</h4>
    <table class="table table-bordered">

      <tbody>
        <tr>
          <td style="width: 50%;"><address>
            <strong>{{ order.store_name }}</strong><br />
            <p style="font-size:10px;">{{ order.store_address }}</p>
            </address>
           <!-- <b>{{ text_telephone }}</b> {{ order.store_telephone }} |
            {% if order.store_fax %}
            <b>{{ text_fax }}</b> {{ order.store_fax }}<br />
            {% endif %}
            <b>{{ text_email }}</b> {{ order.store_email }}<br />-->
           <!-- {% if order.invoice_no %}
            <b><p style="font-size:10px;">{{ text_invoice_no }}</b> {{ order.invoice_no }}</p><br />
            {% endif %}-->
           <!-- <p style="font-size:10px;"><b>Nº</b> {{ order.order_id }}<br /></p>-->
            <p style="font-size:10px;"><b>Pagamento</b> {{ order.payment_method }}<br>
            {% if order.shipping_method %}
           <b>Envio</b> {{ order.shipping_method }}<br>
           <b>{{ text_date_added }}</b> {{ order.date_added }}</p>
          <td style="width: 50%;">
            <p style="font-size:10px;">{{ order.payment_address }}</p>
                           {% if account_custom_fields %}
                   {% for custom_field in account_custom_fields %}
                   <span style="color:red; font-size: 18px;">&nbsp;&nbsp;{{ custom_field.name }}</span> - 
                   {{ custom_field.value }}<br>
                   {% endfor %}
{% endif %} 
TETE
            {% endif %}</td>
        </tr>
      </tbody>
    </table>
 <!--   <table class="table table-bordered">
      <thead>
        <tr>
          <td style="width: 50%;"><b>Dados Cliente</b></td>
          <td style="width: 50%;"><b>Dados Envio</b></td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td><address>
            
            </address></td>
          <td><address>
            {{ order.shipping_address }}
            </address></td>
        </tr>
      </tbody>
    </table>-->
    <table class="table table-bordered">
      <thead>
        <tr>
          <td><b>{{ column_image }}</b></td>
          <td><b style="font-size:12px;">{{ column_product }}</b></td>
          <td><b style="font-size:12px;">{{ column_model }}</b></td>
          <td class="text-right"><b style="font-size:12px;">{{ column_quantity }}</b></td>
          <td class="text-right"><b style="font-size:12px;">P.unit.</b></td>
          <td class="text-right"><b style="font-size:12px;">{{ column_total }}</b></td>
        </tr>
      </thead>
      <tbody>
        {% for product in order.product %}
        <tr>
      <td class="text-left"><img src="{{ product.thumb }}" title="{{ product.name }}"  style="padding: 1px; border: 1px solid #DDDDDD; width:50px;" /></td>
          <td><p style="font-size:10px;">{{ product.name }}</p>
            {% for option in product.option %}
            <br />
            &nbsp;<small> - {{ option.name }}: {{ option.value }}</small>
            {% endfor %}</td>
          <td><p style="font-size:10px;">{{ product.model }}</p></td>
          <td class="text-right"><p style="font-size:10px;">{{ product.quantity }}</p></td>
          <td class="text-right"><p style="font-size:10px;">{{ product.price }}</p></td>
          <td class="text-right"><p style="font-size:10px;">{{ product.total }}</p></td>
        </tr>
        {% endfor %}
        {% for voucher in order.voucher %}
        <tr>
          <td>{{ voucher.description }}</td>
          <td></td>
          <td class="text-right">1</td>
          <td class="text-right">{{ voucher.amount }}</td>
          <td class="text-right">{{ voucher.amount }}</td>
        </tr>
        {% endfor %}
        {% for total in order.total %}
        <tr>
          <td class="text-right" colspan="5"><b>{{ total.title }}</b></td>
          <td class="text-right">{{ total.text }}</td>
        </tr>
        {% endfor %}
      </tbody>
    </table>
    {% if order.comment %}
    <table class="table table-bordered">
      <thead>
        <tr>
          <td><b>{{ text_comment }}</b></td>
        </tr>
      </thead>
      <tbody>
        <tr>
          <td>{{ order.comment }}</td>
        </tr>
      </tbody>
    </table>
    {% endif %}
  </div>
  {% endfor %}
</div>
</body>
</html>