28 require_once DOL_DOCUMENT_ROOT.
'/core/modules/supplier_invoice/modules_facturefournisseur.php';
29 require_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.facture.class.php';
30 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
59 public $update_main_doc_field;
70 public $phpmin = array(7, 0);
76 public $version =
'dolibarr';
101 public $marge_droite;
128 global $conf, $langs, $mysoc;
131 $langs->loadLangs(array(
"main",
"bills"));
134 $this->
name =
"canelle";
135 $this->
description = $langs->trans(
'SuppliersInvoiceModel');
136 $this->update_main_doc_field = 1;
141 $this->page_largeur = $formatarray[
'width'];
142 $this->page_hauteur = $formatarray[
'height'];
143 $this->format = array($this->page_largeur, $this->page_hauteur);
149 $this->option_logo = 1;
150 $this->option_tva = 1;
151 $this->option_modereg = 1;
152 $this->option_condreg = 1;
153 $this->option_multilang = 1;
156 $this->posxdesc = $this->marge_gauche + 1;
157 $this->posxtva = 112;
159 $this->posxqty = 145;
160 $this->posxunit = 162;
161 $this->posxdiscount = 162;
162 $this->postotalht = 174;
167 $this->posxqty = 130;
168 $this->posxunit = 147;
171 $this->posxpicture = $this->posxtva - (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH);
172 if ($this->page_largeur < 210) {
173 $this->posxpicture -= 20;
174 $this->posxtva -= 20;
176 $this->posxqty -= 20;
177 $this->posxunit -= 20;
178 $this->posxdiscount -= 20;
179 $this->postotalht -= 20;
182 $this->tva = array();
183 $this->tva_array = array();
184 $this->localtax1 = array();
185 $this->localtax2 = array();
186 $this->atleastoneratenotnull = 0;
187 $this->atleastonediscount = 0;
203 public function write_file($object, $outputlangs =
'', $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
206 global $user, $langs, $conf, $mysoc, $hookmanager, $nblines;
209 if (!is_object($object->thirdparty)) {
210 $object->fetch_thirdparty();
212 if (!is_object($object->thirdparty)) {
213 $object->thirdparty = $mysoc;
216 $this->emetteur = $object->thirdparty;
217 if (!$this->emetteur->country_code) {
218 $this->emetteur->country_code = substr($langs->defaultlang, -2);
221 if (!is_object($outputlangs)) {
222 $outputlangs = $langs;
225 if (!empty($conf->global->MAIN_USE_FPDF)) {
226 $outputlangs->charset_output =
'ISO-8859-1';
230 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products"));
232 $nblines = count($object->lines);
234 if ($conf->fournisseur->facture->dir_output) {
235 $deja_regle = $object->getSommePaiement((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
236 $amount_credit_notes_included = $object->getSumCreditNotesUsed((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
237 $amount_deposits_included = $object->getSumDepositsUsed((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
240 if ($object->specimen) {
241 $dir = $conf->fournisseur->facture->dir_output;
242 $file = $dir.
"/SPECIMEN.pdf";
246 $dir = $conf->fournisseur->facture->dir_output.
'/'.
get_exdir($object->id, 2, 0, 0, $object,
'invoice_supplier').$objectref;
247 $file = $dir.
"/".$objectref.
".pdf";
248 if (!empty($conf->global->SUPPLIER_REF_IN_NAME)) {
249 $file = $dir.
"/".$objectref.($objectrefsupplier ?
"_".$objectrefsupplier :
"").
".pdf";
253 if (!file_exists($dir)) {
255 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
260 if (file_exists($dir)) {
262 if (!is_object($hookmanager)) {
263 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
266 $hookmanager->initHooks(array(
'pdfgeneration'));
267 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
269 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
272 $nblines = count($object->lines);
273 $nbpayments = count($object->getListOfPayments());
278 $pdf->SetAutoPageBreak(1, 0);
280 $heightforinfotot = 50 + (4 * $nbpayments);
281 if ($heightforinfotot > 220) {
282 $heightforinfotot = 220;
284 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
285 $heightforfooter = $this->marge_basse + 8;
286 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS)) {
287 $heightforfooter += 6;
290 if (class_exists(
'TCPDF')) {
291 $pdf->setPrintHeader(
false);
292 $pdf->setPrintFooter(
false);
296 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
297 $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
298 $tplidx = $pdf->importPage(1);
303 $pdf->SetDrawColor(128, 128, 128);
305 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
306 $pdf->SetSubject($outputlangs->transnoentities(
"PdfInvoiceTitle"));
307 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
308 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
309 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"PdfInvoiceTitle").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
311 $pdf->SetCompression(
false);
314 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
317 for ($i = 0; $i < $nblines; $i++) {
318 if ($object->lines[$i]->remise_percent) {
319 $this->atleastonediscount++;
322 if (empty($this->atleastonediscount)) {
323 $delta = ($this->postotalht - $this->posxdiscount);
324 $this->posxpicture += $delta;
325 $this->posxtva += $delta;
326 $this->posxup += $delta;
327 $this->posxqty += $delta;
328 $this->posxunit += $delta;
329 $this->posxdiscount += $delta;
335 if (!empty($tplidx)) {
336 $pdf->useTemplate($tplidx);
339 $top_shift = $this->
_pagehead($pdf, $object, 1, $outputlangs);
340 $pdf->SetFont(
'',
'', $default_font_size - 1);
341 $pdf->MultiCell(0, 3,
'');
342 $pdf->SetTextColor(0, 0, 0);
344 $tab_top = 90 + $top_shift;
345 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
349 $desc_incoterms = $object->getIncotermsForPDF();
350 if ($desc_incoterms) {
353 $pdf->SetFont(
'',
'', $default_font_size - 1);
354 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
355 $nexY = $pdf->GetY();
356 $height_incoterms = $nexY - $tab_top;
359 $pdf->SetDrawColor(192, 192, 192);
360 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
362 $tab_top = $nexY + 6;
367 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
377 $pdf->SetFont(
'',
'', $default_font_size - 1);
378 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($notetoshow), 0, 1);
379 $nexY = $pdf->GetY();
380 $height_note = $nexY - $tab_top;
383 $pdf->SetDrawColor(192, 192, 192);
384 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
386 $tab_top = $nexY + 6;
389 $iniY = $tab_top + 7;
390 $curY = $tab_top + 7;
391 $nexY = $tab_top + 7;
394 for ($i = 0; $i < $nblines; $i++) {
396 $pdf->SetFont(
'',
'', $default_font_size - 1);
397 $pdf->SetTextColor(0, 0, 0);
400 $imglinesize = array();
401 if (!empty($realpatharray[$i])) {
405 $pdf->setTopMargin($tab_top_newpage);
406 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
407 $pageposbefore = $pdf->getPage();
409 $showpricebeforepagebreak = 1;
413 $curX = $this->posxdesc - 1;
415 $pdf->startTransaction();
416 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 3, $curX, $curY, $hideref, $hidedesc, 1);
417 $pageposafter = $pdf->getPage();
418 if ($pageposafter > $pageposbefore) {
419 $pdf->rollbackTransaction(
true);
420 $pageposafter = $pageposbefore;
422 $pdf->setPageOrientation(
'', 1, $heightforfooter);
423 pdf_writelinedesc($pdf, $object, $i, $outputlangs, $this->posxtva - $curX, 4, $curX, $curY, $hideref, $hidedesc, 1);
424 $posyafter = $pdf->GetY();
425 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
426 if ($i == ($nblines - 1)) {
427 $pdf->AddPage(
'',
'',
true);
428 if (!empty($tplidx)) {
429 $pdf->useTemplate($tplidx);
432 $this->
_pagehead($pdf, $object, 0, $outputlangs);
434 $pdf->setPage($pageposafter + 1);
439 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
440 $showpricebeforepagebreak = 1;
442 $showpricebeforepagebreak = 0;
447 $pdf->commitTransaction();
449 $posYAfterDescription = $pdf->GetY();
451 $nexY = $pdf->GetY();
452 $pageposafter = $pdf->getPage();
453 $pdf->setPage($pageposbefore);
454 $pdf->setTopMargin($this->marge_haute);
455 $pdf->setPageOrientation(
'', 1, 0);
458 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
459 $pdf->setPage($pageposafter);
460 $curY = $tab_top_newpage;
463 $pdf->SetFont(
'',
'', $default_font_size - 1);
466 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT)) {
468 $pdf->SetXY($this->posxtva, $curY);
469 $pdf->MultiCell($this->posxup - $this->posxtva - 1, 3, $vat_rate, 0,
'R');
474 $pdf->SetXY($this->posxup, $curY);
475 $pdf->MultiCell($this->posxqty - $this->posxup - 0.8, 3, $up_excl_tax, 0,
'R', 0);
479 $pdf->SetXY($this->posxqty, $curY);
480 $pdf->MultiCell($this->posxunit - $this->posxqty - 0.8, 4, $qty, 0,
'R');
484 $unit =
pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
485 $pdf->SetXY($this->posxunit, $curY);
486 $pdf->MultiCell($this->posxdiscount - $this->posxunit - 0.8, 4, $unit, 0,
'L');
490 if ($object->lines[$i]->remise_percent) {
491 $pdf->SetXY($this->posxdiscount - 2, $curY);
493 $pdf->MultiCell($this->postotalht - $this->posxdiscount - 1, 3, $remise_percent, 0,
'R');
498 $pdf->SetXY($this->postotalht, $curY);
499 $pdf->MultiCell($this->page_largeur - $this->marge_droite - $this->postotalht, 3, $total_excl_tax, 0,
'R', 0);
502 if (
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) {
503 $tvaligne = $object->lines[$i]->multicurrency_total_tva;
505 $tvaligne = $object->lines[$i]->total_tva;
508 $localtax1ligne = $object->lines[$i]->total_localtax1;
509 $localtax2ligne = $object->lines[$i]->total_localtax2;
511 if (!empty($object->remise_percent)) {
512 $tvaligne -= ($tvaligne * $object->remise_percent) / 100;
515 $vatrate = (string) $object->lines[$i]->tva_tx;
516 $localtax1rate = (
string) $object->lines[$i]->localtax1_tx;
517 $localtax2rate = (string) $object->lines[$i]->localtax2_tx;
519 if (($object->lines[$i]->info_bits & 0x01) == 0x01) {
522 if (empty($this->tva[$vatrate])) {
523 $this->tva[$vatrate] = 0;
525 if (empty($this->localtax1[$localtax1rate])) {
526 $this->localtax1[$localtax1rate] = 0;
528 if (empty($this->localtax2[$localtax2rate])) {
529 $this->localtax2[$localtax2rate] = 0;
531 $this->tva[$vatrate] += $tvaligne;
532 $this->localtax1[$localtax1rate] += $localtax1ligne;
533 $this->localtax2[$localtax2rate] += $localtax2ligne;
535 if ($posYAfterImage > $posYAfterDescription) {
536 $nexY = $posYAfterImage;
540 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
541 $pdf->setPage($pageposafter);
542 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
544 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
545 $pdf->SetLineStyle(array(
'dash'=>0));
551 while ($pagenb < $pageposafter) {
552 $pdf->setPage($pagenb);
554 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code);
556 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
558 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
560 $pdf->setPage($pagenb);
561 $pdf->setPageOrientation(
'', 1, 0);
563 $this->
_pagehead($pdf, $object, 0, $outputlangs);
566 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
568 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1, $object->multicurrency_code);
570 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code);
572 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
575 if (!empty($tplidx)) {
576 $pdf->useTemplate($tplidx);
580 $this->
_pagehead($pdf, $object, 0, $outputlangs);
587 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0, $object->multicurrency_code);
588 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
590 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code);
591 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
595 $posy = $this->
_tableau_tot($pdf, $object, $deja_regle, $bottomlasttab, $outputlangs);
597 $amount_credit_notes_included = 0;
598 $amount_deposits_included = 0;
601 if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->SUPPLIER_INVOICE_NO_PAYMENT_DETAILS)) {
606 $this->
_pagefoot($pdf, $object, $outputlangs);
607 if (method_exists($pdf,
'AliasNbPages')) {
608 $pdf->AliasNbPages();
613 $pdf->Output($file,
'F');
616 $hookmanager->initHooks(array(
'pdfgeneration'));
617 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
619 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
621 $this->error = $hookmanager->error;
622 $this->errors = $hookmanager->errors;
625 if (!empty($conf->global->MAIN_UMASK)) {
626 @chmod($file, octdec($conf->global->MAIN_UMASK));
629 $this->result = array(
'fullpath'=>$file);
633 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
637 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"SUPPLIER_OUTPUTDIR");
654 protected function _tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
657 global $conf, $mysoc;
660 if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) {
668 $pdf->SetFont(
'',
'', $default_font_size - 1);
673 if ($this->page_largeur < 210) {
676 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
682 $pdf->SetFillColor(255, 255, 255);
683 $pdf->SetXY($col1x, $tab2_top);
684 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT"), 0,
'L', 1);
686 $total_ht = ((
isModEnabled(
"multicurrency") && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
687 $pdf->SetXY($col2x, $tab2_top);
688 $pdf->MultiCell($largcol2, $tab2_hl,
price($sign * ($total_ht + (!empty($object->remise) ? $object->remise : 0)), 0, $outputlangs), 0,
'R', 1);
691 $pdf->SetFillColor(248, 248, 248);
693 $total_ttc = (
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
695 $this->atleastoneratenotnull = 0;
696 foreach ($this->tva as $tvakey => $tvaval) {
698 $this->atleastoneratenotnull++;
701 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
705 if (preg_match(
'/\*/', $tvakey)) {
706 $tvakey = str_replace(
'*',
'', $tvakey);
707 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
710 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).
' ';
711 $totalvat .=
vatrate($tvakey, 1).$tvacompl;
712 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
714 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
715 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
718 if (!$this->atleastoneratenotnull) {
720 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
721 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code), 0,
'L', 1);
722 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
723 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_tva, 0, $outputlangs), 0,
'R', 1);
726 if (!empty($conf->global->FACTURE_LOCAL_TAX1_OPTION) && $conf->global->FACTURE_LOCAL_TAX1_OPTION ==
'localtax1on' && $object->total_localtax1 > 0) {
728 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
729 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code), 0,
'L', 1);
730 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
731 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_localtax1, 0, $outputlangs), 0,
'R', 1);
735 if (!empty($conf->global->FACTURE_LOCAL_TAX2_OPTION) && $conf->global->FACTURE_LOCAL_TAX2_OPTION ==
'localtax2on' && $object->total_localtax2 > 0) {
737 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
738 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code), 0,
'L', 1);
739 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
740 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_localtax2, 0, $outputlangs), 0,
'R', 1);
746 foreach ($this->localtax1 as $tvakey => $tvaval) {
751 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
754 if (preg_match(
'/\*/', $tvakey)) {
755 $tvakey = str_replace(
'*',
'', $tvakey);
756 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
758 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).
' ';
759 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
760 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
762 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
763 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
771 foreach ($this->localtax2 as $tvakey => $tvaval) {
776 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
779 if (preg_match(
'/\*/', $tvakey)) {
780 $tvakey = str_replace(
'*',
'', $tvakey);
781 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
783 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).
' ';
784 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
785 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
787 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
788 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
796 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
797 $pdf->SetTextColor(0, 0, 60);
798 $pdf->SetFillColor(224, 224, 224);
799 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC"), $useborder,
'L', 1);
801 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
802 $pdf->MultiCell($largcol2, $tab2_hl,
price($sign * $total_ttc, 0, $outputlangs), $useborder,
'R', 1);
804 $pdf->SetTextColor(0, 0, 0);
805 $creditnoteamount = $object->getSumCreditNotesUsed((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
806 $depositsamount = $object->getSumDepositsUsed((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? 1 : 0);
808 $resteapayer =
price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount,
'MT');
809 if (!empty($object->paye)) {
813 if (($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS)) {
816 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
817 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"Paid"), 0,
'L', 0);
818 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
819 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle + $depositsamount, 0, $outputlangs), 0,
'R', 0);
822 if ($creditnoteamount) {
823 $labeltouse = ($outputlangs->transnoentities(
"CreditNotesOrExcessReceived") !=
"CreditNotesOrExcessReceived") ? $outputlangs->transnoentities(
"CreditNotesOrExcessReceived") : $outputlangs->transnoentities(
"CreditNotes");
825 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
826 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0,
'L', 0);
827 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
828 $pdf->MultiCell($largcol2, $tab2_hl,
price($creditnoteamount, 0, $outputlangs), 0,
'R', 0);
832 if ($object->close_code == FactureFournisseur::CLOSECODE_DISCOUNTVAT) {
834 $pdf->SetFillColor(255, 255, 255);
836 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
837 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"EscompteOfferedShort"), $useborder,
'L', 1);
838 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
839 $pdf->MultiCell($largcol2, $tab2_hl,
price($object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount, 0, $outputlangs), $useborder,
'R', 1);
845 $pdf->SetTextColor(0, 0, 60);
846 $pdf->SetFillColor(224, 224, 224);
847 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
848 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay"), $useborder,
'L', 1);
850 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
851 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
852 $pdf->SetFont(
'',
'', $default_font_size - 1);
853 $pdf->SetTextColor(0, 0, 0);
857 return ($tab2_top + ($tab2_hl * $index));
874 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'')
884 $currency = !empty($currency) ? $currency : $conf->currency;
888 $pdf->SetTextColor(0, 0, 0);
889 $pdf->SetFont(
'',
'', $default_font_size - 2);
891 if (empty($hidetop)) {
892 $titre = $outputlangs->transnoentities(
"AmountInCurrency", $outputlangs->transnoentitiesnoconv(
"Currency".$currency));
893 $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
894 $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
897 if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
898 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5,
'F',
null, explode(
',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
902 $pdf->SetDrawColor(128, 128, 128);
903 $pdf->SetFont(
'',
'', $default_font_size - 1);
906 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
908 if (empty($hidetop)) {
909 $pdf->line($this->marge_gauche, $tab_top + 5, $this->page_largeur - $this->marge_droite, $tab_top + 5);
911 $pdf->SetXY($this->posxdesc - 1, $tab_top + 1);
912 $pdf->MultiCell(108, 2, $outputlangs->transnoentities(
"Designation"),
'',
'L');
915 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) {
916 $pdf->line($this->posxtva - 1, $tab_top, $this->posxtva - 1, $tab_top + $tab_height);
917 if (empty($hidetop)) {
918 $pdf->SetXY($this->posxtva - 3, $tab_top + 1);
919 $pdf->MultiCell($this->posxup - $this->posxtva + 3, 2, $outputlangs->transnoentities(
"VAT"),
'',
'C');
923 $pdf->line($this->posxup - 1, $tab_top, $this->posxup - 1, $tab_top + $tab_height);
924 if (empty($hidetop)) {
925 $pdf->SetXY($this->posxup - 1, $tab_top + 1);
926 $pdf->MultiCell($this->posxqty - $this->posxup - 1, 2, $outputlangs->transnoentities(
"PriceUHT"),
'',
'C');
929 $pdf->line($this->posxqty - 1, $tab_top, $this->posxqty - 1, $tab_top + $tab_height);
930 if (empty($hidetop)) {
931 $pdf->SetXY($this->posxqty - 1, $tab_top + 1);
932 $pdf->MultiCell($this->posxunit - $this->posxqty - 1, 2, $outputlangs->transnoentities(
"Qty"),
'',
'C');
936 $pdf->line($this->posxunit - 1, $tab_top, $this->posxunit - 1, $tab_top + $tab_height);
937 if (empty($hidetop)) {
938 $pdf->SetXY($this->posxunit - 1, $tab_top + 1);
940 $this->posxdiscount - $this->posxunit - 1,
942 $outputlangs->transnoentities(
"Unit"),
949 if ($this->atleastonediscount) {
950 $pdf->line($this->posxdiscount - 1, $tab_top, $this->posxdiscount - 1, $tab_top + $tab_height);
951 if (empty($hidetop)) {
952 $pdf->SetXY($this->posxdiscount - 1, $tab_top + 1);
953 $pdf->MultiCell($this->postotalht - $this->posxdiscount + 1, 2, $outputlangs->transnoentities(
"ReductionShort"),
'',
'C');
957 $pdf->line($this->postotalht, $tab_top, $this->postotalht, $tab_top + $tab_height);
958 if (empty($hidetop)) {
959 $pdf->SetXY($this->postotalht - 1, $tab_top + 1);
960 $pdf->MultiCell(30, 2, $outputlangs->transnoentities(
"TotalHTShort"),
'',
'C');
982 if ($object->type == 2 && !empty($conf->global->INVOICE_POSITIVE_CREDIT_NOTE)) {
987 $tab3_top = $posy + 8;
990 if ($this->page_largeur < 210) {
996 $pdf->SetFont(
'',
'', $default_font_size - 3);
997 $pdf->SetXY($tab3_posx, $tab3_top - 4);
998 $pdf->MultiCell(60, 3, $outputlangs->transnoentities(
"PaymentsAlreadyDone"), 0,
'L', 0);
1000 $pdf->line($tab3_posx, $tab3_top, $tab3_posx + $tab3_width, $tab3_top);
1002 $pdf->SetFont(
'',
'', $default_font_size - 4);
1003 $pdf->SetXY($tab3_posx, $tab3_top);
1004 $pdf->MultiCell(20, 3, $outputlangs->transnoentities(
"Payment"), 0,
'L', 0);
1005 $pdf->SetXY($tab3_posx + 21, $tab3_top);
1006 $pdf->MultiCell(20, 3, $outputlangs->transnoentities(
"Amount"), 0,
'L', 0);
1007 $pdf->SetXY($tab3_posx + 40, $tab3_top);
1008 $pdf->MultiCell(20, 3, $outputlangs->transnoentities(
"Type"), 0,
'L', 0);
1009 $pdf->SetXY($tab3_posx + 58, $tab3_top);
1010 $pdf->MultiCell(20, 3, $outputlangs->transnoentities(
"Num"), 0,
'L', 0);
1012 $pdf->line($tab3_posx, $tab3_top - 1 + $tab3_height, $tab3_posx + $tab3_width, $tab3_top - 1 + $tab3_height);
1016 $pdf->SetFont(
'',
'', $default_font_size - 4);
1022 $sql =
"SELECT p.datep as date, p.fk_paiement as type, p.num_paiement as num, pf.amount as amount, pf.multicurrency_amount,";
1024 $sql .=
" FROM ".MAIN_DB_PREFIX.
"paiementfourn_facturefourn as pf, ".MAIN_DB_PREFIX.
"paiementfourn as p";
1025 $sql .=
" LEFT JOIN ".MAIN_DB_PREFIX.
"c_paiement as cp ON p.fk_paiement = cp.id";
1026 $sql .=
" WHERE pf.fk_paiementfourn = p.rowid and pf.fk_facturefourn = ".((int) $object->id);
1027 $sql .=
" ORDER BY p.datep";
1030 $num = $this->
db->num_rows(
$resql);
1034 $row = $this->
db->fetch_object(
$resql);
1036 $pdf->SetXY($tab3_posx, $tab3_top + $y);
1037 $pdf->MultiCell(20, 3,
dol_print_date($this->
db->jdate($row->date),
'day',
false, $outputlangs,
true), 0,
'L', 0);
1038 $pdf->SetXY($tab3_posx + 21, $tab3_top + $y);
1039 $pdf->MultiCell(20, 3,
price($sign * ((
isModEnabled(
"multicurrency") && $object->multicurrency_tx != 1) ? $row->multicurrency_amount : $row->amount)), 0,
'L', 0);
1040 $pdf->SetXY($tab3_posx + 40, $tab3_top + $y);
1041 $oper = $outputlangs->transnoentitiesnoconv(
"PaymentTypeShort".$row->code);
1043 $pdf->MultiCell(20, 3, $oper, 0,
'L', 0);
1044 $pdf->SetXY($tab3_posx + 58, $tab3_top + $y);
1045 $pdf->MultiCell(30, 3, $row->num, 0,
'L', 0);
1047 $pdf->line($tab3_posx, $tab3_top + $y + 3, $tab3_posx + $tab3_width, $tab3_top + $y + 3);
1052 $this->error = $this->
db->lasterror();
1067 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs)
1069 global $langs, $conf, $mysoc;
1072 $outputlangs->loadLangs(array(
"main",
"orders",
"companies",
"bills"));
1079 $pdf->SetTextColor(0, 0, 60);
1080 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1082 $posy = $this->marge_haute;
1083 $posx = $this->page_largeur - $this->marge_droite - 100;
1085 $pdf->SetXY($this->marge_gauche, $posy);
1107 $text = $this->emetteur->name;
1108 $pdf->MultiCell(100, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
1111 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1112 $pdf->SetXY($posx, $posy);
1113 $pdf->SetTextColor(0, 0, 60);
1114 $title = $outputlangs->transnoentities(
"PdfInvoiceTitle");
1115 if ($object->type == 1) {
1116 $title = $outputlangs->transnoentities(
"InvoiceReplacement");
1118 if ($object->type == 2) {
1119 $title = $outputlangs->transnoentities(
"InvoiceAvoir");
1121 if ($object->type == 3) {
1122 $title = $outputlangs->transnoentities(
"InvoiceDeposit");
1124 $pdf->MultiCell(100, 3, $title.
" ".$outputlangs->convToOutputCharset($object->ref),
'',
'R');
1127 if ($object->ref_supplier) {
1129 $pdf->SetFont(
'',
'B', $default_font_size);
1130 $pdf->SetXY($posx, $posy);
1131 $pdf->SetTextColor(0, 0, 60);
1132 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"RefSupplier").
" : ".$object->ref_supplier,
'',
'R');
1136 $pdf->SetFont(
'',
'', $default_font_size - 1);
1138 if (!empty($conf->global->PDF_SHOW_PROJECT_TITLE)) {
1139 $object->fetch_projet();
1140 if (!empty($object->project->ref)) {
1142 $pdf->SetXY($posx, $posy);
1143 $pdf->SetTextColor(0, 0, 60);
1144 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty($object->project->title) ?
'' : $object->project->title),
'',
'R');
1148 if (!empty($conf->global->PDF_SHOW_PROJECT)) {
1149 $object->fetch_projet();
1150 if (!empty($object->project->ref)) {
1151 $outputlangs->load(
"projects");
1153 $pdf->SetXY($posx, $posy);
1154 $langs->load(
"projects");
1155 $pdf->SetTextColor(0, 0, 60);
1156 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty($object->project->ref) ?
'' : $object->project->ref),
'',
'R');
1160 if ($object->date) {
1162 $pdf->SetXY($posx, $posy);
1163 $pdf->SetTextColor(0, 0, 60);
1164 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date,
"day",
false, $outputlangs,
true),
'',
'R');
1167 $pdf->SetXY($posx, $posy);
1168 $pdf->SetTextColor(255, 0, 0);
1169 $pdf->MultiCell(100, 4, strtolower($outputlangs->transnoentities(
"OrderToProcess")),
'',
'R');
1172 if ($object->thirdparty->code_fournisseur) {
1174 $pdf->SetXY($posx, $posy);
1175 $pdf->SetTextColor(0, 0, 60);
1176 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"SupplierCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_fournisseur),
'',
'R');
1180 $pdf->SetTextColor(0, 0, 60);
1184 $current_y = $pdf->getY();
1185 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, 100, 3,
'R', $default_font_size);
1186 if ($current_y < $pdf->getY()) {
1187 $top_shift = $pdf->getY() - $current_y;
1192 $carac_emetteur =
'';
1194 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1195 if (count($arrayidcontact) > 0) {
1196 $object->fetch_user($arrayidcontact[0]);
1197 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
1200 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
1203 $posy = 42 + $top_shift;
1204 $posx = $this->marge_gauche;
1205 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1206 $posx = $this->page_largeur - $this->marge_droite - 80;
1211 $pdf->SetTextColor(0, 0, 0);
1212 $pdf->SetFont(
'',
'', $default_font_size - 2);
1213 $pdf->SetXY($posx, $posy - 5);
1214 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"BillFrom"), 0,
'L');
1215 $pdf->SetXY($posx, $posy);
1216 $pdf->SetFillColor(230, 230, 230);
1217 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
1218 $pdf->SetTextColor(0, 0, 60);
1221 $pdf->SetXY($posx + 2, $posy + 3);
1222 $pdf->SetFont(
'',
'B', $default_font_size);
1223 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
1224 $posy = $pdf->getY();
1227 $pdf->SetXY($posx + 2, $posy);
1228 $pdf->SetFont(
'',
'', $default_font_size - 1);
1229 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
1234 $usecontact =
false;
1235 $arrayidcontact = $object->getIdContact(
'internal',
'BILLING');
1236 if (count($arrayidcontact) > 0) {
1238 $result = $object->fetch_contact($arrayidcontact[0]);
1242 if ($usecontact && ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
1243 $thirdparty = $object->contact;
1245 $thirdparty = $mysoc;
1250 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $mysoc, ((!empty($object->contact)) ? $object->contact :
null), $usecontact,
'target', $object);
1254 if ($this->page_largeur < 210) {
1257 $posy = 42 + $top_shift;
1258 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1259 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
1260 $posx = $this->marge_gauche;
1264 $pdf->SetTextColor(0, 0, 0);
1265 $pdf->SetFont(
'',
'', $default_font_size - 2);
1266 $pdf->SetXY($posx + 2, $posy - 5);
1267 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo"), 0,
'L');
1268 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1271 $pdf->SetXY($posx + 2, $posy + 3);
1272 $pdf->SetFont(
'',
'B', $default_font_size);
1273 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
1275 $posy = $pdf->getY();
1278 $pdf->SetFont(
'',
'', $default_font_size - 1);
1279 $pdf->SetXY($posx + 2, $posy);
1280 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
1296 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
1298 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
1299 return pdf_pagefoot($pdf, $outputlangs,
'SUPPLIER_INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
Parent class for supplier invoices models.
Class to generate the supplier invoices PDF with the template canelle.
_tableau_tot(&$pdf, $object, $deja_regle, $posy, $outputlangs)
Show total to pay.
write_file($object, $outputlangs='', $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
_tableau_versements(&$pdf, $object, $posy, $outputlangs, $heightforfooter=0)
Show payments table.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency='')
Show table for lines.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
__construct($db)
Constructor.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
if(!function_exists('dolEscapeXML')) convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
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='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
complete_substitutions_array(&$substitutionarray, $outputlangs, $object=null, $parameters=null, $callfunc="completesubstitutionarray")
Complete the $substitutionarray with more entries coming from external module that had set the "subst...
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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...
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
if(!defined( 'CSRFCHECK_WITH_TOKEN'))
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line total excluding tax.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getFormat(Translate $outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0)
Output line description into PDF.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line unit price excluding tax.
pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails=0)
Return line vat rate.
pdf_getlineunit($object, $i, $outputlangs, $hidedetails=0, $hookmanager=false)
Return line unit.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formated for output on documents.
pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails=0)
Return line remise percent.
pdf_getlineqty($object, $i, $outputlangs, $hidedetails=0)
Return line quantity.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.
$conf db
API class for accounts.