noalyss Version-9
Public Member Functions | Data Fields
PDF Class Reference

API for creating PDF, unicode, based on tfpdf. More...

+ Inheritance diagram for PDF:
+ Collaboration diagram for PDF:

Public Member Functions

 __construct (Database $p_cn, $orientation='P', $unit='mm', $format='A4')
 
 Footer ()
 
 get_tiers ($p_jr_id, $p_jrn_type)
 retrieve the client name and quick_code More...
 
 Header ()
 
 set_filter_operation ($filter_operation)
 
 setDossierInfo ($dossier="n/a")
 
- Public Member Functions inherited from PDF_Core
 __construct ( $orientation='P', $unit='mm', $format='A4')
 
 get_margin_bottom ()
 
 get_margin_left ()
 
 get_margin_right ()
 
 get_margin_top ()
 
 get_orientation ()
 
 get_page_size ()
 
 get_unit ()
 
 is_fill ($p_step)
 If the step is even then return 1 and set the backgroup color to blue , otherwise returns 0, and set the background color to white It is use to compute alternated colored row , it the parameter fill in write_cell and cell. More...
 
 line_new ($p_step=null)
 Print all the cell stored and call Ln (new line) More...
 
 LongLine ($w, $h, $txt, $border=0, $align='', $fill=false)
 
 write_cell ($w, $h=0, $txt='', $border=0, $ln=0, $align='', $fill=false, $link='')
 

Data Fields

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

Additional Inherited Members

- Protected Member Functions inherited from PDF_Core
 print_row ()
 print the current array of cell and reset it , if different colors are set on the same row you have to print it before changing More...
 

Detailed Description

API for creating PDF, unicode, based on tfpdf.

See also
TFPDF

Definition at line 33 of file pdf.class.php.

Constructor & Destructor Documentation

◆ __construct()

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

Reimplemented in Print_Ledger_Misc.

Definition at line 41 of file pdf.class.php.

42 {
43 $this->cn = $p_cn;
44
45 $this->own = new Noalyss_Parameter_Folder($this->cn);
46 $this->soc = $this->own->MY_NAME;
47 $this->date = date('d.m.Y');
48 parent::__construct($orientation,$unit,$format);
49 date_default_timezone_set ('Europe/Paris');
50 $this->SetCreator("Noalyss");
51 }
$input_from cn
Definition: balance.inc.php:66
Class to manage the company parameter (address, name...)

References cn.

Member Function Documentation

◆ Footer()

PDF::Footer ( )

Reimplemented in PDFLand, Print_Ledger_Detail, Print_Ledger_Detail_Item, Print_Ledger_Financial, Print_Ledger_Misc, Print_Ledger_Simple, and Print_Ledger_Simple_Without_Vat.

Definition at line 65 of file pdf.class.php.

66 {
67 //Position at 2 cm from bottom
68 $this->SetY(-20);
69 //Arial italic 8
70 $this->SetFont('Arial', '', 8);
71 //Page number
72 parent::Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
73 parent::Ln(3);
74 // Created by NOALYSS
75 parent::Cell(0,8,'Created by NOALYSS, online on https://www.noalyss.eu',0,0,'C',false,'https://www.noalyss.eu');
76 }

◆ get_tiers()

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 84 of file pdf.class.php.

85 {
86 if ( $p_jrn_type=='ACH' )
87 {
88 $array=$this->cn->get_array('SELECT
89 jrnx.j_grpt,
90 quant_purchase.qp_supplier,
91 quant_purchase.qp_internal,
92 jrn.jr_internal
93 FROM
94 public.quant_purchase,
95 public.jrnx,
96 public.jrn
97 WHERE
98 quant_purchase.j_id = jrnx.j_id AND
99 jrnx.j_grpt = jrn.jr_grpt_id and jr_id=$1',array($p_jr_id));
100 if (count($array)==0) return array("ERREUR $p_jr_id",'');
101 $customer_id=$array[0]['qp_supplier'];
102 $fiche=new Fiche($this->cn,$customer_id);
103 $customer_qc=$fiche->get_quick_code($customer_id);
104 $customer_name=$fiche->getName();
105 return array($customer_qc,$customer_name);
106 }
107 if ( $p_jrn_type=='VEN' )
108 {
109 $array=$this->cn->get_array('SELECT
110 quant_sold.qs_client
111 FROM
112 public.quant_sold,
113 public.jrnx,
114 public.jrn
115 WHERE
116 quant_sold.j_id = jrnx.j_id AND
117 jrnx.j_grpt = jrn.jr_grpt_id and jr_id=$1',array($p_jr_id));
118 if (count($array)==0) return array("ERREUR $p_jr_id",'');
119 $customer_id=$array[0]['qs_client'];
120 $fiche=new Fiche($this->cn,$customer_id);
121 $customer_qc=$fiche->get_quick_code($customer_id);
122 $customer_name=$fiche->getName();
123 return array($customer_qc,$customer_name);
124 }
125 if ( $p_jrn_type=='FIN' )
126 {
127 $array=$this->cn->get_array('SELECT
128 qf_other,qf_bank
129 FROM
130 public.quant_fin
131 WHERE
132 quant_fin.jr_id =$1',array($p_jr_id));
133 if (count($array)==0) return array("ERREUR $p_jr_id",'','','');
134 $customer_id=$array[0]['qf_other'];
135 $fiche=new Fiche($this->cn,$customer_id);
136 $customer_qc=$fiche->get_quick_code($customer_id);
137 $customer_name=$fiche->getName();
138
139 $bank_id=$array[0]['qf_bank'];
140 $fiche=new Fiche($this->cn,$bank_id);
141 $bank_qc=$fiche->get_quick_code($bank_id);
142 $bank_name=$fiche->getName();
143
144 return array($customer_qc,$customer_name,$bank_qc,$bank_name);
145 }
146 }
define Class fiche and fiche def, those class are using class attribut. When adding or modifing new c...
Definition: fiche.class.php:38

References $array, $fiche, and cn.

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

◆ Header()

PDF::Header ( )

Reimplemented in PDFLand, PDFBalance_simple, Print_Ledger_Detail, Print_Ledger_Detail_Item, Print_Ledger_Financial, Print_Ledger_Misc, Print_Ledger_Simple, and Print_Ledger_Simple_Without_Vat.

Definition at line 56 of file pdf.class.php.

57 {
58 //Arial bold 12
59 $this->SetFont('DejaVu', 'B', 12);
60 //Title
61 parent::Cell(0,10,$this->dossier, 'B', 0, 'C');
62 //Line break
63 parent::Ln(20);
64 }

◆ set_filter_operation()

PDF::set_filter_operation (   $filter_operation)

Reimplemented in Print_Ledger.

Definition at line 148 of file pdf.class.php.

149 {
150 if (in_array($filter_operation, ['all', 'paid', 'unpaid']))
151 {
152 $this->filter_operation=$filter_operation;
153 return $this;
154 }
155 throw new Exception(_("Filter invalide ".$filter_operation), 5);
156 }
$filter_operation

References $filter_operation.

◆ setDossierInfo()

PDF::setDossierInfo (   $dossier = "n/a")

Reimplemented in Print_Ledger_Detail, Print_Ledger_Detail_Item, Print_Ledger_Simple, and Print_Ledger_Simple_Without_Vat.

Definition at line 52 of file pdf.class.php.

53 {
54 $this->dossier = dossier::name()." ".$dossier;
55 }
$from_poste name
$dossier
Definition: pdf.class.php:38

References $dossier, and name.

Referenced by Card_PDF\__construct().

Field Documentation

◆ $cn

PDF::$cn = null

◆ $date

PDF::$date = ""

Definition at line 39 of file pdf.class.php.

◆ $dossier

PDF::$dossier = "n/a"

◆ $own

PDF::$own = null

Definition at line 36 of file pdf.class.php.

Referenced by Print_Ledger\factory().

◆ $soc

PDF::$soc = ""

Definition at line 37 of file pdf.class.php.


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