<div class="row">
    <div >
    <h3>Produits</h3>
</div></br></br>

<div class="col-md-12">
    <div class="animate-bottom">
        <div class="panel panel-default">

            <div class="panel-heading">
                <h3 class="panel-title">Critères de recherche</h3>
            </div>
            <div class="panel-body" >
                <div ng-include="'app/pages/catalogue/produits/widgets/search.html'" ></div>
            </div>
        </div>

        <div  class="col-md-3 col-md-offset-9 " >
            <button class="btn btn-flexo" style="float: right;bottom:   0; margin-right: 25px" ng-click="searchCommand(pagination.current)">Chercher</button>
        </div></br></br>
    </div>
</div>
<div class="col-md-12">
    <div class="loader" id="Loaderdiv" style=" margin:0 auto;"></div>
    <div class="alert bg-danger closeable" role="alert" id="msgError" style="margin: 80px">
        {{error_response}}.
        <i class="ion-close-round" style="float: right;" ng-click="hideMsgError()"></i>
    </div>
    <div  id="divEmpty" style=" margin:0 auto;"><span class="error-msg-server">Aucun élément trouvé</span></div>
    <div class="animate-bottom" id="divTable">
        <div class="table-responsive">
                <table class="table table-bordered">
                    <thead >
                    <tr class="tr-background-color">
                        <th>ID</th>
                        <th>Nom</th>
                        <th>Sous Famille</th>
                        <th>Code ERP</th>
                        <th>Unité</th>
                        <th>Prix</th>
                        <th>Groupe Remise</th>
                        <th></th>

                    </tr>
                    </thead>
                    <tr dir-paginate="item in products |itemsPerPage:productsPerPage " total-items="totalProducts" current-page="pagination.currentProduct" class="align-td-center ">
                        <td >{{item.id }}</td>
                        <td >{{item.name | limitTo:35}}</td>
                        <td >{{item.group.name| limitTo:35}}</td>
                        <td >{{item.ERP_code| limitTo:35}}</td>
                        <td >{{item.unit.name| limitTo:35}}</td>
                        <td style="text-align: right">{{convertToPriceFormatWithVirgul(item.price_ttc) | limitTo:35}}</td>
                        <td >{{item.discount.ERP_group_code| limitTo:35}}</td>
                        <td class="div-centred-td">
                            <button class="btn btn-flexo btn-sm" ui-sref="consultationProduct({id : item.id })">Consulter</button>
                            <button class="btn btn-flexo btn-sm" ui-sref="updateProduct({id : item.id })">Modifier</button>
                            <!--button class="btn btn-flexo btn-sm" ng-click="deactivateProduit(item.id , 1)" ng-show="item.deactivated == 0" style="width: 80px">Désactiver</button-->
                            <!--button class="btn btn-flexo btn-sm" ng-click="deactivateProduit(item.id , 0)" ng-show="item.deactivated == 1" style="width: 80px">Activer</button-->
                        </td>
                    </tr>
                </table>
                <dir-pagination-controls on-page-change="pageChanged(newPageNumber)"  style="float: right"></dir-pagination-controls>

            </div></br></br>
            <button class="btn btn-flexo" style="float: right" ui-sref="addProduct" >Ajouter</button>
        </div>
    </div>
    </div>
</div>