PageRenderTime 67ms CodeModel.GetById 31ms RepoModel.GetById 1ms app.codeStats 0ms

/htdocs/commande/core/modules/commande/doc/pdf_einstein.modules.php

https://bitbucket.org/speedealing/speedealing
PHP | 1077 lines | 725 code | 171 blank | 181 comment | 114 complexity | b94e5d3f2623c93f8539047f88c03447 MD5 | raw file
Possible License(s): LGPL-3.0, LGPL-2.1, GPL-3.0, MIT
  1. <?php
  2. /* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
  4. * Copyright (C) 2008 Raphael Bertrand <raphael.bertrand@resultic.fr>
  5. * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 3 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. * or see http://www.gnu.org/
  20. */
  21. /**
  22. * \file htdocs/core/modules/commande/doc/pdf_einstein.modules.php
  23. * \ingroup commande
  24. * \brief Fichier de la classe permettant de generer les commandes au modele Einstein
  25. */
  26. require_once DOL_DOCUMENT_ROOT .'/commande/core/modules/commande/modules_commande.php';
  27. require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php';
  28. require_once DOL_DOCUMENT_ROOT.'/societe/lib/societe.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
  30. require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
  31. /**
  32. * Classe permettant de generer les commandes au modele Einstein
  33. */
  34. class pdf_einstein extends ModelePDFCommandes
  35. {
  36. var $db;
  37. var $name;
  38. var $description;
  39. var $type;
  40. var $phpmin = array(4,3,0); // Minimum version of PHP required by module
  41. var $version = 'dolibarr';
  42. var $page_largeur;
  43. var $page_hauteur;
  44. var $format;
  45. var $marge_gauche;
  46. var $marge_droite;
  47. var $marge_haute;
  48. var $marge_basse;
  49. var $emetteur; // Objet societe qui emet
  50. /**
  51. * Constructor
  52. *
  53. * @param DoliDB $db Database handler
  54. */
  55. function __construct($db = '')
  56. {
  57. global $conf,$langs,$mysoc;
  58. $langs->load("main");
  59. $langs->load("bills");
  60. $this->db = $db;
  61. $this->name = "einstein";
  62. $this->description = $langs->trans('PDFEinsteinDescription');
  63. // Dimension page pour format A4
  64. $this->type = 'pdf';
  65. $formatarray=pdf_getFormat();
  66. $this->page_largeur = $formatarray['width'];
  67. $this->page_hauteur = $formatarray['height'];
  68. $this->format = array($this->page_largeur,$this->page_hauteur);
  69. $this->marge_gauche=10;
  70. $this->marge_droite=10;
  71. $this->marge_haute=10;
  72. $this->marge_basse=10;
  73. $this->option_logo = 1; // Affiche logo
  74. $this->option_tva = 1; // Gere option tva FACTURE_TVAOPTION
  75. $this->option_modereg = 1; // Affiche mode reglement
  76. $this->option_condreg = 1; // Affiche conditions reglement
  77. $this->option_codeproduitservice = 1; // Affiche code produit-service
  78. $this->option_multilang = 1; // Dispo en plusieurs langues
  79. $this->option_escompte = 0; // Affiche si il y a eu escompte
  80. $this->option_credit_note = 0; // Support credit notes
  81. $this->option_freetext = 1; // Support add of a personalised text
  82. $this->option_draft_watermark = 1; // Support add of a watermark on drafts
  83. $this->franchise=!$mysoc->tva_assuj;
  84. // Get source company
  85. $this->emetteur=$mysoc;
  86. if (! $this->emetteur->country_code) $this->emetteur->country_code=substr($langs->defaultlang,-2); // By default, if was not defined
  87. // Defini position des colonnes
  88. $this->posxdesc=$this->marge_gauche+1;
  89. $this->posxtva=111;
  90. $this->posxup=126;
  91. $this->posxqty=145;
  92. $this->posxdiscount=162;
  93. $this->postotalht=174;
  94. $this->tva=array();
  95. $this->localtax1=array();
  96. $this->localtax2=array();
  97. $this->atleastoneratenotnull=0;
  98. $this->atleastonediscount=0;
  99. }
  100. /**
  101. * Function to build pdf onto disk
  102. *
  103. * @param int $object Id of object to generate
  104. * @param object $outputlangs Lang output object
  105. * @param string $srctemplatepath Full path of source filename for generator using a template file
  106. * @param int $hidedetails Do not show line details
  107. * @param int $hidedesc Do not show desc
  108. * @param int $hideref Do not show ref
  109. * @return int 1=OK, 0=KO
  110. */
  111. function write_file($object,$outputlangs,$srctemplatepath='',$hidedetails=0,$hidedesc=0,$hideref=0)
  112. {
  113. global $user,$langs,$conf,$hookmanager;
  114. if (! is_object($outputlangs)) $outputlangs=$langs;
  115. // For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
  116. if (! empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output='ISO-8859-1';
  117. $outputlangs->load("main");
  118. $outputlangs->load("dict");
  119. $outputlangs->load("companies");
  120. $outputlangs->load("bills");
  121. $outputlangs->load("products");
  122. $outputlangs->load("orders");
  123. $default_font_size = pdf_getPDFFontSize($outputlangs);
  124. if ($conf->commande->dir_output)
  125. {
  126. $object->fetch_thirdparty();
  127. $deja_regle = "";
  128. // Definition of $dir and $file
  129. if ($object->specimen)
  130. {
  131. $dir = $conf->commande->dir_output;
  132. $file = $dir . "/SPECIMEN.pdf";
  133. }
  134. else
  135. {
  136. $objectref = dol_sanitizeFileName($object->ref);
  137. $dir = $conf->commande->dir_output . "/" . $objectref;
  138. $file = $dir . "/" . $objectref . ".pdf";
  139. }
  140. if (! file_exists($dir))
  141. {
  142. if (dol_mkdir($dir) < 0)
  143. {
  144. $this->error=$langs->transnoentities("ErrorCanNotCreateDir",$dir);
  145. return 0;
  146. }
  147. }
  148. if (file_exists($dir))
  149. {
  150. $nblignes = count($object->lines);
  151. $pdf=pdf_getInstance($this->format);
  152. $heightforinfotot = 50; // Height reserved to output the info and total part (value include bottom margin)
  153. $heightforfooter = 25; // Height reserved to output the footer (value include bottom margin)
  154. $pdf->SetAutoPageBreak(1,0);
  155. if (class_exists('TCPDF'))
  156. {
  157. $pdf->setPrintHeader(false);
  158. $pdf->setPrintFooter(false);
  159. }
  160. $pdf->SetFont(pdf_getPDFFont($outputlangs));
  161. // Set path to the background PDF File
  162. if (empty($conf->global->MAIN_DISABLE_FPDI) && ! empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
  163. {
  164. $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
  165. $tplidx = $pdf->importPage(1);
  166. }
  167. $pdf->Open();
  168. $pagenb=0;
  169. $pdf->SetDrawColor(128,128,128);
  170. $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
  171. $pdf->SetSubject($outputlangs->transnoentities("Order"));
  172. $pdf->SetCreator("Speedealing ".DOL_VERSION);
  173. $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
  174. $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref)." ".$outputlangs->transnoentities("Order"));
  175. if (! empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(false);
  176. $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite); // Left, Top, Right
  177. // Positionne $this->atleastonediscount si on a au moins une remise
  178. for ($i = 0 ; $i < $nblignes ; $i++)
  179. {
  180. if ($object->lines[$i]->remise_percent)
  181. {
  182. $this->atleastonediscount++;
  183. }
  184. }
  185. // New page
  186. $pdf->AddPage();
  187. if (! empty($tplidx)) $pdf->useTemplate($tplidx);
  188. $pagenb++;
  189. $this->_pagehead($pdf, $object, 1, $outputlangs);
  190. $pdf->SetFont('','', $default_font_size - 1);
  191. $pdf->MultiCell(0, 3, ''); // Set interline to 3
  192. $pdf->SetTextColor(0,0,0);
  193. $tab_top = 90;
  194. $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)?42:10);
  195. $tab_height = 130;
  196. $tab_height_newpage = 150;
  197. // Affiche notes
  198. if (! empty($object->note_public))
  199. {
  200. $tab_top = 88;
  201. $pdf->SetFont('','', $default_font_size - 1);
  202. $pdf->writeHTMLCell(190, 3, $this->posxdesc-1, $tab_top, dol_htmlentitiesbr($object->note_public), 0, 1);
  203. $nexY = $pdf->GetY();
  204. $height_note=$nexY-$tab_top;
  205. // Rect prend une longueur en 3eme param
  206. $pdf->SetDrawColor(192,192,192);
  207. $pdf->Rect($this->marge_gauche, $tab_top-1, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $height_note+1);
  208. $tab_height = $tab_height - $height_note;
  209. $tab_top = $nexY+6;
  210. }
  211. else
  212. {
  213. $height_note=0;
  214. }
  215. $iniY = $tab_top + 7;
  216. $curY = $tab_top + 7;
  217. $nexY = $tab_top + 7;
  218. // Loop on each lines
  219. for ($i = 0 ; $i < $nblignes ; $i++)
  220. {
  221. $curY = $nexY;
  222. $pdf->SetFont('','', $default_font_size - 1); // Into loop to work with multipage
  223. $pdf->SetTextColor(0,0,0);
  224. $pdf->setTopMargin($tab_top_newpage);
  225. $pdf->setPageOrientation('', 1, $this->marge_basse+$heightforfooter+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
  226. $pageposbefore=$pdf->getPage();
  227. // Description of product line
  228. $curX = $this->posxdesc-1;
  229. pdf_writelinedesc($pdf,$object,$i,$outputlangs,$this->posxtva-$curX,3,$curX,$curY,$hideref,$hidedesc);
  230. $nexY = $pdf->GetY();
  231. $pageposafter=$pdf->getPage();
  232. $pdf->setPage($pageposbefore);
  233. $pdf->setTopMargin($this->marge_haute);
  234. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
  235. // We suppose that a too long description is moved completely on next page
  236. if ($pageposafter > $pageposbefore) {
  237. $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
  238. }
  239. $pdf->SetFont('','', $default_font_size - 1); // On repositionne la police par defaut
  240. // VAT Rate
  241. if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
  242. {
  243. $vat_rate = pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails);
  244. $pdf->SetXY($this->posxtva, $curY);
  245. $pdf->MultiCell($this->posxup-$this->posxtva-1, 3, $vat_rate, 0, 'R');
  246. }
  247. // Unit price before discount
  248. $up_excl_tax = price($object->lines[$i]->pu_ht);//pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails);
  249. $pdf->SetXY($this->posxup, $curY);
  250. $pdf->MultiCell($this->posxqty-$this->posxup-1, 3, $up_excl_tax, 0, 'R', 0);
  251. // Quantity
  252. $qty = pdf_getlineqty($object, $i, $outputlangs, $hidedetails);
  253. $pdf->SetXY($this->posxqty, $curY);
  254. $pdf->MultiCell($this->posxdiscount-$this->posxqty-1, 3, $qty, 0, 'R'); // Enough for 6 chars
  255. // Discount on line
  256. if ($object->lines[$i]->remise_percent)
  257. {
  258. $pdf->SetXY($this->posxdiscount-2, $curY);
  259. $remise_percent = pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails);
  260. $pdf->MultiCell($this->postotalht-$this->posxdiscount+2, 3, $remise_percent, 0, 'R');
  261. }
  262. // Total HT line
  263. $total_excl_tax = pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails);
  264. $pdf->SetXY($this->postotalht, $curY);
  265. $pdf->MultiCell($this->page_largeur-$this->marge_droite-$this->postotalht, 3, $total_excl_tax, 0, 'R', 0);
  266. // Collecte des totaux par valeur de tva dans $this->tva["taux"]=total_tva
  267. $tvaligne=$object->lines[$i]->total_tva;
  268. $localtax1ligne=$object->lines[$i]->total_localtax1;
  269. $localtax2ligne=$object->lines[$i]->total_localtax2;
  270. if ($object->remise_percent) $tvaligne-=($tvaligne*$object->remise_percent)/100;
  271. if ($object->remise_percent) $localtax1ligne-=($localtax1ligne*$object->remise_percent)/100;
  272. if ($object->remise_percent) $localtax2ligne-=($localtax2ligne*$object->remise_percent)/100;
  273. $vatrate=(string) $object->lines[$i]->tva_tx;
  274. $localtax1rate=(string) $object->lines[$i]->localtax1_tx;
  275. $localtax2rate=(string) $object->lines[$i]->localtax2_tx;
  276. if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate.='*';
  277. if (! isset($this->tva[$vatrate])) $this->tva[$vatrate]='';
  278. if (! isset($this->localtax1[$localtax1rate])) $this->localtax1[$localtax1rate]='';
  279. if (! isset($this->localtax2[$localtax2rate])) $this->localtax2[$localtax2rate]='';
  280. $this->tva[$vatrate] += $tvaligne;
  281. $this->localtax1[$localtax1rate]+=$localtax1ligne;
  282. $this->localtax2[$localtax2rate]+=$localtax2ligne;
  283. $nexY+=2; // Passe espace entre les lignes
  284. // Detect if some page were added automatically and output _tableau for past pages
  285. while ($pagenb < $pageposafter)
  286. {
  287. $pdf->setPage($pagenb);
  288. if ($pagenb == 1)
  289. {
  290. $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
  291. }
  292. else
  293. {
  294. $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
  295. }
  296. $this->_pagefoot($pdf,$object,$outputlangs);
  297. $pagenb++;
  298. $pdf->setPage($pagenb);
  299. $pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
  300. if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
  301. }
  302. if (isset($object->lines[$i+1]->pagebreak) && $object->lines[$i+1]->pagebreak)
  303. {
  304. if ($pagenb == 1)
  305. {
  306. $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
  307. }
  308. else
  309. {
  310. $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
  311. }
  312. $this->_pagefoot($pdf,$object,$outputlangs);
  313. // New page
  314. $pdf->AddPage();
  315. if (! empty($tplidx)) $pdf->useTemplate($tplidx);
  316. $pagenb++;
  317. if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
  318. }
  319. }
  320. // Show square
  321. if ($pagenb == 1)
  322. {
  323. $this->_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfooter, 0, $outputlangs, 0, 0);
  324. $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
  325. }
  326. else
  327. {
  328. $this->_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfooter, 0, $outputlangs, 1, 0);
  329. $bottomlasttab=$this->page_hauteur - $heightforinfotot - $heightforfooter + 1;
  330. }
  331. // Affiche zone infos
  332. $posy=$this->_tableau_info($pdf, $object, $bottomlasttab, $outputlangs);
  333. // Affiche zone totaux
  334. $posy=$this->_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
  335. // Affiche zone versements
  336. if ($deja_regle)
  337. {
  338. $posy=$this->_tableau_versements($pdf, $object, $posy, $outputlangs);
  339. }
  340. // Pied de page
  341. $this->_pagefoot($pdf,$object,$outputlangs);
  342. $pdf->AliasNbPages();
  343. $pdf->Close();
  344. $pdf->Output($file,'F');
  345. // Add pdfgeneration hook
  346. $hookmanager->initHooks(array('pdfgeneration'));
  347. $parameters=array('file'=>$file,'object'=>$object,'outputlangs'=>$outputlangs);
  348. global $action;
  349. $reshook=$hookmanager->executeHooks('afterPDFCreation',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
  350. if (! empty($conf->global->MAIN_UMASK))
  351. @chmod($file, octdec($conf->global->MAIN_UMASK));
  352. return 1; // Pas d'erreur
  353. }
  354. else
  355. {
  356. $this->error=$langs->trans("ErrorCanNotCreateDir",$dir);
  357. return 0;
  358. }
  359. }
  360. else
  361. {
  362. $this->error=$langs->trans("ErrorConstantNotDefined","COMMANDE_OUTPUTDIR");
  363. return 0;
  364. }
  365. $this->error=$langs->trans("ErrorUnknown");
  366. return 0; // Erreur par defaut
  367. }
  368. /**
  369. * Show payments table
  370. *
  371. * @param PDF &$pdf Object PDF
  372. * @param Object $object Object order
  373. * @param int $posy Position y in PDF
  374. * @param Translate $outputlangs Object langs for output
  375. * @return int <0 if KO, >0 if OK
  376. */
  377. function _tableau_versements(&$pdf, $object, $posy, $outputlangs)
  378. {
  379. }
  380. /**
  381. * Show miscellaneous information (payment mode, payment term, ...)
  382. *
  383. * @param PDF &$pdf Object PDF
  384. * @param Object $object Object to show
  385. * @param int $posy Y
  386. * @param Translate $outputlangs Langs object
  387. * @return void
  388. */
  389. function _tableau_info(&$pdf, $object, $posy, $outputlangs)
  390. {
  391. global $conf;
  392. $default_font_size = pdf_getPDFFontSize($outputlangs);
  393. $pdf->SetFont('','', $default_font_size - 1);
  394. // If France, show VAT mention if not applicable
  395. if ($this->emetteur->pays_code == 'FR' && $this->franchise == 1)
  396. {
  397. $pdf->SetFont('','B', $default_font_size - 2);
  398. $pdf->SetXY($this->marge_gauche, $posy);
  399. $pdf->MultiCell(100, 3, $outputlangs->transnoentities("VATIsNotUsedForInvoice"), 0, 'L', 0);
  400. $posy=$pdf->GetY()+4;
  401. }
  402. // Show payments conditions
  403. if ($object->cond_reglement_code || $object->cond_reglement)
  404. {
  405. $pdf->SetFont('','B', $default_font_size - 2);
  406. $pdf->SetXY($this->marge_gauche, $posy);
  407. $titre = $outputlangs->transnoentities("PaymentConditions").':';
  408. $pdf->MultiCell(80, 4, $titre, 0, 'L');
  409. $pdf->SetFont('','', $default_font_size - 2);
  410. $pdf->SetXY(52, $posy);
  411. $lib_condition_paiement=$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code)!=('PaymentCondition'.$object->cond_reglement_code)?$outputlangs->transnoentities("PaymentCondition".$object->cond_reglement_code):$outputlangs->convToOutputCharset($object->cond_reglement_doc);
  412. $lib_condition_paiement=str_replace('\n',"\n",$lib_condition_paiement);
  413. $pdf->MultiCell(80, 4, $lib_condition_paiement,0,'L');
  414. $posy=$pdf->GetY()+3;
  415. }
  416. // Check a payment mode is defined
  417. /* Not used with orders
  418. if (empty($object->mode_reglement_code)
  419. && ! $conf->global->FACTURE_CHQ_NUMBER
  420. && ! $conf->global->FACTURE_RIB_NUMBER)
  421. {
  422. $pdf->SetXY($this->marge_gauche, $posy);
  423. $pdf->SetTextColor(200,0,0);
  424. $pdf->SetFont('','B', $default_font_size - 2);
  425. $pdf->MultiCell(90, 3, $outputlangs->transnoentities("ErrorNoPaiementModeConfigured"),0,'L',0);
  426. $pdf->SetTextColor(0,0,0);
  427. $posy=$pdf->GetY()+1;
  428. }
  429. */
  430. // Show payment mode
  431. if ($object->mode_reglement_code
  432. && $object->mode_reglement_code != 'CHQ'
  433. && $object->mode_reglement_code != 'VIR')
  434. {
  435. $pdf->SetFont('','B', $default_font_size - 2);
  436. $pdf->SetXY($this->marge_gauche, $posy);
  437. $titre = $outputlangs->transnoentities("PaymentMode").':';
  438. $pdf->MultiCell(80, 5, $titre, 0, 'L');
  439. $pdf->SetFont('','', $default_font_size - 2);
  440. $pdf->SetXY(50, $posy);
  441. $lib_mode_reg=$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code)!=('PaymentType'.$object->mode_reglement_code)?$outputlangs->transnoentities("PaymentType".$object->mode_reglement_code):$outputlangs->convToOutputCharset($object->mode_reglement);
  442. $pdf->MultiCell(80, 5, $lib_mode_reg,0,'L');
  443. $posy=$pdf->GetY()+2;
  444. }
  445. // Show payment mode CHQ
  446. if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'CHQ')
  447. {
  448. // Si mode reglement non force ou si force a CHQ
  449. if (! empty($conf->global->FACTURE_CHQ_NUMBER))
  450. {
  451. if ($conf->global->FACTURE_CHQ_NUMBER > 0)
  452. {
  453. $account = new Account($this->db);
  454. $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
  455. $pdf->SetXY($this->marge_gauche, $posy);
  456. $pdf->SetFont('','B', $default_font_size - 3);
  457. $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedTo',$account->proprio).':',0,'L',0);
  458. $posy=$pdf->GetY()+1;
  459. $pdf->SetXY($this->marge_gauche, $posy);
  460. $pdf->SetFont('','', $default_font_size - 3);
  461. $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->adresse_proprio), 0, 'L', 0);
  462. $posy=$pdf->GetY()+2;
  463. }
  464. if ($conf->global->FACTURE_CHQ_NUMBER == -1)
  465. {
  466. $pdf->SetXY($this->marge_gauche, $posy);
  467. $pdf->SetFont('','B', $default_font_size - 3);
  468. $pdf->MultiCell(100, 3, $outputlangs->transnoentities('PaymentByChequeOrderedToShort').' '.$outputlangs->convToOutputCharset($this->emetteur->name).' '.$outputlangs->transnoentities('SendTo').':',0,'L',0);
  469. $posy=$pdf->GetY()+1;
  470. $pdf->SetXY($this->marge_gauche, $posy);
  471. $pdf->SetFont('','', $default_font_size - 3);
  472. $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0, 'L', 0);
  473. $posy=$pdf->GetY()+2;
  474. }
  475. }
  476. }
  477. // If payment mode not forced or forced to VIR, show payment with BAN
  478. if (empty($object->mode_reglement_code) || $object->mode_reglement_code == 'VIR')
  479. {
  480. if (! empty($conf->global->FACTURE_RIB_NUMBER))
  481. {
  482. $account = new Account($this->db);
  483. $account->fetch($conf->global->FACTURE_RIB_NUMBER);
  484. $curx=$this->marge_gauche;
  485. $cury=$posy;
  486. $posy=pdf_bank($pdf,$outputlangs,$curx,$cury,$account,0,$default_font_size);
  487. $posy+=2;
  488. }
  489. }
  490. return $posy;
  491. }
  492. /**
  493. * Show total to pay
  494. *
  495. * @param PDF &$pdf Object PDF
  496. * @param Facture $object Object invoice
  497. * @param int $deja_regle Montant deja regle
  498. * @param int $posy Position depart
  499. * @param Translate $outputlangs Objet langs
  500. * @return int Position pour suite
  501. */
  502. function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
  503. {
  504. global $conf,$mysoc;
  505. $default_font_size = pdf_getPDFFontSize($outputlangs);
  506. $tab2_top = $posy;
  507. $tab2_hl = 4;
  508. $pdf->SetFont('','', $default_font_size - 1);
  509. // Tableau total
  510. $col1x = 120; $col2x = 170; $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
  511. $useborder=0;
  512. $index = 0;
  513. // Total HT
  514. $pdf->SetFillColor(255,255,255);
  515. $pdf->SetXY($col1x, $tab2_top + 0);
  516. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalHT"), 0, 'L', 1);
  517. $pdf->SetXY($col2x, $tab2_top + 0);
  518. $total_ht = price2num($object->total_ht + (! empty($object->remise)?$object->remise:0), 'MT');
  519. $pdf->MultiCell($largcol2, $tab2_hl, price($total_ht), 0, 'R', 1);
  520. // Show VAT by rates and total
  521. $pdf->SetFillColor(248,248,248);
  522. $this->atleastoneratenotnull=0;
  523. if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
  524. {
  525. $tvaisnull=((! empty($this->tva) && count($this->tva) == 1 && isset($this->tva['0.000']) && is_float($this->tva['0.000'])) ? true : false);
  526. if (! empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_ISNULL) && $tvaisnull)
  527. {
  528. // Nothing to do
  529. }
  530. else
  531. {
  532. foreach($this->tva as $tvakey => $tvaval)
  533. {
  534. if ($tvakey > 0) // On affiche pas taux 0
  535. {
  536. $this->atleastoneratenotnull++;
  537. $index++;
  538. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  539. $tvacompl='';
  540. if (preg_match('/\*/',$tvakey))
  541. {
  542. $tvakey=str_replace('*','',$tvakey);
  543. $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
  544. }
  545. $totalvat =$outputlangs->transnoentities("TotalVAT").' ';
  546. $totalvat.=vatrate($tvakey,1).$tvacompl;
  547. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
  548. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  549. $tvaval = price2num($tvaval, 'MT');
  550. $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
  551. }
  552. }
  553. if (! $this->atleastoneratenotnull) // If no vat at all
  554. {
  555. $index++;
  556. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  557. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalVAT"), 0, 'L', 1);
  558. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  559. $total_tva = price2num($object->total_tva, 'MT');
  560. $pdf->MultiCell($largcol2, $tab2_hl, price($total_tva), 0, 'R', 1);
  561. // Total LocalTax1
  562. if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on' && $object->total_localtax1>0)
  563. {
  564. $index++;
  565. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  566. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT1".$mysoc->country_code), $useborder, 'L', 1);
  567. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  568. $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax1), $useborder, 'R', 1);
  569. }
  570. // Total LocalTax2
  571. if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on' && $object->total_localtax2>0)
  572. {
  573. $index++;
  574. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  575. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalLT2".$mysoc->country_code), $useborder, 'L', 1);
  576. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  577. $pdf->MultiCell($largcol2, $tab2_hl, price($object->total_localtax2), $useborder, 'R', 1);
  578. }
  579. }
  580. else
  581. {
  582. if (! empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION=='localtax1on')
  583. {
  584. //Local tax 1
  585. foreach($this->localtax1 as $tvakey => $tvaval)
  586. {
  587. if ($tvakey!=0) // On affiche pas taux 0
  588. {
  589. //$this->atleastoneratenotnull++;
  590. $index++;
  591. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  592. $tvacompl='';
  593. if (preg_match('/\*/',$tvakey))
  594. {
  595. $tvakey=str_replace('*','',$tvakey);
  596. $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
  597. }
  598. $totalvat =$outputlangs->transnoentities("TotalLT1".$mysoc->country_code).' ';
  599. $totalvat.=vatrate($tvakey,1).$tvacompl;
  600. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
  601. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  602. $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
  603. }
  604. }
  605. }
  606. if (! empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION=='localtax2on')
  607. {
  608. //Local tax 2
  609. foreach($this->localtax2 as $tvakey => $tvaval)
  610. {
  611. if ($tvakey!=0) // On affiche pas taux 0
  612. {
  613. //$this->atleastoneratenotnull++;
  614. $index++;
  615. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  616. $tvacompl='';
  617. if (preg_match('/\*/',$tvakey))
  618. {
  619. $tvakey=str_replace('*','',$tvakey);
  620. $tvacompl = " (".$outputlangs->transnoentities("NonPercuRecuperable").")";
  621. }
  622. $totalvat =$outputlangs->transnoentities("TotalLT2".$mysoc->country_code).' ';
  623. $totalvat.=vatrate($tvakey,1).$tvacompl;
  624. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $totalvat, 0, 'L', 1);
  625. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  626. $pdf->MultiCell($largcol2, $tab2_hl, price($tvaval), 0, 'R', 1);
  627. }
  628. }
  629. }
  630. }
  631. // Total TTC
  632. $index++;
  633. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  634. $pdf->SetTextColor(0,0,60);
  635. $pdf->SetFillColor(224,224,224);
  636. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("TotalTTC"), $useborder, 'L', 1);
  637. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  638. $total_ttc = price2num($object->total_ttc, 'MT');
  639. $pdf->MultiCell($largcol2, $tab2_hl, price($total_ttc), $useborder, 'R', 1);
  640. }
  641. }
  642. $pdf->SetTextColor(0,0,0);
  643. $creditnoteamount=0;
  644. $depositsamount=0;
  645. //$creditnoteamount=$object->getSumCreditNotesUsed();
  646. //$depositsamount=$object->getSumDepositsUsed();
  647. //print "x".$creditnoteamount."-".$depositsamount;exit;
  648. $resteapayer = price2num($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 'MT');
  649. if (! empty($object->paye)) $resteapayer=0;
  650. if ($deja_regle > 0)
  651. {
  652. // Already paid + Deposits
  653. $index++;
  654. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  655. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("AlreadyPaid"), 0, 'L', 0);
  656. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  657. $pdf->MultiCell($largcol2, $tab2_hl, price($deja_regle), 0, 'R', 0);
  658. $index++;
  659. $pdf->SetTextColor(0,0,60);
  660. $pdf->SetFillColor(224,224,224);
  661. $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
  662. $pdf->MultiCell($col2x-$col1x, $tab2_hl, $outputlangs->transnoentities("RemainderToPay"), $useborder, 'L', 1);
  663. $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
  664. $pdf->MultiCell($largcol2, $tab2_hl, price($resteapayer), $useborder, 'R', 1);
  665. $pdf->SetFont('','', $default_font_size - 1);
  666. $pdf->SetTextColor(0,0,0);
  667. }
  668. $index++;
  669. return ($tab2_top + ($tab2_hl * $index));
  670. }
  671. /**
  672. * Show table for lines
  673. *
  674. * @param PDF &$pdf Object PDF
  675. * @param string $tab_top Top position of table
  676. * @param string $tab_height Height of table (rectangle)
  677. * @param int $nexY Y (not used)
  678. * @param Translate $outputlangs Langs object
  679. * @param int $hidetop Hide top bar of array
  680. * @param int $hidebottom Hide bottom bar of array
  681. * @return void
  682. */
  683. function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
  684. {
  685. global $conf;
  686. // Force to disable hidetop and hidebottom
  687. $hidebottom=0;
  688. if ($hidetop) $hidetop=-1;
  689. $default_font_size = pdf_getPDFFontSize($outputlangs);
  690. // Amount in (at tab_top - 1)
  691. $pdf->SetTextColor(0,0,0);
  692. $pdf->SetFont('','', $default_font_size - 2);
  693. if (empty($hidetop))
  694. {
  695. $titre = $outputlangs->transnoentities("AmountInCurrency",$outputlangs->transnoentitiesnoconv("Currency".$conf->currency));
  696. $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top-4);
  697. $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
  698. }
  699. $pdf->SetDrawColor(128,128,128);
  700. $pdf->SetFont('','', $default_font_size - 1);
  701. // Output Rect
  702. $this->printRect($pdf,$this->marge_gauche, $tab_top, $this->page_largeur-$this->marge_gauche-$this->marge_droite, $tab_height, $hidetop, $hidebottom); // Rect prend une longueur en 3eme param et 4eme param
  703. if (empty($hidetop))
  704. {
  705. $pdf->line($this->marge_gauche, $tab_top+5, $this->page_largeur-$this->marge_droite, $tab_top+5); // line prend une position y en 2eme param et 4eme param
  706. $pdf->SetXY($this->posxdesc-1, $tab_top+1);
  707. $pdf->MultiCell(108,2, $outputlangs->transnoentities("Designation"),'','L');
  708. }
  709. if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
  710. {
  711. $pdf->line($this->posxtva-1, $tab_top, $this->posxtva-1, $tab_top + $tab_height);
  712. if (empty($hidetop))
  713. {
  714. $pdf->SetXY($this->posxtva-3, $tab_top+1);
  715. $pdf->MultiCell($this->posxup-$this->posxtva+3,2, $outputlangs->transnoentities("VAT"),'','C');
  716. }
  717. }
  718. $pdf->line($this->posxup-1, $tab_top, $this->posxup-1, $tab_top + $tab_height);
  719. if (empty($hidetop))
  720. {
  721. $pdf->SetXY($this->posxup-1, $tab_top+1);
  722. $pdf->MultiCell($this->posxqty-$this->posxup-1,2, $outputlangs->transnoentities("PriceUHT"),'','C');
  723. }
  724. $pdf->line($this->posxqty-1, $tab_top, $this->posxqty-1, $tab_top + $tab_height);
  725. if (empty($hidetop))
  726. {
  727. $pdf->SetXY($this->posxqty-1, $tab_top+1);
  728. $pdf->MultiCell($this->posxdiscount-$this->posxqty-1,2, $outputlangs->transnoentities("Qty"),'','C');
  729. }
  730. $pdf->line($this->posxdiscount-1, $tab_top, $this->posxdiscount-1, $tab_top + $tab_height);
  731. if (empty($hidetop))
  732. {
  733. if ($this->atleastonediscount)
  734. {
  735. $pdf->SetXY($this->posxdiscount-1, $tab_top+1);
  736. $pdf->MultiCell($this->postotalht-$this->posxdiscount+1,2, $outputlangs->transnoentities("ReductionShort"),'','C');
  737. }
  738. }
  739. if ($this->atleastonediscount)
  740. {
  741. $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
  742. }
  743. if (empty($hidetop))
  744. {
  745. $pdf->SetXY($this->postotalht-1, $tab_top+1);
  746. $pdf->MultiCell(30,2, $outputlangs->transnoentities("TotalHT"),'','C');
  747. }
  748. }
  749. /**
  750. * Show top header of page.
  751. *
  752. * @param PDF &$pdf Object PDF
  753. * @param Object $object Object to show
  754. * @param int $showaddress 0=no, 1=yes
  755. * @param Translate $outputlangs Object lang for output
  756. * @return void
  757. */
  758. function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
  759. {
  760. global $conf,$langs;
  761. $outputlangs->load("main");
  762. $outputlangs->load("bills");
  763. $outputlangs->load("propal");
  764. $outputlangs->load("companies");
  765. $default_font_size = pdf_getPDFFontSize($outputlangs);
  766. pdf_pagehead($pdf,$outputlangs,$this->page_hauteur);
  767. // Show Draft Watermark
  768. if($object->Status == "DRAFT" && (! empty($conf->global->COMMANDE_DRAFT_WATERMARK)) )
  769. {
  770. pdf_watermark($pdf,$outputlangs,$this->page_hauteur,$this->page_largeur,'mm',$conf->global->COMMANDE_DRAFT_WATERMARK);
  771. }
  772. $pdf->SetTextColor(0,0,60);
  773. $pdf->SetFont('','B', $default_font_size + 3);
  774. $posy=$this->marge_haute;
  775. $posx=$this->page_largeur-$this->marge_droite-100;
  776. $pdf->SetXY($this->marge_gauche,$posy);
  777. // Logo
  778. $logo=$conf->mycompany->dir_output.'/logos/'.$this->emetteur->logo;
  779. if ($this->emetteur->logo)
  780. {
  781. if (is_readable($logo))
  782. {
  783. $height=pdf_getHeightForLogo($logo);
  784. $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height); // width=0 (auto)
  785. }
  786. else
  787. {
  788. $pdf->SetTextColor(200,0,0);
  789. $pdf->SetFont('','B', $default_font_size -2);
  790. $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorLogoFileNotFound",$logo), 0, 'L');
  791. $pdf->MultiCell(100, 3, $outputlangs->transnoentities("ErrorGoToGlobalSetup"), 0, 'L');
  792. }
  793. }
  794. else
  795. {
  796. $text=$this->emetteur->name;
  797. $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0, 'L');
  798. }
  799. $pdf->SetFont('','B', $default_font_size + 3);
  800. $pdf->SetXY($posx,$posy);
  801. $pdf->SetTextColor(0,0,60);
  802. $title=$outputlangs->transnoentities("Order");
  803. $pdf->MultiCell(100, 3, $title, '', 'R');
  804. $pdf->SetFont('','B',$default_font_size);
  805. $posy+=5;
  806. $pdf->SetXY($posx,$posy);
  807. $pdf->SetTextColor(0,0,60);
  808. $pdf->MultiCell(100, 4, $outputlangs->transnoentities("Ref")." : " . $outputlangs->convToOutputCharset($object->ref), '', 'R');
  809. $posy+=1;
  810. $pdf->SetFont('','', $default_font_size - 1);
  811. if ($object->ref_client)
  812. {
  813. $posy+=5;
  814. $pdf->SetXY($posx,$posy);
  815. $pdf->SetTextColor(0,0,60);
  816. $pdf->MultiCell(100, 3, $outputlangs->transnoentities("RefCustomer")." : " . $outputlangs->convToOutputCharset($object->ref_client), '', 'R');
  817. }
  818. $posy+=4;
  819. $pdf->SetXY($posx,$posy);
  820. $pdf->SetTextColor(0,0,60);
  821. $pdf->MultiCell(100, 3, $outputlangs->transnoentities("OrderDate")." : " . dol_print_date($object->date,"%d %b %Y",false,$outputlangs,true), '', 'R');
  822. $posy+=2;
  823. // Show list of linked objects
  824. $posy = pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3, 'R', $default_font_size);
  825. if ($showaddress)
  826. {
  827. // Sender properties
  828. $carac_emetteur = pdf_build_address($outputlangs,$this->emetteur);
  829. // Show sender
  830. $posy=42;
  831. $posx=$this->marge_gauche;
  832. if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->page_largeur-$this->marge_droite-80;
  833. $hautcadre=40;
  834. // Show sender frame
  835. $pdf->SetTextColor(0,0,0);
  836. $pdf->SetFont('','', $default_font_size - 2);
  837. $pdf->SetXY($posx,$posy-5);
  838. $pdf->MultiCell(66,5, $outputlangs->transnoentities("BillFrom").":", 0, 'L');
  839. $pdf->SetXY($posx,$posy);
  840. $pdf->SetFillColor(230,230,230);
  841. $pdf->MultiCell(82, $hautcadre, "", 0, 'R', 1);
  842. $pdf->SetTextColor(0,0,60);
  843. // Show sender name
  844. $pdf->SetXY($posx+2,$posy+3);
  845. $pdf->SetFont('','B', $default_font_size);
  846. $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0, 'L');
  847. // Show sender information
  848. $pdf->SetXY($posx+2,$posy+8);
  849. $pdf->SetFont('','', $default_font_size - 1);
  850. $pdf->MultiCell(80, 4, $carac_emetteur, 0, 'L');
  851. // If CUSTOMER contact defined on order, we use it
  852. $usecontact=false;
  853. $arrayidcontact=$object->getIdContact('external','CUSTOMER');
  854. if (count($arrayidcontact) > 0)
  855. {
  856. $usecontact=true;
  857. $result=$object->fetch_contact($arrayidcontact[0]);
  858. }
  859. // Recipient name
  860. if (! empty($usecontact))
  861. {
  862. // On peut utiliser le nom de la societe du contact
  863. if (! empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)) $socname = $object->contact->socname;
  864. else $socname = $object->thirdparty->name;
  865. $carac_client_name=$outputlangs->convToOutputCharset($socname);
  866. }
  867. else
  868. {
  869. $carac_client_name=$outputlangs->convToOutputCharset($object->thirdparty->name);
  870. }
  871. $carac_client=pdf_build_address($outputlangs,$this->emetteur,$object->thirdparty,($usecontact?$object->contact:''),$usecontact,'target');
  872. // Show recipient
  873. $posy=42;
  874. $posx=$this->page_largeur-$this->marge_droite-100;
  875. if (! empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx=$this->marge_gauche;
  876. // Show recipient frame
  877. $pdf->SetTextColor(0,0,0);
  878. $pdf->SetFont('','', $default_font_size - 2);
  879. $pdf->SetXY($posx+2,$posy-5);
  880. $pdf->MultiCell(80,5, $outputlangs->transnoentities("BillTo").":",0,'L');
  881. $pdf->Rect($posx, $posy, 100, $hautcadre);
  882. // Show recipient name
  883. $pdf->SetXY($posx+2,$posy+3);
  884. $pdf->SetFont('','B', $default_font_size);
  885. $pdf->MultiCell(96,4, $carac_client_name, 0, 'L');
  886. // Show recipient information
  887. $pdf->SetFont('','', $default_font_size - 1);
  888. $pdf->SetXY($posx+2,$posy+4+(dol_nboflines_bis($carac_client_name,50)*4));
  889. $pdf->MultiCell(86,4, $carac_client, 0, 'L');
  890. }
  891. }
  892. /**
  893. * Show footer of page. Need this->emetteur object
  894. *
  895. * @param PDF &$pdf PDF
  896. * @param Object $object Object to show
  897. * @param Translate $outputlangs Object lang for output
  898. * @return int Return height of bottom margin including footer text
  899. */
  900. function _pagefoot(&$pdf,$object,$outputlangs)
  901. {
  902. return pdf_pagefoot($pdf,$outputlangs,'COMMANDE_FREE_TEXT',$this->emetteur,$this->marge_basse,$this->marge_gauche,$this->page_hauteur,$object);
  903. }
  904. }
  905. ?>