From 96619d2bee3e5b2c8ccd0423c85fa2efbdc4347b Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sat, 6 Jan 2018 21:29:40 +0100 Subject: [PATCH] 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 8d815a8bb..4f3f5a3d1 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;$idb->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