Correct : Sort the periode properly in using p_start and p_end instead of p_id
This commit is contained in:
parent
cd43c8678e
commit
d3d4a1e748
16 changed files with 44 additions and 35 deletions
|
|
@ -72,14 +72,14 @@ $w->table=1;
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->label="Depuis";
|
||||
if ( isset ($_POST['from_periode']) )
|
||||
$w->selected=$_POST['from_periode'];
|
||||
|
||||
echo $w->IOValue('from_periode',$periode_start);
|
||||
$w->label=" jusqu'à ";
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
if ( isset ($_POST['to_periode']) )
|
||||
$w->selected=$_POST['to_periode'];
|
||||
|
||||
|
|
|
|||
|
|
@ -87,12 +87,17 @@ echo ShowMenuJrnUser($_SESSION['g_dossier'],'FIN',0,'<td class="cell"><A class="
|
|||
order by pcm_val::text";
|
||||
$ResAccount=ExecSql($cn,$accountSql);
|
||||
echo '<div class="u_redcontent">';
|
||||
|
||||
echo "<table>";
|
||||
// Filter the saldo
|
||||
// on the current year
|
||||
$filter_year=" and j_tech_per in (select p_id from parm_periode where p_exercice='".$User->getExercice()."')";
|
||||
|
||||
// for each account
|
||||
for ( $i = 0; $i < pg_NumRows($ResAccount);$i++) {
|
||||
// get the saldo
|
||||
$l=pg_fetch_array($ResAccount,$i);
|
||||
$m=GetSolde($cn,$l['pcm_val']);
|
||||
$m=GetSolde($cn,$l['pcm_val'],$filter_year);
|
||||
// print the result if the saldo is not equal to 0
|
||||
if ( $m != 0.0 ) {
|
||||
echo "<tr>";
|
||||
|
|
@ -144,24 +149,26 @@ if ( $sub_action == "list")
|
|||
|
||||
|
||||
$w=new widget("select");
|
||||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id",1);
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
|
||||
// User is already set User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
||||
echo 'Période '.$w->IOValue("p_periode",$periode_start);
|
||||
$qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
|
||||
echo JS_SEARCH_CARD;
|
||||
$w=new widget('js_search_only');
|
||||
$w->name='qcode';
|
||||
$w->value=$qcode;
|
||||
$w->label='';
|
||||
$w->extra='4';
|
||||
$sp= new widget("span");
|
||||
echo $sp->IOValue("qcode_label",$qcode)."</TD></TR>";
|
||||
echo $w->IOValue();
|
||||
echo $w->Submit('gl_submit','Rechercher');
|
||||
$qcode=(isset($_GET['qcode']))?$_GET['qcode']:"";
|
||||
echo JS_SEARCH_CARD;
|
||||
$w=new widget('js_search_only');
|
||||
$w->name='qcode';
|
||||
$w->value=$qcode;
|
||||
$w->label='';
|
||||
$w->extra='4';
|
||||
$sp= new widget("span");
|
||||
echo $sp->IOValue("qcode_label",$qcode)."</TD></TR>";
|
||||
echo $w->IOValue();
|
||||
echo $w->Submit('gl_submit','Rechercher');
|
||||
echo '</form>';
|
||||
echo $retour;
|
||||
// Show list of sell
|
||||
|
|
@ -191,7 +198,7 @@ echo $w->Submit('gl_submit','Rechercher');
|
|||
$l=" and jr_grpt_id in (select j_grpt from jrnx where j_qcode='$qcode') ";
|
||||
}
|
||||
|
||||
list($max_line,$list)=ListJrn($cn,0,"where jrn_def_type='FIN' and jr_tech_per=$current $l "
|
||||
list($max_line,$list)=ListJrn($cn,0,"where jrn_def_type='FIN' $filter_per $l "
|
||||
,null,$offset,0);
|
||||
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
|
||||
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
define ("phpcompta_password","dany");
|
||||
define ("domaine","");
|
||||
|
||||
define ("DEBUG","false");
|
||||
define ("DEBUG","true");
|
||||
|
||||
// securite correspond a la table
|
||||
// action
|
||||
|
|
|
|||
|
|
@ -114,7 +114,7 @@ if ( $sub_action == "list")
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id",1);
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end",1);
|
||||
// User is already set User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,7 @@ if ( $sub_action == "list")
|
|||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') ".
|
||||
" from parm_periode $filter_year order by p_id",1);
|
||||
" from parm_periode $filter_year order by p_start,p_end",1);
|
||||
// User is already set User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
|
|
@ -46,11 +46,11 @@ print '<TR>';
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->label="Depuis";
|
||||
print $w->IOValue('from_periode',$periode_start);
|
||||
$w->label=" jusqu'à ";
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
print $w->IOValue('to_periode',$periode_end);
|
||||
print "</TR>";
|
||||
echo '</TABLE>';
|
||||
|
|
|
|||
|
|
@ -61,11 +61,11 @@ if ( isset ($_REQUEST['fd_id'])) {
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
|
||||
$w->selected=(isset($_POST['from_periode']))?$_POST['from_periode']:"";
|
||||
print "Depuis ".$w->IOValue('from_periode',$periode_start);
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->selected=(isset($_POST['to_periode']))?$_POST['to_periode']:"";
|
||||
print " Jusque ".$w->IOValue('to_periode',$periode_end);
|
||||
|
||||
|
|
|
|||
|
|
@ -208,11 +208,11 @@ print '<TR>';
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->label="Depuis";
|
||||
print $w->IOValue('from_periode',$periode_start);
|
||||
$w->label=" jusqu'à ";
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
print $w->IOValue('to_periode',$periode_end);
|
||||
print "</TR><TR>";
|
||||
$centralise=new widget("checkbox");
|
||||
|
|
|
|||
|
|
@ -166,11 +166,11 @@ print '<TR>';
|
|||
$select=new widget("select");
|
||||
$select->table=1;
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$select->label="Depuis";
|
||||
print $select->IOValue('from_periode',$periode_start);
|
||||
$select->label=" jusqu'à ";
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
print $select->IOValue('to_periode',$periode_end);
|
||||
print "</TR>";
|
||||
print "<TR><TD>";
|
||||
|
|
|
|||
|
|
@ -141,11 +141,11 @@ print '<TR>';
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$w->label="Depuis";
|
||||
print $w->IOValue('from_periode',$periode_start);
|
||||
$w->label=" jusqu'à ";
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_end=make_array($cn,"select p_id,to_char(p_end,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
print $w->IOValue('to_periode',$periode_end);
|
||||
print "</TR>";
|
||||
$aStep=array(
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ function GetSolde($p_cn,$p_account,$p_cond="") {
|
|||
from jrnx join tmp_pcmn on j_poste=pcm_val
|
||||
where
|
||||
j_poste=$p_account
|
||||
$p_cond
|
||||
) as m group by j_poste ");
|
||||
$Max=pg_NumRows($Res);
|
||||
if ($Max==0) return 0;
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ $w->name="p_periode";
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
|
|
@ -180,7 +180,7 @@ $w=new widget("select");
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
|
|
@ -49,9 +49,10 @@ $hid->value="voir_jrn";
|
|||
echo $hid->IOValue();
|
||||
|
||||
$w=new widget("select");
|
||||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id");
|
||||
$User=new cl_user($cn);
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
echo 'Période '.$w->IOValue("p_periode",$periode_start).$w->Submit('gl_submit','Valider');
|
||||
|
|
|
|||
|
|
@ -175,7 +175,7 @@ $w=new widget("select");
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
$User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ $w=new widget("select");
|
|||
// filter on the current year
|
||||
$filter_year=" where p_exercice='".$User->getExercice()."'";
|
||||
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_id");
|
||||
$periode_start=make_array($cn,"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode $filter_year order by p_start,p_end");
|
||||
// User is already set User=new cl_user($cn);
|
||||
$current=(isset($_GET['p_periode']))?$_GET['p_periode']:$User->GetPeriode();
|
||||
$w->selected=$current;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue