diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 759258888cf..ac138636b08 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -141,6 +141,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ", fk_soc"; $sql.= ", datec"; $sql.= ", datef"; + $sql.= ", fk_projet"; $sql.= ", note_private"; $sql.= ", note_public"; $sql.= ", fk_user_author"; @@ -154,6 +155,7 @@ class FactureFournisseur extends CommonInvoice $sql.= ", ".$this->socid; $sql.= ", '".$this->db->idate($now)."'"; $sql.= ", '".$this->db->idate($this->date)."'"; + $sql.= ", ".$this->fk_project; $sql.= ", '".$this->db->escape($this->note_private)."'"; $sql.= ", '".$this->db->escape($this->note_public)."'"; $sql.= ", ".$user->id.","; diff --git a/htdocs/fourn/facture/fiche.php b/htdocs/fourn/facture/fiche.php index 6ed624b82fa..23ed291c681 100644 --- a/htdocs/fourn/facture/fiche.php +++ b/htdocs/fourn/facture/fiche.php @@ -41,6 +41,8 @@ if (!empty($conf->produit->enabled)) require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; if (!empty($conf->projet->enabled)) require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; +if (! empty($conf->projet->enabled)) + require_once DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php'; $langs->load('bills'); @@ -271,6 +273,7 @@ elseif ($action == 'add' && $user->rights->fournisseur->facture->creer) // Creation facture $object->ref = $_POST['ref']; $object->ref_supplier = $_POST['ref_supplier']; + $object->fk_project = GETPOST('projectid'); $object->socid = $_POST['socid']; $object->libelle = $_POST['libelle']; $object->date = $datefacture; @@ -1153,6 +1156,15 @@ if ($action == 'create') print '