noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 08/119: remove extract


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 08/119: remove extract
Date: Mon, 26 Oct 2020 18:27:01 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit c91e64125a69a4ee4ee18a0119c6a69c2b48da7b
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Tue Aug 18 19:12:29 2020 +0200

    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 30df01e..877738b 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"));
             }
         }



reply via email to

[Prev in Thread] Current Thread [Next in Thread]