<?xml version="1.0"?>
<t name="My Purchase Orders" t-name="purchase.portal_my_purchase_orders">
      <t t-call="portal.portal_layout">
          <t t-set="breadcrumbs_searchbar" t-value="True"/>

          <t t-call="portal.portal_searchbar">
              <t t-set="title">Purchase Orders</t>
          </t>
          <t t-if="not orders">
              <p>There are currently no purchase orders for your account.</p>
          </t>
          <t t-if="orders" t-call="portal.portal_table">
              <thead>
                  <tr class="active">
                      <th>
                          <span class="d-none d-md-inline">Purchase Order #</span>
                          <span class="d-block d-md-none">Ref.</span>
                      </th>
                      <th class="text-end">
                          <span class="d-none d-md-inline">Confirmation Date</span>
                          <span class="d-block d-md-none">Confirmation</span>
                      </th>
                      <th class="text-center"/>
                      <th class="text-end">Total</th>
                  </tr>
              </thead>
              <t t-foreach="orders" t-as="order">
                  <tr>
                      <td><a t-att-href="order.get_portal_url()"><t t-esc="order.name"/></a></td>
                      <td class="text-end">
                          <span t-field="order.date_approve" t-options="{'widget': 'date'}"/>&amp;nbsp;
                          <span class="d-none d-md-inline" t-field="order.date_approve" t-options="{'time_only': True}"/>
                      </td>
                      <td class="text-center">
                          <span t-if="order.invoice_status == 'to invoice'" class="badge rounded-pill text-bg-info">
                              <i class="fa fa-fw fa-file-text" role="img" aria-label="Waiting for Bill" title="Waiting for Bill"/><span class="d-none d-md-inline"> Waiting for Bill</span>
                          </span>
                          <span t-if="order.state == 'cancel'" class="badge rounded-pill text-bg-secondary">
                              <i class="fa fa-fw fa-remove" role="img" aria-label="Cancelled" title="Cancelled"/><span class="d-none d-md-inline"> Cancelled</span>
                          </span>
                          <span t-if="order.state == 'done'" class="badge rounded-pill text-bg-success">
                              <i class="fa fa-fw fa-check" role="img" aria-label="Done" title="Done"/><span class="d-none d-md-inline"> Done</span>
                          </span>
                      </td>
                      <td class="text-end"><span t-field="order.amount_total"/></td>
                  </tr>
              </t>
          </t>
      </t>
  </t>

  