318 lines
11 KiB
PHP
Executable File
318 lines
11 KiB
PHP
Executable File
<?php
|
|
$idPolice = $_SESSION['idPolice_C'];
|
|
|
|
require_once $_SESSION['dossierSociete'].'/Tarifs/Modele/Police_sodciete.php';
|
|
|
|
$this->police_societe = new Police_sodciete();
|
|
|
|
$entetecp = $this->police_societe->getEnteteCP($idPolice);
|
|
$collegecps = $this->police_societe->getCollegesCpLienParente($idPolice);
|
|
$garantiescollegecps = $this->police_societe->getGarantiesCollegesCpLienParente($idPolice);
|
|
$tableaupretationcps = $this->police_societe->gettableauPrestationsCpLienParente($idPolice);
|
|
$nombrestatut = $this->police_societe->getnombrestatutpolice($idPolice);
|
|
|
|
$pdf = new FPDF_Protection();
|
|
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
|
|
$userPassword = '';
|
|
$ownerPassword = null;
|
|
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=6;
|
|
$htext=6;
|
|
// Logo
|
|
if ($entetecp['typeGarant']=="1"){
|
|
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($entetecp['codeGcassureur']).'.png')){
|
|
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($entetecp['codeGcassureur']).'.png',10,5,30);
|
|
}else{
|
|
$pdf->Image($_SESSION['lienLogo'],10,6,20);
|
|
}
|
|
}else{
|
|
$pdf->Image($_SESSION['lienLogo'],10,6,20);
|
|
}
|
|
|
|
// Police Arial gras 15
|
|
$pdf->SetFont('Arial','B',10);
|
|
|
|
// Décalage à droite
|
|
$pdf->Cell(60);
|
|
|
|
$pdf->SetFillColor(217,237,247); // bleu
|
|
// Titre
|
|
$pdf->Cell(90,$ht,convertirc("PRIME COLLEGE"),1,0,'C',true);
|
|
|
|
// Saut de ligne
|
|
$pdf->Ln(20);
|
|
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Code Compagnie"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['codeGcassureur']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
if($entetecp['codeTypeContrat'] == "G")
|
|
{
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Nature du risque"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": SANTE GROUPE"),0,0,'L',false);
|
|
}
|
|
else
|
|
{
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Nature du risque"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": SANTE INDIVIDUELLE"),0,0,'L',false);
|
|
}
|
|
$pdf->Ln();
|
|
|
|
$garant = $entetecp['garant'];
|
|
|
|
if(strlen($garant) > "24"){
|
|
$garant = $entetecp['codeGcassureur'];
|
|
}
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Compagnie"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$garant),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['libellePolice']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Code Intermédiaire"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['codeApporteur']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("N° Interne Police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroPolice']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Intermédiaire"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['apporteur']),0,0,'L',false);
|
|
|
|
$dureeOld = dateDifferenceMois($entetecp['dateEffet'],$entetecp['dateEcheance'])+1;
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Durée"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$dureeOld." mois"),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("N° Souscripteur"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroClient']),0,0,'L',false);
|
|
|
|
//dateLang($this->nettoyer($police['dateEffet']), $_SESSION['lang'])
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Date Effet"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['dateEffet']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Souscripteur"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['nomClient']),0,0,'L',false);
|
|
$pdf->SetFont('Arial','',10);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Date Echéance"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['dateEcheance']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Adresse postale"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['boitepostale']),0,0,'L',false);
|
|
$pdf->SetFont('Arial','',10);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("N° d'avenant"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroAvenant']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(40,$ht,convertirc("Numéro de police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroPoliceGarant']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',10);
|
|
$pdf->Cell(35);
|
|
$pdf->Cell(40,$ht,convertirc("Date d'avenant"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',10);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['dateAvenant']),0,0,'L',false);
|
|
|
|
$pdf->Ln(10);
|
|
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
$pdf->SetFillColor(217,237,247); // bleu
|
|
$pdf->Cell(90,$ht,convertirc("Statut"),1,0,'C',true);
|
|
$pdf->SetFillColor(217,237,247); // bleu
|
|
$pdf->Cell(40,$ht,convertirc("Prime nette HT"),1,0,'C',true);
|
|
$pdf->SetFillColor(217,237,247); // bleu
|
|
$pdf->Cell(20,$ht,convertirc("Effectif"),1,0,'C',true);
|
|
$pdf->SetFillColor(217,237,247); // bleu
|
|
$pdf->Cell(40,$ht,convertirc("Prime Totale HT"),1,1,'C',true);
|
|
|
|
$pdf->SetFont('Arial','', 9);
|
|
|
|
$nbPersonne = "0";
|
|
$nbPersonneCollege = "0";
|
|
$nbPersonneOption = "0";
|
|
|
|
$primeHtOption = "0";
|
|
$primeHtCollee = "0";
|
|
|
|
// $idCollege = "0";
|
|
$oldidCollege = "0";
|
|
$primeHtLienParenteTotal = "0";
|
|
$primeHtLienParenteCollege = "0";
|
|
$idCollegeNew = "0";
|
|
|
|
$accessoireTotal = "0";
|
|
$primeHtTotal = "0";
|
|
$taxeTotal = "0";
|
|
$primeTtcTotal = "0";
|
|
|
|
foreach ($collegecps as $collegecp)
|
|
{
|
|
$idCollege = $collegecp['idCollege'];
|
|
|
|
$entetecollege = $this->police_societe->getCollegesCp($idCollege);
|
|
|
|
$primeHtOption = $collegecp['primeHtOption'];
|
|
$nbPersonneOption = $collegecp['nbPersonneOption'];
|
|
$accessoireOption = $collegecp['accessoireOption'];
|
|
|
|
$taxeOption = $collegecp['taxeOption'];
|
|
$primeTtcOption = $collegecp['primeTtcOption'];
|
|
|
|
$nbPersonneCollege = $collegecp['nbPersonneCollege'];
|
|
|
|
|
|
$fraisCarte = $entetecollege['fraisCarteCollege'];
|
|
$accessoireCollege = $entetecollege['accessoireCollege'];
|
|
|
|
$primeHtCollege = $entetecollege['primeHtCollege'];
|
|
$taxeCollege = $entetecollege['taxeCollege'];
|
|
$primeTtcCollege = $entetecollege['primeTtcCollege'];
|
|
|
|
|
|
if ($oldidCollege<>$idCollege && $oldidCollege <> "0")
|
|
{
|
|
|
|
$primeHtCollegeProrata = ($dureeOld*$primeHtCollege)/12;
|
|
$primeTtcCollegeProrata = ($dureeOld*$primeTtcCollege)/12;
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
|
|
$pdf->Cell(130,$ht,convertirc("Sous-Total HT"),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($nbPersonneCollege),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,format_N($primeHtCollegeProrata-$accessoireCollege),1,1,'C',false);
|
|
|
|
$pdf->Cell(80,$ht,convertirc("Accessoires : ".format_N($accessoireCollege)),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,convertirc("Taxes : ".format_N($taxeCollege)),1,0,'C',false);
|
|
$pdf->Cell(70,$ht,convertirc("Sous-Total TTC: ".format_N($primeTtcCollegeProrata)),1,1,'C',false);
|
|
}
|
|
|
|
if($idCollegeNew!=$collegecp['idCollege'])
|
|
{
|
|
$pdf->SetFont('Arial','BI', 9);
|
|
$pdf->Cell(190,$ht,convertirc($collegecp['produit']." => ".$collegecp['libelleCollege']),1,1,'C',false);
|
|
$pdf->SetFont('Arial','', 9);
|
|
$idCollegeNew = $collegecp['idCollege'];
|
|
}
|
|
|
|
$pdf->SetFont('Arial','', 9);
|
|
|
|
$pdf->Cell(90,$ht,convertirc($collegecp['lienparente']),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,format_N($collegecp['primeBase']),1,0,'C',false);
|
|
|
|
$pdf->Cell(20,$ht,format_N($collegecp['nbPersonne']),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,format_N($collegecp['nbPersonne']*$collegecp['primeNette']),1,1,'C',false);
|
|
|
|
// $nbPersonne += $collegecp['nbPersonne'];
|
|
// $primeHtLienParenteTotal += $collegecp['primeHtLienParente'];
|
|
|
|
$oldidCollege = $idCollege;
|
|
}
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
|
|
$pdf->Cell(130,$ht,convertirc("Sous-Total HT"),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($nbPersonneCollege),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,format_N($primeHtCollege-$accessoireCollege),1,1,'C',false);
|
|
|
|
$pdf->Cell(90,$ht,convertirc("Accessoires : ".format_N($accessoireCollege)." - Frais Cartes : ".format_N($fraisCarte)),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,convertirc("Taxes : ".format_N($taxeCollege)),1,0,'C',false);
|
|
$pdf->Cell(60,$ht,convertirc("Sous-Total TTC : ".format_N($primeTtcCollege)),1,1,'C',false);
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
|
|
$pdf->Cell(130,$ht,convertirc("Total HT :"),1,0,'C',false);
|
|
$pdf->Cell(20,$ht,format_N($nbPersonneOption),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,format_N($primeHtOption-$accessoireOption),1,1,'C',false);
|
|
|
|
$pdf->Cell(90,$ht,convertirc("Accessoires : ".format_N($accessoireOption)." - Frais Cartes : ".format_N($fraisCarte)),1,0,'C',false);
|
|
$pdf->Cell(40,$ht,convertirc("Taxes : ".format_N($taxeOption)),1,0,'C',false);
|
|
$pdf->Cell(60,$ht,convertirc("Total TTC : ".format_N($primeTtcOption)),1,1,'C',false);
|
|
|
|
// FIN TEXTE LIBRE
|
|
|
|
$pdf->Ln(20);
|
|
|
|
$pdf->SetFont('Arial','BI', 10);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("Fait à ".$_SESSION['villeSociete']." en 2 exemplaires, le ".$entetecp['dateJour']." à ".$entetecp['HeureJour']),0,1,'C',false);
|
|
|
|
$pdf->Ln(1);
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
|
|
$pdf->SetFont('Arial','BU', 10);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("AU SOUSCRIPTEUR"),0,0,'L',false);
|
|
|
|
$pdf->Cell(0,$ht,convertirc("A LA COMPAGNIE"),0,1,'R',false);
|
|
|
|
if ($entetecp['typeGarant']=="1"){
|
|
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($entetecp['codeGcassureur']).'.png')){
|
|
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($entetecp['codeGcassureur']).'.png',10,265,190);
|
|
}
|
|
|
|
}
|
|
|
|
|
|
$fichier="Temp/TMP_primecollege"."_".uniqid().".pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_export_a" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > TELECHARGER </a> ';
|
|
$t_html .=' </div ';
|
|
|
|
echo $t_html;
|
|
?>
|