dolibarr  7.0.0-beta
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 Charles-Fr BENKE <charles.fr@benke.fr>
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  $langs->load("bills");
44  $langs->load("compta");
45  $langs->load("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 
96  function write_file($_dir, $month, $year, $outputlangs)
97  {
98  include_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
99 
100  global $conf, $hookmanager, $langs, $user;
101 
102  $socid=0;
103  if ($user->societe_id) $socid=$user->societe_id;
104 
105  if (! is_object($outputlangs)) $outputlangs=$langs;
106  // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
107  if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
108 
109  $this->month=$month;
110  $this->year=$year;
111  $dir=$_dir.'/'.$year;
112 
113  if (! is_dir($dir))
114  {
115  $result=dol_mkdir($dir);
116  if ($result < 0)
117  {
118  $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
119  return -1;
120  }
121  }
122 
123  $month = sprintf("%02d",$month);
124  $year = sprintf("%04d",$year);
125 
126  $file = $dir . "/payments-".$year."-".$month.".pdf";
127  switch ($this->doc_type) {
128  case "client":
129  $file = $dir . "/payments-".$year."-".$month.".pdf";
130  break;
131  case "fourn":
132  $file = $dir . "/supplier_payments-".$year."-".$month.".pdf";
133  break;
134  }
135 
136 
137  // Add pdfgeneration hook
138  if (! is_object($hookmanager))
139  {
140  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
141  $hookmanager=new HookManager($this->db);
142  }
143  $hookmanager->initHooks(array('pdfgeneration'));
144  $parameters=array('file'=>$file,'outputlangs'=>$outputlangs);
145  global $action;
146  $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
147 
148  $pdf=pdf_getInstance($this->format);
149  $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
150 
151  if (class_exists('TCPDF'))
152  {
153  $pdf->setPrintHeader(false);
154  $pdf->setPrintFooter(false);
155  }
156  $pdf->SetFont(pdf_getPDFFont($outputlangs));
157 
158  $num=0;
159  $lines=array();
160 
161  // count number of lines of payment
162  $sql = "SELECT p.rowid as prowid";
163  switch ($this->doc_type) {
164  case "client":
165  $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p";
166  break;
167  case "fourn":
168  $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p";
169  break;
170  }
171  $sql.= " WHERE p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
172  $sql.= " AND p.entity = " . $conf->entity;
173  $result = $this->db->query($sql);
174  if ($result)
175  {
176  $numpaiement = $this->db->num_rows($result);
177  }
178 
179  // number of bill
180  switch ($this->doc_type) {
181  case "client":
182  $sql = "SELECT p.datep as dp, f.facnumber";
183  //$sql .= ", c.libelle as paiement_type, p.num_paiement";
184  $sql.= ", c.code as paiement_code, p.num_paiement";
185  $sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
186  $sql.= ", pf.amount as pf_amount";
187  if (! empty($conf->banque->enabled))
188  $sql.= ", ba.ref as bankaccount";
189  $sql.= ", p.rowid as prowid";
190  $sql.= " FROM ".MAIN_DB_PREFIX."paiement as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (" . getEntity('c_paiement').")";
191  $sql.= ", ".MAIN_DB_PREFIX."facture as f,";
192  $sql.= " ".MAIN_DB_PREFIX."paiement_facture as pf,";
193  if (! empty($conf->banque->enabled))
194  $sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
195  $sql.= " ".MAIN_DB_PREFIX."societe as s";
196  if (! $user->rights->societe->client->voir && ! $socid)
197  {
198  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
199  }
200  $sql.= " WHERE f.fk_soc = s.rowid AND pf.fk_facture = f.rowid AND pf.fk_paiement = p.rowid";
201  if (! empty($conf->banque->enabled))
202  $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
203  $sql.= " AND f.entity = ".$conf->entity;
204  $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
205  if (! $user->rights->societe->client->voir && ! $socid)
206  {
207  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
208  }
209  if (! empty($socid)) $sql .= " AND s.rowid = ".$socid;
210  $sql.= " ORDER BY p.datep ASC, pf.fk_paiement ASC";
211  break;
212  case "fourn":
213  $sql = "SELECT p.datep as dp, f.ref as facnumber";
214  //$sql .= ", c.libelle as paiement_type, p.num_paiement";
215  $sql.= ", c.code as paiement_code, p.num_paiement";
216  $sql.= ", p.amount as paiement_amount, f.total_ttc as facture_amount";
217  $sql.= ", pf.amount as pf_amount";
218  if (! empty($conf->banque->enabled))
219  $sql.= ", ba.ref as bankaccount";
220  $sql.= ", p.rowid as prowid";
221  $sql.= " FROM ".MAIN_DB_PREFIX."paiementfourn as p LEFT JOIN ".MAIN_DB_PREFIX."c_paiement as c ON p.fk_paiement = c.id AND c.entity IN (".getEntity('c_paiement').")";
222  $sql.= ", ".MAIN_DB_PREFIX."facture_fourn as f,";
223  $sql.= " ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf,";
224  if (! empty($conf->banque->enabled))
225  $sql.= " ".MAIN_DB_PREFIX."bank as b, ".MAIN_DB_PREFIX."bank_account as ba,";
226  $sql.= " ".MAIN_DB_PREFIX."societe as s";
227  if (! $user->rights->societe->client->voir && ! $socid)
228  {
229  $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
230  }
231  $sql.= " WHERE f.fk_soc = s.rowid AND pf.fk_facturefourn = f.rowid AND pf.fk_paiementfourn = p.rowid";
232  if (! empty($conf->banque->enabled))
233  $sql.= " AND p.fk_bank = b.rowid AND b.fk_account = ba.rowid ";
234  $sql.= " AND f.entity = ".$conf->entity;
235  $sql.= " AND p.datep BETWEEN '".$this->db->idate(dol_get_first_day($year,$month))."' AND '".$this->db->idate(dol_get_last_day($year,$month))."'";
236  if (! $user->rights->societe->client->voir && ! $socid)
237  {
238  $sql .= " AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id;
239  }
240  if (! empty($socid)) $sql .= " AND s.rowid = ".$socid;
241  $sql.= " ORDER BY p.datep ASC, pf.fk_paiementfourn ASC";
242  break;
243  }
244 
245  dol_syslog(get_class($this)."::write_file", LOG_DEBUG);
246  $result = $this->db->query($sql);
247  if ($result)
248  {
249  $num = $this->db->num_rows($result);
250  $i = 0;
251  $var=True;
252 
253  while ($i < $num)
254  {
255  $objp = $this->db->fetch_object($result);
256 
257 
258  $lines[$i][0] = $objp->facnumber;
259  $lines[$i][1] = dol_print_date($this->db->jdate($objp->dp),"day",false,$outputlangs,true);
260  $lines[$i][2] = $langs->transnoentities("PaymentTypeShort".$objp->paiement_code);
261  $lines[$i][3] = $objp->num_paiement;
262  $lines[$i][4] = price($objp->paiement_amount);
263  $lines[$i][5] = price($objp->facture_amount);
264  $lines[$i][6] = price($objp->pf_amount);
265  $lines[$i][7] = $objp->prowid;
266  $lines[$i][8] = $objp->bankaccount;
267  $lines[$i][9] = $objp->paiement_amount;
268  $i++;
269  }
270  }
271  else
272  {
273  dol_print_error($this->db);
274  }
275 
276  $pages = intval(($num + $numpaiement) / $this->line_per_page);
277 
278  if ((($num + $numpaiement) % $this->line_per_page)>0)
279  {
280  $pages++;
281  }
282 
283  if ($pages == 0)
284  {
285  // force to build at least one page if report has no line
286  $pages = 1;
287  }
288 
289  $pdf->Open();
290  $pagenb=0;
291  $pdf->SetDrawColor(128,128,128);
292 
293  $pdf->SetTitle($outputlangs->transnoentities("Payments"));
294  $pdf->SetSubject($outputlangs->transnoentities("Payments"));
295  $pdf->SetCreator("Dolibarr ".DOL_VERSION);
296  $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
297  //$pdf->SetKeyWords();
298  if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
299 
300  $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
301  $pdf->SetAutoPageBreak(1,0);
302 
303  // New page
304  $pdf->AddPage();
305  $pagenb++;
306  $this->_pagehead($pdf, $pagenb, 1, $outputlangs);
307  $pdf->SetFont('','', 9);
308  $pdf->MultiCell(0, 3, ''); // Set interline to 3
309  $pdf->SetTextColor(0,0,0);
310 
311 
312  $this->Body($pdf, 1, $lines, $outputlangs);
313 
314  if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
315 
316  $pdf->Close();
317 
318  $pdf->Output($file,'F');
319 
320  // Add pdfgeneration hook
321  if (! is_object($hookmanager))
322  {
323  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
324  $hookmanager=new HookManager($this->db);
325  }
326  $hookmanager->initHooks(array('pdfgeneration'));
327  $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
328  global $action;
329  $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
330 
331  if (! empty($conf->global->MAIN_UMASK))
332  @chmod($file, octdec($conf->global->MAIN_UMASK));
333 
334  $this->result = array('fullpath'=>$file);
335 
336  return 1;
337  }
338 
348  function _pagehead(&$pdf, $page, $showaddress, $outputlangs)
349  {
350  global $langs;
351 
352  // Do not add the BACKGROUND as this is a report
353  //pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
354 
355  $default_font_size = pdf_getPDFFontSize($outputlangs);
356 
357  $title=$conf->global->MAIN_INFO_SOCIETE_NOM;
358  switch($this->doc_type) {
359  case "client":
360  $title.=' - '.$outputlangs->transnoentities("ListOfCustomerPayments");
361  break;
362  case "fourn":
363  $title.=' - '.$outputlangs->transnoentities("ListOfSupplierPayments");
364  break;
365  }
366  $title.=' - '.dol_print_date(dol_mktime(0,0,0,$this->month,1,$this->year),"%B %Y",false,$outputlangs,true);
367  $pdf->SetFont('','B',$default_font_size + 1);
368  $pdf->SetXY($this->marge_gauche,10);
369  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->marge_gauche, 2, $title, 0, 'C');
370 
371  $pdf->SetFont('','',$default_font_size);
372 
373  $pdf->SetXY($this->posxdate, 16);
374  $pdf->MultiCell(80, 2, $outputlangs->transnoentities("DateBuild")." : ".dol_print_date(time(),"day",false,$outputlangs,true), 0, 'L');
375 
376  $pdf->SetXY($this->posxdate+100, 16);
377  $pdf->MultiCell(80, 2, $outputlangs->transnoentities("Page")." : ".$page, 0, 'R');
378 
379 
380  // Title line
381  $pdf->SetXY($this->posxdate, $this->tab_top+2);
382  $pdf->MultiCell($this->posxpaymenttype - $this->posxdate, 2, 'Date');
383 
384  $pdf->line($this->posxpaymenttype - 1, $this->tab_top, $this->posxpaymenttype - 1, $this->tab_top + $this->tab_height + 10);
385  $pdf->SetXY($this->posxpaymenttype, $this->tab_top+2);
386  $pdf->MultiCell($this->posxinvoice - $this->posxpaymenttype, 2, $outputlangs->transnoentities("PaymentMode"), 0, 'L');
387 
388  $pdf->line($this->posxinvoice - 1, $this->tab_top, $this->posxinvoice - 1, $this->tab_top + $this->tab_height + 10);
389  $pdf->SetXY($this->posxinvoice, $this->tab_top+2);
390  $pdf->MultiCell($this->posxbankaccount - $this->posxinvoice, 2, $outputlangs->transnoentities("Invoice"), 0, 'L');
391 
392  $pdf->line($this->posxbankaccount - 1, $this->tab_top, $this->posxbankaccount - 1, $this->tab_top + $this->tab_height + 10);
393  $pdf->SetXY($this->posxbankaccount, $this->tab_top+2);
394  $pdf->MultiCell($this->posxinvoiceamount - $this->posxbankaccount, 2, $outputlangs->transnoentities("Account"), 0, 'L');
395 
396 
397  $pdf->line($this->posxinvoiceamount - 1, $this->tab_top, $this->posxinvoiceamount - 1, $this->tab_top + $this->tab_height + 10);
398  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top+2);
399  $pdf->MultiCell($this->posxpaymentamount - $this->posxinvoiceamount - 1, 2, $outputlangs->transnoentities("AmountInvoice"), 0, 'R');
400 
401  $pdf->line($this->posxpaymentamount - 1, $this->tab_top, $this->posxpaymentamount - 1, $this->tab_top + $this->tab_height + 10);
402  $pdf->SetXY($this->posxpaymentamount, $this->tab_top+2);
403  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount - 1, 2, $outputlangs->transnoentities("AmountPayment"), 0, 'R');
404 
405  $pdf->line($this->marge_gauche, $this->tab_top + 10, $this->page_largeur - $this->marge_droite, $this->tab_top + 10);
406 
407  $pdf->Rect($this->marge_gauche, $this->tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $this->tab_height + 10);
408  }
409 
410 
420  function Body(&$pdf, $page, $lines, $outputlangs)
421  {
422  global $langs;
423  $default_font_size = pdf_getPDFFontSize($outputlangs);
424 
425  $pdf->SetFont('','', $default_font_size - 1);
426  $oldprowid = 0;
427  $total_page = 0;
428  $total = 0;
429  $pdf->SetFillColor(220,220,220);
430  $yp = 0;
431  $numlines=count($lines);
432  for ($j = 0 ; $j < $numlines ; $j++)
433  {
434  $i = $j;
435  if ($yp > $this->tab_height -5)
436  {
437  $page++;
438  $pdf->AddPage();
439  $this->_pagehead($pdf, $page, 0, $outputlangs);
440  $pdf->SetFont('','', $default_font_size - 1);
441  $yp = 0;
442  }
443  if ($oldprowid <> $lines[$j][7])
444  {
445  if ($yp > $this->tab_height -15)
446  {
447  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
448  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('SubTotal')." : ".price($total_page), 0, 'R', 0);
449  $page++;
450  $pdf->AddPage();
451  $this->_pagehead($pdf, $page, 0, $outputlangs);
452  $pdf->SetFont('','', $default_font_size - 1);
453  $yp = 0;
454  $total += $total_page;
455  $total_page = 0;
456  }
457 
458  $pdf->SetXY($this->posxdate - 1, $this->tab_top + 10 + $yp);
459  $pdf->MultiCell($this->posxpaymenttype - $this->posxdate + 1, $this->line_height, $lines[$j][1], 0, 'L', 1);
460 
461  $pdf->SetXY($this->posxpaymenttype, $this->tab_top + 10 + $yp);
462  $pdf->MultiCell($this->posxinvoiceamount - $this->posxpaymenttype, $this->line_height, $lines[$j][2].' '.$lines[$j][3], 0, 'L', 1);
463 
464  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp);
465  $pdf->MultiCell($this->posxpaymentamount- $this->posxinvoiceamount, $this->line_height, '', 0, 'R', 1);
466 
467  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
468  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][4], 0, 'R', 1);
469  $yp = $yp + 5;
470  $total_page += $lines[$j][9];
471  }
472 
473  // Invoice number
474  $pdf->SetXY($this->posxinvoice, $this->tab_top + 10 + $yp);
475  $pdf->MultiCell($this->posxinvoice - $this->posxbankaccount, $this->line_height, $lines[$j][0], 0, 'L', 0);
476 
477  // BankAccount
478  $pdf->SetXY($this->posxbankaccount, $this->tab_top + 10 + $yp);
479  $pdf->MultiCell($this->posxbankaccount - $this->posxdate, $this->line_height, $lines[$j][8], 0, 'L', 0);
480 
481  // Invoice amount
482  $pdf->SetXY($this->posxinvoiceamount, $this->tab_top + 10 + $yp);
483  $pdf->MultiCell($this->posxpaymentamount- $this->posxinvoiceamount - 1, $this->line_height, $lines[$j][5], 0, 'R', 0);
484 
485  // Payment amount
486  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
487  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $lines[$j][6], 0, 'R', 0);
488  $yp = $yp + 5;
489 
490  if ($oldprowid <> $lines[$j][7])
491  {
492  $oldprowid = $lines[$j][7];
493  }
494  }
495  $total += $total_page;
496  $pdf->SetXY($this->posxpaymentamount, $this->tab_top + 10 + $yp);
497  $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->posxpaymentamount, $this->line_height, $langs->transnoentities('Total')." : ".price($total), 0, 'R', 0);
498  }
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.
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...
</td >< tdclass="liste_titre"align="right"></td ></tr >< trclass="liste_titre">< inputtype="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< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="'.$i.'"'.$disabled.'></td >< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"></td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
Definition: replenish.php:554
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:256
dol_get_first_day($year, $month=1, $gm=false)
Return GMT time for first day of a month or year.
Definition: date.lib.php:445
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:233
Class to manage hooks.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
if($_POST["cancel"]==$langs->trans("Cancel")&&!$id) if($action== 'setdatev'&&$user->rights->tax->charges->creer) if($action== 'add'&&$_POST["cancel"]<> $langs->trans("Cancel")) if($action== 'delete') $title
Actions.
Definition: card.php:183
getEntity($element, $shared=1, $forceentity=null)
Get list of entity id to use.
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:459
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.
type
Definition: viewcat.php:283