hotfixes/hotfixe-pdf-simple-fixe-colunm-text

This commit is contained in:
Narindra ezway 2025-04-16 16:58:23 +03:00
parent a7039dedc8
commit 2e846e75f8
2 changed files with 14 additions and 12 deletions

View File

@ -48,7 +48,7 @@ class InvoiceGroupPdfHandler extends FPDF {
public $devisList = [];
public $thereIsOrderOrCaseNumber = false;
public $startingYOfArticlesTable = 95;
public $startingYOfArticlesTable = 100;
public int $maxArticlePerPage = 19;
public $additionalArticlesLineBasedOnMultiline = 0;
public $interLigneHeader = 5;

View File

@ -200,22 +200,24 @@ class InvoicePdfHandler extends FPDF
private function DrawInvoiceInfoTable()
{
$this->setY(70);
$startInvoiceInfoTable = 70;
$this->setY($startInvoiceInfoTable);
$factureDatePaiement = $this->factureData['date_paiement'];
$factureDatePaiement = DateTime::createFromFormat('Y-m-d', $factureDatePaiement);
$factureDateEcheance = $factureDatePaiement;
$factureDatePaiement = $factureDatePaiement->format('d-m-Y');
$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->setY(77);
$this->SetFont('ComicSans', '', 9);
$this->SetFont('ComicSans', '', 10);
$this->Cell(25, 7, $factureDatePaiement, 1, 0, 'C');
$this->Cell(104, 7, utf8_decode(html_entity_decode($this->factureData['client_nom'])), 1, 0, 'C');
$this->Cell(39, 7, $this->factureData['num'], 1, 0, 'C');
@ -239,7 +241,7 @@ class InvoicePdfHandler extends FPDF
$this->Cell(0, 5, FileExportHelpers::FormatTextForExport("Numéro de dossier: " . $this->factureData['case_number']), 0, 1, 'C');
}
$this->startingYOfArticlesTable = $this->thereIsOrderOrCaseNumber ? $$this->startingYOfArticlesTable + 3 : $this->startingYOfArticlesTable - 7;
$this->startingYOfArticlesTable = $this->thereIsOrderOrCaseNumber ? $this->startingYOfArticlesTable + 3 : $this->startingYOfArticlesTable - 7;
}
private function DrawArticlesTable()
@ -252,7 +254,7 @@ class InvoicePdfHandler extends FPDF
$this->Line(3, $this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName, 207, $this->startingYOfArticlesTable + $gapBetweenStartingOfArticlesTableAndColumnName);
// les traits verticaux colonnes
$additionalMargRight = 1;
$endingLine = 234;
$endingLine = 233; // mois +1 pour le groupe
$this->Line(27 + $additionalMargRight, $this->startingYOfArticlesTable, 27+ $additionalMargRight , $endingLine);
$this->Line(142 + $additionalMargRight, $this->startingYOfArticlesTable, 142+ $additionalMargRight , $endingLine);
$this->Line(164 + $additionalMargRight, $this->startingYOfArticlesTable, 164+ $additionalMargRight , $endingLine);
@ -263,7 +265,7 @@ class InvoicePdfHandler extends FPDF
{
$additionalMargRight = 1;
$tvaValue = $this->factureData["configuration"]->tva_default;
$columnNameY = $this->startingYOfArticlesTable + 1;
$columnNameY = $this->startingYOfArticlesTable - 1;
$this->SetFont('ComicSans', '', 10);
$this->SetXY(12 + $additionalMargRight, $columnNameY);
$this->Cell(7, 10, "Date", 0, 0, 'C');
@ -348,10 +350,10 @@ class InvoicePdfHandler extends FPDF
$this->SetFont('ComicSans', '', 8);
$ibanWidth = 62;
$ibanCursorY = $this->GetY();
$this->Cell($ibanWidth, 5, 'IBANss : 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->SetX($startOftable);
$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)
@ -369,7 +371,7 @@ class InvoicePdfHandler extends FPDF
$this->Cell(24, 6.5, $label, 1, 1, 'C');
$this->SetXY($startOfArrayX + 24,$startOfArrayY);
$this->Cell(24, 6.5, number_format($price,2,'.','').chr(128), 1, 1, 'C');
$startOfArrayY += 5;
$startOfArrayY += 6.5;
}
}
@ -384,7 +386,7 @@ class InvoicePdfHandler extends FPDF
public function SetFactureContent()
{
$this->AddPage();
$this->SetMargins(2, 0, 3);
$this->SetMargins(3, 0, 3);
$this->DrawInvoiceCompanyAndClientInfo();
$this->DrawInvoiceInfoTable();
$this->DrawArticlesTable();