';
exit();
}
// action = new
if ( $action == 'new' ) {
// Check privilege
if ( CheckJrn($gDossier,$_SESSION['g_user'],$_REQUEST['p_jrn']) != 2 ) {
NoAccess();
exit -1;
}
// We request a new form
if ( isset($_GET['blank'] )) {
// Submit button in the form
$submit='
';
// add a one-line calculator
$prop=GetJrnProp($gDossier,$_GET['p_jrn']);
$line=$prop['jrn_deb_max_line'];
$r=FormODS($cn,$_REQUEST['p_jrn'],$User->GetPeriode(),$submit,null,false,$line);
echo '
";
}
// 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=FormODS($cn,$_POST['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=FormODS($cn,$_POST['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
// TODO: the name 'view_invoice' should be changed to something more self-explaining, like
// 'submit_od', no?
if ( isset ($_POST['view_invoice']) ) {
$nb_number=$_POST["nb_item"];
$submit='';
if ( $own->MY_ANALYTIC != "nu" )
$submit.='';
$submit.='';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,true,$nb_number);
// if something goes wrong, correct it
if ( $r == null ) {
// submit button in the form
$submit='
';
$r=FormODS($cn,$_POST['p_jrn'],$User->GetPeriode(),$submit,$_POST,false, $nb_number);
}else {
$submit='
';
}
echo '
';
echo $r;
echo "
On-line calculator
".JS_CALC_LINE."
";
echo "
";
}
// Save the change into database
if ( isset($_POST['save'] )) {
$r=RecordODS($cn,$_POST,$User,$_POST['p_jrn']);
// Get number of lines
$nb_number=$_POST["nb_item"];
if ( $r != null ) {
// submit button in the form
$submit='
';
echo $search_box;
// if nofirst is set then show result
if ( isset ($_GET['nofirst'] ) ) {
list ($max_line,$a)=ListJrn($cn,$_GET['p_jrn'],"",$_POST);
echo $a;
}
echo '