From 98efbca92e3f825c0e7fad9d1908207ff8167bb9 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 4 Dec 2016 00:56:52 +0100 Subject: [PATCH] Performance : improve VERIF , Improve Accounting check --- include/class/class_acc_bilan.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/include/class/class_acc_bilan.php b/include/class/class_acc_bilan.php index 419aff65b..e3c7addd9 100644 --- a/include/class/class_acc_bilan.php +++ b/include/class/class_acc_bilan.php @@ -94,7 +94,10 @@ class Acc_Bilan */ private function warning($p_message,$p_type,$p_deb) { - $sql="select pcm_val,pcm_lib from tmp_pcmn where pcm_type='$p_type'"; + $sql="select distinct pcm_val,pcm_lib + from tmp_pcmn join jrnx on (pcm_val=j_poste) where pcm_type='$p_type'"; + $sql .= "and ".sql_filter_per($this->db,$this->from,$this->to,'p_id','j_tech_per'); + $res=$this->db->exec_sql($sql); if ( Database::num_row($res) ==0 ) return; @@ -103,12 +106,12 @@ class Acc_Bilan $ret=""; $obj=new Acc_Account_Ledger($this->db,0); + $sql=sql_filter_per($this->db,$this->from,$this->to,'p_id','j_tech_per'); for ($i=0;$i<$nRow;$i++) { $line=Database::fetch_array($res,$i); /* set the periode filter */ - $sql=sql_filter_per($this->db,$this->from,$this->to,'p_id','j_tech_per'); $obj->id=$line['pcm_val']; $solde=$obj->get_solde_detail($sql);