diff --git a/htdocs/core/lib/pdf.lib.php b/htdocs/core/lib/pdf.lib.php index 3e9d1b4acff..96f9bbb2aca 100644 --- a/htdocs/core/lib/pdf.lib.php +++ b/htdocs/core/lib/pdf.lib.php @@ -908,7 +908,7 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, $pdf->line($curx + 1, $cury + 1, $curx + 1, $cury + 6); } - + $bank_number_length = 0; foreach ($account->getFieldsToShow() as $val) { $pdf->SetXY($curx, $cury + 4); $pdf->SetFont('', '', $default_font_size - 3); @@ -938,6 +938,10 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, break; } + if ($content == '') { + continue; + } + $pdf->MultiCell($tmplength, 3, $outputlangs->convToOutputCharset($content), 0, 'C', false); $pdf->SetXY($curx, $cury + 1); $curx += $tmplength; @@ -946,10 +950,13 @@ function pdf_bank(&$pdf, $outputlangs, $curx, $cury, $account, $onlynumber = 0, if (empty($onlynumber)) { $pdf->line($curx, $cury + 1, $curx, $cury + 7); } + + // Only set this variable when table was printed + $bank_number_length = 8; } $curx = $savcurx; - $cury += 8; + $cury += $bank_number_length; } } elseif (!empty($account->number)) { $pdf->SetFont('', 'B', $default_font_size - $diffsizecontent);