fix nex line

This commit is contained in:
De Coninck Laurent 2017-02-08 19:00:48 +01:00
parent 49e6192e62
commit a042c30b28

View File

@ -284,7 +284,7 @@ class pdf_standard extends ModeleExpenseReport
} }
$iniY = $tab_top + 7; $iniY = $tab_top + 7;
$curY = $tab_top + 7; $initialY = $tab_top + 7;
$nexY = $tab_top + 7; $nexY = $tab_top + 7;
// Loop on each lines // Loop on each lines
@ -292,28 +292,25 @@ class pdf_standard extends ModeleExpenseReport
{ {
$piece_comptable = $i +1; $piece_comptable = $i +1;
$curY = $nexY;
$pdf->SetFont('','', $default_font_size - 2); // Into loop to work with multipage $pdf->SetFont('','', $default_font_size - 2); // Into loop to work with multipage
$pdf->SetTextColor(0,0,0); $pdf->SetTextColor(0,0,0);
$pdf->setTopMargin($tab_top_newpage); $pdf->setTopMargin($tab_top_newpage);
$pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it. $pdf->setPageOrientation('', 1, $heightforfooter+$heightforfreetext+$heightforinfotot); // The only function to edit the bottom margin of current page to set it.
$pageposbefore=$pdf->getPage(); $pageposbefore=$pdf->getPage();
$curY = $nexY;
// Description of product line
$curX = $this->posxcomment-1;
$showpricebeforepagebreak=1;
$pdf->SetFont('','', $default_font_size - 1); $pdf->SetFont('','', $default_font_size - 1);
// Accountancy piece // Accountancy piece
$pdf->SetXY($this->posxpiece, $curY); $pdf->SetXY($this->posxpiece, $curY);
$pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-0.8, 4, $this->posxpiece-1, $curY, $piece_comptable, 0, 1); $pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-0.8, 4, $this->posxpiece-1, $curY, $piece_comptable, 0, 1);
$curY = ($pdf->PageNo() > $pageposbefore) ? $pdf->GetY()-4 : $curY;
// Comments // Comments
$pdf->SetXY($this->posxcomment, $curY ); $pdf->SetXY($this->posxcomment, $curY );
$pdf->writeHTMLCell($this->posxdate-$this->posxcomment-0.8, 4, $this->posxcomment-1, $curY, $object->lines[$i]->comments, 0, 1); $pdf->writeHTMLCell($this->posxdate-$this->posxcomment-0.8, 4, $this->posxcomment-1, $curY, $object->lines[$i]->comments, 0, 1);
$curY = ($pdf->PageNo() > $pageposbefore) ? $pdf->GetY()-4 : $curY;
// Date // Date
$pdf->SetXY($this->posxdate -1, $curY); $pdf->SetXY($this->posxdate -1, $curY);
@ -378,11 +375,10 @@ class pdf_standard extends ModeleExpenseReport
$nbLineCommentNeed = dol_nboflines_bis($follow_comment,52,$outputlangs->charset_output); $nbLineCommentNeed = dol_nboflines_bis($follow_comment,52,$outputlangs->charset_output);
$nbLineTypeNeed = dol_nboflines_bis($follow_type,4,$outputlangs->charset_output); $nbLineTypeNeed = dol_nboflines_bis($follow_type,4,$outputlangs->charset_output);
//Which one need more lines $nblineFollowComment = max($nbLineCommentNeed, $nbLineTypeNeed);
$nblineFollowComment = ($nbLineCommentNeed > $nbLineTypeNeed) ? $nbLineCommentNeed : $nbLineTypeNeed;
} }
$nexY+=$nblineFollowComment*($pdf->getFontSize()+1); // Passe espace entre les lignes $nexY+=$nblineFollowComment*($pdf->getFontSize()*1.3); // Passe espace entre les lignes
// Detect if some page were added automatically and output _tableau for past pages // Detect if some page were added automatically and output _tableau for past pages
while ($pagenb < $pageposafter) while ($pagenb < $pageposafter)