From c91e64125a69a4ee4ee18a0119c6a69c2b48da7b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Tue, 18 Aug 2020 19:12:29 +0200 Subject: [PATCH] remove extract --- include/class/acc_ledger.class.php | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/include/class/acc_ledger.class.php b/include/class/acc_ledger.class.php index 30df01e4d..877738b9e 100644 --- a/include/class/acc_ledger.class.php +++ b/include/class/acc_ledger.class.php @@ -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")); } }