Commit f2b0c1fd authored by Quentin Ribac's avatar Quentin Ribac
Browse files

FIX #18589 TIME 1:00 displaying recipientLabel correctly in deposit pdf

parent 9f0488e8
......@@ -1057,13 +1057,19 @@ 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] . ')';
}
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);
}
......
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