diff --git a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php index fc7d142d5ae..35d74ec432a 100644 --- a/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php +++ b/htdocs/core/modules/supplier_payment/doc/pdf_standard.modules.php @@ -86,7 +86,7 @@ class pdf_standard extends ModelePDFSuppliersPayments */ public function __construct($db) { - global $conf, $langs, $mysoc; + global $langs, $mysoc; // Load translation files required by the page $langs->loadLangs(array("main", "bills")); @@ -227,7 +227,7 @@ class pdf_standard extends ModelePDFSuppliersPayments global $action; $reshook = $hookmanager->executeHooks('beforePDFCreation', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks - $nblines = count($object->lines); + $nblines = (empty($object->lines) ? 0 : count($object->lines)); $pdf = pdf_getInstance($this->format); $default_font_size = pdf_getPDFFontSize($outputlangs); // Must be after pdf_getInstance