From 7b5be9d0c77fa695ee878ea236a78251f72479e4 Mon Sep 17 00:00:00 2001 From: Tiavina Date: Thu, 2 Jan 2025 16:14:57 +0300 Subject: [PATCH] fix city for adresses (client and configuration entreprise) --- gestion/lib/Db/Bdd.php | 18 ++++++++++++++++++ gestion/lib/Service/InvoicePdfHandler.php | 6 ++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/gestion/lib/Db/Bdd.php b/gestion/lib/Db/Bdd.php index bf80685..21f5516 100644 --- a/gestion/lib/Db/Bdd.php +++ b/gestion/lib/Db/Bdd.php @@ -2287,6 +2287,24 @@ class Bdd { $factureData = $this->setDevisStartAndEndTime($factureData); $factureData["products"] = $products; $factureData["configuration"] = $configuration; + $factureData["client_real_adress"] = ""; + $factureData["client_adress_city"] = ""; + $clientAdresses = explode("-",$factureData["client_adresse"]); + if(isset($clientAdresses[0])){ + $factureData["client_real_adress"] = trim($clientAdresses[0]); + } + if(isset($clientAdresses[1])){ + $factureData["client_adress_city"] = trim($clientAdresses[1]); + } + $factureData["configuration_adresse"] = ""; + $factureData["configuration_adresse_city"] = ""; + $configurationAdresses = explode("-",$configuration->adresse); + if(isset($configurationAdresses[0])){ + $factureData["configuration_adresse"] = trim($configurationAdresses[0]); + } + if(isset($configurationAdresses[1])){ + $factureData["configuration_adresse_city"] = trim($configurationAdresses[1]); + } return $factureData; } diff --git a/gestion/lib/Service/InvoicePdfHandler.php b/gestion/lib/Service/InvoicePdfHandler.php index 124ee4e..c671efe 100644 --- a/gestion/lib/Service/InvoicePdfHandler.php +++ b/gestion/lib/Service/InvoicePdfHandler.php @@ -81,8 +81,10 @@ sera due sur présentation de justificatifs ( articles L.441-3 et L.441-6 du cod $this->SetFont('Arial', '', 12); $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['configuration']->entreprise)), 0, 0); $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['client_nom'] . ' ' . $this->factureData['client_entreprise'])), 0, 1,'R'); - $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['configuration']->adresse)), 0, 0);border: - $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['client_adresse'])), 0, 1,'R'); + $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['configuration_adresse'])), 0, 0); + $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['client_real_adress'])), 0, 1,'R'); + $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['configuration_adresse_city'])), 0, 0);border: + $this->Cell(0, 7, utf8_decode(html_entity_decode($this->factureData['client_adress_city'])), 0, 1,'R'); $this->Cell(0, 7, utf8_decode(html_entity_decode('Tél : ')) . utf8_decode(html_entity_decode($this->factureData['configuration']->telephone)) , 0, 1); $this->Cell(0, 7, 'Mail : ' . $this->factureData['configuration']->mail, 0, 1);