From d4a2b1dbe8097305f282b97ccb9c1c6367f73f05 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Thu, 13 Feb 2025 12:47:03 +0300 Subject: [PATCH 1/5] logo disposition on hytha 35 --- gestion/lib/Controller/PageController.php | 4 ++-- .../Certificate/PdfHandler/CareCertificatePdfHandler.php | 2 +- .../PdfHandler/PacemakerCertificatePdfHandler.php | 2 +- gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php | 2 +- gestion/lib/Service/InvoicePdfHandler.php | 2 +- gestion/lib/Service/InvoiceRecap/InvoiceRecapService.php | 8 ++++---- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index cacf7be..5050df3 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -2029,7 +2029,7 @@ class PageController extends Controller { // logo : 80 de largeur et 55 de hauteur $logo = $this->getLogo(); if($logo != 'nothing'){ - $pdf->Image($this->defaultImagePath."logo.png", 15, 15, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } $pdf->setXY(15, 15); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("N : ".$numFacture)), '', 'R'); @@ -2292,7 +2292,7 @@ class PageController extends Controller { // logo : 80 de largeur et 55 de hauteur $logo = $this->getLogo(); if($logo != 'nothing'){ - $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } $pdf->SetY(45); $pdf->SetFont('ComicSans', 'B', 15); $pdf->Cell(0, 10, utf8_decode(html_entity_decode("ATTESTATION BIJOU(X)")), 0, 0, 'C'); diff --git a/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php b/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php index f752512..78b9201 100644 --- a/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php +++ b/gestion/lib/Service/Certificate/PdfHandler/CareCertificatePdfHandler.php @@ -42,7 +42,7 @@ class CareCertificatePdfHandler extends FPDF { function Header() { if($this->logo != "nothing"){ - $this->Image($this->imagePath."logo.png", 10, 10,50,35); + $this->Image($this->imagePath."logo.png", 10, 10, 75, 25); } else{ $this->Cell(55,30,''); diff --git a/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php b/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php index 67acc1a..fef775d 100644 --- a/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php +++ b/gestion/lib/Service/Certificate/PdfHandler/PacemakerCertificatePdfHandler.php @@ -42,7 +42,7 @@ class PacemakerCertificatePdfHandler extends FPDF { function Header() { if($this->logo != "nothing"){ - $this->Image($this->imagePath."logo.png", 10, 10, 50,35); + $this->Image($this->imagePath."logo.png", 10, 10, 75, 25); } else{ $this->Cell(55,30,''); diff --git a/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php b/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php index 812c95b..7d5552b 100644 --- a/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php +++ b/gestion/lib/Service/Devis/Pdf/DevisPdfHandler.php @@ -40,7 +40,7 @@ class DevisPdfHandler extends FPDF { function Header() { if($this->logo != "nothing"){ - $this->Image($this->logoPath."logo.png", 2, 2, 50,35); + $this->Image($this->logoPath."logo.png", 10, 10, 75, 25); } else{ $this->Cell(55,30,''); diff --git a/gestion/lib/Service/InvoicePdfHandler.php b/gestion/lib/Service/InvoicePdfHandler.php index 6ecefe6..4ed361c 100644 --- a/gestion/lib/Service/InvoicePdfHandler.php +++ b/gestion/lib/Service/InvoicePdfHandler.php @@ -45,7 +45,7 @@ class InvoicePdfHandler extends FPDF { function Header() { if($this->logo != "nothing"){ - $this->Image($this->logoPath."logo.png", 2, 2, 50,35); + $this->Image($this->logoPath."logo.png", 10, 10, 75, 25); } else{ $this->Cell(55,30,''); diff --git a/gestion/lib/Service/InvoiceRecap/InvoiceRecapService.php b/gestion/lib/Service/InvoiceRecap/InvoiceRecapService.php index 74ae8eb..95b3492 100644 --- a/gestion/lib/Service/InvoiceRecap/InvoiceRecapService.php +++ b/gestion/lib/Service/InvoiceRecap/InvoiceRecapService.php @@ -171,7 +171,7 @@ class InvoiceRecapService { // logo : 80 de largeur et 55 de hauteur if($doesLogoExist){ - $pdf->Image($this->defaultImagePath."logo.png", 2, 2, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } //adresse de mon entreprise @@ -276,7 +276,7 @@ class InvoiceRecapService { $pdf->SetMargins(0,0,10); if($doesLogoExist){ - $pdf->Image($this->defaultImagePath."logo.png", 2, 2, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } //adresse de mon entreprise @@ -579,7 +579,7 @@ class InvoiceRecapService { // logo : 80 de largeur et 55 de hauteur if($doesLogoExist){ - $pdf->Image($this->defaultImagePath."logo.png", 2, 2, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } //adresse de mon entreprise @@ -682,7 +682,7 @@ class InvoiceRecapService { $pdf->SetAutoPagebreak(False); $pdf->SetMargins(0,0,10); if($doesLogoExist){ - $pdf->Image($this->defaultImagePath."logo.png", 2, 2, 50,35); + $pdf->Image($this->defaultImagePath."logo.png", 10, 10, 75, 25); } //adresse de mon entreprise From a1a431e9268efd2f0ccd3e84d6e10ca5acccbca4 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Thu, 13 Feb 2025 12:48:47 +0300 Subject: [PATCH 2/5] document comptable when update date paiement on facture --- gestion/lib/Controller/PageController.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 5050df3..5dd64eb 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -1465,8 +1465,8 @@ class PageController extends Controller { $datecourant = $facturecourant->date_paiement; $nouveaudate = $data; $result = $this->myDb->gestion_update($table, $column, $data, $id, $this->idNextcloud); - $this->generer_document_comptable($datecourant); - $this->generer_document_comptable($nouveaudate); + // $this->generer_document_comptable($datecourant); + // $this->generer_document_comptable($nouveaudate); } else { if(strcmp($column, 'date')==0) { if(strcmp($table, 'facture')){ From 0680890dfd0fa5d6955ab263a0836b48de669bca Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 14 Feb 2025 10:48:54 +0300 Subject: [PATCH 3/5] finish rapport soin, wip rapport soin et rapport bijou --- gestion/lib/Controller/PageController.php | 56 +++++++++++++++-------- gestion/lib/Helpers/FileExportHelpers.php | 20 +++++++- 2 files changed, 57 insertions(+), 19 deletions(-) diff --git a/gestion/lib/Controller/PageController.php b/gestion/lib/Controller/PageController.php index 5dd64eb..879e514 100644 --- a/gestion/lib/Controller/PageController.php +++ b/gestion/lib/Controller/PageController.php @@ -2039,10 +2039,34 @@ class PageController extends Controller { $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->adresse.", le ".$today), '', 'R'); - $pdf->SetY($pdf->GetY()+15); - $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode($nomDefunt."\n".$age."ans\n".(strcmp($defunt->sexe, 'm')==0 ? 'Masculin' : 'Féminin'))), '', 'L'); - $pdf->SetY($pdf->GetY()-15); - $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Éffectuées le ".$date_devis."\nà ".$defunt->adresse_lieu."\nde ".$defunt->heure_debut." à ".$defunt->heure_fin)), '', 'R'); + $rapportInfoHeaderY = $pdf->GetY() + 15; + $rapportDefuntInfoY = $rapportInfoHeaderY; + $rapportDevisInfoY = $rapportInfoHeaderY; + $pdf->SetY(y: $rapportDefuntInfoY); + $pdf->SetFont('ComicSans', '', 10); + $pdf->Cell(0,5,FileExportHelpers::FormatTextForExport($nomDefunt)); + $rapportDefuntInfoY += 5; + $pdf->SetY($rapportDefuntInfoY); + $pdf->Cell(0,5,FileExportHelpers::FormatTextForExport($age. " ans")); + $rapportDefuntInfoY += 5; + $pdf->SetY($rapportDefuntInfoY); + $sexeText = strcmp($defunt->sexe, 'm')==0 ? 'Masculin' : 'Féminin'; + $pdf->Cell(0,5,FileExportHelpers::FormatTextForExport($sexeText)); + + //devis info + $rapportDevisInfoX = 115; + $maxWidth = $pdf->GetPageWidth(); + $availableWidhtForDevisInfo = $maxWidth - 10 - $rapportDevisInfoX; + $pdf->SetXY($rapportDevisInfoX,$rapportDevisInfoY); + $pdf->MultiCell(0,5,FileExportHelpers::FormatTextForExport("Éffectuées le ".$date_devis)); + $rapportDevisInfoY += 5; + $pdf->SetXY($rapportDevisInfoX,$rapportDevisInfoY); + $addressText = "à ".$defunt->adresse_lieu; + $pdf->MultiCell(0,5,FileExportHelpers::FormatTextForExport($addressText),0,'L'); + $addressLineCount = FileExportHelpers::GetLineCountForATextInAMaxWidth($pdf,$addressText,$availableWidhtForDevisInfo); + $rapportDevisInfoY += 5 * $addressLineCount; + $pdf->SetXY($rapportDevisInfoX,$rapportDevisInfoY); + $pdf->Cell(0,5,FileExportHelpers::FormatTextForExport("de ".$defunt->heure_debut." à ".$defunt->heure_fin)); $pdf->SetY($pdf->GetY()+10); $pdf->Line(15, $pdf->GetY(), $pdf->GetPageWidth()-15, $pdf->GetY()); @@ -2053,14 +2077,14 @@ class PageController extends Controller { $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Rigidité : ".$defunt->rigidite)), '', 'L'); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Observations du corps : ".$defunt->observations_corps)), '', 'L'); - $pdf->SetY($pdf->GetY()+10); + $pdf->SetY($pdf->GetY()+5); $pdf->SetFont('ComicSans', 'B', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("ACCÈS")), '', 'L'); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Arteriel : ".$defunt->acces)), '', 'L'); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("Recherche : ".$defunt->acces_recherche)), '', 'L'); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("État : ".$defunt->acces_etat)), '', 'L'); - $pdf->SetY($pdf->GetY()+10); + $pdf->SetY($pdf->GetY()+5); $pdf->SetFont('ComicSans', 'B', 10); $pdf->MultiCell(0, 5, utf8_decode(html_entity_decode("INJECTION")), '', 'L'); $pdf->SetY($pdf->GetY()+3); @@ -2098,9 +2122,8 @@ class PageController extends Controller { $pdf->SetXY(($col_width*2)+15, $pdf->GetY()-8); $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($defunt->drainage_etat)), 'LR', 'C'); $pdf->Line(15, $pdf->GetY(), $pdf->GetPageWidth()-15, $pdf->GetY()); - $pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_two), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->telephone), '', 'C'); + $pdf->SetY(-20); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); + $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->adresse), '', 'C'); $pdf->AddPage(); @@ -2165,9 +2188,8 @@ class PageController extends Controller { $col_width = round(($pdf->GetPageWidth()-30)/2); foreach ($observations as $key => $obs) { if($pdf->getY()>=($pdf->GetPageHeight()-45)) { - $pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_two), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->telephone), '', 'C'); + $pdf->SetY(-20); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); + $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->adresse), '', 'C'); $pdf->AddPage(); } $pdf->SetFont('ComicSans', '', 10); $pdf->MultiCell($col_width, 8, utf8_decode(html_entity_decode($obs->designation)), 'LTRB', 'L'); @@ -2177,9 +2199,8 @@ class PageController extends Controller { $pdf->setY($pdf->GetY()+10); if($pdf->getY()>=($pdf->GetPageHeight()-45)) { - $pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_two), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->telephone), '', 'C'); + $pdf->SetY(-20); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); + $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->adresse), '', 'C'); $pdf->AddPage(); } @@ -2197,9 +2218,8 @@ class PageController extends Controller { $pdf->setY($pdf->GetY()-5); $pdf->SetFont('ComicSans','',11); $pdf->Cell( $pdf->GetPageWidth()-80, 0, "Pour :", 0, 0, 'R'); - $pdf->SetY(-30); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_two), '', 'C'); - $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->telephone), '', 'C'); + $pdf->SetY(-20); $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->legal_one), '', 'C'); + $pdf->SetFont('ComicSans', '', 8); $pdf->MultiCell($pdf->GetPageWidth()-30, 5, FileExportHelpers::FormatTextForExport($defaultConfig[0]->adresse), '', 'C'); $pdf->AddPage(); $pdf->Image($this->src_path.(($defunt->sexe=='m'?'facehomme.jpg':'facefemme.jpg')), 0, 0, $pdf->GetPageWidth(), $pdf->GetPageHeight()); diff --git a/gestion/lib/Helpers/FileExportHelpers.php b/gestion/lib/Helpers/FileExportHelpers.php index f9446ae..fc44786 100644 --- a/gestion/lib/Helpers/FileExportHelpers.php +++ b/gestion/lib/Helpers/FileExportHelpers.php @@ -7,7 +7,8 @@ class FileExportHelpers public static function FormatTextForExport(string $text){ - $textFormatted = utf8_decode(html_entity_decode($text)); + $textFormatted = str_replace('‘', "'", $text); + $textFormatted = utf8_decode(html_entity_decode($textFormatted)); return $textFormatted; } @@ -67,4 +68,21 @@ class FileExportHelpers return $defuntFolder.'PACEMAKER/'; } + public static function GetLineCountForATextInAMaxWidth($pdf,$text,$maxWidth){ + $words = explode(' ', $text); + $lineWidth = 0; + $lineCount = 1; + + foreach ($words as $word) { + $wordWidth = $pdf->GetStringWidth($word . ' '); + if ($lineWidth + $wordWidth > $maxWidth) { + $lineCount++; + $lineWidth = $wordWidth; + } else { + $lineWidth += $wordWidth; + } + } + return $lineCount; + } + } From a00dd3add6e60112eddc34f2f9ae418e0aa0aa6b Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 14 Feb 2025 10:54:42 +0300 Subject: [PATCH 4/5] finish bouton rapport bijou and soin on top , wip remove age and sexe in defunt list and add devis date --- gestion/templates/content/defuntshow.php | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/gestion/templates/content/defuntshow.php b/gestion/templates/content/defuntshow.php index 0513e38..85e808f 100644 --- a/gestion/templates/content/defuntshow.php +++ b/gestion/templates/content/defuntshow.php @@ -21,11 +21,13 @@
+

Aperçu du défunt

-

Aperçu du défunt

+ +

@@ -486,10 +488,6 @@

-
- - -