diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 4711ecf7c60..fc3fe0db094 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -38,8 +38,12 @@ require_once(DOL_DOCUMENT_ROOT.'/compta/paiement/class/paiement.class.php'); require_once(DOL_DOCUMENT_ROOT."/lib/functions2.lib.php"); require_once(DOL_DOCUMENT_ROOT.'/lib/invoice.lib.php'); require_once(DOL_DOCUMENT_ROOT."/lib/date.lib.php"); -if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); -if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); +if ($conf->commande->enabled) require_once(DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php'); +if ($conf->projet->enabled) +{ + require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'); + require_once(DOL_DOCUMENT_ROOT.'/lib/project.lib.php'); +} $langs->load('bills'); //print 'ee'.$langs->trans('BillsCustomer');exit; diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index d58515b7db9..06db0239c72 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -280,7 +280,8 @@ class Facture extends CommonObject if ($this->origin == 'commande') { // On recupere les differents contact interne et externe - $order = new Commande($this->db, $this->socid, $this->origin_id); + $order = new Commande($this->db); + $order->id = $this->origin_id; // On recupere le commercial suivi propale $this->userid = $order->getIdcontact('internal', 'SALESREPFOLL');