
    <table id="_table"  width="100%" class="table table-condensed table-bordered ">
        <thead>
            <tr>
                <th width='1px'>Id</th>
                <th width='1px'>Compte</th>
                <th>Libelle</th>
                <th width='1px'>Compte&nbsp;Aux.</th>
                <th>Libelle</th>
                <th>Designation</th>
                <th width='1px'>Débit</th>
                <th width='1px'>Crédit</th>
                @if(($mode!='show') && ($grand_livre_ligne->verrou!="1"))
                <th width='75px'>
                    @if(!$is_new)
                        @if($user->hasRole("ADMINISTRATEUR") || $user->canPermissionName("GLI_MAJ"))
                        <a href="{!! url('ecriture_pop_add/'.$grand_livre_ligne->id) !!}" class="add_ecriture fancybox.iframe btn  btn-sm btn-success">
                            Nouvelle ligne</a>
                        @endif
                    @endif
                </th>
                @endif
            </tr>
        </thead>
        <tbody>
            @php $total_debit=0;$total_credit=0;$numligne=0; @endphp

            @if(count($ecritures)>0)
                @foreach ($ecritures as $ecriture)
                    @php
                        $numligne++;
                        $total_debit+=$ecriture->debit;
                        $total_credit+=$ecriture->credit;
                    @endphp
                    <tr style="">
                        <td nowrap>{!! $ecriture->id !!}</td>
                        <td nowrap>{!! $ecriture->compte !!}</td>
                        <td nowrap>{!! $ecriture->compte_label!!}</td>
                        <td nowrap>{!! $ecriture->compte_aux !!}</td>
                        <td nowrap>{!! $ecriture->compte_aux_label !!}</td>
                        <td>{!! $ecriture->designation !!}</td>
                        <td nowrap align='right' style='color:darkred'>{!! $ecriture->debit !!}</td>
                        <td nowrap align='right' style='color:blue'>{!! $ecriture->credit !!}</td>
                        @if(($mode!='show')&&($grand_livre_ligne->verrou!="1"))
                        <td nowrap>
                            @if($ecriture->verrou!="1")
                                @if($user->hasRole("ADMINISTRATEUR") || $user->canPermissionName("GLI_MAJ"))
                                    <a href="{!! url('ecriture_pop_maj/'.$ecriture->id) !!}" id='btn_maj_{!! $ecriture->id !!}'
                                        class="add_ecriture fancybox.iframe btn btn-info btn-sm" style="margin-right: 3px;">
                                        <span class='fas fa-pencil'></span>
                                    </a>
                                    @if($numligne>1)
                                    <a href="{!! url('grand_livre_del/'.$ecriture->id) !!}"
                                        class="btn btn-danger btn-sm"
                                        onclick="return confirm('voulez-vous vraiement supprimer la ligne ?');" style="margin-right: 3px;">
                                        <span class='fas fa-trash'></span>
                                    </a>
                                    @endif
                                @endif
                            @endif
                        </td>
                        @endif
                    </tr>
                @endforeach
            @endif
        </tbody>

        <tfoot style="background-color: white;color: blue;text-align:right" >
            <tr>
                <th colspan="6">TOTAL</th>
                <th align='right' style="color:darkred">{!! $total_debit !!}</th>
                <th align='right' style="color:blue">{!! $total_credit !!}</th>
                @if(($mode!='show')&&($grand_livre_ligne->verrou!="1"))
                    <th ></th>
                @endif
            </tr>
        </tfoot>
    </table>

