196 lines
7.1 KiB
PHP
196 lines
7.1 KiB
PHP
<?php
|
|
require_once 'Framework/Controleurrequete.php'; // OK
|
|
require_once 'Modele/Gestionconfiee.php';
|
|
|
|
class ControleurAjaxdetailtousgcpdf extends Controleur
|
|
{
|
|
private $facture;
|
|
|
|
public function __construct() {
|
|
$this->facture = new Gestionconfiee();
|
|
}
|
|
|
|
public function index()
|
|
{
|
|
$idGcReglement = $_SESSION['idGcReglement'];
|
|
|
|
$reglement = $this->facture->getgcreglement($idGcReglement);
|
|
|
|
$gcs = $this->facture->get_factures_gc_sel();
|
|
|
|
$cartes = $this->facture->get_cartes_gc_sel();
|
|
|
|
$valide0 = $reglement['valide0'];
|
|
$valideAs = $reglement['valideAs'];
|
|
$valide = $reglement['valide'];
|
|
$regle = $reglement['regle'];
|
|
|
|
$pdf = new FPDF();
|
|
|
|
$pdf->AliasNbPages();
|
|
$pdf->AddPage();
|
|
|
|
$pdf->SetMargins(10, 10, 10) ;
|
|
$pdf->SetFont('Arial','BU',10);
|
|
|
|
// $pdf->AliasNbPages();
|
|
$pdf->Cell(0,6,convertirc(_("DETAIL DES SINISTRES DE LA FACTURATION")),0,1,'C',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$pdf->SetFont('Arial','B',6);
|
|
|
|
$pdf->Cell(12,5,convertirc(_("Assureur")),0,0,'L',false);
|
|
$pdf->Cell(18,5,convertirc(': '.$reglement['gcassureur']),0,0,'L',false);
|
|
|
|
$pdf->Cell(8,5,convertirc('Date'),0,0,'L',false);
|
|
$pdf->Cell(25,5,convertirc(': '.dateFr($reglement['dateSysteme'])),0,0,'L',false);
|
|
|
|
$pdf->Cell(14,5,convertirc(_("1ère Valid")),0,0,'L',false);
|
|
if($valide0=="1")
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Oui")),0,0,'L',false);
|
|
}else
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Non")),0,0,'L',false);
|
|
}
|
|
|
|
$pdf->Cell(14,5,convertirc(_("Valid Ass")),0,0,'L',false);
|
|
if($valideAs=="1")
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Oui")),0,0,'L',false);
|
|
}else
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Non")),0,0,'L',false);
|
|
}
|
|
|
|
$pdf->Cell(14,5,convertirc(_("2ème Valid")),0,0,'L',false);
|
|
if($valide=="1")
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Oui")),0,0,'L',false);
|
|
}else
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Non")),0,0,'L',false);
|
|
}
|
|
|
|
$pdf->Cell(10,5,convertirc(_("Encais")),0,0,'L',false);
|
|
if($regle=="1")
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Oui")),0,1,'L',false);
|
|
}else
|
|
{
|
|
$pdf->Cell(18,5,convertirc(_(": Non")),0,1,'L',false);
|
|
}
|
|
|
|
$pdf->Cell(12,5,convertirc('Observ'),0,0,'L',false);
|
|
$pdf->Cell(25,5,convertirc(': '.$reglement['observations']),0,0,'L',false);
|
|
$pdf->Cell(0,5,'Edition : '.heureCouranteLang($_SESSION['lang']),0,1,'R',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$hl=5;
|
|
|
|
$pdf->SetFont('Arial','B',5);
|
|
|
|
$pdf->Cell(12,$hl,convertirc("Date"),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc(_("Facture")),"1",0,'C');
|
|
$pdf->Cell(33,$hl,convertirc(_("Prestataire")),"1",0,'C');
|
|
$pdf->Cell(45,$hl,convertirc(_("Souscripteur")),"1",0,'C');
|
|
$pdf->Cell(13,$hl,convertirc(_("No Bénéf")),"1",0,'C');
|
|
$pdf->Cell(35,$hl,convertirc(_("Bénéficiaire")),"1",0,'C');
|
|
$pdf->Cell(14,$hl,convertirc(_("Frais")),"1",0,'C');
|
|
$pdf->Cell(12,$hl,convertirc(_("Redres")),"1",0,'C');
|
|
$pdf->Cell(14,$hl,convertirc(_("A payer")),"1",1,'C');
|
|
|
|
$pdf->SetFont('Arial','I',5);
|
|
foreach ($gcs as $gc)
|
|
{
|
|
$pdf->Cell(12,$hl,dateFr($gc['dateFacture']),"1",0,'C');
|
|
$pdf->Cell(10,$hl,convertirc($gc['idFacture']),"1",0,'C');
|
|
$pdf->Cell(33,$hl,convertirc($gc['prestataire']),"1",0,'L');
|
|
$pdf->Cell(45,$hl,convertirc(substr($gc['souscripteur'], 0, 45)),"1",0,'L');
|
|
$pdf->Cell(13,$hl,convertirc($gc['numeroBeneficiaire']),"1",0,'C');
|
|
$pdf->Cell(35,$hl,convertirc($gc['beneficiaire']),"1",0,'L');
|
|
$pdf->Cell(14,$hl,format_N($gc['montantFacture']),"1",0,'C');
|
|
$pdf->Cell(12,$hl,format_N($gc['montantRedresse']),"1",0,'C');
|
|
$pdf->Cell(14,$hl,format_N($gc['montantApayer']),"1",1,'C');
|
|
}
|
|
$pdf->SetFont('Arial','BI',6);
|
|
|
|
$pdf->Cell(148,$hl,convertirc(_('TOTAL SINISTRES')),"1",0,'C');
|
|
$pdf->Cell(14,$hl,format_N($reglement['montantFacture']),"1",0,'C');
|
|
$pdf->Cell(12,$hl,format_N($reglement['montantRedresse']),"1",0,'C');
|
|
$pdf->Cell(14,$hl,format_N($reglement['montantApayer']),1,1,'C');
|
|
|
|
$pdf->Cell(60,$hl,'Nb Factures : '.format_N($reglement['nbFacture']),"1",0,'C');
|
|
$pdf->Cell(63,$hl,'Frais de Gestion : '.format_N($reglement['commissionFacture']),"1",0,'C');
|
|
$pdf->Cell(65,$hl,'Frais Redressement : '.format_N($reglement['commissionRedresse']),1,1,'C');
|
|
|
|
// FIN FACYURE
|
|
$pdf->AddPage();
|
|
|
|
$pdf->Cell(0,6,convertirc(_("DETAIL DES CARTES DE LA FACTURATION")),0,1,'C',false);
|
|
|
|
$pdf->Ln(2);
|
|
|
|
$hl=5;
|
|
|
|
$pdf->SetFont('Arial','B',5);
|
|
|
|
$pdf->Cell(20,$hl,convertirc("Date"),"1",0,'C');
|
|
$pdf->Cell(60,$hl,convertirc(_("Souscripteur")),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_("No Bénéf")),"1",0,'C');
|
|
$pdf->Cell(60,$hl,convertirc(_("Bénéficiaire")),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_("Carte")),"1",1,'C');
|
|
|
|
$pdf->SetFont('Arial','I',5);
|
|
foreach ($cartes as $gc)
|
|
{
|
|
$pdf->Cell(20,$hl,dateFr($gc['dateCarte']),"1",0,'C');
|
|
$pdf->Cell(60,$hl,convertirc($gc['souscripteur']),"1",0,'L');
|
|
$pdf->Cell(20,$hl,convertirc($gc['numeroBeneficiaire']),"1",0,'C');
|
|
$pdf->Cell(60,$hl,convertirc($gc['beneficiaire']),"1",0,'L');
|
|
$pdf->Cell(20,$hl,format_N($gc['montantCarte']),"1",1,'C');
|
|
}
|
|
$pdf->SetFont('Arial','BI',6);
|
|
|
|
$pdf->Cell(160,$hl,convertirc(_('TOTAL CARTES')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['montantCarte']),1,1,'C');
|
|
|
|
$pdf->Cell(60,$hl,'Nb Cartes : '.format_N($reglement['nbCarte']),"1",0,'C');
|
|
$pdf->Cell(60,$hl,'H T : '.format_N($reglement['htCarte']),"1",0,'C');
|
|
$pdf->Cell(60,$hl,'TVA : '.format_N($reglement['tvaCarte']),1,1,'C');
|
|
// FIN CARTES
|
|
|
|
$pdf->Cell(0,6,convertirc(_('RECAPITULATIF')),0,1,'C',false);
|
|
$pdf->Cell(15,$hl,convertirc(_('Nb Fact')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_('Sinistres')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_('Frais Gest')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_('Redressé')),"1",0,'C');
|
|
$pdf->Cell(15,$hl,convertirc(_('Com Redr')),"1",0,'C');
|
|
$pdf->Cell(15,$hl,convertirc(_('Nb Cart')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_('Val Carte')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc(_('HT')),"1",0,'C');
|
|
$pdf->Cell(15,$hl,convertirc(_('TVA')),"1",0,'C');
|
|
$pdf->Cell(20,$hl,convertirc("Total"),"1",1,'C');
|
|
|
|
$pdf->Cell(15,$hl,format_N($reglement['nbFacture']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['montantFacture']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['commissionFacture']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['montantRedresse']),"1",0,'C');
|
|
$pdf->Cell(15,$hl,format_N($reglement['commissionRedresse']),"1",0,'C');
|
|
$pdf->Cell(15,$hl,format_N($reglement['nbCarte']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['montantCarte']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['htCarte']),"1",0,'C');
|
|
$pdf->Cell(15,$hl,format_N($reglement['tvaCarte']),"1",0,'C');
|
|
$pdf->Cell(20,$hl,format_N($reglement['montantDu']),"1",1,'C');
|
|
|
|
$fichier="Temp/TMP_DETAIL_FACT_CART_GC"."_".uniqid().".pdf";
|
|
$pdf->Output($fichier,"F");
|
|
|
|
$t_html =' <div id ="div_export_b" class="alert alert-info"> ';
|
|
$t_html .=' <a style="font-size:15pt;" href="'.$fichier.'" target="_blank" > '._("TELECHARGER").' </a> ';
|
|
$t_html .=' </div ';
|
|
echo $t_html;
|
|
}
|
|
} |