From 74dc21a8cbf40ec0783e60731a71d1e1edf17ff7 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Fri, 28 Feb 2025 18:13:56 +0300 Subject: [PATCH] add order number on pdf --- gestion/lib/Db/Bdd.php | 6 ++++++ .../InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index 29270bd..1b01176 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -2800,6 +2800,8 @@ class Bdd { $totalHt = 0; $totalTtc = 0; $totalTva = 0; + $caseNumber = ""; + $orderNumber = ""; foreach($factureDevisList as &$devis){ if($factureIncrement == 0){ $factureData["client_real_adress"] = $devis["group_address"] ?? ""; @@ -2808,6 +2810,8 @@ class Bdd { $factureData["siret"] = $devis["group_siret_number"]; $factureData["group_name"] = $devis["group_name"] ?? ""; } + $caseNumber = empty($devis["case_number"]) ? $caseNumber : $devis["case_number"]; + $orderNumber = empty($devis["order_number"]) ? $orderNumber : $devis["order_number"]; $products = $this->getDevisProduits($devis["devis_id"]); foreach($products as $product){ $valueHt = $product['produit_price'] * $product['quantite']; @@ -2833,6 +2837,8 @@ class Bdd { $factureData["configuration_adresse_city"] = $configurationAdresses["city"]; $factureData["productsCount"] = $productsCount; $factureData["totalPrices"] = $totaPricesArray; + $factureData["case_number"] = $caseNumber; + $factureData["order_number"] = $orderNumber; return $factureData; } diff --git a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php index d2d7687..70f2c3f 100644 --- a/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php +++ b/gestion/lib/Service/InvoiceGroupPdfHandler/InvoiceGroupPdfHandler.php @@ -171,15 +171,17 @@ class InvoiceGroupPdfHandler extends FPDF { $factureDateEcheance = $factureDateEcheance->format('d-m-Y'); $this->SetFont('ComicSans', 'B', 11); $this->Cell(30, 7, 'DATE', 1, 0, 'C'); - $this->Cell(94, 7, 'CLIENT', 1, 0, 'C'); + $this->Cell(60, 7, 'CLIENT', 1, 0, 'C'); $this->Cell(40, 7, 'FACTURE', 1, 0, 'C'); - $this->Cell(40, 7, 'ECHEANCE', 1, 1, 'C'); + $this->Cell(40, 7, 'ECHEANCE', 1, 0, 'C'); + $this->Cell(34, 7, 'COMMANDE', 1, 1, 'C'); $this->SetFont('ComicSans', '', 10); $this->Cell(30, 7, $factureDatePaiement, 1, 0, 'C'); - $this->Cell(94, 7, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C'); + $this->Cell(60, 7, utf8_decode(html_entity_decode($this->factureData['group_name'])), 1, 0, 'C'); $this->Cell(40, 7, $this->factureData['num'], 1, 0, 'C'); - $this->Cell(40, 7, $factureDateEcheance, 1, 1, 'C'); + $this->Cell(40, 7, $factureDateEcheance, 1, 0, 'C'); + $this->Cell(34, 7, $this->factureData["order_number"], 1, 1, 'C'); $this->startingYOfArticlesTable = 85; }