From 63aa9029bbd3635e4cee92b2f37d4fd2087d6bbb Mon Sep 17 00:00:00 2001 From: Narindra ezway Date: Fri, 4 Apr 2025 18:53:15 +0300 Subject: [PATCH] Set font size for product details in PDF invoices --- .../Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php | 3 ++- gestion/lib/Service/InvoicePdfHandler.php | 4 +++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index 3b485f9..bff6755 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -265,6 +265,8 @@ class InvoiceGroupPdfHandler extends FPDF { $products = $currentDevis["products"]; $productIncrement = 0; foreach($products as $product){ + $this->SetFont('ComicSans', '', 8); + $valueHt = $product['produit_price'] * $product["quantite"]; $valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt,$tvaValue); $totalHt+=$valueHt; @@ -296,7 +298,6 @@ class InvoiceGroupPdfHandler extends FPDF { $this->Cell($maxDescriptionWidth, 6, $productDescription); } - $this->SetFont('ComicSans', '', 8); $this->SetXY( 135,$yValue ); $this->Cell(20, 6, number_format($valueHt,2,'.','').chr(128), 0, 0, 'C'); diff --git a/gestion/lib/Service/InvoicePdfHandler.php b/gestion/lib/Service/InvoicePdfHandler.php index bca330f..f041e95 100644 --- a/gestion/lib/Service/InvoicePdfHandler.php +++ b/gestion/lib/Service/InvoicePdfHandler.php @@ -283,6 +283,9 @@ class InvoicePdfHandler extends FPDF $products = $this->factureData["products"]; $yValue = $this->startingYOfArticlesTable + 11; foreach ($products as $product) { + + $this->SetFont('ComicSans', '', 8); + $valueHt = $product['produit_price']; $valueTtc = PriceHelpers::calculPriceWithVatValue($valueHt, $tvaValue); $totalHt += $valueHt; @@ -301,7 +304,6 @@ class InvoicePdfHandler extends FPDF $this->MultiAlignCell(102, 6, utf8_decode(html_entity_decode($productDescription)), 0, '0',); - $this->SetFont('ComicSans', '', 7); $this->SetXY(135, $yValue); $this->Cell(20, 6, number_format($valueHt, 2, '.', '') . chr(128), 0, 0, 'C');