/* * This file is part of PhpCompta. * * PhpCompta is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * PhpCompta is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PhpCompta; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* $Revision$ */ // Copyright Author Dany De Bontridder ddebontridder@yahoo.fr require_once('class_jrn.php'); require_once('user_form_ven.php'); require_once('jrn.php'); require_once("class_document.php"); require_once("class_fiche.php"); /*!\brief the purpose off this file is to create invoices, to record them and to generate * them, and of course to save them into the database * * \note we update also the jrn. * jr_pj oid * jr_pj_name text * jr_pj_type text * \todo link the table document and jrn, remove those field to make it cleaner and to permit to * several operation for one document. For that we should have a new item in the menu (link * document and operation) To be analyzed */ var_dump($_REQUEST); // 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'],'VEN'); $p_jrn=-1; } else { $p_jrn=$_REQUEST['p_jrn']; } // for the back button if ( isset ($_REQUEST['url'])) { $retour=sprintf('',urldecode($_REQUEST['url'])); $h_url=sprintf('',urldecode($_REQUEST['url'])); } else { $retour=""; $h_url=""; } $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:""; //////////////////////////////////////////////////////////////////////////////// // If a list of invoice is asked // if ( $sub_action == "list") { // 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; // echo "Mise à jour $id"; $paid=($paid=='on')?'paid':''; $sql="update jrn set jr_rapt='$paid' where jr_id=$id"; $Res=ExecSql($cn,$sql); } } echo '