diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index 1084a0deb2f..1e9ca3343d1 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -44,9 +44,12 @@ class Commande extends CommonObject var $element='commande'; var $id ; + + var $socidp; // Id client + var $client; // Objet societe client (à charger par fetch_client) + var $ref; var $ref_client; - var $socidp; var $contactid; var $projet_id; var $statut; @@ -934,18 +937,6 @@ class Commande extends CommonObject * */ - function fetch_client() - { - $client = new Societe($this->db); - $client->fetch($this->socidp); - $this->client = $client; - } - - /** - * - * - */ - function fetch_adresse_livraison($id) { $idadresse = $id; diff --git a/htdocs/commonobject.class.php b/htdocs/commonobject.class.php index 5a19181d63f..da8b5e682e4 100644 --- a/htdocs/commonobject.class.php +++ b/htdocs/commonobject.class.php @@ -333,6 +333,27 @@ class CommonObject $this->contact = $contact; } + /* + * \brief Charge l'objet client depuis la base + */ + function fetch_client() + { + $client = new Societe($this->db); + $client->fetch($this->societe_id); + $this->client = $client; + } + + /* + * \brief Charge l'objet projet depuis la base + * + */ + function fetch_projet() + { + $projet = new Project($this->db); + $projet->fetch($this->projet_id); + $this->projet = $projet; + } + } ?> diff --git a/htdocs/compta/facture/facture-rec.class.php b/htdocs/compta/facture/facture-rec.class.php index 99eef0730ab..8a55222339f 100644 --- a/htdocs/compta/facture/facture-rec.class.php +++ b/htdocs/compta/facture/facture-rec.class.php @@ -38,9 +38,14 @@ require_once(DOL_DOCUMENT_ROOT."/facture.class.php"); */ class FactureRec extends Facture { - var $id; - var $db; - var $socidp; + var $db ; + var $element='commande'; + + var $id ; + + var $socidp; // Id client + var $client; // Objet societe client (à charger par fetch_client) + var $number; var $author; var $date; @@ -239,17 +244,6 @@ class FactureRec extends Facture } } - /** - * Recupére l'objet client lié à la facture - */ - function fetch_client() - { - $client = new Societe($this->db); - $client->fetch($this->socidp); - $this->client = $client; - - } - /** * Valide la facture */ diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 4c6fe314962..19d2776f607 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -71,12 +71,12 @@ class Facture extends CommonObject var $mode_reglement_id; var $mode_reglement_code; - // Pour board - var $nbtodo; - var $nbtodolate; - + // Pour board + var $nbtodo; + var $nbtodolate; + var $specimen; - var $error; + var $error; /** @@ -468,17 +468,6 @@ class Facture extends CommonObject } } - /** - * \brief Recupére l'objet client lié à la facture - * - */ - function fetch_client() - { - $client = new Client($this->db); - $client->fetch($this->socidp); - $this->client = $client; - } - /** * \brief Classe la facture dans un projet diff --git a/htdocs/fichinter/fiche.php b/htdocs/fichinter/fiche.php index 60d5c684f62..0bd18c8b00f 100644 --- a/htdocs/fichinter/fiche.php +++ b/htdocs/fichinter/fiche.php @@ -330,7 +330,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') if ($conf->projet->enabled) { $fichinter->fetch_projet(); - print '