diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php index 0483caa29ae..23ebc01f3e2 100644 --- a/htdocs/categories/admin/categorie.php +++ b/htdocs/categories/admin/categorie.php @@ -1,6 +1,7 @@ - * Copyright (C) 2013 Florian Henry +/* Copyright (C) 2008-2011 Laurent Destailleur + * Copyright (C) 2013 Florian Henry + * Copyright (C) 2015 Juanjo Menent * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -107,11 +108,11 @@ if ($conf->use_javascript_ajax) } else { - if($conf->global->CATEGORIE_RECURSIV_ADD == 0) + if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) { print ''.img_picto($langs->trans("Disabled"),'off').''; } - else if($conf->global->CATEGORIE_RECURSIV_ADD == 1) + else { print ''.img_picto($langs->trans("Enabled"),'on').''; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 96e41962f9b..18c8b554637 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -1252,7 +1252,7 @@ class Commande extends CommonOrder $result=$product->fetch($fk_product); $product_type=$product->type; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER && $product_type == 0 && $product->stock_reel < $qty) + if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_ORDER) && $product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); dol_syslog(get_class($this)."::addline error=Product ".$product->ref.": ".$this->error, LOG_ERR); diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 59acd0b81f2..a347ccdbca8 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2179,7 +2179,7 @@ class Facture extends CommonInvoice $result=$product->fetch($fk_product); $product_type=$product->type; - if($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE && $product_type == 0 && $product->stock_reel < $qty) { + if (! empty($conf->global->STOCK_MUST_BE_ENOUGH_FOR_INVOICE) && $product_type == 0 && $product->stock_reel < $qty) { $this->error=$langs->trans('ErrorStockIsNotEnough'); $this->db->rollback(); return -3;