From 198a6c9c1b8837cd5beae3f14fd3314f7d4fa11c Mon Sep 17 00:00:00 2001 From: Tolotsoa Date: Fri, 5 Sep 2025 16:05:41 +0300 Subject: [PATCH] fix change attestation bijoux --- gestion/lib/Controller/PageController.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 9f503c2..54adbee 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -2858,7 +2858,6 @@ class PageController extends Controller { * @param string $numdefunt */ public function saveRapportBijoux($numdefunt,$withPhotos = false, $email = ''){ - if($withPhotos != null && $withPhotos == 1){ $withPhotos = true; } @@ -2886,7 +2885,6 @@ class PageController extends Controller { $this->storage->newFolder($folderDestination); } catch(\OCP\Files\NotPermittedException $e) { } - // TODO: init pdf $pdf = new FPDF(); // $pdf->AddFont('Arial','','Comic Sans MS.php'); @@ -2903,14 +2901,11 @@ class PageController extends Controller { } $pdf->SetY(45); $pdf->SetFont('Arial', 'B', 15); $pdf->Cell(0, 10, utf8_decode(html_entity_decode("ATTESTATION BIJOU(X)")), 0, 0, 'C'); - - $pdf->SetMargins(15,15,15); $pdf->SetY(65); $pdf->SetFont('Arial', '', 10); - $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Je soussignée ".$defunt->prenom_thanato." ".strtoupper($defunt->nom_thanato).", Thanatopracteur, agissant pour le compte de la société ".strtoupper($defaultConfig[0]->entreprise)." titulaire de l'habilitation n° ".$defunt->reference_habilitation." atteste par la présente que : - ".(strcmp($defunt->sexe, 'm')==0 ? 'Monsieur' : 'Madame').". ".$defunt->nom_defunt." + "." ".$defunt->nom_defunt." a été pris(e) en charge par nos services pour des soins mortuaires.")), '','J',0); $pdf->setY($pdf->GetY()+10); @@ -2941,11 +2936,9 @@ class PageController extends Controller { $pdf->SetFont('Arial', '', 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('Arial', '', 10); - $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->commentaire)), 'LTRB', 'L'); if($hasTaker){ $pdf->SetXY($col_width+75, $pdf->GetY()-8); $pdf->SetFont('Arial', '', 10); - $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($bijou->taker_name)), 'LTRB', 'L'); } } @@ -2986,7 +2979,7 @@ class PageController extends Controller { $pdf->SetFont('Arial', '', 10); $pdf->MultiCell(0, 5, FileExportHelpers::FormatTextForExport("Cette attestation est remise pour faire valoir ce que de droit. - Fait à ".$defaultConfig[0]->adresse.", le ".$today), '','J',0); + Fait sur le lieu du soin ".$defaultConfig[0]->adresse.", le ".$today), '','J',0); $pdf->setY($pdf->GetY()+10); @@ -2995,17 +2988,21 @@ class PageController extends Controller { $pdf->Cell( $pdf->GetPageWidth()-30, 0, utf8_decode(html_entity_decode($defaultConfig[0]->nom).' '.html_entity_decode($defaultConfig[0]->prenom)), 0, 0, 'L'); $pdf->setY($pdf->GetY()+5); + $signatureExist = $this->signatureImageExists('sign.jpg'); + if ($signatureExist) { + $pdf->Image($this->defaultImagePath."sign.jpg", 5, $pdf->GetY(), 60, 40); + } + $signatureExist = $this->signatureImageExists('sign.png'); if ($signatureExist) { - $pdf->Image($this->defaultImagePath."sign.png", 5, $pdf->GetY(), 60, 40); + // Placer sign.png en bas de sign.jpg (position Y + hauteur de sign.jpg) + $pdf->Image($this->defaultImagePath."sign.png", 5, $pdf->GetY() + 40, 60, 40); } $pdf->setY($pdf->GetY()-5); $pdf->SetFont('Arial','',11); $pdf->Cell( $pdf->GetPageWidth()-80, 0, "Pour :", 0, 0, 'R'); - $pdf->SetY(-15); $pdf->SetFont('Arial', '', 8); - $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode($defaultConfig[0]->legal_one)), 0, 'C'); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode($defaultConfig[0]->adresse)), 0,'C');