Plugins  LAST
 All Data Structures Files Functions Variables Pages
Public Member Functions
Pdf_Card Class Reference
Inheritance diagram for Pdf_Card:
Inheritance graph
Collaboration diagram for Pdf_Card:
Collaboration graph

Public Member Functions

 __construct (&$p_cn=null, $orientation= 'P', $unit= 'mm', $format= 'A4')
 
 setDossierInfo ($dossier="n/a")
 
 Header ()
 
 Footer ()
 
 export ()
 

Detailed Description

Definition at line 25 of file class_pdf_card.php.

Constructor & Destructor Documentation

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

Definition at line 27 of file class_pdf_card.php.

28  {
29 
30  if($p_cn == null) die("No database connection. Abort.");
31 
32  parent::__construct($p_cn,'P', 'mm', 'A4');
33  date_default_timezone_set ('Europe/Paris');
34  $this->total_page=0;
35 
36  }

Member Function Documentation

Pdf_Card::export ( )

Definition at line 66 of file class_pdf_card.php.

References $array, $ret, and $row.

67  {
68  // take all material from
69  $array=$this->cn->get_array("select a_id , f_id , vw_name,vw_description,
70  account_deb , account_cred , a_amount ,
71  a_nb_year , a_start
72  from amortissement.amortissement
73  left join vw_fiche_attr using(f_id)
74  where a_visible='Y'
75  order by vw_name ");
76 
77  $this->total_page=count($array);
78  $this->SetFont('DejaVu','BI',7);
79  bcscale(2);
80  // print all operation
81  for ($i=0;$i< count($array);$i++)
82  {
83  $this->SetFont('DejaVuCond','B',15);
84  $row=$array[$i];
85  $this->write_cell(0,0,$row['vw_name'],0,0,'C');
86 
87  $this->line_new(12);
88 
89  $this->SetFont('DejaVu','',7);
90  $this->write_cell(50,7,'Montant');
91  $this->write_cell(50,7,nbm($row['a_amount']));
92  $this->line_new(4);
93 
94  $this->write_cell(50,7,"Année d'achat");
95  $this->write_cell(50,7,$row['a_start']);
96  $this->line_new(4);
97 
98  $this->write_cell(50,7,"Poste charge");
99  $this->write_cell(50,7,$row['account_deb']);
100  $deb=$this->cn->get_value("select pcm_lib from tmp_pcmn where pcm_val=$1",
101  array($row['account_deb']));
102  $this->write_cell(120,7,$deb);
103  $this->line_new(4);
104 
105  $this->write_cell(50,7,"Poste contrepartie");
106  $this->write_cell(50,7,$row['account_cred']);
107  $cred=$this->cn->get_value("select pcm_lib from tmp_pcmn where pcm_val=$1",
108  array($row['account_cred']));
109  $this->write_cell(120,7,$cred);
110  $this->line_new(4);
111 
112  $this->write_cell(50,7,"Nbre annuités");
113  $this->write_cell(50,7,$row['a_nb_year']);
114  $this->line_new(12);
115 
116  /*
117  * Now we print for each year
118  */
119  $col=array('Année','Montant','Am. actés','Pièce','n° interne','%');
120  foreach ($col as $scol)
121  {
122  $this->write_cell(25,7,$scol,1);
123  }
124  $this->line_new();
125 
126  $array_year=$this->cn->get_array("select ad_id , ad_amount , a_id , ad_year , ad_percentage ".
127  " from amortissement.amortissement_detail ".
128  " where a_id=$1 order by ad_year",
129  array($row['a_id']));
130  for ($e=0;$e<count($array_year);$e++)
131  {
132  $this->write_cell(25,7,$array_year[$e]['ad_year'],1,0);
133  $this->write_cell(25,7,nbm($array_year[$e]['ad_amount']),1,0,'R');
134  $ret=$this->cn->exec_sql("select h_amount,h_pj,jr_internal from amortissement.amortissement_histo where a_id=$1 and h_year=$2",
135  array($row['a_id'],$array_year[$e]['ad_year']));
136  $value=$this->cn->fetch_array($ret,0);
137  $this->write_cell(25,7,nbm($value['h_amount']),1,0,'R');
138  $this->write_cell(25,7,$value['h_pj'],1,0);
139  $this->write_cell(25,7,$value['jr_internal'],1,0);
140  $pct=bcdiv($array_year[$e]['ad_amount'],$row['a_amount']);
141  $pct=bcmul($pct,100);
142  $this->write_cell(25,7,$pct,1,0,'R');
143 
144  $this->line_new();
145 
146  }// for all year
147  if ($i < count($array)) $this->AddPage();
148  } // for ... all card
149  $this->Output('toutes_les_fiches.pdf','I');
150  }
$ret
for($i=0;$i< Database::num_row($ret);$i++) $row
if(isset($_POST['remove'])) $array
Pdf_Card::Footer ( )

Definition at line 52 of file class_pdf_card.php.

53  {
54  //Position at 2 cm from bottom
55  $this->SetY(-20);
56  //Arial italic 8
57  $this->SetFont('Arial', 'I', 8);
58  //Page number
59  $this->Cell(0,8,'Date '.$this->date." - Page ".$this->PageNo().'/{nb}',0,0,'C');
60  $this->Ln(3);
61  // Created by NOALYSS
62  $this->Cell(0,8,'Created by NOALYSS, a professional opensource accounting software http://www.noalyss.eu',0,0,'C',false,'http://www.noalyss.eu');
63  }
Pdf_Card::Header ( )

Definition at line 43 of file class_pdf_card.php.

44  {
45  //Arial bold 12
46  $this->SetFont('DejaVu', 'B', 12);
47  //Title
48  $this->Cell(0,10,$this->dossier, 'B', 0, 'C');
49  //Line break
50  $this->Ln(20);
51  }
Pdf_Card::setDossierInfo (   $dossier = "n/a")

Definition at line 38 of file class_pdf_card.php.

References $dossier, and name.

39  {
40  $this->dossier = dossier::name()." ".$dossier;
41  }
$dossier
Definition: index.php:32
$categorie_appel name

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