<div>
    <form >
        <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                    <label for="">Document</label>
                    <select class="form-control form-control-sm" wire:model.live="journal">
                        <option value="GL">Grand-Livre</option>
                        <option value="balance">Balance</option>
                        <option value="resultat">Résultat</option>
                        <option value="bilan">Bilan</option>
                        <option value="amortissement">Amortissement</option>
                        <option value="test">TEST Bilan</option>
                        
                    </select>
                    <!-- __BLOCK__ --><?php $__errorArgs = ['journal'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                        <small class="form-text text-danger"><?php echo e($message); ?></small>
                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <!-- __BLOCK__ --><?php if($is_Amort): ?>
                        <label for="">Amortir sur  <small>Mois</small></label>
                        <input type="text"  class="form-control form-control-sm" wire:model="amort_sur" maxlength="4" >
                        <!-- __BLOCK__ --><?php $__errorArgs = ['amort_sur'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                              <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php else: ?>
                        <label for="">Du </label>
                        <input type="date"  class="form-control form-control-sm" wire:model="date_start" >
                        <!-- __BLOCK__ --><?php $__errorArgs = ['date_start'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                          <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php endif; ?> <!-- __ENDBLOCK__ -->
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <!-- __BLOCK__ --><?php if($is_Amort): ?>
                        <label for="">à la date du </label>
                        <input type="date"  class="form-control form-control-sm" wire:model="amort_date"  >
                        <!-- __BLOCK__ --><?php $__errorArgs = ['amort_date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                             <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php else: ?>
                        <label for="">Au </label>
                        <input type="date"  class="form-control form-control-sm" wire:model="date_end"  >
                        <!-- __BLOCK__ --><?php $__errorArgs = ['date_end'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                              <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php endif; ?> <!-- __ENDBLOCK__ -->
                </div>
            </div>

            <div class="col-md-3">
                <div class="form-group">
                    <label for="">Devise</label>
                    <select class="form-control form-control-sm" wire:model="devise">
                        <!-- __BLOCK__ --><?php $__currentLoopData = get_select_devise(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dev): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($dev->devise); ?>"><?php echo e($dev->devise); ?> - <?php echo e($dev->intitule); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
                     </select>
                     <!-- __BLOCK__ --><?php $__errorArgs = ['devise'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                          <small class="form-text text-danger"><?php echo e($message); ?></small>
                     <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                </div>
            </div>
        </div>

        <div class="row">
            <div class="col-md-9">
                <div class="form-group">
                    <!-- __BLOCK__ --><?php if($is_Amort): ?>
                        <label for="">Affichage</label>
                        <select class="form-control form-control-sm" wire:model="affiche_amort" >
                                <option value="detail">Détails</option>
                                <option value="general">Général</option>
                        </select>
                        <!-- __BLOCK__ --><?php $__errorArgs = ['affiche_amort'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                             <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php else: ?>
                        <label for="">Compte</label>
                        <select class="form-control form-control-sm" wire:model="compte"  <?php echo e($disabled); ?>>
                                <option value="-1">-- select --</option>
                        <!-- __BLOCK__ --><?php $__currentLoopData = get_select_compte_comptable(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $comp): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($comp->num_compte); ?>"><?php echo e($comp->num_compte); ?> - <?php echo e($comp->nom_compte); ?></option>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
                        </select>
                        <!-- __BLOCK__ --><?php $__errorArgs = ['compte'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                             <small class="form-text text-danger"><?php echo e($message); ?></small>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                    <?php endif; ?> <!-- __ENDBLOCK__ -->
                </div>
            </div>
            
         
            <div class="col-md-3">
                <div class="form-group pt-4">
                    <button type="button" wire:click="goEtatFinance" wire:loading.attr="disabled" class="btn btn-primary btn-sm" style="width:100%; height:3%;"> 
                        <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="goEtatFinance">
                            <span class="visually-hidden"></span>
                        </div>
                        <div wire:loading.remove wire:target="goEtatFinance"> Afficher</div>
                    </button>
                </div>
            </div>
        </div>
    </form>

    <hr>
    <!-- __BLOCK__ --><?php if($data): ?>

        <!-- __BLOCK__ --><?php if($journal == "GL"): ?>

        <?php
            $debit_somme  = 0 ;
            $credit_somme = 0 ;  
           
            if($infoCompte->type_compte === 'credit')
            {
                if($soldeInitial < 0){
                    $soldeDebit = $soldeInitial ;
                    $soldeCredit = null ;
                }else{
                    $soldeDebit = null ;
                    $soldeCredit = $soldeInitial ;
                }
            }else{

                if($soldeInitial < 0){
                    $soldeDebit = null ;
                    $soldeCredit = $soldeInitial ;
                }else{
                    $soldeDebit = $soldeInitial ;
                    $soldeCredit = null ;
                }
            }

            if($soldeDebit){
                 $debit_somme += $soldeDebit ;
            }

            if($soldeCredit){
                 $credit_somme += $soldeCredit ;
            }

        ?>

        <table style="width: 100%;" class="mb-3">
            <tr>
                <td colspan="1" align="left"><b>GRAND LIVRE</b></td>
                <td align="right">
                    <button type="button" wire:click="DownloadGrandLivrePdf()" wire:loading.attr="disabled" class="btn btn-info btn-sm" style="width:50%; height:3%;"> 
                        <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="DownloadGrandLivrePdf">
                            <span class="visually-hidden"></span>
                        </div>
                        <div wire:loading.remove wire:target="DownloadGrandLivrePdf"><i class="fa fa-file-pdf-o"></i>  Télécharger</div>
                    </button>
                    
                </td>
            </tr>
            <tr>
                <td colspan="2">Compte : <?php echo e($compte); ?>  <?php echo e($infoCompte->nom_compte); ?></td>
            </tr>
            <tr>
                <td>Période : <?php echo e(get_format_date($date_start,'L')); ?> au <?php echo e(get_format_date($date_end,'L')); ?></td>
                <td>Devise : <?php echo e($devise); ?> - <?php echo e(get_libelle_devise($devise)); ?></td>
            </tr>
        </table>
        

        <table class="" border="1" style="width: 100%;  font-size:13px;">
            <tr>
                <td class="pl-1" style="width: 10%;">Date</td>
                <td class="pl-1">Libellé</td>
                <td class="pl-1" style="width: 15%;">Débit</td>
                <td class="pl-1" style="width: 15%;">Crédit</td>
            </tr>
            <tr>
                <td></td>
                <td colspan="1" align="right" class="pr-1"><b>Solde initial :</b></td>
                <td align="right" class="pr-1"><b><?php echo e(get_format_montant($soldeDebit)); ?></b></td>
                <td align="right" class="pr-1"><b><?php echo e(get_format_montant($soldeCredit)); ?></b></td>
            </tr>
            <!-- __BLOCK__ --><?php $__currentLoopData = $data; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td class="pl-1"><?php echo e(get_format_date($info->date_valeur)); ?></td>
                    <td class="pl-1"><?php echo e($info->intitule); ?></td>
                    <td class="pr-1" align="right"><?php echo e(get_format_montant($info->debit)); ?></td>
                    <td class="pr-1" align="right"><?php echo e(get_format_montant($info->credit)); ?></td>
                </tr>
                <?php
                    $debit_somme += $info->debit ;
                    $credit_somme += $info->credit ;   
               ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->

                <?php
                     if($infoCompte->type_compte === 'credit')
                      {
                        /*** solde = totCredit - TotDebit  */
                           $solde = $credit_somme - $debit_somme ;
                      }else{
                        /** solde = totDébit - TotCredit */
                            $solde = $debit_somme - $credit_somme ;
                      }
                ?>
            <tr>
                <td colspan="2" align="right" class="pr-1">
                    <b>Totaux :</b>
                    </br>
                    <b>Solde :</b>
                </td>
                <td align="right" valign="top" class="pr-1">
                    <b><?php echo e(get_format_montant($debit_somme)); ?></b>
                    </br>
                    <b>
                    <!-- __BLOCK__ --><?php if($debit_somme < $credit_somme): ?>
                           <?php echo e(get_format_montant(abs($solde))); ?> 
                    <?php endif; ?> <!-- __ENDBLOCK__ -->
                    </b>
                </td>
                <td align="right" valign="top" class="pr-1">
                    <b><?php echo e(get_format_montant($credit_somme)); ?></b>
                    </br>
                    <b> 
                    <!-- __BLOCK__ --><?php if($credit_somme < $debit_somme): ?>
                        <?php echo e(get_format_montant(abs($solde))); ?> 
                    <?php endif; ?> <!-- __ENDBLOCK__ -->
                </b>
                </td>
            </tr>
        </table>
        <?php endif; ?> <!-- __ENDBLOCK__ -->

        <!-- __BLOCK__ --><?php if($journal == "balance"): ?>

        <?php
            // substr('abcde', 0,1);
            //  $type = substr( $info->compte, 0,1);
            $somme_init_debit = 0 ;
            $somme_init_credit= 0 ;
            $somme_variation_debit = 0 ;
            $somme_variation_credit= 0 ;
            $somme_solde_debit = 0 ;
            $somme_solde_credit= 0 ;
        ?>

        <table style="width: 100%;" class="mb-3">
            <tr>
                <td colspan="1" align="left"><b>BALANCE DES COMPTES</b></td>
                <td align="right">
                    <button type="button" wire:click="DownloadBalancePdf()" wire:loading.attr="disabled" class="btn btn-info btn-sm" style="width:50%; height:3%;"> 
                        <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="DownloadBalancePdf">
                            <span class="visually-hidden"></span>
                        </div>
                        <div wire:loading.remove wire:target="DownloadBalancePdf"><i class="fa fa-file-pdf-o"></i>  Télécharger</div>
                    </button>
                    
                </td>
            </tr>
            <tr>
                <td>Période : <?php echo e(get_format_date($date_start,'L')); ?> au <?php echo e(get_format_date($date_end,'L')); ?> </td>
                <td>Devise : <?php echo e($devise); ?> - <?php echo e(get_libelle_devise($devise)); ?></td>
            </tr>
        </table>

        <table class="" border="1" style="width: 100%; font-size:13px;">
            <tr>
                <td class="pl-1" style="width: 9%;"><b>COMPTE</b></td>
                <td class="pl-1" align="center"><b>INTITULE DE COMPTE</b></td>
                <td class="pl-1" style="width: 18%;" colspan="2" align="center"><b>SOLDE INITIAL</b></td>
                <td class="pl-1" style="width: 18%;" colspan="2" align="center"><b>VARIATIONS</b></td>
                <td class="pl-1" style="width: 18%;" colspan="2" align="center"><b>SOLDE</b></td>
            </tr>
            <tr>
                <td></td>
                <td></td>
                <td  class="pl-1" align="center">débit</td>
                <td  class="pl-1" align="center">crédit</td>
                <td  class="pl-1" align="center">débit</td>
                <td  class="pl-1" align="center">crédit</td>
                <td  class="pl-1" align="center">débit</td>
                <td  class="pl-1" align="center">crédit</td>
            </tr>
            <!-- __BLOCK__ --><?php $__currentLoopData = $dico; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                   
                    <?php
                        $bgColor = "";
                        $textColor = "";

                        if($info['compte'] <> '')
                        { 
                            $somme_init_debit += $info['soldeInitial']['debit_true'] ;
                            $somme_init_credit += $info['soldeInitial']['credit_true'] ;
                            $somme_variation_debit += $info['variations']['debit_true'] ;
                            $somme_variation_credit += $info['variations']['credit_true'] ;
                            $somme_solde_debit += $info['solde']['debit_true'] ;
                            $somme_solde_credit += $info['solde']['credit_true'] ;
                        }else{
                            $bgColor = "#e3eae9";
                            $textColor = "";
                        }
                    ?>
                     <tr style="background-color: <?php echo e($bgColor); ?>;color: <?php echo e($textColor); ?>;">
                        <td class="pl-1"><?php echo e($info['compte']); ?></td>
                        <td class="pl-1"><?php echo e($info['intitule']); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['soldeInitial']['debit'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['soldeInitial']['credit'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['variations']['debit'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['variations']['credit'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['solde']['debit'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['solde']['credit'])); ?></td>
                    </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
            <tr style="background-color: black;color: white;">
                        
                        <td class="pl-1" colspan="2" align="center">TOTAL GENERAL</td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_init_debit)); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_init_credit)); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_variation_debit)); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_variation_credit)); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_solde_debit)); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($somme_solde_credit)); ?></td>
            </tr>
        </table>

        <?php endif; ?> <!-- __ENDBLOCK__ -->

        <!-- __BLOCK__ --><?php if($journal == "resultat"): ?>

        <table style="width: 80%;" class="mb-3">
            <tr>
                <td colspan="2" align="left"><b>COMPTE DE RESULTAT</b></td>
            </tr>
            <tr>
                <td>Période : </td>
                <td>Devise : <?php echo e($devise); ?> - <?php echo e(get_libelle_devise($devise)); ?></td>
            </tr>
        </table>


        <table class="" border="1" style="width: 100%; font-size:13px;">
            <tr>
                <td class="pl-1" style="width: 5%;" rowspan="2" align="center"><b>REF.</b></td>
                <td class="pl-1"  style="width: 45%;" rowspan="2" align="center"><b>LIBELLES</b></td>
                <td class="pl-1"  style="width: 5%;" rowspan="2" align="center"></td>
                <td class="pl-1"  rowspan="2" align="center"><b>NOTE</b></td>
                <td class="pl-1" style="width: 20%;"  align="center"><b>EXERCICE <?php echo e(getExercice()); ?> </b></td>
                <td class="pl-1" style="width: 20%;" align="center"><b>EXERCICE <?php echo e(getExercice_n_1()); ?></b></td>
            </tr>
            <tr>
                <td class="pl-1" align="center" ><b>Net</b></td>
                <td class="pl-1" align="center"><b>Net</b></td>
            </tr>

            <!-- __BLOCK__ --><?php $__currentLoopData = $dico; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <tr
                >
                    <td class="pl-1" align="center" ><?php echo e(get_text_MAJ($info['poste'])); ?></td>
                    <td class="pl-1" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['intitule']); ?></td>
                    <td class="pr-1" align="center" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['operation']); ?></td>
                    <td class="pr-1" align="center" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['note']); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n'])); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n1'])); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->


        </table>
        <?php endif; ?> <!-- __ENDBLOCK__ -->

        <!-- __BLOCK__ --><?php if($journal == "bilan"): ?>

            <table style="width: 100%;" class="mb-3">
                <tr>
                    <td  align="left"><b>BILAN</b></td>
                    <td align="right">
                        <button type="button" wire:click="DownloadBilanPdf()" wire:loading.attr="disabled" class="btn btn-info btn-sm" style="width:25%; height:3%;"> 
                            <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="DownloadBilanPdf">
                                <span class="visually-hidden"></span>
                            </div>
                            <div wire:loading.remove wire:target="DownloadBilanPdf"><i class="fa fa-file-pdf-o"></i>  Télécharger</div>
                        </button>
                        
                    </td>
                </tr>
                <tr>
                    <td>Période : </td>
                    <td>Devise : <?php echo e($devise); ?> - <?php echo e(get_libelle_devise($devise)); ?></td>
                </tr>
            </table>

            <table class="" border="1" style="width: 100%; font-size:13px;">
                <tr>
                    <td class="pl-1" style="width: 5%;" rowspan="2" align="center"><b>REF.</b></td>
                    <td class="pl-1"  rowspan="2" align="center"><b>ACTIF</b></td>
                    <td class="pl-1"  rowspan="2"  style="width: 5%;" align="center"><b>NOTE</b></td>
                    <td class="pl-1" style="width: 42%;"  align="center" colspan="3"><b>EXERCICE <?php echo e(getExercice()); ?></b></td>
                    <td class="pl-1" style="width: 14%;" align="center"><b>EX. <?php echo e(getExercice_n_1()); ?></b></td>
                </tr>
                <tr>
                    <td class="pl-1" style="width: 14%;" align="center" ><b>Brut</b></td>
                    <td class="pl-1" style="width: 14%;" align="center" ><b>Amort.</b></td>
                    <td class="pl-1" align="center" ><b>Net</b></td>
                    <td class="pl-1" align="center"><b>Net</b></td>
                </tr>
    
                <!-- __BLOCK__ --><?php $__currentLoopData = $dico['actif']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <tr>
                    <td class="pl-1" align="center"><?php echo e(get_text_MAJ($info['poste'])); ?></td>
                    <td class="pl-1" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['intitule']); ?></td>
                    <td class="pr-1" align="center" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['note']); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n']['brut'])); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n']['amort'])); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n']['net'])); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n1'])); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
            </table>

            <br><br>

            <table class="" border="1" style="width: 100%; font-size:13px;">
                <tr>
                    <td class="pl-1" style="width: 5%;" rowspan="2" align="center"><b>REF.</b></td>
                    <td class="pl-1"  style="width: 45%;" rowspan="2" align="center"><b>PASSIF</b></td>
                    <td class="pl-1"  rowspan="2" align="center"><b>NOTE</b></td>
                    <td class="pl-1" style="width: 20%;"  align="center"><b>EXERCICE <?php echo e(getExercice()); ?></b></td>
                    <td class="pl-1" style="width: 20%;" align="center"><b>EX. <?php echo e(getExercice_n_1()); ?></b></td>
                </tr>
                <tr>
                    <td class="pl-1" align="center" ><b>Net</b></td>
                    <td class="pl-1" align="center"><b>Net</b></td>
                </tr>
    
                <!-- __BLOCK__ --><?php $__currentLoopData = $dico['passif']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td class="pl-1" align="center"><?php echo e(get_text_MAJ($info['poste'])); ?></td>
                    <td class="pl-1" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['intitule']); ?></td>
                    <td class="pr-1" align="center" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e($info['note']); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n'])); ?></td>
                    <td class="pr-1" align="right" style="background-color: <?php echo e($info['bgColor']); ?>;color: <?php echo e($info['textColor']); ?>"><?php echo e(get_format_montant($info['exercice_n1'])); ?></td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
            </table>
        <?php endif; ?> <!-- __ENDBLOCK__ -->

        <!-- __BLOCK__ --><?php if($journal == "amortissement"): ?>
            <?php   
            //$dico_immo = array();
            $grand_t_montant = 0;
            $grand_t_ant = 0;
            $grand_t_amort = 0;
            $grand_t_val_res = 0;
            $libTitle = ($affiche_amort == "detail")? 'détaillé' : 'général';
            $libColonne = ($affiche_amort == "detail")? 'date' : 'compte';

            ?>

            <table style="width: 100%;" class="mb-3">
                <tr>
                    <td colspan="1" align="left"><b>Tableau <?php echo e($libTitle); ?> des amortissements
                    </b></td>
                    <td align="right">
                        <button type="button" wire:click="DownloadTabImmoPdf()" wire:loading.attr="disabled" class="btn btn-info btn-sm" style="width:50%; height:3%;"> 
                            <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="DownloadTabImmoPdf">
                                <span class="visually-hidden"></span>
                            </div>
                            <div wire:loading.remove wire:target="DownloadTabImmoPdf"><i class="fa fa-file-pdf-o"></i>  Télécharger</div>
                        </button>
                        
                    </td>
                </tr>
                <tr>
                    <td>Amortissement limites sur <?php echo e($amort_sur); ?> mois à la date du <?php echo e(get_format_date($amort_date,'L')); ?> </td>
                    <td>Devise : <?php echo e($devise); ?> - <?php echo e(get_libelle_devise($devise)); ?></td>
                </tr>
            </table>

            <table class="" border="1" style="width: 100%; font-size:13px;">
                <tr style="background-color: black; color:white;" >
                    <td class="pl-1" style="width: 10%;"  ><?php echo e($libColonne); ?></td>
                    <td class="pl-1" style="width: %;"  >libellé</td>
                    <td class="pr-1" style="width: 12%;" align="center" >montant</td>

                    <!-- __BLOCK__ --><?php if($affiche_amort == "detail"): ?>
                        <td class="pl-1" style="width: 2%;" align="center">D</td>
                    <?php endif; ?> <!-- __ENDBLOCK__ -->

                    <td class="pr-1" style="width: 12%;" align="center" >ant</td>
                    <td class="pr-1" style="width: 12%;" align="center">amort</td>
                    <td class="pr-1" style="width: 12%;" align="center">val.rés</td>
                </tr>
                <!-- __BLOCK__ --><?php $__currentLoopData = $dico_immo; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                <!-- __BLOCK__ --><?php if($affiche_amort == "detail"): ?>
                    <tr style="background-color:#e3eae9;font-size:12px;">
                        <td class="pl-1"  ><b><?php echo e($info['num_compte']); ?></b></td>
                        <td class="pl-1" ><b><?php echo e($info['nom_compte']); ?></b></td>
                        <td class="pr-1" align="right" ><b><?php echo e(get_format_montant($info['t_montant'])); ?></b></td>
                        <td  align="center"></td>
                        <td class="pr-1" align="right" ><b><?php echo e(get_format_montant($info['t_ant'])); ?></b></td>
                        <td class="pr-1" align="right"><b><?php echo e(get_format_montant($info['t_amort'])); ?></b></td>
                        <td class="pr-1" align="right"><b><?php echo e(get_format_montant($info['t_val_res'])); ?></b></td>
                    </tr>
                    
                    <!-- __BLOCK__ --><?php $__currentLoopData = $info['detail']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $immo): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr style = "font-size:12px;">
                            <td class="pl-1"  ><?php echo e(get_format_date($immo['date_acq'])); ?></td>
                            <td class="pl-1"  ><?php echo e($immo['libelle']); ?></td>
                            <td class="pr-1" align="right" ><?php echo e(get_format_montant($immo['montant'] )); ?></td>
                            <td  align="center"><?php echo e($immo['periode']); ?></td>
                            <td class="pr-1" align="right" ><?php echo e(get_format_montant($immo['ant'])); ?></td>
                            <td class="pr-1" align="right"><?php echo e(get_format_montant($immo['amort'])); ?></td>
                            <td class="pr-1" align="right"><?php echo e(get_format_montant($immo['val_res'])); ?></td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
                <?php else: ?>
                    <tr style="font-size:12px;">
                        <td class="pl-1"  ><?php echo e($info['num_compte']); ?></td>
                        <td class="pl-1" ><?php echo e($info['nom_compte']); ?></td>
                        <td class="pr-1" align="right" ><?php echo e(get_format_montant($info['t_montant'])); ?></td>
                        <td class="pr-1" align="right" ><?php echo e(get_format_montant($info['t_ant'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['t_amort'])); ?></td>
                        <td class="pr-1" align="right"><?php echo e(get_format_montant($info['t_val_res'])); ?></td>
                    </tr>
                <?php endif; ?> <!-- __ENDBLOCK__ -->

                    <?php
                    $grand_t_montant += $info['t_montant'];
                    $grand_t_ant += $info['t_ant'];
                    $grand_t_amort += $info['t_amort'];
                    $grand_t_val_res += $info['t_val_res'];
                    ?>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
                <tr style="">
                    <td class="pl-1" colspan="2" align="center" ><b>TOTAL GENERAL</b></td>
                    <td class="pr-1" align="right" ><b><?php echo e(get_format_montant($grand_t_montant)); ?></b></td>
                    
                    <!-- __BLOCK__ --><?php if($affiche_amort == "detail"): ?>
                        <td  align="center"></td>
                    <?php endif; ?> <!-- __ENDBLOCK__ -->

                    <td class="pr-1" align="right" ><b><?php echo e(get_format_montant( $grand_t_ant)); ?></b></td>
                    <td class="pr-1" align="right"><b><?php echo e(get_format_montant($grand_t_amort)); ?></b></td>
                    <td class="pr-1" align="right"><b><?php echo e(get_format_montant($grand_t_val_res)); ?></b></td>
                </tr>
            </table>

        <?php endif; ?> <!-- __ENDBLOCK__ -->

        <!-- __BLOCK__ --><?php if($journal == "test"): ?>
            
        <?php endif; ?> <!-- __ENDBLOCK__ -->

    <?php endif; ?> <!-- __ENDBLOCK__ -->
</div><?php /**PATH N:\AppLaravel\access\resources\views/livewire/etat-financier.blade.php ENDPATH**/ ?>