Merge pull request #15026 from atm-john/10.0_fix_expensereport_pagebreak_on_pdf
Fix page break on expense report pdf
This commit is contained in:
commit
b9aee876e9
@ -361,32 +361,18 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
$curY = $nexY;
|
$curY = $nexY;
|
||||||
$pdf->startTransaction();
|
$pdf->startTransaction();
|
||||||
$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
|
$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
|
||||||
$pageposafter=$pdf->getPage();
|
$pageposafter=$pdf->getPage();
|
||||||
if ($pageposafter > $pageposbefore) {
|
if ($pageposafter > $pageposbefore) {
|
||||||
// There is a pagebreak
|
// There is a pagebreak
|
||||||
$pdf->rollbackTransaction(true);
|
$pdf->rollbackTransaction(true);
|
||||||
$pageposafter = $pageposbefore;
|
|
||||||
//print $pageposafter.'-'.$pageposbefore;exit;
|
$pdf->AddPage('', '', true);
|
||||||
|
$pdf->setPage($pageposbefore+1);
|
||||||
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
$pdf->setPageOrientation('', 1, $heightforfooter); // The only function to edit the bottom margin of current page to set it.
|
||||||
$this->printLine($pdf, $object, $i, $curY, $default_font_size, $outputlangs, $hidedetails);
|
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
||||||
$pageposafter = $pdf->getPage();
|
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
||||||
$posyafter = $pdf->GetY();
|
|
||||||
//var_dump($posyafter); var_dump(($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))); exit;
|
$this->printLine($pdf, $object, $i, $tab_top_newpage, $default_font_size, $outputlangs, $hidedetails);
|
||||||
if ($posyafter > ($this->page_hauteur - ($heightforfooter+$heightforfreetext+$heightforinfotot))) {
|
|
||||||
// There is no space left for total+free text
|
|
||||||
if ($i == ($nblignes-1)) {
|
|
||||||
// No more lines, and no space left to show total, so we create a new page
|
|
||||||
$pdf->AddPage('', '', true);
|
|
||||||
if (! empty($tplidx)) $pdf->useTemplate($tplidx);
|
|
||||||
if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) $this->_pagehead($pdf, $object, 0, $outputlangs);
|
|
||||||
$pdf->setPage($pageposafter+1);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// We found a page break
|
|
||||||
$showpricebeforepagebreak=0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else // No pagebreak
|
else // No pagebreak
|
||||||
{
|
{
|
||||||
@ -554,7 +540,7 @@ class pdf_standard extends ModeleExpenseReport
|
|||||||
{
|
{
|
||||||
global $conf;
|
global $conf;
|
||||||
$pdf->SetFont('', '', $default_font_size - 1);
|
$pdf->SetFont('', '', $default_font_size - 1);
|
||||||
|
$pdf->SetTextColor(0, 0, 0);
|
||||||
// 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, $linenumber + 1, 0, 1);
|
$pdf->writeHTMLCell($this->posxcomment-$this->posxpiece-0.8, 4, $this->posxpiece-1, $curY, $linenumber + 1, 0, 1);
|
||||||
|
|||||||
@ -1664,6 +1664,7 @@ class TCPDF_FONTS {
|
|||||||
* @public static
|
* @public static
|
||||||
*/
|
*/
|
||||||
public static function unichr($c, $unicode=true) {
|
public static function unichr($c, $unicode=true) {
|
||||||
|
$c = intval($c);
|
||||||
if (!$unicode) {
|
if (!$unicode) {
|
||||||
return chr($c);
|
return chr($c);
|
||||||
} elseif ($c <= 0x7F) {
|
} elseif ($c <= 0x7F) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user