Update pdf.lib.php

This commit is contained in:
Laurent Destailleur 2020-08-23 19:13:30 +02:00 committed by GitHub
parent b44d6744f9
commit 7a183ea026
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2071,7 +2071,7 @@ function pdf_getTotalQty($object,$type,$outputlangs)
*/
function pdf_getLinkedObjects($object,$outputlangs)
{
global $hookmanager;
global $db, $hookmanager;
$linkedobjects=array();
@ -2130,7 +2130,7 @@ function pdf_getLinkedObjects($object,$outputlangs)
$elementobject->fetchObjectLinked(null, '', null, '', 'OR', 1, 'sourcetype', 0);
if (! empty($elementobject->linkedObjectsIds['commande'])){
include_once DOL_DOCUMENT_ROOT.'/commande/commande.class.php';
$order = new Commande($object->db);
$order = new Commande($db);
$ret = $order->fetch(reset($elementobject->linkedObjectsIds['commande']));
if ($ret < 1) { $order=null; }
}