noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 17/323: query is prepared twice and cannot be


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 17/323: query is prepared twice and cannot be called only once
Date: Wed, 14 Mar 2018 17:38:10 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 96619d2bee3e5b2c8ccd0423c85fa2efbdc4347b
Author: Dany De Bontridder <address@hidden>
Date:   Sat Jan 6 21:29:40 2018 +0100

    query is prepared twice and cannot be called only once
---
 include/class/acc_reconciliation.class.php | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/class/acc_reconciliation.class.php 
b/include/class/acc_reconciliation.class.php
index 8d815a8..4f3f5a3 100644
--- a/include/class/acc_reconciliation.class.php
+++ b/include/class/acc_reconciliation.class.php
@@ -287,7 +287,6 @@ j1.j_poste as poste
             $this->jr_id=$array[$i]['jr_id'];
             $ret[$i]['first']=$this->fill_info();
         }
-        $this->db->prepare('detail_quant','select * from v_quant_detail where 
jr_id=$1');
         return $ret;
     }
     /**
@@ -367,6 +366,7 @@ j1.j_poste as poste
         $array=$this->get_reconciled();
         $ret=array();
         bcscale(2);
+        $this->prepare_query_detail_quant();
         for ($i=0;$i<count($array);$i++)
         {
              
$retdb=$this->db->execute("detail_quant",array($array[$i]['first']['jr_id']));
@@ -613,7 +613,10 @@ j1.j_poste as poste
     }
     function prepare_query_detail_quant()
     {
+        static $seen=0;
+        if ( $seen == 1) return;
         $this->db->prepare('detail_quant','select * from v_quant_detail where 
jr_id=$1');
+        $seen=1;
     }
     /**
      * Retrieve the amount VAT included and autoreversed VAT excluded thanks



reply via email to

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