phpcompta  Version-6
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Data Fields
PDF Class Reference
Inheritance diagram for PDF:
TFPDF PDFBalance_simple PDFLand Print_Ledger_Detail Print_Ledger_Financial Print_Ledger_Misc Print_Ledger_Simple Print_Ledger_Simple_Without_Vat

Public Member Functions

 __construct ($p_cn=null, $orientation= 'P', $unit= 'mm', $format= 'A4')
 
 Cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
 
 Footer ()
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code
 
 Header ()
 
 Ln ($p_step=null)
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 
 setDossierInfo ($dossier="n/a")
 

Data Fields

 $cn = null
 
 $date = ""
 
 $dossier = "n/a"
 
 $own = null
 
 $soc = ""
 

Detailed Description

Definition at line 29 of file class_pdf.php.

Constructor & Destructor Documentation

PDF::__construct (   $p_cn = null,
  $orientation = 'P',
  $unit = 'mm',
  $format = 'A4' 
)

Definition at line 38 of file class_pdf.php.

References cn.

{
$this->bigger=0;
if($p_cn == null) die("No database connection. Abort.");
parent::TFPDF($orientation, $unit, $format);
$this->AddFont('DejaVu','','DejaVuSans.ttf',true);
$this->AddFont('DejaVu','B','DejaVuSans-Bold.ttf',true);
$this->AddFont('DejaVu','BI','DejaVuSans-BoldOblique.ttf',true);
$this->AddFont('DejaVuCond','','DejaVuSansCondensed.ttf',true);
$this->AddFont('DejaVuCond','B','DejaVuSansCondensed-Bold.ttf',true);
$this->AddFont('DejaVuCond','I','DejaVuSansCondensed-Oblique.ttf',true);
date_default_timezone_set ('Europe/Paris');
$this->cn = $p_cn;
$this->own = new own($this->cn);
$this->soc = $this->own->MY_NAME;
$this->date = date('d.m.Y');
}

Member Function Documentation

PDF::Cell (   $w,
  $h = 0,
  $txt = '',
  $border = 0,
  $ln = 0,
  $align = '',
  $fill = false,
  $link = '' 
)

Definition at line 84 of file class_pdf.php.

References $align, and $w.

Referenced by Print_Ledger_Financial\export(), Print_Ledger_Misc\export(), Print_Ledger_Misc\Footer(), Print_Ledger_Financial\Footer(), Footer(), PDFLand\Footer(), Print_Ledger_Misc\Header(), Print_Ledger_Financial\Header(), Header(), PDFLand\Header(), and PDFBalance_simple\Header().

{
$txt = str_replace("\\", "", $txt);
return parent::Cell($w, $h, $txt, $border, $ln, $align, $fill, $link);
}
PDF::Footer ( )

Definition at line 72 of file class_pdf.php.

References Cell(), and Ln().

{
//Position at 2 cm from bottom
$this->SetY(-20);
//Arial italic 8
$this->SetFont('Arial', '', 8);
//Page number
$this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
$this->Ln(3);
// Created by PhpCompta
$this->Cell(0,8,'Created by Phpcompta, online on http://www.aevalys.eu',0,0,'C',false,'http://www.aevalys.eu');
}
PDF::get_tiers (   $p_jr_id,
  $p_jrn_type 
)

retrieve the client name and quick_code

Parameters
$p_jr_idjrn.jr_id
$p_jrn_typeledger type ACH VEN FIN
Returns
array (0=>qcode,1=>name) or for FIN 0=>customer qc 1=>customer name 2=>bank qc 3=>bank name
See Also
class_print_ledger_simple, class_print_ledger_simple_without_vat

Definition at line 112 of file class_pdf.php.

References $array, $fiche, and cn.

Referenced by Print_Ledger_Simple_Without_Vat\export(), and Print_Ledger_Simple\export().

{
if ( $p_jrn_type=='ACH' )
{
$array=$this->cn->get_array('SELECT
jrnx.j_grpt,
quant_purchase.qp_supplier,
quant_purchase.qp_internal,
jrn.jr_internal
FROM
public.quant_purchase,
public.jrnx,
public.jrn
WHERE
quant_purchase.j_id = jrnx.j_id AND
jrnx.j_grpt = jrn.jr_grpt_id and jr_id=$1',array($p_jr_id));
if (count($array)==0) return array("ERREUR $p_jr_id",'');
$customer_id=$array[0]['qp_supplier'];
$fiche=new Fiche($this->cn,$customer_id);
$customer_qc=$fiche->get_quick_code($customer_id);
$customer_name=$fiche->getName();
return array($customer_qc,$customer_name);
}
if ( $p_jrn_type=='VEN' )
{
$array=$this->cn->get_array('SELECT
quant_sold.qs_client
FROM
public.quant_sold,
public.jrnx,
public.jrn
WHERE
quant_sold.j_id = jrnx.j_id AND
jrnx.j_grpt = jrn.jr_grpt_id and jr_id=$1',array($p_jr_id));
if (count($array)==0) return array("ERREUR $p_jr_id",'');
$customer_id=$array[0]['qs_client'];
$fiche=new Fiche($this->cn,$customer_id);
$customer_qc=$fiche->get_quick_code($customer_id);
$customer_name=$fiche->getName();
return array($customer_qc,$customer_name);
}
if ( $p_jrn_type=='FIN' )
{
$array=$this->cn->get_array('SELECT
qf_other,qf_bank
FROM
public.quant_fin
WHERE
quant_fin.jr_id =$1',array($p_jr_id));
if (count($array)==0) return array("ERREUR $p_jr_id",'','','');
$customer_id=$array[0]['qf_other'];
$fiche=new Fiche($this->cn,$customer_id);
$customer_qc=$fiche->get_quick_code($customer_id);
$customer_name=$fiche->getName();
$bank_id=$array[0]['qf_bank'];
$fiche=new Fiche($this->cn,$bank_id);
$bank_qc=$fiche->get_quick_code($bank_id);
$bank_name=$fiche->getName();
return array($customer_qc,$customer_name,$bank_qc,$bank_name);
}
}
PDF::Header ( )

Definition at line 63 of file class_pdf.php.

References Cell(), and Ln().

{
//Arial bold 12
$this->SetFont('DejaVu', 'B', 12);
//Title
$this->Cell(0,10,$this->dossier, 'B', 0, 'C');
//Line break
$this->Ln(20);
}
PDF::Ln (   $p_step = null)
PDF::LongLine (   $w,
  $h,
  $txt,
  $border = 0,
  $align = '',
  $fill = false 
)

Definition at line 89 of file class_pdf.php.

References $align, $tmp, and $w.

Referenced by Print_Ledger_Financial\export(), Print_Ledger_Misc\export(), Print_Ledger_Detail\export(), Print_Ledger_Simple_Without_Vat\export(), and Print_Ledger_Simple\export().

{
$x_m=$this->GetX();
$y_m=$this->GetY();
$txt = str_replace("\\", "", $txt);
$this->MultiCell($w,$h,$txt,$border,$align,$fill);
$x_m=$x_m+$w;
$tmp=$this->GetY()-$y_m;
if ( $tmp > $this->bigger) $this->bigger=$tmp;
$this->SetXY($x_m,$y_m);
}
PDF::setDossierInfo (   $dossier = "n/a")

Definition at line 58 of file class_pdf.php.

References $dossier, and name.

{
$this->dossier = dossier::name()." ".$dossier;
}

Field Documentation

PDF::$cn = null

Definition at line 32 of file class_pdf.php.

PDF::$date = ""

Definition at line 36 of file class_pdf.php.

PDF::$dossier = "n/a"
PDF::$own = null

Definition at line 33 of file class_pdf.php.

PDF::$soc = ""

Definition at line 34 of file class_pdf.php.


The documentation for this class was generated from the following file: