HOTFIX pdf facture

This commit is contained in:
ezway 2025-09-04 17:03:53 +02:00
parent b8ae0f1e48
commit a2ca034507
3 changed files with 4681 additions and 4597 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -35,6 +35,7 @@ use OCA\Gestion\Helpers\PriceHelpers;
class InvoicePdfHandler extends FPDF class InvoicePdfHandler extends FPDF
{ {
private $multipleFactureData = []; private $multipleFactureData = [];
private $factureData = []; private $factureData = [];
private $logo = null; private $logo = null;
@ -42,8 +43,11 @@ class InvoicePdfHandler extends FPDF
protected $extgstates = []; protected $extgstates = [];
private $thereIsOrderOrCaseNumber = false; private $thereIsOrderOrCaseNumber = false;
private $startingYOfArticlesTable = 100; private $startingYOfArticlesTable = 100;
private $endingYOfArticlesTable = 230; private $endingYOfArticlesTable = 230;
private $articleTablesHeight = 130; private $articleTablesHeight = 130;
public $interLigneHeader = 5; public $interLigneHeader = 5;
public $hasTva = true; public $hasTva = true;
@ -89,6 +93,10 @@ class InvoicePdfHandler extends FPDF
// Ajouter l'image en filigrane // Ajouter l'image en filigrane
$this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur $this->Image($imagePath, $x, $y, $width, $height); // Chemin, position x, position y, largeur, hauteur
$this->SetAlpha(0.1); // Définir l'opacité $this->SetAlpha(0.1); // Définir l'opacité
} }
public function SetAlpha($alpha) public function SetAlpha($alpha)
@ -346,6 +354,7 @@ class InvoicePdfHandler extends FPDF
$yValue = $this->startingYOfArticlesTable + 13; $yValue = $this->startingYOfArticlesTable + 13;
$maxDescriptionWidth = 102; $maxDescriptionWidth = 102;
foreach ($products as $product) { foreach ($products as $product) {
$valueHt = $product['produit_price'] * $product['quantite']; $valueHt = $product['produit_price'] * $product['quantite'];
@ -365,8 +374,17 @@ class InvoicePdfHandler extends FPDF
if ($product === end($products)) { if ($product === end($products)) {
$dateValue = $devisDate; $dateValue = $devisDate;
$productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->factureData['defunt_sexe']) . ' ' . $this->factureData["defunt_nom"]; $productDescription .= " de " . FileExportHelpers::GetSexeLabel($this->factureData['defunt_sexe']) . ' ' . $this->factureData["defunt_nom"];
} }
$this->SetXY(5, $yValue); $this->SetXY(5, $yValue);
$this->Cell(5, 6, $dateValue, 0, 0); $this->Cell(5, 6, $dateValue, 0, 0);