Si le montant de TVA est égal à 0, il sera automatiquement calculé'; // First we show the menu // If nothing is asked the propose a blank form // to enter a new invoice if ( ! isset ($_REQUEST['p_jrn'])) { // no journal are selected so we select the first one $p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],'ACH'); } else { $p_jrn=$_REQUEST['p_jrn']; } // for the back button $retour=""; $h_url=""; if ( isset ($_REQUEST['url'])) { $retour=sprintf('',urldecode($_REQUEST['url'])); $h_url=sprintf('',urldecode($_REQUEST['url'])); } $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:""; //----------------------------------------------------- // If a list of depense is asked // if ( $sub_action == "list") { if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$p_jrn) < 1 ) { NoAccess(); exit -1; } // show the menu with the list item selected echo '
'; // Ask to update payment if ( isset ( $_GET['paid'])) { // reset all the paid flag because the checkbox is post only // when checked foreach ($_GET as $name=>$paid) { list($ad) = sscanf($name,"set_jr_id%d"); if ( $ad == null ) continue; $sql="update jrn set jr_rapt='' where jr_id=$ad"; $Res=ExecSql($cn,$sql); } // set a paid flag for the checked box foreach ($_GET as $name=>$paid) { list ($id) = sscanf ($name,"rd_paid%d"); if ( $id == null ) continue; $paid=($paid=='on')?'paid':''; $sql="update jrn set jr_rapt='$paid' where jr_id=$id"; $Res=ExecSql($cn,$sql); } } echo '