detailsp = new Statistique(); $this->college = new Collegepolice(); $this->police_societe = new Police_sodciete(); } public function index() { //////////////////////////////////////////// $start_time = microtime(true); $pdf = new FPDF_Protection(); $pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES'); $userPassword = ''; $ownerPassword = null; $pdf->SetProtection(['print'], $userPassword, $ownerPassword); $idPolice = $this->requete->getParametreFormulaire("idPolice"); $idCollege = $this->requete->getParametreFormulaire("idCollege"); if( $idCollege ==""){ $idCollege = null; } $codeGcAssureur = $this->requete->getParametreFormulaire("codeGcAssureur"); $Chargement = $this->requete->getParametreFormulaire("Chargement"); $Chargement = str_replace(",", ".", $Chargement); $Chargement = (float)$Chargement; $debutStat = $this->requete->getParametreDate("debutStat"); $finStat = $this->requete->getParametreDate("finStat"); $depenses = $this->requete->getParametreFormulaire("depenses","numerique"); $_SESSION['debutStat'] = $debutStat; $_SESSION['finStat'] = $finStat; $_SESSION['depenses'] = $depenses; $p_datedebut = $_SESSION['debutStat']; $p_datefin =$_SESSION['finStat']; $p_garant = $codeGcAssureur; $entete = $this->detailsp->detailrapportspperiodepdfentete_new($idPolice, $p_datedebut, $p_datefin); $p_id = $entete['idPolice'] ; $p_limite = $_SESSION['depenses']; $p_id_college = $idCollege; $p_id_clients = null; $p_apporteur = null; $infocollege = $this->college->getCollegepoliceId($idCollege); $tableaudajustements = $this->detailsp->gettableauAjustementGarant($codeGcAssureur); $infosDuGarant = $this->police_societe->getInfosGarant($codeGcAssureur); $chargeravantapres = $this->requete->getParametreFormulaire("chargeravantapres"); $pdf->AliasNbPages(); $pdf->AddPage(); // debut page de garde $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit1.jpg', 0, 0, 210); $pdf->SetY(75); $pdf->SetFont('Helvetica', 'B', 36); $pdf->SetTextColor( 37, 36, 97 ); $pdf->Cell(0, 6, convertirc(_('STATISTIQUES MALADIE')), 0, 1, 'C', false); $pdf->SetY(240); $pdf->SetFont('Times', 'BI', 13); $pdf->SetTextColor( 0, 0, 0 ); $pdf->Cell(0, 6, convertirc(_('PÉRIODE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'C', false); $pdf->Ln(10); $pdf->SetTextColor( 37, 36, 97 ); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'BI', 12); $pdf->Cell(75, 5, convertirc(''), 0, 0, 'L', false); $pdf->Cell(22, 5, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 5, convertirc(_($entete['garant'])), 0, 'L'); $pdf->Ln(2); $pdf->Cell(75, 4, convertirc(''), 0, 0, 'L', false); $pdf->Cell(38, 4, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 4, convertirc(_($entete['souscripteur'])), 0, 'L'); $pdf->Ln(2); $pdf->Cell(75, 4, convertirc(''), 0, 0, 'L', false); $pdf->Cell(21, 4, convertirc(_('POLICE').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 4, convertirc(_($entete['libellePolice'])), 0, 'L'); }else{ $pdf->SetFont('Times', 'BI', 16); $pdf->Cell(100, 5, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Times', 'BI', 14); $pdf->MultiCell(115, 5, convertirc(_($infosDuGarant['libelle'])), 0, 'L' ); $pdf->Ln(40); } $pdf->AddPage(); // SOMMAIRE if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit2.jpg', 0, 0, 210); $pdf->Ln(10); $pdf->SetTextColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 24); $pdf->Cell(34,12,convertirc(""),0,0,'C',false); $pdf->Cell(100,12,convertirc(_("SOMMAIRE")),0,0,'C',false); $pdf->Ln(20); $pdf->SetFont('Helvetica', 'B', 9); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DONNÉES ÉLEMENTAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("MOUVEMENTS D'EFFECTIFS PAR COLLEGE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("SINISTRIALITÉ MOYENNE PAR BENEFICIAIRE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("TOP 15 DES ACTES DETAILLÉS PAR FAMILLES D'ACTES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("TOP 10 DES AFFECTIONS COURANTES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DÉPENSES PAR FAMILLES ET PAR COLLEGE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DÉPENSES PAR COLLEGE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DÉPENSES PAR CONTRAT")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR STATUT DE BÉNÉFICIAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR TRANCHES D’ÂGES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("ÉVOLUTION MENSUELLE DES DÉPENSES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DÉPENSES PAR FAMILLE D’ASSURÉS")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("ÉVOLUTION MENSUELLE DES DÉPENSES PAR FAMILLE D’ASSURÉS")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR FAMILLE D’ACTES MÉDICAUX")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("EVOLUTION MENSUELLE DES DÉPENSES PAR FAMILLE D’ACTES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("COMPARATIF DES DÉPENSES DES ANNÉES N-1 ET N")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("DÉPENSES PAR FAMILLE D’ACTES ET PAR PRESTATAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("HOSPITALISATIONS PAR AFFECTION")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("DÉPENSES PAR AFFECTIONS")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("DÉPENSES PAR PHARMACIE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); }else{ $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit2.jpg', 0, 0, 210); $pdf->Ln(10); $pdf->SetTextColor(255, 255, 255); $pdf->SetFont('Arial', 'B', 24); $pdf->Cell(34,12,convertirc(""),0,0,'C',false); $pdf->Cell(100,12,convertirc(_("SOMMAIRE")),0,0,'C',false); $pdf->Ln(20); $pdf->SetFont('Helvetica', 'B', 9); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DONNÉES ÉLEMENTAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("MOUVEMENTS D'EFFECTIFS PAR COLLEGE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("DÉPENSES PAR FAMILLES ET PAR COLLEGE")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR STATUT DE BÉNÉFICIAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("ÉVOLUTION MENSUELLE DES DÉPENSES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(34,0,convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR FAMILLE D’ACTES MÉDICAUX")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("COMPARATIF DES DÉPENSES DES ANNÉES N-1 ET N")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,1,'L',false); $pdf->Ln(8); $pdf->Cell(10,0,convertirc(""),0,0,'C',false); $pdf->Cell(36,0,convertirc(_("DÉPENSES PAR FAMILLE D’ACTES ET PAR PRESTATAIRES")),0,0,'L',false); $pdf->Cell(140,0,convertirc(""),0,0,'L',false); } $pdf->AddPage(); // $pdf->Cell(0,8,convertirc(_("FICHE DE SUIVI")),0,1,'C',TRUE); $pdf->Ln(8); $h=5; $pdf->SetTextColor(0, 0, 0); $pdf->SetFont('Times', 'BI', 9); $pdf->Cell(75,$h,convertirc(_("PERIODE")),1,0,'L',false); $pdf->Cell(115,$h,convertirc(dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])),1,1,'L',false); $beneficiaires = $this->detailsp->getficheSuivie1($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $agemoyens = $this->detailsp->getficheSuivie2($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $tranchesages = $this->detailsp->getficheSuivie3($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $topactes = $this->detailsp->getficheSuivie4($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $topprestataires = $this->detailsp->getficheSuivie5($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $topaffections = $this->detailsp->getficheSuivie6($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $sinistrialites = $this->detailsp->getficheSuivie7($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin,$Chargement,$chargeravantapres); $nombreBeneficiaire = 0; foreach($beneficiaires as $keybenf=>$beneficiaire){ if($keybenf == 0){ $nombreTraiteA= $beneficiaire['Nombretraite']; $DepensesA= $beneficiaire['Depenses']; $taux_DepenseA= $beneficiaire['Taux_Depense']; $coutMoyenA= $beneficiaire['CoutMoyen']; }elseif($keybenf == 1){ $nombreTraiteC= $beneficiaire['Nombretraite']; $DepensesC= $beneficiaire['Depenses']; $taux_DepenseC= $beneficiaire['Taux_Depense']; $coutMoyenC= $beneficiaire['CoutMoyen']; } elseif($keybenf == 2){ $nombreTraiteE= $beneficiaire['Nombretraite']; $DepensesE= $beneficiaire['Depenses']; $taux_DepenseE= $beneficiaire['Taux_Depense']; $coutMoyenE= $beneficiaire['CoutMoyen']; } $nombreBeneficiaire = $nombreBeneficiaire+ $beneficiaire['Nombre']; } $coutMoyens = max(array($coutMoyenA,$coutMoyenC,$coutMoyenE)); if( $coutMoyens=$coutMoyenA){ $libelle = _("Adhérent(e)s"); }elseif( $coutMoyens== $coutMoyenC){ $libelle = _("Conjoint(e)s"); }elseif( $coutMoyens == $coutMoyenE){ $libelle = _("Enfants"); } foreach($agemoyens as $keyage=>$agemoyen){ if($keyage == 0){ $Age_MoyenA= $agemoyen['Age_Moyen']; }elseif($keyage == 1){ $Age_MoyenC= $agemoyen['Age_Moyen']; }elseif($keyage == 3){ $Age_MoyenE= $agemoyen['Age_Moyen']; } } foreach($tranchesages as $keytranche=>$tranchesage){ if($keytranche == 0){ $Depenses1= $tranchesage['Depense_Tranche']; $taux_Depense1= $tranchesage['Taux_Depense']; $coutMoyen1= $beneficiaire['CoutMoyen']; }elseif($keytranche == 1){ $Depenses2= $tranchesage['Depense_Tranche']; $taux_Depense2= $tranchesage['Taux_Depense']; $coutMoyen2= $beneficiaire['CoutMoyen']; }elseif($keytranche == 2){ $Depenses3= $tranchesage['Depense_Tranche']; $taux_Depense3= $tranchesage['Taux_Depense']; $coutMoyen3= $beneficiaire['CoutMoyen']; }elseif($keytranche == 3){ $Depenses4= $tranchesage['Depense_Tranche']; $taux_Depense4= $tranchesage['Taux_Depense']; $coutMoyen4= $beneficiaire['CoutMoyen']; }elseif($keytranche == 4){ $Depenses4= $tranchesage['Depense_Tranche']; $taux_Depense4= $tranchesage['Taux_Depense']; $coutMoyen4= $beneficiaire['CoutMoyen']; } } $pdf->Cell(75,$h,convertirc(_("BENEFICIAIRES")),1,0,'L',false); $pdf->Cell(115,$h,convertirc(format_N($nombreBeneficiaire)),1,1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Adhérent(e)s").": ".format_N($nombreTraiteA)),"LTR",1,'L',false); $pdf->Cell(75,$h,convertirc(_("BENEFICIAIRES TRAITES")),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Conjoint(e)s").": ".format_N($nombreTraiteC)),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LBR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Enfants").": ".format_N($nombreTraiteE)),"LBR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Adhérent(e)s").": ".format_N($Age_MoyenA)." "._("ans")),"LTR",1,'L',false); $pdf->Cell(75,$h,convertirc(_("AGE MOYEN DE LA POPULATION")),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Conjoint(e)s").": ".format_N($Age_MoyenC)." "._("ans")),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LBR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Enfants").": ".format_N($Age_MoyenE)." "._("ans")),"LBR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Adhérent(e)s").": ".format_N($DepensesA)." ".$_SESSION['devise_C']." "._("soit")." ".$taux_DepenseA." %"),"LTR",1,'L',false); $pdf->Cell(75,$h,convertirc(_("SINISTRIALITE PAR STATUT DE BENEFICIAIRE")),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Conjoint(e)s").": ".format_N($DepensesC)." ".$_SESSION['devise_C']." "._("soit")." ".$taux_DepenseC." %"),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("Enfants").": ".format_N($DepensesE)." ".$_SESSION['devise_C']." "._("soit")." ".$taux_DepenseE." %"),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("On observe un coût moyen plus élevé chez les")." ".$libelle." ".format_N($coutMoyens)." ".$_SESSION['devise_C']),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LR",1,'L',false); $keytop=0; foreach($topactes as $keytop=>$topacte){ if($keytop == 0){ $pdf->Cell(75,$h,convertirc(_("TOP DES ACTES")),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc($topacte['libelle'].": ".format_N($topacte['MontantRembourse'])." ".$_SESSION['devise_C']." "._("soit")." ".$topacte['Taux']." %"),"LTR",1,'L',false); }else{ $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc($topacte['libelle'].": ".format_N($topacte['MontantRembourse'])." ".$_SESSION['devise_C']." "._("soit")." ".$topacte['Taux']." %"),"LR",1,'L',false); } } $pdf->SetFont('Times', 'BI', 7); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LR",1,'L',false); foreach($topprestataires as $keytop1=>$topprestataire){ if($keytop1 == 0){ $pdf->Cell(75,$h,convertirc(_("TOP DES PRESTATAIRES")),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc($topprestataire['Prestataire'].": ".format_N($topprestataire['montantApayer'])." ".$_SESSION['devise_C']),"LTR",1,'L',false); }else{ $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc($topprestataire['Prestataire'].": ".format_N($topprestataire['montantApayer'])." ".$_SESSION['devise_C']),"LR",1,'L',false); } } $pdf->SetFont('Times', 'BI', 9); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LR",1,'L',false); foreach($topaffections as $keytop2=>$topaffection){ if($keytop2 == 0){ $pdf->Cell(75,$h,convertirc(_("TOP DES AFFECTIONS")),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc($topaffection['affection'].": ".format_N($topaffection['apresDecompte'])." ".$_SESSION['devise_C']." "._("soit")." ".$topaffection['Taux']." %"),"LTR",1,'L',false); }else{ $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc($topaffection['affection'].": ".format_N($topaffection['apresDecompte'])." ".$_SESSION['devise_C']." "._("soit")." ".$topaffection['Taux']." %"),"LR",1,'L',false); } } $pdf->Cell(75,$h,convertirc(""),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LTR",1,'L',false); $pdf->Cell(75,$h,convertirc(_("SINISTRIALITÉ")),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("PROVISION MOYENNE").": ".format_N($sinistrialites['PROVISION'])." ".$_SESSION['devise_C']),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("SINISTRIALITÉ MOYENNE").": ".format_N($sinistrialites['SINISTRES'])." ".$_SESSION['devise_C']),"LR",1,'L',false); $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("ÉCART").": ".format_N($sinistrialites['ECART'])." ".$_SESSION['devise_C']),"LR",1,'L',false); // tableau d'ajustement $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LR",1,'L',false); foreach($tableaudajustements as $keytop3=>$tableaudajustement){ if($tableaudajustement['codeGcAssureur'] ==$entete['codeGcAssureur'] ){ $ajustement = $tableaudajustement['tauxAjustement']>0.00 ? 'majoration' : 'minoration'; if($tableaudajustement['spMin']<= $sinistrialites['RAPPRSP'] && $tableaudajustement['spMax']>= $sinistrialites['RAPPRSP'] ){ $pdf->SetFont('Times', 'BI', 11); $pdf->SetTextColor(255, 0, 0); $conclusion = $ajustement == "majoration" ? _("La tendance est ascendante par conséquent la police sera majorée au renouvelement.") : _("La tendance est constante par conséquent la police ne sera pas majorée au renouvelement.") ; }else{ $pdf->SetFont('Times', 'BI', 9); $pdf->SetTextColor(0, 0, 0); } if($keytop3 == 0){ $pdf->Cell(75,$h,convertirc(_("Tableau d'ajustement")." "),"LTR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("de")." ".$tableaudajustement['spMin']." "._("à")." ".$tableaudajustement['spMax'].$ajustement.$tableaudajustement['tauxAjustement']),"LTR",1,'L',false); }else{ $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(_("de")." ".$tableaudajustement['spMin']." "._("à")." ".$tableaudajustement['spMax'].$ajustement.$tableaudajustement['tauxAjustement']),"LR",1,'L',false); } } } $pdf->Cell(75,$h,convertirc(""),"LR",0,'L',false); $pdf->Cell(115,$h,convertirc(""),"LR",1,'L',false); $pdf->Cell(190,$h,convertirc(_($conclusion)),"LBR",1,'L',false); $pdf->AddPage(); // DEBUT FT1 $statutsfts = $this->detailsp->donneelementaire_rp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $primeSinistrefts = $this->detailsp->donneelementaire_rp2_1($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin,$Chargement,$chargeravantapres ); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit3.jpg', 0, 0, 210); $pdf->SetY(40); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('DONNÉES ÉLÉMENTAIRES')), 0, 1, 'L', false); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(8); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(10, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(10, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(10, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(10, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc(_(' : '.$p_garant)), 0, 1, 'L', false); } $pdf->SetX(15); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(35, 6, convertirc(_('POPULATION').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_('cf Tableau ci-dessous').': '), 0, 1, 'L', false); $pdf->Ln(10); $hl=6; $pdf->SetX(12); $pdf->SetFont('Arial', 'B', 8); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(35, $hl, convertirc(_('Statut bénéficiaire')), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_("Nombre d'assurés sur la période")), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_("Bénéficiaires traités sur la période")), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_("% Bénéficiaires traités sur la période")), 1, 1, 'C', true); $pdf->SetFont('Arial', '', 9); $total_assure = 0; $total_traite = 0; $total_taux = 0; foreach ($statutsfts as $statutsf) { $pdf->SetX(12); $pdf->Cell(35, $hl, convertirc($statutsf['libelle']), 1, 0, 'L', false); $pdf->Cell(50, $hl, convertirc(format_N($statutsf['Nombre'])), 1, 0, 'C', false); $pdf->Cell(50, $hl, convertirc(format_N($statutsf['Nombretraite'])), 1, 0, 'C', false); $pdf->Cell(50, $hl, convertirc($statutsf['Taux_EffTraite']." %"), 1, 1, 'C', false); $total_assure = $total_assure + $statutsf['Nombre']; $total_traite = $total_traite + $statutsf['Nombretraite']; $total_taux = $total_taux + $statutsf['Taux_EffTraite']; } $hl=8; $pdf->SetFont('Arial', 'B', 9); $pdf->SetFillColor(143, 206, 143); $pdf->SetX(12); $pdf->Cell(35, $hl, convertirc(_('TOTAL')), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_(format_N($total_assure))), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_(format_N($total_traite))), 1, 0, 'C', true); $pdf->Cell(50, $hl, convertirc(_(format_N($total_taux)." %")), 1, 1, 'C', true); $pdf->Ln(15); $tp = 11; $ht = 6; $pdf->SetFont('Arial', 'BI', $tp); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(190, $ht, convertirc("PRIMES ET SINISTRALITÉ DE LA POLICE"), 0, 1, 'C', false); $pdf->SetTextColor( 0, 0, 0 ); foreach ($primeSinistrefts as $primeSinistreft) { $pdf->SetFont('Helvetica', 'B', 11); $pdf->Ln(5); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(100, $ht, convertirc(_("RAPPEL PRIME NETTE TOTALE").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['PRIMETOTALE']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(100, $ht, convertirc(_("PRIME NETTE DE LA PÉRIODE").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['PRIMENETTE']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(100, $ht, convertirc(_("CHARGEMENT DE LA PÉRIODE").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['CHARGEMENT']), 0, 1, 'L', false); $pdf->Ln(5); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(100, $ht, convertirc(_("PROVISION POUR SINISTRES DE LA PÉRIODE").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['PROVISION']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(100, $ht, convertirc(_("SINISTRES DE LA PÉRIODE").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['SINISTRES']), 0, 1, 'L', false); $pdf->Ln(10); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(120, $ht, convertirc(_("RÉSULTATS TECHNIQUES DE LA PÉRIODE (Rapport Sinistres/Primes)").': '), 0, 1, 'L', false); if($chargeravantapres =="AVANT"){ $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(125, $ht, convertirc(_("RAPPORT (SINISTRES/PRIME NETTE DE LA PÉRIODE) NET").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, number_format($primeSinistreft['RAPPRSP'], 2, '.', ','), 0, 1, 'L', false); }else{ $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(110, $ht, convertirc(_("RAPPORT (SINISTRES/PROVISION) NET").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, number_format($primeSinistreft['RAPPRSP'], 2, '.', ','), 0, 1, 'L', false); } $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(125, $ht, convertirc(_("EXCEDENT (ou DEFICIT (-))").': '), 0, 0, 'L', false); $pdf->Cell(40, $ht, format_N($primeSinistreft['ECART']), 0, 1, 'L', false); } $pdf->AddPage('L'); // debut MOUVEMENTS D'EFFECTIFS PAR COLLEGE $p_factures = $this->detailsp->mouvementeffectifcollege($p_garant, $p_id_clients, $p_id, $p_id_college, $p_apporteur,$p_datedebut, $p_datefin); $p_retraits = $this->detailsp->mouvementeffectifcollege_retrait($p_garant, $p_id_clients, $p_id, $p_id_college,$p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit7.jpg', 0, 0, 297); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("MOUVEMENTS D'EFFECTIFS PAR COLLEGE")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(150, 8, convertirc(_("Evolution des bénéficiaires par college")), 0, 1,'L',false ); $pdf->SetTextColor(0); $hl=7; $pdf->SetFont('Arial','',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('idCollege')),1,0,'C',true); $pdf->Cell(60,$hl,convertirc(_("College")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Janvier")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Février")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mars")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Avril")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mai")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Juin")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Juillet")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Août")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Septembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Octobre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Novembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Décembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_JANVIER = 0; $total_FEVRIER = 0; $total_MARS = 0; $total_AVRIL = 0; $total_MAI = 0; $total_JUIN = 0; $total_JUILLET = 0; $total_AOUT = 0; $total_SEPTEMBRE = 0; $total_OCTOBRE = 0; $total_NOVEMBRE = 0; $total_DECEMBRE = 0; $total_TOTAUX = 0; foreach ($p_factures as $dep) { $taillelibelleCollege = strlen($dep['libelleCollege']); // compter le nombre de caractere de la chaine if($taillelibelleCollege>38) { $hl= 4; $text = wordwrap($dep['libelleCollege'], 38, "***", false); // insertion de marqueurs *** $tcut = explode("***", $text); // on créé un tableau à partir des marqueurs *** $part1 = $tcut[0]; // la partie à mettre en exergue $part2 = ''; for($i=1; $iCell(15,$hl,convertirc($dep['idCollege']),"LTR",0,'C',false); $pdf->Cell(60,$hl,convertirc($part1),"LTR",0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JANVIER'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['FEVRIER'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MARS'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AVRIL'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MAI'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['JUIN'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JUILLET'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AOUT'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['SEPTEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['OCTOBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['NOVEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['DECEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['TOTAUX'])),"LTR",1,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(60,$hl,convertirc($part2),"LBR",0,'L',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",1,'C',false); }else{ $pdf->Cell(15,$hl,convertirc($dep['idCollege']),1,0,'C',false); $pdf->Cell(60,$hl,convertirc($dep['libelleCollege']),1,0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JANVIER'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['FEVRIER'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MARS'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AVRIL'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MAI'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['JUIN'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JUILLET'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AOUT'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['SEPTEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['OCTOBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['NOVEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['DECEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['TOTAUX'])),1,1,'C',false); } $total_JANVIER = $total_JANVIER + $dep['JANVIER']; $total_FEVRIER = $total_FEVRIER + $dep['FEVRIER']; $total_MARS = $total_MARS + $dep['MARS']; $total_AVRIL = $total_AVRIL + $dep['AVRIL']; $total_MAI = $total_MAI + $dep['MAI']; $total_JUIN = $total_JUIN + $dep['JUIN']; $total_JUILLET = $total_JUILLET + $dep['JUILLET']; $total_AOUT = $total_AOUT + $dep['AOUT']; $total_SEPTEMBRE = $total_SEPTEMBRE + $dep['SEPTEMBRE']; $total_OCTOBRE = $total_OCTOBRE + $dep['OCTOBRE']; $total_NOVEMBRE = $total_NOVEMBRE + $dep['NOVEMBRE']; $total_DECEMBRE = $total_DECEMBRE + $dep['DECEMBRE']; $total_TOTAUX = $total_TOTAUX + $dep['TOTAUX']; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(75,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(16,$hl,format_N($total_JANVIER),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_FEVRIER),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MARS),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AVRIL),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MAI),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_JUIN),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_JUILLET),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AOUT),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_SEPTEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_OCTOBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_NOVEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_DECEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_TOTAUX),1,1,'C',true); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Nombre de lignes").': '.count($p_factures)),0,1,'L',false); $pdf->Ln(10); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 247, 4, 8 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(150, 8, convertirc(_("Evolution des bénéficiaires rétirés par college")), 0, 1, 'L' ,false); $pdf->SetTextColor(0); $hl=7; $pdf->SetFont('Arial','',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('idCollege')),1,0,'C',true); $pdf->Cell(60,$hl,convertirc(_("College")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Janvier")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Février")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mars")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Avril")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mai")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Juin")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Juillet")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Août")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Septembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Octobre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Novembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Décembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_JANVIER = 0; $total_FEVRIER = 0; $total_MARS = 0; $total_AVRIL = 0; $total_MAI = 0; $total_JUIN = 0; $total_JUILLET = 0; $total_AOUT = 0; $total_SEPTEMBRE = 0; $total_OCTOBRE = 0; $total_NOVEMBRE = 0; $total_DECEMBRE = 0; $total_TOTAUX = 0; foreach ($p_retraits as $depretrait) { $taillelibelleCollege = strlen($depretrait['libelleCollege']); // compter le nombre de caractere de la chaine if($taillelibelleCollege>38) { $hl= 4; $text = wordwrap($depretrait['libelleCollege'], 38, "***", false); // insertion de marqueurs *** $tcut = explode("***", $text); // on créé un tableau à partir des marqueurs *** $part1 = $tcut[0]; // la partie à mettre en exergue $part2 = ''; for($i=1; $iCell(15,$hl,convertirc($depretrait['idCollege']),"LTR",0,'C',false); $pdf->Cell(60,$hl,convertirc($part1),"LTR",0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['JANVIER'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['FEVRIER'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['MARS'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['AVRIL'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['MAI'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['JUIN'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['JUILLET'])),"LTR",0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['AOUT'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['SEPTEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['OCTOBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['NOVEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['DECEMBRE'])),"LTR",0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['TOTAUX'])),"LTR",1,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(60,$hl,convertirc($part2),"LBR",0,'L',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(15,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",0,'C',false); $pdf->Cell(16,$hl,convertirc(""),"LBR",1,'C',false); }else{ $pdf->Cell(15,$hl,convertirc($depretrait['idCollege']),1,0,'C',false); $pdf->Cell(60,$hl,convertirc($depretrait['libelleCollege']),1,0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['JANVIER'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['FEVRIER'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['MARS'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['AVRIL'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['MAI'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['JUIN'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['JUILLET'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($depretrait['AOUT'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['SEPTEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['OCTOBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['NOVEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['DECEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($depretrait['TOTAUX'])),1,1,'C',false); } $total_JANVIER = $total_JANVIER + $depretrait['JANVIER']; $total_FEVRIER = $total_FEVRIER + $depretrait['FEVRIER']; $total_MARS = $total_MARS + $depretrait['MARS']; $total_AVRIL = $total_AVRIL + $depretrait['AVRIL']; $total_MAI = $total_MAI + $depretrait['MAI']; $total_JUIN = $total_JUIN + $depretrait['JUIN']; $total_JUILLET = $total_JUILLET + $depretrait['JUILLET']; $total_AOUT = $total_AOUT + $depretrait['AOUT']; $total_SEPTEMBRE = $total_SEPTEMBRE + $depretrait['SEPTEMBRE']; $total_OCTOBRE = $total_OCTOBRE + $depretrait['OCTOBRE']; $total_NOVEMBRE = $total_NOVEMBRE + $depretrait['NOVEMBRE']; $total_DECEMBRE = $total_DECEMBRE + $depretrait['DECEMBRE']; $total_TOTAUX = $total_TOTAUX + $depretrait['TOTAUX']; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(75,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(16,$hl,format_N($total_JANVIER),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_FEVRIER),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MARS),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AVRIL),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MAI),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_JUIN),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_JUILLET),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AOUT),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_SEPTEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_OCTOBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_NOVEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_DECEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_TOTAUX),1,1,'C',true); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Nombre de lignes: ").count($p_retraits)),0,0,'L',false); if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage();// TOP 15 DES AFFECTIONS COURANTES SANS LE CODE D'AFFECTION 990 $p_factures = $this->detailsp->get_FamilleActe_rp(); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(25); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("TOP 15 DES ACTES DÉTAILLÉS PAR FAMILLES D'ACTES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDERÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(8); $hl=5; $pdf->SetFont('Arial','B',7); foreach ($p_factures as $dep) { $total_montantFacture = 0; $$total_nbreActe = 0; $total_apresDecompte = 0; $total_Coutmoyen = 0; $total_Taux = 0; $codeGarantie = $dep['codeGarantie']; $garanties = $this->detailsp->get_top15_depense_actes_famille_acte_rp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_apporteur, $p_datedebut, $p_datefin,$codeGarantie); if(!empty($garanties)){ $pdf->Cell(190,$hl,convertirc(_($dep['libelle'])),1,1,'L',FALSE); $pdf->SetFillColor(143,206,143); $pdf->Cell(85,$hl,convertirc(_('Actes')),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_('Nbre Actes')),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',7); foreach ($garanties as $garantie) { $pdf->Cell(85,$hl,convertirc($garantie['Acte']),1,0,'L',false); $pdf->Cell(15,$hl,convertirc(format_N($garantie['nbFactures'])),1,0,'R',false); $pdf->Cell(25,$hl,convertirc(format_N($garantie['montantReclame'])),1,0,'R',false); $pdf->Cell(25,$hl,convertirc(format_N($garantie['montantApayer'])),1,0,'R',false); $pdf->Cell(25,$hl,convertirc(format_N($garantie['coutMoyen'])),1,0,'R',false); $pdf->Cell(15,$hl,convertirc($garantie['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$garantie['montantReclame']; $total_nbreActe = $total_nbreActe +$garantie['nbFactures']; $total_apresDecompte = $total_apresDecompte +$garantie['montantApayer']; $total_Taux = $total_Taux +$garantie['Taux']; } $total_Coutmoyen = $total_apresDecompte/$total_nbreActe ; $pdf->SetFont('Arial','B',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(85,$hl,convertirc("TOTAL"),"1",0,'C',true); $pdf->Cell(15,$hl,format_N($total_nbreActe),1,0,'R',true); $pdf->Cell(25,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(25,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(25,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(15,$hl,convertirc($total_Taux),1,1,'C',true); } } $pdf->AddPage();// TOP 10 DES AFFECTIONS COURANTES SANS LE CODE D'AFFECTION 990 $p_factures = $this->detailsp->gettop10_depense_affection_rp($p_garant, $p_id_clients, $p_id, $p_id_college,$p_apporteur, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit8.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("TOP 10 DES AFFECTIONS COURANTES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDERÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(62,$hl,convertirc(_('Affection')),1,0,'C',true); $pdf->Cell(20,$hl,convertirc(_('Nbre Actes')),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->Cell(20,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',10); $total_montantFacture = $total_nbreAffection = $total_apresDecompte = $total_Coutmoyen = $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(62,$hl,convertirc($dep['Affection']),1,0,'L',false); $pdf->Cell(20,$hl,convertirc(format_N($dep['nbreAffection'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(20,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_nbreAffection = $total_nbreAffection +$dep['nbreAffection']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen']; $total_Taux = $total_Taux +$dep['Taux']; } } $pdf->AddPage(); // debut etat des depenses par college $p_factures = $this->detailsp->get_depense_contrat_college_rp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetFont('Arial','B',13); $pdf->SetY(40); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(145, 8, convertirc(_("DÉPENSES PAR FAMILLES ET PAR COLLEGE")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(5); $hl=7; $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(16,$hl,convertirc(_("Id")),1,0,'C',true); $pdf->Cell(94,$hl,convertirc(_("College")),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(_("Mt Recl.")),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(_("Mt Remb.")),1,0,'C',true); $pdf->Cell(20,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',8); $total_montantFacture = 0; $total_apresDecompte = 0; $total_taux = 0; foreach ($p_factures as $p_facture){ $total_montantFacture = $total_montantFacture + $p_facture['montantFacture']; $total_apresDecompte = $total_apresDecompte + $p_facture['apresDecompte']; $total_taux = $total_taux + $p_facture['Taux']; $pdf->Cell(16,$hl,convertirc($p_facture['idCollege']),1,0,'C',false); $pdf->Cell(94,$hl,convertirc($p_facture['libelleCollege']),1,0,'L',false); $pdf->Cell(30,$hl,convertirc(format_N($p_facture['montantFacture'])),1,0,'C',false); $pdf->Cell(30,$hl,convertirc(format_N($p_facture['apresDecompte'])),1,0,'C',false); $pdf->Cell(20,$hl,convertirc($p_facture['Taux']),1,1,'C',false); } $pdf->Cell(110,$hl,convertirc("TOTAL GENERAL"),1,0,'L',true); $pdf->Cell(30,$hl,convertirc(format_N($total_montantFacture)),1,0,'C',true); $pdf->Cell(30,$hl,convertirc(format_N($total_apresDecompte)),1,0,'C',true); $pdf->Cell(20,$hl,convertirc(format_N($total_taux)),1,1,'C',true); $pdf->SetFont('Helvetica','B',10); $pdf->Cell(45,$hl,convertirc(_(" * Légende :")),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(16); $pdf->Cell(45,$hl,convertirc(_("Mt Recl. = Montant reclamé ")),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(16); $pdf->Cell(45,$hl,convertirc(_("Mt Remb. = Montant rembousé")),0,0,'L',false); if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage(); // debut ft2 $p_factures = $this->detailsp->getdepenseparcontratrp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $total_montantFacture = 0; $total_apresDecompte = 0; $total_taux = 0; foreach ($p_factures as $p_facture){ $total_montantFacture = $total_montantFacture + $p_facture['montantFacture']; $total_apresDecompte = $total_apresDecompte + $p_facture['apresDecompte']; $total_taux = $total_taux + $p_facture['Taux']; } $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit3.jpg', 0, 0, 210); $pdf->SetFont('Arial','B',13); $pdf->SetY(40); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('DÉPENSES PAR CONTRAT')), 0, 1, 'L', false); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(5); $hl=7; $pdf->SetFont('Arial','B',8); $pdf->SetX(12); $pdf->SetFillColor(143,206,143); $pdf->Cell(46,$hl,convertirc(_('Garant')),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("No Police")),1,0,'C',true); $pdf->Cell(74,$hl,convertirc(_("Police")),1,0,'C',true); $pdf->Cell(18,$hl,convertirc(_("Mt recl.")),1,0,'C',true); $pdf->Cell(18,$hl,convertirc(_("Mt remb.")),1,0,'C',true); $pdf->Cell(14,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',8); $pdf->SetX(12); $pdf->Cell(46,$hl,convertirc($p_facture['CodeG']),1,0,'L',false); $pdf->Cell(16,$hl,convertirc($p_facture['numeroPolice']),1,0,'C',false); if($p_id!=null){ $pdf->Cell(74,$hl,convertirc($p_facture['libellePolice']),1,0,'L',false); }else{ $pdf->Cell(74,$hl,convertirc($p_facture['garant']),1,0,'L',false); } $pdf->Cell(18,$hl,convertirc(format_N($total_montantFacture)),1,0,'C',false); $pdf->Cell(18,$hl,convertirc(format_N($total_apresDecompte)),1,0,'C',false); $pdf->Cell(14,$hl,convertirc('100'),1,1,'C',false); $pdf->SetX(12); $pdf->SetFont('helvetica','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(136,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(18,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(18,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(14,$hl,convertirc('100 %'),1,0,'C',true); $pdf->Ln(10); $pdf->SetFont('Helvetica','B',10); $pdf->Cell(45,$hl,convertirc(_(" * Légende").': '),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(16); $pdf->Cell(45,$hl,convertirc(_("Mt Recl. = Montant reclamé ")),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(16); $pdf->Cell(45,$hl,convertirc(_("Mt Remb. = Montant rembousé")),0,0,'L',false); } $pdf->AddPage(); // debut ft3 $p_factures = $this->detailsp->recapdepensesstatutbenef($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $statutsfts = $this->detailsp->recapdepensesstatutbenefdeux($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $statuts = $this->detailsp->listestatutbeneficiaire($idPolice,$debutStat,$finStat); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit3.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(145, 8, convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR STATUT DE BÉNEFICIAIRES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(5); $hl=6; $pdf->SetX(13); $pdf->SetFont('Arial','B',9); $pdf->Cell(184,6,convertirc(_('Dépenses par statut de bénéficiaires')),1,1,'C',false); $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc(_('Statut bénéficiaire')),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Nombre")),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Taux effectif")),1,0,'C',true); $pdf->Cell(25,$hl,convertirc(_("Age moyen")),1,0,'C',true); $pdf->Cell(27,$hl,convertirc(_("Montant")),1,0,'C',true); $pdf->Cell(24,$hl,convertirc(_("Taux")),1,0,'C',true); $pdf->Cell(24,$hl,convertirc(_("Coût moyen")),1,1,'C',true); $pdf->SetFont('Arial','',9); $total_Nombre = 0; $total_Taux_Eff = 0; $total_Age_Moyen = 0; $total_Montant = 0; $total_tauxMontantTraite = 0; $total_coutMoyenTraite = 0; foreach ($p_factures as $p_facture) { $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc($p_facture['libelle']),1,0,'L',false); $pdf->Cell(25,$hl,convertirc(format_N($p_facture['Nombre'])),1,0,'C',false); $pdf->Cell(25,$hl,convertirc($p_facture['Taux_Eff']."%"),1,0,'C',false); $pdf->Cell(25,$hl,convertirc($p_facture['Age_Moyen']),1,0,'C',false); $pdf->Cell(27,$hl,convertirc(format_N($p_facture['Montant'])),1,0,'C',false); $pdf->Cell(24,$hl,convertirc($p_facture['Taux_Depense']."%"),1,0,'C',false); $pdf->Cell(24,$hl,convertirc(format_N($p_facture['CoutMoyen'])),1,1,'C',false); $total_Nombre = $total_Nombre + $p_facture['Nombre']; $total_Taux_Eff = $total_Taux_Eff + $p_facture['Taux_Eff']; $total_Age_Moyen = $total_Age_Moyen + $p_facture['Age_Moyen']; $total_Montant = $total_Montant + $p_facture['Montant']; $total_tauxMontantTraite = $total_tauxMontantTraite + $p_facture['Taux_Depense']; $total_coutMoyenTraite = $total_coutMoyenTraite + $p_facture['CoutMoyen']; } $pdf->SetFont('Arial','B',9); $pdf->SetX(13); $total_Age_Moyen =$total_Age_Moyen /6; $pdf->Cell(34,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(25,$hl,format_N($total_Nombre),1,0,'C',true); $pdf->Cell(25,$hl,format_N($total_Taux_Eff)."%",1,0,'C',true); $pdf->Cell(25,$hl,format_N($total_Age_Moyen),1,0,'C',true); $pdf->Cell(27,$hl,format_N($total_Montant),1,0,'C',true); $pdf->Cell(24,$hl,format_N($total_tauxMontantTraite)."%",1,0,'C',true); $pdf->Cell(24,$hl,format_N($total_coutMoyenTraite),1,0,'C',true); $pdf->SetFont('Arial','B',8); $pdf->SetY(160); $pdf->Cell(10,8,(''),0,0); $pdf->Cell(80,8,convertirc(_('Récapitulatif dépenses par statut bénéficiaire (%)')),1,0,'C',false); $pdf->Cell(10,8,(''),0,0); $pdf->Cell(80,8,convertirc(_('Récapitulatif des bénéficiaires traités par statut (%)')),1,1,'C',false); $pdf->Ln(5); $pdf->Rect(20,168, 80, 52, 'D'); $pdf->Rect(110, 168, 80, 52, 'D'); // DEBUT GRAPH $valeur0=0; $valeur1=0; $valeur2=0; $valeur3=0; $valeur4=0; $valeur5=0; $value=0; $v=0; $valeurs=array(); foreach($p_factures as $key => $value){ array_push($valeurs,$value['Taux_Depense']); } foreach($valeurs as $key =>$valeur){ if ($key == 0) { $valeur0 = $valeur; } if ($key == 1) { $valeur1 = $valeur; } if ($key == 2) { $valeur2 = $valeur; } if ($key == 3) { $valeur3 = $valeur; } if ($key == 4) { $valeur4 = $valeur; } if ($key == 5) { $valeur5 = $valeur; } $data=Array( 'A'=>[ 'color'=>[255,0,0], 'value'=>$valeur0], 'C'=>[ 'color'=>[255,255,0], 'value'=>$valeur1], 'E'=>[ 'color'=>[50,0,255], 'value'=>$valeur2], 'O'=>[ 'color'=>[255,0,255], 'value'=>$valeur3], 'F'=>[ 'color'=>[0,255,0], 'value'=>$valeur4], 'D'=>[ 'color'=>[0,0,0], 'value'=>$valeur5] ); } //pie and legend properties $pieX=40; $pieY=195; $r=14;//radius $legendX=65; $legendY=185; //get total data summary $dataSum=0; foreach($data as $item){ $dataSum+=$item['value']; } //get scale unit for each degree $degUnit=360/$dataSum; //variable to store current angle $currentAngle=0; //store current legend Y position $currentLegendY=$legendY; $pdf->SetFont('Arial','',8); //simplify the code by drawing both pie and legend in one loop foreach($data as $index=>$item) { //draw the pie //slice size $deg=$degUnit*$item['value']; //set color $pdf->SetFillColor($item['color'][0],$item['color'][1],$item['color'][2]); //remove border $pdf->SetDrawColor($item['color'][0],$item['color'][1],$item['color'][2]); //draw the slice $pdf->Sector($pieX,$pieY,$r,$currentAngle,$currentAngle+$deg); //add slice angle to currentAngle var $currentAngle+=$deg; //draw the legend $pdf->SetFont('Arial','',8); // $pdf->SetXY($chartX,$chartY); $pdf->Rect($legendX,$currentLegendY,4,4,'DF'); $pdf->SetXY($legendX + 6,$currentLegendY); foreach($valeurs as $key =>$valeur){ if ($key == 0) { $v0 = $valeur; } if ($key == 1) { $v1 = $valeur; } if ($key == 2) { $v2 = $valeur; } if ($key == 3) { $v3 = $valeur; } if ($key == 4) { $v4 = $valeur; } if ($key == 5) { $v5 = $valeur; } } $pdf->Cell(20,5,convertirc(_($index)),0,0); if ($index == 'A') { $pdf->Cell(10,5,convertirc(_($v0)),0,0); } if ($index == 'C') { $pdf->Cell(10,5,convertirc(_($v1)),0,0); } if ($index == 'E') { $pdf->Cell(10,5,convertirc(_($v2)),0,0); } if ($index == 'O') { $pdf->Cell(10,5,convertirc(_('0')),0,0); } if ($index == 'F') { $pdf->Cell(10,5,convertirc(_($v4)),0,0); } if ($index == 'D') { $pdf->Cell(10,5,convertirc(_($v5)),0,0); } $currentLegendY+=5; } $valeur0=0; $valeur1=0; $valeur2=0; $valeur3=0; $valeur4=0; $valeur5=0; $value=0; $v=0; $valeurs=array(); foreach($statutsfts as $key => $value){ array_push($valeurs,$value['Taux_Eff']); } foreach($valeurs as $key =>$valeur){ if ($key == 0) { $valeur0 = $valeur; } if ($key == 1) { $valeur1 = $valeur; } if ($key == 2) { $valeur2 = $valeur; } if ($key == 3) { $valeur3 = $valeur; } if ($key == 4) { $valeur4 = $valeur; } if ($key == 5) { $valeur5 = $valeur; } $data=Array( 'A'=>[ 'color'=>[255,0,0], 'value'=>$valeur0], 'C'=>[ 'color'=>[255,255,0], 'value'=>$valeur1], 'E'=>[ 'color'=>[50,0,255], 'value'=>$valeur2], 'O'=>[ 'color'=>[255,0,255], 'value'=>$valeur3], 'F'=>[ 'color'=>[0,255,0], 'value'=>$valeur4], 'D'=>[ 'color'=>[0,0,0], 'value'=>$valeur5] ); } //pie and legend properties $pieX=130; $pieY=195; $r=14;//radius $legendX=155; $legendY=185; //get total data summary $dataSum=0; foreach($data as $item){ $dataSum+=$item['value']; } //get scale unit for each degree $degUnit=360/$dataSum; //variable to store current angle $currentAngle=0; //store current legend Y position $currentLegendY=$legendY; $pdf->SetFont('Arial','',8); //simplify the code by drawing both pie and legend in one loop foreach($data as $index=>$item){ //draw the pie //slice size $deg=$degUnit*$item['value']; //set color $pdf->SetFillColor($item['color'][0],$item['color'][1],$item['color'][2]); //remove border $pdf->SetDrawColor($item['color'][0],$item['color'][1],$item['color'][2]); //draw the slice $pdf->Sector($pieX,$pieY,$r,$currentAngle,$currentAngle+$deg); //add slice angle to currentAngle var $currentAngle+=$deg; //draw the legend $pdf->SetFont('Arial','',8); // $pdf->SetXY($chartX,$chartY); $pdf->Rect($legendX,$currentLegendY,4,4,'DF'); $pdf->SetXY($legendX + 6,$currentLegendY); foreach($valeurs as $key =>$valeur){ if ($key == 0) { $v0 = $valeur; } if ($key == 1) { $v1 = $valeur; } if ($key == 2) { $v2 = $valeur; } if ($key == 3) { $v3 = $valeur; } if ($key == 4) { $v4 = $valeur; } if ($key == 5) { $v5 = $valeur; } } $pdf->Cell(20,5,convertirc(_($index)),0,0); if ($index == 'A') { $pdf->Cell(10,5,convertirc(_($v0)),0,0); } if ($index == 'C') { $pdf->Cell(10,5,convertirc(_($v1)),0,0); } if ($index == 'E') { $pdf->Cell(10,5,convertirc(_($v2)),0,0); } if ($index == 'O') { $pdf->Cell(10,5,convertirc(_($v3)),0,0); } if ($index == 'F') { $pdf->Cell(10,5,convertirc(_($v4)),0,0); } if ($index == 'D') { $pdf->Cell(10,5,convertirc(_($v5)),0,0); } $currentLegendY+=5; } $pdf->Ln(18); $hl=5; $pdf->SetX(13); $pdf->SetFont('Arial','B',9); $pdf->Cell(184,6,convertirc(_('Dépenses des bénéficiaires traités par statut')),1,1,'C',false); $pdf->SetFont('Arial','B',8); $pdf->SetX(13); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_('Statut bénéficiaire')),1,0,'C',true); $pdf->Cell(51,$hl,convertirc(_("Nombre traité sur la période")),1,0,'C',true); $pdf->Cell(24,$hl,convertirc(_("Taux traités")),1,0,'C',true); $pdf->Cell(27,$hl,convertirc(_("Dépenses")),1,0,'C',true); $pdf->Cell(24,$hl,convertirc(_("Taux")),1,0,'C',true); $pdf->Cell(24,$hl,convertirc(_("Coût moyen")),1,1,'C',true); $pdf->SetFont('Arial','',9); $total_BenefTraite = 0; $total_Taux_EffTraite = 0; $total_Depensestraite = 0; $total_Taux_Depense = 0; $total_coutMoyenTraite = 0; foreach ($statutsfts as $statutsft) { $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc($statutsft['libelle']),1,0,'L',false); $pdf->Cell(51,$hl,convertirc(format_N($statutsft['BenefTraite'])),1,0,'C',false); $pdf->Cell(24,$hl,convertirc($statutsft['Taux_Eff']."%"),1,0,'C',false); $pdf->Cell(27,$hl,convertirc(format_N($statutsft['Depenses'])),1,0,'C',false); $pdf->Cell(24,$hl,convertirc($statutsft['Taux_Depense']."%"),1,0,'C',false); $pdf->Cell(24,$hl,convertirc(format_N($statutsft['CoutMoyen'])),1,1,'C',false); $total_BenefTraite = $total_BenefTraite + $statutsft['BenefTraite']; $total_Taux_EffTraite = $total_Taux_EffTraite + $statutsft['Taux_Eff']; $total_Depensestraite = $total_Depensestraite + $statutsft['Depenses']; $total_Taux_Depense = $total_Taux_Depense+ $statutsft['Taux_Depense']; $total_coutMoyenTraite = $total_coutMoyenTraite + $statutsft['CoutMoyen']; } $pdf->SetFont('Arial','B',9); $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc("TOTAL GÉNERAL"),"1",0,'C',true); $pdf->Cell(51,$hl,format_N($total_BenefTraite),1,0,'C',true); $pdf->Cell(24,$hl,$total_Taux_EffTraite."%",1,0,'C',true); $pdf->Cell(27,$hl,format_N($total_Depensestraite),1,0,'C',true); $pdf->Cell(24,$hl,format_N($total_tauxMontantTraite)."%",1,0,'C',true); $pdf->Cell(24,$hl,format_N($total_coutMoyenTraite),1,0,'C',true); if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage(); // DEBUT FT4 $statuts = $this->detailsp->listestatutbeneficiaire($idPolice,$debutStat,$finStat); $tranches = $this->detailsp->listetrancheagebeneficiaire($idPolice,$debutStat,$finStat); $tranchesfts = $this->detailsp->recapdepensestranchesage($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit3.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR TRANCHES D'AGES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $hl=6; $pdf->SetX(13); $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl*2,convertirc(_("Tranche d'âge")),1,0,'C',true); $pdf->Cell(61,8,convertirc(_("Effectif sur la période")),1,0,'C',true); $pdf->Cell(64,8,convertirc(_("Dépenses sur la période")),1,0,'C',true); $pdf->Cell(25,$hl*2,convertirc(_("Coût moyen")),1,1,'C',true); $pdf->Cell(34,0,convertirc(""),0,0,'C',true); if ($p_id!=null){ $pdf->SetY(110); }else{ $pdf->SetY(76); } $pdf->SetX(47); $pdf->Cell(31,$hl,convertirc(_("Nombre")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Taux")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_("Montant")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Taux")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(26,0,convertirc(""),0,0,'C',false); $pdf->SetFont('Arial','',8); $total_Nombre = 0; $total_Taux_Eff = 0; $total_Depense_Tranche = 0; $total_Taux_Depense = 0; $total_coutMoyenTrancheTraite = 0; if ($p_id!=null){ $pdf->SetY(116); }else{ $pdf->SetY(82); } foreach ($tranchesfts as $tranchesft) { $hl=5; $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc($tranchesft['libelleTrancheAge']),1,0,'L',false); $pdf->Cell(31,$hl,convertirc(format_N($tranchesft['Nombre'])),1,0,'C',false); $pdf->Cell(30,$hl,convertirc($tranchesft['Taux_Eff']."%"),1,0,'C',false); $pdf->Cell(34,$hl,convertirc(format_N($tranchesft['Depense_Tranche'])),1,0,'C',false); $pdf->Cell(30,$hl,convertirc($tranchesft['Taux_Depense']."%"),1,0,'C',false); $pdf->Cell(25,$hl,convertirc(format_N($tranchesft['CoutMoyen'])),1,1,'C',false); $total_Nombre = $total_Nombre + $tranchesft['Nombre']; $total_Taux_Eff = $total_Taux_Eff + $tranchesft['Taux_Eff']; $total_Depense_Tranche = $total_Depense_Tranche + $tranchesft['Depense_Tranche']; $total_Taux_Depense = $total_Taux_Depense + $tranchesft['Taux_Depense']; $total_coutMoyenTrancheTraite = $total_coutMoyenTrancheTraite + $tranchesft['CoutMoyen']; } $pdf->SetFont('Arial','B',9); $pdf->SetX(13); $pdf->Cell(34,$hl,convertirc("TOTAL"),"1",0,'C',true); $pdf->Cell(31,$hl,format_N($total_Nombre),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_Taux_Eff) ."%",1,0,'C',true); $pdf->Cell(34,$hl,format_N($total_Depense_Tranche),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_Taux_Depense)."%",1,0,'C',true); $pdf->Cell(25,$hl,format_N($total_coutMoyenTrancheTraite),1,0,'C',true); } if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage('L'); // DEBUT FT5 $p_factures = $this->detailsp->evolutiondesdepenses($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $Chargement,$chargeravantapres); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit4.jpg', 0, 0, 297); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("ÉVOLUTION MENSUELLE DES DÉPENSES")), 0, 'L' ); $pdf->Ln(6); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(8); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['garant'])), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['souscripteur'])), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No')), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc(_(' : '.$entete['numeroPolice'].' / '.$entete['libellePolice'])), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['courtier'])), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc(_(' : '.$p_garant)), 0, 1, 'L', false); } $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(35,$hl,convertirc(_('Libellés')),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Janvier")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Février")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Mars")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Avril")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Mai")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Juin")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Juillet")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Août")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Septembre")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Octobre")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Novembre")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Décembre")),1,0,'C',true); $pdf->Cell(19,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_JANVIER = 0; $total_FEVRIER = 0; $total_MARS = 0; $total_AVRIL = 0; $total_MAI = 0; $total_JUIN = 0; $total_JUILLET = 0; $total_AOUT = 0; $total_SEPTEMBRE = 0; $total_OCTOBRE = 0; $total_NOVEMBRE = 0; $total_DECEMBRE = 0; $total_TOTAUX = 0; $hl=6; foreach ($p_factures as $dep) { $pdf->SetFont('Arial','B',7); $pdf->Cell(35,$hl,convertirc(_($dep['libelle'])),1,0,'L',false); $pdf->SetFont('Arial','',7); if($dep['libelle']== 'RAPP.S/P' || $dep['libelle']== 'RAPP.S/P' || $dep['libelle']== 'RAPP.S/P'){ $pdf->Cell(19,$hl,convertirc(_($dep['JANVIER'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['FEVRIER'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['MARS'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['AVRIL'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['MAI'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['JUIN'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['JUILLET'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['AOUT'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['SEPTEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['OCTOBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['NOVEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['DECEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(_($dep['TOTAUX'])),1,1,'R',false); }else{ $pdf->Cell(19,$hl,convertirc(format_N($dep['JANVIER'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['FEVRIER'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['MARS'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['AVRIL'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['MAI'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['JUIN'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['JUILLET'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['AOUT'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['SEPTEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['OCTOBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['NOVEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['DECEMBRE'])),1,0,'R',false); $pdf->Cell(19,$hl,convertirc(format_N($dep['TOTAUX'])),1,1,'R',false); } } $pdf->AddPage(''); // debut ft 6 $depensesFamille = $this->detailsp->detaildepensefamilleass($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("DÉPENSES PAR FAMILLE D'ASSURÉS")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); $pdf->SetX(20); $pdf->Cell(170,6,convertirc(_('DÉPENSES SUPÉRIEURES A').' : '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false); $pdf->Ln(10); $hl=7; $pdf->SetFont('Arial','B',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('Matricule')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(63,$hl,convertirc(_("Famille")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_("Pop. active")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_("Pop. traitée")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(22,$hl,convertirc(_("Réclamé")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(22,$hl,convertirc(_("Non Remb.")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(22,$hl,convertirc(_("Remboursé")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(16,$hl,convertirc(_("Coût moyen")),1,1,'C',true); $pdf->SetFont('Arial','',7); $total_popActive = 0; $total_popTraite = 0; $total_montantReclame = 0; $total_montantNonRembourse = 0; $total_montantRembourse = 0; $total_coutMoyen = 0; foreach ($depensesFamille as $dep) { $pdf->Cell(15,$hl,convertirc($dep['numeroAdherent']),1,0,'C',false); $pdf->Cell(63,$hl,convertirc($dep['adherent']),1,0,'L',false); $pdf->Cell(15,$hl,convertirc($dep['popActive']),1,0,'C',false); $pdf->Cell(15,$hl,convertirc($dep['popTraite']),1,0,'C',false); $pdf->Cell(22,$hl,convertirc(format_N($dep['montantReclame'])),1,0,'C',false); $pdf->Cell(22,$hl,convertirc(format_N($dep['montantNonRembourse'])),1,0,'C',false); $pdf->Cell(22,$hl,convertirc(format_N($dep['montantRembourse'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['Coutmoyen'])),1,1,'C',false); $total_popActive = $total_popActive + $dep['popActive']; $total_popTraite = $total_popTraite + $dep['popTraite']; $total_montantReclame = $total_montantReclame + $dep['montantReclame']; $total_montantNonRembourse = $total_montantNonRembourse + $dep['montantNonRembourse']; $total_montantRembourse = $total_montantRembourse + $dep['montantRembourse']; $total_coutMoyen = $total_montantRembourse / $total_popTraite; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(78,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(15,$hl,format_N($total_popActive),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_popTraite),1,0,'C',true); $pdf->Cell(22,$hl,format_N($total_montantReclame),1,0,'C',true); $pdf->Cell(22,$hl,format_N($total_montantNonRembourse),1,0,'C',true); $pdf->Cell(22,$hl,format_N($total_montantRembourse),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_coutMoyen),1,1,'C',true); $pdf->Ln(5); $pdf->SetX(15); $pdf->SetFont('helvetica','B',12); $hl =8; $pdf->Cell(45,$hl,convertirc(_("Nombre de lignes: ").count($depensesFamille)),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(45,$hl,convertirc(_(" * Légende : ").count($depensesFamille)),0,0,'L',false); $pdf->Ln(8); $pdf->SetX(15); $pdf->Cell(45,$hl,convertirc(_("Non remb.= Ticket modérateur + exclusion + dépassement de plafond")),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(15); $pdf->Cell(45,$hl,convertirc(_("Pop.active= Population active sur la période")),0,0,'L',false); $pdf->Ln(5); $pdf->SetX(15); $pdf->Cell(45,$hl,convertirc(_("Pop.traitée= Population traitée sur la période")),0,0,'L',false); } $pdf->AddPage('L'); // debut ft7 $p_factures = $this->detailsp->evolutiondepfamilleAssrp($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin,$p_limite ); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit7.jpg', 0, 0, 297); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(180, 8, convertirc(_("EVOLUTION MENSUELLE DES DEPENSES PAR FAMILLE D'ASSURE")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $pdf->Ln(4); $pdf->SetX(65); $pdf->Cell(170,6,convertirc(_('DEPENSES SUPERIEURES A').' : '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false); $pdf->Ln(2); $hl=7; $pdf->SetFont('Arial','',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('Matricule')),1,0,'C',true); $pdf->Cell(60,$hl,convertirc(_("Famille")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Janvier")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Février")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mars")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Avril")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mai")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Juin")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Juillet")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Août")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Septembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Octobre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Novembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Décembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_JANVIER = 0; $total_FEVRIER = 0; $total_MARS = 0; $total_AVRIL = 0; $total_MAI = 0; $total_JUIN = 0; $total_JUILLET = 0; $total_AOUT = 0; $total_SEPTEMBRE = 0; $total_OCTOBRE = 0; $total_NOVEMBRE = 0; $total_DECEMBRE = 0; $total_TOTAUX = 0; foreach ($p_factures as $dep) { $pdf->Cell(15,$hl,convertirc($dep['numeroAdherent']),1,0,'C',false); $pdf->Cell(60,$hl,convertirc($dep['adherent']),1,0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JANVIER'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['FEVRIER'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MARS'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AVRIL'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MAI'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['JUIN'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JUILLET'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AOUT'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['SEPTEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['OCTOBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['NOVEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['DECEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['TOTAUX'])),1,1,'C',false); $total_JANVIER = $total_JANVIER + $dep['JANVIER']; $total_FEVRIER = $total_FEVRIER + $dep['FEVRIER']; $total_MARS = $total_MARS + $dep['MARS']; $total_AVRIL = $total_AVRIL + $dep['AVRIL']; $total_MAI = $total_MAI + $dep['MAI']; $total_JUIN = $total_JUIN + $dep['JUIN']; $total_JUILLET = $total_JUILLET + $dep['JUILLET']; $total_AOUT = $total_AOUT + $dep['AOUT']; $total_SEPTEMBRE = $total_SEPTEMBRE + $dep['SEPTEMBRE']; $total_OCTOBRE = $total_OCTOBRE + $dep['OCTOBRE']; $total_NOVEMBRE = $total_NOVEMBRE + $dep['NOVEMBRE']; $total_DECEMBRE = $total_DECEMBRE + $dep['DECEMBRE']; $total_TOTAUX = $total_TOTAUX + $dep['TOTAUX']; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(75,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(16,$hl,format_N($total_JANVIER),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_FEVRIER),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MARS),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AVRIL),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MAI),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_JUIN),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_JUILLET),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AOUT),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_SEPTEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_OCTOBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_NOVEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_DECEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_TOTAUX),1,1,'C',true); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Nombre de lignes").': '.count($p_factures)),0,0,'L',false); $pdf->AddPage();// debut ft 8 $p_factures = $this->detailsp->etatrecapdepensesparfamilledactesmedicaux($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(145, 8, convertirc(_("RÉCAPITULATIF DES DÉPENSES PAR FAMILLE D'ACTES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $hl=6; $pdf->SetFont('Arial', 'B', 8); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(15, $hl, convertirc(_('Code')), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(80, $hl, convertirc(_("Libellé")), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(20, $hl, convertirc(_("Quantité")), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(30, $hl, convertirc(_("Montant Remboursé")), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(25, $hl, convertirc(_("Coût Moyen")), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(20, $hl, convertirc(_("Taux")), 1, 1, 'C', true); $pdf->SetFont('Arial', '', 9); $total_assure = 0; $total_coutmoyen =0; $total_quantite =0; $total_montantrembourse =0; $total_traite = 0; $total_taux = 0; foreach ($p_factures as $p_facture) { $pdf->Cell(15, $hl, convertirc($p_facture['codeGarantie']), 1, 0, 'L', false); $pdf->Cell(80, $hl, convertirc($p_facture['libelle']), 1, 0, 'L', false); $pdf->Cell(20, $hl, convertirc(format_N($p_facture['Quantite'])), 1, 0, 'C', false); $pdf->Cell(30, $hl, convertirc(format_N($p_facture['MontantRembourse'])), 1, 0, 'R', false); $pdf->Cell(25, $hl, convertirc(format_N($p_facture['Coutmoyen'])), 1, 0, 'R', false); $pdf->Cell(20, $hl, convertirc($p_facture['Taux']), 1, 1, 'C', false); $total_coutmoyen = $total_coutmoyen + $p_facture['Coutmoyen']; $total_quantite = $total_quantite + $p_facture['Quantite']; $total_montantrembourse = $total_montantrembourse + $p_facture['MontantRembourse']; $total_taux = $total_taux + $p_facture['Taux']; } $hl=8; $total_coutmoyen = round($total_montantrembourse/$total_quantite); $pdf->SetFont('Arial', 'B', 9); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(95, $hl, convertirc(_('TOTAL')), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(20, $hl, convertirc(_(format_N($total_quantite))), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(30, $hl, convertirc(_(format_N($total_montantrembourse))), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(25, $hl, convertirc(_(format_N($total_coutmoyen))), 1, 0, 'C', true); $pdf->SetFillColor(143, 206, 143); $pdf->Cell(20, $hl, convertirc(_(convertirc('100 %'))), 1, 1, 'C', true); $chartX=15; $chartY=175; //dimension $chartWidth=180; $chartHeight=100; //padding $chartTopPadding=12; $chartLeftPadding=20; $chartBottomPadding=10; $chartRightPadding=5; //chart box $chartBoxX=$chartX+$chartLeftPadding; $chartBoxY=$chartY+$chartTopPadding; $chartBoxWidth=$chartWidth-$chartLeftPadding-$chartRightPadding; $chartBoxHeight=$chartHeight-$chartBottomPadding-$chartTopPadding; //bar width $barWidth=8; $valeur0=0; $valeur1=0; $valeur2=0; $valeur3=0; $valeur4=0; $valeur5=0; $valeur6=0; $valeur7=0; $valeur8=0; $valeur9=0; $valeur10=0; $value=0; $v=0; $valeurs=array(); foreach($p_factures as $p_factures['codeGarantie'] => $value) { array_push($valeurs,$value['Taux']); foreach($valeurs as $key =>$valeur) { if ($value['codeGarantie'] == 'AUX') { $valeur1 = $value['Taux']; } if ($value['codeGarantie'] == 'BIO') { $valeur2 = $value['Taux']; } if ($value['codeGarantie'] == 'CON') { $valeur3 = $value['Taux']; } if ($value['codeGarantie'] == 'DEN') { $valeur4 = $value['Taux']; } if ($value['codeGarantie'] == 'EXA') { $valeur5 = $value['Taux']; } if ($value['codeGarantie'] == 'HOS') { $valeur6 = $value['Taux']; } if ($value['codeGarantie'] == 'IMA') { $valeur7 = $value['Taux']; } if ($value['codeGarantie'] == 'MAT') { $valeur8 = $value['Taux']; } if ($value['codeGarantie'] == 'OPT') { $valeur9 = $value['Taux']; } if ($value['codeGarantie'] == 'PHA') { $valeur10 = $value['Taux']; } $data=Array( 'AUX'=>[ 'color'=>[255,0,0], 'value'=>$valeur1], 'BIO'=>[ 'color'=>[255,255,0], 'value'=>$valeur2], 'CON'=>[ 'color'=>[50,0,255], 'value'=>$valeur3], 'DEN'=>[ 'color'=>[255,0,255], 'value'=>$valeur4], 'EXA'=>[ 'color'=>[0,255,0], 'value'=>$valeur5], 'HOS'=>[ 'color'=>[200,255,100], 'value'=>$valeur6], 'IMA'=>[ 'color'=>[121,248,248], 'value'=>$valeur7], 'MAT'=>[ 'color'=>[121,210,180], 'value'=>$valeur8], 'OPT'=>[ 'color'=>[221,248,248], 'value'=>$valeur9], 'PHA'=>[ 'color'=>[0,100,108], 'value'=>$valeur10] ); } } $dataMax=0; foreach($data as $item){ if ($item['value']> $dataMax) $dataMax=$item['value']; } //data step if($dataMax>200 and $dataMax<600){ $dataStep=20; } if($dataMax<200){ $dataStep=10; } if($dataMax>1000){ $dataStep=100; } //set font, line width and color $pdf->SetFont('Arial','',8); $pdf->SetLineWidth(0.1); $pdf->SetDrawColor(0); //chart boundary $pdf->Rect($chartX,$chartY,$chartWidth,$chartHeight); //vertical axis line $pdf->Line( $chartBoxX , $chartBoxY , $chartBoxX , ($chartBoxY+$chartBoxHeight) ); //horizontal axis line $pdf->Line( $chartBoxX-2 , ($chartBoxY+$chartBoxHeight) , $chartBoxX+($chartBoxWidth) , ($chartBoxY+$chartBoxHeight) ); ///vertical axis //calculate chart's y axis scale unit $yAxisUnits=$chartBoxHeight/$dataMax; //draw the vertical (y) axis labels for($i=0 ; $i<=$dataMax ; $i+=$dataStep){ //y position $yAxisPos=$chartBoxY+($yAxisUnits*$i); //draw y axis line $pdf->Line( $chartBoxX-2 , $yAxisPos , $chartBoxX , $yAxisPos ); //set cell position for y axis labels $pdf->SetXY($chartBoxX-$chartLeftPadding , $yAxisPos-2); //$pdf->Cell($chartLeftPadding-4 , 5 , $dataMax-$i , 1);--------------- $pdf->Cell($chartLeftPadding-4 , 5 , $dataMax-$i, 0 , 0 , 'R'); } ///horizontal axis //set cells position $pdf->SetXY($chartBoxX , $chartBoxY+$chartBoxHeight); //cell's width $xLabelWidth=$chartBoxWidth / count($data); //$pdf->Cell($xLabelWidth , 5 , $itemName , 1 , 0 , 'C');------------- //loop horizontal axis and draw the bar $barXPos=0; foreach($data as $itemName=>$item){ //print the label //$pdf->Cell($xLabelWidth , 5 , $itemName , 1 , 0 , 'C');-------------- $pdf->Cell($xLabelWidth , 5 , $itemName , 0 , 0 , 'C'); ///drawing the bar //bar color $pdf->SetFillColor($item['color'][0],$item['color'][1],$item['color'][2]); //bar height $barHeight=$yAxisUnits*$item['value']; //bar x position $barX=($xLabelWidth/2)+($xLabelWidth*$barXPos); $barX=$barX-($barWidth/2); $barX=$barX+$chartBoxX; //bar y position $barY=$chartBoxHeight-$barHeight; $barY=$barY+$chartBoxY; //draw the bar $pdf->Rect($barX,$barY,$barWidth,$barHeight,'DF'); //increase x position (next series) $barXPos++; } //axis labels $pdf->SetFont('Arial','B',9); $pdf->SetXY($chartX,$chartY); $pdf->Cell(30,10,"Taux",0); $pdf->SetXY(($chartWidth/2)-50+$chartX,$chartY+$chartHeight-($chartBottomPadding/2)); $pdf->Cell(100,5,convertirc(_("Récapitulatif des dépenses par famille d'acte")),0,0,'C'); if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage('L'); $p_factures = $this->detailsp->evolutiondepfamilleAct($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin,$p_limite ); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit4.jpg', 0, 0, 297); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("ÉVOLUTION MENSUELLE DES DÉPENSES PAR FAMILLE D'ACTES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc(_(' : '.$p_garant)), 0, 1, 'L', false); } $pdf->Ln(4); $pdf->SetX(65); $pdf->Cell(170,6,convertirc(_('DÉPENSES SUPÉRIEURES À').' : '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false); $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',7); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('Code')),1,0,'C',true); $pdf->Cell(60,$hl,convertirc(_("Garantie")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Janvier")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Février")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mars")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Avril")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Mai")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Juin")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Juillet")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Août")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Septembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Octobre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Novembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Décembre")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_JANVIER = 0; $total_FEVRIER = 0; $total_MARS = 0; $total_AVRIL = 0; $total_MAI = 0; $total_JUIN = 0; $total_JUILLET = 0; $total_AOUT = 0; $total_SEPTEMBRE = 0; $total_OCTOBRE = 0; $total_NOVEMBRE = 0; $total_DECEMBRE = 0; $total_TOTAUX = 0; $pdf->SetFont('Arial','',7); foreach ($p_factures as $dep) { $pdf->Cell(15,$hl,convertirc($dep['codeGarantie']),1,0,'C',false); $pdf->Cell(60,$hl,convertirc($dep['libelle']),1,0,'L',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JANVIER'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['FEVRIER'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MARS'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AVRIL'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['MAI'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['JUIN'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['JUILLET'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AOUT'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['SEPTEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['OCTOBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['NOVEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['DECEMBRE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['TOTAUX'])),1,1,'C',false); $total_JANVIER = $total_JANVIER + $dep['JANVIER']; $total_FEVRIER = $total_FEVRIER + $dep['FEVRIER']; $total_MARS = $total_MARS + $dep['MARS']; $total_AVRIL = $total_AVRIL + $dep['AVRIL']; $total_MAI = $total_MAI + $dep['MAI']; $total_JUIN = $total_JUIN + $dep['JUIN']; $total_JUILLET = $total_JUILLET + $dep['JUILLET']; $total_AOUT = $total_AOUT + $dep['AOUT']; $total_SEPTEMBRE = $total_SEPTEMBRE + $dep['SEPTEMBRE']; $total_OCTOBRE = $total_OCTOBRE + $dep['OCTOBRE']; $total_NOVEMBRE = $total_NOVEMBRE + $dep['NOVEMBRE']; $total_DECEMBRE = $total_DECEMBRE + $dep['DECEMBRE']; $total_TOTAUX = $total_TOTAUX + $dep['TOTAUX']; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(75,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(16,$hl,format_N($total_JANVIER),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_FEVRIER),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MARS),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AVRIL),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_MAI),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_JUIN),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_JUILLET),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AOUT),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_SEPTEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_OCTOBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_NOVEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_DECEMBRE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_TOTAUX),1,1,'C',true); } $pdf->AddPage();// debut fiche 11 $depensesFamillesA = $this->detailsp->etatcomparatifdesdepensesA($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); $depensesFamillesB = $this->detailsp->etatcomparatifdesdepensesB($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin, $p_limite); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(10); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(145, 8, convertirc(_("COMPARATIF DES DÉPENSES DES ANNÉE N-1 ET N")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(9); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc(_(' : '.$p_garant)), 0, 1, 'L', false); } $pdf->Ln(2); $hl=7; $pdf->SetFont('Arial','BU',10); $annee = date("Y", strtotime($finStat)); $precannee = $annee -1; $pdf->Cell(95,$hl,convertirc(_('Etat des dépenses de l\'année n-1')),1,0,'C',FALSE); $pdf->Cell(95,$hl,convertirc(_('Etat des dépenses de l\'année n')),1,1,'C',FALSE); $pdf->SetFillColor( 65, 185, 80 ); $pdf->SetFont('Arial','B',6); $pdf->Cell(44,$hl,convertirc(_('Famille d\'actes')),1,0,'C',true); $pdf->Cell(13,$hl,convertirc(_("Nombre")),1,0,'C',true); $pdf->Cell(14,$hl,convertirc(_("Montant net ")),1,0,'C',true); $pdf->Cell(13,$hl,convertirc(_("Coût moyen")),1,0,'C',true); $pdf->Cell(10,$hl,convertirc(_("Taux %")),1,0,'C',true); $pdf->SetX(106); $pdf->SetFillColor(5,19,111); $pdf->SetTextColor(255,255,255); $pdf->Cell(44,$hl,convertirc(_('Famille d\'actes')),1,0,'C',true); $pdf->Cell(13,$hl,convertirc(_("Nombre")),1,0,'C',true); $pdf->Cell(14,$hl,convertirc(_("Montant net ")),1,0,'C',true); $pdf->Cell(13,$hl,convertirc(_("Coût moyen")),1,0,'C',true); $pdf->Cell(10,$hl,convertirc(_("Taux %")),1,1,'C',true); $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','',6); $total_popActive = 0; $total_popTraite = 0; $total_quantite = 0; $total_taux =0; $total_montantReclame = 0; $total_montantNonRembourse = 0; $total_montantRembourse = 0; $total_coutMoyen = 0; $total_popActiveA = 0; $total_popTraiteA = 0; $total_montantReclameA = 0; $total_montantNonRembourseA = 0; $total_montantRembourseA = 0; $total_coutMoyenA = 0; $total_tauxA =0; $total_quantiteA = 0; foreach ($depensesFamillesA as $depA) { $pdf->Cell(44,$hl,convertirc($depA['libelle']),1,0,'L',false); $pdf->Cell(13,$hl,convertirc($depA['Quantite']),1,0,'C',false); $pdf->Cell(14,$hl,convertirc(format_N($depA['MontantRembourse'])),1,0,'C',false); $pdf->Cell(13,$hl,convertirc(format_N($depA['Coutmoyen'])),1,0,'C',false); $pdf->Cell(10,$hl,convertirc(($depA['Taux'])),1,1,'C',false); $total_quantiteA = $total_quantiteA + $depA['Quantite']; $total_montantRembourseA = $total_montantRembourseA + $depA['MontantRembourse']; $total_coutMoyenA = $total_montantRembourseA / $total_quantiteA; $total_tauxA = $total_tauxA + $depA['Taux']; } $pdf->SetFont('Arial','B',6); $pdf->SetFillColor( 65, 185, 80 ); $pdf->Cell(44,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(13,$hl,format_N($total_quantiteA),1,0,'C',true); $pdf->Cell(14,$hl,format_N($total_montantRembourseA),1,0,'C',true); $pdf->Cell(13,$hl,format_N($total_coutMoyenA),1,0,'C',true); $pdf->Cell(10,$hl,format_N(100),1,0,'C',true); $pdf->SetY(89); if ($p_id!=null){ $pdf->SetY(89); }else{ $pdf->SetY(65); } foreach ($depensesFamillesB as $dep) { $pdf->SetX(106); $pdf->Cell(44,$hl,convertirc($dep['libelle']),1,0,'L',false); $pdf->Cell(13,$hl,convertirc($dep['Quantite']),1,0,'C',false); $pdf->Cell(14,$hl,convertirc(format_N($dep['MontantRembourse'])),1,0,'C',false); $pdf->Cell(13,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'C',false); $pdf->Cell(10,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_quantite = $total_quantite + $dep['Quantite']; $total_montantRembourse = $total_montantRembourse + $dep['MontantRembourse']; $total_coutMoyen = $total_montantRembourse / $total_quantite; $total_taux = $total_taux + $dep['Taux']; } $pdf->SetX(106); $pdf->SetFont('Arial','B',6); $pdf->SetFillColor(5,19,111); $pdf->SetTextColor(255,255,255); $pdf->Cell(44,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(13,$hl,format_N($total_quantite),1,0,'C',true); $pdf->Cell(14,$hl,format_N($total_montantRembourse),1,0,'C',true); $pdf->Cell(13,$hl,format_N($total_coutMoyen),1,0,'C',true); $pdf->Cell(10,$hl,format_N(100),1,1,'C',true); $pdf->SetTextColor(0,0,0); $pdf->SetFont('Arial','BU',10); $pdf->SetY(175); $pdf->SetX(50); $pdf->Cell(120,8,convertirc(_('Comparaison des dépenses de l\'année n-1 et l\'année n ')),1,1,'C',false); $chartX=15; $chartY=175; //dimension $chartWidth=180; $chartHeight=100; //padding $chartTopPadding=12; $chartLeftPadding=20; $chartBottomPadding=10; $chartRightPadding=5; //chart box $chartBoxX=$chartX+$chartLeftPadding; $chartBoxY=$chartY+$chartTopPadding; $chartBoxWidth=$chartWidth-$chartLeftPadding-$chartRightPadding; $chartBoxHeight=$chartHeight-$chartBottomPadding-$chartTopPadding; //bar width $barWidth=5; $barWidth1=5; $valeur0=0; $valeur1=0; $valeur2=0; $valeur3=0; $valeur4=0; $valeur5=0; $valeur6=0; $valeur7=0; $valeur8=0; $valeur9=0; $valeur10=0; $value=0; $v=0; $valeur0A=0; $valeur1A=0; $valeur2A=0; $valeur3A=0; $valeur4A=0; $valeur5A=0; $valeur6A=0; $valeur7A=0; $valeur8A=0; $valeur9A=0; $valeur10A=0; $value1=0; $v=0; $valeurs=array(); $valeurs1=array(); foreach($depensesFamillesA as $depensesFamillesA['codeGarantie'] => $value1) { array_push($valeurs1,$value1['Taux']); foreach($valeurs1 as $key =>$valeurA) { if ($value1['codeGarantie'] == 'AUX') { $valeur1A = $value1['Taux']; } if ($value1['codeGarantie'] == 'BIO') { $valeur2A = $value1['Taux']; } if ($value1['codeGarantie'] == 'CON') { $valeur3A = $value1['Taux']; } if ($value1['codeGarantie'] == 'DEN') { $valeur4A = $value1['Taux']; } if ($value1['codeGarantie'] == 'EXA') { $valeur5A = $value1['Taux']; } if ($value1['codeGarantie'] == 'HOS') { $valeur6A = $value1['Taux']; } if ($value1['codeGarantie'] == 'IMA') { $valeur7A = $value1['Taux']; } if ($value1['codeGarantie'] == 'MAT') { $valeur8A = $value1['Taux']; } if ($value1['codeGarantie'] == 'OPT') { $valeur9A = $value1['Taux']; } if ($value1['codeGarantie'] == 'PHA') { $valeur10A = $value1['Taux']; } $data1=Array( 'AUX'=>[ 'color'=>[65,185,80], 'value'=>$valeur1A], 'BIO'=>[ 'color'=>[65,185,80], 'value'=>$valeur2A], 'CON'=>[ 'color'=>[65,185,80], 'value'=>$valeur3A], 'DEN'=>[ 'color'=>[65,185,80], 'value'=>$valeur4A], 'EXA'=>[ 'color'=>[65,185,80], 'value'=>$valeur5A], 'HOS'=>[ 'color'=>[65,185,80], 'value'=>$valeur6A], 'IMA'=>[ 'color'=>[65,185,80], 'value'=>$valeur7A], 'MAT'=>[ 'color'=>[65,185,80], 'value'=>$valeur8A], 'OPT'=>[ 'color'=>[65,185,80], 'value'=>$valeur9A], 'PHA'=>[ 'color'=>[65,185,80], 'value'=>$valeur10A] ); } } foreach($depensesFamillesB as $depensesFamillesB['codeGarantie'] => $value) { array_push($valeurs,$value['Taux']); foreach($valeurs as $key =>$valeur) { if ($value['codeGarantie'] == 'AUX') { $valeur1 = $value['Taux']; } if ($value['codeGarantie'] == 'BIO') { $valeur2 = $value['Taux']; } if ($value['codeGarantie'] == 'CON') { $valeur3 = $value['Taux']; } if ($value['codeGarantie'] == 'DEN') { $valeur4 = $value['Taux']; } if ($value['codeGarantie'] == 'EXA') { $valeur5 = $value['Taux']; } if ($value['codeGarantie'] == 'HOS') { $valeur6 = $value['Taux']; } if ($value['codeGarantie'] == 'IMA') { $valeur7 = $value['Taux']; } if ($value['codeGarantie'] == 'MAT') { $valeur8 = $value['Taux']; } if ($value['codeGarantie'] == 'OPT') { $valeur9 = $value['Taux']; } if ($value['codeGarantie'] == 'PHA') { $valeur10 = $value['Taux']; } $data=Array( 'AUX'=>[ 'color'=>[5,19,111], 'value'=>$valeur1], 'BIO'=>[ 'color'=>[5,19,111], 'value'=>$valeur2], 'CON'=>[ 'color'=>[5,19,111], 'value'=>$valeur3], 'DEN'=>[ 'color'=>[5,19,111], 'value'=>$valeur4], 'EXA'=>[ 'color'=>[5,19,111], 'value'=>$valeur5], 'HOS'=>[ 'color'=>[5,19,111], 'value'=>$valeur6], 'IMA'=>[ 'color'=>[5,19,111], 'value'=>$valeur7], 'MAT'=>[ 'color'=>[5,19,111], 'value'=>$valeur8], 'OPT'=>[ 'color'=>[5,19,111], 'value'=>$valeur9], 'PHA'=>[ 'color'=>[5,19,111], 'value'=>$valeur10] ); } } //$dataMax $dataMax1=0; foreach($data1 as $item1) { if($item1['value']>$dataMax1) $dataMax1=$item1['value']; } //data step if($dataMax1>200 and $dataMax1<600) { $dataStep1=20; } if($dataMax1<200){ $dataStep1=10; } if($dataMax1>1000){ $dataStep1=100; } $dataMax=0; foreach($data as $item) { if($item['value']>$dataMax) $dataMax=$item['value']; } //data step if($dataMax>200 and $dataMax<600) { $dataStep=20; } if($dataMax<200){ $dataStep=10; } if($dataMax>1000){ $dataStep=100; } //set font, line width and color $pdf->SetFont('Arial','',8); $pdf->SetLineWidth(0.1); $pdf->SetDrawColor(0); //chart boundary $pdf->Rect($chartX,$chartY,$chartWidth,$chartHeight); //vertical axis line $pdf->Line( $chartBoxX , $chartBoxY , $chartBoxX , ($chartBoxY+$chartBoxHeight) ); //horizontal axis line $pdf->Line( $chartBoxX-2 , ($chartBoxY+$chartBoxHeight) , $chartBoxX+($chartBoxWidth) , ($chartBoxY+$chartBoxHeight) ); ///vertical axis //calculate chart's y axis scale unit $yAxisUnits=$chartBoxHeight/$dataMax; $yAxisUnits1=$chartBoxHeight/$dataMax1; //draw the vertical (y) axis labels for($i=0 ; $i<=$dataMax1 ; $i+=$dataStep1) { //y position $yAxisPos1=$chartBoxY+($yAxisUnits1*$i); //draw y axis line $pdf->Line( $chartBoxX-2 , $yAxisPos1 , $chartBoxX , $yAxisPos1 ); //set cell position for y axis labels $pdf->SetTextColor(65,185,80); $pdf->SetXY($chartBoxX-$chartLeftPadding , $yAxisPos1-2); //$pdf->Cell($chartLeftPadding-4 , 5 , $dataMax-$i , 1);--------------- $pdf->Cell($chartLeftPadding-4 , 5 , $dataMax1-$i, 0 , 0 , 'L'); } for($i=0 ; $i<=$dataMax ; $i+=$dataStep) { //y position $yAxisPos=$chartBoxY+($yAxisUnits*$i); //draw y axis line $pdf->Line( $chartBoxX-2 , $yAxisPos , $chartBoxX , $yAxisPos ); //set cell position for y axis labels $pdf->SetXY($chartBoxX-$chartLeftPadding , $yAxisPos-2); //$pdf->Cell($chartLeftPadding-4 , 5 , $dataMax-$i , 1);--------------- $pdf->SetTextColor(5,19,111); $pdf->Cell($chartLeftPadding-2 , 5 , $dataMax-$i, 0 , 0 , 'R'); $pdf->SetTextColor(0); } ///horizontal axis //set cells position $pdf->SetXY($chartBoxX , $chartBoxY+$chartBoxHeight); //cell's width $xLabelWidth=$chartBoxWidth / count($data); //$pdf->Cell($xLabelWidth , 5 , $itemName , 1 , 0 , 'C');------------- //loop horizontal axis and draw the bar $barXPos1=0; foreach($data1 as $itemName1=>$item1) { //print the label //$pdf->Cell($xLabelWidth , 5 , $itemName , 1 , 0 , 'C');-------------- //$pdf->Cell($xLabelWidth , 5 , $itemName , 0 , 0 , 'C'); ///drawing the bar //bar color $pdf->SetFillColor($item1['color'][0],$item1['color'][1],$item1['color'][2]); //bar height $barHeight=$yAxisUnits1*$item1['value']; //bar x position $barX1=($xLabelWidth/2)+($xLabelWidth*$barXPos1); $barX1=$barX1-($barWidth/2); $barX1=$barX1+$chartBoxX; //bar y position $barY1=$chartBoxHeight-$barHeight; $barY1=$barY1+$chartBoxY; //draw the bar $pdf->Rect($barX1,$barY1,$barWidth,$barHeight,'DF'); //increase x position (next series) $barXPos1++; } $barXPos=0; //highlight_string(""); foreach($data as $itemName=>$item) { //print the label //$pdf->Cell($xLabelWidth , 5 , $itemName , 1 , 0 , 'C');-------------- $pdf->Cell($xLabelWidth , 5 , $itemName , 0 , 0 , 'C'); ///drawing the bar //bar color $pdf->SetFillColor($item['color'][0],$item['color'][1],$item['color'][2]); //bar height $barHeight=$yAxisUnits*$item['value']; //bar x position $barX=($xLabelWidth/2)+($xLabelWidth*$barXPos); $barX=$barX-($barWidth/2); $barX=$barX+$chartBoxX+5; //bar y position $barY=$chartBoxHeight-$barHeight; $barY=$barY+$chartBoxY; //draw the bar $pdf->Rect($barX,$barY,$barWidth,$barHeight,'DF'); //increase x position (next series) $barXPos++; } //axis labels $pdf->SetFont('Arial','B',9); $pdf->SetXY($chartX,$chartY); $pdf->Cell(30,10,"Taux",0); $pdf->SetXY(($chartWidth/2)-50+$chartX,$chartY+$chartHeight-($chartBottomPadding/2)); $pdf->SetXY(($chartWidth/2)-50+$chartX,$chartY+$chartHeight-($chartBottomPadding/2)); if($entete['codeTypeContrat']!="G"){ $pdf->AddPage(); $p_factures = $this->detailsp->depensesparprestatairemedicaux($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("ÉTAT DES DÉPENSES PAR PRESTATAIRES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['garant'])), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['souscripteur'])), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No')), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc(_(' : '.$entete['numeroPolice'].' / '.$entete['libellePolice'])), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER')), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc(_(' : '.$entete['courtier'])), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT')), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc(_(' : '.$p_garant)), 0, 1, 'L', false); } $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(87,$hl,convertirc(_('Prestataire médicaux')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(28,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',8); $total_montantFacture = $total_apresDecompte = $total_Coutmoyen = $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(87,$hl,convertirc($dep['Beneficiaire']),1,0,'L',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(28,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(15,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen']; $total_Taux = $total_Taux +$dep['Taux']; } // $total_Quantite=count($p_factures) // $total_Coutmoyen = $total_Coutmoyen/$total_Quantite ; $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(87,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(30,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(28,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(15,$hl,convertirc('100 %'),1,1,'C',true); } if($entete['codeTypeContrat']=="G" || $entete['codeTypeContrat']=="E"){ $pdf->AddPage('L'); //DEBUT FT 13 G-E $p_factures = $this->detailsp->depensesparfamilledactesetparprestataires($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin,$p_limite); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit4.jpg', 0, 0, 297); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(180, 8, convertirc(_("DÉPENSES PAR FAMILLE D'ACTES ET PAR PRESTATAIRES")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $pdf->Ln(4); $pdf->SetX(65); $pdf->Cell(170,6,convertirc(_('DÉPENSES SUPERIEURES A').' : '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false); $pdf->Ln(2); $hl=7; $pdf->SetFont('Arial','B',6); $pdf->SetFillColor(143,206,143); $pdf->Cell(62,$hl,convertirc(_("Prestataire")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_('Consultation')),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Imagerie")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Biologie")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Dentisterie")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Optique")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Hospitalisation")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Pharmacie")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Maternité")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("# Autres.")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("# Aux Med.")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("Assistance")),1,0,'C',true); $pdf->Cell(16,$hl,convertirc(_("# Trans Med.")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("# Bilan.")),1,0,'C',true); $pdf->Cell(15,$hl,convertirc(_("Totaux")),1,1,'C',true); $total_CONSULTATION = $total_IMAGERIE = $total_BIOLOGIE = $total_DENTISTERIE = $total_OPTIQUE = $total_HOSPITALISATION = $total_PHARMACIE = $total_MATERNITE = $total_AUTRES_EXAMENS = $total_AUXILIAIRES_MEDICAUX = $total_ASSISTANCE = $total_TRANSPORT_MEDICALISE = $total_BILAN_DE_SANTE = $total_TOTAUX = 0; $pdf->SetFont('Arial','',6); foreach ($p_factures as $dep) { $pdf->Cell(62,$hl,convertirc(substr($dep['Prestataire'],1,47)),1,0,'L',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['CONSULTATION'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['IMAGERIE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['BIOLOGIE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['DENTISTERIE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['OPTIQUE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['HOSPITALISATION'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['PHARMACIE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['MATERNITE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['AUTRES EXAMENS'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['AUXILIAIRES MEDICAUX'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['ASSISTANCE'])),1,0,'C',false); $pdf->Cell(16,$hl,convertirc(format_N($dep['TRANSPORT MEDICALISE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['BILAN DE SANTE'])),1,0,'C',false); $pdf->Cell(15,$hl,convertirc(format_N($dep['TOTAUX'])),1,1,'C',false); $total_CONSULTATION = $total_CONSULTATION + $dep['CONSULTATION']; $total_IMAGERIE = $total_IMAGERIE + $dep['IMAGERIE']; $total_BIOLOGIE = $total_BIOLOGIE + $dep['BIOLOGIE']; $total_DENTISTERIE = $total_DENTISTERIE + $dep['DENTISTERIE']; $total_OPTIQUE = $total_OPTIQUE + $dep['OPTIQUE']; $total_HOSPITALISATION = $total_HOSPITALISATION + $dep['HOSPITALISATION']; $total_PHARMACIE = $total_PHARMACIE + $dep['PHARMACIE']; $total_MATERNITE = $total_MATERNITE + $dep['MATERNITE']; $total_AUTRES_EXAMENS = $total_AUTRES_EXAMENS + $dep['AUTRES EXAMENS']; $total_AUXILIAIRES_MEDICAUX = $total_AUXILIAIRES_MEDICAUX + $dep['AUXILIAIRES MEDICAUX']; $total_ASSISTANCE = $total_ASSISTANCE + $dep['ASSISTANCE']; $total_TRANSPORT_MEDICALISE = $total_TRANSPORT_MEDICALISE + $dep['TRANSPORT MEDICALISE']; $total_BILAN_DE_SANTE = $total_BILAN_DE_SANTE + $dep['BILAN DE SANTE']; $total_TOTAUX = $total_TOTAUX + $dep['TOTAUX']; } $pdf->SetFont('Arial','B',8); $pdf->SetFillColor(143,206,143); $pdf->Cell(62,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(15,$hl,format_N($total_CONSULTATION),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_IMAGERIE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_BIOLOGIE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_DENTISTERIE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_OPTIQUE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_HOSPITALISATION),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_PHARMACIE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_MATERNITE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_AUTRES_EXAMENS),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_AUXILIAIRES_MEDICAUX),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_ASSISTANCE),1,0,'C',true); $pdf->Cell(16,$hl,format_N($total_TRANSPORT_MEDICALISE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_BILAN_DE_SANTE),1,0,'C',true); $pdf->Cell(15,$hl,format_N($total_TOTAUX),1,1,'C',true); $pdf->Cell(45,$hl,convertirc(_("Légende")),0,0,'L',false); $pdf->Ln(8); $pdf->Cell(45,$hl,convertirc(_("Autres. = Autres Examens")),0,0,'L',false); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Aux Med. = Auxiliaire Médicaux")),0,0,'L',false); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Trans Med. = Transport Medicalisé")),0,0,'L',false); $pdf->Ln(5); $pdf->Cell(45,$hl,convertirc(_("Bilan. = Bilan de santé")),0,0,'L',false); $pdf->Ln(2); $pdf->AddPage(); $p_factures = $this->detailsp->etathopitalisationsparaffections($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(15); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("HOSPITALISATIONS PAR AFFECTIONS")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(10); $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(54,$hl,convertirc(_('Code Affection')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(26,$hl,convertirc(_("Quantité")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(20,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',10); $total_Quantite = $total_montantFacture = $total_apresDecompte = $total_Coutmoyen = $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(54,$hl,convertirc($dep['CodeAffection']),1,0,'C',false); $pdf->Cell(26,$hl,convertirc(format_N($dep['Quantite'])),1,0,'C',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(20,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_Quantite = $total_Quantite +$dep['Quantite']; $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Taux = $total_Taux +$dep['Taux']; } $total_Coutmoyen = $total_apresDecompte/$total_Quantite ; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(54,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(26,$hl,format_N($total_Quantite),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(20,$hl,convertirc('100 %'),1,1,'C',true); $pdf->AddPage();// debut ft14 $p_factures = $this->detailsp->etatdepensepartypeaffection($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit8.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("DÉPENSES PAR FAMILLE D'AFFECTION")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); //$pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(67,$hl,convertirc(_('Type d\'Affection')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(25,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',10); $total_montantFacture = 0; $total_apresDecompte = 0; $total_Coutmoyen = 0; $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(67,$hl,convertirc($dep['TypeAffection']),1,0,'L',false); $pdf->Cell(34,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(34,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(25,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen']; $total_Taux = $total_Taux +$dep['Taux']; } // $total_Quantite=count($p_factures) // $total_Coutmoyen = $total_Coutmoyen/$total_Quantite ; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(67,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(34,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(34,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(25,$hl,convertirc('100 %'),1,1,'C',true); $pdf->AddPage();// debut ft16 $p_factures = $this->detailsp->etatdepenseparaffection($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut, $p_datefin); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit5.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("DÉPENSES PAR AFFECTION")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').' : '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(8); $hl=7; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(67,$hl,convertirc(_('Affection')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(34,$hl,convertirc(_("Apres Décompte")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(30,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(25,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',10); $total_montantFacture = $total_apresDecompte = $total_Coutmoyen = $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(67,$hl,convertirc($dep['Affection']),1,0,'L',false); $pdf->Cell(34,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(34,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(30,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(25,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen']; $total_Taux = $total_Taux +$dep['Taux']; } // $total_Quantite=count($p_factures) // $total_Coutmoyen = $total_Coutmoyen/$total_Quantite ; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(67,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(34,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(34,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(30,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(25,$hl,convertirc('100 %'),1,1,'C',true); $pdf->AddPage();// debut ft 16 $p_factures = $this->detailsp->etatdepenseparpharmacie($p_garant, $p_id_clients, $p_id, $p_id_college, $p_datedebut,$p_datefin,$p_limite); $pdf->SetMargins(10, 10, 10) ; $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit8.jpg', 0, 0, 210); $pdf->SetY(30); $pdf->SetFont('Helvetica', 'B', 18); $pdf->SetTextColor( 65, 185, 80 ); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->MultiCell(150, 8, convertirc(_("DÉPENSES PAR PHARMACIE")), 0, 'L' ); $pdf->Ln(8); $pdf->SetFont('Helvetica', 'B', 11); $pdf->SetTextColor(0); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(50, 6, convertirc(_('PÉRIODE COMPTABLE CONSIDÉRÉE').': '.dateLang($debutStat, $_SESSION['lang']).' '._('AU').' '.dateLang($finStat, $_SESSION['lang'])), 0, 1, 'L', false); $pdf->Ln(10); if ($p_id!=null){ $pdf->SetFont('Helvetica', 'B', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['garant']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('SOUSCRIPTEUR').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['souscripteur']), 0, 1, 'L', false); //$pdf->Cell(0, 8, convertirc(_('SOUSCRIPTEUR').' : '.$entete['souscripteur']), 0, 1, 'L', false); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('POLICE No').': '), 0, 0, 'L', false); $pdf->MultiCell(115, 6, convertirc($entete['numeroPolice'].' / '.$entete['libellePolice']), 0, 'L'); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('COURTIER').': '), 0, 0, 'L', false); $pdf->Cell(0, 6, convertirc($entete['courtier']), 0, 1, 'L', false); // $pdf->Cell(0, 6, convertirc(_('COURTIER').' : '.$entete['courtier']), 0, 1, 'L', false); }else{ $pdf->Ln(10); $pdf->SetFont('Helvetica', 'BUI', 11); $pdf->Cell(5, 6, convertirc(''), 0, 0, 'L', false); $pdf->Cell(35, 6, convertirc(_('GARANT').': '), 0, 0, 'L', false); $pdf->SetFont('Helvetica', 'BI', 11); $pdf->Cell(0, 6, convertirc($p_garant), 0, 1, 'L', false); } $pdf->Ln(8); $pdf->SetX(20); $pdf->Cell(170,6,convertirc(_('DÉPENSES SUPÉRIEURES A').' : '.format_N($depenses).' '.$_SESSION['devise_C']),1,1,'C',false); $pdf->Ln(4); $hl=7; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_('Code')),1,0,'C',true); $pdf->Cell(76,$hl,convertirc(_('Prestataire')),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(28,$hl,convertirc(_("Montant Facture")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(28,$hl,convertirc(_("Montant Reglé")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(28,$hl,convertirc(_("Coût Moyen")),1,0,'C',true); $pdf->SetFillColor(143,206,143); $pdf->Cell(15,$hl,convertirc(_("Taux (%)")),1,1,'C',true); $pdf->SetFont('Arial','',9); $total_montantFacture = 0; $total_apresDecompte = 0; $total_Coutmoyen = 0; $total_Taux = 0; foreach ($p_factures as $dep) { $pdf->Cell(15,$hl,convertirc($dep['codeP']),1,0,'C',false); $pdf->Cell(76,$hl,convertirc(substr($dep['Prestataire'],0,38)),1,0,'L',false); $pdf->Cell(28,$hl,convertirc(format_N($dep['montantFacture'])),1,0,'R',false); $pdf->Cell(28,$hl,convertirc(format_N($dep['apresDecompte'])),1,0,'R',false); $pdf->Cell(28,$hl,convertirc(format_N($dep['Coutmoyen'])),1,0,'R',false); $pdf->Cell(15,$hl,convertirc($dep['Taux']),1,1,'C',false); $total_montantFacture = $total_montantFacture +$dep['montantFacture']; $total_apresDecompte = $total_apresDecompte +$dep['apresDecompte']; $total_Coutmoyen = $total_Coutmoyen +$dep['Coutmoyen']; $total_Taux = $total_Taux +$dep['Taux']; } // $total_Quantite=count($p_factures) // $total_Coutmoyen = $total_Coutmoyen/$total_Quantite ; $pdf->SetFont('Arial','B',10); $pdf->SetFillColor(143,206,143); $pdf->Cell(91,$hl,convertirc("TOTAL GENERAL"),"1",0,'C',true); $pdf->Cell(28,$hl,format_N($total_montantFacture),1,0,'C',true); $pdf->Cell(28,$hl,format_N($total_apresDecompte),1,0,'C',true); $pdf->Cell(28,$hl,format_N($total_Coutmoyen),1,0,'C',true); $pdf->Cell(15,$hl,convertirc("100 %"),1,1,'C',true); } $pdf->AddPage();// debut ft 16 G E $pdf->Image($_SESSION['dossierSociete'].'/Tarifs/Img/newkit9.jpg', 0, 0, 210); $fichier="Temp/TMP_KIT_STATISTIQUES"."_".uniqid().".pdf"; $pdf->Output($fichier,"F"); $end_time = microtime(true); $execution_time = $end_time - $start_time; echo "Le script a pris " . number_format(($execution_time * 0.0166667), 2) . " min pour s'exécuter."; $t_html ='
'; $t_html .=' '._("TELECHARGER").' '; $t_html .='