dolibarr  7.0.0-beta
pdf_sepamandate.modules.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; either version 3 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  * or see http://www.gnu.org/
17  */
18 
25 require_once DOL_DOCUMENT_ROOT.'/core/modules/bank/modules_bank.php';
26 require_once DOL_DOCUMENT_ROOT.'/societe/class/companybankaccount.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
29 require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
30 
31 
37 {
38  var $emetteur; // Objet societe qui emet
39  var $version = 'dolibarr';
40 
46  function __construct($db)
47  {
48  global $conf,$langs,$mysoc;
49 
50  $langs->load("main");
51  $langs->load("bank");
52  $langs->load("withdrawals");
53  $langs->load("companies");
54 
55  $this->db = $db;
56  $this->name = "sepamandate";
57  $this->description = $langs->transnoentitiesnoconv("DocumentModelSepaMandate");
58 
59  // Dimension page pour format A4
60  $this->type = 'pdf';
61  $formatarray=pdf_getFormat();
62  $this->page_largeur = $formatarray['width'];
63  $this->page_hauteur = $formatarray['height'];
64  $this->format = array($this->page_largeur,$this->page_hauteur);
65  $this->marge_gauche=isset($conf->global->MAIN_PDF_MARGIN_LEFT)?$conf->global->MAIN_PDF_MARGIN_LEFT:10;
66  $this->marge_droite=isset($conf->global->MAIN_PDF_MARGIN_RIGHT)?$conf->global->MAIN_PDF_MARGIN_RIGHT:10;
67  $this->marge_haute =isset($conf->global->MAIN_PDF_MARGIN_TOP)?$conf->global->MAIN_PDF_MARGIN_TOP:10;
68  $this->marge_basse =isset($conf->global->MAIN_PDF_MARGIN_BOTTOM)?$conf->global->MAIN_PDF_MARGIN_BOTTOM:10;
69 
70  $this->option_logo = 1; // Affiche logo FAC_PDF_LOGO
71  $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
72  $this->option_codeproduitservice = 1; // Affiche code produit-service
73 
74  // Recupere emmetteur
75  $this->emetteur=$mysoc;
76  if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default if not defined
77 
78  // Defini position des colonnes
79  $this->posxref=$this->marge_gauche+1;
80  $this->posxlabel=$this->marge_gauche+25;
81  $this->posxworkload=$this->marge_gauche+100;
82  $this->posxprogress=$this->marge_gauche+130;
83  $this->posxdatestart=$this->marge_gauche+150;
84  $this->posxdateend=$this->marge_gauche+170;
85  }
86 
87 
100  function write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
101  {
102  global $conf, $hookmanager, $langs, $user, $mysoc;
103 
104  if (! is_object($outputlangs)) $outputlangs=$langs;
105  // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
106  if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
107 
108  $outputlangs->load("main");
109  $outputlangs->load("dict");
110  $outputlangs->load("companies");
111  $outputlangs->load("projects");
112  $outputlangs->load("withdrawals");
113  $outputlangs->load("bills");
114 
115  if (! empty($conf->bank->dir_output))
116  {
117  //$nblignes = count($object->lines); // This is set later with array of tasks
118 
119  // Definition of $dir and $file
120  if ($object->specimen)
121  {
122  if (! empty($moreparams['force_dir_output'])) $dir = $moreparams['force_dir_output'];
123  else $dir = $conf->bank->dir_output;
124  $file = $dir . "/SPECIMEN.pdf";
125  }
126  else
127  {
128  $objectref = dol_sanitizeFileName($object->ref);
129  if (! empty($moreparams['force_dir_output'])) $dir = $moreparams['force_dir_output'];
130  else $dir = $conf->bank->dir_output . "/" . $objectref;
131  $file = $dir . "/" . $langs->transnoentitiesnoconv("SepaMandateShort").' '.$objectref . "-".dol_sanitizeFileName($object->rum).".pdf";
132  }
133 
134  if (! file_exists($dir))
135  {
136  if (dol_mkdir($dir) < 0)
137  {
138  $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
139  return 0;
140  }
141  }
142 
143  if (file_exists($dir))
144  {
145  // Add pdfgeneration hook
146  if (! is_object($hookmanager))
147  {
148  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
149  $hookmanager=new HookManager($this->db);
150  }
151  $hookmanager->initHooks(array('pdfgeneration'));
152  $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
153  global $action;
154  $reshook=$hookmanager->executeHooks('beforePDFCreation',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
155 
156  $pdf=pdf_getInstance($this->format);
157  $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance
158  $heightforinfotot = 50; // Height reserved to output the info and total part
159  $heightforfreetext= (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT)?$conf->global->MAIN_PDF_FREETEXT_HEIGHT:5); // Height reserved to output the free text on last page
160  $heightforfooter = $this->marge_basse + 8; // Height reserved to output the footer (value include bottom margin)
161  $pdf->SetAutoPageBreak(1,0);
162 
163  if (class_exists('TCPDF'))
164  {
165  $pdf->setPrintHeader(false);
166  $pdf->setPrintFooter(false);
167  }
168  $pdf->SetFont(pdf_getPDFFont($outputlangs));
169 
170  $pdf->Open();
171  $pagenb=0;
172  $pdf->SetDrawColor(128,128,128);
173 
174  $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
175  $pdf->SetSubject($outputlangs->transnoentities("SepaMandate"));
176  $pdf->SetCreator("Dolibarr ".DOL_VERSION);
177  $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
178  $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("SepaMandate"));
179  if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
180 
181  $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
182 
183  // New page
184  $pdf->AddPage();
185  $pagenb++;
186  $this->_pagehead($pdf, $object, 1, $outputlangs);
187  $pdf->SetFont('','', $default_font_size - 1);
188  $pdf->MultiCell(0, 3, ''); // Set interline to 3
189  $pdf->SetTextColor(0,0,0);
190 
191  $tab_top = 50;
192  $tab_height = 200;
193  $tab_top_newpage = 40;
194  $tab_height_newpage = 210;
195 
196  // Affiche notes
197  if (! empty($object->note_public))
198  {
199  $pdf->SetFont('','', $default_font_size - 1);
200  $pdf->writeHTMLCell(190, 3, $this->posxref-1, $tab_top-2, dol_htmlentitiesbr($object->note_public), 0, 1);
201  $nexY = $pdf->GetY();
202  $height_note=$nexY-($tab_top-2);
203 
204  // Rect prend une longueur en 3eme param
205  $pdf->SetDrawColor(192,192,192);
206  $pdf->Rect($this->marge_gauche, $tab_top-3, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
207 
208  $tab_height = $tab_height - $height_note;
209  $tab_top = $nexY+6;
210  }
211  else
212  {
213  $height_note=0;
214  }
215 
216  $iniY = $tab_top + 7;
217  $curY = $tab_top + 7;
218  $nexY = $tab_top + 7;
219 
220  $posY = $curY;
221 
222  $pdf->SetFont('','', $default_font_size);
223 
224  $pdf->line($this->marge_gauche, $posY, $this->page_largeur - $this->marge_droite, $posY);
225  $posY+=2;
226 
227  $pdf->SetXY($this->marge_gauche, $posY);
228  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("RUMLong").' ('.$outputlangs->transnoentitiesnoconv("RUM").')'.' : '.$object->rum, 0, 'L');
229 
230  $posY=$pdf->GetY();
231  $posY+=2;
232  $pdf->SetXY($this->marge_gauche, $posY);
233  $ics='';
234  if (! empty($conf->global->PRELEVEMENT_ICS)) $ics=$conf->global->PRELEVEMENT_ICS;
235  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("CreditorIdentifier").' ('.$outputlangs->transnoentitiesnoconv("ICS").')'.' : '.$ics, 0, 'L');
236 
237  $posY=$pdf->GetY();
238  $posY+=1;
239  $pdf->SetXY($this->marge_gauche, $posY);
240  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("CreditorName").' : '.$mysoc->name, 0, 'L');
241 
242  $posY=$pdf->GetY();
243  $posY+=1;
244  $pdf->SetXY($this->marge_gauche, $posY);
245  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("Address").' : ', 0, 'L');
246  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $mysoc->getFullAddress(), 0, 'L');
247 
248  $posY=$pdf->GetY();
249  $posY+=3;
250 
251  $pdf->line($this->marge_gauche, $posY, $this->page_largeur - $this->marge_droite, $posY);
252 
253  $pdf->SetFont('','', $default_font_size - 1);
254 
255  $posY+=8;
256  $pdf->SetXY($this->marge_gauche, $posY);
257  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 8, $outputlangs->transnoentitiesnoconv("SEPALegalText", $mysoc->name, $mysoc->name), 0, 'L');
258 
259  // Your data form
260  $posY=$pdf->GetY();
261  $posY+=8;
262  $pdf->line($this->marge_gauche, $posY, $this->page_largeur - $this->marge_droite, $posY);
263  $posY+=2;
264 
265  $pdf->SetFont('','', $default_font_size);
266 
267  $pdf->SetXY($this->marge_gauche, $posY);
268  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("SEPAFillForm"), 0, 'C');
269 
270  $thirdparty=new Societe($this->db);
271  if ($object->socid > 0) $thirdparty->fetch($object->socid);
272 
273  $sepaname = '______________________________________________';
274  if ($thirdparty->id > 0)
275  {
276  $sepaname = $thirdparty->name.($object->account_owner?' ('.$object->account_owner.')':'');
277  }
278  $posY=$pdf->GetY();
279  $posY+=3;
280  $pdf->SetXY($this->marge_gauche, $posY);
281  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("SEPAFormYourName").' * : ', 0, 'L');
282  $pdf->SetXY(80, $posY);
283  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $sepaname, 0, 'L');
284 
285  $address = '______________________________________________';
286  if ($thirdparty->id > 0)
287  {
288  $address = $thirdparty->getFullAddress();
289  }
290  $posY=$pdf->GetY();
291  $posY+=1;
292  $pdf->SetXY($this->marge_gauche, $posY);
293  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("Address").' : ', 0, 'L');
294  $pdf->SetXY(80, $posY);
295  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $address, 0, 'L');
296  if (preg_match('/_____/', $address))
297  {
298  $posY+=6;
299  $pdf->SetXY(80, $posY);
300  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $address, 0, 'L');
301  }
302 
303  $ban = '__________________________________________________';
304  if (! empty($object->iban)) $ban = $object->iban;
305  $posY=$pdf->GetY();
306  $posY+=1;
307  $pdf->SetXY($this->marge_gauche, $posY);
308  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("SEPAFormYourBAN").' * : ', 0, 'L');
309  $pdf->SetXY(80, $posY);
310  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $ban, 0, 'L');
311 
312  $bic = '__________________________________________________';
313  if (! empty($object->bic)) $bic = $object->bic;
314  $posY=$pdf->GetY();
315  $posY+=1;
316  $pdf->SetXY($this->marge_gauche, $posY);
317  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $outputlangs->transnoentitiesnoconv("SEPAFormYourBIC").' * : ', 0, 'L');
318  $pdf->SetXY(80, $posY);
319  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $bic, 0, 'L');
320 
321 
322  $posY=$pdf->GetY();
323  $posY+=1;
324  $pdf->SetXY($this->marge_gauche, $posY);
325  $txt = $outputlangs->transnoentitiesnoconv("SEPAFrstOrRecur").' * : ';
326  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
327  $pdf->Rect(80, $posY, 5, 5);
328  $pdf->SetXY(80, $posY);
329  if ($object->frstrecur == 'RECUR') $pdf->MultiCell(5, 3, 'X', 0, 'L');
330  $pdf->SetXY(86, $posY);
331  $txt = $langs->transnoentitiesnoconv("ModeRECUR").' '.$langs->transnoentitiesnoconv("or");
332  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
333  $posY+=6;
334  $pdf->Rect(80, $posY, 5, 5);
335  $pdf->SetXY(80, $posY);
336  if ($object->frstrecur == 'FRST') $pdf->MultiCell(5, 3, 'X', 0, 'L');
337  $pdf->SetXY(86, $posY);
338  $txt = $langs->transnoentitiesnoconv("ModeFRST");
339  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
340  if (empty($object->frstrecur))
341  {
342  $posY+=6;
343  $pdf->SetXY(80, $posY);
344  $txt = '('.$langs->transnoentitiesnoconv("PleaseCheckOne").')';
345  $pdf->MultiCell($this->page_largeur - $this->marge_gauche - $this->marge_droite, 3, $txt, 0, 'L');
346  }
347 
348  $posY=$pdf->GetY();
349  $posY+=3;
350  $pdf->line($this->marge_gauche, $posY, $this->page_largeur - $this->marge_droite, $posY);
351  $posY+=3;
352 
353 
354  // Show square
355  if ($pagenb == 1)
356  {
357  $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
358  $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
359  }
360  else
361  {
362  $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
363  $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
364  }
365 
366  /*var_dump($tab_top);
367  var_dump($heightforinfotot);
368  var_dump($heightforfreetext);
369  var_dump($heightforfooter);
370  var_dump($bottomlasttab);*/
371 
372  // Affiche zone infos
373  $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
374 
375  /*
376  * Pied de page
377  */
378  $this->_pagefoot($pdf,$object,$outputlangs);
379  if (method_exists($pdf,'AliasNbPages')) $pdf->AliasNbPages();
380 
381  $pdf->Close();
382 
383  $pdf->Output($file,'F');
384 
385  // Add pdfgeneration hook
386  if (! is_object($hookmanager))
387  {
388  include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php';
389  $hookmanager=new HookManager($this->db);
390  }
391  $hookmanager->initHooks(array('pdfgeneration'));
392  $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
393  global $action;
394  $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
395 
396  if (! empty($conf->global->MAIN_UMASK))
397  @chmod($file, octdec($conf->global->MAIN_UMASK));
398 
399  $this->result = array('fullpath'=>$file);
400 
401  return 1; // Pas d'erreur
402  }
403  else
404  {
405  $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
406  return 0;
407  }
408  }
409 
410  $this->error=$langs->transnoentities("ErrorConstantNotDefined","LIVRAISON_OUTPUTDIR");
411  return 0;
412  }
413 
414 
427  function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
428  {
429  global $conf,$mysoc;
430 
431  $default_font_size = pdf_getPDFFontSize($outputlangs);
432 
433  }
434 
435 
445  function _tableau_info(&$pdf, $object, $posy, $outputlangs)
446  {
447  global $conf, $mysoc;
448 
449  $default_font_size = pdf_getPDFFontSize($outputlangs);
450 
451  $diffsizetitle=(empty($conf->global->PDF_DIFFSIZE_TITLE)?1:$conf->global->PDF_DIFFSIZE_TITLE);
452 
453  $posy+=$this->_signature_area($pdf, $object, $posy, $outputlangs);
454 
455  $pdf->SetXY($this->marge_gauche, $posy);
456  $pdf->SetFont('','', $default_font_size);
457  $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("PleaseReturnMandate", $mysoc->email).':', 0, 'L', 0);
458  $posy=$pdf->GetY()+2;
459 
460  $pdf->SetXY($this->marge_gauche, $posy);
461  $pdf->SetFont('','', $default_font_size - $diffsizetitle);
462  $pdf->MultiCell(100, 6, $mysoc->name, 0, 'L', 0);
463  $pdf->MultiCell(100, 6, $outputlangs->convToOutputCharset($mysoc->getFullAddress()), 0, 'L', 0);
464  $posy=$pdf->GetY()+2;
465 
466  return $posy;
467  }
468 
469 
470 
480  function _signature_area(&$pdf, $object, $posy, $outputlangs)
481  {
482  $default_font_size = pdf_getPDFFontSize($outputlangs);
483  $tab_top = $posy + 4;
484  $tab_hl = 4;
485 
486  $posx = $this->marge_gauche;
487  $pdf->SetXY($posx, $tab_top + 0);
488 
489  $pdf->SetFont('','', $default_font_size - 2);
490 
491  $pdf->MultiCell(100, 3, $outputlangs->transnoentitiesnoconv("DateOfSignature"), 0, 'L', 0);
492  $pdf->MultiCell(100, 3, ' ');
493  $pdf->MultiCell(100, 3, '______________________', 0, 'L', 0);
494 
495  $posx = 120;
496  $largcol = ($this->page_largeur - $this->marge_droite - $posx);
497  $useborder=0;
498  $index = 0;
499  // Total HT
500  $pdf->SetFillColor(255,255,255);
501  $pdf->SetXY($posx, $tab_top + 0);
502  $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentitiesnoconv("Signature"), 0, 'L', 1);
503 
504  $pdf->SetXY($posx, $tab_top + $tab_hl);
505  $pdf->MultiCell($largcol, $tab_hl*3, '', 1, 'R');
506 
507  return ($tab_hl*7);
508  }
509 
510 
520  function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
521  {
522  global $langs,$conf,$mysoc;
523 
524  $default_font_size = pdf_getPDFFontSize($outputlangs);
525 
526  pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
527 
528  $pdf->SetTextColor(0,0,60);
529  $pdf->SetFont('','B', $default_font_size + 3);
530 
531  $posx=$this->page_largeur-$this->marge_droite-100;
532  $posy=$this->marge_haute;
533 
534  $pdf->SetXY($this->marge_gauche,$posy);
535 
536  // Logo
537  $logo=$conf->mycompany->dir_output.'/logos/'.$mysoc->logo;
538  if ($mysoc->logo)
539  {
540  if (is_readable($logo))
541  {
542  $height=pdf_getHeightForLogo($logo);
543  $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
544  }
545  else
546  {
547  $pdf->SetTextColor(200,0,0);
548  $pdf->SetFont('','B', $default_font_size - 2);
549  $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
550  $pdf->MultiCell(100, 3, $langs->transnoentities("ErrorGoToModuleSetup"), 0, 'L');
551  }
552  }
553  else $pdf->MultiCell(100, 4, $outputlangs->transnoentities($this->emetteur->name), 0, 'L');
554 
555  $pdf->SetFont('','B', $default_font_size + 3);
556  $pdf->SetXY($posx,$posy);
557  $pdf->SetTextColor(0,0,60);
558  $pdf->MultiCell(100, 4, $outputlangs->transnoentities("SepaMandate"), '', 'R');
559  $pdf->SetFont('','', $default_font_size + 2);
560 
561  $posy+=6;
562  $pdf->SetXY($posx,$posy);
563  $pdf->SetTextColor(0,0,60);
564  $daterum = '__________________';
565  if (! empty($object->date_rum))
566  {
567  $daterum = dol_print_date($object->date_rum,'day',false,$outputlangs,true);
568  }
569  else $daterum = dol_print_date($object->datec,'day',false,$outputlangs,true); // For old record, the date_rum was not saved.
570  $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Date")." : " . $daterum, '', 'R');
571  /*$posy+=6;
572  $pdf->SetXY($posx,$posy);
573  $pdf->MultiCell(100, 4, $outputlangs->transnoentities("DateEnd")." : " . dol_print_date($object->date_end,'day',false,$outputlangs,true), '', 'R');
574  */
575 
576  $pdf->SetTextColor(0,0,60);
577 
578  // Add list of linked objects
579  /* Removed: A project can have more than thousands linked objects (orders, invoices, proposals, etc....
580  $object->fetchObjectLinked();
581 
582  foreach($object->linkedObjects as $objecttype => $objects)
583  {
584  var_dump($objects);exit;
585  if ($objecttype == 'commande')
586  {
587  $outputlangs->load('orders');
588  $num=count($objects);
589  for ($i=0;$i<$num;$i++)
590  {
591  $posy+=4;
592  $pdf->SetXY($posx,$posy);
593  $pdf->SetFont('','', $default_font_size - 1);
594  $text=$objects[$i]->ref;
595  if ($objects[$i]->ref_client) $text.=' ('.$objects[$i]->ref_client.')';
596  $pdf->MultiCell(100, 4, $outputlangs->transnoentities("RefOrder")." : ".$outputlangs->transnoentities($text), '', 'R');
597  }
598  }
599  }
600  */
601 
602  }
603 
613  function _pagefoot(&$pdf,$object,$outputlangs,$hidefreetext=0)
614  {
615  global $conf;
616  $showdetails=$conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
617  return pdf_pagefoot($pdf,$outputlangs,'PAYMENTORDER_FREE_TEXT',null,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object,$showdetails,$hidefreetext);
618  }
619 
620 }
621 
Parent class for bank account models.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
Definition: pdf.lib.php:82
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
Definition: pdf.lib.php:580
</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
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0, $moreparams=null)
Fonction generant le projet sur le disque.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Definition: pdf.lib.php:256
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
Definition: pdf.lib.php:233
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
Class to manage hooks.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
Class to manage third parties objects (customers, suppliers, prospects...)
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
Definition: pdf.lib.php:852
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
Definition: pdf.lib.php:277
Classe permettant de generer les projets au modele SEPAMandate.
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition: repair.php:104
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_mkdir($dir, $dataroot='', $newmask=null)
Creation of a directory (this can create recursive subdir)
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
_signature_area(&$pdf, $object, $posy, $outputlangs)
Show area for the customer to sign.
type
Definition: viewcat.php:283
__construct($db)
Constructor.