diff --git a/include/class_acc_account.php b/include/class_acc_account.php index 15e2796e7..4aa21e53c 100644 --- a/include/class_acc_account.php +++ b/include/class_acc_account.php @@ -19,7 +19,7 @@ /* $Revision$ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr /*! \file - * \brief Manage the account + * \brief Manage the account */ /*! * \brief Manage the account from the table tmp_pcmn @@ -117,16 +117,10 @@ class Acc_Account // otherwise we check only the value if ( strcmp ($p_member,'pcm_val') == 0 ) { - if (is_numeric($p_value) ==0 ) - throw new Exception('Poste comptable incorrect '.$p_value); - else return true; } else if ( strcmp ($p_member,'pcm_val_parent') == 0 ) { - if ( is_numeric($p_value) == 0 || ($this->count($p_value) == 0 && $p_value !=0)) - throw new Exception('Poste comptable parent incorrect '.$p_value); - else return true; } else if ( strcmp ($p_member,'pcm_lib') == 0 ) @@ -147,7 +141,7 @@ class Acc_Account } /*!\brief Get all the value for this object from the database - * the data member are set + * the data member are set * \return false if this account doesn't exist otherwise true */ function load() diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php index abb2d76d9..9cfbc4418 100644 --- a/include/param_pcmn.inc.php +++ b/include/param_pcmn.inc.php @@ -194,10 +194,10 @@ if ( isset ( $_POST["Ajout"] ) ) $p_val=trim($p_val); $p_parent=trim($p_parent); - if ( isset ( $p_val) && isset ( $p_lib ) && isNumber($p_val) && isNumber($p_parent) ) + if ( isset ( $p_val) && isset ( $p_lib ) ) { - $p_val=trim($p_val); - $p_parent=$_POST["p_parent"]; + $p_val=$cn->get_value('select format_account($1)',array($p_val)); + $p_parent=$cn->get_value('select format_account($1)',array($_POST["p_parent"])); if ( strlen ($p_val) != 0 && strlen ($p_lib) != 0 ) { if (strlen ($p_val) == 1 )