diff --git a/htdocs/core/class/objectlink.class.php b/htdocs/core/class/objectlink.class.php index c4e61a910ae..14cd41c8b35 100644 --- a/htdocs/core/class/objectlink.class.php +++ b/htdocs/core/class/objectlink.class.php @@ -328,6 +328,12 @@ class ObjectLink extends CommonObject $result = $newobject->fetch($objectid); return $result; } + if ($objecttype == 'invoice_supplier') { + require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php'; + $newobject = new FactureFournisseur($this->db); + $result = $newobject->fetch($objectid); + return $result; + } if ($objecttype == 'propal') { require_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php'; $newobject = new Propal($this->db); diff --git a/htdocs/projet/element.php b/htdocs/projet/element.php index d09ba4ee765..78e151087e0 100644 --- a/htdocs/projet/element.php +++ b/htdocs/projet/element.php @@ -968,6 +968,9 @@ foreach ($listofreferent as $key => $value) { if (getDolGlobalString('FACTURE_DEPOSITS_ARE_JUST_PAYMENTS') && $element->type == Facture::TYPE_DEPOSIT) { $qualifiedfortotal = false; // If hidden option to use deposits as payment (deprecated, not recommended to use this), deposits are not included } + if (getDolGlobalString('PROJECT_ONLY_PAYED_INVOICE_ON_PROFIT') && $element->status != Facture::STATUS_CLOSED) { + $qualifiedfortotal = false; // Only paid invoices qualify + } } if ($key == 'propal') { if ($element->status != Propal::STATUS_SIGNED && $element->status != Propal::STATUS_BILLED) { diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 9b47ff3731b..10de7349adb 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -911,7 +911,7 @@ class User extends CommonObject 'fichinter' => 'ficheinter', 'inventory' => 'stock', 'invoice' => 'facture', - 'invoice_supplier' => 'fournisseur', + 'invoice_supplier' => 'facture@fournisseur', 'order_supplier' => 'fournisseur', 'knowledgerecord' => 'knowledgerecord@knowledgemanagement', 'skill@hrm' => 'all@hrm', // skill / job / position objects rights are for the moment grouped into right level "all"