<div class="row">
  <div class="page-wrapper chiller-theme toggled">
    <nav id="sidebar" class="sidebar-wrapper">
      <menu-admin name={{name}} dock={{dock}}></menu-admin>
      <link-exit></link-exit>
    </nav>

    <main class="page-content">
      <div class="container justify-content-md-center" ng-init="inicio()">

        <h2>Pedido {{order.orderId}}</h2>

        <p ng-show="mensagem.length" class="alert alert-info">{{mensagem}}</p>

        <div class="row form-login">
          <div class="col-md-10">
            <form name="formOrder" ng-submit="submeter()" novalidate >
              <div class="form-row">
                <div class="col-md-4">
                  <input type="text" class="form-control" placeholder="Número da Nota Fiscal" ng-model="order.nf" required>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control" placeholder="Código de Rastreio" ng-model="order.rastreio" required>
                </div>
                <div class="col-md-4">
                  <input type="text" class="form-control"  placeholder="Valor Total {{ (order.value / 100).toFixed(2).replace('.', ',') }}" readonly>
                </div>

              </div>

              <div class="form-row form-login">
                <table class="table">
                  <thead>
                    <tr>
                      <th scope="col">#</th>
                      <th scope="col">Produto</th>
                      <th scope="col">Quantidade</th>
                      <th scope="col">Valor</th>
                    </tr>
                  </thead>
                  <tbody ng-repeat="i in items">
                    <tr>
                      <th scope="row">{{ i.ean }}</th>
                      <td>{{ i.productName }}</td>
                      <td>{{ i.quantity }}</td>
                      <td>{{ (i.price / 100).toFixed(2).replace(".", ",") }}</td>
                    </tr>
                  </tbody>

                </table>
                <button type="submit" class="btn btn-success mb-2" ng-disabled="formOrder.$invalid">Faturar</button>

                <a href="#/orders/{{ order.orderId }}" role="button" class="btn btn-primary mb-2 space-left">Voltar</a>
              </div>
            </form>
          </div>
        </div>

      </div>
    </main>

  </div>

</div>
