newdesigngestionnaire/Vue/Fichegcassureur/index.php
2026-03-15 17:43:00 +00:00

301 lines
22 KiB
PHP
Executable File

<?php
$this->titre = "INTER SANTE - Fiche Garant";
$_SESSION['codeGcAssureur_C'] = $this->nettoyer($gc['codeGcAssureur']);
$nbreTotal = count($polices);
$sourcefonds = est_anglophone() ? $gc['sourcefondsEng'] : $gc['sourcefonds'];
$sourcehonoraire = est_anglophone() ? $gc['sourcehonoraireEng'] : $gc['sourcehonoraire'];
$assiettefonds = est_anglophone() ? $gc['assiettefondsEng'] : $gc['assiettefonds'];
$assiettehonoraire = est_anglophone() ? $gc['assiettehonoraireEng'] : $gc['assiettehonoraire'];
$periodicitesappelfond = est_anglophone() ? $gc['periodicitesappelfondEng'] : $gc['periodicitesappelfond'];
$periodicitesfactDeficit = est_anglophone() ? $gc['periodicitesfactDeficitEng'] : $gc['periodicitesfactDeficit'];
$periodicites = est_anglophone() ? $gc['periodicitesEng'] : $gc['periodicites'];
$modepaiement = est_anglophone() ? $gc['modepaiementEng'] : $gc['modepaiement'];
$conventions = est_anglophone() ? $gc['conventionsEng'] : $gc['conventions'];
$tarifActe = est_anglophone() ? $gc['tarifActeEng'] : $gc['tarifActe'];
?>
<div class="page-content animate__animated animate__fadeIn">
<input class="sr-only" type="text" id="idGc" name="idGc" value="<?= $this->nettoyer($gc['id']);?>" >
<INPUT class="sr-only" TYPE="text" id="codeGcAssureur" NAME="codeGcAssureur" value="<?=$this->nettoyer($gc['codeGcAssureur'])?>">
<div class="header-section mb-1">
<div class="d-flex align-items-center bg-white p-3 shadow-sm border-start border-primary border-4" style="border-radius: var(--radius-md);">
<div class="icon-shape bg-primary-ghost text-primary rounded-circle me-3" style="width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;">
<i class="fas fa-shield-alt fs-4"></i>
</div>
<div class="flex-grow-1">
<h4 id="titre-page" class="mb-0 fw-bold text-uppercase"><?= $this->nettoyer($gc['libelle']) ?></h4>
<p class="text-muted small mb-0"><?= _("Code :") ?> <span class="badge bg-light text-primary border"><?= $this->nettoyer($gc['codeGcAssureur']) ?></span></p>
</div>
<div class="text-end">
<span class="badge bg-primary-ghost text-primary rounded-pill px-3 py-2 fw-bold">
<?= $nbreTotal ?> <?= _("Polices actives") ?>
</span>
</div>
</div>
</div>
<ul class="nav nav-tabs border-0 gap-2 mb-1" id="ficheGarantTabs" role="tablist">
<li class="nav-item">
<button class="nav-link active rounded-pill px-4 fw-bold shadow-xs" data-bs-toggle="tab" data-bs-target="#tab-polices" type="button">
<i class="fas fa-list-ul me-2"></i><?= _("Polices actives") ?>
</button>
</li>
<li class="nav-item">
<button class="nav-link rounded-pill px-4 fw-bold shadow-xs" data-bs-toggle="tab" data-bs-target="#tab-infos" type="button">
<i class="fas fa-id-card me-2"></i><?= _("Identité & Contacts") ?>
</button>
</li>
<li class="nav-item">
<button class="nav-link rounded-pill px-4 fw-bold shadow-xs" data-bs-toggle="tab" data-bs-target="#tab-finance" type="button">
<i class="fas fa-percentage me-2"></i><?= _("Taux & Frais") ?>
</button>
</li>
<li class="nav-item">
<button class="nav-link rounded-pill px-4 fw-bold shadow-xs" data-bs-toggle="tab" data-bs-target="#tab-gestion" type="button">
<i class="fas fa-cogs me-2"></i><?= _("Gestion des Fonds") ?>
</button>
</li>
<li class="nav-item">
<button class="nav-link rounded-pill px-4 fw-bold shadow-xs" data-bs-toggle="tab" data-bs-target="#tab-compta" type="button">
<i class="fas fa-file-invoice-dollar me-2"></i><?= _("Comptabilité") ?>
</button>
</li>
</ul>
<div class="tab-content border-0">
<div class="tab-pane fade show active" id="tab-polices" role="tabpanel">
<div class="card border-0 shadow-sm">
<div class="table-responsive">
<table class="table table-hover align-middle mb-0 datatable-inter" id="tablePolicesGarant" style="width:100%;">
<thead class="bg-light text-muted fw-bold">
<tr>
<th class="text-center py-3"><?= _("No Police") ?></th>
<th class="py-3"><?= _("Libellé Police") ?></th>
<th class="text-center py-3"><?= _("Effet") ?></th>
<th class="text-center py-3"><?= _("Echéance") ?></th>
<th class="text-center py-3"><?= _("Etat") ?></th>
<th class="text-center py-3"><?= _("No Devis") ?></th>
</tr>
</thead>
<tbody>
<?php foreach ($polices as $p):
$libelleP = ($this->nettoyer($p['libellePolice']) == $this->nettoyer($p['souscripteur']))
? $this->nettoyer($p['souscripteur'])
: $this->nettoyer($p['souscripteur']).' / '.$this->nettoyer($p['libellePolice']);
?>
<tr onclick="selectionner_police(<?= $p['id'] ?>,'<?= $p['numeroPolice'] ?>');" class="cursor-pointer">
<td class="text-center fw-bold text-primary"><?= $p['numeroPolice'] ?></td>
<td><?= $libelleP ?></td>
<td class="text-center"><?= dateLang($p['dateEffet']) ?></td>
<td class="text-center"><?= dateLang($p['dateEcheance']) ?></td>
<td class="text-center">
<span class="badge rounded-pill <?= ($p['etatPolice'] == 'ACTIF') ? 'bg-success-light text-success' : 'bg-warning-light text-warning' ?>">
<?= $p['etatPolice'] ?>
</span>
</td>
<td class="text-center text-muted"><?= $p['numeroDevis'] ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab-infos" role="tabpanel">
<div class="row g-4">
<div class="col-md-8">
<div class="card border-0 shadow-sm p-4">
<div class="row g-3">
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Nom Complet") ?></label>
<input class="form-control bg-light border-0 fw-bold" value="<?= $this->nettoyer($gc['libelle']) ?>" disabled>
</div>
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Type de Garant") ?></label>
<input class="form-control bg-light border-0 fw-bold" value="<?= $this->nettoyer($gc['typegc']) ?>" disabled>
</div>
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Représentant") ?></label>
<input class="form-control bg-light border-0 fw-bold" value="<?= $this->nettoyer($gc['representant']) ?>" disabled>
</div>
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Téléphone Représentant") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['telephonerepresentant']) ?>" disabled>
</div>
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Téléphone Garant") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['telephoneGarant']) ?>" disabled>
</div>
<div class="col-md-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("E-mail") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['email']) ?>" disabled>
</div>
<div class="col-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Sigle") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['siglerepresentant']) ?>" disabled>
</div>
<div class="col-6">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Adresse Postale") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['adressePostale']) ?>" disabled>
</div>
<div class="col-12">
<label class="form-label small text-muted fw-bold text-uppercase"><?= _("Adresse Géographique") ?></label>
<input class="form-control bg-light border-0" value="<?= $this->nettoyer($gc['adresseGeographique']) ?>" disabled>
</div>
</div>
</div>
</div>
<div class="col-md-4">
<div class="card border-0 shadow-sm p-4 text-center">
<label class="form-label small text-muted fw-bold text-uppercase mb-3"><?= _("Identité Visuelle") ?></label>
<div class="p-3 bg-light rounded-3 mb-3">
<?php if ($gc['logo_garant'] > " "): ?>
<img src="<?= $_SESSION['dossierPhoto_C'].$_SESSION['dossierSociete'].'/Tarifs/Img/garants/'.$_SESSION['logoGarant'] ?>" class="img-fluid rounded border shadow-sm" style="max-height:120px;">
<?php else: ?>
<i class="fas fa-image fa-4x text-muted opacity-25 py-4"></i>
<?php endif; ?>
</div>
<form enctype="multipart/form-data" action="Fichegcassureur/<?= $gc['id'] ?>/" method="post">
<input type="file" name="fichier_image_a_uploader" class="form-control form-control-sm mb-2 shadow-none border-2">
<button type="submit" name="submit" class="btn btn-primary btn-sm w-100 rounded-pill fw-bold"><?= _("Mettre à jour le logo") ?></button>
</form>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab-finance" role="tabpanel">
<div class="card border-0 shadow-sm p-4">
<div class="row g-4">
<div class="col-md-3 border-end">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Commissions") ?></label>
<div class="mb-3">
<div class="text-muted small"><?= _("Sur Primes") ?></div>
<div class="h5 fw-bold text-primary"><?= $gc['gcTauxCommissionGerant'] ?> %</div>
</div>
<div>
<div class="text-muted small"><?= _("Sur Sinistres") ?></div>
<div class="h5 fw-bold text-primary"><?= $gc['gcTauxFraisReel'] ?> %</div>
</div>
</div>
<div class="col-md-3 border-end">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Taxes & Taux") ?></label>
<div class="mb-3"><div class="text-muted small"><?= _("TVA") ?></div><div class="h6 fw-bold"><?= $gc['gcTauxTva'] ?> %</div></div>
<div class="mb-3"><div class="text-muted small"><?= _("Ristourne") ?></div><div class="h6 fw-bold"><?= $gc['gcTauxRistourne'] ?> %</div></div>
<div><div class="text-muted small"><?= _("Redressement") ?></div><div class="h6 fw-bold"><?= $gc['gcTauxRedressement'] ?> %</div></div>
</div>
<div class="col-md-3 border-end">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Frais de Cartes") ?></label>
<div class="mb-2 d-flex justify-content-between"><span><?= _("Nouvelle") ?></span><span class="fw-bold"><?= format_N($gc['fraisCarteAfn']) ?></span></div>
<div class="mb-2 d-flex justify-content-between"><span><?= _("Renouvellement") ?></span><span class="fw-bold"><?= format_N($gc['fraisCarteRen']) ?></span></div>
<div class="d-flex justify-content-between"><span><?= _("Ré-impression") ?></span><span class="fw-bold"><?= format_N($gc['fraisCarteImp']) ?></span></div>
</div>
<div class="col-md-3">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Alertes & Seuils") ?></label>
<div class="mb-3"><div class="text-muted small"><?= _("Seuil Remboursement Direct") ?></div><div class="h6 fw-bold"><?= $gc['seuilRdGarant'] ?> %</div></div>
<div class="mb-3"><div class="text-muted small"><?= _("Taux Suspension") ?></div><div class="h6 fw-bold text-danger"><?= $gc['gcLimiteConsommation'] ?> %</div></div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab-gestion" role="tabpanel">
<div class="row g-4">
<div class="col-md-6">
<div class="card border-0 shadow-sm h-100">
<div class="card-header bg-primary text-white py-2"><h6 class="mb-0 small text-uppercase fw-bold"><?= _("Fonds Sinistres") ?></h6></div>
<div class="card-body">
<div class="row g-2 small">
<div class="col-6 text-muted"><?= _("Source Fonds") ?></div><div class="col-6 fw-bold border-bottom"><?= $sourcefonds; ?></div>
<div class="col-6 text-muted"><?= _("Assiette Facturation") ?></div><div class="col-6 fw-bold border-bottom"><?= $assiettefonds; ?></div>
<div class="col-6 text-muted"><?= _("Périodicité Fonds") ?></div><div class="col-6 fw-bold border-bottom"><?= $periodicitesappelfond; ?></div>
<div class="col-6 text-muted"><?= _("Périodicité Déficit") ?></div><div class="col-6 fw-bold"><?= $periodicitesfactDeficit; ?></div>
</div>
<div class="mt-4 p-2 bg-primary-ghost rounded text-center">
<div class="small text-muted"><?= _("Provision Garant (HT)") ?></div>
<div class="fw-bold fs-5 text-primary"><?= format_N($gc['montantBudget']) ?></div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="card border-0 shadow-sm h-100">
<div class="card-header bg-info text-white py-2"><h6 class="mb-0 small text-uppercase fw-bold"><?= _("Fonds Honoraires & Caution") ?></h6></div>
<div class="card-body">
<div class="row g-2 small">
<div class="col-6 text-muted"><?= _("Source Fonds") ?></div><div class="col-6 fw-bold border-bottom"><?= $sourcehonoraire; ?></div>
<div class="col-6 text-muted"><?= _("Assiette Facturation") ?></div><div class="col-6 fw-bold border-bottom"><?= $assiettehonoraire; ?></div>
<div class="col-6 text-muted"><?= _("Périodicité") ?></div><div class="col-6 fw-bold"><?= $periodicites; ?></div>
</div>
<div class="row mt-3 g-2">
<div class="col-6 bg-light p-2 rounded"><small class="text-muted d-block"><?= _("Caution Permanente (HT)") ?></small><span class="fw-bold"><?= format_N($gc['forfaitCautionPermanant']) ?></span></div>
<div class="col-6 bg-light p-2 rounded"><small class="text-muted d-block"><?= _("Forfait Honoraire") ?></small><span class="fw-bold"><?= format_N($gc['forfaitHonoraire']) ?></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="tab-pane fade" id="tab-compta" role="tabpanel">
<div class="card border-0 shadow-sm p-4">
<div class="row g-4">
<div class="col-md-4">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Comptes Comptables") ?></label>
<div class="p-2 bg-light border-start border-3 border-primary mb-2">
<small class="text-muted d-block"><?= _("N° Compte Tiers Payant") ?></small><span class="fw-bold"><?= $gc['numerodeCompteComptableTP'] ?></span>
</div>
<div class="p-2 bg-light border-start border-3 border-warning mb-2">
<small class="text-muted d-block"><?= _("N° Compte Remboursement Direct") ?></small><span class="fw-bold"><?= $gc['numerodeCompteComptableRD'] ?></span>
</div>
<div class="p-2 bg-light border-start border-3 border-info">
<small class="text-muted d-block"><?= _("N° Compte Contribuable") ?></small><span class="fw-bold"><?= $gc['numeroCompteContribuable'] ?></span>
</div>
</div>
<div class="col-md-4">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Règlement & Convention") ?></label>
<div class="mb-3"><small class="text-muted d-block"><?= _("Mode Paiement") ?></small><span class="fw-bold text-primary"><?= $modepaiement; ?></span></div>
<div class="mb-3"><small class="text-muted d-block"><?= _("Convention") ?></small><span class="fw-bold"><?= $conventions; ?></span></div>
<div class="mb-3"><small class="text-muted d-block"><?= _("Tarif Actes") ?></small><span class="fw-bold"><?= $tarifActe; ?></span></div>
</div>
<div class="col-md-4">
<label class="small text-muted fw-bold text-uppercase d-block mb-3"><?= _("Complément Caution") ?></label>
<div class="mb-3"><small class="text-muted d-block"><?= _("Fraction (Nombre mois / 12)") ?></small><span class="fw-bold fs-6"><?= format_N($gc['nbMoisCaution']) ?></span></div>
<div class="mb-3"><small class="text-muted d-block"><?= _("Seuil Complément (%)") ?></small><span class="fw-bold fs-6"><?= format_N($gc['seuilComplementCaution']) ?> %</span></div>
<div class="p-2 rounded <?= ($gc['encaissementExige'] == "1") ? 'bg-danger text-white' : 'bg-success text-white' ?> fw-bold small text-center">
<i class="fas <?= ($gc['encaissementExige'] == "1") ? 'fa-lock' : 'fa-unlock' ?> me-2"></i>
<?= ($gc['encaissementExige'] == "1") ? _("Impayé = Blocage") : _("Prestation autorisée") ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.nav-tabs .nav-link { color: #6c757d; border: 1px solid transparent; background: #fff; transition: 0.3s; margin-bottom: 5px; }
.nav-tabs .nav-link.active { background-color: var(--bs-primary) !important; color: white !important; }
.bg-success-light { background-color: rgba(25, 135, 84, 0.1); }
.bg-warning-light { background-color: rgba(255, 193, 7, 0.1); }
.bg-primary-ghost { background-color: rgba(33, 46, 83, 0.08); }
.cursor-pointer { cursor: pointer; }
.form-select:disabled { opacity: 1; border: none; background: transparent; padding: 0; font-weight: bold; color: #212e53; }
</style>
<script>
var checkDT = setInterval(function() {
if (typeof initSmartTable === 'function') {
initSmartTable('.datatable-inter', 'Polices_Garant', false);
// AJOUT : Force le recalcul des colonnes quand on change d'onglet
$('button[data-bs-toggle="tab"]').on('shown.bs.tab', function (e) {
$($.fn.dataTable.tables(true)).DataTable().columns.adjust();
});
clearInterval(checkDT);
}
}, 100);
</script>