From b92fecbb39432001d9b7cfa7000d5fd670526339 Mon Sep 17 00:00:00 2001 From: Laurent LE CORRE Date: Mon, 11 May 2020 18:51:14 +0200 Subject: [PATCH] =?UTF-8?q?Anomalie=200000024=20:=20premi=C3=A8re=20=C3=A9?= =?UTF-8?q?tape=20-->=20correction=20de=20l'erreur=20PHP=20sur=20le=20modu?= =?UTF-8?q?le=20SIRET=20Program,=20obsol=C3=A8te=20vis-=C3=A0-vis=20de=20P?= =?UTF-8?q?S=201.7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/modules/siretprogram/siretprogram.php | 26 ++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/web/modules/siretprogram/siretprogram.php b/web/modules/siretprogram/siretprogram.php index 9c82303c..13f1107f 100644 --- a/web/modules/siretprogram/siretprogram.php +++ b/web/modules/siretprogram/siretprogram.php @@ -631,8 +631,31 @@ src="http://www.ixycom.com/images/logo-300.jpg" alt="Logo Ixycom" width="300" he public function hookdisplayPDFInvoice($params) { - $pdf = $params['pdf']; +// TheCoreDev le 11/05/2020 : ce module est obsolète et génère des erreurs PHP dans les logs --> essayons de l'adapter à PS 1.7 + $id_order = (_PS_VERSION_ > '1.5' ? $params['object']->id_order : $params['id_order']); + $ma_order = new Order($id_order); + $mon_customer_id = $ma_order->id_customer; + $my_customer = new Customer($mon_customer_id); + + if (!empty($my_customer->siret)) + { + $text = $this->l('SIRET : ').str_replace(' ', '', $my_customer->siret); + + if (_PS_VERSION_ > '1.5') + return $text; + else + { + $pdf = $params['pdf']; + $pdf->Ln(20); + $pdf->SetFont('Helvetica', '', 8); + $pdf->Cell(0, 0, $text, 0, 0, 'R'); + $pdf->Ln(10); + } + } + + /* L'ancien code ----------------------- + $pdf = $params['pdf']; $id_order = $params['id_order']; $ma_order = new Order($id_order); $mon_customer_id = $ma_order->id_customer; @@ -645,6 +668,7 @@ src="http://www.ixycom.com/images/logo-300.jpg" alt="Logo Ixycom" width="300" he $pdf->Cell(0, 0, $this->l('SIRET : ').str_replace(' ', '', $my_customer->siret), 0, 0, 'R'); $pdf->Ln(10); } + */ } public function processSiret($siret, $new_customer)