";
}
// Add an item
if ( isset ($_POST['add_item'])) {
// Add a line
$nb_number=$_POST["nb_item"];
$nb_number++;
// submit button in the form
$submit='
';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// Correct it
if ( isset ($_POST['correct'])) {
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='
';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// View the charge and show a submit button to save it
if ( isset ($_POST['view_invoice']) ) {
$nb_number=$_POST["nb_item"];
$r=form_verify_input($cn,$_GET['p_jrn'],$User->GetPeriode(),$_POST,$nb_number);
// if something goes wrong correct it
if ( $r == null )
{
// submit button in the form
$submit='
';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
}
else
{
$submit='';
$submit.='';
$r=FormFin($cn,$_GET['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
}
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// Save the charge into database
if ( isset($_POST['save'] )) {
$r=RecordFin($cn,$_POST,$User,$_GET['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
// submit button in the form
$submit='
";
}
}
//-----------------------------------------------------
// see jrn
//-----------------------------------------------------
if ( $action == 'voir_jrn' ) {
// Check privilege
if ( CheckJrn($gDossier,$_SESSION['g_user'],$_GET['p_jrn']) < 1 ) {
NoAccess();
exit -1;
}
?>
getExercice()."')";
} else {
$cond=" and jr_tech_per=".$current;
}
// Date - date of payment - Customer - amount
$sql=SQL_LIST_ALL_INVOICE.$cond." and jr_def_id=".$_GET['p_jrn'];
// Nav. bar
$step=$_SESSION['g_pagesize'];
$page=(isset($_GET['offset']))?$_GET['page']:1;
$offset=(isset($_GET['offset']))?$_GET['offset']:0;
// SQL
list($max_line,$list)=ListJrn($cn,$_GET['p_jrn'],$sql,null,$offset);
$bar=jrn_navigation_bar($offset,$max_line,$step,$page);
echo $bar;
echo $list;
echo $bar;
echo '
';
}
//-----------------------------------------------------
// balance
//-----------------------------------------------------
if ( $action == 'solde' ) {
require_once("poste.php");
// find the bank account
// NOTE : those values are in a table because
// they are _national_ parameters
$banque=new parm_code($cn,'BANQUE');
$caisse=new parm_code($cn,'CAISSE');
$vir_interne=new parm_code($cn,'VIREMENT_INTERNE');
$accountSql="select distinct pcm_val::text,pcm_lib from
tmp_pcmn
where pcm_val like '".$banque->p_value."%' or pcm_val like '".$vir_interne->p_value."%'
or pcm_val like '".$caisse->p_value."%'
order by pcm_val::text";
$ResAccount=ExecSql($cn,$accountSql);
echo '
';
echo "
";
// 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']);
// print the result if the saldo is not equal to 0
if ( $m != 0.0 ) {
echo "