<div wire:ignore.self
class="modal fade bs-example-modal-lg"
id="ModalTiers"
tabindex="-1"
role="dialog"
data-backdrop="static"
aria-labelledby="Modal_tiers"
aria-hidden="true"
>
<div class="modal-dialog modal-lg modal-dialog-top">
    <div class="modal-content">
        <div class="modal-header">
            <h6 class="modal-title" id="Modal_tiers">
                <!-- __BLOCK__ --><?php if($isNewTiers): ?> Ajouter <?php else: ?> Mise à jour <?php endif; ?> <!-- __ENDBLOCK__ --> Tiers
            </h6>
            <button
                type="button"
                class="close"
                wire:click.prevent="CloseModalTiers"
                data-dismiss="modal"
                aria-hidden="true"
            >
                ×
            </button>
        </div>
        <div class="modal-body">

            <div wire:ignore.self class="tab" >
                <ul class="nav nav-pills" role="tablist">
                    <li class="nav-item">
                        <a 
                            wire:click.prevent="selectTab_t('identification')"
                            class="nav-link  text-blue <?php echo e($tab_t == 'identification' ? 'active' : ''); ?>"
                            data-toggle="tab"
                            href="#identification"
                            role="tab"
                            aria-selected="true"
                            >Identification</a
                        >
                    </li>
                    <li class="nav-item">
                        <a  
                            wire:click.prevent="selectTab_t('compte')"
                            class="nav-link text-blue <?php echo e($tab_t == 'compte' ? 'active' : ''); ?>"
                            data-toggle="tab"
                            href="#compte_t"
                            role="tab"
                            aria-selected="false"
                            >Compte tiers</a
                        >
                    </li>
                    
                </ul>
                <div class="tab-content">
                    <div
                        class="tab-pane fade <?php echo e($tab_t == 'identification' ? 'show active' : ''); ?>"
                        id="identification"
                        role="tabpanel"
                    >
                        <div class="pd-20">
                            <div class="row">
                                <div class="col-md-12">
                                    <form >
                                        <div class="row mb-2">
                                         
                                            <div class="col-md-4">
                                                    <label for="">Désignation </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Désignation" wire:model="designation_t" maxlength="50" <?php if(!$isNewTiers): ?> readonly  <?php endif; ?> >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['designation_t'];
$__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 class="col-md-4">
                                                    <label for="">Nom Complet </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Nom Complet" wire:model="nom_complet_t" maxlength="150">
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['nom_complet_t'];
$__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 class="col-md-4">
                                                <label for="">Type tiers </label>
                                                    <select class="form-control form-control-sm" wire:model="type_t" <?php if(!$isNewTiers): ?> readonly  <?php endif; ?>>
                                                        <option value="">Select type tiers</option>
                                                        <option value="client">Client</option>
                                                        <option value="fourn">Fournisseur</option>
                                                    </select>
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['type_t'];
$__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="row mb-2">
                                            <div class="col-md-4">
                                                    <label for="">Type tiers </label>
                                                    <select class="form-control form-control-sm" wire:model="forme_t">
                                                        <option value="">Select forme tiers</option>
                                                        <option value="particulier">Particulier</option>
                                                        <option value="entreprise">Entreprise</option>
                                                    </select>
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['forme_t'];
$__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 class="col-md-4 ">
                                                    <label for="">Téléphone </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Téléphone (Optionnel)" wire:model="phone_t"   maxlength="15">
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['phone_t'];
$__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 class="col-md-4">
                                                <label for="">Email </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Email (Optionnel)" wire:model="email_t"  maxlength="50"  >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['email_t'];
$__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="row">
                                            <div class="col-md-4">
                                                     <label for="">Adresse </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Adresse (Optionnel)" wire:model="adresse_t" maxlength="120"   >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['adresse_t'];
$__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 class="col-md-4">
                                                    <label for="">Ville </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Ville (Optionnel)" wire:model="ville_t" maxlength="50"  >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['ville_t'];
$__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 class="col-md-4">
                                                    <label for="">Pays </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Pays (Optionnel)" wire:model="pays_t" maxlength="50"  >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['pays_t'];
$__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>
                                    </form>
                                </div>
                            </div> 
                        </div>
                    </div>
                    <div class="tab-pane fade <?php echo e($tab_t == 'compte' ? 'show active' : ''); ?>" 
                        id="compte_t" role="tabpanel">
                        <div class="pd-20">
                            <div class="row">
                                <div class="col-md-12">
                                    <form >
                                        <div class="row mb-2">
                                         
                                            <div class="col-md-3">
                                                    <label for="">Compte de tiers </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Compte de tiers" wire:model="compte_tiers" maxlength="8"  >
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['compte_tiers'];
$__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 class="col-md-6">
                                                    <label for="">Intitulé de compte </label>
                                                    <input type="text"  class="form-control form-control-sm" placeholder="Intitulé de compte" wire:model="intitule_compte" maxlength="100">
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['intitule_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__ -->
                                                
                                            </div>
                                            <div class="col-md-3">
                                              
                                                <label for="">Compte Général </label>
                                                    <select class="form-control form-control-sm" wire:model="compte_general">
                                                        <option value="">Select Compte Général</option>
                                                       
                                                        <!-- __BLOCK__ --><?php $__currentLoopData = get_compte_Client_or_Fourn($type_t); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $info): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                             <option value="<?php echo e($info->num_compte); ?>"><?php echo e($info->num_compte); ?> <?php echo e($info->nom_compte); ?></option>
                                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
                                                    </select>
                                                    <!-- __BLOCK__ --><?php $__errorArgs = ['compte_general'];
$__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="row mb-2 pl-10 al_r">
                                                <button type="button" class="btn btn-outline-primary btn-sm" wire:click="addItem">ajouter compte de tiers</button>
                                        </div>
                                        <div  class="list_compte" >
                                           
                                            <!-- __BLOCK__ --><?php if(empty($dicoCompteTiers)): ?>
                                         
                                            <?php else: ?>
                                                <table border="0" class="table-striped table-sm" style="font-size:0.8em; width:100%;">
                                                <thead>
                                                    <tr>
                                                       
                                                        <td  style="width: 8px;">Compte tiers</td>
                                                        <td  style="width: 74px;" >Intitulé de Compte</td>
                                                        <td style="width: 8px;">Compte Général</td>
                                                        <td style="width: 10px;"></td>
                                                    </tr>
                                                </thead>    
                                                <tbody>
                                                    <!-- __BLOCK__ --><?php $__currentLoopData = $dicoCompteTiers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                    
                                                        <tr>
                                                            
                                                            <td><?php echo e($data['compte_tiers']); ?></td>
                                                            <td><?php echo e($data['intitule_compte']); ?></td>
                                                            <td><?php echo e($data['compte_general']); ?></td>
                                                            <td align="center" ><!-- __BLOCK__ --><?php if($data['is_new'] === 1): ?><span class="text-danger"  wire:click="removeItem(<?php echo e($data['compte_tiers']); ?>)"  style="cursor:pointer;"><i class="fa fa-times"></i></span><?php endif; ?> <!-- __ENDBLOCK__ --></td>
                                                        </tr>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> <!-- __ENDBLOCK__ -->
    
                                                    
                                                </tbody>
                                                </table>
                                            <?php endif; ?> <!-- __ENDBLOCK__ -->

                                            <!-- __BLOCK__ --><?php $__errorArgs = ['dicoCompteTiers'];
$__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('ajoutez un compte de tiers'); ?>

                                            </small>
                                            <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?> <!-- __ENDBLOCK__ -->
                                        </div>
                                    </form>
                                </div>
                            </div>
                        </div>
                    </div>
                   
                </div>
            </div>

        </div>
        <div class="modal-footer">
            <button
                type="button"
                wire:click.prevent="CloseModalTiers"
                class="btn btn-secondary btn-sm"
                data-dismiss="modal"
               
            >
                Fermer
            </button>

            <!-- __BLOCK__ --><?php if($isNewTiers && $tab_t === 'compte' && !$activeBtnSave ): ?>
                <button type="button" wire:click="selectTab_t('identification')"  class="btn btn-primary btn-sm" style="width:15%;">
                    Précédent
                </button>

            <?php elseif($isNewTiers && $tab_t === 'identification' && !$activeBtnSave): ?>
                <button type="button" wire:click="selectTab_t('compte')"  class="btn btn-primary btn-sm" style="width:15%;">
                    Suivant
                </button>

            <?php elseif($isNewTiers && $activeBtnSave): ?>
                    <button type="button" class="btn btn-info btn-sm" wire:click="saveAndCloseModalTiers"
                    wire:loading.attr="disabled" style="width:25%;"
                    >
                        <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="saveAndCloseModalTiers">
                            <span class="visually-hidden"></span>
                        </div>
        
                        <div wire:loading.remove wire:target="saveAndCloseModalTiers">
                            Enregistrer & Fermer
                        </div>
                    </button>
                    <button type="button" class="btn btn-primary btn-sm" wire:click="saveTiers"
                    wire:loading.attr="disabled" style="width:15%;"
                    >
                        <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="saveTiers">
                            <span class="visually-hidden"></span>
                        </div>
        
                        <div wire:loading.remove wire:target="saveTiers">
                            Enregistrer
                        </div>
                    </button>
            <?php elseif(!$isNewTiers): ?>
                <button type="button" class="btn btn-success btn-sm" wire:click="saveAndCloseModalTiers"
                wire:loading.attr="disabled" style="width:15%;"
                >
                    <div class="spinner-border spinner-border-sm"  role="status" wire:loading wire:target="saveAndCloseModalTiers">
                        <span class="visually-hidden"></span>
                    </div>

                    <div wire:loading.remove wire:target="saveAndCloseModalTiers">
                        Enregistrer
                    </div>
                </button>
            <?php else: ?>

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

            
            
        </div>
    </div>
</div>
</div>

<?php $__env->startPush('scripts'); ?>

<script>
    	window.addEventListener('hideModalTiers', event => {
					$('#ModalTiers').modal('hide');
				})

        window.addEventListener('showModalTiers', event => {
					$('#ModalTiers').modal('show');
				})
  
</script>
    
<?php $__env->stopPush(); ?>

<?php /**PATH D:\laravel_apps\access\resources\views/livewire/modal-tiers.blade.php ENDPATH**/ ?>