From a15e908b76e0c82bbee56aff2326506bbd2fddf9 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Thu, 13 Mar 2025 11:57:25 +0300 Subject: [PATCH] Update jewelry report formatting and button label for clarity --- gestion/lib/Controller/PageController.php | 25 +++++++++++++++++------ gestion/templates/content/defuntshow.php | 4 ++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 3b89353..38343c1 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -2372,24 +2372,37 @@ class PageController extends Controller { $pdf->setY($pdf->GetY()+10); + $hasTaker = false; + foreach ($bijoux as $key => $bijou) { + $currentBijouHasTaker = $bijou->taker_name != null && $bijou->taker_name != "" && $bijou->taker_name != "-"; + if($currentBijouHasTaker){ + $hasTaker = true; + break; + } + } + $columnNumber = $hasTaker ? 3 : 2; $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("À la suite de notre prise en charge, une liste des bijoux appartenant au défunt a été établie comme suit :")), '','J',0); $pdf->setY($pdf->GetY()+5); - $col_width = round(($pdf->GetPageWidth()-30)/3); + $col_width = round(($pdf->GetPageWidth()-30)/$columnNumber); $pdf->SetFont('ComicSans', 'B', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode("Désignation")), 'LTRB', 'C'); $pdf->SetXY($col_width+15, $pdf->GetY()-8); $pdf->SetFont('ComicSans', 'B', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode("Commentaire")), 'LTRB', 'C'); - $pdf->SetXY($col_width+75, $pdf->GetY()-8); - $pdf->SetFont('ComicSans', 'B', 10); - $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode("Qui a récupéré le bijou")), 'LTRB', 'C'); + if($hasTaker){ + $pdf->SetXY($col_width+75, $pdf->GetY()-8); + $pdf->SetFont('ComicSans', 'B', 10); + $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode("Prise en charge des bijoux par")), 'LTRB', 'C'); + } foreach ($bijoux as $key => $bijou) { $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->designation)), 'LTRB', 'L'); $pdf->SetXY($col_width+15, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->commentaire)), 'LTRB', 'L'); - $pdf->SetXY($col_width+75, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); - $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->taker_name)), 'LTRB', 'L'); + if($hasTaker){ + $pdf->SetXY($col_width+75, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); + $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->taker_name)), 'LTRB', 'L'); + } } $photosCount = 0; if($withPhotos){ diff --git a/gestion/templates/content/defuntshow.php b/gestion/templates/content/defuntshow.php index b0e129b..f3898bd 100644 --- a/gestion/templates/content/defuntshow.php +++ b/gestion/templates/content/defuntshow.php @@ -25,7 +25,7 @@ $coverProducts = $_['coverProducts'];
- +
@@ -489,7 +489,7 @@ $coverProducts = $_['coverProducts']; Désignation t('Comment')); ?> t('Photo')); ?> - t('Nom de la personne qui a récupéré ces bijoux')); ?> + t('Prise en charge des bijoux par')); ?> Actions