<div class="row animate-bottom" >
    <h3>Commande ou Retour/Consultation</h3></br>
    <style>
        .th_label {
            border: 1px solid black;
            border-collapse: collapse;
            text-align: center;
            min-width: 100px;
        }
        .th_DS_IS {
            border: 1px solid black;
            border-collapse: collapse;
            text-align: center;
            min-width: 50px;
        }
    </style>
    <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="divTable">
       <form name="formAddGroup">
        <div class="col-md-6">
            <div class="panel panel-default">
                <div class="panel-heading">
                    <h3 class="panel-title">Informations générales</h3>
                </div>
                <div class="panel-body" >

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Numéro</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.number"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Date Création</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="frenchDateTimeFormat(commandDetail.created_at)"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Type</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.type.name"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Canal</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.channel.name"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Code Client</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.client.ERP_code"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Nom Client</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="clientName"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Nom Utilisateur</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="employeeName"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Statut</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.status.name"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Date Statut</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="frenchDateTimeFormat(commandDetail.updated_at)"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Code ERP</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.ERP_code"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                    <div class="form-group">
                        <label  class="col-sm-4 control-label">Référence externe</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.ref_ext"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>

                </div>
            </div>

        </div>
        <div class="col-md-6">
            <div class="panel panel-default">

                <div class="panel-heading">
                    <h3 class="panel-title">Prix Totaux</h3>
                </div>
                <div class="panel-body" >
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">Prix total TTC</label>
                        <div class="col-sm-8" >
                            <input type="text"
                                   class="form-control"
                                   style="text-align: right"
                                   ng-value="commandDetail.total_ttc"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">Prix total HT</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   style="text-align: right"
                                   ng-value="commandDetail.total_ht"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">TVA (20%)</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   style="text-align: right"
                                   ng-value="commandDetail.total_vat"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br>
                </div>
            </div>

            <div class="panel panel-default" ng-show="commandDetail.delivery != null">

                <div class="panel-heading">
                    <h3 class="panel-title">Adresse de livraison</h3>
                </div>
                <div class="panel-body" >
                    <div class="form-group" ng-show="commandDetail.delivery.delivery_address_code">
                        <label  class="col-sm-3 control-label">Code Adresse</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.delivery.delivery_address_code"
                                   placeholder=""
                                   disabled/>
                        </div>
                        </br></br>
                    </div>
                    <div class="form-group" ng-show="commandDetail.delivery.last_name && commandDetail.delivery.first_name">
                        <label  class="col-sm-3 control-label">Nom</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.delivery.last_name+' '+commandDetail.delivery.first_name"
                                   placeholder=""
                                   disabled/>
                        </div>
                        </br></br>
                    </div>
                    <div class="form-group" ng-show="commandDetail.delivery.phone">
                        <label  class="col-sm-3 control-label" style="text-align: left">Téléphone</label>
                        <div class="col-sm-8">
                            <input
                                    type="text"
                                    class="form-control"
                                    name="phone"
                                    ng-value="commandDetail.delivery.phone"
                                    disabled/>
                            </br>
                        </div>
                        </br></br>
                    </div>
                    <!--div class="form-group">
                        <label  class="col-sm-3 control-label">Code postal</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.delivery.zip_code"
                                   placeholder=""
                                   disabled/>
                        </div>
                    </div></br></br-->
                    <div class="form-group" ng-show="commandDetail.delivery.adress">
                        <label  class="col-sm-3 control-label">Adresse</label>
                        <div class="col-sm-8">
                            <textarea
                                    class="form-control"
                                    style="vertical-align: top"
                                    ng-model="commandDetail.delivery.adress"
                                    disabled>
                            </textarea>
                            </br>
                        </div>
                    </div>
                    <div class="form-group"  ng-show="commandDetail.delivery.adress_followup">
                        <label  class="col-sm-3 control-label"></label>
                        <div class="col-sm-8">
                            <input type="text"
                                    class="form-control"
                                    ng-model="commandDetail.delivery.adress_followup"
                                    disabled>
                            </input>
                            </br>
                        </div>
                    </div>
                    <div class="form-group">
                        <label  class="col-sm-3 control-label">Ville</label>
                        <div class="col-sm-8">
                            <input type="text"
                                   class="form-control"
                                   ng-value="commandDetail.delivery.town"
                                   disabled/>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="col-md-12  ">
            <table class="table" ng-show="commandDetail.items.length > 0">

                <tr class="tr-background-color" >
                    <th style="text-align: left">Code Produit</th>
                    <th style="text-align: left; min-width: 200px">Nom Produit</th>
                    <th style="text-align: center">Variante</th>
                    <th style="text-align: center">Prix base TTC</th>
                    <th style="text-align: center">Quantité</th>
                    <th style="text-align: center">Prix unitaire TTC</th>
                    <th style="text-align: center">Remise %</th>
                    <th style="text-align: center">Prix total TTC</th>
                    <th style="text-align: center">Longueur</th>
                    <th style="text-align: center">Largeur</th>
                    <th style="text-align: center">Hauteur</th>
                    <th class="th_label">Label DS 1</th>
                    <th class="th_DS_IS">DS 1</th>
                    <th class="th_label">Label DS 2</th>
                    <th class="th_DS_IS">DS 2</th>
                    <th class="th_label">Label DS 3</th>
                    <th class="th_DS_IS">DS 3</th>
                    <th class="th_label">Label DS 4</th>
                    <th class="th_DS_IS">DS 4</th>
                    <th class="th_label">Label DS 5</th>
                    <th class="th_DS_IS">DS 5</th>
                    <th class="th_label">Label IS 1</th>
                    <th class="th_DS_IS">IS 1</th>
                    <th class="th_label">Label IS 2</th>
                    <th class="th_DS_IS">IS 2</th>
                </tr>
                <tr ng-repeat="prod in commandDetail.items track by $index" >
                    <td style="text-align: left">{{prod.product_ERP_code}}</td>
                    <td style="text-align: left">{{prod.product_name}}</td>
                    <td style="text-align: center">{{prod.variant_ERP_code}}</td>
                    <td style="text-align: center">{{prod.product_price_ttc}}</td>
                    <td style="text-align: center">{{prod.quantity}}</td>
                    <td ng-show="prod.unitary_ttc != null" style="text-align: center">{{prod.unitary_ttc}}</td>
                    <td ng-show="prod.unitary_ttc == null" style="text-align: center">{{prod.product_price_ttc}}</td>
                    <td style="text-align: center">{{prod.discount_rate}}</td>
                    <td style="text-align: center">{{prod.total_ttc}}</td>
                    <td style="text-align: center">{{prod.length}}</td>
                    <td style="text-align: center">{{prod.width}}</td>
                    <td style="text-align: center">{{prod.high}}</td>
                    <td style="text-align: center">{{prod.label_dim_supp_1}}</td>
                    <td style="text-align: center">{{prod.dim_supp_1}}</td>
                    <td style="text-align: center">{{prod.label_dim_supp_2}}</td>
                    <td style="text-align: center">{{prod.dim_supp_2}}</td>
                    <td style="text-align: center">{{prod.label_dim_supp_3}}</td>
                    <td style="text-align: center">{{prod.dim_supp_3}}</td>
                    <td style="text-align: center">{{prod.label_dim_supp_4}}</td>
                    <td style="text-align: center">{{prod.dim_supp_4}}</td>
                    <td style="text-align: center">{{prod.label_dim_supp_5}}</td>
                    <td style="text-align: center">{{prod.dim_supp_5}}</td>
                    <td style="text-align: center">{{prod.label_info_supp_1}}</td>
                    <td style="text-align: center">{{prod.info_supp_1}}</td>
                    <td style="text-align: center">{{prod.label_info_supp_2}}</td>
                    <td style="text-align: center">{{prod.info_supp_2}}</td>
                </tr>
            </table></br></br>
            <div style="float: right">
                <button class="btn btn-flexo " ui-sref="commandes">Quitter</button>
            </div></br>
        </div>
    </form>
    </div>
    </br></br>
</div></br></br></br>