diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index b85099d5a15..24834b508ac 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3036,8 +3036,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/multicurrency/class/multicurrency.class.php b/htdocs/multicurrency/class/multicurrency.class.php index ccc017dab49..6a524fa5a99 100644 --- a/htdocs/multicurrency/class/multicurrency.class.php +++ b/htdocs/multicurrency/class/multicurrency.class.php @@ -624,14 +624,14 @@ class MultiCurrency extends CommonObject } /** - * Sync rates from api + * Sync rates from api * - * @param array $response array of reponse from api to sync dolibarr rates - * @return void + * @param array $response array of reponse from api to sync dolibarr rates + * @return void */ public static function syncRates($response) { - global $db,$conf; + global $conf, $db, $langs; $ch = curl_init('http://apilayer.net/api/live?access_key='.$key.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); @@ -639,8 +639,8 @@ class MultiCurrency extends CommonObject curl_close($ch); $response = json_decode($response); - if ($response->success) { - + if ($response->success) + { $TRate = $response->quotes; $timestamp = $response->timestamp; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index fe9577c5ca8..a872bdae8ae 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