diff --git a/htdocs/core/modules/contract/doc/pdf_strato.modules.php b/htdocs/core/modules/contract/doc/pdf_strato.modules.php index be686377ce3..46364b23d0d 100644 --- a/htdocs/core/modules/contract/doc/pdf_strato.modules.php +++ b/htdocs/core/modules/contract/doc/pdf_strato.modules.php @@ -239,29 +239,9 @@ class pdf_strato extends ModelePDFContract $iniY = $tab_top + 7; $curY = $tab_top + 7; - $nexY = $tab_top + 7; + $nexY = $tab_top + 2; $pdf->SetXY($this->marge_gauche, $tab_top); - $pdf->MultiCell(190,8,$outputlangs->transnoentities("Description"),0,'L',0); - $pdf->line($this->marge_gauche, $tab_top + 8, $this->page_largeur-$this->marge_droite, $tab_top + 8); - - $pdf->SetFont('', '', $default_font_size - 1); - - $pdf->MultiCell(0, 3, ''); // Set interline to 3 - $pdf->SetXY($this->marge_gauche, $tab_top + 8); - $text=$object->description; - if ($object->duree > 0) - { - $totaltime=convertSecondToTime($object->duree,'all',$conf->global->MAIN_DURATION_OF_WORKDAY); - $text.=($text?' - ':'').$langs->trans("Total").": ".$totaltime; - } - $desc=dol_htmlentitiesbr($text,1); - //print $outputlangs->convToOutputCharset($desc); exit; - - $pdf->writeHTMLCell(180, 3, 10, $tab_top + 8, $outputlangs->convToOutputCharset($desc), 0, 1); - $nexY = $pdf->GetY(); - - $pdf->line($this->marge_gauche, $nexY, $this->page_largeur-$this->marge_droite, $nexY); $pdf->MultiCell(0, 2, ''); // Set interline to 3. Then writeMultiCell must use 3 also. @@ -285,7 +265,20 @@ class pdf_strato extends ModelePDFContract $pageposbefore=$pdf->getPage(); // Description of product line - $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true)." - ".$outputlangs->transnoentities("Duration")." : ".convertSecondToTime($objectligne->duration),1,$outputlangs->charset_output).''; + + if ($objectligne->datei) { + $datei = dol_print_date($objectligne->datei,'dayhour',false,$outputlangs,true); + } else { + $datei = $langs->trans("Unknown"); + } + + if ($objectligne->duration) { + $durationi = convertSecondToTime($objectligne->duration); + } else { + $durationi = $langs->trans("Unknown"); + } + + $txt=''.dol_htmlentitiesbr($outputlangs->transnoentities("Date")." : ".$datei." - ".$outputlangs->transnoentities("Duration")." : ".$durationi,1,$outputlangs->charset_output).''; $desc=dol_htmlentitiesbr($objectligne->desc,1); $pdf->writeHTMLCell(0, 0, $curX, $curY, dol_concatdesc($txt,$desc), 0, 1, 0); @@ -533,7 +526,7 @@ class pdf_strato extends ModelePDFContract $posy+=4; $pdf->SetXY($posx,$posy); $pdf->SetTextColor(0,0,60); - $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->datec,"day",false,$outputlangs,true), '', 'R'); + $pdf->MultiCell(100, 3, $outputlangs->transnoentities("Date")." : " . dol_print_date($object->date_creation,"day",false,$outputlangs,true), '', 'R'); if ($object->client->code_client) {