Anomalie 0000024 : première étape --> correction de l'erreur PHP sur le module SIRET Program, obsolète vis-à-vis de PS 1.7

This commit is contained in:
2020-05-11 18:51:14 +02:00
parent 8fd5f28ef7
commit b92fecbb39

View File

@@ -631,8 +631,31 @@ src="http://www.ixycom.com/images/logo-300.jpg" alt="Logo Ixycom" width="300" he
public function hookdisplayPDFInvoice($params) 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']; $id_order = $params['id_order'];
$ma_order = new Order($id_order); $ma_order = new Order($id_order);
$mon_customer_id = $ma_order->id_customer; $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->Cell(0, 0, $this->l('SIRET : ').str_replace(' ', '', $my_customer->siret), 0, 0, 'R');
$pdf->Ln(10); $pdf->Ln(10);
} }
*/
} }
public function processSiret($siret, $new_customer) public function processSiret($siret, $new_customer)