diff --git a/include/user_action_gl.php b/include/user_action_gl.php index 61eb52e8a..767121b1d 100644 --- a/include/user_action_gl.php +++ b/include/user_action_gl.php @@ -23,8 +23,8 @@ echo_debug(__FILE__,__LINE__,"include user_action_gl.php"); include_once ("preference.php"); include_once ("user_common.php"); include_once ("class_widget.php"); -include_once("class_jrn.php"); include_once("class_user.php"); +include("jrn.php"); $dossier=sprintf("dossier%d",$g_dossier); $cn=DbConnect($dossier); @@ -38,26 +38,15 @@ $periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from pa $User=new cl_user($cn); $current=(isset($_POST['p_periode']))?$_POST['p_periode']:$User->GetPeriode(); $w->selected=$current; -echo 'Période'.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider'); +echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider'); ?> GetRow($current,$current); - if ( count($Jrn->row ) == 0 ) - exit; - echo ""; -foreach ( $Jrn->row as $op ) { - echo "". - "". - "". - "". - "". - "". - "". - ""; - } - echo "
".$op['internal']."".$op['j_date']."".$op['poste']."".$op['description']."".$op['deb_montant']."".$op['cred_montant']."
"; +$sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current; +$list=ListJrn($cn,0,$sql); + +echo $list; + ?> \ No newline at end of file diff --git a/include/user_common.php b/include/user_common.php index 48632d8f2..76f8f8c60 100644 --- a/include/user_common.php +++ b/include/user_common.php @@ -265,7 +265,8 @@ function ListJrn($p_cn,$p_jrn,$p_where="",$p_array=null) jrn_def_type, jr_valid from - jrn join jrn_def on jrn_def_id=jr_def_id where jrn_def_id=$p_jrn"; + jrn join jrn_def on jrn_def_id=jr_def_id where "; + $jrn_sql=($p_jrn =0)?"1=1":"jrn_def_id=$p_jrn "; $l_and=" and "; if ( ereg("^[0-9]+$", $l_s_montant) || ereg ("^[0-9]+\.[0-9]+$", $l_s_montant) ) { $sql.=" and jr_montant $l_mont_sel $l_s_montant";