<!-- SIDE MENU -->
<div id="dashboard-options-menu" class="side-menu dashboard left closed" ng-controller="initCtrl">
  <!-- SVG PLUS -->
  <svg class="svg-plus">
    <use xlink:href="#svg-plus"></use>
  </svg>
  <!-- /SVG PLUS -->
  <!-- SIDE MENU HEADER -->
  <div class="side-menu-header">
    <!-- USER QUICKVIEW -->
    <div class="user-quickview">
      <!-- USER AVATAR -->
      <a href="author-profile.html">
        <div class="outer-ring">
          <div class="inner-ring"></div>
          <figure class="user-avatar">
            <img src="asset/images/avatars/avatar_01.jpg" alt="avatar">
          </figure>
        </div>
      </a>
      <!-- /USER AVATAR -->
      <!-- USER INFORMATION -->
      <p class="user-money">{{user.username}}</p>
      <p class="user-name">Administrateur</p>
      <!-- /USER INFORMATION -->
    </div>
    <!-- /USER QUICKVIEW -->
  </div>
  <!-- /SIDE MENU HEADER -->
  <!-- DROPDOWN -->
  <ul class="dropdown dark hover-effect interactive">
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item">
      <a href="#!/dashboard">
      <span class="sl-icon icon-speedometer"></span>
      Tableau de bord
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item">
      <a href="#!/clients">
      <span class="sl-icon icon-people"></span>
      Clients
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item">
      <a href="#!/providers">
      <span class="sl-icon icon-organization"></span>
      Fournisseurs
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item">
      <a href="#!/products">
      <span class="sl-icon icon-basket"></span>
      Produits
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item">
      <a href="#!/stocks">
      <span class="sl-icon icon-list"></span>
      Stocks
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
    <!-- DROPDOWN ITEM -->
    <li class="dropdown-item active">
      <a href="#!/orders">
      <span class="sl-icon icon-credit-card"></span>
      Commandes
      </a>
    </li>
    <!-- /DROPDOWN ITEM -->
  </ul>
  <!-- /DROPDOWN -->
  <a href="#!/logout" class="button medium primary">D&eacute;connexion</a>
</div>
<!-- /SIDE MENU -->
<!-- DASHBOARD BODY -->
<div class="dashboard-body">
  <!-- DASHBOARD HEADER -->
  <div class="dashboard-header retracted">
    <!-- DASHBOARD HEADER ITEM -->
    <div class="dashboard-header-item title">
      <!-- DB SIDE MENU HANDLER -->
      <div class="db-side-menu-handler">
        <img src="asset/images/dashboard/db-list-left.png" alt="db-list-left">
      </div>
      <!-- /DB SIDE MENU HANDLER -->
      <img src="asset/images/logo.png" alt="logo">
    </div>
    <!-- /DASHBOARD HEADER ITEM -->
  </div>
  <!-- DASHBOARD HEADER -->
  <!-- DASHBOARD CONTENT -->
  <div class="dashboard-content">
    <!-- HEADLINE -->
    <div class="headline buttons one primary">
      <h4>Commandes</h4>
      <a href="#!/orders" class="button primary">Retour</a>
    </div>
    <!-- /HEADLINE -->
    <!-- FORM BOX ITEM -->
    <div class="form-box-item jq-order">
      <h4>Commande #{{orderId}}</h4>
      <hr class="line-separator">
      <div class="cart-overview-item" ng-class="{'bordered': $last}" ng-repeat="item in articles  | orderBy:'providerName' | groupBy:'providerName'">
        <p class="text-header small">{{item.designation}} <span class="primary">x{{item.quantity}}</span></p>
        <p class="price"><span></span>{{item.quantity * item.price | number: 2}}</p>
        <p class="category primary">{{item.providerName}}</p>
      </div>
      <div class="cart-total small">
        <p class="price"><span></span>{{totalHT | number: 2}}</p>
        <p class="text-header total">Total HT</p>
      </div>
      <div class="cart-total small">
        <p class="price"><span></span>{{tva2 | number: 2}}</p>
        <p class="text-header total">TVA 2.5%</p>
      </div>
      <div class="cart-total small">
        <p class="price"><span></span>{{tva7 | number: 2}}</p>
        <p class="text-header total">TVA 7.7%</p>
      </div>
      <div class="cart-total small">
        <p class="price"><span></span>{{totalTTC | number: 2}}</p>
        <p class="text-header total">Total TTC</p>
      </div>
      <a class="button primary" ng-click="purchaseOrder(orderId)">Exporter</a>
    </div>
    <!-- /FORM BOX ITEM -->
    <!-- PACK BOXES -->
    <div class="pack-boxes">
      <div class="pack-box" ng-repeat="item in articles  | orderBy:'providerName' | groupBy:'providerName'" ng-show="item.providerName_CHANGED">
        <p class="text-header small">{{item.providerName}}</p>
        <p class="price larger">{{getArticlesCount(item.providerName)}}</p>
        <p class="credit">Article(s)</p>
        <a class="button primary" ng-click="purchaseOrder2(orderId,item.providerName)">Exporter</a>
      </div>
    </div>
    <!-- /PACK BOXES -->				
  </div>
  <!-- DASHBOARD CONTENT -->
</div>
<!-- /DASHBOARD BODY -->
<div class="shadow-film closed"></div>
<div id="invoice">
  <header class="clearfix">
    <div id="project">
      PMARKET SAS
      <br>37 Rue Joseph Marion
      <br>01200 Valserhone
			<br>06 05 78 77 12
    </div>
    <div id="slogan" class="clearfix">
      Osez l&apos;originalit&eacute;
    </div>
    <div class="clearfix"> </div>
    <div id="contact">
    </div>
    <div id="company">
      {{order.clientName}}
      <br>{{order.street}}
      <br>{{order.postalCode}} {{order.city}}
    </div>
    <div class="clearfix"></div>
    <div id="facture">
      Facture n&ordm; {{date | date:'yyyy'}}-{{orderId}}
    </div>
    <div id="date">
      Date: {{date | date:'dd.MM.yyyy'}}
    </div>
  </header>
  <main>
    <table id="order">
      <thead>
        <tr>
          <th class="desc">D&eacute;signation</th>
          <th class="unit">Prix unit.</th>
          <th class="qty">Qt&eacute;</th>
          <th class="total">Montant</th>
          <th class="tva">TVA</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="article in articles" ng-if="$index < 38"> <!-- 19 -->
          <td class="desc">{{article.designation}}</td>
          <td class="unit">{{article.price | number: 2}}</td>
          <td class="qty">{{article.quantity}}</td>
          <td class="total">{{article.quantity * article.price | number: 2}}</td>
          <td class="tva">{{article.tva}}%</td>
        </tr>
      </tbody>
    </table>
    <table id="order">
      <tbody>
        <tr ng-repeat="article in articles" ng-if="$index >= 38"> <!-- 19 -->
          <td class="desc">{{article.designation}}</td>
          <td class="unit">{{article.price | number: 2}}</td>
          <td class="qty">{{article.quantity}}</td>
          <td class="total">{{article.quantity * article.price | number: 2}}</td>
          <td class="tva">{{article.tva}}%</td>
        </tr>
      </tbody>
    </table>
    <div class="clearfix"></div>
    <div id="tva">
      <span>D&eacute;tail TVA:</span>
      <table>
        <thead>
          <tr>
            <th>Base</th>
            <th>Taux</th>
            <th>TVA</th>
          </tr>
        </thead>
        <tbody>
          <tr>
            <td>{{base7 | number: 2}}</td>
            <td>20%</td>
            <td>{{tva7 | number: 2}}</td>
          </tr>
          <tr>
            <td>{{base2 | number: 2}}</td>
            <td>5.5%</td>
            <td>{{tva2 | number: 2}}</td>
          </tr>
        </tbody>
      </table>
    </div>
    <div id="montant">
      <table>
        <tbody>
          <tr>
            <td class="first">Total net</td>
            <td class="last">{{totalHT | number: 2}}</td>
          </tr>
          <tr>
            <td class="first">TVA</td>
            <td  class="last">{{totalTVA | number: 2}}</td>
          </tr>
          <tr>
            <td class="first">Montant total TTC</td>
            <td  class="last">{{totalTTC | number: 2}}</td>
          </tr>
        </tbody>
      </table>
      <span>{{totalFrancs}} euros et {{totalCentimes}} centimes</span>
    </div>
    <div class="clearfix"></div>
    <div id="notices">
			Siret : 89355363600018 - APE : 4690Z - N° TVA intracom : FR57893553636 - Capital : 100,00 €<br>RIB : FR8220041010072187459W03806<br>Avec nos remerciements pour votre commande.
    </div>
  </main>
</div>
<div id="purchase">
  <header class="clearfix">
    <div id="project">
      PMARKET SAS
      <br>37 Rue Joseph Marion
      <br>01200 Valserhone
			<br>06 05 78 77 12
    </div>
    <div id="slogan" class="clearfix">
      Osez l&apos;originalit&eacute;
    </div>
    <div class="clearfix"> </div>
    <div id="company">
      {{order.clientName}}
      <br><br>{{order.street}}
      <br>{{order.postalCode}} {{order.ville}}
    </div>
    <div class="clearfix"></div>
    <div id="facture">
      Bon de commande n&ordm; {{date | date:'yyyy'}}-{{orderId}}
    </div>
    <div id="date">
      Date: {{date | date:'dd.MM.yyyy'}}
    </div>
  </header>
  <main>
    <table id="order">
      <thead>
        <tr>
          <th class="desc">D&eacute;signation</th>
          <th class="qty">Qt&eacute;</th>
        </tr>
      </thead>
      <tbody>
        <tr ng-repeat="article in articles | filter:{providerName:providerName}" ng-if="$index < 38"> <!-- 19 -->
          <td class="desc">{{article.designation}}</td>
          <td class="qty">{{article.quantity}}</td>
        </tr>
      </tbody>
    </table>
    <table id="order">
      <tbody>
        <tr ng-repeat="article in articles | filter:{providerName:providerName}" ng-if="$index >= 38"> <!-- 19 -->
          <td class="desc">{{article.designation}}</td>
          <td class="qty">{{article.quantity}}</td>
        </tr>
      </tbody>
    </table>
    <div class="clearfix"></div><div class="clearfix"></div>
    <div id="notices">
			Siret : 89355363600018 - APE : 4690Z - N° TVA intracom : FR57893553636 - Capital : 100,00 €<br>RIB : FR8220041010072187459W03806<br>Avec nos remerciements pour votre commande.
    </div>
  </main>
</div>
