Commit 2c43d902 authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FIX #18589 TIME 0:10 display better recipient label in deposit list pdf

parent 94d45766
......@@ -1058,16 +1058,22 @@ class RegisteredMailController
$pdf->Cell(30, 10, mb_strimwidth($registeredMail['reference'], 0, 22, "...", "UTF-8"), 1, 0, 'C');
$pdf->setFont('times', '', 6);
if (strlen($recipient[1] . " " . $recipient[4] . " " . $recipient[6] . " " . $recipient[7]) > 60) {
$pdf->Cell(95, 10, $recipient[1], 1);
$recipientLabel = $recipient[2] ?? '';
if (empty($recipientLabel)) {
$recipientLabel = $recipient[1];
} elseif (!empty($recipient[1])) {
$recipientLabel .= ' (' . $recipient[1] . ')';
}
$recipientLabel = trim($recipientLabel);
if (strlen($recipientLabel . " " . $recipient[4] . " " . $recipient[6] . " " . $recipient[7]) > 60) {
$pdf->Cell(95, 10, $recipientLabel, 1);
$pdf->SetXY($pdf->GetX() - 95, $pdf->GetY() + 3);
$pdf->Cell(95, 10, $recipient[4] . " " . $recipient[6] . " " . $recipient[7], 0);
$pdf->SetXY($pdf->GetX() + 95, $pdf->GetY() - 3);
} else {
$pdf->Cell(95, 10, $recipient[1] . " " . $recipient[4] . " " . $recipient[6] . " " . $recipient[7], 1);
$pdf->Cell(95, 10, $recipientLabel . " " . $recipient[4] . " " . $recipient[6] . " " . $recipient[7], 1);
}
$pdf->Ln();
//contrôle du nb de reco présent sur la page. Si 16 lignes, changement de page et affichage du footer
if ($position % 12 >= 11) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment