From 0d4b17ae30e74384ed76f25fd9d8f70e4a47fd28 Mon Sep 17 00:00:00 2001 From: Narindra ezway Date: Tue, 15 Apr 2025 15:29:09 +0300 Subject: [PATCH] make-center-all text-in-table- and same-font --- gestion/lib/Db/Bdd.php | 1 - .../InvoiceFunecapPdfHandler.php | 2 +- .../InvoiceGroupPdfHandler.php | 40 +++++++++---------- 3 files changed, 21 insertions(+), 22 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index 9d260b8..d5438a5 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -3114,7 +3114,6 @@ class Bdd { $factureData["siret"] = $devis["group_siret_number"]; $factureData["group_name"] = $devis["group_name"] ?? ""; $templateType = $devis['fk_template_type_key'] ?? ClientTemplateTypeConstant::PRIVEES; - $templateType = $devis['code_comptable'] ?? '-'; $factureData["group_type"] = "group"; } diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php index 1274b0b..cc8bd30 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceFunecapPdfHandler.php @@ -73,7 +73,7 @@ class InvoiceFunecapPdfHandler extends InvoiceGroupPdfHandler { $productDescription .= " de " . $currentDevis["defunt_nom"] ?? ""; } $tvaAmount = $valueTtc - $valueHt; - $this->SetXY( 5,$yValue ); + $this->SetXY( 4.5,$yValue ); $this->Cell(5, 6, $dateValue, 0,0); $this->SetXY( 29,$yValue ); diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index c4b7857..a0c9090 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -84,7 +84,7 @@ class InvoiceGroupPdfHandler extends FPDF { $height = $originalHeight * $scale; // Calculer la position pour centrer l'image $x = (210 - $width) / 2 + 15; // Décalage à droite de 15 mm - $y = ((297 - $height) / 2 ) + 30; // 297 mm est la hauteur d'une page A4 + $y = ((297 - $height) / 2 ) + 25; // 297 mm est la hauteur d'une page A4 // Ajouter l'image en filigrane $this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur @@ -246,17 +246,17 @@ class InvoiceGroupPdfHandler extends FPDF { $factureDateEcheance->modify('last day of next month'); $factureDateEcheance = $factureDateEcheance->format('d-m-Y'); - $this->SetFont('ComicSans', '', 9); + $this->SetFont('ComicSans', '', 10); $this->Cell(25, 7, 'DATE', 1, 0, 'C'); $this->Cell(104, 7, 'CLIENT', 1, 0, 'C'); $this->Cell(39, 7, 'FACTURE', 1, 0, 'C'); $this->Cell(36, 7, 'ECHEANCE', 1, 1, 'C'); - $this->SetFont('ComicSans', '', 9); - $this->Cell(25, 11, $factureDatePaiement, 1, 0, 'C'); - $this->Cell(104, 11, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C'); - $this->Cell(39, 11, $this->factureData['num'], 1, 0, 'C'); - $this->Cell(36, 11, $factureDateEcheance, 1, 1, 'C'); + $this->SetFont('ComicSans', '', 10); + $this->Cell(25, 9, $factureDatePaiement, 1, 0, 'C'); + $this->Cell(104, 9, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C'); + $this->Cell(39, 9, $this->factureData['num'], 1, 0, 'C'); + $this->Cell(36, 9, $factureDateEcheance, 1, 1, 'C'); $this->startingYOfArticlesTable = $startInvoiceInfoTable + 20; } @@ -264,7 +264,7 @@ class InvoiceGroupPdfHandler extends FPDF { public function DrawArticlesTableRect(){ $this->SetLineWidth(0.2); - $gapBetweenStartingOfArticlesTableAndColumnName = 10; + $gapBetweenStartingOfArticlesTableAndColumnName = 8; $tableHeight = $this->thereIsOrderOrCaseNumber ? 137 : 137 + 10; $this->Rect(3, $this->startingYOfArticlesTable, 204, $tableHeight, "D"); // $this->RoundedRect(3, $this->startingYOfArticlesTable, 204, $tableHeight,5 ,'1234',"D"); @@ -279,22 +279,22 @@ class InvoiceGroupPdfHandler extends FPDF { public function DrawArticlesTableHeader(){ $tvaValue = $this->factureData["configuration"]->tva_default; - $columnNameY = $this->startingYOfArticlesTable + 1; + $columnNameY = $this->startingYOfArticlesTable - 1; $this->SetFont('ComicSans', '', 10); $this->SetXY(12, $columnNameY); - $this->Cell(7, 8, "Date", 0, 0, 'C'); + $this->Cell(7, 10, "Date", 0, 0, 'C'); $this->SetXY(28, $columnNameY); - $this->Cell(100, 8, "Description", 0, 0, 'C'); + $this->Cell(100, 10, "Description", 0, 0, 'C'); $this->SetXY(135, $columnNameY); - $this->Cell(20, 8, "Prix Uni. HT", 0, 0, 'C'); + $this->Cell(20, 10, "Prix Uni. HT", 0, 0, 'C'); $this->SetXY(159, $columnNameY); - $this->Cell(20, 8, 'TVA ' . $tvaValue . '%', 0, 0, 'C'); + $this->Cell(20, 10, 'TVA ' . $tvaValue . '%', 0, 0, 'C'); $this->SetXY(185, $columnNameY); - $this->Cell(20, 8, "Prix Uni. TTC", 0, 0, 'C'); + $this->Cell(20, 10, "Prix Uni. TTC", 0, 0, 'C'); } public function DrawArticlesTableValue(){ @@ -329,7 +329,7 @@ class InvoiceGroupPdfHandler extends FPDF { $productDescription .= " de " . $currentDevis["defunt_nom"] ?? ""; } $tvaAmount = $valueTtc - $valueHt; - $this->SetXY( 5,$yValue ); + $this->SetXY(4,$yValue ); $this->Cell(5, 6, $dateValue, 0,0); $this->SetXY( 29,$yValue ); @@ -386,9 +386,9 @@ class InvoiceGroupPdfHandler extends FPDF { $this->SetFont('ComicSans', '', 8); $ibanWidth = 62; $ibanCursorY = $this->GetY(); - $this->Cell($ibanWidth, 5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C'); + $this->Cell($ibanWidth, 6.5, 'IBAN : FR76 1360 6000 1436 5418 1800 038', 1, 1, 'C'); $ibanCursorX = $this->GetX(); - $this->Cell($ibanWidth, 5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C'); + $this->Cell($ibanWidth, 6.5, 'Code SWIFT : AGRI FR PP 836', 1, 1, 'C'); //TABLE HT $tableWidth = 48; // Largeur totale de la 2e table (20+20) @@ -403,10 +403,10 @@ class InvoiceGroupPdfHandler extends FPDF { $totalPriceArray = $this->totalPrices; foreach($totalPriceArray as $label => $price){ $this->SetXY($startOfArrayX,$startOfArrayY); - $this->Cell(24, 5, $label, 1, 1, 'C'); + $this->Cell(24, 6.5, $label, 1, 1, 'C'); $this->SetXY($startOfArrayX + 24,$startOfArrayY); - $this->Cell(24, 5, number_format($price,2,'.','').chr(128), 1, 1, 'C'); - $startOfArrayY += 5; + $this->Cell(24, 6.5, number_format($price,2,'.','').chr(128), 1, 1, 'C'); + $startOfArrayY += 6.5; } }