|
Server IP : 10.128.40.6 / Your IP : 216.73.216.111 Web Server : Apache System : Linux webd006.cluster128.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : logmcpe ( 111175) PHP Version : 7.3.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0705) : /home/logmcpe/MC/../www/mcg/plugins/jszip/../../.github/../sms/../pages/code/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
// ini_set('display_errors','on');
// error_reporting(E_ALL);
include 'config_tmcpro.php' ;
include 'stable_functions_tmcpro.php' ;
include 'fpdf/fpdf.php' ;
include 'fpdi/fpdi.php' ;
define('CELL_HEIGHT', .6) ;
define('LEFT_MARGIN', 1) ;
define('TVA', 0.833);
define('START_PAGES', -1) ;
define('TAILLE_PRESTA', 9) ;
define('START_TABLEAU', 8) ;
define('TAILLE_TOTAL_HT', 5) ;
define('TAILLE_TOTAL_TTC', 5) ;
define('TAILLE_DATE', 4.5) ;
define('TAILLE_NUM', 5.5) ;
define('START_NUM', 6) ;
define('POS_NUM', 3) ;
define('CELL_HEIGHT', .6) ;
define('LEFT_MARGIN', 1) ;
define('LIGNES_PAR_PAGE', 20) ;
define('TAILLE_FACT_IMPAYE', 12) ;
define('START_IMPAYE', 6) ;
define('TAILLE_NBH', 2.5) ;
define('START_PAGES', -1) ;
define('TAILLE_PRESTA', 9.2) ;
define('TAILLE_PRIX_IMPAYE', 7) ;
define('START_RELANCE', 29) ;
define('POS_RELANCE', 0) ;
define('TAILLE_RELANCE', 3.5) ;
define('START_TABLEAU', 8) ;
define('TAILLE_TAUX', 2.1) ;
define('TAILLE_TOTAL_HT', 2.5) ;
define('TAILLE_TOTAL_TTC', 2.7) ;
define('TAILLE_FIN_TOTAL_HT', 2.5) ;
define('TAILLE_FIN_TOTAL_TTC', 2.5) ;
define('TAILLE_FIN_ACCOMPTE', 2.5) ;
define('TAILLE_FIN_TVA', 2.5) ;
define('TAILLE_FIN_NET', 3.5) ;
define('TAILLE_FIN_PAYE', 2.5) ;
define('TAILLE_FIN_RESTE', 3) ;
define('START_FIN', 2.5) ;
define('POS_TALON', 15) ;
define('TAILLE_DATE', 4.5) ;
define('TAILLE_PAIEMENT', 4.5) ;
define('TAILLE_ECHEANCE', 4.5) ;
define('TAILLE_PERIODE', 6) ;
define('TAILLE_CUMULS', 7) ;
define('TAILLE_INTER', 5) ;
define('POS_FACT_IMPAYE', 1) ;
define('POS_PRIX_IMPAYE', POS_FACT_IMPAYE+TAILLE_FACT_IMPAYE) ;
class avoir extends FPDI
{
public function avoir($id, $relance = false, $attdata='', $f_format = "n", $prev=false, $cumul=false)
{
global $agence, $tplidx;
list($montant, $num, $date, $numfact, $date_fact, $client_id,$desc , $id_factt) = array(1,2,3,1,2,3,1,2);
// list($montant, $num, $date, $numfact, $date_fact, $client_id,$desc , $id_factt) = dbi_fetch_row(dbi_query("SELECT a.montant, a.num_avoir, a.date, num_fact, date_fact, client_id, des, fact_id FROM ".TABLE_AVOIR." a LEFT JOIN ".TABLE_FACT." f USING (fact_id) WHERE avoir_id = $id")) ;
// $client = dbi_fetch_row(dbi_query("SELECT client_genre genre, client_nom nom, client_pnom prenom, concat_ws('\n', if(client_adr1 = '', NULL, client_adr1), if(client_adr2 = '', NULL, client_adr2), if(client_adr3 = '', NULL, client_adr3)) adresse, client_cp cp, client_ville ville, client_reglement reglement FROM ".TABLE_CLIENT." where client_id=$client_id AND agence_id = $agence")) ;
list($date_fact, $numfact) = array(1,2);
if ($date_fact>20140101 )
{
$montantHT = $montant / 1.2 ;
}
else
{
$montantHT = $montant / 1.196 ;
}
$this->textf=$textf;
$this->FPDF('P', 'cm');
// $pagecount = $this->setSourceFile('entetes/agence-'.$agence.'.pdf');
// $tplidx = $this->importPage(1, '/TrimBox');
$this->SetTextColor(0) ;
$this->break = $this->inHeader = false ;
$this->AliasNbPages();
// $client = sprintf("%s %s %s\n%s\n%s %s", $client['genre'], strtoupper($client['nom']), ucwords(strtolower($client['prenom'])), $client['adresse'], $client['cp'], $client['ville']) ;
// $cname = sprintf("%s %s %s", $client['genre'], strtoupper($client['nom']), ucwords(strtolower($client['prenom']))) ;
// $this->factures = $factures ;
// k
$this->Open() ;
$this->SetFont('ARIAL', '', 12) ;
$this->AddPage();
// $this->useTemplate($tplidx, 0, 0, 21);
$this->SetAutoPageBreak(true, 4) ;
$this->SetMargins(LEFT_MARGIN, 1) ;
$this->SetAutoPageBreak(false) ;
$this->SetXY(11,6) ;
$this->MultiCell(0,CELL_HEIGHT,'') ;
$y = $this->GetY() ;
$this->SetY(1) ;
$this->SetFont('ARIAL', '', 10) ;
$this->SetXY(14, 2) ;
$this->SetFont('', 'B', 20) ;
$this->SetTextColor(8, 155, 217);
$this->Cell(TAILLE_NUM, CELL_HEIGHT*2, 'Avoir', 0, 0, 'C') ;
$this->Ln();
$this->SetTextColor(0, 0, 0);
$this->SetFont('', 'B',13 ) ;
$this->SetXY(13, 3) ;
$this->SetXY(13, 3) ;
$this->Cell(TAILLE_NUM, CELL_HEIGHT*2, "Num�ro AV000$num", 0, 0, 'C') ;
$this->Cell(TAILLE_NUM, CELL_HEIGHT, '', 0, 1) ;
$this->Ln();
$this->Ln();
$this->SetY(max($y, $this->GetY())) ;
$this->SetFont('', '', 12) ;
$this->SetAutoPageBreak(true, 4) ;
$this->SetX(0.3) ;
$this->SetFont('', 'B') ;
$date = int2date($date) ;
$this->Cell(TAILLE_DATE, CELL_HEIGHT, "Date : $date ", 0, 0, 'C') ;
$this->SetFont('', '') ;
$this->SetX(1) ;
$this->Ln();
$this->Ln();
$this->Ln();
$this->SetFont('', 'B') ;
$this->SetFillColor(8, 155, 217) ;
$this->SetTextColor(255, 255, 255);
$this->SetDrawColor(8, 155, 217);
$this->SetFont('ARIAL', '', 10) ;
$this->Cell(8, 1, 'Description', 0, 0, 'C',true) ;
$this->Cell(3, 1, "PU HT", 0, 0, 'C',1) ;
$this->Cell(3, 1, "Montant HT", 0, 0, 'C',1) ;
$this->Cell(3, 1, "TVA", 0, 1, 'C',1) ;
$this->SetFont('') ;
$this->SetTextColor(0);
$this->SetFont('ARIAL', '', 10) ;
$date_fact = int2date($date_fact) ;
if(empty($desc))
{
$this->setXY(3.4,12.5) ;
}
else
{
$this->setXY(3.4,11) ;;
}
// exit() ;
$this->Cell(3, 1, " Transf�r� de Facture n�FA$numfact du $date_fact", 0, 0, 'C') ;
$this->setXY(1,12) ;
$this->SetFont('ARIAL', '', 10) ;
$this->MultiCell(8,0.7, "$desc", 0) ;
$this->ln() ;
$this->setXY(9,10.5) ;
$this->Cell(3, 5, number_format($montantHT , 2, ',', ' '), 1, 0, 'C') ;
$this->Cell(3, 5, number_format($montantHT , 2, ',', ' '), 1, 0, 'C') ;
$this->Cell(3, 5, "20,00", 1, 1, 'C') ;
$this->setXY(1,10.5) ;
$this->Cell(8, 5, " ", 1, 0, 'C') ;
// �----------------------------------------------------------------------------------------------------------------------------------------
// if($this->state==3)
// return;
// if($this->page==0) {
// $this->AddPage();
// $this->useTemplate($tplidx, 0, 0, 21);
// } else
// {
//Page footer
$this->InFooter=true;
$this->Footer();
$this->InFooter=false;
// }
//////////////////////////////////////////////////////////////////////////
// factures � payer
$x = $this->GetX() ;
$this->SetX($x);
$this->SetAutoPageBreak(true, 3) ;
$this->SetFont('', 'B') ;
// $this->Ln();
$this->Ln();
$this->SetFillColor(8, 155, 217) ;
$this->SetTextColor(255, 255, 255);
$this->SetX(1) ;
$this->SetY(19) ;
$this->SetFillColor(8, 155, 217) ;
$this->SetTextColor(255, 255, 255);
// $this->SetFont('', '','10') ;
$this->SetFont('ARIAL', '', 10) ;
$this->Cell(2, 1, 'Taux', 0, 0, 'C',1) ;
$this->Cell(2, 1, 'Base', 0, 0, 'C',1) ;
$this->Cell(2, 1, 'Montant', 0, 0, 'C',1) ;
$this->ln();
$this->Cell(2, 1, '20,00', 0, 0, 'C',1) ;
$this->Cell(2, 1, "-".number_format($montantHT, 2, ',', ' '), 0, 0, 'C',1) ;
$this->Cell(2, 1, number_format( $montantHT - $montant, 2, ',', ' '), 0, 0, 'C',1) ;
// $this->SetFont('') ;
// $this->SetTextColor(0) ;
$this->SetY(19) ;
$this->SetX(13.5) ;
$this->SetFont('ARIAL', '', 10) ;
$this->Cell(2.5, 1, 'Total HT', 0, 0, 'C',1) ;
$this->SetTextColor(0);
$this->SetDrawColor(8, 155, 217);
$this->Cell(2, 1, "-".number_format($montantHT, 2, ',', ' '), 1, 0, 'C') ;
$this->ln();
$this->SetY(20) ;
$this->SetX(13.5) ;
$this->SetTextColor(255, 255, 255);
$this->Cell(2.5, 1, 'Total TVA', 0, 0, 'C',1) ;
$this->SetTextColor(0);
$this->Cell(2, 1, number_format($montantHT - $montant, 2, ',', ' '), 1, 0, 'C') ;
$this->ln();
$this->SetY(21) ;
$this->SetX(13.5) ;
$this->SetTextColor(255, 255, 255);
$this->Cell(2.5, 1, 'Total TTC', 0, 0, 'C',1) ;
$this->SetTextColor(0);
$this->Cell(2, 1, number_format( $montant, 2, ',', ' '), 1, 0, 'C') ;
$this->ln();
$this->SetY(22) ;
$this->SetX(13.5) ;
$this->SetTextColor(255, 255, 255);
$this->Cell(2.5, 1, 'Net � Payer', 0, 0, 'C',1) ;
$this->SetTextColor(0);
$this->Cell(2, 1, number_format( $montant, 2, ',', ' '), 1, 0, 'C') ;
$this->ln();
$this->SetY(23) ;
$this->SetX(13.5) ;
// }
$this->Ln();$this->Ln();$this->Ln();
$image_height = 5;
$image_width = 11;
$this->pagePrest=1;
$this->Close($attdata);
}
};
$avoir = new Avoir (1) ;
$avoir->Output() ;
?>