35 require_once DOL_DOCUMENT_ROOT.
'/core/modules/stocktransfer/modules_stocktransfer.php';
36 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
37 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
38 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
65 public $update_main_doc_field;
76 public $version =
'dolibarr';
86 global $langs, $mysoc;
89 $langs->loadLangs(array(
"main",
"bills",
"products"));
92 $this->
name = $langs->trans(
"StockTransferSheetProforma");
93 $this->
description = $langs->trans(
'StockTransferSheetProforma');
94 $this->update_main_doc_field = 1;
99 $this->page_largeur = $formatarray[
'width'];
100 $this->page_hauteur = $formatarray[
'height'];
101 $this->format = array($this->page_largeur, $this->page_hauteur);
107 $this->option_logo = 1;
108 $this->option_tva = 1;
109 $this->option_modereg = 1;
110 $this->option_condreg = 1;
111 $this->option_multilang = 1;
112 $this->option_escompte = 0;
113 $this->option_credit_note = 0;
114 $this->option_freetext = 1;
115 $this->option_draft_watermark = 1;
118 $this->emetteur = $mysoc;
119 if (empty($this->emetteur->country_code)) {
120 $this->emetteur->country_code = substr($langs->defaultlang, -2);
124 $this->posxdesc = $this->marge_gauche + 1;
127 $this->tabTitleHeight = 5;
129 $this->tva = array();
130 $this->localtax1 = array();
131 $this->localtax2 = array();
132 $this->atleastoneratenotnull = 0;
133 $this->atleastonediscount = 0;
148 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
151 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
153 if (!is_object($outputlangs)) {
154 $outputlangs = $langs;
158 $outputlangs->charset_output =
'ISO-8859-1';
162 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
165 global $outputlangsbis;
166 $outputlangsbis =
new Translate(
'', $conf);
168 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"orders",
"deliveries"));
179 $realpatharray = array();
180 $this->atleastonephoto =
false;
182 $objphoto =
new Product($this->db);
184 for ($i = 0; $i < $nblines; $i++) {
185 if (empty(
$object->lines[$i]->fk_product)) {
189 $objphoto->fetch(
$object->lines[$i]->fk_product);
193 $pdir[0] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
194 $pdir[1] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
196 $pdir[0] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
197 $pdir[1] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
201 foreach ($pdir as $midir) {
203 $dir = $conf->product->dir_output.
'/'.$midir;
205 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
207 if ($obj[
'photo_vignette']) {
208 $filename = $obj[
'photo_vignette'];
210 $filename = $obj[
'photo'];
213 $filename = $obj[
'photo'];
216 $realpath = $dir.$filename;
218 $this->atleastonephoto =
true;
223 if ($realpath && $arephoto) {
224 $realpatharray[$i] = $realpath;
231 if ($conf->stocktransfer->dir_output) {
238 $dir = $conf->stocktransfer->multidir_output[$conf->entity];
239 $file = $dir.
"/SPECIMEN.pdf";
242 $dir = $conf->stocktransfer->multidir_output[$conf->entity].
"/".
$object->element.
"/".$objectref;
243 $file = $dir.
"/".$objectref.
"-proforma.pdf";
246 if (!file_exists($dir)) {
248 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
253 if (file_exists($dir)) {
255 if (!is_object($hookmanager)) {
256 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
259 $hookmanager->initHooks(array(
'pdfgeneration'));
260 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
262 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
267 $pdf->SetAutoPageBreak(1, 0);
269 $heightforinfotot = 40;
270 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
271 $heightforfooter = $this->marge_basse + (!
getDolGlobalString(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22);
273 if (class_exists(
'TCPDF')) {
274 $pdf->setPrintHeader(
false);
275 $pdf->setPrintFooter(
false);
280 $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[
$object->entity].
'/' .
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
281 $tplidx = $pdf->importPage(1);
286 $pdf->SetDrawColor(128, 128, 128);
288 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
289 $pdf->SetSubject($outputlangs->transnoentities(
"PdfOrderTitle"));
290 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
291 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
292 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".$outputlangs->transnoentities(
"PdfOrderTitle").($object->thirdparty ?
" ".$outputlangs->convToOutputCharset(
$object->thirdparty->name) :
''));
294 $pdf->SetCompression(
false);
298 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
301 if (is_array(
$object->lines)) {
302 foreach (
$object->lines as $line) {
303 if ($line->remise_percent) {
304 $this->atleastonediscount =
true;
312 if (!empty($tplidx)) {
313 $pdf->useTemplate($tplidx);
317 $pdf->SetFont(
'',
'', $default_font_size - 1);
318 $pdf->MultiCell(0, 3,
'');
319 $pdf->SetTextColor(0, 0, 0);
322 $tab_top = 90 + $top_shift;
323 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
327 if ($conf->incoterm->enabled) {
328 $desc_incoterms =
$object->getIncotermsForPDF();
329 if ($desc_incoterms) {
332 $pdf->SetFont(
'',
'', $default_font_size - 1);
333 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
334 $nexY = $pdf->GetY();
335 $height_incoterms = $nexY - $tab_top;
338 $pdf->SetDrawColor(192, 192, 192);
339 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
341 $tab_top = $nexY + 6;
346 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
349 if (is_object(
$object->thirdparty)) {
350 $salereparray =
$object->thirdparty->getSalesRepresentatives($user);
351 $salerepobj =
new User($this->db);
352 $salerepobj->fetch($salereparray[0][
'id']);
353 if (!empty($salerepobj->signature)) {
354 $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
360 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
361 if (!empty($extranote)) {
365 $pagenb = $pdf->getPage();
367 $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
368 $pageposbeforenote = $pagenb;
377 $pdf->startTransaction();
379 $pdf->SetFont(
'',
'', $default_font_size - 1);
380 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
382 $pageposafternote = $pdf->getPage();
383 $posyafter = $pdf->GetY();
385 if ($pageposafternote > $pageposbeforenote) {
386 $pdf->rollbackTransaction(
true);
389 while ($pagenb < $pageposafternote) {
392 if (!empty($tplidx)) {
393 $pdf->useTemplate($tplidx);
399 $pdf->setTopMargin($tab_top_newpage);
401 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
405 $pdf->setPage($pageposbeforenote);
406 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
407 $pdf->SetFont(
'',
'', $default_font_size - 1);
408 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
409 $pageposafternote = $pdf->getPage();
411 $posyafter = $pdf->GetY();
413 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
414 $pdf->AddPage(
'',
'',
true);
417 $pdf->setPage($pageposafternote);
418 $pdf->setTopMargin($tab_top_newpage);
420 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
426 $i = $pageposbeforenote;
427 while ($i < $pageposafternote) {
431 $pdf->SetDrawColor(128, 128, 128);
433 if ($i > $pageposbeforenote) {
434 $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
435 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
437 $height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
438 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
442 $pdf->setPageOrientation(
'', 1, 0);
449 $pdf->setPage($pageposafternote);
450 if (!empty($tplidx)) {
451 $pdf->useTemplate($tplidx);
456 $height_note = $posyafter - $tab_top_newpage;
457 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
459 $pdf->commitTransaction();
460 $posyafter = $pdf->GetY();
461 $height_note = $posyafter - $tab_top;
462 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
465 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20))) {
467 $pdf->AddPage(
'',
'',
true);
470 $pdf->setPage($pageposafternote);
471 if (!empty($tplidx)) {
472 $pdf->useTemplate($tplidx);
478 $posyafter = $tab_top_newpage;
482 $tab_height = $tab_height - $height_note;
483 $tab_top = $posyafter + 6;
493 $pdf->startTransaction();
494 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
495 $pdf->rollbackTransaction(
true);
497 $nexY = $tab_top + $this->tabTitleHeight;
500 $pageposbeforeprintlines = $pdf->getPage();
501 $pagenb = $pageposbeforeprintlines;
502 for ($i = 0; $i < $nblines; $i++) {
504 $pdf->SetFont(
'',
'', $default_font_size - 1);
505 $pdf->SetTextColor(0, 0, 0);
508 $imglinesize = array();
509 if (!empty($realpatharray[$i])) {
513 $pdf->setTopMargin($tab_top_newpage);
514 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
515 $pageposbefore = $pdf->getPage();
518 $showpricebeforepagebreak = 1;
523 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
524 $pdf->AddPage(
'',
'',
true);
525 if (!empty($tplidx)) {
526 $pdf->useTemplate($tplidx);
528 $pdf->setPage($pageposbefore + 1);
530 $curY = $tab_top_newpage;
534 $showpricebeforepagebreak = 1;
536 $showpricebeforepagebreak = 0;
540 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height'])) {
541 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
543 $posYAfterImage = $curY + $imglinesize[
'height'];
548 $pdf->startTransaction();
550 if (method_exists(
$object->lines[$i],
'fetch_product')) {
551 $object->lines[$i]->fetch_product();
553 $object->lines[$i]->description =
$object->lines[$i]->product->description;
554 $object->lines[$i]->fk_unit =
$object->lines[$i]->product->fk_unit;
559 $pageposafter = $pdf->getPage();
560 if ($pageposafter > $pageposbefore) {
561 $pdf->rollbackTransaction(
true);
562 $pageposafter = $pageposbefore;
564 $pdf->setPageOrientation(
'', 1, $heightforfooter);
567 $pageposafter = $pdf->getPage();
568 $posyafter = $pdf->GetY();
569 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
570 if ($i == ($nblines - 1)) {
571 $pdf->AddPage(
'',
'',
true);
572 if (!empty($tplidx)) {
573 $pdf->useTemplate($tplidx);
576 $pdf->setPage($pageposafter + 1);
582 $showpricebeforepagebreak = 1;
584 $showpricebeforepagebreak = 0;
588 $pdf->commitTransaction();
594 $nexY = max($pdf->GetY(), $posYAfterImage);
597 $pageposafter = $pdf->getPage();
599 $pdf->setPage($pageposbefore);
600 $pdf->setTopMargin($this->marge_haute);
601 $pdf->setPageOrientation(
'', 1, 0);
604 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
605 $pdf->setPage($pageposafter);
606 $curY = $tab_top_newpage;
609 $pdf->SetFont(
'',
'', $default_font_size - 1);
615 $nexY = max($pdf->GetY(), $nexY);
620 $pmp =
$object->lines[$i]->pmp;
622 $nexY = max($pdf->GetY(), $nexY);
630 $nexY = max($pdf->GetY(), $nexY);
638 $nexY = max($pdf->GetY(), $nexY);
645 $nexY = max($pdf->GetY(), $nexY);
650 $pmp_qty = $pmp *
$object->lines[$i]->qty;
652 $nexY = max($pdf->GetY(), $nexY);
656 if (!empty(
$object->lines[$i]->array_options)) {
657 foreach (
$object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
661 $nexY = max($pdf->GetY(), $nexY);
672 'outputlangs' => $outputlangs,
673 'hidedetails' => $hidedetails
675 $reshook = $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
680 $tvaligne =
$object->lines[$i]->multicurrency_total_tva;
682 $tvaligne =
$object->lines[$i]->total_tva;
685 $localtax1ligne =
$object->lines[$i]->total_localtax1;
686 $localtax2ligne =
$object->lines[$i]->total_localtax2;
687 $localtax1_rate =
$object->lines[$i]->localtax1_tx;
688 $localtax2_rate =
$object->lines[$i]->localtax2_tx;
689 $localtax1_type =
$object->lines[$i]->localtax1_type;
690 $localtax2_type =
$object->lines[$i]->localtax2_type;
697 $vatrate = (string)
$object->lines[$i]->tva_tx;
700 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
701 && (!empty($localtax1_rate) || !empty($localtax2_rate))) {
703 $localtax1_type = $localtaxtmp_array[0];
704 $localtax2_type = $localtaxtmp_array[2];
708 if ($localtax1_type && $localtax1ligne != 0) {
709 if (empty($this->localtax1[$localtax1_type][$localtax1_rate])) {
710 $this->localtax1[$localtax1_type][$localtax1_rate] = $localtax1ligne;
712 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
715 if ($localtax2_type && $localtax2ligne != 0) {
716 if (empty($this->localtax2[$localtax2_type][$localtax2_rate])) {
717 $this->localtax2[$localtax2_type][$localtax2_rate] = $localtax2ligne;
719 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
723 if ((
$object->lines[$i]->info_bits & 0x01) == 0x01) {
726 if (!isset($this->tva[$vatrate])) {
727 $this->tva[$vatrate] = 0;
729 $this->tva[$vatrate] += $tvaligne;
733 $pdf->setPage($pageposafter);
734 $pdf->SetLineStyle(array(
'dash' =>
'1,1',
'color' => array(80, 80, 80)));
736 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
737 $pdf->SetLineStyle(array(
'dash' => 0));
742 while ($pagenb < $pageposafter) {
743 $pdf->setPage($pagenb);
744 if ($pagenb == $pageposbeforeprintlines) {
745 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code);
747 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code);
751 $pdf->setPage($pagenb);
752 $pdf->setPageOrientation(
'', 1, 0);
757 if (isset(
$object->lines[$i + 1]->pagebreak) &&
$object->lines[$i + 1]->pagebreak) {
758 if ($pagenb == $pageposafter) {
759 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1,
$object->multicurrency_code);
761 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1,
$object->multicurrency_code);
766 if (!empty($tplidx)) {
767 $pdf->useTemplate($tplidx);
777 if ($pagenb == $pageposbeforeprintlines) {
778 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, $hidetop, 0,
$object->multicurrency_code);
780 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0,
$object->multicurrency_code);
782 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
793 if (method_exists($pdf,
'AliasNbPages')) {
794 $pdf->AliasNbPages();
799 $pdf->Output($file,
'F');
802 $hookmanager->initHooks(array(
'pdfgeneration'));
803 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
805 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
807 $this->error = $hookmanager->error;
808 $this->errors = $hookmanager->errors;
813 $this->result = array(
'fullpath' => $file);
817 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
821 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"STOCKTRANSFER_OUTPUTDIR");
837 global $conf, $mysoc;
840 $pdf->SetFont(
'',
'', $default_font_size - 1);
843 if ($this->emetteur->country_code ==
'FR' && empty($mysoc->tva_assuj)) {
844 $pdf->SetFont(
'',
'B', $default_font_size - 2);
845 $pdf->SetXY($this->marge_gauche, $posy);
846 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"VATIsNotUsedForInvoice"), 0,
'L', 0);
848 $posy = $pdf->GetY() + 4;
855 $pdf->SetFont(
'',
'B', $default_font_size - 2);
856 $pdf->SetXY($this->marge_gauche, $posy);
857 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
858 $pdf->MultiCell(43, 4, $titre, 0,
'L');
860 $pdf->SetFont(
'',
'', $default_font_size - 2);
861 $pdf->SetXY($posxval, $posy);
862 $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);
863 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
864 $pdf->MultiCell(67, 4, $lib_condition_paiement, 0,
'L');
866 $posy = $pdf->GetY() + 3;
897 if (!empty(
$object->delivery_date)) {
898 $outputlangs->load(
"sendings");
899 $pdf->SetFont(
'',
'B', $default_font_size - 2);
900 $pdf->SetXY($this->marge_gauche, $posy);
901 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
902 $pdf->MultiCell(80, 4, $titre, 0,
'L');
903 $pdf->SetFont(
'',
'', $default_font_size - 2);
904 $pdf->SetXY($posxval, $posy);
906 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
908 $posy = $pdf->GetY() + 1;
910 $pdf->SetFont(
'',
'B', $default_font_size - 2);
911 $pdf->SetXY($this->marge_gauche, $posy);
912 $titre = $outputlangs->transnoentities(
"AvailabilityPeriod").
':';
913 $pdf->MultiCell(80, 4, $titre, 0,
'L');
914 $pdf->SetTextColor(0, 0, 0);
915 $pdf->SetFont(
'',
'', $default_font_size - 2);
916 $pdf->SetXY($posxval, $posy);
917 $lib_availability = $outputlangs->transnoentities(
"AvailabilityType".
$object->availability_code) !=
'AvailabilityType'.$object->availability_code ? $outputlangs->transnoentities(
"AvailabilityType".
$object->availability_code) : $outputlangs->convToOutputCharset(isset(
$object->availability) ?
$object->availability :
'');
918 $lib_availability = str_replace(
'\n',
"\n", $lib_availability);
919 $pdf->MultiCell(80, 4, $lib_availability, 0,
'L');
921 $posy = $pdf->GetY() + 1;
925 if (
$object->mode_reglement_code
926 &&
$object->mode_reglement_code !=
'CHQ'
927 &&
$object->mode_reglement_code !=
'VIR') {
928 $pdf->SetFont(
'',
'B', $default_font_size - 2);
929 $pdf->SetXY($this->marge_gauche, $posy);
930 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
931 $pdf->MultiCell(80, 5, $titre, 0,
'L');
933 $pdf->SetFont(
'',
'', $default_font_size - 2);
934 $pdf->SetXY($posxval, $posy);
935 $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);
936 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
938 $posy = $pdf->GetY() + 2;
942 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'CHQ') {
946 $account =
new Account($this->db);
949 $pdf->SetXY($this->marge_gauche, $posy);
950 $pdf->SetFont(
'',
'B', $default_font_size - 3);
951 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->owner_name), 0,
'L', 0);
952 $posy = $pdf->GetY() + 1;
955 $pdf->SetXY($this->marge_gauche, $posy);
956 $pdf->SetFont(
'',
'', $default_font_size - 3);
957 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
958 $posy = $pdf->GetY() + 2;
962 $pdf->SetXY($this->marge_gauche, $posy);
963 $pdf->SetFont(
'',
'B', $default_font_size - 3);
964 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
965 $posy = $pdf->GetY() + 1;
968 $pdf->SetXY($this->marge_gauche, $posy);
969 $pdf->SetFont(
'',
'', $default_font_size - 3);
970 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
971 $posy = $pdf->GetY() + 2;
978 if (empty(
$object->mode_reglement_code) ||
$object->mode_reglement_code ==
'VIR') {
980 $bankid = (empty(
$object->fk_account) ? $conf->global->FACTURE_RIB_NUMBER :
$object->fk_account);
981 if (!empty(
$object->fk_bank)) {
984 $account =
new Account($this->db);
985 $account->fetch($bankid);
987 $curx = $this->marge_gauche;
990 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
1012 global $conf, $mysoc;
1018 $pdf->SetFont(
'',
'', $default_font_size - 1);
1023 if ($this->page_largeur < 210) {
1026 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
1030 $outputlangsbis =
null;
1032 $outputlangsbis =
new Translate(
'', $conf);
1034 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
1046 $pdf->SetFillColor(248, 248, 248);
1048 $total_ttc =
$object->getValorisationTotale();
1050 $this->atleastoneratenotnull = 0;
1054 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1055 $pdf->SetTextColor(0, 0, 60);
1056 $pdf->SetFillColor(224, 224, 224);
1057 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"Total").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"Total", $mysoc->country_code) :
''), $useborder,
'L', 1);
1059 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1060 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1062 $pdf->SetTextColor(0, 0, 0);
1064 $creditnoteamount = 0;
1065 $depositsamount = 0;
1069 $resteapayer =
price2num($total_ttc - $deja_regle - $creditnoteamount - $depositsamount,
'MT');
1074 if ($deja_regle > 0) {
1078 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1079 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"AlreadyPaid") :
''), 0,
'L', 0);
1080 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1081 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1084 $pdf->SetTextColor(0, 0, 60);
1085 $pdf->SetFillColor(224, 224, 224);
1086 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1087 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"AlreadyPaid") :
''), $useborder,
'L', 1);
1089 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1090 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1092 $pdf->SetFont(
'',
'', $default_font_size - 1);
1093 $pdf->SetTextColor(0, 0, 0);
1097 return ($tab2_top + ($tab2_hl * $index));
1114 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'')
1124 $currency = !empty($currency) ? $currency : $conf->currency;
1128 $pdf->SetTextColor(0, 0, 0);
1129 $pdf->SetFont(
'',
'', $default_font_size - 2);
1131 if (empty($hidetop)) {
1132 $titre = $outputlangs->transnoentities(
"AmountInCurrency", $outputlangs->transnoentitiesnoconv(
"Currency".$currency));
1133 $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
1134 $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
1138 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight,
'F',
null, explode(
',',
getDolGlobalString(
'MAIN_PDF_TITLE_BACKGROUND_COLOR')));
1142 $pdf->SetDrawColor(128, 128, 128);
1143 $pdf->SetFont(
'',
'', $default_font_size - 1);
1146 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
1149 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
1151 if (empty($hidetop)) {
1152 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight);
1168 protected function _pagehead(&$pdf,
$object, $showaddress, $outputlangs, $titlekey =
"StockTransferSheetProforma")
1171 global $conf, $langs;
1174 $outputlangs->loadLangs(array(
"main",
"bills",
"propal",
"orders",
"companies"));
1185 $pdf->SetTextColor(0, 0, 60);
1186 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1190 $posy = $this->marge_haute;
1191 $posx = $this->page_largeur - $this->marge_droite - 100;
1193 $pdf->SetXY($this->marge_gauche, $posy);
1197 if ($this->emetteur->logo) {
1198 $logodir = $conf->mycompany->dir_output;
1199 if (!empty($conf->mycompany->multidir_output[
$object->entity])) {
1200 $logodir = $conf->mycompany->multidir_output[
$object->entity];
1203 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1205 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1207 if (is_readable($logo)) {
1209 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1211 $pdf->SetTextColor(200, 0, 0);
1212 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1213 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1214 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1217 $text = $this->emetteur->name;
1218 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
1222 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1223 $pdf->SetXY($posx, $posy);
1224 $pdf->SetTextColor(0, 0, 60);
1225 $title = $outputlangs->transnoentities($titlekey);
1226 $pdf->MultiCell($w, 3, $title,
'',
'R');
1228 $pdf->SetFont(
'',
'B', $default_font_size);
1231 $pdf->SetXY($posx, $posy);
1232 $pdf->SetTextColor(0, 0, 60);
1233 $pdf->MultiCell($w, 4, $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset(
$object->ref),
'',
'R');
1236 $pdf->SetFont(
'',
'', $default_font_size - 1);
1239 if (!empty(
$object->date_prevue_depart)) {
1241 $pdf->SetXY($posx, $posy);
1242 $pdf->SetTextColor(0, 0, 60);
1243 $pdf->MultiCell($w, 4, $outputlangs->transnoentities(
"DatePrevueDepart").
" : ".
dol_print_date(
$object->date_prevue_depart,
"day",
false, $outputlangs,
true),
'',
'R');
1247 if (!empty(
$object->date_prevue_arrivee)) {
1249 $pdf->SetXY($posx, $posy);
1250 $pdf->SetTextColor(0, 0, 60);
1251 $pdf->MultiCell($w, 4, $outputlangs->transnoentities(
"DatePrevueArrivee").
" : ".
dol_print_date(
$object->date_prevue_arrivee,
"day",
false, $outputlangs,
true),
'',
'R');
1255 if (!empty(
$object->date_reelle_depart)) {
1257 $pdf->SetXY($posx, $posy);
1258 $pdf->SetTextColor(0, 0, 60);
1259 $pdf->MultiCell($w, 4, $outputlangs->transnoentities(
"DateReelleDepart").
" : ".
dol_print_date(
$object->date_reelle_depart,
"day",
false, $outputlangs,
true),
'',
'R');
1263 if (!empty(
$object->date_reelle_arrivee)) {
1265 $pdf->SetXY($posx, $posy);
1266 $pdf->SetTextColor(0, 0, 60);
1267 $pdf->MultiCell($w, 4, $outputlangs->transnoentities(
"DateReelleArrivee").
" : ".
dol_print_date(
$object->date_reelle_arrivee,
"day",
false, $outputlangs,
true),
'',
'R');
1272 $pdf->SetXY($posx, $posy);
1273 $pdf->SetTextColor(0, 0, 60);
1274 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".$outputlangs->convToOutputCharset(
$object->ref_client),
'',
'R');
1279 if (!empty(
$object->project->ref)) {
1281 $pdf->SetXY($posx, $posy);
1282 $pdf->SetTextColor(0, 0, 60);
1283 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty(
$object->project->title) ?
'' :
$object->projet->title),
'',
'R');
1289 if (!empty(
$object->project->ref)) {
1291 $pdf->SetXY($posx, $posy);
1292 $pdf->SetTextColor(0, 0, 60);
1293 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefProject").
" : ".(empty(
$object->project->ref) ?
'' :
$object->projet->ref),
'',
'R');
1299 $pdf->SetXY($posx, $posy);
1300 $pdf->SetTextColor(0, 0, 60);
1301 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities(
$object->thirdparty->code_client),
'',
'R');
1306 $arrayidcontact =
$object->getIdContact(
'internal',
'SALESREPFOLL');
1307 if (count($arrayidcontact) > 0) {
1308 $usertmp =
new User($this->db);
1309 $usertmp->fetch($arrayidcontact[0]);
1311 $pdf->SetXY($posx, $posy);
1312 $pdf->SetTextColor(0, 0, 60);
1313 $pdf->MultiCell(100, 3, $langs->trans(
"SalesRepresentative").
" : ".$usertmp->getFullName($langs),
'',
'R');
1321 $current_y = $pdf->getY();
1323 if ($current_y < $pdf->getY()) {
1324 $top_shift = $pdf->getY() - $current_y;
1329 $carac_emetteur =
'';
1331 $arrayidcontact = array();
1332 $arrayidcontact =
$object->getIdContact(
'external',
'STFROM');
1334 $usecontact =
false;
1335 if (count($arrayidcontact) > 0) {
1339 $result =
$object->fetch_contact($arrayidcontact[0]);
1343 $thirdparty =
$object->contact;
1345 $thirdparty = $this->emetteur;
1348 if (!empty($thirdparty)) {
1360 $posx = $this->marge_gauche;
1362 $posx = $this->page_largeur - $this->marge_droite - 80;
1369 $pdf->SetTextColor(0, 0, 0);
1370 $pdf->SetFont(
'',
'', $default_font_size - 2);
1371 $pdf->SetXY($posx, $posy - 5);
1372 $pdf->MultiCell(66, 5, $outputlangs->transnoentities(
"Sender").
":", 0,
'L');
1373 $pdf->SetXY($posx, $posy);
1374 $pdf->SetFillColor(230, 230, 230);
1375 $pdf->MultiCell($widthrecbox, $hautcadre,
"", 0,
'R', 1);
1376 $pdf->SetTextColor(0, 0, 60);
1377 $pdf->SetFillColor(255, 255, 255);
1380 $pdf->SetXY($posx + 2, $posy + 3);
1381 $pdf->SetFont(
'',
'B', $default_font_size);
1382 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($carac_emetteur_name), 0,
'L');
1383 $posy = $pdf->getY();
1386 $pdf->SetXY($posx + 2, $posy);
1387 $pdf->SetFont(
'',
'', $default_font_size - 1);
1388 $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0,
'L');
1392 $usecontact =
false;
1393 $arrayidcontact =
$object->getIdContact(
'external',
'STDEST');
1394 if (count($arrayidcontact) > 0) {
1396 $result =
$object->fetch_contact($arrayidcontact[0]);
1402 $thirdparty =
$object->contact;
1404 $thirdparty =
$object->thirdparty;
1407 $carac_client_name =
'';
1408 if (!empty($thirdparty)) {
1416 if ($this->page_largeur < 210) {
1420 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1422 $posx = $this->marge_gauche;
1426 $pdf->SetTextColor(0, 0, 0);
1427 $pdf->SetFont(
'',
'', $default_font_size - 2);
1428 $pdf->SetXY($posx + 2, $posy - 5);
1429 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"Recipient").
":", 0,
'L');
1430 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1433 $pdf->SetXY($posx + 2, $posy + 3);
1434 $pdf->SetFont(
'',
'B', $default_font_size);
1435 $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0,
'L');
1437 $posy = $pdf->getY();
1440 $pdf->SetFont(
'',
'', $default_font_size - 1);
1441 $pdf->SetXY($posx + 2, $posy);
1442 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
1445 $pdf->SetTextColor(0, 0, 0);
1464 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
1465 return pdf_pagefoot($pdf, $outputlangs,
'ORDER_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur,
$object, $showdetails, $hidefreetext);
1482 global $conf, $hookmanager;
1485 $this->defaultContentsFieldsStyle = array(
1487 'padding' => array(1, 0.5, 1, 0.5),
1491 $this->defaultTitlesFieldsStyle = array(
1493 'padding' => array(0.5, 0, 0.5, 0),
1515 $this->cols[
'desc'] = array(
1520 'textkey' =>
'Designation',
1524 'padding' => array(0.5, 1, 0.5, 1.5),
1528 'padding' => array(1, 0.5, 1, 1.5),
1533 $this->cols[
'photo'] = array(
1538 'textkey' =>
'Photo',
1542 'padding' => array(0, 0, 0, 0),
1544 'border-left' =>
false,
1548 $this->cols[
'photo'][
'status'] =
true;
1553 $this->cols[
'vat'] = array(
1560 'border-left' =>
true,
1569 $this->cols[
'subprice'] = array(
1574 'textkey' =>
'PMPValueShort'
1576 'border-left' =>
true,
1582 for ($i = 0; $i < $nblines; $i++) {
1584 $tmpwidth = max($tmpwidth, $tmpwidth2);
1586 if ($tmpwidth > 10) {
1587 $this->cols[
'subprice'][
'width'] += (2 * ($tmpwidth - 10));
1591 $this->cols[
'qty'] = array(
1598 'border-left' =>
true,
1602 $this->cols[
'unit'] = array(
1609 'border-left' =>
true,
1612 $this->cols[
'unit'][
'status'] =
true;
1616 $this->cols[
'discount'] = array(
1621 'textkey' =>
'ReductionShort'
1623 'border-left' =>
true,
1625 if ($this->atleastonediscount) {
1626 $this->cols[
'discount'][
'status'] =
true;
1629 $rank = $rank + 1000;
1630 $this->cols[
'totalexcltax'] = array(
1635 'textkey' =>
'TotalHTShort'
1637 'border-left' =>
true,
1642 $line = reset(
$object->lines);
1646 $parameters = array(
1648 'outputlangs' => $outputlangs,
1649 'hidedetails' => $hidedetails,
1650 'hidedesc' => $hidedesc,
1651 'hideref' => $hideref
1654 $reshook = $hookmanager->executeHooks(
'defineColumnField', $parameters, $this);
1657 } elseif (empty($reshook)) {
1659 $this->cols = array_replace($this->cols, $hookmanager->resArray);
1661 $this->cols = $hookmanager->resArray;
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage bank accounts.
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
getColumnStatus($colKey)
get column status from column key
printStdColumnContent($pdf, &$curY, $colKey, $columnText='')
print standard column content
pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
Print standard column content.
printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
print description column content
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
getExtrafieldContent($object, $extrafieldKey, $outputlangs=null)
get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note...
defineColumnExtrafield($object, $outputlangs, $hidedetails=0)
Define Array Column Field for extrafields.
Parent class for documents models.
Class to manage products or services.
Class to manage translations.
Class to manage Dolibarr users.
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...
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
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.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
Get type and rate of localtaxes for a particular vat rate/country of a thirdparty.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
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...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
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...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
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_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_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto 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_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber=0, $default_font_size=10)
Show bank information 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 formatted for output on PDF documents.
pdf_getlineunit($object, $i, $outputlangs, $hidedetails=0)
Return line unit.
pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails=0)
Return line remise percent.
pdf_getlineqty($object, $i, $outputlangs, $hidedetails=0)
Return line quantity.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0, $include=null)
Return array of possible substitutions for PDF content (without external module substitutions).
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
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.