production/Controleur/ControleurAjaximprimerdemandereglement.php
2025-12-02 11:29:44 +00:00

602 lines
22 KiB
PHP
Executable File

<?php
require_once 'Framework/Controleurrequete.php'; // OK
require_once 'Modele/Reglement.php';
require_once 'Modele/Prestataire.php';
class ControleurAjaximprimerdemandereglement extends Controleurrequete
{
private $reglement;
private $prestataire;
public function __construct()
{
$this->reglement = new Reglement();
$this->prestataire = new Prestataire();
}
public function index()
{
$idReglement = $_SESSION['idReglement_C'];
$numeroDecompte = $_SESSION['numeroDecompte_C'];
$reglement = $this->reglement->getreglement($idReglement);
$pdf = new FPDF_Protection();
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=10;
$lg=60;
$pdf->SetMargins(10, 10, 10) ;
$pdf->SetFont('Arial','B', 15);
$pdf->SetY(20);
$pdf->Cell(0,10,convertirc($_SESSION['nomSociete'] ),1,1,'C',false);
$pdf->Ln(10);
$pdf->SetFont('Arial','BU', 15);
$pdf->SetFontSize(12);
$pdf->Cell(0,10,convertirc(_('DEMANDE DE REGLEMENT').' No '.$reglement['numeroDemandeReglement']),0,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("Prestataire")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(': '.$reglement['prestataire']),0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("PERIODE")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
if (est_anglophone())
{
$pdf->Cell(0,10,convertirc(': '.$reglement['periodeEng']),0,1,'L');
}
else
{
$pdf->Cell(0,10,convertirc(': '.$reglement['periode']),0,1,'L');
}
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("No Lot")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(': '.$reglement['numeroLotDecompte']),0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("Montant")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,": ".format_N($reglement['montantApayer'])." ".$_SESSION['devise_C'],0,1,'L');
$pdf->Cell(0,10, convetirEnLettre($reglement['montantApayer'], $_SESSION['lang'])." ".$_SESSION['devise_C'],1,1,'C');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('A VERSER AU COMPTE').' No'),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(': '.$reglement['numeroCompteBancaire'].' => '.$reglement['intituleCompteBancaire']),0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('SUR')),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(': '.$reglement['banque']),0,1,'L');
$pdf->Ln(10);
$pdf->Cell(0,10,convertirc(_('Fait à').' '.$_SESSION['villeSociete'].', le ').heureCouranteLang($_SESSION['lang']),0,1,'C',false);
$pdf->Ln(10);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("SERVICE DEMANDEUR")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(": .........................................."),0,1,'L');
$pdf->Ln(20);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc((isset($_SESSION['affichagedynamique']['VISA DIRECTION SANTE'])) ? _($_SESSION['affichagedynamique']['VISA DIRECTION SANTE']) : _("VISA DIRECTION SANTE")),0,0,'L',false);
$pdf->Cell(0,10,convertirc((isset($_SESSION['affichagedynamique']['VISA DAF'])) ? _($_SESSION['affichagedynamique']['VISA DAF']) : _("VISA DAF")),0,1,'R');
$pdf->Ln(30);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(_("Chèque").' / '._('OP')." No : _______________________________________"),0,1,'R');
$pdf->Cell(0,10,convertirc(_("Sur")." : _______________________________________"),0,1,'R');
$pdf->Cell(0,10,convertirc("Date : _______________________________________"),0,1,'R');
$fichier="Temp/TMP_demande_regelement"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
$t_html =' <div id ="div_wait" class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
$t_html .=' </div ';
echo $t_html;
}
public function imprimerbordereaudecompte()
{
$idReglement = $_SESSION['idReglement_C'];
$numeroDecompte = $_SESSION['numeroDecompte_C'];
$reglement = $this->reglement->getreglement($idReglement);
$codeTypePrestataire = $reglement['codeTypePrestataire'];
$codeProfil = $this->reglement->get_codeProfil($codeTypePrestataire);
$motifrejets = $this->reglement->getListeMotifDecompte($numeroDecompte);
$motifrejetsDecomptes = $this->reglement->getListeMotifDecompteDecompte($numeroDecompte);
if($codeProfil=="CSO" || $codeProfil=="DEN" || $codeProfil=="HRW" || $codeProfil=="HPC" || $codeProfil=="HPP" || $codeProfil=="POC" || $codeProfil=="CME")
{
$factures = $this->reglement->getdetaildecompteexportcso($numeroDecompte);
//highlight_string("<?php\n\$datas =\n" . var_export($factures , true) . ";\n>");
//die();
}
elseif($codeTypePrestataire=="PHA")
{
$factures = $this->reglement->getdetaildecompteexportpha($numeroDecompte);
}
elseif($codeTypePrestataire=="OPT")
{
$factures = $this->reglement->getdetaildecompteexportopt($numeroDecompte);
}
elseif($codeTypePrestataire=="LAB" || $codeTypePrestataire=="IMA")
{
$factures = $this->reglement->getdetaildecompteexportlab($numeroDecompte);
}
elseif($codeTypePrestataire=="SEA")
{
$factures = $this->reglement->getdetaildecompteexportsea($numeroDecompte);
}
else
{
$factures = $this->reglement->getdetaildecompteexportcso($numeroDecompte);
}
$pdf = new FPDF_Protection('L');
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=5;
$lg1=35;
$lg2=75;
$lg3=40;
$lg4=40;
$pdf->SetMargins(10, 10, 10) ;
// Logo
$pdf->Image($_SESSION['dossierLogo'],10,3,18);
//$pdf->Ln(50);
$pdf->SetFont('Arial','I',7);
//Numéro de page
$pdf->Cell(0,$ht,'Page '.$pdf->PageNo().'/{nb}',0,0,'C');
$pdf->SetFont('Arial','', 7);
$pdf->Cell(0,$ht,convertirc(_('Edité par le gestionnaire').' : '.heureCouranteLang($_SESSION['lang'])),0,1,'R',false);
//$pdf->Ln(3);
//$pdf->SetFont('Arial','BI', 7);
//$pdf->Cell(0,$ht,convertirc($_SESSION['nomSociete']),0,0,'L',false);
// Police Arial gras 15
$pdf->SetFont('Arial','B',15);
// Décalage à droite
$pdf->Cell(90);
$pdf->SetFillColor(245,245,245);
// Titre
$pdf->Cell(120,8,convertirc(_("BORDERAU POUR DECOMPTE") . " No ".$reglement['numeroDecompte']),1,0,'C',true);
$pdf->Ln(12);
$pdf->SetFont('Arial','BU', 10);
$pdf->Cell(0,$ht,convertirc(" Prestataire: ".$reglement['prestataire']),0,0,'C',false);
$pdf->Ln(8);
$pdf->SetFont('Arial','', 8);
if (est_anglophone())
{
$pdf->Cell(50,$ht,convertirc("Etat: ".$reglement['etatdecompteEng']),0,0,'L',false);
$pdf->Cell(85,$ht,convertirc(_("PERIODE")." : ".$reglement['periodeEng']),0,0,'C',false);
}
else
{
$pdf->Cell(50,$ht,convertirc("Etat: ".$reglement['etatdecompte']),0,0,'L',false);
$pdf->Cell(85,$ht,convertirc(_("PERIODE")." : ".$reglement['periode']),0,0,'C',false);
}
$pdf->Cell(85,$ht,convertirc(_('Vérificateur').' : '.$reglement['nomControleur']),0,0,'C',false);
$pdf->Cell(0,$ht,convertirc(_('Demande Rgt').' : '.$reglement['numeroDemandeReglement'].' => Lot : '.$reglement['numeroLotDecompte']),0,1,'R',false);
$pdf->SetFont('Arial','', 6);
$pdf->Cell(10,$ht,convertirc("No"),1,0,'C',false);
$pdf->Cell(5,$ht,convertirc("Jour"),1,0,'C',false);
$pdf->Cell(35,$ht,convertirc(_("Souscripteur")),1,0,'L',false);
$pdf->Cell(40,$ht,convertirc(_('Adhérent')),1,0,'C',false);
// $pdf->Cell(22,$ht,convertirc(_('Date de soins')),1,0,'C',false);
$pdf->Cell(20,$ht,convertirc(_('No Bénéf')),1,0,'C',false);
$pdf->Cell(45,$ht,convertirc(_("Bénéficiaire")),1,0,'L',false);
$pdf->Cell(15,$ht,convertirc(_('Bon')),1,0,'C',false);
$pdf->Cell(20,$ht,convertirc(_('Actes')),1,0,'C',false);
$pdf->Cell(15,$ht,convertirc(_('Frais')),1,0,'R',false);
$pdf->Cell(10,$ht,convertirc(_('T M')),1,0,'R',false);
$pdf->Cell(15,$ht,convertirc(_('A payer')),1,0,'R',false);
$pdf->Cell(15,$ht,convertirc(_('Rejeté')),1,0,'C',false);
$pdf->Cell(15,$ht,convertirc(_('Dépassement')),1,0,'C',false);
$pdf->Cell(15,$ht,convertirc(_('A rembourser')),1,1,'R',false);
$ordre = "0";
$fraisReel_acte_med = "0";
$fraisReel_phar_cons = "0";
$fraisReel = "0";
$prixManuel = "0";
$montantTm = "0";
$montantArembourser = "0";
$montantApayer = "0";
$montantRedresse = "0";
$montantRejete = "0";
$montantDepassemnt = "0";
foreach ($factures as $facture)
{
if ( $facture['fraisReel'] != '0' && ($facture['montantExclues'] == '0' /* || $facture['fraisExclu'] == '0' */)) {
$acte = $facture['acte'];
if (est_anglophone()){
$acte = $facture['acteEng'];
}
$ordre++;
$pdf->Cell(10,$ht,$ordre,1,0,'C',false);
$pdf->Cell(5,$ht,$facture['jourFacture'],1,0,'C',false);
$pdf->Cell(35,$ht,convertirc(substr($facture['souscripteur'], 0, 25)),1,0,'L',false);
// $pdf->Cell(40,$ht,convertirc(substr($facture['numeroAdherent'], 0, 30)),1,0,'C',false);
$pdf->Cell(40,$ht,convertirc(substr($facture['adherent'], 0, 30)),1,0,'L',false);
// $pdf->Cell(22,$ht,convertirc(substr(dateLang($facture['DateSoins'], $_SESSION['lang']), 0, 30)),1,0,'C',false);
$pdf->Cell(20,$ht,convertirc($facture['numeroBeneficiaire']),1,0,'C',false);
$pdf->Cell(45,$ht,convertirc(substr($facture['beneficiaire'], 0, 30)),1,0,'L',false);
$pdf->Cell(15,$ht,convertirc($facture['numeroBon']),1,0,'C',false);
// $pdf->Cell(10,$ht,convertirc(substr($acte,0,25)),1,0,'L',false);
$pdf->Cell(20,$ht,convertirc($facture['codeActe'] . " / ".$facture['codeTypePrestation']),1,0,'C',false);
if($codeTypePrestataire=="PHA"){
$pdf->Cell(15,$ht,format_N($facture['prixManuel']),1,0,'R',false);
}else{
$pdf->Cell(15,$ht,format_N($facture['fraisReel']),1,0,'R',false);
}
$pdf->Cell(10,$ht,format_N($facture['montantTm']),1,0,'R',false);
$pdf->Cell(15,$ht,format_N($facture['montantArembourser']),1,0,'R',false);
if ($facture['montantRedresse'] != 0 && $facture['montantRedresse']==$facture['montantRejete'] ) {
$pdf->Cell(15,$ht,convertirc('- '.format_N($facture['montantRedresse'])),1,0,'R',false);
}elseif ($facture['montantRedresse'] != 0 && $facture['montantRedresse']!=$facture['montantRejete'] ) {
$pdf->Cell(15,$ht,convertirc(format_N($facture['montantRedresse'])),1,0,'R',false);
}else{
$pdf->Cell(15,$ht,convertirc('0'),1,0,'R',false);
}
$pdf->Cell(15,$ht,format_N($facture['depassement']),1,0,'R',false);
$pdf->Cell(15,$ht,format_N($facture['montantApayer']),1,1,'R',false);
$fraisReel_acte_med += $facture['fraisReel_acte_med'];
$fraisReel_phar_cons += $facture['fraisReel_phar_cons'];
$montantTm += $facture['montantTm'];
$montantArembourser += $facture['montantArembourser'];
$montantApayer += $facture['montantApayer'];
$montantRedresse += $facture['montantRedresse'];
$montantDepassemnt += $facture['depassement'];
if($codeTypePrestataire=="PHA"){
$prixManuel += $facture['prixManuel'];
}else{
$fraisReel += $facture['fraisReel'];
}
}
}
$pdf->SetFont('Arial','B', 6);
$pdf->Cell(190,$ht,convertirc("TOTAL : "),1,0,'C',false);
if($codeTypePrestataire=="PHA"){
$pdf->Cell(15,$ht,format_N($prixManuel),1,0,'R',false);
}else{
$pdf->Cell(15,$ht,format_N($fraisReel),1,0,'R',false);
}
$pdf->Cell(10,$ht,format_N($montantTm),1,0,'R',false);
$pdf->Cell(15,$ht,format_N($montantArembourser),1,0,'R',false);
if ($montantRedresse > 0) { // permet l'affichage du signe negatif
$pdf->Cell(15,$ht,convertirc('-'.format_N($montantRedresse)),1,0,'R',false);
}elseif ($montantRedresse < 0) { //il sagit dun vrai rejet
$pdf->Cell(15,$ht,convertirc(format_N($montantRedresse)),1,0,'R',false);
}else{
$pdf->Cell(15,$ht,convertirc('0'),1,0,'R',false);
}
if ($montantDepassemnt != 0) {
$pdf->Cell(15,$ht,convertirc('- '.format_N($montantDepassemnt)),1,0,'R',false);
}else{
$pdf->Cell(15,$ht,convertirc('0'),1,0,'R',false);
}
$pdf->Cell(15,$ht,format_N($montantApayer),1,1,'R',false);
// $moyenne = $ordre $montantApayer
$pdf->Cell(260,$ht,convertirc(_("MOYENNE PAR MALADE")." : "),1,0,'C',false);
$pdf->Cell(15,$ht,format_N($reglement['MoyenneDecompte']),1,1,'R',false);
$pdf->SetFontSize(8);
$pdf->Cell(0,6,convertirc(_('Arrêté le présent décompte à la somme de').' : '),0,1,'C',false);
$pdf->SetFont('','I');
// $pdf->SetFillColor(245,245,245);
$pdf->SetFillColor(121, 248, 248); // bleu
$pdf->Cell(0,6, convetirEnLettre($montantApayer, $_SESSION['lang'])." ".$_SESSION['devise_C'],0,1,'C',true);
$pdf->SetFont('');
$i=0;
$bonoldobs="";
$bonold ="";
foreach ($factures as $facture)
{
//if ($facture['montantExclues'] == 0 && $facture['motifRejet'] != ' ') {
# code...
if ($bonold != $facture['numeroBon']){
$acte = $facture['acte'];
if (est_anglophone()){
$acte = $facture['acteEng'];
}
# code...
if(($facture['observations'] != '' && empty($motifrejets)) || (($facture['motifRejet'] != ' ' && $facture['montantExclues'] == 0 ) && !empty($motifrejets))){
$i = $i+1;
if ($i==1) {
$pdf->Ln(8);
$pdf->SetFillColor(245,245,245); // vert de vitalis
//$pdf->SetFont('Arial','B', 10);
$pdf->Cell(40,6,convertirc(_('Légende des exclusions').' : '),0,1,'C',true);
$pdf->Ln(2);
//$pdf->SetFont('Arial','B', 10);
$pdf->Cell(30,6,convertirc('Bon'),1,0,'C',false);
//$pdf->SetFont('Arial','B', 10);
$pdf->Cell(249,6,convertirc('Observations'),1,1,'C',false);
}
if (($facture['observations']) != '' && $facture['motifRejet'] == '' ) {
//$pdf ->MultiCell(30,6,convertirc($facture['numeroBon']), 'LRT', 'L', 0);
if ($bonoldobs != $facture['numeroBon']){
$pdf->Cell(30,6,convertirc($facture['numeroBon']),'LTR',0,'C',false);
}else{
$pdf->Cell(30,6,"",'LR',0,'C',false);
}
//$pdf->Cell(30,6,convertirc($facture['numeroBon']),1,0,'C',false);
$pdf->Cell(249,6,convertirc('- '.$facture['observations']),1,1,'L',false);
}
$bonoldmotif="";
foreach ($motifrejets as $motifrejet){
//highlight_string("<?php\n\$datas =\n" . var_export($motifrejet , true) . ";\n>");
//die();
// ajout de && $facture['montantTm']!=$facture['prixManuel'] marc pour ne pas afficher le motif en cas de depassement de plafond
if (isset($facture['motifRejet']) && $motifrejet['numeroBonConsultation'] == $facture['numeroBon'] && $motifrejet['montantExclues'] ==0) {
/* if ($facture['motifRejet'] == "Autres") {
# code...
} */
if ($bonoldmotif != $facture['numeroBon']){
$pdf->Cell(30,6,convertirc($motifrejet['numeroBonConsultation']),'LTR',0,'C',false);
}else{
$pdf->Cell(30,6,"",'LR',0,'C',false);
}
if ($motifrejet['codeMotifRejet'] == "Autres") {
$pdf->Cell(249,6,convertirc('- '.$motifrejet['motifManuel']),1,1,'L',false);
}else{
if (!empty($motifrejet['motifManuel']) ) {
$pdf->Cell(249,6,convertirc('- '.$motifrejet['codeMotifRejet'].' => '.$motifrejet['motifManuel']),1,1,'L',false);
}else{
$pdf->Cell(249,6,convertirc('- '.$motifrejet['codeMotifRejet']),1,1,'L',false);
}
}
$bonoldmotif= $motifrejet['numeroBonConsultation'];
}
}
$pdf->Cell(279,0,"",1,1,'C',false);
}
}
$bonold = $facture['numeroBon'];
}
foreach ($motifrejetsDecomptes as $motifrejetsDecompte){
$pdf->Cell(30,6,"",'LR',0,'C',false);
if ($motifrejetsDecompte['codeMotifRejet'] == "Autres") {
$pdf->Cell(249,6,convertirc('- '.$motifrejetsDecompte['motifManuel']),1,1,'L',false);
}else{
if (!empty($motifrejetsDecompte['motifManuel']) ) {
$pdf->Cell(249,6,convertirc('- '.$motifrejetsDecompte['codeMotifRejet'].' => '.$motifrejetsDecompte['motifManuel']),1,1,'L',false);
}else{
$pdf->Cell(249,6,convertirc('- '.$motifrejetsDecompte['codeMotifRejet']),1,1,'L',false);
}
}
}
// $pdf->Cell(279,0,"",1,0,'C',false);
// $pdf->SetY(-70);
$pdf->Ln(4);
$pdf->Cell(0,6,convertirc(_('Fait à').' '.$_SESSION['villeSociete'].', le ').date('d/m/Y'),0,1,'C',false);
//$pdf->Ln(2);
$pdf->SetFont('','BU');
$pdf->Cell(0,6,convertirc(_('Pour').' '.$_SESSION['nomSociete']),0,0,'C',false);
$fichier="Temp/TMP_borderau_decompte"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
$t_html =' <div id ="div_wait" class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
$t_html .=' </div ';
//highlight_string("<?php\n\$datas =\n" . var_export($factures , true) . ";\n>");
echo $t_html;
}
public function majcomptebancaire()
{
$codePrestataire = $this->requete->getParametreFormulaire("codePrestataire");
$codeBanque = $this->requete->getParametreFormulaire("codeBanque");
$codeBanqueInterne = $this->requete->getParametreFormulaire("codeBanqueInterne");
$codeGuichet = $this->requete->getParametreFormulaire("codeGuichet");
$numeroCompteBancaire = $this->requete->getParametreFormulaire("numeroCompteBancaire");
$cleRib = $this->requete->getParametreFormulaire("cleRib");
$iban = $this->requete->getParametreFormulaire("iban");
$intituleCompteBancaire = $this->requete->getParametreFormulaire("intituleCompteBancaire");
$this->prestataire->majcomptebancaire($codePrestataire, $codeBanque, $codeBanqueInterne, $codeGuichet, $numeroCompteBancaire, $cleRib, $iban, $intituleCompteBancaire);
}
public function imprimerdecompteprestataireaccord()
{
$idReglement = $_SESSION['idReglement_C'];
$numeroDecompte = $_SESSION['numeroDecompte_C'];
//highlight_string("<?php\n\$datas =\n" . var_export($factures , true) . ";\n>");
//die();
$reglement = $this->reglement->getreglement($idReglement);
$pdf = new FPDF_Protection();
$pdf->SetAuthor('EBENE SOLUTIONS INFORMATIQUES');
$userPassword = '';
$ownerPassword = null;
$pdf->SetProtection(['print'], $userPassword, $ownerPassword);
$pdf->AliasNbPages();
$pdf->AddPage();
$ht=10;
$lg=60;
$pdf->SetMargins(10, 10, 10) ;
$pdf->SetFont('Arial','B', 15);
$pdf->SetY(25);
$pdf->Cell(0,10,convertirc($_SESSION['nomSociete'] ),1,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','BU', 15);
$pdf->SetFontSize(12);
$pdf->Cell(0,10,convertirc(_('DECOMPTE DE REGLEMENT')),0,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_("Prestataire")),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,convertirc(': '.$reglement['prestataire']),0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('PERIODE')),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
if (est_anglophone())
{
$pdf->Cell(0,10,convertirc(': '.$reglement['periodeEng']),0,1,'L');
}
else
{
$pdf->Cell(0,10,convertirc(': '.$reglement['periode']),0,1,'L');
}
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('MONTANT FACTURE')),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,": ".format_N($reglement['montantPrestataire'])." ".$_SESSION['devise_C'],0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('MONTANT A PAYER')),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,": ".format_N($reglement['montantApayer'])." ".$_SESSION['devise_C'],0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc("DIFFERENCES"),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,": ".format_N($reglement['difference'])." ".$_SESSION['devise_C'],0,1,'L');
$pdf->SetFont('Arial','B', 11);
$pdf->Cell($lg,10,convertirc(_('MONTANT PAYE')),0,0,'L',false);
$pdf->SetFont('Arial','I',11);
$pdf->Cell(0,10,": ".format_N($reglement['montantPaye'])." ".$_SESSION['devise_C'],0,1,'L');
$pdf->Ln(5);
$pdf->Cell(0,10,convertirc(_('Date apprrobation')).' : '.dateheureFr($reglement['heureValidationDecompte']).' '._('par').' '.$reglement['userValidationDecompte'],0,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell(0,10,convertirc(_('Fait à')).' '.$_SESSION['villeSociete'].', '._('le').' '.heureCouranteLang($_SESSION['lang']),0,1,'C',false);
$pdf->Ln(5);
$pdf->SetFont('Arial','B', 11);
$pdf->Cell(0,10,convertirc(_('Accord du Prestataire')),0,1,'C');
$fichier="Temp/TMP_ACCORD_PREST_DECOMPTE"."_".uniqid().".pdf";
$pdf->Output($fichier,"F");
$t_html =' <div id ="div_wait" class="alert alert-info"> ';
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
$t_html .=' </div ';
echo $t_html;
}
}