diff --git a/html/ajax_poste.php b/html/ajax_poste.php index cb808da20..524b3551c 100644 --- a/html/ajax_poste.php +++ b/html/ajax_poste.php @@ -99,8 +99,9 @@ case "sf": $r.=''; - $sql="select pcm_val,pcm_lib,pcm_val_parent,pcm_type ". - " from tmp_pcmn "; + $sql=" + select pcm_val,pcm_lib,array_to_string(array_agg(j_qcode) , ',') as acode + from tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) "; $sep=" where "; /* build the sql stmt */ if ( isset($j) && $j > 0 && isNumber($j)) @@ -121,7 +122,7 @@ case "sf": $sql.=sprintf(" $sep ( pcm_val::text like '%s%%' or pcm_lib::text ilike '%%%s%%') ", $q,$q); } - $sql.=' order by pcm_val::text limit 50'; + $sql.=' group by pcm_val,pcm_lib,pcm_val_parent, pcm_type order by pcm_val::text limit 50'; if ( isset($q) && strlen(trim($q))> 0 ) { $array=$cn->get_array($sql); diff --git a/html/js/accounting_item.js b/html/js/accounting_item.js index ba8fb29e7..e47ac1355 100644 --- a/html/js/accounting_item.js +++ b/html/js/accounting_item.js @@ -75,7 +75,7 @@ function search_poste(obj) sx=document.body.scrollTop+60; } - var div_style="z-index:15;top:"+sx; + var div_style="top:"+sx; removeDiv('search_account'); add_div({id:'search_account',cssclass:'inner_box',html:loading(),style:div_style,drag:true}); diff --git a/include/param_pcmn.inc.php b/include/param_pcmn.inc.php index 4e63131e7..1f93fa271 100644 --- a/include/param_pcmn.inc.php +++ b/include/param_pcmn.inc.php @@ -239,7 +239,9 @@ if ( isset ( $_POST["Ajout"] ) ) } } -$Ret=$cn->exec_sql("select pcm_val,pcm_lib,pcm_val_parent,pcm_type from tmp_pcmn where substr(pcm_val::text,1,1)='".$_SESSION['g_start']."' order by pcm_val::text"); +$Ret=$cn->exec_sql("select pcm_val,pcm_lib,pcm_val_parent,pcm_type,array_to_string(array_agg(j_qcode) , ',') as acode + from tmp_pcmn left join vw_poste_qcode on (j_poste=pcm_val) where substr(pcm_val::text,1,1)='".$_SESSION['g_start']."'". + " group by pcm_val,pcm_lib,pcm_val_parent, pcm_type order by pcm_val::text"); $MaxRow=Database::num_row($Ret); ?> @@ -256,11 +258,13 @@ echo dossier::hidden();