diff --git a/htdocs/compta/facture/apercu.php b/htdocs/compta/facture/apercu.php index 3a726067290..5252343a0d5 100644 --- a/htdocs/compta/facture/apercu.php +++ b/htdocs/compta/facture/apercu.php @@ -67,16 +67,20 @@ if ($_GET["facid"] > 0) $soc = new Societe($db, $fac->socidp); $soc->fetch($fac->socidp); $author = new User($db); - $author->id = $fac->user_author; - $author->fetch(); - $head = facture_prepare_head($fac); - $hselected = $conf->use_preview_tabs ? 2 : false; + if ($fac->user_author) + { + $author->id = $fac->user_author; + $author->fetch(); + } + + $head = facture_prepare_head($fac); + $hselected = $conf->use_preview_tabs ? 2 : false; dolibarr_fiche_head($head, $hselected, $langs->trans("Bill")." : $fac->ref"); /* - * Facture - */ + * Facture + */ print ''; $rowspan=3;