dolibarr  9.0.0
pdf_paiement.class.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2006-2014 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2015-2018 Charlene BENKE <charlie@patas-monkey.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  * or see http://www.gnu.org/
19  */
20 
26 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
28 
29 
34 {
40  function __construct($db)
41  {
42  global $langs,$conf;
43 
44  // Load translation files required by the page
45  $langs->loadLangs(array("bills","compta","main"));
46 
47  $this->db = $db;
48  $this->description = $langs->transnoentities("ListOfCustomerPayments");
49 
50  // Dimension page pour format A4
51  $this->type = 'pdf';
52  $formatarray=pdf_getFormat();
53  $this->page_largeur = $formatarray['width'];
54  $this->page_hauteur = $formatarray['height'];
55  $this->format = array($this->page_largeur,$this->page_hauteur);
56  $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
57  $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
58  $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
59  $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
60 
61  $this->tab_top = 30;
62 
63  $this->line_height = 5;
64  $this->line_per_page = 40;
65  $this->tab_height = $this->page_hauteur - $this->marge_haute - $this->marge_basse - $this->tab_top - 5; // must be > $this->line_height * $this->line_per_page and < $this->page_hauteur - $this->marge_haute - $this->marge_basse - $this->tab_top - 5;
66 
67  $this->posxdate=$this->marge_gauche+2;
68  $this->posxpaymenttype=42;
69  $this->posxinvoice=82;
70  $this->posxbankaccount=110;
71  $this->posxinvoiceamount=132;
72  $this->posxpaymentamount=162;
73  if ($this->page_largeur < 210) // To work with US executive format
74  {
75  $this->line_per_page = 35;
76  $this->posxpaymenttype-=10;
77  $this->posxinvoice-=0;
78  $this->posxinvoiceamount-=10;
79  $this->posxpaymentamount-=20;
80  }
81  // which type of document will be generated: clients (client) or providers (fourn) invoices
82  $this->doc_type = "client";
83  }
84 
85 
86  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
96  function write_file($_dir, $month, $year, $outputlangs)
97  {
98  // phpcs:enable
99  include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
100 
101  global $conf, $hookmanager, $langs, $user;
102 
103  $socid=0;
104  if ($user->societe_id) $socid=$user->societe_id;
105 
106  if (! is_object($outputlangs)) $outputlangs=$langs;
107  // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
108  if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
109 
110  $this->month=$month;
111  $this->year=$year;
112  $dir=$_dir.'/'.$year;
113 
114  if (! is_dir($dir))
115  {
116  $result=dol_mkdir($dir);
117  if ($result < 0)
118  {
119  $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
120  return -1;
121  }
122  }
123 
124  $month = sprintf("%02d",$month);
125  $year = sprintf("%04d",$year);
126 
127  $file = $dir . "/payments-".$year."-".$month.".pdf";
128  switch ($this->doc_type) {
129  case "client":
130  $file = $dir . "/payments-".$year."-".$month.".pdf";
131  break;
132  case "fourn":
133  $file = $dir . "/supplier_payments-".$year."-".$month.".pdf";
134  break;
135  }
136 
137 
138  // Add pdfgeneration hook
139  if (! is_object($hookmanager))
140  {
141  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
142  $hookmanager=new HookManager($this->db);
143  }
144  $hookmanager->initHooks(array('pdfgeneration'));
145  $parameters=array('file'=>$file,'outputlangs'=>$outputlangs);
146  global $action;
147  $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
148 
149  $pdf=pdf_getInstance($this->format);
150  $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
151 
152  if (class_exists('TCPDF'))
153  {
154  $pdf->setPrintHeader(false);
155  $pdf->setPrintFooter(false);
156  }
157  $pdf->SetFont(pdf_getPDFFont($outputlangs));
158 
159  $num=0;
160  $lines=array();
161 
162  // count number of lines of payment
163  $sql = "SELECT p.rowid as prowid";
164  switch ($this->doc_type) {
165  case "client":
166  $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p";
167  break;
168  case "fourn":
169  $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
170  break;
171  }
172  $sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
173  $sql.= " AND p.entity = " . $conf->entity;
174  $result = $this->db->query($sql);
175  if ($result)
176  {
177  $numpaiement = $this->db->num_rows($result);
178  }
179 
180  // number of bill
181  switch ($this->doc_type) {
182  case "client":
183  $sql = "SELECT p.datep as dp, f.facnumber";
184  //$sql .= ", c.libelle as paiement_type, p.num_paiement";
185  $sql.= ", c.code as paiement_code, p.num_paiement";
186  $sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
187  $sql.= ", pf.amount as pf_amount";
188  if (! empty($conf->banque->enabled))
189  $sql.= ", ba.ref as bankaccount";
190  $sql.= ", p.rowid as prowid";
191  $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id";
192  $sql.= ", ".MAIN_DB_PREFIX."facture as f,";
193  $sql.= " ".MAIN_DB_PREFIX."paiement_facture as pf,";
194  if (! empty($conf->banque->enabled))
195  $sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
196  $sql.= " ".MAIN_DB_PREFIX."societe as s";
197  if (! $user->rights->societe->client->voir && ! $socid)
198  {
199  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
200  }
201  $sql.= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
202  if (! empty($conf->banque->enabled))
203  $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
204  $sql.= " AND f.entity = ".$conf->entity;
205  $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
206  if (! $user->rights->societe->client->voir && ! $socid)
207  {
208  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
209  }
210  if (! empty($socid)) $sql .= " AND s.rowid = ".$socid;
211  $sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
212  break;
213  case "fourn":
214  $sql = "SELECT p.datep as dp, f.ref as facnumber";
215  //$sql .= ", c.libelle as paiement_type, p.num_paiement";
216  $sql.= ", c.code as paiement_code, p.num_paiement";
217  $sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
218  $sql.= ", pf.amount as pf_amount";
219  if (! empty($conf->banque->enabled))
220  $sql.= ", ba.ref as bankaccount";
221  $sql.= ", p.rowid as prowid";
222  $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id";
223  $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f,";
224  $sql.= " ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,";
225  if (! empty($conf->banque->enabled))
226  $sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
227  $sql.= " ".MAIN_DB_PREFIX."societe as s";
228  if (! $user->rights->societe->client->voir && ! $socid)
229  {
230  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
231  }
232  $sql.= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid";
233  if (! empty($conf->banque->enabled))
234  $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
235  $sql.= " AND f.entity = ".$conf->entity;
236  $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
237  if (! $user->rights->societe->client->voir && ! $socid)
238  {
239  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
240  }
241  if (! empty($socid)) $sql .= " AND s.rowid = ".$socid;
242  $sql.= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC";
243  break;
244  }
245 
246  dol_syslog(get_class($this)."::write_file", LOG_DEBUG);
247  $result = $this->db->query($sql);
248  if ($result)
249  {
250  $num = $this->db->num_rows($result);
251  $i = 0;
252 
253  while ($i < $num)
254  {
255  $objp = $this->db->fetch_object($result);
256 
257  $lines[$i][0] = $objp->facnumber;
258  $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true);
259  $lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code);
260  $lines[$i][3] = $objp->num_paiement;
261  $lines[$i][4] = price($objp->paiement_amount);
262  $lines[$i][5] = price($objp->facture_amount);
263  $lines[$i][6] = price($objp->pf_amount);
264  $lines[$i][7] = $objp->prowid;
265  $lines[$i][8] = $objp->bankaccount;
266  $lines[$i][9] = $objp->paiement_amount;
267  $i++;
268  }
269  }
270  else
271  {
272  dol_print_error($this->db);
273  }
274 
275  $pages = intval(($num + $numpaiement) / $this->line_per_page);
276 
277  if ((($num + $numpaiement) % $this->line_per_page)>0)
278  {
279  $pages++;
280  }
281 
282  if ($pages == 0)
283  {
284  // force to build at least one page if report has no line
285  $pages = 1;
286  }
287 
288  $pdf->Open();
289  $pagenb=0;
290  $pdf->SetDrawColor(128,128,128);
291 
292  $pdf->SetTitle($outputlangs->transnoentities("Payments"));
293  $pdf->SetSubject($outputlangs->transnoentities("Payments"));
294  $pdf->SetCreator("Dolibarr ".DOL_VERSION);
295  $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
296  //$pdf->SetKeyWords();
297  if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
298 
299  $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
300  $pdf->SetAutoPageBreak(1,0);
301 
302  // New page
303  $pdf->AddPage();
304  $pagenb++;
305  $this->_pagehead($pdf, $pagenb, 1, $outputlangs);
306  $pdf->SetFont('','', 9);
307  $pdf->MultiCell(0, 3, ''); // Set interline to 3
308  $pdf->SetTextColor(0,0,0);
309 
310 
311  $this->Body($pdf, 1, $lines, $outputlangs);
312 
313  if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
314 
315  $pdf->Close();
316 
317  $pdf->Output($file,'F');
318 
319  // Add pdfgeneration hook
320  if (! is_object($hookmanager))
321  {
322  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
323  $hookmanager=new HookManager($this->db);
324  }
325  $hookmanager->initHooks(array('pdfgeneration'));
326  $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
327  global $action;
328  $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
329 
330  if (! empty($conf->global->MAIN_UMASK))
331  @chmod($file, octdec($conf->global->MAIN_UMASK));
332 
333  $this->result = array('fullpath'=>$file);
334 
335  return 1;
336  }
337 
347  function _pagehead(&$pdf, $page, $showaddress, $outputlangs)
348  {
349  global $langs, $conf;
350 
351  // Do not add the BACKGROUND as this is a report
352  //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
353 
354  $default_font_size = pdf_getPDFFontSize($outputlangs);
355 
356  $title=$conf->global->MAIN_INFO_SOCIETE_NOM;
357  switch($this->doc_type) {
358  case "client":
359  $title.=' - '.$outputlangs->transnoentities("ListOfCustomerPayments");
360  break;
361  case "fourn":
362  $title.=' - '.$outputlangs->transnoentities("ListOfSupplierPayments");
363  break;
364  }
365  $title.=' - '.dol_print_date(dol_mktime(0,0,0,$this->month,1,$this->year),"%B %Y",false,$outputlangs,true);
366  $pdf->SetFont('','B',$default_font_size + 1);
367  $pdf->SetXY($this->marge_gauche,10);
368  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 2, $title, 0, 'C');
369 
370  $pdf->SetFont('','',$default_font_size);
371 
372  $pdf->SetXY($this->posxdate, 16);
373  $pdf->MultiCell(80, 2, $outputlangs->transnoentities("DateBuild")." : ".dol_print_date(time(),"day",false,$outputlangs,true), 0, 'L');
374 
375  $pdf->SetXY($this->posxdate+100, 16);
376  $pdf->MultiCell(80, 2, $outputlangs->transnoentities("Page")." : ".$page, 0, 'R');
377 
378 
379  // Title line
380  $pdf->SetXY($this->posxdate, $this->tab_top+2);
381  $pdf->MultiCell($this->posxpaymenttype - $this->posxdate, 2, 'Date');
382 
383  $pdf->line($this->posxpaymenttype - 1, $this->tab_top, $this->posxpaymenttype - 1, $this->tab_top + $this->tab_height + 10);
384  $pdf->SetXY($this->posxpaymenttype, $this->tab_top+2);
385  $pdf->MultiCell($this->posxinvoice - $this->posxpaymenttype, 2, $outputlangs->transnoentities("PaymentMode"), 0, 'L');
386 
387  $pdf->line($this->posxinvoice - 1, $this->tab_top, $this->posxinvoice - 1, $this->tab_top + $this->tab_height + 10);
388  $pdf->SetXY($this->posxinvoice, $this->tab_top+2);
389  $pdf->MultiCell($this->posxbankaccount - $this->posxinvoice, 2, $outputlangs->transnoentities("Invoice"), 0, 'L');
390 
391  $pdf->line($this->posxbankaccount - 1, $this->tab_top, $this->posxbankaccount - 1, $this->tab_top + $this->tab_height + 10);
392  $pdf->SetXY($this->posxbankaccount, $this->tab_top+2);
393  $pdf->MultiCell($this->posxinvoiceamount - $this->posxbankaccount, 2, $outputlangs->transnoentities("Account"), 0, 'L');
394 
395 
396  $pdf->line($this->posxinvoiceamount - 1, $this->tab_top, $this->posxinvoiceamount - 1, $this->tab_top + $this->tab_height + 10);
397  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top+2);
398  $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount - 1, 2, $outputlangs->transnoentities("AmountInvoice"), 0, 'R');
399 
400  $pdf->line($this->posxpaymentamount - 1, $this->tab_top, $this->posxpaymentamount - 1, $this->tab_top + $this->tab_height + 10);
401  $pdf->SetXY($this->posxpaymentamount, $this->tab_top+2);
402  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount - 1, 2, $outputlangs->transnoentities("AmountPayment"), 0, 'R');
403 
404  $pdf->line($this->marge_gauche, $this->tab_top + 10, $this->page_largeur - $this->marge_droite, $this->tab_top + 10);
405 
406  $pdf->Rect($this->marge_gauche, $this->tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $this->tab_height + 10);
407  }
408 
409 
410  // phpcs:disable PEAR.NamingConventions.ValidFunctionName.NotCamelCaps
420  function Body(&$pdf, $page, $lines, $outputlangs)
421  {
422  // phpcs:enable
423  global $langs;
424  $default_font_size = pdf_getPDFFontSize($outputlangs);
425 
426  $pdf->SetFont('','', $default_font_size - 1);
427  $oldprowid = 0;
428  $total_page = 0;
429  $total = 0;
430  $pdf->SetFillColor(220,220,220);
431  $yp = 0;
432  $numlines=count($lines);
433  for ($j = 0 ; $j < $numlines ; $j++)
434  {
435  $i = $j;
436  if ($yp > $this->tab_height -5)
437  {
438  $page++;
439  $pdf->AddPage();
440  $this->_pagehead($pdf, $page, 0, $outputlangs);
441  $pdf->SetFont('','', $default_font_size - 1);
442  $yp = 0;
443  }
444  if ($oldprowid <> $lines[$j][7])
445  {
446  if ($yp > $this->tab_height -15)
447  {
448  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
449  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0);
450  $page++;
451  $pdf->AddPage();
452  $this->_pagehead($pdf, $page, 0, $outputlangs);
453  $pdf->SetFont('','', $default_font_size - 1);
454  $yp = 0;
455  $total += $total_page;
456  $total_page = 0;
457  }
458 
459  $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
460  $pdf->MultiCell($this->posxpaymenttype - $this->posxdate + 1, $this->line_height, $lines[$j][1], 0, 'L', 1);
461 
462  $pdf->SetXY($this->posxpaymenttype, $this->tab_top + 10 + $yp);
463  $pdf->MultiCell($this->posxinvoiceamount - $this->posxpaymenttype, $this->line_height, $lines[$j][2].' '.$lines[$j][3], 0, 'L', 1);
464 
465  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp);
466  $pdf->MultiCell($this->posxpaymentamount- $this->posxinvoiceamount, $this->line_height, '', 0, 'R', 1);
467 
468  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
469  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1);
470  $yp = $yp + 5;
471  $total_page += $lines[$j][9];
472  }
473 
474  // Invoice number
475  $pdf->SetXY($this->posxinvoice, $this->tab_top + 10 + $yp);
476  $pdf->MultiCell($this->posxinvoice - $this->posxbankaccount, $this->line_height, $lines[$j][0], 0, 'L', 0);
477 
478  // BankAccount
479  $pdf->SetXY($this->posxbankaccount, $this->tab_top + 10 + $yp);
480  $pdf->MultiCell($this->posxbankaccount - $this->posxdate, $this->line_height, $lines[$j][8], 0, 'L', 0);
481 
482  // Invoice amount
483  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp);
484  $pdf->MultiCell($this->posxpaymentamount- $this->posxinvoiceamount - 1, $this->line_height, $lines[$j][5], 0, 'R', 0);
485 
486  // Payment amount
487  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
488  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][6], 0, 'R', 0);
489  $yp = $yp + 5;
490 
491  if ($oldprowid <> $lines[$j][7])
492  {
493  $oldprowid = $lines[$j][7];
494  }
495  }
496  $total += $total_page;
497  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
498  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('Total')." : ".price($total), 0, 'R', 0);
499  }
500 }
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition: pdf.lib.php:82
_pagehead(&$pdf, $page, $showaddress, $outputlangs)
Show top header of page.
</td >< td class="liste_titre" align="right"></td ></tr >< tr class="liste_titre">< input type="checkbox" onClick="toggle(this)"/> Ref p ref Label p label Duration p duration warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow img yes disabled img no img no< tr class="oddeven">< td >< input type="checkbox" class="check" name="' . $i . '"' . $disabled . '></td >< td >< input type="checkbox" class="check" name="choose'.$i.'"></td >< td class="nowrap"></td >< td >< input type="hidden" name="desc' . $i . '" value="' . dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:573
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm=false, $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
pdf_getFormat(Translate $outputlangs=null)
Return array with format properties of default PDF format.
Definition: pdf.lib.php:42
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition: pdf.lib.php:224
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:453
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition: pdf.lib.php:201
Class to manage hooks.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
type
Definition: viewcat.php:284
write_file($_dir, $month, $year, $outputlangs)
Fonction generant la rapport sur le disque.
Classe permettant de generer les rapports de paiement.
price($amount, $form=0, $outlangs='', $trunc=1, $rounding=-1, $forcerounding=-1, $currency_code='')
Function to format a value into an amount for visual output Function used into PDF and HTML pages...
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_last_day($year, $month=12, $gm=false)
Return GMT time for last day of a month or year.
Definition: date.lib.php:467
Body(&$pdf, $page, $lines, $outputlangs)
Output body.
dol_mkdir($dir, $dataroot='', $newmask=null)
Creation of a directory (this can create recursive subdir)
__construct($db)
Constructor.