354 lines
12 KiB
PHP
Executable File
354 lines
12 KiB
PHP
Executable File
<?php
|
|
$idPolice = $_SESSION['idPolice_C'];
|
|
|
|
require_once $_SESSION['dossierSociete'].'/Tarifs/Modele/Police_sodciete.php';
|
|
|
|
$this->police_societe = new Police_sodciete();
|
|
|
|
$idAvenant = $this->requete->getParametreFormulaire("idAvenant");
|
|
$numeroAvenant_cp=0;
|
|
$numeroAvenant = $_SESSION['numeroAvenant_cp'] ;
|
|
$p_emission = $numeroAvenant['numeroAvenant'];
|
|
|
|
$entetecp = $this->police_societe->getEnteteCP($idPolice,$p_emission);
|
|
$collegecps = $this->police_societe->getCollegesCpLienParente($idPolice);
|
|
$garantiescollegecps = $this->police_societe->getGarantiesCollegesCpLienParente($idPolice);
|
|
$tableaupretationcps = $this->police_societe->gettableauPrestationsCpLienParente($idPolice);
|
|
|
|
|
|
$codeGarant = $this->police_societe->getcodeGarant($idPolice);
|
|
|
|
$codeGcAssureur = $codeGarant['codeGcAssureur'];
|
|
$infosDuGarant = $this->police_societe->getInfosGarant($codeGcAssureur);
|
|
|
|
$pdf = new FPDF_Protection();
|
|
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
|
|
$userPassword = '';
|
|
$ownerPassword = null;
|
|
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=8;
|
|
// Logo
|
|
if ($infosDuGarant['typeGarant']=="1"){
|
|
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($codeGcAssureur).'.png')){
|
|
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/logo_'.strtolower($codeGcAssureur).'.png',10,5,30);
|
|
}else{
|
|
$pdf->Image($_SESSION['lienLogo'],10,6,30);
|
|
}
|
|
}else{
|
|
$pdf->Image($_SESSION['lienLogo'],10,6,30);
|
|
}
|
|
// Police Arial gras 15
|
|
$pdf->SetFont('Arial','B',15);
|
|
|
|
|
|
|
|
// Décalage à droite
|
|
$pdf->Cell(30);
|
|
|
|
$pdf->SetFillColor(153,255,153); // bleu
|
|
// Titre
|
|
$pdf->Cell(0,$ht,convertirc("BORDEREAU D'EMISSION DE LA PRIME"),1,0,'C',true);
|
|
require_once 'Entetecontrat.php';
|
|
|
|
/*
|
|
// Saut de ligne
|
|
$pdf->Ln(20);
|
|
//encadrer
|
|
$pdf->Rect(10,30,190,65);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Code Compagnie"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['codeGcassureur']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
if($entetecp['codeTypeContrat'] == "G")
|
|
{
|
|
$pdf->Cell(32,$ht,convertirc("Nature du risque"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": SANTE GROUPE"),0,0,'L',false);
|
|
}
|
|
else
|
|
{
|
|
$pdf->Cell(32,$ht,convertirc("Nature du risque"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": SANTE INDIVIDUELLE"),0,0,'L',false);
|
|
}
|
|
$pdf->Ln();
|
|
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
|
|
|
|
if(strlen($entetecp['garant']) > "40"){
|
|
|
|
$pdf->Cell(17,$ht,convertirc("Compagnie"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',8);
|
|
$pdf->Cell(85,$ht,convertirc(":".$entetecp['garant']),0,0,'L',false);
|
|
}
|
|
else{
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Compagnie"),0,0,'L',false);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['garant']),0,0,'L',false);
|
|
}
|
|
|
|
|
|
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
if(strlen($entetecp['libellePolice']) > "30"){
|
|
$pdf->Cell(22,$ht,convertirc("Police : "),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',8);
|
|
$pdf->MultiCell(65, 4, $entetecp['libellePolice'],0);
|
|
}else{
|
|
$pdf->Cell(32,$ht,convertirc("Police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['libellePolice']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
}
|
|
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Code Intermédiaire"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['codeApporteur']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(32,$ht,convertirc("N° Interne Police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroPolice']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Intermédiaire"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['apporteur']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(32,$ht,convertirc("Durée"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['dureePeriodicite']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("N° Souscripteur"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['numeroClient']),0,0,'L',false);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
if(strlen($entetecp['nomClient'])> "30"){
|
|
$pdf->Cell(22,$ht,convertirc("Souscripteur : "),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',8);
|
|
$pdf->MultiCell(65,4,convertirc($entetecp['nomClient']),0);
|
|
}
|
|
else{
|
|
|
|
$pdf->Cell(32,$ht,convertirc("Souscripteur"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(77,$ht,convertirc(": ".$entetecp['nomClient']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
}
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Echéance annuelle"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['echeancean']),0,0,'L',false);
|
|
|
|
|
|
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(32,$ht,convertirc("Fractionnement prime"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['fractionnement']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Adresse postale"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['boitepostale']),0,0,'L',false);
|
|
$pdf->SetFont('Arial','',9);
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(32,$ht,convertirc("N° d'avenant"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroAvenant']),0,0,'L',false);
|
|
$pdf->Ln();
|
|
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(30,$ht,convertirc("Numéro police"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(72,$ht,convertirc(": ".$entetecp['numeroPoliceGarant']),0,0,'L',false);
|
|
$pdf->SetFont('Arial','',9);
|
|
$pdf->Cell(32,$ht,convertirc("N° quittance"),0,0,'L',false);
|
|
$pdf->SetFont('Arial','B',9);
|
|
$pdf->Cell(20,$ht,convertirc(": ".$entetecp['numeroQuittancePlus']),0,0,'L',false);
|
|
//////////////////*/
|
|
$pdf->Ln(10);
|
|
|
|
|
|
$pdf->SetFont('Arial','B', 10);
|
|
$pdf->SetFillColor(153,255,153); // bleu
|
|
$pdf->Cell(60,$ht,convertirc("Statut"),1,0,'C',true);
|
|
$pdf->SetFillColor(153,255,153); // bleu
|
|
$pdf->Cell(50,$ht,convertirc("Prime nette HT"),1,0,'C',true);
|
|
$pdf->SetFillColor(153,255,153); // bleu
|
|
$pdf->Cell(30,$ht,convertirc("Effectif"),1,0,'C',true);
|
|
$pdf->SetFillColor(153,255,153); // bleu
|
|
$pdf->Cell(50,$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";
|
|
$ht = 6;
|
|
foreach ($collegecps as $collegecp)
|
|
{
|
|
$idCollege = $collegecp['idCollege'];
|
|
|
|
if ($oldidCollege<>$idCollege && $oldidCollege <> "0")
|
|
{
|
|
$pdf->SetTextColor(130,15,150);
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
$pdf->Cell(110,$ht,convertirc("Sous-Total HT :".format_N($primeHtCollege)),1,0,'C',false);
|
|
$pdf->Cell(30,$ht,format_N($nbPersonneCollege),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,format_N($primeHtCollege),1,1,'C',false);
|
|
|
|
$pdf->SetTextColor(0,0,0);
|
|
$pdf->Cell(60,$ht,convertirc("Accessoires : ".format_N($accessoireCollege)),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc("Taxes : ".format_N($taxeCollege)),1,0,'C',false);
|
|
$pdf->Cell(80,$ht,convertirc("Sous-Total TTC: ".format_N($primeTtcCollege)),1,1,'C',false);
|
|
$primeHtCollege= 0;
|
|
$nbPersonneCollege=0;
|
|
$accessoireCollege=0;
|
|
$primeTtcCollege =0;
|
|
$taxeCollege = 0;
|
|
}
|
|
|
|
if($idCollegeNew!=$collegecp['idCollege'])
|
|
{
|
|
$pdf->SetFont('Arial','BI', 9);
|
|
$pdf->SetTextColor(0,0,250);
|
|
$pdf->Cell(190,$ht,convertirc($collegecp['produit']." => ".$collegecp['libelleCollege']),'TB',1,'C',false);
|
|
$pdf->SetFont('Arial','', 9);
|
|
$idCollegeNew = $collegecp['idCollege'];
|
|
}
|
|
$pdf->SetTextColor(0,0,0);
|
|
|
|
$pdf->SetFont('Arial','', 9);
|
|
|
|
$pdf->Cell(60,$ht,convertirc($collegecp['lienparente']),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,format_N($collegecp['primeHt']),1,0,'C',false);
|
|
$pdf->Cell(30,$ht,format_N($collegecp['nbPersonne']),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,format_N($collegecp['primeHtLienParente']),1,1,'C',false);
|
|
|
|
$primeHtOption = $collegecp['primeHtOption'];
|
|
$nbPersonneOption = $collegecp['nbPersonneOption'];
|
|
$accessoireOption = $collegecp['accessoireOption'];
|
|
$primeHtOption = $collegecp['primeHtOption'];
|
|
$taxeOption = $collegecp['taxeOption'];
|
|
$primeTtcOption = $collegecp['primeTtcOption'];
|
|
|
|
$nbPersonneCollege += $collegecp['nbPersonne'];
|
|
// $primeHtCollege = $collegecp['primeHtLienParente'];
|
|
$accessoireCollege += $collegecp['accessoireCollege'];
|
|
$primeHtCollege += $collegecp['primeHtCollege'];
|
|
$taxeCollege += $collegecp['taxeCollege'];
|
|
$primeTtcCollege += $collegecp['primeTtcCollege'];
|
|
|
|
// $nbPersonne += $collegecp['nbPersonne'];
|
|
// $primeHtLienParenteTotal += $collegecp['primeHtLienParente'];
|
|
|
|
$oldidCollege = $idCollege;
|
|
|
|
$primeHtCollegett += $collegecp['primeHtCollege'];
|
|
$nbPersonneCollegett += $collegecp['nbPersonne'];
|
|
$accessoireCollegett += $collegecp['accessoireCollege'];
|
|
$taxeCollegett += $collegecp['taxeCollege'];
|
|
$primeTtcCollegett += $collegecp['primeTtcCollege'];
|
|
}
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
$pdf->SetTextColor(130,15,150);
|
|
|
|
$pdf->Cell(110,$ht,convertirc("Sous-Total HT :" .format_N($primeHtCollege)),1,0,'C',false);
|
|
$pdf->Cell(30,$ht,format_N($nbPersonneCollege),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,format_N($primeHtCollege),1,1,'C',false);
|
|
$pdf->SetTextColor(0,0,0);
|
|
$pdf->Cell(60,$ht,convertirc("Accessoires : ".format_N($accessoireCollege)),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc("Taxes : ".format_N($taxeCollege)),1,0,'C',false);
|
|
$pdf->Cell(80,$ht,convertirc("Sous-Total TTC : ".format_N($primeTtcCollege)),1,1,'C',false);
|
|
|
|
$pdf->Ln(8);
|
|
|
|
$pdf->SetFont('Arial','B', 9);
|
|
$pdf->SetTextColor(250,0,0);
|
|
|
|
$pdf->Cell(110,$ht,convertirc("Total HT :".format_N($primeHtCollegett)),1,0,'C',false);
|
|
|
|
$pdf->Cell(30,$ht,format_N($nbPersonneCollegett),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,format_N($primeHtCollegett),1,1,'C',false);
|
|
|
|
|
|
$pdf->SetTextColor(250,0,0);
|
|
$pdf->Cell(60,$ht,convertirc("Accessoires : ".format_N($accessoireCollegett)),1,0,'C',false);
|
|
$pdf->Cell(50,$ht,convertirc("Taxes : ".format_N($taxeCollegett)),1,0,'C',false);
|
|
$pdf->Cell(80,$ht,convertirc("Total TTC : ".format_N($primeTtcCollegett)),1,1,'C',false);
|
|
$pdf->SetTextColor(0,0,0);
|
|
|
|
// FIN TEXTE LIBRE
|
|
|
|
$pdf->Ln(10);
|
|
|
|
$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);
|
|
|
|
$pdf->Cell(190,0,convertirc(""),1,0,'L',false);
|
|
|
|
if ($infosDuGarant['typeGarant']=="1"){
|
|
if (file_exists($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($codeGcAssureur).'.png')){
|
|
$pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/garants/pied_'.strtolower($codeGcAssureur).'.png',10,280,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;
|
|
?>
|