388 lines
14 KiB
PHP
388 lines
14 KiB
PHP
<?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();
|
|
$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'];
|
|
|
|
if($codeTypePrestataire=="CSO")
|
|
{
|
|
$factures = $this->reglement->getdetaildecompteexportcso($numeroDecompte);
|
|
}
|
|
elseif($codeTypePrestataire=="PHA")
|
|
{
|
|
$factures = $this->reglement->getdetaildecompteexportpha($numeroDecompte);
|
|
}
|
|
elseif($codeTypePrestataire=="OPT")
|
|
{
|
|
$factures = $this->reglement->getdetaildecompteexportopt($numeroDecompte);
|
|
}
|
|
elseif($codeTypePrestataire=="LAB")
|
|
{
|
|
$factures = $this->reglement->getdetaildecompteexportlab($numeroDecompte);
|
|
}
|
|
elseif($codeTypePrestataire=="SEA")
|
|
{
|
|
$factures = $this->reglement->getdetaildecompteexportsea($numeroDecompte);
|
|
}
|
|
|
|
$pdf = new FPDF('L');
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$ht=4;
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
|
|
$pdf->SetFont('Arial','BI', 7);
|
|
|
|
$pdf->Cell(0,$ht,convertirc($_SESSION['nomSociete']),0,0,'L',false);
|
|
$pdf->Cell(0,$ht,convertirc(_("BORDERAU POUR DECOMPTE")." No ".$reglement['numeroDecompte']." => "._("PRESTATAIRE")." ".$reglement['prestataire']),0,1,'R',false);
|
|
|
|
$pdf->SetFont('Arial','', 7);
|
|
|
|
$pdf->Cell(65,$ht,convertirc(_('Edité par l\'assureur le').' : '.heureCouranteLang($_SESSION['lang'])),0,0,'L',false);
|
|
|
|
$pdf->Cell(50,$ht,convertirc(_('Vérificateur').' : '.$reglement['nomControleur']),0,0,'C',false);
|
|
|
|
if (est_anglophone())
|
|
{
|
|
$pdf->Cell(50,$ht,convertirc($reglement['etatdecompteEng']),0,0,'C',false);
|
|
$pdf->Cell(55,$ht,convertirc(_("PERIODE")." : ".$reglement['periodeEng']),0,0,'C',false);
|
|
}
|
|
else
|
|
{
|
|
$pdf->Cell(50,$ht,convertirc($reglement['etatdecompte']),0,0,'C',false);
|
|
$pdf->Cell(55,$ht,convertirc(_("PERIODE")." : ".$reglement['periode']),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(7,$ht,convertirc("No"),1,0,'C',false);
|
|
$pdf->Cell(7,$ht,convertirc("Dt"),1,0,'C',false);
|
|
$pdf->Cell(14,$ht,convertirc(_('Police')),1,0,'C',false);
|
|
$pdf->Cell(36,$ht,convertirc(_("Souscripteur")),1,0,'L',false);
|
|
$pdf->Cell(44,$ht,convertirc(_('Adhérent')),1,0,'L',false);
|
|
$pdf->Cell(14,$ht,convertirc(_('No Bénéf')),1,0,'C',false);
|
|
$pdf->Cell(44,$ht,convertirc(_("Bénéficiaire")),1,0,'L',false);
|
|
$pdf->Cell(14,$ht,convertirc(_('Bon')),1,0,'C',false);
|
|
$pdf->Cell(17,$ht,convertirc(_('Actes')),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,convertirc(_('Autres')),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,convertirc(_('Frais')),1,0,'R',false);
|
|
$pdf->Cell(12,$ht,convertirc(_('T M')),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,convertirc(_('A payer')),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,convertirc(_('Retenu')),1,1,'R',false);
|
|
|
|
$ordre = "0";
|
|
$fraisReel_acte_med = "0";
|
|
$fraisReel_phar_cons = "0";
|
|
$fraisReel = "0";
|
|
$montantTm = "0";
|
|
$montantArembourser = "0";
|
|
$montantApayer = "0";
|
|
|
|
foreach ($factures as $facture)
|
|
{
|
|
$ordre++;
|
|
$pdf->Cell(7,$ht,$ordre,1,0,'C',false);
|
|
$pdf->Cell(7,$ht,$facture['jourFacture'],1,0,'C',false);
|
|
$pdf->Cell(14,$ht,convertirc($facture['numeroPolice']),1,0,'C',false);
|
|
$pdf->Cell(36,$ht,convertirc(substr($facture['souscripteur'], 0, 25)),1,0,'L',false);
|
|
$pdf->Cell(44,$ht,substr($facture['adherent'], 0, 30),1,0,'L',false);
|
|
$pdf->Cell(14,$ht,convertirc($facture['numeroBeneficiaire']),1,0,'C',false);
|
|
$pdf->Cell(44,$ht,substr($facture['beneficiaire'], 0, 30),1,0,'L',false);
|
|
$pdf->Cell(14,$ht,convertirc($facture['numeroBon']),1,0,'C',false);
|
|
$pdf->Cell(17,$ht,format_N($facture['fraisReel_acte_med']),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($facture['fraisReel_phar_cons']),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($facture['fraisReel']),1,0,'R',false);
|
|
$pdf->Cell(12,$ht,format_N($facture['montantTm']),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($facture['montantArembourser']),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($facture['montantApayer']),1,1,'R',false);
|
|
|
|
$fraisReel_acte_med += $facture['fraisReel_acte_med'];
|
|
$fraisReel_phar_cons += $facture['fraisReel_phar_cons'];
|
|
$fraisReel += $facture['fraisReel'];
|
|
$montantTm += $facture['montantTm'];
|
|
$montantArembourser += $facture['montantArembourser'];
|
|
$montantApayer += $facture['montantApayer'];
|
|
}
|
|
|
|
$pdf->SetFont('Arial','B', 6);
|
|
|
|
$pdf->Cell(180,$ht,convertirc("TOTAL : "),1,0,'C',false);
|
|
|
|
$pdf->Cell(17,$ht,format_N($fraisReel_acte_med),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($fraisReel_phar_cons),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($fraisReel),1,0,'R',false);
|
|
$pdf->Cell(12,$ht,format_N($montantTm),1,0,'R',false);
|
|
$pdf->Cell(17,$ht,format_N($montantArembourser),1,0,'R',false);
|
|
$pdf->Cell(17,$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(17,$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(135,206,250); // bleu
|
|
|
|
$pdf->Cell(0,6, convetirEnLettre($montantApayer, $_SESSION['lang'])." ".$_SESSION['devise_C'],0,1,'C',true);
|
|
$pdf->SetFont('');
|
|
|
|
// $pdf->SetY(-70);
|
|
|
|
$pdf->Cell(0,6,convertirc(_('Fait à').' '.$_SESSION['villeSociete'].', le ').date('d/m/Y'),0,1,'C',false);
|
|
|
|
$pdf->Ln(10);
|
|
$pdf->SetFont('','U');
|
|
$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 ';
|
|
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'];
|
|
|
|
$reglement = $this->reglement->getreglement($idReglement);
|
|
|
|
$pdf = new FPDF();
|
|
$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;
|
|
|
|
}
|
|
} |