32 require_once DOL_DOCUMENT_ROOT.
'/core/modules/propale/modules_propale.php';
33 require_once DOL_DOCUMENT_ROOT.
'/product/class/product.class.php';
34 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/functions2.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
62 public $update_main_doc_field;
73 public $phpmin = array(5, 6);
79 public $version =
'dolibarr';
104 public $marge_droite;
135 global $conf, $langs, $mysoc;
138 $langs->loadLangs(array(
"main",
"bills"));
141 $this->
name =
"cyan";
142 $this->
description = $langs->trans(
'DocModelCyanDescription');
143 $this->update_main_doc_field = 1;
148 $this->page_largeur = $formatarray[
'width'];
149 $this->page_hauteur = $formatarray[
'height'];
150 $this->format = array($this->page_largeur, $this->page_hauteur);
151 $this->marge_gauche = isset($conf->global->MAIN_PDF_MARGIN_LEFT) ? $conf->global->MAIN_PDF_MARGIN_LEFT : 10;
152 $this->marge_droite = isset($conf->global->MAIN_PDF_MARGIN_RIGHT) ? $conf->global->MAIN_PDF_MARGIN_RIGHT : 10;
153 $this->marge_haute = isset($conf->global->MAIN_PDF_MARGIN_TOP) ? $conf->global->MAIN_PDF_MARGIN_TOP : 10;
154 $this->marge_basse = isset($conf->global->MAIN_PDF_MARGIN_BOTTOM) ? $conf->global->MAIN_PDF_MARGIN_BOTTOM : 10;
156 $this->option_logo = 1;
157 $this->option_tva = 1;
158 $this->option_modereg = 1;
159 $this->option_condreg = 1;
160 $this->option_codeproduitservice = 1;
161 $this->option_multilang = 1;
162 $this->option_escompte = 0;
163 $this->option_credit_note = 0;
164 $this->option_freetext = 1;
165 $this->option_draft_watermark = 1;
168 $this->emetteur = $mysoc;
169 if (empty($this->emetteur->country_code)) $this->emetteur->country_code = substr($langs->defaultlang, -2);
172 $this->posxdesc = $this->marge_gauche + 1;
175 $this->tabTitleHeight = 5;
179 $this->tva = array();
180 $this->localtax1 = array();
181 $this->localtax2 = array();
182 $this->atleastoneratenotnull = 0;
183 $this->atleastonediscount = 0;
198 public function write_file($object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
201 global $user, $langs, $conf, $mysoc, $db, $hookmanager, $nblines;
203 dol_syslog(
"write_file outputlangs->defaultlang=".(is_object($outputlangs) ? $outputlangs->defaultlang :
'null'));
205 if (!is_object($outputlangs)) $outputlangs = $langs;
207 if (!empty($conf->global->MAIN_USE_FPDF)) $outputlangs->charset_output =
'ISO-8859-1';
210 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
212 global $outputlangsbis;
213 $outputlangsbis = null;
214 if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
215 $outputlangsbis =
new Translate(
'', $conf);
216 $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
217 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
220 $nblines = count($object->lines);
223 if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) {
224 $hidetop = $conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE;
228 $realpatharray = array();
229 $this->atleastonephoto =
false;
230 if (!empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE))
234 for ($i = 0; $i < $nblines; $i++)
236 if (empty($object->lines[$i]->fk_product))
continue;
238 $objphoto->fetch($object->lines[$i]->fk_product);
240 if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
242 $pdir[0] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
243 $pdir[1] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
245 $pdir[0] =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
246 $pdir[1] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
250 foreach ($pdir as $midir)
254 if ($conf->product->entity != $objphoto->entity) {
255 $dir = $conf->product->multidir_output[$objphoto->entity].
'/'.$midir;
257 $dir = $conf->product->dir_output.
'/'.$midir;
260 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj)
262 if (empty($conf->global->CAT_HIGH_QUALITY_IMAGES))
264 if ($obj[
'photo_vignette'])
266 $filename = $obj[
'photo_vignette'];
268 $filename = $obj[
'photo'];
271 $filename = $obj[
'photo'];
274 $realpath = $dir.$filename;
276 $this->atleastonephoto =
true;
281 if ($realpath && $arephoto) $realpatharray[$i] = $realpath;
285 if (count($realpatharray) == 0) $this->posxpicture = $this->posxtva;
287 if ($conf->propal->multidir_output[$conf->entity])
289 $object->fetch_thirdparty();
294 if ($object->specimen)
296 $dir = $conf->propal->multidir_output[$conf->entity];
297 $file = $dir.
"/SPECIMEN.pdf";
300 $dir = $conf->propal->multidir_output[$object->entity].
"/".$objectref;
301 $file = $dir.
"/".$objectref.
".pdf";
304 if (!file_exists($dir))
308 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
313 if (file_exists($dir))
316 if (!is_object($hookmanager))
318 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
321 $hookmanager->initHooks(array(
'pdfgeneration'));
322 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
324 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters, $object, $action);
327 $nblines = count($object->lines);
333 $pdf->SetAutoPageBreak(1, 0);
335 if (class_exists(
'TCPDF'))
337 $pdf->setPrintHeader(
false);
338 $pdf->setPrintFooter(
false);
342 if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND))
344 $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].
'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
345 $tplidx = $pdf->importPage(1);
350 $pdf->SetDrawColor(128, 128, 128);
352 $pdf->SetTitle($outputlangs->convToOutputCharset($object->ref));
353 $pdf->SetSubject($outputlangs->transnoentities(
"PdfCommercialProposalTitle"));
354 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
355 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
356 $pdf->SetKeyWords($outputlangs->convToOutputCharset($object->ref).
" ".$outputlangs->transnoentities(
"PdfCommercialProposalTitle").
" ".$outputlangs->convToOutputCharset($object->thirdparty->name));
357 if (!empty($conf->global->MAIN_DISABLE_PDF_COMPRESSION)) $pdf->SetCompression(
false);
359 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
362 for ($i = 0; $i < $nblines; $i++)
364 if ($object->lines[$i]->remise_percent)
366 $this->atleastonediscount++;
373 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
376 $heightforinfotot = 40;
377 $heightforsignature = empty($conf->global->PROPAL_DISABLE_SIGNATURE) ? (
pdfGetHeightForHtmlContent($pdf, $outputlangs->transnoentities(
"ProposalCustomerSignature")) + 10) : 0;
378 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
379 $heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22);
382 $top_shift = $this->
_pagehead($pdf, $object, 1, $outputlangs, $outputlangsbis);
383 $pdf->SetFont(
'',
'', $default_font_size - 1);
384 $pdf->MultiCell(0, 3,
'');
385 $pdf->SetTextColor(0, 0, 0);
388 $tab_top = 90 + $top_shift;
389 $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
393 $height_incoterms = 0;
394 if (!empty($conf->incoterm->enabled))
396 $desc_incoterms = $object->getIncotermsForPDF();
401 $pdf->SetFont(
'',
'', $default_font_size - 1);
402 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
403 $nexY = max($pdf->GetY(), $nexY);
404 $height_incoterms = $nexY - $tab_top;
407 $pdf->SetDrawColor(192, 192, 192);
408 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
410 $tab_top = $nexY + 6;
415 $notetoshow = empty($object->note_public) ?
'' : $object->note_public;
416 if (!empty($conf->global->MAIN_ADD_SALE_REP_SIGNATURE_IN_NOTE))
419 if (is_object($object->thirdparty))
421 $salereparray = $object->thirdparty->getSalesRepresentatives($user);
422 $salerepobj =
new User($this->
db);
423 $salerepobj->fetch($salereparray[0][
'id']);
424 if (!empty($salerepobj->signature)) $notetoshow =
dol_concatdesc($notetoshow, $salerepobj->signature);
429 $extranote = $this->getExtrafieldsInHtml($object, $outputlangs);
430 if (!empty($extranote)) {
434 if (!empty($conf->global->MAIN_ADD_CREATOR_IN_NOTE) && $object->user_author_id > 0)
436 $tmpuser =
new User($this->
db);
437 $tmpuser->fetch($object->user_author_id);
438 $notetoshow .= $langs->trans(
"CaseFollowedBy").
' '.$tmpuser->getFullName($langs);
439 if ($tmpuser->email) $notetoshow .=
', Mail: '.$tmpuser->email;
440 if ($tmpuser->office_phone) $notetoshow .=
', Tel: '.$tmpuser->office_phone;
443 $tab_height = $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter;
445 $pagenb = $pdf->getPage();
450 $tab_width = $this->page_largeur - $this->marge_gauche - $this->marge_droite;
451 $pageposbeforenote = $pagenb;
458 $pdf->startTransaction();
460 $pdf->SetFont(
'',
'', $default_font_size - 1);
461 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
463 $pageposafternote = $pdf->getPage();
464 $posyafter = $pdf->GetY();
466 if ($pageposafternote > $pageposbeforenote)
468 $pdf->rollbackTransaction(
true);
471 while ($pagenb < $pageposafternote) {
474 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
475 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
477 $pdf->setTopMargin($tab_top_newpage);
479 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
483 $pdf->setPage($pageposbeforenote);
484 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
485 $pdf->SetFont(
'',
'', $default_font_size - 1);
486 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
487 $pageposafternote = $pdf->getPage();
489 $posyafter = $pdf->GetY();
491 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20)))
493 $pdf->AddPage(
'',
'',
true);
496 $pdf->setPage($pageposafternote);
497 $pdf->setTopMargin($tab_top_newpage);
499 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext);
505 $i = $pageposbeforenote;
506 while ($i < $pageposafternote) {
510 $pdf->SetDrawColor(128, 128, 128);
512 if ($i > $pageposbeforenote) {
513 $height_note = $this->page_hauteur - ($tab_top_newpage + $heightforfooter);
514 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
516 $height_note = $this->page_hauteur - ($tab_top + $heightforfooter);
517 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
521 $pdf->setPageOrientation(
'', 1, 0);
522 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
528 $pdf->setPage($pageposafternote);
529 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
530 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
531 $height_note = $posyafter - $tab_top_newpage;
532 $pdf->Rect($this->marge_gauche, $tab_top_newpage - 1, $tab_width, $height_note + 1);
535 $pdf->commitTransaction();
536 $posyafter = $pdf->GetY();
537 $height_note = $posyafter - $tab_top;
538 $pdf->Rect($this->marge_gauche, $tab_top - 1, $tab_width, $height_note + 1);
541 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + 20)))
544 $pdf->AddPage(
'',
'',
true);
547 $pdf->setPage($pageposafternote);
548 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
549 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
551 $posyafter = $tab_top_newpage;
554 $tab_height = $tab_height - $height_note;
555 $tab_top = $posyafter + 6;
564 $pdf->startTransaction();
565 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
566 $pdf->rollbackTransaction(
true);
568 $nexY = $tab_top + $this->tabTitleHeight;
571 $pageposbeforeprintlines = $pdf->getPage();
572 $pagenb = $pageposbeforeprintlines;
573 for ($i = 0; $i < $nblines; $i++)
576 $pdf->SetFont(
'',
'', $default_font_size - 1);
577 $pdf->SetTextColor(0, 0, 0);
580 $imglinesize = array();
583 $pdf->setTopMargin($tab_top_newpage);
584 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot);
585 $pageposbefore = $pdf->getPage();
587 $showpricebeforepagebreak = 1;
589 $posYAfterDescription = 0;
594 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot)))
596 $pdf->AddPage(
'',
'',
true);
597 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
598 $pdf->setPage($pageposbefore + 1);
600 $curY = $tab_top_newpage;
603 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
604 $showpricebeforepagebreak = 1;
605 else $showpricebeforepagebreak = 0;
609 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height']))
611 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
613 $posYAfterImage = $curY + $imglinesize[
'height'];
620 $pdf->startTransaction();
622 $this->
printColDescContent($pdf, $curY,
'desc', $object, $i, $outputlangs, $hideref, $hidedesc);
623 $pageposafter = $pdf->getPage();
625 if ($pageposafter > $pageposbefore)
627 $pdf->rollbackTransaction(
true);
629 $pdf->setPageOrientation(
'', 1, $heightforfooter);
631 $this->
printColDescContent($pdf, $curY,
'desc', $object, $i, $outputlangs, $hideref, $hidedesc);
633 $pageposafter = $pdf->getPage();
634 $posyafter = $pdf->GetY();
636 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforsignature + $heightforinfotot)))
638 if ($i == ($nblines - 1))
640 $pdf->AddPage(
'',
'',
true);
641 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
642 $pdf->setPage($pageposafter + 1);
647 if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE))
648 $showpricebeforepagebreak = 1;
649 else $showpricebeforepagebreak = 0;
653 $pdf->commitTransaction();
655 $posYAfterDescription = $pdf->GetY();
658 $nexY = $pdf->GetY();
659 $pageposafter = $pdf->getPage();
661 $pdf->setPage($pageposbefore);
662 $pdf->setTopMargin($this->marge_haute);
663 $pdf->setPageOrientation(
'', 1, 0);
666 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
667 $pdf->setPage($pageposafter); $curY = $tab_top_newpage;
670 $pdf->SetFont(
'',
'', $default_font_size - 1);
677 $nexY = max($pdf->GetY(), $nexY);
685 $nexY = max($pdf->GetY(), $nexY);
694 $nexY = max($pdf->GetY(), $nexY);
701 $unit =
pdf_getlineunit($object, $i, $outputlangs, $hidedetails, $hookmanager);
703 $nexY = max($pdf->GetY(), $nexY);
707 if ($this->
getColumnStatus(
'discount') && $object->lines[$i]->remise_percent)
711 $nexY = max($pdf->GetY(), $nexY);
719 $nexY = max($pdf->GetY(), $nexY);
727 $nexY = max($pdf->GetY(), $nexY);
731 if (!empty($object->lines[$i]->array_options)) {
732 foreach ($object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
737 $nexY = max($pdf->GetY(), $nexY);
748 'outputlangs' => $outputlangs,
749 'hidedetails' => $hidedetails
751 $reshook = $hookmanager->executeHooks(
'printPDFline', $parameters, $this);
755 if (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) $tvaligne = $object->lines[$i]->multicurrency_total_tva;
756 else $tvaligne = $object->lines[$i]->total_tva;
758 $localtax1ligne = $object->lines[$i]->total_localtax1;
759 $localtax2ligne = $object->lines[$i]->total_localtax2;
760 $localtax1_rate = $object->lines[$i]->localtax1_tx;
761 $localtax2_rate = $object->lines[$i]->localtax2_tx;
762 $localtax1_type = $object->lines[$i]->localtax1_type;
763 $localtax2_type = $object->lines[$i]->localtax2_type;
765 if ($object->remise_percent) $tvaligne -= ($tvaligne * $object->remise_percent) / 100;
766 if ($object->remise_percent) $localtax1ligne -= ($localtax1ligne * $object->remise_percent) / 100;
767 if ($object->remise_percent) $localtax2ligne -= ($localtax2ligne * $object->remise_percent) / 100;
769 $vatrate = (string) $object->lines[$i]->tva_tx;
772 if ((!isset($localtax1_type) || $localtax1_type ==
'' || !isset($localtax2_type) || $localtax2_type ==
'')
773 && (!empty($localtax1_rate) || !empty($localtax2_rate)))
776 $localtax1_type = isset($localtaxtmp_array[0]) ? $localtaxtmp_array[0] :
'';
777 $localtax2_type = isset($localtaxtmp_array[2]) ? $localtaxtmp_array[2] :
'';
781 if ($localtax1_type && $localtax1ligne != 0) {
782 $this->localtax1[$localtax1_type][$localtax1_rate] += $localtax1ligne;
784 if ($localtax2_type && $localtax2ligne != 0) {
785 $this->localtax2[$localtax2_type][$localtax2_rate] += $localtax2ligne;
788 if (($object->lines[$i]->info_bits & 0x01) == 0x01) $vatrate .=
'*';
789 if (!isset($this->tva[$vatrate])) $this->tva[$vatrate] = 0;
790 $this->tva[$vatrate] += $tvaligne;
792 if ($posYAfterImage > $posYAfterDescription) $nexY = max($nexY, $posYAfterImage);
795 if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
796 $pdf->setPage($pageposafter);
797 $pdf->SetLineStyle(array(
'dash'=>
'1,1',
'color'=>array(80, 80, 80)));
799 $pdf->line($this->marge_gauche, $nexY, $this->page_largeur - $this->marge_droite, $nexY);
800 $pdf->SetLineStyle(array(
'dash'=>0));
806 while ($pagenb < $pageposafter) {
807 $pdf->setPage($pagenb);
808 if ($pagenb == $pageposbeforeprintlines) {
809 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis);
811 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis);
813 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
815 $pdf->setPage($pagenb);
816 $pdf->setPageOrientation(
'', 1, 0);
817 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
820 if (isset($object->lines[$i + 1]->pagebreak) && $object->lines[$i + 1]->pagebreak) {
821 if ($pagenb == $pageposafter) {
822 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, $hidetop, 1, $object->multicurrency_code, $outputlangsbis);
824 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1, $object->multicurrency_code, $outputlangsbis);
826 $this->
_pagefoot($pdf, $object, $outputlangs, 1);
829 if (!empty($tplidx)) $pdf->useTemplate($tplidx);
831 if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->
_pagehead($pdf, $object, 0, $outputlangs);
836 if ($pagenb == $pageposbeforeprintlines)
838 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, $hidetop, 0, $object->multicurrency_code, $outputlangsbis);
839 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1;
841 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter, 0, $outputlangs, 1, 0, $object->multicurrency_code, $outputlangsbis);
842 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforsignature - $heightforfooter + 1;
846 $posy = $this->
drawInfoTable($pdf, $object, $bottomlasttab, $outputlangs);
849 $posy = $this->
drawTotalTable($pdf, $object, 0, $bottomlasttab, $outputlangs);
860 if (empty($conf->global->PROPAL_DISABLE_SIGNATURE))
866 $this->
_pagefoot($pdf, $object, $outputlangs);
867 if (method_exists($pdf,
'AliasNbPages')) $pdf->AliasNbPages();
870 if (!empty($conf->global->PRODUIT_PDF_MERGE_PROPAL))
872 require_once DOL_DOCUMENT_ROOT.
'/product/class/propalmergepdfproduct.class.php';
874 $already_merged = array();
875 foreach ($object->lines as $line) {
876 if (!empty($line->fk_product) && !(in_array($line->fk_product, $already_merged))) {
880 if ($conf->global->MAIN_MULTILANGS) {
881 $filetomerge->fetch_by_product($line->fk_product, $outputlangs->defaultlang);
883 $filetomerge->fetch_by_product($line->fk_product);
886 $already_merged[] = $line->fk_product;
889 $product->fetch($line->fk_product);
891 if ($product->entity != $conf->entity) {
892 $entity_product_file = $product->entity;
894 $entity_product_file = $conf->entity;
898 if (count($filetomerge->lines) > 0) {
899 foreach ($filetomerge->lines as $linefile) {
900 if (!empty($linefile->id) && !empty($linefile->file_name)) {
901 if (!empty($conf->global->PRODUCT_USE_OLD_PATH_FOR_PHOTO))
903 if (!empty($conf->product->enabled)) {
904 $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].
'/'.
get_exdir($product->id, 2, 0, 0, $product,
'product').$product->id.
"/photos";
905 } elseif (!empty($conf->service->enabled)) {
906 $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].
'/'.
get_exdir($product->id, 2, 0, 0, $product,
'product').$product->id.
"/photos";
909 if (!empty($conf->product->enabled)) {
910 $filetomerge_dir = $conf->product->multidir_output[$entity_product_file].
'/'.
get_exdir(0, 0, 0, 0, $product,
'product').dol_sanitizeFileName($product->ref);
911 } elseif (!empty($conf->service->enabled)) {
912 $filetomerge_dir = $conf->service->multidir_output[$entity_product_file].
'/'.
get_exdir(0, 0, 0, 0, $product,
'product').dol_sanitizeFileName($product->ref);
916 dol_syslog(get_class($this).
':: upload_dir='.$filetomerge_dir, LOG_DEBUG);
918 $infile = $filetomerge_dir.
'/'.$linefile->file_name;
919 if (file_exists($infile) && is_readable($infile)) {
920 $pagecount = $pdf->setSourceFile($infile);
921 for ($i = 1; $i <= $pagecount; $i++) {
922 $tplIdx = $pdf->importPage($i);
923 if ($tplIdx !==
false) {
924 $s = $pdf->getTemplatesize($tplIdx);
925 $pdf->AddPage($s[
'h'] > $s[
'w'] ?
'P' :
'L');
926 $pdf->useTemplate($tplIdx);
928 setEventMessages(null, array($infile.
' cannot be added, probably protected PDF'),
'warnings');
941 $pdf->Output($file,
'F');
944 $hookmanager->initHooks(array(
'pdfgeneration'));
945 $parameters = array(
'file'=>$file,
'object'=>$object,
'outputlangs'=>$outputlangs);
947 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
950 $this->error = $hookmanager->error;
951 $this->errors = $hookmanager->errors;
954 if (!empty($conf->global->MAIN_UMASK))
955 @chmod($file, octdec($conf->global->MAIN_UMASK));
957 $this->result = array(
'fullpath'=>$file);
961 $this->error = $langs->trans(
"ErrorCanNotCreateDir", $dir);
965 $this->error = $langs->trans(
"ErrorConstantNotDefined",
"PROP_OUTPUTDIR");
994 global $conf, $mysoc;
997 $pdf->SetFont(
'',
'', $default_font_size - 1);
1000 if ($this->emetteur->country_code ==
'FR' && empty($mysoc->tva_assuj))
1002 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1003 $pdf->SetXY($this->marge_gauche, $posy);
1004 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"VATIsNotUsedForInvoice"), 0,
'L', 0);
1006 $posy = $pdf->GetY() + 4;
1012 if (!empty($object->delivery_date))
1014 $outputlangs->load(
"sendings");
1015 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1016 $pdf->SetXY($this->marge_gauche, $posy);
1017 $titre = $outputlangs->transnoentities(
"DateDeliveryPlanned").
':';
1018 $pdf->MultiCell(80, 4, $titre, 0,
'L');
1019 $pdf->SetFont(
'',
'', $default_font_size - 2);
1020 $pdf->SetXY($posxval, $posy);
1021 $dlp =
dol_print_date($object->delivery_date,
"daytext",
false, $outputlangs,
true);
1022 $pdf->MultiCell(80, 4, $dlp, 0,
'L');
1024 $posy = $pdf->GetY() + 1;
1025 } elseif ($object->availability_code || $object->availability)
1027 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1028 $pdf->SetXY($this->marge_gauche, $posy);
1029 $titre = $outputlangs->transnoentities(
"AvailabilityPeriod").
':';
1030 $pdf->MultiCell(80, 4, $titre, 0,
'L');
1031 $pdf->SetTextColor(0, 0, 0);
1032 $pdf->SetFont(
'',
'', $default_font_size - 2);
1033 $pdf->SetXY($posxval, $posy);
1034 $lib_availability = $outputlangs->transnoentities(
"AvailabilityType".$object->availability_code) != (
'AvailabilityType'.$object->availability_code) ? $outputlangs->transnoentities(
"AvailabilityType".$object->availability_code) : $outputlangs->convToOutputCharset($object->availability);
1035 $lib_availability = str_replace(
'\n',
"\n", $lib_availability);
1036 $pdf->MultiCell(80, 4, $lib_availability, 0,
'L');
1038 $posy = $pdf->GetY() + 1;
1042 if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTTERM) && ($object->cond_reglement_code || $object->cond_reglement))
1044 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1045 $pdf->SetXY($this->marge_gauche, $posy);
1046 $titre = $outputlangs->transnoentities(
"PaymentConditions").
':';
1047 $pdf->MultiCell(43, 4, $titre, 0,
'L');
1049 $pdf->SetFont(
'',
'', $default_font_size - 2);
1050 $pdf->SetXY($posxval, $posy);
1051 $lib_condition_paiement = $outputlangs->transnoentities(
"PaymentCondition".$object->cond_reglement_code) != (
'PaymentCondition'.$object->cond_reglement_code) ? $outputlangs->transnoentities(
"PaymentCondition".$object->cond_reglement_code) : $outputlangs->convToOutputCharset($object->cond_reglement_doc ? $object->cond_reglement_doc : $object->cond_reglement_label);
1052 $lib_condition_paiement = str_replace(
'\n',
"\n", $lib_condition_paiement);
1053 $pdf->MultiCell(67, 4, $lib_condition_paiement, 0,
'L');
1055 $posy = $pdf->GetY() + 3;
1058 if (empty($conf->global->PROPOSAL_PDF_HIDE_PAYMENTMODE))
1077 if ($object->mode_reglement_code
1078 && $object->mode_reglement_code !=
'CHQ'
1079 && $object->mode_reglement_code !=
'VIR')
1081 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1082 $pdf->SetXY($this->marge_gauche, $posy);
1083 $titre = $outputlangs->transnoentities(
"PaymentMode").
':';
1084 $pdf->MultiCell(80, 5, $titre, 0,
'L');
1085 $pdf->SetFont(
'',
'', $default_font_size - 2);
1086 $pdf->SetXY($posxval, $posy);
1087 $lib_mode_reg = $outputlangs->transnoentities(
"PaymentType".$object->mode_reglement_code) != (
'PaymentType'.$object->mode_reglement_code) ? $outputlangs->transnoentities(
"PaymentType".$object->mode_reglement_code) : $outputlangs->convToOutputCharset($object->mode_reglement);
1088 $pdf->MultiCell(80, 5, $lib_mode_reg, 0,
'L');
1090 $posy = $pdf->GetY() + 2;
1094 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'CHQ')
1097 if (!empty($conf->global->FACTURE_CHQ_NUMBER))
1099 $diffsizetitle = (empty($conf->global->PDF_DIFFSIZE_TITLE) ? 3 : $conf->global->PDF_DIFFSIZE_TITLE);
1101 if ($conf->global->FACTURE_CHQ_NUMBER > 0)
1104 $account->fetch($conf->global->FACTURE_CHQ_NUMBER);
1106 $pdf->SetXY($this->marge_gauche, $posy);
1107 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1108 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $account->proprio), 0,
'L', 0);
1109 $posy = $pdf->GetY() + 1;
1111 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
1113 $pdf->SetXY($this->marge_gauche, $posy);
1114 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1115 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($account->owner_address), 0,
'L', 0);
1116 $posy = $pdf->GetY() + 2;
1119 if ($conf->global->FACTURE_CHQ_NUMBER == -1)
1121 $pdf->SetXY($this->marge_gauche, $posy);
1122 $pdf->SetFont(
'',
'B', $default_font_size - $diffsizetitle);
1123 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
'PaymentByChequeOrderedTo', $this->emetteur->name), 0,
'L', 0);
1124 $posy = $pdf->GetY() + 1;
1126 if (empty($conf->global->MAIN_PDF_HIDE_CHQ_ADDRESS))
1128 $pdf->SetXY($this->marge_gauche, $posy);
1129 $pdf->SetFont(
'',
'', $default_font_size - $diffsizetitle);
1130 $pdf->MultiCell(100, 3, $outputlangs->convToOutputCharset($this->emetteur->getFullAddress()), 0,
'L', 0);
1131 $posy = $pdf->GetY() + 2;
1138 if (empty($object->mode_reglement_code) || $object->mode_reglement_code ==
'VIR')
1140 if ($object->fk_account > 0 || $object->fk_bank > 0 || !empty($conf->global->FACTURE_RIB_NUMBER))
1142 $bankid = ($object->fk_account <= 0 ? $conf->global->FACTURE_RIB_NUMBER : $object->fk_account);
1143 if ($object->fk_bank > 0) $bankid = $object->fk_bank;
1145 $account->fetch($bankid);
1147 $curx = $this->marge_gauche;
1150 $posy =
pdf_bank($pdf, $outputlangs, $curx, $cury, $account, 0, $default_font_size);
1173 global $conf, $mysoc, $hookmanager;
1177 $outputlangsbis = null;
1178 if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
1179 $outputlangsbis =
new Translate(
'', $conf);
1180 $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
1181 $outputlangsbis->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"propal"));
1182 $default_font_size--;
1187 $pdf->SetFont(
'',
'', $default_font_size - 1);
1190 $col1x = 120; $col2x = 170;
1191 if ($this->page_largeur < 210)
1195 $largcol2 = ($this->page_largeur - $this->marge_droite - $col2x);
1201 $pdf->SetFillColor(255, 255, 255);
1202 $pdf->SetXY($col1x, $tab2_top + 0);
1203 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalHT").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"TotalHT") :
''), 0,
'L', 1);
1205 $total_ht = ((!empty($conf->multicurrency->enabled) && isset($object->multicurrency_tx) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ht : $object->total_ht);
1206 $pdf->SetXY($col2x, $tab2_top + 0);
1207 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ht + (!empty($object->remise) ? $object->remise : 0), 0, $outputlangs), 0,
'R', 1);
1210 $pdf->SetFillColor(248, 248, 248);
1212 $total_ttc = (!empty($conf->multicurrency->enabled) && $object->multicurrency_tx != 1) ? $object->multicurrency_total_ttc : $object->total_ttc;
1214 $this->atleastoneratenotnull = 0;
1215 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT))
1217 $tvaisnull = ((!empty($this->tva) && count($this->tva) == 1 && isset($this->tva[
'0.000']) && is_float($this->tva[
'0.000'])) ?
true :
false);
1218 if (!empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_IFNULL) && $tvaisnull)
1225 foreach ($this->localtax1 as $localtax_type => $localtax_rate)
1227 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5')))
continue;
1229 foreach ($localtax_rate as $tvakey => $tvaval)
1236 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1239 if (preg_match(
'/\*/', $tvakey))
1241 $tvakey = str_replace(
'*',
'', $tvakey);
1242 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1244 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1246 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1247 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1249 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1250 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1258 foreach ($this->localtax2 as $localtax_type => $localtax_rate)
1260 if (in_array((
string) $localtax_type, array(
'1',
'3',
'5')))
continue;
1262 foreach ($localtax_rate as $tvakey => $tvaval)
1271 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1274 if (preg_match(
'/\*/', $tvakey))
1276 $tvakey = str_replace(
'*',
'', $tvakey);
1277 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1279 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1281 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1282 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1284 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1285 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1291 foreach ($this->tva as $tvakey => $tvaval)
1295 $this->atleastoneratenotnull++;
1298 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1301 if (preg_match(
'/\*/', $tvakey))
1303 $tvakey = str_replace(
'*',
'', $tvakey);
1304 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1306 $totalvat = $outputlangs->transcountrynoentities(
"TotalVAT", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalVAT", $mysoc->country_code) :
'');
1308 $totalvat .=
vatrate($tvakey, 1).$tvacompl;
1309 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1311 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1312 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1319 foreach ($this->localtax1 as $localtax_type => $localtax_rate)
1321 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6')))
continue;
1323 foreach ($localtax_rate as $tvakey => $tvaval)
1330 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1333 if (preg_match(
'/\*/', $tvakey))
1335 $tvakey = str_replace(
'*',
'', $tvakey);
1336 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1338 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT1", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT1", $mysoc->country_code) :
'');
1341 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1342 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1343 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1344 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1352 foreach ($this->localtax2 as $localtax_type => $localtax_rate)
1354 if (in_array((
string) $localtax_type, array(
'2',
'4',
'6')))
continue;
1356 foreach ($localtax_rate as $tvakey => $tvaval)
1364 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1367 if (preg_match(
'/\*/', $tvakey))
1369 $tvakey = str_replace(
'*',
'', $tvakey);
1370 $tvacompl =
" (".$outputlangs->transnoentities(
"NonPercuRecuperable").
")";
1372 $totalvat = $outputlangs->transcountrynoentities(
"TotalLT2", $mysoc->country_code).(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transcountrynoentities(
"TotalLT2", $mysoc->country_code) :
'');
1375 $totalvat .=
vatrate(abs($tvakey), 1).$tvacompl;
1376 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $totalvat, 0,
'L', 1);
1378 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1379 $pdf->MultiCell($largcol2, $tab2_hl,
price($tvaval, 0, $outputlangs), 0,
'R', 1);
1387 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1388 $pdf->SetTextColor(0, 0, 60);
1389 $pdf->SetFillColor(224, 224, 224);
1390 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"TotalTTC").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"TotalTTC") :
''), $useborder,
'L', 1);
1392 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1393 $pdf->MultiCell($largcol2, $tab2_hl,
price($total_ttc, 0, $outputlangs), $useborder,
'R', 1);
1397 $pdf->SetTextColor(0, 0, 0);
1405 if ($deja_regle > 0)
1410 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1411 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"AlreadyPaid").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"AlreadyPaid") :
''), 0,
'L', 0);
1413 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1414 $pdf->MultiCell($largcol2, $tab2_hl,
price($deja_regle, 0, $outputlangs), 0,
'R', 0);
1433 $pdf->SetTextColor(0, 0, 60);
1434 $pdf->SetFillColor(224, 224, 224);
1435 $pdf->SetXY($col1x, $tab2_top + $tab2_hl * $index);
1436 $pdf->MultiCell($col2x - $col1x, $tab2_hl, $outputlangs->transnoentities(
"RemainderToPay").(is_object($outputlangsbis) ?
' / '.$outputlangsbis->transnoentities(
"RemainderToPay") :
''), $useborder,
'L', 1);
1438 $pdf->SetXY($col2x, $tab2_top + $tab2_hl * $index);
1439 $pdf->MultiCell($largcol2, $tab2_hl,
price($resteapayer, 0, $outputlangs), $useborder,
'R', 1);
1441 $pdf->SetFont(
'',
'', $default_font_size - 1);
1442 $pdf->SetTextColor(0, 0, 0);
1446 return ($tab2_top + ($tab2_hl * $index));
1464 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0, $currency =
'', $outputlangsbis = null)
1470 if ($hidetop) $hidetop = -1;
1472 $currency = !empty($currency) ? $currency : $conf->currency;
1476 $pdf->SetTextColor(0, 0, 0);
1477 $pdf->SetFont(
'',
'', $default_font_size - 2);
1479 if (empty($hidetop))
1481 $titre = $outputlangs->transnoentities(
"AmountInCurrency", $outputlangs->transnoentitiesnoconv(
"Currency".$currency));
1482 if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
1483 $titre .=
' - '.$outputlangsbis->transnoentities(
"AmountInCurrency", $outputlangsbis->transnoentitiesnoconv(
"Currency".$currency));
1486 $pdf->SetXY($this->page_largeur - $this->marge_droite - ($pdf->GetStringWidth($titre) + 3), $tab_top - 4);
1487 $pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
1490 if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
1491 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight,
'F', null, explode(
',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
1495 $pdf->SetDrawColor(128, 128, 128);
1496 $pdf->SetFont(
'',
'', $default_font_size - 1);
1499 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
1501 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
1503 if (empty($hidetop)) {
1504 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight);
1519 protected function _pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis = null)
1521 global $conf, $langs;
1524 $outputlangs->loadLangs(array(
"main",
"propal",
"companies",
"bills"));
1531 if ($object->statut == $object::STATUS_DRAFT && (!empty($conf->global->PROPALE_DRAFT_WATERMARK)))
1533 pdf_watermark($pdf, $outputlangs, $this->page_hauteur, $this->page_largeur,
'mm', $conf->global->PROPALE_DRAFT_WATERMARK);
1536 $pdf->SetTextColor(0, 0, 60);
1537 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1541 $posy = $this->marge_haute;
1542 $posx = $this->page_largeur - $this->marge_droite - $w;
1544 $pdf->SetXY($this->marge_gauche, $posy);
1547 if (empty($conf->global->PDF_DISABLE_MYCOMPANY_LOGO))
1549 if ($this->emetteur->logo)
1551 $logodir = $conf->mycompany->dir_output;
1552 if (!empty($conf->mycompany->multidir_output[$object->entity])) $logodir = $conf->mycompany->multidir_output[$object->entity];
1553 if (empty($conf->global->MAIN_PDF_USE_LARGE_LOGO))
1555 $logo = $logodir.
'/logos/thumbs/'.$this->emetteur->logo_small;
1557 $logo = $logodir.
'/logos/'.$this->emetteur->logo;
1559 if (is_readable($logo)) {
1561 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
1563 $pdf->SetTextColor(200, 0, 0);
1564 $pdf->SetFont(
'',
'B', $default_font_size - 2);
1565 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
1566 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
1569 $text = $this->emetteur->name;
1570 $pdf->MultiCell($w, 4, $outputlangs->convToOutputCharset($text), 0,
'L');
1574 $pdf->SetFont(
'',
'B', $default_font_size + 3);
1575 $pdf->SetXY($posx, $posy);
1576 $pdf->SetTextColor(0, 0, 60);
1577 $title = $outputlangs->transnoentities(
"PdfCommercialProposalTitle");
1578 $pdf->MultiCell($w, 4, $title,
'',
'R');
1580 $pdf->SetFont(
'',
'B', $default_font_size);
1583 $pdf->SetXY($posx, $posy);
1584 $pdf->SetTextColor(0, 0, 60);
1585 $textref = $outputlangs->transnoentities(
"Ref").
" : ".$outputlangs->convToOutputCharset($object->ref);
1586 if ($object->statut == $object::STATUS_DRAFT)
1588 $pdf->SetTextColor(128, 0, 0);
1589 $textref .=
' - '.$outputlangs->transnoentities(
"NotValidated");
1591 $pdf->MultiCell($w, 4, $textref,
'',
'R');
1594 $pdf->SetFont(
'',
'', $default_font_size - 2);
1596 if ($object->ref_client)
1599 $pdf->SetXY($posx, $posy);
1600 $pdf->SetTextColor(0, 0, 60);
1601 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefCustomer").
" : ".$outputlangs->convToOutputCharset($object->ref_client),
'',
'R');
1604 if (!empty($conf->global->PDF_SHOW_PROJECT_TITLE))
1606 $object->fetch_projet();
1607 if (!empty($object->project->ref))
1610 $pdf->SetXY($posx, $posy);
1611 $pdf->SetTextColor(0, 0, 60);
1612 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Project").
" : ".(empty($object->project->title) ?
'' : $object->projet->title),
'',
'R');
1616 if (!empty($conf->global->PDF_SHOW_PROJECT))
1618 $object->fetch_projet();
1619 if (!empty($object->project->ref))
1622 $pdf->SetXY($posx, $posy);
1623 $pdf->SetTextColor(0, 0, 60);
1624 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"RefProject").
" : ".(empty($object->project->ref) ?
'' : $object->projet->ref),
'',
'R');
1629 $pdf->SetXY($posx, $posy);
1630 $pdf->SetTextColor(0, 0, 60);
1631 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date($object->date,
"day",
false, $outputlangs,
true),
'',
'R');
1634 $pdf->SetXY($posx, $posy);
1635 $pdf->SetTextColor(0, 0, 60);
1637 $title = $outputlangs->transnoentities(
"DateEndPropal");
1638 if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
1639 $title .=
' - '.$outputlangsbis->transnoentities(
"DateEndPropal");
1641 $pdf->MultiCell($w, 3, $title.
" : ".
dol_print_date($object->fin_validite,
"day",
false, $outputlangs,
true),
'',
'R');
1643 if ($object->thirdparty->code_client)
1646 $pdf->SetXY($posx, $posy);
1647 $pdf->SetTextColor(0, 0, 60);
1648 $pdf->MultiCell($w, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities($object->thirdparty->code_client),
'',
'R');
1652 if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP))
1654 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1655 if (count($arrayidcontact) > 0)
1657 $usertmp =
new User($this->
db);
1658 $usertmp->fetch($arrayidcontact[0]);
1660 $pdf->SetXY($posx, $posy);
1661 $pdf->SetTextColor(0, 0, 60);
1662 $pdf->MultiCell($w, 3, $langs->transnoentities(
"SalesRepresentative").
" : ".$usertmp->getFullName($langs),
'',
'R');
1670 $current_y = $pdf->getY();
1671 $posy =
pdf_writeLinkedObjects($pdf, $object, $outputlangs, $posx, $posy, $w, 3,
'R', $default_font_size);
1672 if ($current_y < $pdf->getY())
1674 $top_shift = $pdf->getY() - $current_y;
1680 $carac_emetteur =
'';
1682 $arrayidcontact = $object->getIdContact(
'internal',
'SALESREPFOLL');
1683 if (count($arrayidcontact) > 0)
1685 $object->fetch_user($arrayidcontact[0]);
1686 $labelbeforecontactname = ($outputlangs->transnoentities(
"FromContactName") !=
'FromContactName' ? $outputlangs->transnoentities(
"FromContactName") : $outputlangs->transnoentities(
"Name"));
1687 $carac_emetteur .= ($carac_emetteur ?
"\n" :
'').$labelbeforecontactname.
" ".$outputlangs->convToOutputCharset($object->user->getFullName($outputlangs)).
"\n";
1690 $carac_emetteur .=
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty,
'', 0,
'source', $object);
1693 $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
1694 $posy += $top_shift;
1695 $posx = $this->marge_gauche;
1696 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->page_largeur - $this->marge_droite - 80;
1698 $hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
1699 $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
1702 $pdf->SetTextColor(0, 0, 0);
1703 $pdf->SetFont(
'',
'', $default_font_size - 2);
1704 $pdf->SetXY($posx, $posy - 5);
1705 $pdf->MultiCell(66, 5, $outputlangs->transnoentities(
"BillFrom").
":", 0,
'L');
1706 $pdf->SetXY($posx, $posy);
1707 $pdf->SetFillColor(230, 230, 230);
1708 $pdf->MultiCell($widthrecbox, $hautcadre,
"", 0,
'R', 1);
1709 $pdf->SetTextColor(0, 0, 60);
1712 $pdf->SetXY($posx + 2, $posy + 3);
1713 $pdf->SetFont(
'',
'B', $default_font_size);
1714 $pdf->MultiCell($widthrecbox - 2, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
1715 $posy = $pdf->getY();
1718 $pdf->SetXY($posx + 2, $posy);
1719 $pdf->SetFont(
'',
'', $default_font_size - 1);
1720 $pdf->MultiCell($widthrecbox - 2, 4, $carac_emetteur, 0,
'L');
1724 $usecontact =
false;
1725 $arrayidcontact = $object->getIdContact(
'external',
'CUSTOMER');
1726 if (count($arrayidcontact) > 0)
1729 $result = $object->fetch_contact($arrayidcontact[0]);
1733 if ($usecontact && ($object->contact->fk_soc != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT)))) {
1734 $thirdparty = $object->contact;
1736 $thirdparty = $object->thirdparty;
1741 $carac_client =
pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact :
''), $usecontact,
'target', $object);
1744 $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
1745 if ($this->page_largeur < 210) $widthrecbox = 84;
1746 $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
1747 $posy += $top_shift;
1748 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
1749 if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) $posx = $this->marge_gauche;
1752 $pdf->SetTextColor(0, 0, 0);
1753 $pdf->SetFont(
'',
'', $default_font_size - 2);
1754 $pdf->SetXY($posx + 2, $posy - 5);
1755 $pdf->MultiCell($widthrecbox, 5, $outputlangs->transnoentities(
"BillTo").
":", 0,
'L');
1756 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
1759 $pdf->SetXY($posx + 2, $posy + 3);
1760 $pdf->SetFont(
'',
'B', $default_font_size);
1761 $pdf->MultiCell($widthrecbox, 2, $carac_client_name, 0,
'L');
1763 $posy = $pdf->getY();
1766 $pdf->SetFont(
'',
'', $default_font_size - 1);
1767 $pdf->SetXY($posx + 2, $posy);
1768 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
1771 $pdf->SetTextColor(0, 0, 0);
1785 protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
1788 $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
1789 return pdf_pagefoot($pdf, $outputlangs,
'PROPOSAL_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
1805 $tab_top = $posy + 4;
1809 $largcol = ($this->page_largeur - $this->marge_droite - $posx);
1813 $pdf->SetFillColor(255, 255, 255);
1814 $pdf->SetXY($posx, $tab_top + 0);
1815 $pdf->SetFont(
'',
'', $default_font_size - 2);
1816 $pdf->MultiCell($largcol, $tab_hl, $outputlangs->transnoentities(
"ProposalCustomerSignature"), 0,
'L', 1);
1818 $pdf->SetXY($posx, $tab_top + $tab_hl);
1819 $pdf->MultiCell($largcol, $tab_hl * 3,
'', 1,
'R');
1820 if (!empty($conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING)) {
1821 $pdf->addEmptySignatureAppearance($posx, $tab_top + $tab_hl, $largcol, $tab_hl * 3);
1824 return ($tab_hl * 7);
1838 public function defineColumnField($object, $outputlangs, $hidedetails = 0, $hidedesc = 0, $hideref = 0)
1840 global $conf, $hookmanager;
1843 $this->defaultContentsFieldsStyle = array(
1845 'padding' => array(1, 0.5, 1, 0.5),
1849 $this->defaultTitlesFieldsStyle = array(
1851 'padding' => array(0.5, 0, 0.5, 0),
1873 $this->cols[
'desc'] = array(
1878 'textkey' =>
'Designation',
1882 'padding' => array(0.5, 0.5, 0.5, 0.5),
1886 'padding' => array(1, 0.5, 1, 1.5),
1892 $this->cols[
'photo'] = array(
1894 'width' => (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH),
1897 'textkey' =>
'Photo',
1901 'padding' => array(0, 0, 0, 0),
1903 'border-left' =>
false,
1906 if (!empty($conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE) && !empty($this->atleastonephoto))
1908 $this->cols[
'photo'][
'status'] =
true;
1913 $this->cols[
'vat'] = array(
1920 'border-left' =>
true,
1923 if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN))
1925 $this->cols[
'vat'][
'status'] =
true;
1929 $this->cols[
'subprice'] = array(
1934 'textkey' =>
'PriceUHT'
1936 'border-left' =>
true,
1941 $nblines = count($object->lines);
1942 for ($i = 0; $i < $nblines; $i++) {
1944 $tmpwidth = max($tmpwidth, $tmpwidth2);
1946 if ($tmpwidth > 10) {
1947 $this->cols[
'subprice'][
'width'] += (2 * ($tmpwidth - 10));
1951 $this->cols[
'qty'] = array(
1958 'border-left' =>
true,
1962 $this->cols[
'unit'] = array(
1969 'border-left' =>
true,
1971 if (!empty($conf->global->PRODUCT_USE_UNITS)) {
1972 $this->cols[
'unit'][
'status'] =
true;
1976 $this->cols[
'discount'] = array(
1981 'textkey' =>
'ReductionShort'
1983 'border-left' =>
true,
1985 if ($this->atleastonediscount) {
1986 $this->cols[
'discount'][
'status'] =
true;
1989 $rank = $rank + 1000;
1990 $this->cols[
'totalexcltax'] = array(
1993 'status' => empty($conf->global->PDF_PROPAL_HIDE_PRICE_EXCL_TAX) ?
true :
false,
1995 'textkey' =>
'TotalHT'
1997 'border-left' =>
true,
2000 $rank = $rank + 1010;
2001 $this->cols[
'totalincltax'] = array(
2004 'status' => empty($conf->global->PDF_PROPAL_SHOW_PRICE_INCL_TAX) ?
false :
true,
2006 'textkey' =>
'TotalTTC'
2008 'border-left' =>
true,
2012 if (!empty($object->lines)) {
2013 $line = reset($object->lines);
2017 $parameters = array(
2018 'object' => $object,
2019 'outputlangs' => $outputlangs,
2020 'hidedetails' => $hidedetails,
2021 'hidedesc' => $hidedesc,
2022 'hideref' => $hideref
2025 $reshook = $hookmanager->executeHooks(
'defineColumnField', $parameters, $this);
2029 } elseif (empty($reshook))
2031 $this->cols = array_replace($this->cols, $hookmanager->resArray);
2033 $this->cols = $hookmanager->resArray;
pdf_getFormat(Translate $outputlangs=null, $mode= 'setup')
Return array with format properties of default PDF format.
pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber=0, $default_font_size=10)
Show bank informations for PDF generation.
getExtrafieldContent($object, $extrafieldKey)
get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note...
dol_string_nohtmltag($stringtoclean, $removelinefeed=1, $pagecodeto= 'UTF-8', $strip_tags=0, $removedoublespaces=1)
Clean a string from all HTML tags and entities.
__construct($db)
Constructor.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
Put here description of your class.
_pagehead(&$pdf, $object, $showaddress, $outputlangs, $outputlangsbis=null)
Show top header of page.
</td > param sortfield sortorder printFieldListOption< tdclass="liste_titremaxwidthsearchright"></td ></tr >< trclass="liste_titre">< inputtype="checkbox"onClick="toggle(this)"/> Ref p ref Label p label Duration p duration center DesiredStock p desiredstock right StockLimitShort p seuil_stock_alerte right stock_physique right stock_real_warehouse right Ordered right StockToBuy right SupplierRef right param sortfield sortorder printFieldListTitle warehouseinternal SELECT description FROM product_lang WHERE qty< br > qty qty qty StockTooLow StockTooLow help help help< trclass="oddeven">< td >< inputtype="checkbox"class="check"name="choose'.$i.'"></td >< tdclass="nowrap"> stock</td >< td >< inputtype="hidden"name="desc'.$i.'"value="'.dol_escape_htmltag($objp-> description
Only used if Module[ID]Desc translation string is not found.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
Class to manage products or services.
printColDescContent($pdf, &$curY, $colKey, $object, $i, $outputlangs, $hideref=0, $hidedesc=0, $issupplierline=0)
print description column content
Class to manage Dolibarr users.
defineColumnExtrafield($object, $outputlangs, $hidedetails=0)
Define Array Column Field for extrafields.
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...
write_file($object, $outputlangs, $srctemplatepath= '', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
printStdColumnContent($pdf, &$curY, $colKey, $columnText= '')
print standard column content
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_getlineunit($object, $i, $outputlangs, $hidedetails=0, $hookmanager=false)
Return line unit.
$conf db name
Only used if Module[ID]Name translation string is not found.
Classe mere des modeles de propale.
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...
$conf db
API class for accounts.
Class to manage bank accounts.
drawPaymentsTable(&$pdf, $object, $posy, $outputlangs)
Show payments table.
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...
getColumnStatus($colKey)
get column status from column key
pdf_getlinetotalexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line total excluding tax.
pdf_getlinevatrate($object, $i, $outputlangs, $hidedetails=0)
Return line vat rate.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
pdf_getlineqty($object, $i, $outputlangs, $hidedetails=0)
Return line quantity.
pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
Print standard column content.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0)
Show footer of page for PDF generation.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
pdf_getlineupexcltax($object, $i, $outputlangs, $hidedetails=0)
Return line unit price excluding tax.
pdfGetHeightForHtmlContent(&$pdf, $htmlcontent)
Function to try to calculate height of a HTML Content.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart= '')
Return a path to have a the directory according to object where files are stored. ...
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
drawInfoTable(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
Class to manage translations.
dol_sanitizeFileName($str, $newstr= '_', $unaccent=1)
Clean a string to use it as a file name.
pdf_getlineremisepercent($object, $i, $outputlangs, $hidedetails=0)
Return line remise percent.
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
convertBackOfficeMediasLinksToPublicLinks($notetoshow)
Convert links to local wrapper to medias files into a string into a public external URL readable on i...
vatrate($rate, $addpercent=false, $info_bits=0, $usestarfornpr=0)
Return a string with VAT rate label formated for view output Used into pdf and HTML pages...
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
pdf_getInstance($format= '', $metric= 'mm', $pagetype= 'P')
Return a PDF instance object.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany= '', $targetcontact= '', $usecontact=0, $mode= 'source', $object=null)
Return a string with full address formated for output on documents.
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
drawSignatureArea(&$pdf, $object, $posy, $outputlangs)
Show area for the customer to sign.
make_substitutions($text, $substitutionarray, $outputlangs=null)
Make substitution into a text string, replacing keys with vals from $substitutionarray (oldval=>newva...
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0, $currency= '', $outputlangsbis=null)
Show table for lines.
getLocalTaxesFromRate($vatrate, $local, $buyer, $seller, $firstparamisid=0)
Get type and rate of localtaxes for a particular vat rate/country of a thirdparty.
Class to generate PDF proposal Cyan.
drawTotalTable(&$pdf, $object, $deja_regle, $posy, $outputlangs)
Show total to pay.
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)
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...
pdf_getlinetotalwithtax($object, $i, $outputlangs, $hidedetails=0)
Return line total including tax.