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)