remove extract

This commit is contained in:
Dany De Bontridder 2020-08-18 19:12:29 +02:00
parent 5779e2f33c
commit c91e64125a

View file

@ -2351,7 +2351,12 @@ class Acc_Ledger extends jrn_def_sql
*/
function verify_ledger($array)
{
extract($array, EXTR_SKIP);
$p_jrn=$array['p_jrn'];
$p_jrn_deb_max_line=$array['p_jrn_deb_max_line'];
$p_jrn_name=$array['p_jrn_name'];
$p_jrn_type=$array['p_jrn_type'];
try
{
if (isNumber($p_jrn)==0)
@ -2365,8 +2370,10 @@ class Acc_Ledger extends jrn_def_sql
throw new Exception(_("Un journal avec ce nom existe déjà"));
if ($p_jrn_type=='FIN')
{
$http=new \HttpInput();
$a=new Fiche($this->db);
$result=$a->get_by_qcode(trim(strtoupper($_POST['bank'])), false);
$bank=$http->post("bank");
$result=$a->get_by_qcode(trim(strtoupper($bank)), false);
if ($result==1)
throw new Exception(_("Aucun compte en banque n'est donné"));
}
@ -2375,11 +2382,17 @@ class Acc_Ledger extends jrn_def_sql
throw new Exception(_('Choix du type de journal est obligatoire'));
}
if (isset( $negative_warning) && $negative_amount == 1 && trim($negative_warning)=="") {
if ( isset( $array['negative_warning']) &&
isset( $array['negative_amount']) &&
$array['negative_amount'] == 1
&& trim($array['negative_warning'])=="") {
throw new Exception(_("Avertissement ne peut être vide"));
}
if ( isset( $negative_amount) && $negative_amount <> 0 && $negative_amount <> 1 ){
if ( isset( $array['negative_amount']) &&
$array['negative_amount'] <> 0 &&
$array['negative_amount'] <> 1 )
{
throw new Exception(_("Valeur invalide"));
}
}