diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 1aaeb69029a..7295db2596d 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3011,8 +3011,13 @@ else print '
'; } + $discount = new DiscountAbsolute($db); + $result = $discount->fetch(0, 0, $object->id); + // Reopen a standard paid invoice - if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT) && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) + if (($object->type == FactureFournisseur::TYPE_STANDARD || $object->type == FactureFournisseur::TYPE_REPLACEMENT + || ($object->type == FactureFournisseur::TYPE_CREDIT_NOTE && empty($discount->id))) + && ($object->statut == 2 || $object->statut == 3)) // A paid invoice (partially or completely) { if (! $facidnext && $object->close_code != 'replaced' && $user->rights->fournisseur->facture->creer) // Not replaced by another invoice { diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index f02caf7f3ed..ef18d285f6c 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -44,6 +44,7 @@ class Entrepot extends CommonObject public $table_element='entrepot'; public $picto='stock'; + public $ismultientitymanaged = 1; // 0=No test on entity, 1=Test with field entity, 2=Test with link by societe /** * Warehouse closed, inactive