33 require_once DOL_DOCUMENT_ROOT.
'/core/modules/delivery/modules_delivery.php';
34 require_once DOL_DOCUMENT_ROOT.
'/delivery/class/delivery.class.php';
35 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
36 require_once DOL_DOCUMENT_ROOT.
'/core/lib/pdf.lib.php';
62 public $update_main_doc_field;
73 public $version =
'dolibarr';
83 global $langs, $mysoc;
86 $langs->loadLangs(array(
"main",
"bills",
"sendings",
"companies"));
89 $this->
name =
"Storm";
90 $this->
description = $langs->trans(
"DocumentModelStorm");
91 $this->update_main_doc_field = 1;
96 $this->page_largeur = $formatarray[
'width'];
97 $this->page_hauteur = $formatarray[
'height'];
98 $this->format = array($this->page_largeur, $this->page_hauteur);
104 $this->option_logo = 1;
105 $this->option_tva = 1;
108 $this->emetteur = $mysoc;
109 if (empty($this->emetteur->country_code)) {
110 $this->emetteur->country_code = substr($langs->defaultlang, -2);
127 public function write_file(
$object, $outputlangs, $srctemplatepath =
'', $hidedetails = 0, $hidedesc = 0, $hideref = 0)
130 global $user, $langs, $conf, $mysoc, $hookmanager;
132 if (!is_object($outputlangs)) {
133 $outputlangs = $langs;
137 $outputlangs->charset_output =
'ISO-8859-1';
141 $outputlangs->loadLangs(array(
"main",
"dict",
"companies",
"bills",
"products",
"sendings",
"deliveries"));
143 if ($conf->expedition->dir_output) {
148 $dir = $conf->expedition->dir_output.
"/receipt";
149 $file = $dir.
"/SPECIMEN.pdf";
152 $dir = $conf->expedition->dir_output.
"/receipt/".$objectref;
153 $file = $dir.
"/".$objectref.
".pdf";
156 if (!file_exists($dir)) {
158 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
163 if (file_exists($dir)) {
165 if (!is_object($hookmanager)) {
166 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
169 $hookmanager->initHooks(array(
'pdfgeneration'));
170 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
172 $reshook = $hookmanager->executeHooks(
'beforePDFCreation', $parameters,
$object, $action);
174 $nblines = count(
$object->lines);
178 $realpatharray = array();
179 $this->atleastonephoto =
false;
181 $objphoto =
new Product($this->db);
183 for ($i = 0; $i < $nblines; $i++) {
184 if (empty(
$object->lines[$i]->fk_product)) {
188 $objphoto->fetch(
$object->lines[$i]->fk_product);
192 $pdir[0] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
193 $pdir[1] =
get_exdir(0, 0, 0, 0, $objphoto,
'product').dol_sanitizeFileName($objphoto->ref).
'/';
195 $pdir[0] =
get_exdir(0, 0, 0, 0, $objphoto,
'product');
196 $pdir[1] =
get_exdir($objphoto->id, 2, 0, 0, $objphoto,
'product').$objphoto->id.
"/photos/";
200 foreach ($pdir as $midir) {
202 $dir = $conf->product->dir_output.
'/'.$midir;
204 foreach ($objphoto->liste_photos($dir, 1) as $key => $obj) {
206 if ($obj[
'photo_vignette']) {
207 $filename = $obj[
'photo_vignette'];
209 $filename = $obj[
'photo'];
212 $filename = $obj[
'photo'];
215 $realpath = $dir.$filename;
217 $this->atleastonephoto =
true;
222 if ($realpath && $arephoto) {
223 $realpatharray[$i] = $realpath;
232 $heightforinfotot = 30;
233 $heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5);
234 $heightforfooter = $this->marge_basse + 8;
236 $heightforfooter += 6;
238 $pdf->SetAutoPageBreak(1, 0);
240 if (class_exists(
'TCPDF')) {
241 $pdf->setPrintHeader(
false);
242 $pdf->setPrintFooter(
false);
247 $pagecount = $pdf->setSourceFile($conf->mycompany->dir_output.
'/' .
getDolGlobalString(
'MAIN_ADD_PDF_BACKGROUND'));
248 $tplidx = $pdf->importPage(1);
253 $result = $expedition->fetch(
$object->origin_id);
255 $commande =
new Commande($this->db);
256 if ($expedition->origin ==
'commande') {
257 $commande->fetch($expedition->origin_id);
260 $object->commande->loadExpeditions();
265 $pdf->SetDrawColor(128, 128, 128);
267 $pdf->SetTitle($outputlangs->convToOutputCharset(
$object->ref));
268 $pdf->SetSubject($outputlangs->transnoentities(
"DeliveryOrder"));
269 $pdf->SetCreator(
"Dolibarr ".DOL_VERSION);
270 $pdf->SetAuthor($outputlangs->convToOutputCharset($user->getFullName($outputlangs)));
271 $pdf->SetKeyWords($outputlangs->convToOutputCharset(
$object->ref).
" ".$outputlangs->transnoentities(
"DeliveryOrder"));
273 $pdf->SetCompression(
false);
277 $pdf->SetMargins($this->marge_gauche, $this->marge_haute, $this->marge_droite);
282 if (!empty($tplidx)) {
283 $pdf->useTemplate($tplidx);
287 $pdf->SetFont(
'',
'', $default_font_size - 1);
288 $pdf->MultiCell(0, 3,
'');
289 $pdf->SetTextColor(0, 0, 0);
292 $tab_top_newpage = (!
getDolGlobalInt(
'MAIN_PDF_DONOTREPEAT_HEAD') ? 42 : 10);
294 $tab_height = $this->page_hauteur - $tab_top - $heightforfooter - $heightforfreetext;
296 $this->posxdesc = $this->marge_gauche + 1;
299 $height_incoterms = 0;
301 $desc_incoterms =
$object->getIncotermsForPDF();
302 if ($desc_incoterms) {
305 $pdf->SetFont(
'',
'', $default_font_size - 1);
306 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top - 1,
dol_htmlentitiesbr($desc_incoterms), 0, 1);
307 $nexY = $pdf->GetY();
308 $height_incoterms = $nexY - $tab_top;
311 $pdf->SetDrawColor(192, 192, 192);
312 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_incoterms + 1);
314 $tab_top = $nexY + 6;
315 $height_incoterms += 4;
320 $notetoshow = empty(
$object->note_public) ?
'' :
$object->note_public;
323 $extranote = $this->getExtrafieldsInHtml(
$object, $outputlangs);
324 if (!empty($extranote)) {
328 if (!empty($notetoshow)) {
329 $tab_top = 88 + $height_incoterms;
331 $pdf->SetFont(
'',
'', $default_font_size - 1);
332 $pdf->writeHTMLCell(190, 3, $this->posxdesc - 1, $tab_top,
dol_htmlentitiesbr($notetoshow), 0, 1);
333 $nexY = $pdf->GetY();
334 $height_note = $nexY - $tab_top;
337 $pdf->SetDrawColor(192, 192, 192);
338 $pdf->Rect($this->marge_gauche, $tab_top - 1, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $height_note + 1);
340 $tab_height = $tab_height - $height_note;
341 $tab_top = $nexY + 6;
350 $pdf->startTransaction();
351 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, 0);
352 $pdf->rollbackTransaction(
true);
354 $iniY = $tab_top + $this->tabTitleHeight + 2;
355 $curY = $tab_top + $this->tabTitleHeight + 2;
356 $nexY = $tab_top + $this->tabTitleHeight + 2;
359 for ($i = 0; $i < $nblines; $i++) {
361 if (empty(
$object->lines[$i]->array_options)) {
362 $object->lines[$i]->fetch_optionals();
366 $pdf->SetFont(
'',
'', $default_font_size - 1);
367 $pdf->SetTextColor(0, 0, 0);
370 $imglinesize = array();
371 if (!empty($realpatharray[$i])) {
376 $pdf->setTopMargin($tab_top_newpage);
377 $pdf->setPageOrientation(
'', 1, $heightforfooter + $heightforfreetext + $heightforinfotot);
378 $pageposbefore = $pdf->getPage();
381 $curX = $this->posxdesc - 1;
383 $showpricebeforepagebreak = 1;
386 $posYAfterDescription = 0;
389 if (isset($imglinesize[
'width']) && isset($imglinesize[
'height']) && ($curY + $imglinesize[
'height']) > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
390 $pdf->AddPage(
'',
'',
true);
391 if (!empty($tplidx)) {
392 $pdf->useTemplate($tplidx);
395 $pdf->setPage($pageposbefore + 1);
397 $curY = $tab_top_newpage;
401 $showpricebeforepagebreak = 1;
403 $showpricebeforepagebreak = 0;
408 if (!empty($this->cols[
'photo']) && isset($imglinesize[
'width']) && isset($imglinesize[
'height'])) {
409 $pdf->Image($realpatharray[$i], $this->
getColumnContentXStart(
'photo'), $curY + 1, $imglinesize[
'width'], $imglinesize[
'height'],
'',
'',
'', 2, 300);
411 $posYAfterImage = $curY + $imglinesize[
'height'];
418 $pdf->startTransaction();
420 $pageposafter = $pdf->getPage();
421 if ($pageposafter > $pageposbefore) {
422 $pdf->rollbackTransaction(
true);
423 $pageposafter = $pageposbefore;
425 $pdf->setPageOrientation(
'', 1, $heightforfooter);
427 $posyafter = $pdf->GetY();
428 if ($posyafter > ($this->page_hauteur - ($heightforfooter + $heightforfreetext + $heightforinfotot))) {
429 if ($i == ($nblines - 1)) {
430 $pdf->AddPage(
'',
'',
true);
431 if (!empty($tplidx)) {
432 $pdf->useTemplate($tplidx);
437 $pdf->setPage($pageposafter + 1);
443 $showpricebeforepagebreak = 1;
445 $showpricebeforepagebreak = 0;
449 $pdf->commitTransaction();
452 $posYAfterDescription = $pdf->GetY();
455 $nexY = $pdf->GetY();
456 $pageposafter = $pdf->getPage();
457 $pdf->setPage($pageposbefore);
458 $pdf->setTopMargin($this->marge_haute);
459 $pdf->setPageOrientation(
'', 1, 0);
462 if ($pageposafter > $pageposbefore && empty($showpricebeforepagebreak)) {
463 $pdf->setPage($pageposafter);
464 $curY = $tab_top_newpage;
467 $pdf->SetFont(
'',
'', $default_font_size - 1);
473 $nexY = max($pdf->GetY(), $nexY);
478 $qtyRemaining =
$object->lines[$i]->qty_asked -
$object->commande->expeditions[
$object->lines[$i]->fk_origin_line];
480 $nexY = max($pdf->GetY(), $nexY);
483 $nexY = max($nexY, $posYAfterImage);
486 if (!empty(
$object->lines[$i]->array_options)) {
487 foreach (
$object->lines[$i]->array_options as $extrafieldColKey => $extrafieldValue) {
491 $nexY = max($pdf->GetY(), $nexY);
498 $pdf->setPage($pageposafter);
499 $pdf->SetLineStyle(array(
'dash' =>
'1,1',
'color' => array(80, 80, 80)));
501 $pdf->line($this->marge_gauche, $nexY + 1, $this->page_largeur - $this->marge_droite, $nexY + 1);
502 $pdf->SetLineStyle(array(
'dash' => 0));
508 while ($pagenb < $pageposafter) {
509 $pdf->setPage($pagenb);
511 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
513 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
517 $pdf->setPage($pagenb);
518 $pdf->setPageOrientation(
'', 1, 0);
522 if (!empty($tplidx)) {
523 $pdf->useTemplate($tplidx);
526 if (isset(
$object->lines[$i + 1]->pagebreak) &&
$object->lines[$i + 1]->pagebreak) {
528 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforfooter, 0, $outputlangs, 0, 1);
530 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforfooter, 0, $outputlangs, 1, 1);
535 if (!empty($tplidx)) {
536 $pdf->useTemplate($tplidx);
547 $this->
_tableau($pdf, $tab_top, $this->page_hauteur - $tab_top - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 0, 0);
548 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
550 $this->
_tableau($pdf, $tab_top_newpage, $this->page_hauteur - $tab_top_newpage - $heightforinfotot - $heightforfreetext - $heightforfooter, 0, $outputlangs, 1, 0);
551 $bottomlasttab = $this->page_hauteur - $heightforinfotot - $heightforfreetext - $heightforfooter + 1;
560 if (method_exists($pdf,
'AliasNbPages')) {
561 $pdf->AliasNbPages();
566 $pdf->Output($file,
'F');
569 if (!is_object($hookmanager)) {
570 include_once DOL_DOCUMENT_ROOT.
'/core/class/hookmanager.class.php';
573 $hookmanager->initHooks(array(
'pdfgeneration'));
574 $parameters = array(
'file' => $file,
'object' =>
$object,
'outputlangs' => $outputlangs);
576 $reshook = $hookmanager->executeHooks(
'afterPDFCreation', $parameters, $this, $action);
578 $this->error = $hookmanager->error;
579 $this->errors = $hookmanager->errors;
584 $this->result = array(
'fullpath' => $file);
588 $this->error = $langs->transnoentities(
"ErrorCanNotCreateDir", $dir);
593 $this->error = $langs->transnoentities(
"ErrorConstantNotDefined",
"LIVRAISON_OUTPUTDIR");
611 global $conf, $mysoc;
614 $pdf->SetFont(
'',
'', $default_font_size);
615 $pdf->SetXY($this->marge_gauche, $posy);
617 $larg_sign = ($this->page_largeur - $this->marge_gauche - $this->marge_droite) / 3;
618 $pdf->Rect($this->marge_gauche, $posy + 1, $larg_sign, 25);
619 $pdf->SetXY($this->marge_gauche + 2, $posy + 2);
620 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"For").
' '.$outputlangs->convToOutputCharset($mysoc->name).
":",
'',
'L');
622 $pdf->Rect(2 * $larg_sign + $this->marge_gauche, $posy + 1, $larg_sign, 25);
623 $pdf->SetXY(2 * $larg_sign + $this->marge_gauche + 2, $posy + 2);
624 $pdf->MultiCell($larg_sign, 2, $outputlangs->trans(
"ForCustomer").
':',
'',
'L');
641 protected function _tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop = 0, $hidebottom = 0)
654 $pdf->SetTextColor(0, 0, 0);
655 $pdf->SetFont(
'',
'', $default_font_size - 2);
657 if (empty($hidetop)) {
660 $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, 5,
'F',
null, explode(
',',
getDolGlobalString(
'MAIN_PDF_TITLE_BACKGROUND_COLOR')));
664 $pdf->SetDrawColor(128, 128, 128);
665 $pdf->SetFont(
'',
'', $default_font_size - 1);
668 $this->
printRect($pdf, $this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_gauche - $this->marge_droite, $tab_height, $hidetop, $hidebottom);
671 $this->
pdfTabTitles($pdf, $tab_top, $tab_height, $outputlangs, $hidetop);
673 if (empty($hidetop)) {
674 $pdf->line($this->marge_gauche, $tab_top + $this->tabTitleHeight, $this->page_largeur - $this->marge_droite, $tab_top + $this->tabTitleHeight);
690 global $conf, $langs;
701 $pdf->SetTextColor(0, 0, 60);
702 $pdf->SetFont(
'',
'B', $default_font_size + 3);
704 $posy = $this->marge_haute;
705 $posx = $this->page_largeur - $this->marge_droite - 100;
707 $pdf->SetXY($this->marge_gauche, $posy);
710 $logo = $conf->mycompany->dir_output.
'/logos/'.$this->emetteur->logo;
711 if ($this->emetteur->logo) {
712 if (is_readable($logo)) {
714 $pdf->Image($logo, $this->marge_gauche, $posy, 0, $height);
716 $pdf->SetTextColor(200, 0, 0);
717 $pdf->SetFont(
'',
'B', $default_font_size - 2);
718 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorLogoFileNotFound", $logo), 0,
'L');
719 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"ErrorGoToGlobalSetup"), 0,
'L');
722 $pdf->MultiCell(100, 4, $this->emetteur->name, 0,
'L');
725 $pdf->SetFont(
'',
'B', $default_font_size + 2);
726 $pdf->SetXY($posx, $posy);
727 $pdf->SetTextColor(0, 0, 60);
728 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"DeliveryOrder").
" ".$outputlangs->convToOutputCharset(
$object->ref),
'',
'R');
730 $pdf->SetFont(
'',
'', $default_font_size + 2);
733 $pdf->SetXY($posx, $posy);
734 $pdf->SetTextColor(0, 0, 60);
736 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"Date").
" : ".
dol_print_date(
$object->date_delivery,
"%d %b %Y",
false, $outputlangs,
true),
'',
'R');
738 $pdf->SetTextColor(255, 0, 0);
739 $pdf->MultiCell(100, 4, $outputlangs->transnoentities(
"DeliveryNotValidated"),
'',
'R');
740 $pdf->SetTextColor(0, 0, 60);
743 if (
$object->thirdparty->code_client) {
745 $pdf->SetXY($posx, $posy);
746 $pdf->SetTextColor(0, 0, 60);
747 $pdf->MultiCell(100, 3, $outputlangs->transnoentities(
"CustomerCode").
" : ".$outputlangs->transnoentities(
$object->thirdparty->code_client),
'',
'R');
750 $pdf->SetTextColor(0, 0, 60);
763 $posx = $this->marge_gauche;
765 $posx = $this->page_largeur - $this->marge_droite - 80;
770 $pdf->SetTextColor(0, 0, 0);
771 $pdf->SetFont(
'',
'', $default_font_size - 2);
772 $pdf->SetXY($posx, $posy - 5);
773 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"BillFrom"), 0,
'L');
774 $pdf->SetXY($posx, $posy);
775 $pdf->SetFillColor(230, 230, 230);
776 $pdf->MultiCell(82, $hautcadre,
"", 0,
'R', 1);
777 $pdf->SetTextColor(0, 0, 60);
780 $pdf->SetXY($posx + 2, $posy + 3);
781 $pdf->SetFont(
'',
'B', $default_font_size);
782 $pdf->MultiCell(80, 4, $outputlangs->convToOutputCharset($this->emetteur->name), 0,
'L');
783 $posy = $pdf->getY();
786 $pdf->SetXY($posx + 2, $posy);
787 $pdf->SetFont(
'',
'', $default_font_size - 1);
788 $pdf->MultiCell(80, 4, $carac_emetteur, 0,
'L');
794 $posx = $this->marge_gauche;
796 $pdf->SetTextColor(0, 0, 0);
797 $pdf->SetFont(
'',
'', $default_font_size - 2);
798 $pdf->SetXY($posx, $posy - 5);
799 $pdf->MultiCell(80, 5, $outputlangs->transnoentities(
"DeliveryAddress"), 0,
'L');
803 $arrayidcontact =
$object->commande->getIdContact(
'external',
'SHIPPING');
804 if (count($arrayidcontact) > 0) {
806 $result =
$object->fetch_contact($arrayidcontact[0]);
810 if ($usecontact && (
$object->contact->socid !=
$object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) ||
getDolGlobalString(
'MAIN_USE_COMPANY_NAME_OF_CONTACT')))) {
811 $thirdparty =
$object->contact;
813 $thirdparty =
$object->thirdparty;
822 if ($this->page_largeur < 210) {
826 $posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
828 $posx = $this->marge_gauche;
832 $pdf->SetTextColor(0, 0, 0);
833 $pdf->SetFont(
'',
'', $default_font_size - 2);
834 $pdf->SetXY($posx + 2, $posy - 5);
836 $pdf->Rect($posx, $posy, $widthrecbox, $hautcadre);
839 $pdf->SetXY($posx + 2, $posy + 3);
840 $pdf->SetFont(
'',
'B', $default_font_size);
841 $pdf->MultiCell($widthrecbox, 4, $carac_client_name, 0,
'L');
843 $posy = $pdf->getY();
846 $pdf->SetFont(
'',
'', $default_font_size - 1);
847 $pdf->SetXY($posx + 2, $posy);
848 $pdf->MultiCell($widthrecbox, 4, $carac_client, 0,
'L');
851 $pdf->SetTextColor(0, 0, 60);
868 $showdetails =
getDolGlobalInt(
'MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS', 0);
869 return pdf_pagefoot($pdf, $outputlangs,
'DELIVERY_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur,
$object, $showdetails, $hidefreetext);
886 global $conf, $hookmanager;
889 $this->defaultContentsFieldsStyle = array(
891 'padding' => array(0.5, 0.5, 0.5, 0.5),
895 $this->defaultTitlesFieldsStyle = array(
897 'padding' => array(0.5, 0, 0.5, 0),
919 $this->cols[
'desc'] = array(
924 'textkey' =>
'Designation',
928 'padding' => array(0.5, 0.5, 0.5, 0.5),
936 $this->cols[
'photo'] = array(
941 'textkey' =>
'Photo',
945 'padding' => array(0, 0, 0, 0),
947 'border-left' =>
false,
950 if (
getDolGlobalString(
'MAIN_GENERATE_DELIVERY_WITH_PICTURE') && !empty($this->atleastonephoto)) {
951 $this->cols[
'photo'][
'status'] =
true;
956 $this->cols[
'Comments'] = array(
961 'textkey' =>
'Comments'
963 'border-left' =>
true,
978 $this->cols[
'qty_shipped'] = array(
983 'textkey' =>
'QtyShippedShort'
985 'border-left' =>
true,
989 $this->cols[
'qty_remaining'] = array(
994 'textkey' =>
'KeepToShipShort'
996 'border-left' =>
true,
1002 $line = reset(
$object->lines);
1006 $parameters = array(
1008 'outputlangs' => $outputlangs,
1009 'hidedetails' => $hidedetails,
1010 'hidedesc' => $hidedesc,
1011 'hideref' => $hideref
1014 $reshook = $hookmanager->executeHooks(
'defineColumnField', $parameters, $this);
1017 } elseif (empty($reshook)) {
1019 $this->cols = array_replace($this->cols, $hookmanager->resArray);
1021 $this->cols = $hookmanager->resArray;
if($user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Class to manage customers orders.
prepareArrayColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Prepare Array Column Field.
getColumnStatus($colKey)
get column status from column key
printStdColumnContent($pdf, &$curY, $colKey, $columnText='')
print standard column content
pdfTabTitles(&$pdf, $tab_top, $tab_height, $outputlangs, $hidetop=0)
Print standard column content.
getColumnContentXStart($colKey)
get column content X (abscissa) left position from column key
printRect($pdf, $x, $y, $l, $h, $hidetop=0, $hidebottom=0)
Rect pdf.
getColumnContentWidth($colKey)
get column content width from column key
getExtrafieldContent($object, $extrafieldKey, $outputlangs=null)
get extrafield content for pdf writeHtmlCell compatibility usage for PDF line columns and object note...
defineColumnExtrafield($object, $outputlangs, $hidedetails=0)
Define Array Column Field for extrafields.
Class to manage shipments.
Class mere des modeles de bon de livraison.
Class to manage products or services.
Class to build Delivery Order documents with storm model.
defineColumnField($object, $outputlangs, $hidedetails=0, $hidedesc=0, $hideref=0)
Define Array Column Field.
_tableau_info(&$pdf, $object, $posy, $outputlangs)
Show miscellaneous information (payment mode, payment term, ...)
_tableau(&$pdf, $tab_top, $tab_height, $nexY, $outputlangs, $hidetop=0, $hidebottom=0)
Show table for lines.
__construct($db)
Constructor.
_pagehead(&$pdf, $object, $showaddress, $outputlangs)
Show top header of page.
_pagefoot(&$pdf, $object, $outputlangs, $hidefreetext=0)
Show footer of page.
write_file($object, $outputlangs, $srctemplatepath='', $hidedetails=0, $hidedesc=0, $hideref=0)
Function to build pdf onto disk.
print *****$script_file(".$version.") pid cd cd cd description as description
Only used if Module[ID]Desc translation string is not found.
dolChmod($filepath, $newmask='')
Change mod of a file.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_concatdesc($text1, $text2, $forxml=false, $invert=false)
Concat 2 descriptions with a new line between them (second operand after first one with appropriate n...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart='')
Return a path to have a the directory according to object where files are stored.
dol_mkdir($dir, $dataroot='', $newmask='')
Creation of a directory (this can create recursive subdir)
pdf_getSizeForImage($realpath)
Return dimensions to use for images onto PDF checking that width and height are not higher than maxim...
pdf_writelinedesc(&$pdf, $object, $i, $outputlangs, $w, $h, $posx, $posy, $hideref=0, $hidedesc=0, $issupplierline=0, $align='J')
Output line description into PDF.
pdf_getPDFFontSize($outputlangs)
Return font size to use for PDF generation.
pdf_getFormat(Translate $outputlangs=null, $mode='setup')
Return array with format properties of default PDF format.
pdf_getHeightForLogo($logo, $url=false)
Return height to use for Logo onto PDF.
pdf_pagefoot(&$pdf, $outputlangs, $paramfreetext, $fromcompany, $marge_basse, $marge_gauche, $page_hauteur, $object, $showdetails=0, $hidefreetext=0, $page_largeur=0, $watermark='')
Show footer of page for PDF generation.
pdf_pagehead(&$pdf, $outputlangs, $page_height)
Show header of page for PDF generation.
pdf_writeLinkedObjects(&$pdf, $object, $outputlangs, $posx, $posy, $w, $h, $align, $default_font_size)
Show linked objects for PDF generation.
pdf_getPDFFont($outputlangs)
Return font name to use for PDF generation.
pdf_build_address($outputlangs, $sourcecompany, $targetcompany='', $targetcontact='', $usecontact=0, $mode='source', $object=null)
Return a string with full address formatted for output on PDF documents.
pdf_getInstance($format='', $metric='mm', $pagetype='P')
Return a PDF instance object.
pdfBuildThirdpartyName($thirdparty, Translate $outputlangs, $includealias=0)
Returns the name of the thirdparty.
pdf_watermark(&$pdf, $outputlangs, $h, $w, $unit, $text)
Add a draft watermark on PDF files.
if(preg_match('/crypted:/i', $dolibarr_main_db_pass)||!empty($dolibarr_main_db_encrypted_pass)) $conf db type
$conf db name
Only used if Module[ID]Name translation string is not found.