41include_once DOL_DOCUMENT_ROOT.
'/core/lib/signature.lib.php';
56 $head[$h][0] = DOL_URL_ROOT.
'/admin/pdf.php';
57 $head[$h][1] = $langs->trans(
"GlobalParameters");
58 $head[$h][2] =
'general';
68 $head[$h][0] = DOL_URL_ROOT.
'/admin/pdf_other.php';
69 $head[$h][1] = $langs->trans(
"SpecificParameters");
70 $head[$h][2] =
'other';
89 global
$conf, $db, $langs;
91 dol_syslog(
"pdf_getFormat Get paper format with mode=".$mode.
" MAIN_PDF_FORMAT=".
getDolGlobalString(
'MAIN_PDF_FORMAT').
" outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang :
'null').
" and langs->defaultlang=".(is_object($langs) ? $langs->defaultlang :
'null'));
99 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
105 $sql =
"SELECT code, label, width, height, unit FROM ".MAIN_DB_PREFIX.
"c_paper_format";
106 $sql .=
" WHERE code = '".$db->escape($pdfformat).
"'";
107 $resql = $db->query($sql);
109 $obj = $db->fetch_object($resql);
111 $width = (int) $obj->width;
112 $height = (int) $obj->height;
118 return array(
'width' => $width,
'height' => $height,
'unit' => $unit);
134 if (!defined(
'K_TCPDF_EXTERNAL_CONFIG')) {
135 define(
'K_TCPDF_EXTERNAL_CONFIG', 1);
136 define(
'K_PATH_CACHE', DOL_DATA_ROOT.
'/admin/temp/');
137 define(
'K_PATH_URL_CACHE', DOL_DATA_ROOT.
'/admin/temp/');
139 define(
'K_BLANK_IMAGE',
'_blank.png');
140 define(
'PDF_PAGE_FORMAT',
'A4');
141 define(
'PDF_PAGE_ORIENTATION',
'P');
142 define(
'PDF_CREATOR',
'TCPDF');
143 define(
'PDF_AUTHOR',
'TCPDF');
144 define(
'PDF_HEADER_TITLE',
'TCPDF Example');
145 define(
'PDF_HEADER_STRING',
"by Dolibarr ERP CRM");
146 define(
'PDF_UNIT',
'mm');
147 define(
'PDF_MARGIN_HEADER', 5);
148 define(
'PDF_MARGIN_FOOTER', 10);
149 define(
'PDF_MARGIN_TOP', 27);
150 define(
'PDF_MARGIN_BOTTOM', 25);
151 define(
'PDF_MARGIN_LEFT', 15);
152 define(
'PDF_MARGIN_RIGHT', 15);
153 define(
'PDF_FONT_NAME_MAIN',
'helvetica');
154 define(
'PDF_FONT_SIZE_MAIN', 10);
155 define(
'PDF_FONT_NAME_DATA',
'helvetica');
156 define(
'PDF_FONT_SIZE_DATA', 8);
157 define(
'PDF_FONT_MONOSPACED',
'courier');
158 define(
'PDF_IMAGE_SCALE_RATIO', 1.25);
159 define(
'HEAD_MAGNIFICATION', 1.1);
160 define(
'K_CELL_HEIGHT_RATIO', 1.25);
161 define(
'K_TITLE_MAGNIFICATION', 1.3);
162 define(
'K_SMALL_RATIO', 2 / 3);
163 define(
'K_THAI_TOPCHARS',
true);
164 define(
'K_TCPDF_CALLS_IN_HTML',
true);
171 define(
'K_TCPDF_THROW_EXCEPTION_ERROR',
true);
173 define(
'K_TCPDF_THROW_EXCEPTION_ERROR',
false);
178 require_once TCPDF_PATH.
'tcpdf.php';
182 require_once TCPDI_PATH.
'tcpdi.php';
193 $pdf =
new TCPDI($pagetype, $metric, $format,
true,
'UTF-8',
false, $pdfa);
195 $pdf =
new TCPDF($pagetype, $metric, $format,
true,
'UTF-8',
false, $pdfa);
198 $pdf->setAllowLocalFiles(
true);
230 $pdf->SetProtection($pdfrights, $pdfuserpass, $pdfownerpass, $encstrength, $pubkeys);
244 require_once TCPDF_PATH.
'tcpdf_parser.php';
246 $isencrypted =
false;
248 $content = file_get_contents($pathoffile);
251 @($parser =
new TCPDF_PARSER(ltrim($content)));
252 $tmp = $parser->getParsedData();
254 $data = $tmp[1] ??
null;
258 if (isset($xref[
'trailer'][
'encrypt'])) {
282 if (class_exists(
'TCPDF')) {
283 if ($outputlangs->trans(
'FONTFORPDF') !=
'FONTFORPDF') {
284 $font = $outputlangs->trans(
'FONTFORPDF');
299 if (class_exists(
'TCPDF')) {
300 if ($outputlangs->trans(
'FONTSIZEFORPDF') !=
'FONTSIZEFORPDF') {
301 $size = (int) $outputlangs->trans(
'FONTSIZEFORPDF');
323 include_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
325 if ($tmp[
'height']) {
326 $width = round($height * $tmp[
'width'] / $tmp[
'height']);
327 if ($width > $maxwidth) {
328 $height = $height * $maxwidth / $width;
354 if ($emetteur->logo) {
356 $logo = $logodir.
'/logos/thumbs/'.$emetteur->logo_small;
358 $logo = $logodir.
'/logos/'.$emetteur->logo;
360 if (is_readable($logo)) {
362 $pdf->Image($logo, $posx, $posy, 0, $height);
364 $pdf->SetTextColor(200, 0, 0);
365 $pdf->SetFont(
'',
'B', $default_font_size - 2);
366 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
367 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
370 $text = (string) $emetteur->name;
371 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0, $align);
388 $pdf->startTransaction();
393 $start_y = $pdf->GetY();
395 $start_page = $pdf->getPage();
397 $pdf->writeHTMLCell(0, 0, 0, $start_y, $htmlcontent, 0, 1,
false,
true,
'J',
true);
399 $end_y = $pdf->GetY();
400 $end_page = $pdf->getPage();
403 if ($end_page == $start_page) {
404 $height = $end_y - $start_y;
406 for ($page = $start_page; $page <= $end_page; ++$page) {
407 $pdf->setPage($page);
408 $tmpm = $pdf->getMargins();
409 $tMargin = $tmpm[
'top'];
410 if ($page == $start_page) {
412 $height = $pdf->getPageHeight() - $start_y - $pdf->getBreakMargin();
413 } elseif ($page == $end_page) {
415 $height = $end_y - $tMargin;
417 $height = $pdf->getPageHeight() - $tMargin - $pdf->getBreakMargin();
422 $pdf->rollbackTransaction(
true);
441 if ($thirdparty instanceof
Societe) {
442 $socname = $thirdparty->name;
443 if (($includealias ||
getDolGlobalInt(
'PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->name_alias)) {
445 $socname = $thirdparty->name_alias.
" - ".$thirdparty->name;
447 $socname = $thirdparty->name.
" - ".$thirdparty->name_alias;
450 } elseif ($thirdparty instanceof
Contact) {
451 if ($thirdparty->socid > 0) {
452 $thirdparty->fetch_thirdparty();
453 $socname = $thirdparty->thirdparty->name;
454 if (($includealias ||
getDolGlobalInt(
'PDF_INCLUDE_ALIAS_IN_THIRDPARTY_NAME')) && !empty($thirdparty->thirdparty->name_alias)) {
456 $socname = $thirdparty->thirdparty->name_alias.
" - ".$thirdparty->thirdparty->name;
458 $socname = $thirdparty->thirdparty->name.
" - ".$thirdparty->thirdparty->name_alias;
463 throw new InvalidArgumentException(
'Parameter 1 $thirdparty is not a Societe nor Contact');
466 return $outputlangs->convToOutputCharset((
string) $socname);
481function pdf_build_address($outputlangs, $sourcecompany, $targetcompany =
'', $targetcontact =
'', $usecontact = 0, $mode =
'source',
$object =
null)
485 if ($mode ==
'source' && !is_object($sourcecompany)) {
488 if (($mode ==
'target' || $mode ==
'targetshipping') && !is_object($targetcompany)) {
492 if (!empty($sourcecompany->state_id) && empty($sourcecompany->state)) {
493 $sourcecompany->state =
getState($sourcecompany->state_id);
495 if (!empty($targetcompany->state_id) && empty($targetcompany->state)) {
496 $targetcompany->state =
getState($targetcompany->state_id);
501 if (is_object($hookmanager)) {
502 $parameters = array(
'sourcecompany' => &$sourcecompany,
'targetcompany' => &$targetcompany,
'targetcontact' => &$targetcontact,
'outputlangs' => $outputlangs,
'mode' => $mode,
'usecontact' => $usecontact);
505 $reshook = $hookmanager->executeHooks(
'pdf_build_address', $parameters,
$object, $action);
506 $stringaddress .= $hookmanager->resPrint;
508 if (empty($reshook)) {
509 if ($mode ==
'source') {
511 if (isset($targetcompany->country_code) && !empty($sourcecompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
517 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset($fulladdress).
"\n";
522 if ($sourcecompany->phone) {
523 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"PhoneShort").
": ".$outputlangs->convToOutputCharset($sourcecompany->phone);
526 if ($sourcecompany->phone_mobile &&
getDolGlobalString(
'MAIN_PDF_SHOW_SOURCE_PHONE_MOBILE')) {
527 $stringaddress .= ($stringaddress ? ($sourcecompany->phone ?
" - " :
"\n") :
'').$outputlangs->transnoentities(
"PhoneShort").
": ".$outputlangs->convToOutputCharset($sourcecompany->phone_mobile);
530 if ($sourcecompany->fax) {
531 $stringaddress .= ($stringaddress ? ($sourcecompany->phone ?
" - " :
"\n") :
'').$outputlangs->transnoentities(
"Fax").
": ".$outputlangs->convToOutputCharset($sourcecompany->fax);
534 if ($sourcecompany->email) {
535 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Email").
": ".$outputlangs->convToOutputCharset($sourcecompany->email);
538 if ($sourcecompany->url) {
539 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Web").
": ".$outputlangs->convToOutputCharset($sourcecompany->url);
544 if ($sourcecompany->tva_intra) {
545 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"VATIntraShort").
': '.$outputlangs->convToOutputCharset($sourcecompany->tva_intra);
550 if (
getDolGlobalString(
'MAIN_PROFID1_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof1)) {
551 $tmp = $outputlangs->transcountrynoentities(
"ProfId1", $sourcecompany->country_code);
552 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
555 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof1);
557 if (
getDolGlobalString(
'MAIN_PROFID2_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof2)) {
558 $tmp = $outputlangs->transcountrynoentities(
"ProfId2", $sourcecompany->country_code);
559 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
562 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof2);
564 if (
getDolGlobalString(
'MAIN_PROFID3_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof3)) {
565 $tmp = $outputlangs->transcountrynoentities(
"ProfId3", $sourcecompany->country_code);
566 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
569 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof3);
571 if (
getDolGlobalString(
'MAIN_PROFID4_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof4)) {
572 $tmp = $outputlangs->transcountrynoentities(
"ProfId4", $sourcecompany->country_code);
573 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
576 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof4);
578 if (
getDolGlobalString(
'MAIN_PROFID5_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof5)) {
579 $tmp = $outputlangs->transcountrynoentities(
"ProfId5", $sourcecompany->country_code);
580 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
583 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof5);
585 if (
getDolGlobalString(
'MAIN_PROFID6_IN_SOURCE_ADDRESS') && !empty($sourcecompany->idprof6)) {
586 $tmp = $outputlangs->transcountrynoentities(
"ProfId6", $sourcecompany->country_code);
587 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
590 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($sourcecompany->idprof6);
593 $stringaddress .= ($stringaddress ?
"\n" :
'') .
getDolGlobalString(
'PDF_ADD_MORE_AFTER_SOURCE_ADDRESS');
597 if ($mode ==
'target' || $mode ==
'targetshipping' || preg_match(
'/targetwithdetails/', $mode)) {
598 if ($usecontact && (is_object($targetcontact))) {
599 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset($targetcontact->getFullName($outputlangs, 1));
601 if (!empty($targetcontact->address)) {
602 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset(
dol_format_address($targetcontact)).
"\n";
603 } elseif (is_object($targetcompany)) {
604 $companytouseforaddress = $targetcompany;
607 if ($targetcontact->socid > 0 && $targetcontact->socid != $targetcompany->id) {
608 $targetcontact->fetch_thirdparty();
609 $companytouseforaddress = $targetcontact->thirdparty;
612 if (is_object($companytouseforaddress)) {
613 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset(
dol_format_address($companytouseforaddress)).
"\n";
617 if (!empty($targetcontact->country_code) && $targetcontact->country_code != $sourcecompany->country_code) {
618 $stringaddress .= (($stringaddress && !
getDolGlobalString(
'MAIN_PDF_REMOVE_BREAK_BEFORE_COUNTRY')) ?
"\n" :
'').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv(
"Country".$targetcontact->country_code));
619 } elseif (empty($targetcontact->country_code) && !empty($targetcompany->country_code) && ($targetcompany->country_code != $sourcecompany->country_code)) {
620 $stringaddress .= (($stringaddress && !
getDolGlobalString(
'MAIN_PDF_REMOVE_BREAK_BEFORE_COUNTRY')) ?
"\n" :
'').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv(
"Country".$targetcompany->country_code));
623 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || preg_match(
'/targetwithdetails/', $mode)) {
625 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_phone/', $mode)) {
626 if (!empty($targetcontact->phone_pro) || !empty($targetcontact->phone_mobile)) {
627 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Phone").
": ";
629 if (!empty($targetcontact->phone_pro)) {
630 $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_pro);
632 if (!empty($targetcontact->phone_pro) && !empty($targetcontact->phone_mobile)) {
633 $stringaddress .=
" / ";
635 if (!empty($targetcontact->phone_mobile)) {
636 $stringaddress .= $outputlangs->convToOutputCharset($targetcontact->phone_mobile);
640 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_fax/', $mode)) {
641 if ($targetcontact->fax) {
642 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Fax").
": ".$outputlangs->convToOutputCharset($targetcontact->fax);
646 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_email/', $mode)) {
647 if ($targetcontact->email) {
648 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Email").
": ".$outputlangs->convToOutputCharset($targetcontact->email);
652 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_url/', $mode)) {
653 if ($targetcontact->url) {
654 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Web").
": ".$outputlangs->convToOutputCharset((
string) $targetcontact->url);
659 if (is_object($targetcompany)) {
660 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset(
dol_format_address($targetcompany));
662 if (!empty($targetcompany->country_code) && $targetcompany->country_code != $sourcecompany->country_code) {
663 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->convToOutputCharset($outputlangs->transnoentitiesnoconv(
"Country".$targetcompany->country_code));
665 $stringaddress .= ($stringaddress ?
"\n" :
'');
668 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || preg_match(
'/targetwithdetails/', $mode)) {
670 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_phone/', $mode)) {
671 if (!empty($targetcompany->phone) || !empty($targetcompany->phone_mobile)) {
672 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Phone").
": ";
674 if (!empty($targetcompany->phone)) {
675 $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone);
677 if (!empty($targetcompany->phone) && !empty($targetcompany->phone_mobile)) {
678 $stringaddress .=
" / ";
680 if (!empty($targetcompany->phone_mobile)) {
681 $stringaddress .= $outputlangs->convToOutputCharset($targetcompany->phone_mobile);
685 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_fax/', $mode)) {
686 if ($targetcompany->fax) {
687 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Fax").
": ".$outputlangs->convToOutputCharset($targetcompany->fax);
691 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_email/', $mode)) {
692 if ($targetcompany->email) {
693 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Email").
": ".$outputlangs->convToOutputCharset($targetcompany->email);
697 if (
getDolGlobalString(
'MAIN_PDF_ADDALSOTARGETDETAILS') || $mode ==
'targetwithdetails' || preg_match(
'/targetwithdetails_url/', $mode)) {
698 if ($targetcompany->url) {
699 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"Web").
": ".$outputlangs->convToOutputCharset($targetcompany->url);
708 if ($usecontact && is_object($targetcontact) &&
getDolGlobalInt(
'MAIN_USE_COMPANY_NAME_OF_CONTACT')) {
709 $targetcontact->fetch_thirdparty();
710 if (!empty($targetcontact->thirdparty->id) && $targetcontact->thirdparty->tva_intra) {
711 $stringaddress .= ($stringaddress ?
"\n" :
'') . $outputlangs->transnoentities(
"VATIntraShort") .
': ' . $outputlangs->convToOutputCharset($targetcontact->thirdparty->tva_intra);
713 } elseif (!empty($targetcompany->tva_intra)) {
714 $stringaddress .= ($stringaddress ?
"\n" :
'').$outputlangs->transnoentities(
"VATIntraShort").
': '.$outputlangs->convToOutputCharset($targetcompany->tva_intra);
719 if (
getDolGlobalString(
'MAIN_LEGALFORM_IN_ADDRESS') && !empty($targetcompany->forme_juridique_code)) {
721 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp;
725 if (
getDolGlobalString(
'MAIN_PROFID1_IN_ADDRESS') && !empty($targetcompany->idprof1)) {
726 $tmp = $outputlangs->transcountrynoentities(
"ProfId1", $targetcompany->country_code);
727 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
730 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof1);
732 if (
getDolGlobalString(
'MAIN_PROFID2_IN_ADDRESS') && !empty($targetcompany->idprof2)) {
733 $tmp = $outputlangs->transcountrynoentities(
"ProfId2", $targetcompany->country_code);
734 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
737 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof2);
739 if (
getDolGlobalString(
'MAIN_PROFID3_IN_ADDRESS') && !empty($targetcompany->idprof3)) {
740 $tmp = $outputlangs->transcountrynoentities(
"ProfId3", $targetcompany->country_code);
741 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
744 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof3);
746 if (
getDolGlobalString(
'MAIN_PROFID4_IN_ADDRESS') && !empty($targetcompany->idprof4)) {
747 $tmp = $outputlangs->transcountrynoentities(
"ProfId4", $targetcompany->country_code);
748 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
751 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof4);
753 if (
getDolGlobalString(
'MAIN_PROFID5_IN_ADDRESS') && !empty($targetcompany->idprof5)) {
754 $tmp = $outputlangs->transcountrynoentities(
"ProfId5", $targetcompany->country_code);
755 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
758 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof5);
760 if (
getDolGlobalString(
'MAIN_PROFID6_IN_ADDRESS') && !empty($targetcompany->idprof6)) {
761 $tmp = $outputlangs->transcountrynoentities(
"ProfId6", $targetcompany->country_code);
762 if (preg_match(
'/\((.+)\)/', $tmp, $reg)) {
765 $stringaddress .= ($stringaddress ?
"\n" :
'').$tmp.
': '.$outputlangs->convToOutputCharset($targetcompany->idprof6);
770 if ($mode ==
'source' && !empty($sourcecompany->note_public)) {
771 $stringaddress .= ($stringaddress ?
"\n" :
'').
dol_string_nohtmltag($sourcecompany->note_public);
773 if (($mode ==
'target' || $mode ==
'targetshipping' || preg_match(
'/targetwithdetails/', $mode)) && !empty($targetcompany->note_public)) {
774 $stringaddress .= ($stringaddress ?
"\n" :
'').
dol_string_nohtmltag($targetcompany->note_public);
780 return $stringaddress;
799 if (file_exists($filepath)) {
800 $pdf->setAutoPageBreak(
false, 0);
809 $pdf->setAutoPageBreak(
true, 0);
833 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
855function pdfWriteVATArray($docgenerator, &$index, $pdf, $outputlangs, $outputlangsbis,
$object, $col1x, $col2x, $largcol2, $tab2_top, $tab2_hl)
859 $tmpatleastoneratenotnull = 0;
862 foreach ($docgenerator->localtax1 as $localtax_type => $localtax_rate) {
863 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
867 foreach ($localtax_rate as $tvakey => $tvaval) {
872 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
875 if (preg_match(
'/\*/', (
string) $tvakey)) {
876 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
877 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
880 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1",
$mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1",
$mysoc->country_code) :
'');
884 $totalvat .= $tvacompl;
886 $totalvat .=
vatrate((
string) abs((
float) $tvakey),
true).$tvacompl;
889 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L',
true);
893 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
894 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R',
true);
900 foreach ($docgenerator->localtax2 as $localtax_type => $localtax_rate) {
901 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5'))) {
905 foreach ($localtax_rate as $tvakey => $tvaval) {
910 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
913 if (preg_match(
'/\*/', (
string) $tvakey)) {
914 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
915 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
917 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2",
$mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2",
$mysoc->country_code) :
'');
921 $totalvat .= $tvacompl;
923 $totalvat .=
vatrate((
string) abs((
float) $tvakey),
true).$tvacompl;
926 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L',
true);
930 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
931 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R',
true);
939 foreach ($docgenerator->tva as $tvakey => $tvaval) {
940 $sum_pdf_tva += $tvaval;
943 if ($sum_pdf_tva !=
$object->total_tva) {
944 if (!empty($sum_pdf_tva)) {
945 $coef_fix_tva =
$object->total_tva / $sum_pdf_tva;
951 foreach ($docgenerator->tva as $tvakey => $tvaval) {
952 $docgenerator->tva[$tvakey] = $tvaval * $coef_fix_tva;
954 foreach ($docgenerator->tva_array as $tvakey => $tvaval) {
955 $docgenerator->tva_array[$tvakey][
'amount'] = $tvaval[
'amount'] * $coef_fix_tva;
962 foreach ($docgenerator->tva_array as $tvakey => $tvaval) {
964 $tmpatleastoneratenotnull++;
967 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
970 if (preg_match(
'/\*/', $tvakey)) {
971 $tvakey = str_replace(
'*',
'', $tvakey);
972 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
974 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT",
$mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalVAT",
$mysoc->country_code) :
'');
977 $totalvat .=
vatrate((
string) $tvaval[
'vatrate'],
true).$tvacompl;
979 $totalvat .= $tvaval[
'vatcode'].$tvacompl;
981 $totalvat .= $tvacompl;
983 $totalvat .=
vatrate((
string) $tvaval[
'vatrate'],
true).($tvaval[
'vatcode'] ?
' ('.$tvaval[
'vatcode'].
')' :
'').$tvacompl;
986 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L',
true);
988 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
990 $pdf->MultiCell($largcol2, $tab2_hl,
price(
price2num($tvaval[
'amount'],
'MT'), 0, $outputlangs), 0,
'R',
true);
996 foreach ($docgenerator->localtax1 as $localtax_type => $localtax_rate) {
997 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1001 foreach ($localtax_rate as $tvakey => $tvaval) {
1002 if ($tvakey != 0 ||
getDolGlobalString(
'INVOICE_SHOW_ALSO_LOCALTAX1_LINE_IF_ZERO')) {
1006 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1009 if (preg_match(
'/\*/', (
string) $tvakey)) {
1010 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1011 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1013 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1",
$mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1",
$mysoc->country_code) :
'');
1017 $totalvat .= $tvacompl;
1019 $totalvat .=
vatrate((
string) abs((
float) $tvakey),
true).$tvacompl;
1022 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L',
true);
1026 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1027 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R',
true);
1033 foreach ($docgenerator->localtax2 as $localtax_type => $localtax_rate) {
1034 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6'))) {
1038 foreach ($localtax_rate as $tvakey => $tvaval) {
1040 if ($tvakey != 0 ||
getDolGlobalString(
'INVOICE_SHOW_ALSO_LOCALTAX2_LINE_IF_ZERO')) {
1044 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1047 if (preg_match(
'/\*/', (
string) $tvakey)) {
1048 $tvakey = str_replace(
'*',
'', (
string) $tvakey);
1049 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1051 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2",
$mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2",
$mysoc->country_code) :
'');
1055 $totalvat .= $tvacompl;
1057 $totalvat .=
vatrate((
string) abs((
float) $tvakey),
true).$tvacompl;
1060 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L',
true);
1064 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1065 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_localtax, 0, $outputlangs), 0,
'R',
true);
1070 $docgenerator->atleastoneratenotnull = $tmpatleastoneratenotnull;
1095function pdfWriteAlreadyPaid($docgenerator, &$index, $pdf, $outputlangs, $outputlangsbis,
$object, $col1x, $col2x, $largcol2, $tab2_top, $tab2_hl, $deja_regle, $creditnoteamount, $depositsamount, $resteapayer, $resteapayer_origin)
1101 if ((($deja_regle > 0 || $creditnoteamount > 0 || $depositsamount > 0) && !
getDolGlobalString(
'INVOICE_NO_PAYMENT_DETAILS'))
1105 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1106 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"Paid").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"Paid") :
''), 0,
'L',
false);
1107 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1109 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle + $depositsamount, 0, $outputlangs), 0,
'R',
false);
1122 if ($creditnoteamount) {
1123 $labeltouse = ($outputlangs->transnoentities(
"CreditNotesOrExcessReceived") !=
"CreditNotesOrExcessReceived") ? $outputlangs->transnoentities(
"CreditNotesOrExcessReceived") : $outputlangs->transnoentities(
"CreditNotes");
1124 $labeltouse .= (is_object($outputlangsbis) ? (
' / '.(($outputlangsbis->transnoentities(
"CreditNotesOrExcessReceived") !=
"CreditNotesOrExcessReceived") ? $outputlangsbis->transnoentities(
"CreditNotesOrExcessReceived") : $outputlangsbis->transnoentities(
"CreditNotes"))) :
'');
1126 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1127 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $labeltouse, 0,
'L',
false);
1128 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1129 $pdf->MultiCell($largcol2, $tab2_hl,
price($creditnoteamount, 0, $outputlangs), 0,
'R',
false);
1132 if (
$object->close_code == Facture::CLOSECODE_DISCOUNTVAT) {
1134 $pdf->SetFillColor(255, 255, 255);
1136 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1137 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"EscompteOfferedShort").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"EscompteOfferedShort") :
''), $useborder,
'L',
true);
1138 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1139 $pdf->MultiCell($largcol2, $tab2_hl,
price(
price2num(
$object->total_ttc - $deja_regle - $creditnoteamount - $depositsamount,
'MT'), 0, $outputlangs), $useborder,
'R',
true);
1142 $resteapayer_origin = 0;
1146 $pdf->SetTextColor(0, 0, 60);
1147 $pdf->SetFillColor(224, 224, 224);
1148 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1149 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"RemainderToPay") :
''), $useborder,
'L',
true);
1150 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1152 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R',
true);
1154 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R',
true);
1158 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1159 $pdf->SetTextColor(0, 0, 60);
1160 $pdf->SetFillColor(224, 224, 224);
1161 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"RemainderToPay") :
'').
' ('.$outputlangs->getCurrencySymbol(
$mysoc->currency_code).
')', $useborder,
'L',
true);
1163 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1164 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer_origin, 0, $outputlangs, 1, -1, -1,
$mysoc->currency_code), $useborder,
'L',
true);
1182 $substitutionarray = getCommonSubstitutionArray($outputlangs, $onlykey, $exclude,
$object, $include);
1183 $substitutionarray[
'__FROM_NAME__'] =
'__FROM_NAME__';
1184 $substitutionarray[
'__FROM_EMAIL__'] =
'__FROM_EMAIL__';
1185 return $substitutionarray;
1203 if ($unit ==
'pt') {
1205 } elseif ($unit ==
'mm') {
1207 } elseif ($unit ==
'cm') {
1209 } elseif ($unit ==
'in') {
1213 dol_print_error(
null,
'Unexpected unit "'.$unit.
'" for pdf_watermark');
1220 $text = $outputlangs->convToOutputCharset($text);
1222 $savx = $pdf->getX();
1223 $savy = $pdf->getY();
1225 $watermark_angle = atan($h / $w) / 2;
1226 $watermark_x_pos = 0;
1227 $watermark_y_pos = $h / 3;
1228 $watermark_x = $w / 2;
1229 $watermark_y = $h / 3;
1230 $pdf->SetFont(
'',
'B', 40);
1231 $pdf->SetTextColor(255, 0, 0);
1234 $pdf->_out(sprintf(
'q %.5F %.5F %.5F %.5F %.2F %.2F cm 1 0 0 1 %.2F %.2F cm', cos($watermark_angle), sin($watermark_angle), -sin($watermark_angle), cos($watermark_angle), $watermark_x * $k, ($h - $watermark_y) * $k, -$watermark_x * $k, -($h - $watermark_y) * $k));
1236 $pdf->SetAlpha(0.5);
1237 $pdf->SetXY($watermark_x_pos, $watermark_y_pos);
1240 $pdf->SetAlpha(0.3);
1241 $pdf->Cell($w - 20, 25, $outputlangs->convToOutputCharset($text),
"", 2,
"C",
false);
1246 $pdf->SetXY($savx, $savy);
1264function pdfCertifMention($pdf, $outputlangs, $seller, $default_font_size, &$posy, $pdftemplate)
1266 include_once DOL_DOCUMENT_ROOT.
'/blockedlog/lib/blockedlog.lib.php';
1286function pdf_bank($pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $default_font_size = 10)
1288 global $hookmanager;
1290 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formbank.class.php';
1292 if (is_object($hookmanager)) {
1293 $parameters = array(
'pdf' => $pdf,
'outputlangs' => $outputlangs,
'curx' => $curx,
'cury' => $cury,
'onlynumber' => $onlynumber,
'default_font_size' => $default_font_size);
1295 $reshook = $hookmanager->executeHooks(
'pdf_bank', $parameters, $account, $action);
1297 return isset($hookmanager->resArray[
'posy']) ? (float) $hookmanager->resArray[
'posy'] : $cury;
1303 $pdf->SetXY($curx, $cury);
1305 if (empty($onlynumber)) {
1306 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1307 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByTransferOnThisBankAccount').
':', 0,
'L',
false);
1311 $outputlangs->load(
"banks");
1314 $bickey =
"BICNumber";
1315 if ($account->getCountryCode() ==
'IN') {
1320 $usedetailedbban = $account->useDetailedBBAN();
1323 if ($usedetailedbban) {
1326 if (empty($onlynumber)) {
1327 $pdf->SetFont(
'',
'', $default_font_size - $diffsizecontent);
1328 $pdf->SetXY($curx, $cury);
1329 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Bank").
': '.$outputlangs->convToOutputCharset($account->bank), 0,
'L',
false);
1339 if (empty($onlynumber)) {
1340 $pdf->line($curx + 1, $cury + 1, $curx + 1, $cury + 6);
1343 $bank_number_length = 0;
1344 foreach ($account->getFieldsToShow() as $val) {
1345 $pdf->SetXY($curx, $cury + 4);
1346 $pdf->SetFont(
'',
'', $default_font_size - 3);
1348 if ($val ==
'BankCode') {
1351 $content = $account->code_banque;
1352 } elseif ($val ==
'DeskCode') {
1355 $content = $account->code_guichet;
1356 } elseif ($val ==
'BankAccountNumber') {
1359 $content = $account->number;
1360 } elseif ($val ==
'BankAccountNumberKey') {
1363 $content = $account->cle_rib;
1364 } elseif ($val ==
'IBAN' || $val ==
'BIC') {
1369 dol_print_error($account->db,
'Unexpected value for getFieldsToShow: '.$val);
1373 if ($content ==
'') {
1377 $pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0,
'C',
false);
1378 $pdf->SetXY($curx, $cury + 1);
1379 $curx += $tmplength;
1380 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizecontent);
1381 $pdf->MultiCell($tmplength, 3, $outputlangs->transnoentities($account->getBankFieldLabel($val)), 0,
'C',
false);
1382 if (empty($onlynumber)) {
1383 $pdf->line($curx, $cury + 1, $curx, $cury + 7);
1387 $bank_number_length = 8;
1391 $cury += $bank_number_length;
1393 } elseif (!empty($account->number)) {
1394 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizecontent);
1395 $pdf->SetXY($curx, $cury);
1396 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"Bank").
': '.$outputlangs->convToOutputCharset($account->bank), 0,
'L',
false);
1399 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizecontent);
1400 $pdf->SetXY($curx, $cury);
1401 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"BankAccountNumber").
': '.$outputlangs->convToOutputCharset($account->number), 0,
'L',
false);
1404 if ($diffsizecontent <= 2) {
1409 $pdf->SetFont(
'',
'', $default_font_size - $diffsizecontent);
1411 if (empty($onlynumber) && !empty($account->address)) {
1412 $pdf->SetXY($curx, $cury);
1413 $val = $outputlangs->transnoentities(
"Residence").
': '.$outputlangs->convToOutputCharset($account->address);
1414 $pdf->MultiCell(100, 3, $val, 0,
'L',
false);
1417 $tmpy = $pdf->getStringHeight(100, $val);
1421 if (!empty($account->owner_name)) {
1422 $pdf->SetXY($curx, $cury);
1423 $val = $outputlangs->transnoentities(
"BankAccountOwner").
': '.$outputlangs->convToOutputCharset($account->owner_name);
1424 $pdf->MultiCell(100, 3, $val, 0,
'L',
false);
1425 $tmpy = $pdf->getStringHeight(100, $val);
1427 } elseif (!$usedetailedbban) {
1434 if (!empty($account->iban)) {
1436 $ibanDisplay_temp = str_replace(
' ',
'', $outputlangs->convToOutputCharset($account->iban));
1439 $nbIbanDisplay_temp =
dol_strlen($ibanDisplay_temp);
1440 for ($i = 0; $i < $nbIbanDisplay_temp; $i++) {
1441 $ibanDisplay .= $ibanDisplay_temp[$i];
1442 if ($i % 4 == 3 && $i > 0) {
1443 $ibanDisplay .=
" ";
1447 $pdf->SetFont(
'',
'B', $default_font_size - 3);
1448 $pdf->SetXY($curx, $cury);
1449 $pdf->MultiCell(100, 3, $outputlangs->transnoentities($ibankey).
': '.$ibanDisplay, 0,
'L',
false);
1453 if (!empty($account->bic)) {
1454 $pdf->SetFont(
'',
'B', $default_font_size - 3);
1455 $pdf->SetXY($curx, $cury);
1456 $pdf->MultiCell(100, 3, $outputlangs->transnoentities($bickey).
': '.$outputlangs->convToOutputCharset($account->bic), 0,
'L',
false);
1459 return $pdf->getY();
1479function pdf_pagefoot($pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur,
$object, $showdetails = 0, $hidefreetext = 0, $page_largeur = 0, $watermark =
'')
1481 global
$conf, $hookmanager;
1483 $outputlangs->load(
"dict");
1486 $marginwithfooter = 0;
1488 $dims = $pdf->getPageDimensions();
1494 if (is_object($fromcompany)) {
1495 $substitutionarray[
'__FROM_NAME__'] = $fromcompany->name;
1496 $substitutionarray[
'__FROM_EMAIL__'] = $fromcompany->email;
1505 $newfreetext = preg_replace(
'/(<img.*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)("[^\/]*\/>)/',
'\1file:/'.DOL_DATA_ROOT.
'/medias/\2\3', $newfreetext);
1507 $line .= $outputlangs->convToOutputCharset($newfreetext);
1516 if (is_object($fromcompany) && in_array($showdetails, array(1, 3))) {
1518 if ($fromcompany->name) {
1519 $line1 .= ($line1 ?
" - " :
"").$outputlangs->transnoentities(
"RegisteredOffice").
": ".$fromcompany->name;
1522 if ($fromcompany->address) {
1523 $line1 .= ($line1 ?
" - " :
"").str_replace(
"\n",
", ", $fromcompany->address);
1526 if ($fromcompany->zip) {
1527 $line1 .= ($line1 ?
" - " :
"").$fromcompany->zip;
1530 if ($fromcompany->town) {
1531 $line1 .= ($line1 ?
" " :
"").$fromcompany->town;
1534 if ($fromcompany->country) {
1535 $line1 .= ($line1 ?
", " :
"").$fromcompany->country;
1538 if ($fromcompany->phone) {
1539 $line2 .= ($line2 ?
" - " :
"").$outputlangs->transnoentities(
"Phone").
": ".$fromcompany->phone;
1542 if ($fromcompany->fax) {
1543 $line2 .= ($line2 ?
" - " :
"").$outputlangs->transnoentities(
"Fax").
": ".$fromcompany->fax;
1547 if ($fromcompany->url) {
1548 $line2 .= ($line2 ?
" - " :
"").$fromcompany->url;
1551 if ($fromcompany->email) {
1552 $line2 .= ($line2 ?
" - " :
"").$fromcompany->email;
1555 if ($showdetails == 2 || $showdetails == 3 || (!empty($fromcompany->country_code) && $fromcompany->country_code ==
'DE')) {
1557 if ($fromcompany->managers) {
1558 $line2 .= ($line2 ?
" - " :
"").$fromcompany->managers;
1564 if (!empty($fromcompany->forme_juridique_code)) {
1565 $line3 .= ($line3 ?
" - " :
"").$outputlangs->convToOutputCharset(
getFormeJuridiqueLabel((
string) $fromcompany->forme_juridique_code));
1568 if (!empty($fromcompany->capital)) {
1569 $tmpamounttoshow =
price2num($fromcompany->capital);
1570 if (is_numeric($tmpamounttoshow) && $tmpamounttoshow > 0) {
1571 $line3 .= ($line3 ?
" - " :
"").$outputlangs->transnoentities(
"CapitalOf",
price($tmpamounttoshow, 0, $outputlangs, 0, 0, 0,
getDolCurrency()));
1572 } elseif (!empty($fromcompany->capital)) {
1573 $line3 .= ($line3 ?
" - " :
"").$outputlangs->transnoentities(
"CapitalOf", (
string) $fromcompany->capital);
1577 if (!empty($fromcompany->idprof1) && ($fromcompany->country_code !=
'FR' || (empty($fromcompany->idprof2) || strpos($fromcompany->idprof2, $fromcompany->idprof1) !== 0))) {
1578 $field = $outputlangs->transcountrynoentities(
"ProfId1", $fromcompany->country_code);
1579 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1582 $line3 .= ($line3 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof1);
1585 if (!empty($fromcompany->idprof2)) {
1586 $field = $outputlangs->transcountrynoentities(
"ProfId2", $fromcompany->country_code);
1587 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1590 $line3 .= ($line3 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof2);
1595 if (!empty($fromcompany->idprof3)) {
1596 $field = $outputlangs->transcountrynoentities(
"ProfId3", $fromcompany->country_code);
1597 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1600 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof3);
1603 if (!empty($fromcompany->idprof4)) {
1604 $field = $outputlangs->transcountrynoentities(
"ProfId4", $fromcompany->country_code);
1605 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1608 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof4);
1611 if (!empty($fromcompany->idprof5)) {
1612 $field = $outputlangs->transcountrynoentities(
"ProfId5", $fromcompany->country_code);
1613 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1616 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof5);
1619 if (!empty($fromcompany->idprof6)) {
1620 $field = $outputlangs->transcountrynoentities(
"ProfId6", $fromcompany->country_code);
1621 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1624 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof6);
1627 if (!empty($fromcompany->idprof7)) {
1628 $field = $outputlangs->transcountrynoentities(
"ProfId7", $fromcompany->country_code);
1629 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1632 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof7);
1635 if (!empty($fromcompany->idprof8)) {
1636 $field = $outputlangs->transcountrynoentities(
"ProfId8", $fromcompany->country_code);
1637 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1640 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof8);
1643 if (!empty($fromcompany->idprof9)) {
1644 $field = $outputlangs->transcountrynoentities(
"ProfId9", $fromcompany->country_code);
1645 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1648 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof9);
1651 if (!empty($fromcompany->idprof10)) {
1652 $field = $outputlangs->transcountrynoentities(
"ProfId10", $fromcompany->country_code);
1653 if (preg_match(
'/\((.*)\)/i', $field, $reg)) {
1656 $line4 .= ($line4 ?
" - " :
"").$field.
": ".$outputlangs->convToOutputCharset($fromcompany->idprof10);
1659 if (!empty($fromcompany->tva_intra) && $fromcompany->tva_intra !=
'') {
1660 $line4 .= ($line4 ?
" - " :
"").$outputlangs->transnoentities(
"VATIntraShort").
": ".$outputlangs->convToOutputCharset($fromcompany->tva_intra);
1663 $pdf->SetFont(
'',
'', 7);
1664 $pdf->SetDrawColor(224, 224, 224);
1671 $pdf->SetTextColor($r, $g, $b);
1675 $freetextheight = 0;
1686 $freetextheight = $pdf->getStringHeight($width, $line);
1695 if (is_object($hookmanager)) {
1696 $parameters = array(
'line1' => $line1,
'line2' => $line2,
'line3' => $line3,
'line4' => $line4,
'outputlangs' => $outputlangs,
'hidefreetext' => $hidefreetext,
'pdf' => $pdf,
'pagenb' => $pdf->PageNo());
1698 $hookmanager->executeHooks(
'pdf_pagefoot', $parameters,
$object, $action);
1701 if (!empty($hookmanager->resPrint) && ($hidefreetext == 0 || !empty($hookmanager->resArray[
'footeronallpages']))) {
1702 $mycustomfooter = $hookmanager->resPrint;
1705 $marginwithfooter = $marge_basse + $freetextheight + $mycustomfooterheight;
1706 $posy = (float) $marginwithfooter;
1714 $pdf->setAutoPageBreak(
false, 0);
1715 $pdf->Rect(0, $dims[
'hk'] - $posy + $freetextheight, $dims[
'wk'] + 1, $marginwithfooter + 1,
'F', array(), $fill_color = array($r, $g, $b));
1716 $pdf->setAutoPageBreak(
true, 0);
1720 $pdf->setAutoPageBreak(
false, 0);
1723 $pdf->SetXY($dims[
'lm'], -$posy);
1725 $pdf->MultiCell(0, 3, $line, 0, $align,
false);
1727 $pdf->writeHTMLCell($dims[
'wk'] - $dims[
'lm'] - $dims[
'rm'], $freetextheight, $dims[
'lm'], $dims[
'hk'] - $marginwithfooter,
dol_htmlentitiesbr($line, 1,
'UTF-8', 0));
1729 $posy -= $freetextheight;
1732 $pdf->setAutoPageBreak(
true, 0);
1739 $pdf->line($dims[
'lm'], $dims[
'hk'] - $posy, $dims[
'wk'] - $dims[
'rm'], $dims[
'hk'] - $posy);
1750 $pdf->setAutoPageBreak(
false, 0);
1752 $pdf->writeHTMLCell($dims[
'wk'] - $dims[
'lm'] - $dims[
'rm'], $mycustomfooterheight, $dims[
'lm'], $dims[
'hk'] - $posy,
dol_htmlentitiesbr($mycustomfooter, 1,
'UTF-8', 0));
1754 $pdf->setAutoPageBreak(
true, 0);
1757 $posy -= $mycustomfooterheight - 3;
1760 $marginwithfooter = $marge_basse + $freetextheight + (!empty($line1) ? 3 : 0) + (!empty($line2) ? 3 : 0) + (!empty($line3) ? 3 : 0) + (!empty($line4) ? 3 : 0);
1761 $posy = (float) $marginwithfooter;
1769 $pdf->setAutoPageBreak(
false, 0);
1770 $pdf->Rect(0, $dims[
'hk'] - $posy + $freetextheight, $dims[
'wk'] + 1, $marginwithfooter + 1,
'F', array(), $fill_color = array($r, $g, $b));
1771 $pdf->setAutoPageBreak(
true, 0);
1775 $pdf->setAutoPageBreak(
false, 0);
1778 $pdf->SetXY($dims[
'lm'], -$posy);
1780 $pdf->MultiCell(0, 3, $line, 0, $align,
false);
1782 $pdf->writeHTMLCell($dims[
'wk'] - $dims[
'lm'] - $dims[
'rm'], $freetextheight, $dims[
'lm'], $dims[
'hk'] - $marginwithfooter,
dol_htmlentitiesbr($line, 1,
'UTF-8', 0));
1784 $posy -= $freetextheight;
1787 $pdf->setAutoPageBreak(
true, 0);
1796 $pdf->line($dims[
'lm'], $dims[
'hk'] - $posy, $dims[
'wk'] - $dims[
'rm'], $dims[
'hk'] - $posy);
1806 if (!empty($line1)) {
1807 $pdf->SetFont(
'',
'B', 7);
1808 $pdf->SetXY($dims[
'lm'], -$posy);
1809 $pdf->MultiCell($dims[
'wk'] - $dims[
'rm'] - $dims[
'lm'], 2, $line1, 0,
'C',
false);
1811 $pdf->SetFont(
'',
'', 7);
1814 if (!empty($line2)) {
1815 $pdf->SetFont(
'',
'B', 7);
1816 $pdf->SetXY($dims[
'lm'], -$posy);
1817 $pdf->MultiCell($dims[
'wk'] - $dims[
'rm'] - $dims[
'lm'], 2, $line2, 0,
'C',
false);
1819 $pdf->SetFont(
'',
'', 7);
1822 if (!empty($line3)) {
1823 $pdf->SetXY($dims[
'lm'], -$posy);
1824 $pdf->MultiCell($dims[
'wk'] - $dims[
'rm'] - $dims[
'lm'], 2, $line3, 0,
'C',
false);
1827 if (!empty($line4)) {
1829 $pdf->SetXY($dims[
'lm'], -$posy);
1830 $pdf->MultiCell($dims[
'wk'] - $dims[
'rm'] - $dims[
'lm'], 2, $line4, 0,
'C',
false);
1837 $pdf->SetXY($dims[
'wk'] - $dims[
'rm'] - 18 -
getDolGlobalInt(
'PDF_FOOTER_PAGE_NUMBER_X', 0), -$posy -
getDolGlobalInt(
'PDF_FOOTER_PAGE_NUMBER_Y', 0));
1839 $pagination = $pdf->PageNo().
' / '.$pdf->getAliasNbPages();
1840 $fontRenderCorrection = 0;
1841 if (in_array(
pdf_getPDFFont($outputlangs), array(
'freemono',
'DejaVuSans'))) {
1842 $fontRenderCorrection = 10;
1844 $pdf->MultiCell(18 + $fontRenderCorrection, 2, $pagination, 0,
'R',
false);
1847 if (!empty($watermark)) {
1848 pdf_watermark($pdf, $outputlangs, $page_hauteur, $page_largeur,
'mm', $watermark);
1851 return $marginwithfooter;
1872 global $hookmanager;
1874 if (is_object($hookmanager)) {
1875 $parameters = array(
'pdf' => $pdf,
'outputlangs' => $outputlangs,
'posx' => $posx,
'posy' => $posy,
'w' => $w,
'h' => $h,
'align' => $align,
'default_font_size' => $default_font_size);
1877 $reshook = $hookmanager->executeHooks(
'pdf_writeLinkedObjects', $parameters,
$object, $action);
1879 return isset($hookmanager->resArray[
'posy']) ? (float) $hookmanager->resArray[
'posy'] : $pdf->getY();
1883 $linkedobjects = pdf_getLinkedObjects(
$object, $outputlangs);
1885 if (!empty($linkedobjects)) {
1886 foreach ($linkedobjects as $linkedobject) {
1887 $reftoshow = $linkedobject[
"ref_title"].
' : '.$linkedobject[
"ref_value"];
1888 if (!empty($linkedobject[
"date_value"])) {
1889 $reftoshow .=
' / '.$linkedobject[
"date_value"];
1893 $pdf->SetXY($posx, $posy);
1894 $pdf->SetFont(
'',
'', (
float) $default_font_size - 2);
1895 $pdf->MultiCell($w, $h, $reftoshow,
'', $align);
1899 return $pdf->getY();
1919function pdf_writelinedesc($pdf,
$object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref = 0, $hidedesc = 0, $issupplierline = 0, $align =
'J')
1921 global $hookmanager;
1926 if (is_object($hookmanager)) {
1927 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
1928 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
1929 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
1931 $parameters = array(
'pdf' => $pdf,
'i' => $i,
'outputlangs' => $outputlangs,
'w' => $w,
'h' => $h,
'posx' => $posx,
'posy' => $posy,
'hideref' => $hideref,
'hidedesc' => $hidedesc,
'issupplierline' => $issupplierline,
'special_code' => $special_code);
1935 $reshook = $hookmanager->executeHooks(
'pdf_writelinedesc', $parameters,
$object, $action);
1937 if (!empty($hookmanager->resPrint)) {
1938 $result .= $hookmanager->resPrint;
1941 if (empty($reshook)) {
1943 $labelproductservice = preg_replace(
'/(<img[^>]*src=")[^\"]*viewimage\.php[^\"]*modulepart=medias[^\"]*file=([^\"]*)/',
'\1file:/'.DOL_DATA_ROOT.
'/medias/\2\3', $labelproductservice, -1, $nbrep);
1950 $labelproductservice = preg_replace(
'/(<img[^>]*src=")([^"]*)(&)([^"]*")/',
'\1\2&\4', $labelproductservice, -1, $nbrep);
1953 $pdf->setListIndentWidth(5);
1954 $TMarginList = [
'ul' => [[
'h' => 0.1, ],[
'h' => 0.1, ]],
'li' => [[
'h' => 0.1, ],],];
1955 $pdf->setHtmlVSpace($TMarginList);
1959 $pdf->writeHTMLCell($w, $h, $posx, $posy, $outputlangs->convToOutputCharset($labelproductservice), 0, 1,
false,
true, $align,
true);
1960 $result .= $labelproductservice;
1978 global $db,
$conf, $langs;
1980 $idprod = (!empty(
$object->lines[$i]->fk_product) ?
$object->lines[$i]->fk_product :
false);
1981 $label = (!empty(
$object->lines[$i]->label) ?
$object->lines[$i]->label : (!empty(
$object->lines[$i]->product_label) ?
$object->lines[$i]->product_label :
''));
1982 $product_barcode = (!empty(
$object->lines[$i]->product_barcode) ?
$object->lines[$i]->product_barcode :
"");
1983 $desc = (!empty(
$object->lines[$i]->desc) ?
$object->lines[$i]->desc : (!empty(
$object->lines[$i]->description) ?
$object->lines[$i]->description :
''));
1984 $ref_supplier = (!empty(
$object->lines[$i]->ref_supplier) ?
$object->lines[$i]->ref_supplier : (!empty(
$object->lines[$i]->ref_fourn) ?
$object->lines[$i]->ref_fourn :
''));
1985 $note = (!empty(
$object->lines[$i]->note) ?
$object->lines[$i]->note :
'');
1986 $dbatch = (!empty(
$object->lines[$i]->detail_batch) ?
$object->lines[$i]->detail_batch :
false);
1990 if ($issupplierline) {
1991 include_once DOL_DOCUMENT_ROOT.
'/fourn/class/fournisseur.product.class.php';
1994 include_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
1998 include_once DOL_DOCUMENT_ROOT .
'/product/class/productcustomerprice.class.php';
2003 $idprod = (!empty(
$object->lines[$i]->fk_product) ?
$object->lines[$i]->fk_product :
false);
2005 $prodser->fetch($idprod);
2007 if ($multilangsactive) {
2008 $prodser->getMultiLangs();
2009 $object->lines[$i]->multilangs = $prodser->multilangs;
2013 if (!empty(
$object->lines[$i]->label)) {
2014 $label =
$object->lines[$i]->label;
2016 if (!empty(
$object->lines[$i]->multilangs[$outputlangs->defaultlang][
'label']) && $multilangsactive) {
2017 $label =
$object->lines[$i]->multilangs[$outputlangs->defaultlang][
'label'];
2019 if (!empty(
$object->lines[$i]->product_label)) {
2020 $label =
$object->lines[$i]->product_label;
2027 if (!empty(
$object->lines[$i]->desc)) {
2028 $desc =
$object->lines[$i]->desc;
2030 if (!empty(
$object->lines[$i]->multilangs[$outputlangs->defaultlang][
'description']) && $multilangsactive) {
2031 $desc =
$object->lines[$i]->multilangs[$outputlangs->defaultlang][
'description'];
2033 if (!empty(
$object->lines[$i]->description)) {
2034 $desc =
$object->lines[$i]->description;
2041 $ref_supplier = (!empty(
$object->lines[$i]->ref_supplier) ?
$object->lines[$i]->ref_supplier : (!empty(
$object->lines[$i]->ref_fourn) ?
$object->lines[$i]->ref_fourn :
''));
2043 $note = (!empty(
$object->lines[$i]->note) ?
$object->lines[$i]->note :
'');
2045 $dbatch = (!empty(
$object->lines[$i]->detail_batch) ?
$object->lines[$i]->detail_batch :
false);
2049 if ($multilangsactive && ($outputlangs->defaultlang != $langs->defaultlang)) {
2050 $translatealsoifmodified =
getDolGlobalString(
'MAIN_MULTILANG_TRANSLATE_EVEN_IF_MODIFIED');
2058 $textwasnotmodified = ($label == $prodser->label);
2059 if (!empty($prodser->multilangs[$outputlangs->defaultlang][
"label"]) && ($textwasnotmodified || $translatealsoifmodified)) {
2060 $label = $prodser->multilangs[$outputlangs->defaultlang][
"label"];
2065 $textwasnotmodified =
false;
2066 $textdiffersonlybymarkup =
false;
2076 $textwasnotmodified = ($prodtextonly !==
'' && strpos($desctextonly, $prodtextonly) !==
false);
2077 $textdiffersonlybymarkup = ($textwasnotmodified && $desctextonly === $prodtextonly);
2079 $textwasnotmodified = ($desc == $prodser->description);
2081 if (!empty($prodser->multilangs[$outputlangs->defaultlang][
"description"])) {
2082 if ($textwasnotmodified) {
2083 if ($textdiffersonlybymarkup && strpos($desc, $prodser->description) ===
false) {
2086 $desc = $prodser->multilangs[$outputlangs->defaultlang][
"description"];
2088 $desc = str_replace($prodser->description, $prodser->multilangs[$outputlangs->defaultlang][
"description"], $desc);
2090 } elseif ($translatealsoifmodified) {
2091 $desc = $prodser->multilangs[$outputlangs->defaultlang][
"description"];
2096 $textwasnotmodified = ($note == $prodser->note_public);
2097 if (!empty($prodser->multilangs[$outputlangs->defaultlang][
"other"]) && ($textwasnotmodified || $translatealsoifmodified)) {
2098 $note = $prodser->multilangs[$outputlangs->defaultlang][
"other"];
2101 } elseif ((
$object->element ==
'facture' ||
$object->element ==
'facturefourn') && preg_match(
'/^\(DEPOSIT\).+/', $desc)) {
2102 $desc = str_replace(
'(DEPOSIT)', $outputlangs->trans(
'Deposit'), $desc);
2105 $labelproductservice =
'';
2108 $labelproductservice = $label;
2113 $labelproductservice = str_replace(
"\n",
'<br>', $labelproductservice);
2115 $labelproductservice =
'<b>'.$labelproductservice.
'</b>';
2122 $prodser->get_sousproduits_arbo();
2123 if (!empty($prodser->sousprods) && is_array($prodser->sousprods) && count($prodser->sousprods)) {
2124 $outputlangs->load(
'mrp');
2125 $tmparrayofsubproducts = reset($prodser->sousprods);
2128 if (isset(
$object->lines[$i]->qty) && !empty(
$object->lines[$i]->qty)) {
2129 $qtyText =
$object->lines[$i]->qty;
2130 } elseif (isset(
$object->lines[$i]->qty_shipped) && !empty(
$object->lines[$i]->qty_shipped)) {
2131 $qtyText =
$object->lines[$i]->qty;
2135 foreach ($tmparrayofsubproducts as $subprodval) {
2139 $outputlangs->trans(
'Qty').
':'.$qtyText.
' x '.$outputlangs->trans(
'AssociatedProducts').
':'.$subprodval[1].
'= '.$outputlangs->trans(
'QtyTot').
':'.$subprodval[1] * $qtyText :
2140 $outputlangs->trans(
'Qty').
' '.$outputlangs->trans(
'AssociatedProducts').
':'.$subprodval[1])
2144 foreach ($tmparrayofsubproducts as $subprodval) {
2146 dol_concatdesc($labelproductservice,
" * ".$subprodval[5].(($subprodval[5] && $subprodval[3]) ?
' - ' :
'').$subprodval[3]),
2148 $outputlangs->trans(
'Qty').
':'.$qtyText.
' x '.$outputlangs->trans(
'AssociatedProducts').
':'.$subprodval[1].
'= '.$outputlangs->trans(
'QtyTot').
':'.$subprodval[1] * $qtyText :
2149 $outputlangs->trans(
'Qty').
' '.$outputlangs->trans(
'AssociatedProducts').
':'.$subprodval[1])
2157 $labelproductservice =
dol_concatdesc($labelproductservice, $outputlangs->trans(
"BarCode").
" ".$product_barcode);
2161 if (!empty($desc) && ($desc != $label)) {
2162 if ($desc ==
'(CREDIT_NOTE)' &&
$object->lines[$i]->fk_remise_except) {
2164 $discount->fetch(
$object->lines[$i]->fk_remise_except);
2165 $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
2166 $labelproductservice = $outputlangs->transnoentitiesnoconv(
"DiscountFromCreditNote", $sourceref);
2167 } elseif ($desc ==
'(DEPOSIT)' &&
$object->lines[$i]->fk_remise_except) {
2169 $discount->fetch(
$object->lines[$i]->fk_remise_except);
2170 $sourceref = !empty($discount->discount_type) ? $discount->ref_invoice_supplier_source : $discount->ref_facture_source;
2171 $labelproductservice = $outputlangs->transnoentitiesnoconv(
"DiscountFromDeposit", $sourceref);
2174 $labelproductservice .=
' ('.dol_print_date($discount->datec,
'day',
'', $outputlangs).
')';
2176 } elseif ($desc ==
'(EXCESS RECEIVED)' &&
$object->lines[$i]->fk_remise_except) {
2178 $discount->fetch(
$object->lines[$i]->fk_remise_except);
2179 $labelproductservice = $outputlangs->transnoentitiesnoconv(
"DiscountFromExcessReceived", $discount->ref_facture_source);
2180 } elseif ($desc ==
'(EXCESS PAID)' &&
$object->lines[$i]->fk_remise_except) {
2182 $discount->fetch(
$object->lines[$i]->fk_remise_except);
2183 $labelproductservice = $outputlangs->transnoentitiesnoconv(
"DiscountFromExcessPaid", $discount->ref_invoice_supplier_source);
2187 if (!empty(
$object->element)) {
2188 $tmpkey =
'MAIN_DOCUMENTS_HIDE_DESCRIPTION_FOR_'.strtoupper(
$object->element);
2193 if (empty($hidedesc)) {
2195 $labelproductservice =
dol_concatdesc($desc, $labelproductservice);
2198 $labelproductservice = $desc;
2200 $labelproductservice =
dol_concatdesc($labelproductservice, $desc);
2205 $labelproductservice =
dol_concatdesc($labelproductservice, $desc);
2211 $prefix_prodserv =
"";
2214 if ($prodser->isService()) {
2215 $prefix_prodserv = $outputlangs->transnoentitiesnoconv(
"Service").
" ";
2217 $prefix_prodserv = $outputlangs->transnoentitiesnoconv(
"Product").
" ";
2221 if (empty($hideref)) {
2222 if ($issupplierline) {
2224 $ref_prodserv = $prodser->ref;
2225 if ($ref_supplier) {
2226 $ref_prodserv .= ($prodser->ref ?
' (' :
'').$outputlangs->transnoentitiesnoconv(
"SupplierRef").
' '.$ref_supplier.($prodser->ref ?
')' :
'');
2228 } elseif (
getDolGlobalInt(
'PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES') == 1) {
2229 $ref_prodserv = $ref_supplier;
2230 } elseif (
getDolGlobalInt(
'PDF_HIDE_PRODUCT_REF_IN_SUPPLIER_LINES') == 2) {
2231 $ref_prodserv = $ref_supplier.
' ('.$outputlangs->transnoentitiesnoconv(
"InternalRef").
' '.$prodser->ref.
')';
2234 $ref_prodserv = $prodser->ref;
2238 $filter = array(
'fk_product' => (
string) $idprod,
'fk_soc' => (
string)
$object->socid);
2240 $nbCustomerPrices = $productCustomerPriceStatic->fetchAll(
'',
'', 1, 0, $filter);
2242 if ($nbCustomerPrices > 0) {
2243 $productCustomerPrice =
null;
2244 if (count($productCustomerPriceStatic->lines) > 0) {
2245 $date_now = (int) floor(
dol_now() / 86400) * 86400;
2246 foreach ($productCustomerPriceStatic->lines as $k => $custprice_line) {
2247 if ($custprice_line->date_begin <= $date_now && (empty($custprice_line->date_end) || $date_now <= $custprice_line->date_end)) {
2248 $productCustomerPrice = $custprice_line;
2254 if (isset($productCustomerPrice) && !empty($productCustomerPrice->ref_customer)) {
2255 $idcustprice =
getDolGlobalInt(
'PRODUIT_CUSTOMER_PRICES_PDF_REF_MODE');
2256 switch ($idcustprice) {
2258 $ref_prodserv = $productCustomerPrice->ref_customer;
2262 $ref_prodserv = $productCustomerPrice->ref_customer .
' (' . $outputlangs->transnoentitiesnoconv(
'InternalRef') .
' ' . $ref_prodserv .
')';
2266 $ref_prodserv = $ref_prodserv .
' (' . $outputlangs->transnoentitiesnoconv(
'RefCustomer') .
' ' . $productCustomerPrice->ref_customer .
')';
2273 if (!empty($labelproductservice) && !empty($ref_prodserv)) {
2274 $ref_prodserv .=
" - ";
2278 if (!empty($ref_prodserv) &&
getDolGlobalString(
'PDF_BOLD_PRODUCT_REF_AND_PERIOD')) {
2280 $labelproductservice = str_replace(
"\n",
'<br>', $labelproductservice);
2282 $ref_prodserv =
'<b>'.$ref_prodserv.
'</b>';
2285 $labelproductservice = $prefix_prodserv.$ref_prodserv.$labelproductservice;
2289 include_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
2292 $tblcateg = $categstatic->containing($idprod, Categorie::TYPE_PRODUCT);
2293 foreach ($tblcateg as $cate) {
2295 $desccateg = $cate->description;
2297 $labelproductservice =
dol_concatdesc($labelproductservice, $desccateg);
2302 if (!empty(
$object->lines[$i]->date_start) || !empty(
$object->lines[$i]->date_end)) {
2306 if (
$object->lines[$i]->date_start &&
$object->lines[$i]->date_end) {
2307 $period =
'('.$outputlangs->transnoentitiesnoconv(
'DateFromTo',
dol_print_date(
$object->lines[$i]->date_start, $format,
false, $outputlangs),
dol_print_date(
$object->lines[$i]->date_end, $format,
false, $outputlangs)).
')';
2309 if (
$object->lines[$i]->date_start && !
$object->lines[$i]->date_end) {
2310 $period =
'('.$outputlangs->transnoentitiesnoconv(
'DateFrom',
dol_print_date(
$object->lines[$i]->date_start, $format,
false, $outputlangs)).
')';
2312 if (!
$object->lines[$i]->date_start &&
$object->lines[$i]->date_end) {
2313 $period =
'('.$outputlangs->transnoentitiesnoconv(
'DateUntil',
dol_print_date(
$object->lines[$i]->date_end, $format,
false, $outputlangs)).
')';
2318 $labelproductservice = str_replace(
"\n",
'<br>', $labelproductservice);
2320 $labelproductservice .=
'<br><b style="color:#333666;" ><em>'.$period.
'</em></b>';
2322 $labelproductservice =
dol_concatdesc($labelproductservice, $period);
2328 if (!empty($dbatch)) {
2333 include_once DOL_DOCUMENT_ROOT.
'/product/stock/class/entrepot.class.php';
2334 include_once DOL_DOCUMENT_ROOT.
'/product/class/productbatch.class.php';
2339 foreach ($dbatch as $detail) {
2341 if ($detail->eatby) {
2342 $dte[] = $outputlangs->transnoentitiesnoconv(
'printEatby',
dol_print_date($detail->eatby, $format,
false, $outputlangs));
2344 if ($detail->sellby) {
2345 $dte[] = $outputlangs->transnoentitiesnoconv(
'printSellby',
dol_print_date($detail->sellby, $format,
false, $outputlangs));
2347 if ($detail->batch) {
2348 $dte[] = $outputlangs->transnoentitiesnoconv(
'printBatch', $detail->batch);
2351 $dte[] = $outputlangs->transnoentitiesnoconv(
'printQty', (
string) $detail->qty);
2355 if (
$object->element ==
'shipping' && $detail->fk_origin_stock > 0 &&
getDolGlobalInt(
'PRODUCTBATCH_SHOW_WAREHOUSE_ON_SHIPMENT')) {
2356 $resproductbatch = $tmpproductbatch->fetch($detail->fk_origin_stock);
2357 if ($resproductbatch > 0) {
2358 $reswarehouse = $tmpwarehouse->fetch($tmpproductbatch->warehouseid);
2359 if ($reswarehouse > 0) {
2360 $dte[] = $tmpwarehouse->ref;
2365 $labelproductservice .=
"__N__ ".implode(
" - ", $dte);
2375 $labelproductservice = preg_replace(
'/__N__/',
'<br>', $labelproductservice);
2377 $labelproductservice = preg_replace(
'/__N__/',
"\n", $labelproductservice);
2381 return $labelproductservice;
2395 global $hookmanager;
2400 if (is_object($hookmanager)) {
2401 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2402 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2403 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2405 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2407 $reshook = $hookmanager->executeHooks(
'pdf_getlinenum', $parameters,
$object, $action);
2408 $result .= $hookmanager->resPrint;
2410 if (empty($reshook)) {
2428 global $hookmanager;
2433 if (is_object($hookmanager)) {
2434 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2435 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2436 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2438 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2440 $reshook = $hookmanager->executeHooks(
'pdf_getlineref', $parameters,
$object, $action);
2441 $result .= $hookmanager->resPrint;
2443 if (empty($reshook)) {
2461 global $hookmanager;
2466 if (is_object($hookmanager)) {
2467 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2468 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2469 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2471 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2473 $reshook = $hookmanager->executeHooks(
'pdf_getlineref_supplier', $parameters,
$object, $action);
2474 $result .= $hookmanager->resPrint;
2476 if (empty($reshook)) {
2498 if (is_object($hookmanager)) {
2499 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2500 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2501 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2503 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2505 $reshook = $hookmanager->executeHooks(
'pdf_getlinevatrate', $parameters,
$object, $action);
2507 if (!empty($hookmanager->resPrint)) {
2508 $result .= $hookmanager->resPrint;
2511 if (empty($reshook)) {
2512 if (empty($hidedetails) || $hidedetails > 1) {
2518 if (preg_replace(
'/[\s0%]/',
'', $tmpresult)) {
2523 $tmpresult .=
vatrate((
string) abs(
$object->lines[$i]->localtax1_tx),
false);
2528 if (preg_replace(
'/[\s0%]/',
'', $tmpresult)) {
2533 $tmpresult .=
vatrate((
string) abs(
$object->lines[$i]->localtax2_tx),
false);
2538 $result .= $tmpresult;
2555 global $hookmanager;
2565 if (is_object($hookmanager)) {
2566 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2567 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2568 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2570 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2572 $reshook = $hookmanager->executeHooks(
'pdf_getlineupexcltax', $parameters,
$object, $action);
2574 if (!empty($hookmanager->resPrint)) {
2575 $result .= $hookmanager->resPrint;
2578 if (empty($reshook)) {
2579 if (empty($hidedetails) || $hidedetails > 1) {
2581 $result .=
price($sign * $subprice, 0, $outputlangs);
2598 global $hookmanager;
2608 if (is_object($hookmanager)) {
2609 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2610 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2611 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2613 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2615 $reshook = $hookmanager->executeHooks(
'pdf_getlineupwithtax', $parameters,
$object, $action);
2617 if (!empty($hookmanager->resPrint)) {
2618 $result .= $hookmanager->resPrint;
2621 if (empty($reshook)) {
2622 if (empty($hidedetails) || $hidedetails > 1) {
2623 $result .=
price($sign * ((
$object->lines[$i]->subprice) + (
$object->lines[$i]->subprice) * (
$object->lines[$i]->tva_tx) / 100), 0, $outputlangs);
2640 global $hookmanager;
2645 if (is_object($hookmanager)) {
2646 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2647 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2648 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2650 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2652 $reshook = $hookmanager->executeHooks(
'pdf_getlineqty', $parameters,
$object, $action);
2654 if (!empty($hookmanager->resPrint)) {
2655 $result = $hookmanager->resPrint;
2658 if (empty($reshook)) {
2659 if (
$object->lines[$i]->special_code == 3) {
2662 if (empty($hidedetails) || $hidedetails > 1) {
2663 $result .=
$object->lines[$i]->qty;
2680 global $hookmanager;
2685 if (is_object($hookmanager)) {
2686 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2687 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2688 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2690 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2692 $reshook = $hookmanager->executeHooks(
'pdf_getlineqty_asked', $parameters,
$object, $action);
2694 if (!empty($hookmanager->resPrint)) {
2695 $result .= $hookmanager->resPrint;
2698 if (empty($reshook)) {
2699 if (
$object->lines[$i]->special_code == 3) {
2702 if (empty($hidedetails) || $hidedetails > 1) {
2703 $result .=
$object->lines[$i]->qty_asked;
2720 global $hookmanager;
2725 if (is_object($hookmanager)) {
2726 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2727 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2728 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2730 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2732 $reshook = $hookmanager->executeHooks(
'pdf_getlineqty_shipped', $parameters,
$object, $action);
2734 if (!empty($hookmanager->resPrint)) {
2735 $result .= $hookmanager->resPrint;
2738 if (empty($reshook)) {
2739 if (
$object->lines[$i]->special_code == 3) {
2742 if (empty($hidedetails) || $hidedetails > 1) {
2743 $result .=
$object->lines[$i]->qty_shipped;
2760 global $hookmanager;
2765 if (is_object($hookmanager)) {
2766 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2767 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2768 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2770 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2772 $reshook = $hookmanager->executeHooks(
'pdf_getlineqty_keeptoship', $parameters,
$object, $action);
2774 if (!empty($hookmanager->resPrint)) {
2775 $result .= $hookmanager->resPrint;
2778 if (empty($reshook)) {
2779 if (
$object->lines[$i]->special_code == 3) {
2782 if (empty($hidedetails) || $hidedetails > 1) {
2783 $result .= (
$object->lines[$i]->qty_asked -
$object->lines[$i]->qty_shipped);
2800 global $hookmanager;
2805 if (is_object($hookmanager)) {
2806 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2807 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2808 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2810 $parameters = array(
2812 'outputlangs' => $outputlangs,
2813 'hidedetails' => $hidedetails,
2814 'special_code' => $special_code
2817 $reshook = $hookmanager->executeHooks(
'pdf_getlineunit', $parameters,
$object, $action);
2819 if (!empty($hookmanager->resPrint)) {
2820 $result .= $hookmanager->resPrint;
2823 if (empty($reshook)) {
2824 if (empty($hidedetails) || $hidedetails > 1) {
2825 $result .=
$object->lines[$i]->getLabelOfUnit(
'short', $outputlangs, 1);
2843 global $hookmanager;
2845 include_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
2850 if (is_object($hookmanager)) {
2851 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2852 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2853 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2855 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2857 $reshook = $hookmanager->executeHooks(
'pdf_getlineremisepercent', $parameters,
$object, $action);
2859 if (!empty($hookmanager->resPrint)) {
2860 $result .= $hookmanager->resPrint;
2863 if (empty($reshook)) {
2864 if (
$object->lines[$i]->special_code == 3) {
2867 if (empty($hidedetails) || $hidedetails > 1) {
2886 if (empty($hookmanager)) {
2887 global $hookmanager;
2893 if (is_object($hookmanager)) {
2894 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2895 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2896 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2898 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
2900 $reshook = $hookmanager->executeHooks(
'pdf_getlineprogress', $parameters,
$object, $action);
2902 if (!empty($hookmanager->resPrint)) {
2903 return $hookmanager->resPrint;
2906 if (empty($reshook)) {
2907 if (
$object->lines[$i]->special_code == 3) {
2910 if (empty($hidedetails) || $hidedetails > 1) {
2916 if ($isCumulative xor $showDelta) {
2920 $result =
$object->lines[$i]->situation_percent;
2926 if ($isCumulative) {
2928 if (method_exists(
$object->lines[$i],
'get_prev_progress')) {
2929 $prev_progress =
$object->lines[$i]->get_prev_progress(
$object->id);
2937 if (method_exists(
$object->lines[$i],
'getAllPrevProgress')) {
2938 $prev_progress =
$object->lines[$i]->getAllPrevProgress(
$object->id);
2939 } elseif (method_exists(
$object->lines[$i],
'get_prev_progress')) {
2940 $prev_progress =
$object->lines[$i]->get_prev_progress(
$object->id);
2943 $result = $isCumulative ?
2945 $object->lines[$i]->situation_percent - $prev_progress :
2947 $prev_progress +
$object->lines[$i]->situation_percent;
2949 $result = round($result,
getDolGlobalInt(
'INVOICE_SITUATION_PROGRESS_DECIMALS', 2)).
'%';
2966 global $hookmanager;
2976 if (is_object($hookmanager)) {
2977 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
2978 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
2979 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
2981 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code,
'sign' => $sign);
2983 $reshook = $hookmanager->executeHooks(
'pdf_getlinetotalexcltax', $parameters,
$object, $action);
2985 if (!empty($hookmanager->resPrint)) {
2986 $result .= $hookmanager->resPrint;
2989 if (empty($reshook)) {
2990 if (!empty(
$object->lines[$i]) &&
$object->lines[$i]->special_code == 3) {
2991 $result .= $outputlangs->transnoentities(
"Option");
2992 } elseif (empty($hidedetails) || $hidedetails > 1) {
2994 if (!empty(
$object->lines[$i]->situation_percent) &&
$object->lines[$i]->situation_percent > 0) {
2995 if (method_exists(
$object->lines[$i],
'getSituationRatio')) {
2996 $total_ht *=
$object->lines[$i]->getSituationRatio();
2999 $result .=
price($sign * $total_ht, 0, $outputlangs);
3016 global $hookmanager;
3026 if (is_object($hookmanager)) {
3027 $special_code = empty(
$object->lines[$i]->special_code) ?
'' :
$object->lines[$i]->special_code;
3028 if (!empty(
$object->lines[$i]->fk_parent_line) &&
$object->lines[$i]->fk_parent_line > 0) {
3029 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
3031 $parameters = array(
'i' => $i,
'outputlangs' => $outputlangs,
'hidedetails' => $hidedetails,
'special_code' => $special_code);
3033 $reshook = $hookmanager->executeHooks(
'pdf_getlinetotalwithtax', $parameters,
$object, $action);
3035 if (!empty($hookmanager->resPrint)) {
3036 $result .= $hookmanager->resPrint;
3039 if (empty($reshook)) {
3040 if (
$object->lines[$i]->special_code == 3) {
3041 $result .= $outputlangs->transnoentities(
"Option");
3042 } elseif (empty($hidedetails) || $hidedetails > 1) {
3044 if (isset(
$object->lines[$i]->situation_percent) &&
$object->lines[$i]->situation_percent > 0) {
3045 $total_ttc *=
$object->lines[$i]->getSituationRatio();
3047 $result .=
price($sign * $total_ttc, 0, $outputlangs);
3072 if (!empty($objectSocId) && !empty($elementSocId) && $objectSocId != $elementSocId) {
3087function pdf_getLinkedObjects(
$object, $outputlangs)
3089 global $db, $hookmanager;
3091 $linkedobjects = array();
3095 foreach (
$object->linkedObjects as $objecttype => $objects) {
3096 if ($objecttype ==
'facture') {
3098 } elseif ($objecttype ==
'propal' || $objecttype ==
'supplier_proposal') {
3099 '@phan-var-force array<Propal|SupplierProposal> $objects';
3101 $outputlangs->load(
'propal');
3103 foreach ($objects as $elementobject) {
3104 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"RefProposal");
3105 $linkedobjects[$objecttype][
'ref_value'] = $outputlangs->transnoentities($elementobject->ref);
3106 $linkedobjects[$objecttype][
'date_title'] = $outputlangs->transnoentities(
"DatePropal");
3107 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date($elementobject->date,
'day',
'', $outputlangs);
3109 } elseif ($objecttype ==
'commande' || $objecttype ==
'supplier_order' || $objecttype ==
'order_supplier') {
3110 $optiontohidelinkedorders =
"PDF_HIDE_LINKED_ORDERS_ON_SAME_THIRDPARTY";
3111 if ($objecttype ==
'supplier_order' || $objecttype ==
'order_supplier') {
3112 $optiontohidelinkedorders =
"PDF_HIDE_LINKED_PURCHASE_ORDERS_ON_SAME_THIRDPARTY";
3114 '@phan-var-force array<Commande|CommandeFournisseur> $objects';
3115 $outputlangs->load(
'orders');
3118 if (empty(
$object->context[
'DolPublicNoteAppendedGetLinkedObjects'])) {
3120 foreach ($objects as $elementobject) {
3122 $outputList =
dol_concatdesc($outputList, $outputlangs->transnoentities($elementobject->ref) . (empty($elementobject->ref_client) ?
'' :
' (' . $elementobject->ref_client .
')') . (empty($elementobject->ref_supplier) ?
'' :
' (' . $elementobject->ref_supplier .
')') .
' ');
3123 $outputList =
dol_concatdesc($outputList, $outputlangs->transnoentities(
"OrderDate") .
' : ' .
dol_print_date($elementobject->date,
'day',
'', $outputlangs));
3127 if (!empty($outputList)) {
3133 $elementobject = array_shift($objects);
3135 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"RefOrder");
3136 $linkedobjects[$objecttype][
'ref_value'] = $outputlangs->transnoentities($elementobject->ref).(!empty($elementobject->ref_client) ?
' ('.$elementobject->ref_client.
')' :
'').(!empty($elementobject->ref_supplier) ?
' ('.$elementobject->ref_supplier.
')' :
'');
3137 $linkedobjects[$objecttype][
'date_title'] = $outputlangs->transnoentities(
"OrderDate");
3138 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date($elementobject->date,
'day',
'', $outputlangs);
3141 } elseif ($objecttype ==
'contrat') {
3142 '@phan-var-force Contrat[] $objects';
3143 $outputlangs->load(
'contracts');
3144 foreach ($objects as $elementobject) {
3146 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"RefContract");
3147 $linkedobjects[$objecttype][
'ref_value'] = $outputlangs->transnoentities($elementobject->ref);
3148 $linkedobjects[$objecttype][
'date_title'] = $outputlangs->transnoentities(
"DateContract");
3149 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date($elementobject->date_contrat,
'day',
'', $outputlangs);
3152 } elseif ($objecttype ==
'fichinter') {
3153 '@phan-var-force Fichinter[] $objects';
3154 $outputlangs->load(
'interventions');
3155 foreach ($objects as $elementobject) {
3157 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"InterRef");
3158 $linkedobjects[$objecttype][
'ref_value'] = $outputlangs->transnoentities($elementobject->ref);
3159 $linkedobjects[$objecttype][
'date_title'] = $outputlangs->transnoentities(
"InterDate");
3160 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date($elementobject->datec,
'day',
'', $outputlangs);
3163 } elseif ($objecttype ==
'shipping') {
3164 '@phan-var-force Expedition[] $objects';
3165 $outputlangs->loadLangs(array(
"orders",
"sendings"));
3167 if (count($objects) > 1) {
3171 if (empty(
$object->linkedObjects[
'commande']) &&
$object->element !=
'commande') {
3172 $refListsTxt .= $outputlangs->transnoentities(
"RefOrder").
' / '.$outputlangs->transnoentities(
"RefSending").
' :';
3174 $refListsTxt .= $outputlangs->transnoentities(
"RefSending").
' :';
3177 foreach ($objects as $elementobject) {
3178 if (empty(
$object->linkedObjects[
'commande']) &&
$object->element !=
'commande') {
3179 $elementobject->fetchObjectLinked(
null,
'',
null,
'',
'OR', 1,
'sourcetype', 0);
3180 if (!empty($elementobject->linkedObjectsIds[
'commande'])) {
3181 include_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
3183 $ret = $order->fetch(reset($elementobject->linkedObjectsIds[
'commande']));
3189 $refListsTxt .= (!empty($refListsTxt) ?
' ' :
'');
3190 if (! is_object($order)) {
3191 $refListsTxt .= $outputlangs->transnoentities($elementobject->ref);
3193 $refListsTxt .= $outputlangs->convToOutputCharset($order->ref).($order->ref_client ?
' ('.$order->ref_client.
')' :
'');
3194 $refListsTxt .=
' / '.$outputlangs->transnoentities($elementobject->ref);
3198 if (empty(
$object->context[
'DolPublicNoteAppendedGetLinkedObjects']) && !
getDolGlobalString(
"PDF_HIDE_LINKED_OBJECT_IN_PUBLIC_NOTE")) {
3201 } elseif (count($objects) == 1) {
3202 $elementobject = array_shift($objects);
3205 if (empty(
$object->linkedObjects[
'commande']) &&
$object->element !=
'commande') {
3206 $elementobject->fetchObjectLinked(
null,
'',
null,
'',
'OR', 1,
'sourcetype', 0);
3207 if (!empty($elementobject->linkedObjectsIds[
'commande'])) {
3208 include_once DOL_DOCUMENT_ROOT.
'/commande/class/commande.class.php';
3210 $ret = $order->fetch(reset($elementobject->linkedObjectsIds[
'commande']));
3217 if (! is_object($order)) {
3218 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"RefSending");
3219 if (empty($linkedobjects[$objecttype][
'ref_value'])) {
3220 $linkedobjects[$objecttype][
'ref_value'] =
'';
3222 $linkedobjects[$objecttype][
'ref_value'] .=
' / ';
3224 $linkedobjects[$objecttype][
'ref_value'] .= $outputlangs->transnoentities($elementobject->ref);
3225 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date(empty($elementobject->date_shipping) ? $elementobject->date_delivery : $elementobject->date_shipping,
'day',
'', $outputlangs);
3227 $linkedobjects[$objecttype][
'ref_title'] = $outputlangs->transnoentities(
"RefOrder").
' / '.$outputlangs->transnoentities(
"RefSending");
3228 if (empty($linkedobjects[$objecttype][
'ref_value'])) {
3229 $linkedobjects[$objecttype][
'ref_value'] = $outputlangs->convToOutputCharset($order->ref).($order->ref_client ?
' ('.$order->ref_client.
')' :
'');
3231 $linkedobjects[$objecttype][
'ref_value'] .=
' / '.$outputlangs->transnoentities($elementobject->ref);
3232 $linkedobjects[$objecttype][
'date_value'] =
dol_print_date(empty($elementobject->date_shipping) ? $elementobject->date_delivery : $elementobject->date_shipping,
'day',
'', $outputlangs);
3238 $object->context[
'DolPublicNoteAppendedGetLinkedObjects'] = 1;
3241 if (is_object($hookmanager)) {
3242 $parameters = array(
'linkedobjects' => $linkedobjects,
'outputlangs' => $outputlangs);
3244 $reshook = $hookmanager->executeHooks(
'pdf_getLinkedObjects', $parameters,
$object, $action);
3245 if (empty($reshook)) {
3246 $linkedobjects = array_replace($linkedobjects, $hookmanager->resArray);
3247 } elseif ($reshook > 0) {
3249 $linkedobjects = $hookmanager->resArray;
3253 return $linkedobjects;
3266 $maxheight =
getDolGlobalInt(
'MAIN_DOCUMENTS_WITH_PICTURE_HEIGHT', 32);
3268 include_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
3272 if ($tmp[
'height']) {
3273 $width = (int) round($maxheight * $tmp[
'width'] / $tmp[
'height']);
3274 if ($width > $maxwidth) {
3276 $height = (int) round($maxwidth * $tmp[
'height'] / $tmp[
'width']);
3278 $height = $maxheight;
3281 return array(
'width' => $width,
'height' => $height);
3297 global $hookmanager;
3303 if (
$object->lines[$i]->special_code == 3) {
3305 return $outputlangs->transnoentities(
"Option");
3307 if (is_object($hookmanager)) {
3308 $special_code =
$object->lines[$i]->special_code;
3309 if (!empty(
$object->lines[$i]->fk_parent_line)) {
3310 $special_code =
$object->getSpecialCode(
$object->lines[$i]->fk_parent_line);
3313 $parameters = array(
3315 'outputlangs' => $outputlangs,
3316 'hidedetails' => $hidedetails,
3317 'special_code' => $special_code,
3318 'multicurrency' => $multicurrency
3323 if ($hookmanager->executeHooks(
'getlinetotalremise', $parameters,
$object, $action) > 0) {
3324 if (isset($hookmanager->resArray[
'linetotalremise'])) {
3325 return (
float) $hookmanager->resArray[
'linetotalremise'];
3327 return (
float) $hookmanager->resPrint;
3332 if (empty($hidedetails) || $hidedetails > 1) {
3333 if (empty($multicurrency)) {
3335 return (
float)
price2num($diff,
'MT', 1);
3337 $diff = (float)
price2num($sign *
$object->lines[$i]->multicurrency_subprice * (
float)
$object->lines[$i]->qty,
'MT', 1) -
$object->lines[$i]->multicurrency_total_ht;
3338 return (
float)
price2num($diff,
'MT', 1);
3355 return "ERROR: FILE NOT FOUND OR NOT VALID";
3366 $content = preg_replace(
'/[^(\x20-\x7F)]*/',
'', $content);
3367 if (preg_match(
'/\/' . preg_quote($field,
'/') .
'\s*\((.*?)\)/', $content, $matches)) {
3368 return trim($matches[1]);
3370 return "ERROR: NOT FOUND";
3372 return "ERROR: FAILED TO READ PDF";
3405 bool $isSubtotal =
false,
3406 bool $applySubtotalLogic =
true
3408 global $hookmanager;
3410 if (is_object($hookmanager)) {
3411 $parameters = array(
'pdf' => $pdf,
'generator' => $generator,
'curY' => $curY,
'i' => $i,
'outputlangs' => $outputlangs,
'hideref' => $hideref,
'hidedesc' => $hidedesc,
'bgColor' => $bgColor,
'isSubtotal' => $isSubtotal,
'applySubtotalLogic' => $applySubtotalLogic);
3413 $reshook = $hookmanager->executeHooks(
'pdf_render_subtotals', $parameters,
$object, $action);
3419 $savePage = $pdf->getPage();
3420 $saveX = $pdf->GetX();
3421 $prevAlign = $generator->cols[
'desc'][
'content'][
'align'];
3422 $prevDesc =
$object->lines[$i]->desc;
3424 if ($isSubtotal && $applySubtotalLogic &&
$object->lines[$i]->qty < 0) {
3425 $outputlangs->load(
"subtotals");
3426 $object->lines[$i]->desc =
getDolGlobalString(
"SUBTOTAL_LINE_TEXT_DOES_NOT_INCLUDE_TITLE_TEXT") ? $outputlangs->trans(
"SubTotal") : $outputlangs->trans(
"SubtotalOf",
$object->lines[$i]->desc);
3427 $generator->cols[
'desc'][
'content'][
'align'] = ($prevAlign ===
'L') ?
'R' :
'L';
3430 $pdf->startTransaction();
3431 $pdf->SetXY($saveX, $curY);
3433 $pageAfter = $pdf->getPage();
3434 $yAfter = $pdf->GetY();
3435 $pdf->rollbackTransaction(
true);
3437 $pdf->SetFillColor($bgColor[0], $bgColor[1], $bgColor[2]);
3438 $width = $generator->page_largeur - $generator->marge_droite - $generator->marge_gauche;
3440 $pdf->SetXY($generator->marge_gauche, $curY);
3441 if ($pageAfter === $savePage) {
3442 $pdf->MultiCell($width, max(0, $yAfter - $curY),
'', 0,
'',
true);
3444 $pdf->MultiCell($width, $pdf->getPageHeight() - $pdf->getBreakMargin() - $curY,
'', 0,
'',
true);
3450 while ($pdf->getNumPages() < $pageAfter) {
3453 $pdf->setPage($pageAfter);
3454 $pdf->SetXY($generator->marge_gauche, $pdf->getMargins()[
'top']);
3455 $pdf->MultiCell($width, max(0, $yAfter - $pdf->getMargins()[
'top']),
'', 0,
'',
true);
3457 $pdf->setPage($savePage);
3461 $textGray = (
colorIsLight(implode(
',', $bgColor)) === 0) ? 255 : 0;
3462 $pdf->SetTextColor($textGray);
3463 $pdf->SetXY($saveX, $curY);
3467 $generator->cols[
'desc'][
'content'][
'align'] = $prevAlign;
3469 $object->lines[$i]->desc = $prevDesc;
3485 if ($ellipsis_pos == 0) {
3488 if ($ellipsis_pos ==
'left') {
3492 if ($ellipsis_pos ==
'right') {
3497 $ellipsis_width = $pdf->GetStringWidth($ellipsis);
3498 $available_width = $max_width - $ellipsis_width;
3500 if ($available_width <= 0) {
3501 return ($ellipsis_pos <= 0) ? $ellipsis :
'';
3504 $text_width = $pdf->GetStringWidth($text);
3505 if ($text_width <= $max_width) {
3509 if ($ellipsis_pos < 0) {
3515 while ($low <= $high) {
3516 $mid = (int) (($low + $high) / 2);
3517 $substring =
dol_substr($text, $mid,
null,
'UTF-8');
3518 $substring_width = $pdf->GetStringWidth($substring);
3520 if ($substring_width <= $available_width) {
3528 return $ellipsis .
dol_substr($text, $best,
null,
'UTF-8');
3535 while ($low <= $high) {
3536 $mid = (int) (($low + $high) / 2);
3537 $substring =
dol_substr($text, 0, $mid,
'UTF-8');
3538 $substring_width = $pdf->GetStringWidth($substring);
3540 if ($substring_width <= $available_width) {
3548 return dol_substr($text, 0, $best,
'UTF-8') . $ellipsis;
if(! $sortfield) if(! $sortorder) $object
pdfWriteBlockedLogSignature(&$pdf, $outputlangs, $page_height, $object, &$w, &$posx, &$posy)
Add some information from the blockedlog module.
pdfCertifMentionblockedLog(&$pdf, $outputlangs, $seller, $default_font_size, &$posy, $pdftemplate)
Add legal mention.
isALNERunningVersion($blockedlogusagealreadychecked=0, $blockedlogmoduleonalreadychecked=0)
Return if the application is executed with the LNE requirements on.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage categories.
Class to manage customers orders.
Parent class for documents (PDF, ODT, ...) generators.
printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
print description column content
setAfterColsLinePositionsData(string $colId, float $y, int $pageNumb)
Used for to set afterColsLinePositions var in a pdf draw line loop.
Class to manage absolute discounts.
Class to manage warehouses.
File of class to manage predefined price products or services by customer.
Class to manage predefined suppliers products.
Class to manage products or services.
Manage record for batch number management.
Class to manage third parties objects (customers, suppliers, prospects...)
Class to manage translations.
getState($id, $withcode='0', $dbtouse=null, $withregion=0, $outputlangs=null, $entconv=1)
Return state translated from an id.
getFormeJuridiqueLabel($code)
Return the name translated of juridical status.
dol_is_file($pathoffile)
Return if path is a file.
dol_print_reduction($reduction, $langs)
Returns formatted reduction.
dol_getDefaultFormat($outputlangs=null)
Try to guess default paper format according to language into $langs.
dol_html_entity_decode($a, $b, $c='UTF-8', $keepsomeentities=0)
Replace html_entity_decode functions to manage errors.
dol_now($mode='gmt')
Return date for now.
getDolGlobalFloat($key, $default=0)
Return a Dolibarr global constant float value.
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0, $html=0)
Return a string with VAT rate label formatted for view output Used into pdf and HTML pages.
price2num($amount, $rounding='', $option=0, $currencycode='')
Function that return a number with universal decimal format (decimal separator is '.
dol_format_address($object, $withcountry=0, $sep="\n", $outputlangs=null, $mode=0, $extralangcode='')
Return a formatted address (part address/zip/town/state) according to country rules.
dol_strlen($string, $stringencoding='UTF-8', $binarycount=0)
Make a strlen call.
dol_osencode($str)
Return a string encoded into OS filesystem encoding.
getObjectSocId($obj)
Get the socid of an object, supporting legacy attribute names.
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto='UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
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.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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...
getDolCurrency()
Return the main currency ('EUR', 'USD', ...)
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...
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
make_substitutions($text, $substitutionarray, $outputlangs=null, $converttextinhtmlifnecessary=0)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
dol_textishtml($msg, $option=0)
Return if a text is a html content.
colorIsLight($stringcolor)
Return true if the color is light.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getDolGlobalBool($key, $default=false)
Return a Dolibarr global constant boolean value.
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
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 a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
dol_getImageSize($file, $url=false)
Return size of image file on disk (Supported extensions are gif, jpg, png, bmp and webp)
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
pdf_watermark($pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line total excluding tax.
pdfCertifMention($pdf, $outputlangs, $seller, $default_font_size, &$posy, $pdftemplate)
Add legal certificate mention.
pdf_getlinedesc($object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
Return line description translated in outputlangs and encoded into htmlentities and with
pdf_getFormat($outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdfGetLineTotalDiscountAmount($object, $i, $outputlangs, $hidedetails=0, $multicurrency=0)
Return line total amount discount.
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation The hook 'pdf_writeLinkedObjects' can replace this block (retu...
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdfExtractMetadata($file, $field='Keywords')
Function to extract metadata from a PDF file by doing a binary parsing of the PDF file.
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, $onlynumber=0, $default_font_size=10)
Show bank information for PDF generation The hook 'pdf_bank' can replace this block (return > 0).
pdf_getlineqty_shipped($object, $i, $outputlangs, $hidedetails=0)
Return line quantity shipped.
pdf_getlinenum($object, $i, $outputlangs, $hidedetails=0)
Return line num.
pdf_getEncryption($pathoffile)
Return if pdf file is protected/encrypted.
pdf_writelinedesc($pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0, $align='J')
Output line description into PDF.
pdf_getlineupwithtax($object, $i, $outputlangs, $hidedetails=0)
Return line unit price including tax.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_getlineref_supplier($object, $i, $outputlangs, $hidedetails=0)
Return line ref_supplier.
pdfWriteVATArray($docgenerator, &$index, $pdf, $outputlangs, $outputlangsbis, $object, $col1x, $col2x, $largcol2, $tab2_top, $tab2_hl)
Add some information from the blockedlog module.
pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails=0)
Return line total including tax.
pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line unit price excluding tax.
pdf_getlineprogress($object, $i, $outputlangs, $hidedetails=0, $hookmanager=null)
Return line percent.
pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails=0)
Return line vat rate.
pdf_admin_prepare_head()
Return array head with list of tabs to view object information.
canDisplayLinkedObjectInPDF($object, $elementobject)
Check if a linked object can be displayed based on third-party privacy rules.
pdf_pagehead($pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdfGetHeightForHtmlContent($pdf, $htmlcontent)
Function to try to calculate height of a HTML Content.
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_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_render_subtotals(TCPDF $pdf, CommonDocGenerator $generator, float $curY, CommonObject $object, int $i, Translate $outputlangs, int $hideref, int $hidedesc, array $bgColor, bool $isSubtotal=false, bool $applySubtotalLogic=true)
Render subtotals line with a colored background and adapted text color .
pdf_getlineqty_keeptoship($object, $i, $outputlangs, $hidedetails=0)
Return line keep to ship quantity.
pdf_truncate_text($pdf, $text, $max_width, $ellipsis_pos=1, $ellipsis="\u{2026}")
Truncates text to fit a specified width in TCPDF, with configurable ellipsis position.
pdf_getlineref($object, $i, $outputlangs, $hidedetails=0)
Return line product ref.
pdfWriteAdditionnalTitle($pdf, $outputlangs, $page_height, $object, &$w, &$posx, &$posy)
Add some information from the blockedlog module.
pdfWriteAlreadyPaid($docgenerator, &$index, $pdf, $outputlangs, $outputlangsbis, $object, $col1x, $col2x, $largcol2, $tab2_top, $tab2_hl, $deja_regle, $creditnoteamount, $depositsamount, $resteapayer, $resteapayer_origin)
Add some information from the blockedlog module.
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_writeLogoOrCompanyName($pdf, $outputlangs, $emetteur, $logodir, $posx, $posy, $w, $default_font_size, $align)
Output company logo on top-left of a PDF page header, or the company name as fallback text if no logo...
pdf_getlineunit($object, $i, $outputlangs, $hidedetails=0)
Return line unit.
pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails=0)
Return line remise percent.
pdf_getlineqty_asked($object, $i, $outputlangs, $hidedetails=0)
Return line quantity asked.
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.