altocompta/doc/developper/html/facture_8inc_8php-source.html

237 lines
25 KiB
HTML
Raw Blame History

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>phpcompta: /home/dany/developpement/phpcompta-dev/phpcompta/include/facture.inc.php Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.4 -->
<div class="qindex"><a class="qindex" href="index.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="dirs.html">Directories</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a></div>
<div class="nav">
<a class="el" href="dir_000000.html">developpement</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000001.html">phpcompta-dev</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000002.html">phpcompta</a>&nbsp;&raquo&nbsp;<a class="el" href="dir_000006.html">include</a></div>
<h1>facture.inc.php</h1><a href="facture_8inc_8php.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 &lt;?
<a name="l00002"></a>00002 <span class="comment">/*</span>
<a name="l00003"></a>00003 <span class="comment"> * This file is part of PhpCompta.</span>
<a name="l00004"></a>00004 <span class="comment"> *</span>
<a name="l00005"></a>00005 <span class="comment"> * PhpCompta is free software; you can redistribute it and/or modify</span>
<a name="l00006"></a>00006 <span class="comment"> * it under the terms of the GNU General Public License as published by</span>
<a name="l00007"></a>00007 <span class="comment"> * the Free Software Foundation; either version 2 of the License, or</span>
<a name="l00008"></a>00008 <span class="comment"> * (at your option) any later version.</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * PhpCompta is distributed in the hope that it will be useful,</span>
<a name="l00011"></a>00011 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00012"></a>00012 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the</span>
<a name="l00013"></a>00013 <span class="comment"> * GNU General Public License for more details.</span>
<a name="l00014"></a>00014 <span class="comment"> *</span>
<a name="l00015"></a>00015 <span class="comment"> * You should have received a copy of the GNU General Public License</span>
<a name="l00016"></a>00016 <span class="comment"> * along with PhpCompta; if not, write to the Free Software</span>
<a name="l00017"></a>00017 <span class="comment"> * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA</span>
<a name="l00018"></a>00018 <span class="comment">*/</span>
<a name="l00019"></a>00019 <span class="comment">/* $Revision$ */</span>
<a name="l00020"></a>00020 <span class="comment">// Copyright Author Dany De Bontridder ddebontridder@yahoo.fr</span>
<a name="l00021"></a>00021 require_once('class_jrn.php');
<a name="l00022"></a>00022 require_once('user_form_ven.php');
<a name="l00023"></a>00023 require_once('<a class="code" href="classjrn.html">jrn</a>.php');
<a name="l00024"></a>00024 require_once(<span class="stringliteral">"class_document.php"</span>);
<a name="l00025"></a>00025 require_once(<span class="stringliteral">"class_fiche.php"</span>);
<a name="l00038"></a>00038 var_dump($_REQUEST);
<a name="l00039"></a>00039 <span class="comment">// First we show the menu</span>
<a name="l00040"></a>00040 <span class="comment">// If nothing is asked the propose a blank form</span>
<a name="l00041"></a>00041 <span class="comment">// to enter a new invoice</span>
<a name="l00042"></a>00042 <span class="keywordflow">if</span> ( ! isset ($_REQUEST['p_jrn'])) {
<a name="l00043"></a>00043 <span class="comment">// no journal are selected so we select the first one</span>
<a name="l00044"></a>00044 <span class="comment">// $p_jrn=GetFirstJrnIdForJrnType($_SESSION['g_dossier'],'VEN'); </span>
<a name="l00045"></a>00045 <a class="code" href="modify__op_8php.html#a2">$p_jrn</a>=-1;
<a name="l00046"></a>00046 } <span class="keywordflow">else</span>
<a name="l00047"></a>00047 {
<a name="l00048"></a>00048 <a class="code" href="modify__op_8php.html#a2">$p_jrn</a>=$_REQUEST['p_jrn'];
<a name="l00049"></a>00049 }
<a name="l00050"></a>00050 <span class="comment">// for the back button</span>
<a name="l00051"></a>00051 <span class="keywordflow">if</span> ( isset ($_REQUEST['url']))
<a name="l00052"></a>00052 {
<a name="l00053"></a>00053 <a class="code" href="client_8inc_8php.html#a9">$retour</a>=sprintf('&lt;A HREF=<span class="stringliteral">"%s"</span>&gt;&lt;input type=<span class="stringliteral">"button"</span> <a class="code" href="client_8inc_8php.html#a6">value</a>=<span class="stringliteral">"Retour"</span>&gt;&lt;/A&gt;',urldecode($_REQUEST['url']));
<a name="l00054"></a><a class="code" href="facture_8inc_8php.html#a0">00054</a> <a class="code" href="action_8inc_8php.html#a1">$h_url</a>=sprintf('&lt;input type=<span class="stringliteral">"hidden"</span> <a class="code" href="client_8inc_8php.html#a5">name</a>=<span class="stringliteral">"url"</span> <a class="code" href="client_8inc_8php.html#a6">value</a>=<span class="stringliteral">"%s"</span>&gt;',urldecode($_REQUEST['url']));
<a name="l00055"></a>00055 }
<a name="l00056"></a>00056 <span class="keywordflow">else</span>
<a name="l00057"></a>00057 {
<a name="l00058"></a>00058 <a class="code" href="client_8inc_8php.html#a9">$retour</a>=<span class="stringliteral">""</span>;
<a name="l00059"></a>00059 <a class="code" href="action_8inc_8php.html#a1">$h_url</a>=<span class="stringliteral">""</span>;
<a name="l00060"></a>00060 }
<a name="l00061"></a>00061
<a name="l00062"></a>00062 <a class="code" href="action_8inc_8php.html#a0">$sub_action</a>=(isset($_REQUEST['sa']))?$_REQUEST['sa']:<span class="stringliteral">""</span>;
<a name="l00064"></a>00064 <span class="comment">// If a list of invoice is asked</span>
<a name="l00065"></a>00065 <span class="comment">// </span>
<a name="l00066"></a>00066 <span class="keywordflow">if</span> ( $sub_action == <span class="stringliteral">"list"</span>)
<a name="l00067"></a>00067 {
<a name="l00068"></a>00068
<a name="l00069"></a>00069 <span class="comment">// show the menu with the list item selected</span>
<a name="l00070"></a>00070 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_subtmenu"</span>&gt;';
<a name="l00071"></a>00071 echo <a class="code" href="user__menu_8php.html#a5">ShowMenuJrnUser</a>($_SESSION['g_dossier'],'<a class="code" href="constant_8php.html#a16">VEN</a>',$p_jrn,'&lt;td <span class="keyword">class</span>=<span class="stringliteral">"selectedcell"</span>&gt;Liste&lt;/td&gt;');
<a name="l00072"></a>00072 echo '&lt;/div&gt;';
<a name="l00073"></a>00073 <span class="comment">// Ask to update payment</span>
<a name="l00074"></a>00074 <span class="keywordflow">if</span> ( isset ( $_GET['paid']))
<a name="l00075"></a>00075 {
<a name="l00076"></a>00076 <span class="comment">// reset all the paid flag because the checkbox is post only</span>
<a name="l00077"></a>00077 <span class="comment">// when checked</span>
<a name="l00078"></a>00078 foreach ($_GET as $<a class="code" href="client_8inc_8php.html#a5">name</a>=&gt;$paid)
<a name="l00079"></a>00079 {
<a name="l00080"></a>00080 list($ad) = sscanf($<a class="code" href="client_8inc_8php.html#a5">name</a>,<span class="stringliteral">"set_jr_id%d"</span>);
<a name="l00081"></a>00081 <span class="keywordflow">if</span> ( $ad == null ) <span class="keywordflow">continue</span>;
<a name="l00082"></a><a class="code" href="facture_8inc_8php.html#a1">00082</a> <a class="code" href="facture_8inc_8php.html#a1">$sql</a>=<span class="stringliteral">"update jrn set jr_rapt='' where jr_id=$ad"</span>;
<a name="l00083"></a><a class="code" href="facture_8inc_8php.html#a2">00083</a> <a class="code" href="eub__be_8inc_8php.html#a5">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,$sql);
<a name="l00084"></a>00084
<a name="l00085"></a>00085 }
<a name="l00086"></a>00086 <span class="comment">// set a paid flag for the checked box</span>
<a name="l00087"></a>00087 foreach ($_GET as $<a class="code" href="client_8inc_8php.html#a5">name</a>=&gt;$paid)
<a name="l00088"></a>00088 {
<a name="l00089"></a>00089 list ($<span class="keywordtype">id</span>) = sscanf ($<a class="code" href="client_8inc_8php.html#a5">name</a>,<span class="stringliteral">"rd_paid%d"</span>);
<a name="l00090"></a>00090
<a name="l00091"></a>00091 <span class="keywordflow">if</span> ( $<span class="keywordtype">id</span> == null ) <span class="keywordflow">continue</span>;
<a name="l00092"></a>00092 <span class="comment">// echo "Mise <20> jour $id";</span>
<a name="l00093"></a><a class="code" href="facture_8inc_8php.html#a3">00093</a> <a class="code" href="facture_8inc_8php.html#a3">$paid</a>=(<a class="code" href="facture_8inc_8php.html#a3">$paid</a>=='on')?'paid<span class="charliteral">':'</span>';
<a name="l00094"></a>00094 <a class="code" href="facture_8inc_8php.html#a1">$sql</a>=<span class="stringliteral">"update jrn set jr_rapt='$paid' where jr_id=$id"</span>;
<a name="l00095"></a>00095 <a class="code" href="eub__be_8inc_8php.html#a5">$Res</a>=<a class="code" href="postgres_8php.html#a2">ExecSql</a>($cn,$sql);
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097
<a name="l00098"></a>00098 }
<a name="l00099"></a>00099
<a name="l00100"></a>00100 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00101"></a>00101
<a name="l00102"></a>00102
<a name="l00103"></a>00103
<a name="l00104"></a>00104 echo '&lt;form method= <span class="stringliteral">"GET"</span> <a class="code" href="classaction.html">action</a>=<span class="stringliteral">"commercial.php"</span>&gt;';
<a name="l00105"></a>00105
<a name="l00106"></a><a class="code" href="facture_8inc_8php.html#a4">00106</a> <a class="code" href="balance_8php.html#a1">$hid</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"hidden"</span>);
<a name="l00107"></a>00107
<a name="l00108"></a><a class="code" href="facture_8inc_8php.html#a5">00108</a> <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;name=<span class="stringliteral">"p_action"</span>;
<a name="l00109"></a><a class="code" href="facture_8inc_8php.html#a6">00109</a> <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;value=<span class="stringliteral">"facture"</span>;
<a name="l00110"></a>00110 echo <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;IOValue();
<a name="l00111"></a>00111
<a name="l00112"></a>00112
<a name="l00113"></a>00113 <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;name=<span class="stringliteral">"sa"</span>;
<a name="l00114"></a>00114 <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;value=<span class="stringliteral">"list"</span>;
<a name="l00115"></a>00115 echo <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;IOValue();
<a name="l00116"></a>00116
<a name="l00117"></a>00117
<a name="l00118"></a>00118
<a name="l00119"></a><a class="code" href="facture_8inc_8php.html#a7">00119</a> <a class="code" href="balance_8php.html#a2">$w</a>=<span class="keyword">new</span> <a class="code" href="classwidget.html">widget</a>(<span class="stringliteral">"select"</span>);
<a name="l00120"></a>00120
<a name="l00121"></a><a class="code" href="facture_8inc_8php.html#a8">00121</a> <a class="code" href="balance_8php.html#a4">$periode_start</a>=<a class="code" href="ac__common_8php.html#a12">make_array</a>($cn,<span class="stringliteral">"select p_id,to_char(p_start,'DD-MM-YYYY') from parm_periode order by p_id"</span>);
<a name="l00122"></a>00122 <span class="comment">// User is already set User=new cl_user($cn);</span>
<a name="l00123"></a><a class="code" href="facture_8inc_8php.html#a9">00123</a> <a class="code" href="facture_8inc_8php.html#a9">$current</a>=(isset($_GET['p_periode']))?$_GET['p_periode']:<a class="code" href="user__action__ach_8php.html#a9">$User</a>-&gt;GetPeriode();
<a name="l00124"></a><a class="code" href="facture_8inc_8php.html#a10">00124</a> <a class="code" href="balance_8php.html#a2">$w</a>-&gt;selected=<a class="code" href="facture_8inc_8php.html#a9">$current</a>;
<a name="l00125"></a>00125
<a name="l00126"></a>00126 echo 'P<>riode '.$w-&gt;IOValue(<span class="stringliteral">"p_periode"</span>,$periode_start).$w-&gt;Submit('gl_submit<span class="charliteral">','</span>Valider');
<a name="l00127"></a><a class="code" href="facture_8inc_8php.html#a11">00127</a> <a class="code" href="contact_8inc_8php.html#a7">$qcode</a>=(isset($_GET['qcode']))?$_GET['qcode']:<span class="stringliteral">""</span>;
<a name="l00128"></a>00128 printf ('&lt;span&gt;Tiers QuickCode: &lt;input type="text" name="qcode" value="%s"&gt;&lt;/span&gt;',
<a name="l00129"></a>00129 $qcode);
<a name="l00130"></a>00130 echo <a class="code" href="client_8inc_8php.html#a9">$retour</a>;
<a name="l00131"></a>00131 <span class="comment">// Show list of sell</span>
<a name="l00132"></a>00132 <span class="comment">// Date - date of payment - Customer - amount</span>
<a name="l00133"></a>00133 <a class="code" href="facture_8inc_8php.html#a1">$sql</a>=<a class="code" href="constant_8php.html#a82">SQL_LIST_ALL_INVOICE</a>.<span class="stringliteral">" and jr_tech_per="</span>.<a class="code" href="facture_8inc_8php.html#a9">$current</a>.<span class="stringliteral">" and jr_def_type='VEN'"</span> ;
<a name="l00134"></a><a class="code" href="facture_8inc_8php.html#a12">00134</a> <a class="code" href="facture_8inc_8php.html#a12">$step</a>=<a class="code" href="commercial_8php.html#a0">$_SESSION</a>['g_pagesize'];
<a name="l00135"></a><a class="code" href="facture_8inc_8php.html#a13">00135</a> <a class="code" href="facture_8inc_8php.html#a13">$page</a>=(isset($_GET['offset']))?$_GET['page']:1;
<a name="l00136"></a><a class="code" href="facture_8inc_8php.html#a14">00136</a> <a class="code" href="facture_8inc_8php.html#a14">$offset</a>=(isset($_GET['offset']))?$_GET['offset']:0;
<a name="l00137"></a>00137
<a name="l00138"></a><a class="code" href="facture_8inc_8php.html#a15">00138</a> <a class="code" href="facture_8inc_8php.html#a15">$l</a>=<span class="stringliteral">""</span>;
<a name="l00139"></a>00139 <span class="comment">// check if qcode contains something</span>
<a name="l00140"></a>00140 <span class="keywordflow">if</span> ( $qcode != <span class="stringliteral">""</span> )
<a name="l00141"></a>00141 {
<a name="l00142"></a>00142 <span class="comment">// add a condition to filter on the quick code</span>
<a name="l00143"></a>00143 <a class="code" href="facture_8inc_8php.html#a15">$l</a>=<span class="stringliteral">" and jr_grpt_id in (select j_grpt from jrnx where j_qcode='$qcode') "</span>;
<a name="l00144"></a>00144 }
<a name="l00145"></a>00145
<a name="l00146"></a>00146 list($max_line,$list)=<a class="code" href="user__common_8php.html#a6">ListJrn</a>($cn,0,<span class="stringliteral">"where jrn_def_type='VEN' and jr_tech_per=$current $l "</span>
<a name="l00147"></a>00147 ,null,$offset,1);
<a name="l00148"></a><a class="code" href="facture_8inc_8php.html#a16">00148</a> <a class="code" href="facture_8inc_8php.html#a16">$bar</a>=<a class="code" href="user__common_8php.html#a16">jrn_navigation_bar</a>($offset,$max_line,$step,$page);
<a name="l00149"></a>00149
<a name="l00150"></a>00150 echo <span class="stringliteral">"&lt;hr&gt; $bar"</span>;
<a name="l00151"></a>00151 echo <a class="code" href="fiche__new_8php.html#a7">$list</a>;
<a name="l00152"></a>00152 echo <span class="stringliteral">"$bar &lt;hr&gt;"</span>;
<a name="l00153"></a>00153 <span class="keywordflow">if</span> ( $max_line !=0 )
<a name="l00154"></a>00154 echo <a class="code" href="balance_8php.html#a1">$hid</a>-&gt;Submit('paid<span class="charliteral">','</span>Mise <20> jour paiement');
<a name="l00155"></a>00155 echo '&lt;/<a class="code" href="constant_8php.html#a7">FORM</a>&gt;';
<a name="l00156"></a>00156
<a name="l00157"></a>00157 echo '&lt;/div&gt;';
<a name="l00158"></a>00158
<a name="l00159"></a>00159 <a class="code" href="balance_8php.html#a0">exit</a>();
<a name="l00160"></a>00160 }
<a name="l00162"></a>00162 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_subtmenu"</span>&gt;';
<a name="l00163"></a>00163 echo <a class="code" href="user__menu_8php.html#a5">ShowMenuJrnUser</a>($_SESSION['g_dossier'],'<a class="code" href="constant_8php.html#a16">VEN</a>',$p_jrn,'&lt;td <span class="keyword">class</span>=<span class="stringliteral">"cell"</span>&gt;&lt;A <span class="keyword">class</span>=<span class="stringliteral">"mtitle"</span> HREF=<span class="stringliteral">"commercial.php?liste&amp;p_action=facture&amp;sa=list"</span>&gt;Liste&lt;/A&gt;&lt;/td&gt;');
<a name="l00164"></a>00164 echo '&lt;/div&gt;';
<a name="l00166"></a>00166 <span class="comment">// if we request to add an item </span>
<a name="l00167"></a>00167 <span class="comment">// the $_POST['add_item'] is set</span>
<a name="l00168"></a>00168 <span class="comment">// or if we ask to correct the invoice</span>
<a name="l00169"></a>00169 <span class="keywordflow">if</span> ( isset ($_POST['add_item']) || isset ($_POST[<span class="stringliteral">"correct_new_invoice"</span>]) )
<a name="l00170"></a>00170 {
<a name="l00171"></a>00171 $nb_item=$_POST['nb_item'];
<a name="l00172"></a>00172 $nb_item++;
<a name="l00173"></a>00173 <a class="code" href="facture_8inc_8php.html#a17">$form</a>=<a class="code" href="user__form__ven_8php.html#a0">FormVenInput</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$_POST,<span class="keyword">false</span>,$nb_item);
<a name="l00174"></a>00174 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00175"></a>00175 echo <a class="code" href="facture_8inc_8php.html#a17">$form</a>;
<a name="l00176"></a>00176 echo '&lt;/div&gt;';
<a name="l00177"></a>00177 <a class="code" href="balance_8php.html#a0">exit</a>();
<a name="l00178"></a>00178 }
<a name="l00180"></a>00180 <span class="comment">// we want to save the invoice and to generate a invoice</span>
<a name="l00181"></a>00181 <span class="comment">//</span>
<a name="l00182"></a>00182 <span class="keywordflow">if</span> ( isset($_POST['record_and_print_invoice']))
<a name="l00183"></a>00183 {
<a name="l00184"></a>00184 <span class="comment">// First we save the invoice</span>
<a name="l00185"></a>00185 <a class="code" href="user__form__ven_8php.html#a3">RecordInvoice</a>($cn,$_POST,$User,$p_jrn);
<a name="l00186"></a><a class="code" href="facture_8inc_8php.html#a17">00186</a> <a class="code" href="facture_8inc_8php.html#a17">$form</a>=<a class="code" href="user__form__ven_8php.html#a2">FormVenteView</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$_POST,$_POST['nb_item'],'noform<span class="charliteral">','</span>');
<a name="l00187"></a>00187 <span class="comment">// $form=FormVenInput($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$_POST,true,$_POST['nb_item']);</span>
<a name="l00188"></a>00188 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00189"></a>00189 echo <a class="code" href="facture_8inc_8php.html#a17">$form</a>;
<a name="l00190"></a>00190 echo '&lt;hr&gt;';
<a name="l00191"></a>00191 <span class="comment">// Show the details of the encoded invoice </span>
<a name="l00192"></a>00192 <span class="comment">// and the url of the invoice</span>
<a name="l00193"></a>00193 <span class="keywordflow">if</span> ( isset($_POST['gen_invoice']))
<a name="l00194"></a>00194 {
<a name="l00195"></a>00195 <a class="code" href="document__modele_8inc_8php.html#a1">$doc</a>=<span class="keyword">new</span> <a class="code" href="classDocument.html">Document</a>($cn);
<a name="l00196"></a><a class="code" href="facture_8inc_8php.html#a18">00196</a> <a class="code" href="document__modele_8inc_8php.html#a1">$doc</a>-&gt;f_id=$_POST['e_client'];
<a name="l00197"></a><a class="code" href="facture_8inc_8php.html#a19">00197</a> <a class="code" href="document__modele_8inc_8php.html#a1">$doc</a>-&gt;md_id=$_POST['gen_doc'];
<a name="l00198"></a><a class="code" href="facture_8inc_8php.html#a20">00198</a> <a class="code" href="document__modele_8inc_8php.html#a1">$doc</a>-&gt;ag_id=0;
<a name="l00199"></a><a class="code" href="facture_8inc_8php.html#a21">00199</a> <a class="code" href="facture_8inc_8php.html#a21">$str_file</a>=<a class="code" href="document__modele_8inc_8php.html#a1">$doc</a>-&gt;Generate();
<a name="l00200"></a>00200 echo <a class="code" href="facture_8inc_8php.html#a21">$str_file</a>;
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 echo '&lt;/form&gt;';
<a name="l00203"></a>00203 <a class="code" href="balance_8php.html#a0">exit</a>();
<a name="l00204"></a>00204 }
<a name="l00206"></a>00206 <span class="comment">// we show the confirmation screen it is proposed here to generate the</span>
<a name="l00207"></a>00207 <span class="comment">// invoice</span>
<a name="l00208"></a>00208 <span class="keywordflow">if</span> ( isset ($_POST['view_invoice']) )
<a name="l00209"></a>00209 {
<a name="l00210"></a>00210 <a class="code" href="user__action__fin_8php.html#a3">$nb_number</a>=$_POST[<span class="stringliteral">"nb_item"</span>];
<a name="l00211"></a>00211 <span class="keywordflow">if</span> ( <a class="code" href="user__form__ach_8php.html#a1">form_verify_input</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$HTTP_POST_VARS,<a class="code" href="user__action__fin_8php.html#a3">$nb_number</a>) == <span class="keyword">true</span>)
<a name="l00212"></a>00212 {
<a name="l00213"></a>00213 $form=<a class="code" href="user__form__ven_8php.html#a2">FormVenteView</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$HTTP_POST_VARS,<a class="code" href="user__action__fin_8php.html#a3">$nb_number</a>);
<a name="l00214"></a>00214
<a name="l00215"></a>00215 } <span class="keywordflow">else</span> {
<a name="l00216"></a>00216 <span class="comment">// Check failed : invalid date or quantity</span>
<a name="l00217"></a>00217 <a class="code" href="ac__common_8php.html#a0">echo_error</a>(<span class="stringliteral">"Cannot validate "</span>);
<a name="l00218"></a>00218 $form=<a class="code" href="user__form__ven_8php.html#a0">FormVenInput</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),$HTTP_POST_VARS,<span class="keyword">false</span>,<a class="code" href="user__action__fin_8php.html#a3">$nb_number</a>);
<a name="l00219"></a>00219 }
<a name="l00220"></a>00220
<a name="l00221"></a>00221 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00222"></a>00222 echo $form;
<a name="l00223"></a>00223 echo '&lt;/div&gt;';
<a name="l00224"></a>00224 <a class="code" href="balance_8php.html#a0">exit</a>();
<a name="l00225"></a>00225
<a name="l00226"></a>00226 }
<a name="l00227"></a>00227
<a name="l00228"></a>00228
<a name="l00229"></a>00229
<a name="l00231"></a>00231 <span class="comment">// By default we add a new invoice</span>
<a name="l00232"></a>00232 <span class="keywordflow">if</span> ( $p_jrn != -1 )
<a name="l00233"></a>00233 {
<a name="l00234"></a>00234 <a class="code" href="show__pj_8php.html#a6">$jrn</a>=<span class="keyword">new</span> <a class="code" href="classjrn.html">jrn</a>($cn, $p_jrn);
<a name="l00235"></a>00235 <a class="code" href="debug_8php.html#a0">echo_debug</a>('user_action_ven.php',__LINE__,<span class="stringliteral">"Blank form"</span>);
<a name="l00236"></a>00236 <span class="comment">// Show an empty form of invoice</span>
<a name="l00237"></a>00237 $form=<a class="code" href="user__form__ven_8php.html#a0">FormVenInput</a>($cn,$_GET['p_jrn'],$User-&gt;GetPeriode(),null,<span class="keyword">false</span>,<a class="code" href="show__pj_8php.html#a6">$jrn</a>-&gt;GetDefLine('cred'));
<a name="l00238"></a>00238 echo '&lt;div <span class="keyword">class</span>=<span class="stringliteral">"u_redcontent"</span>&gt;';
<a name="l00239"></a>00239 echo $form;
<a name="l00240"></a>00240 echo '&lt;/div&gt;';
<a name="l00241"></a>00241 }
</pre></div><hr size="1"><address style="align: right;"><small>Generated on Fri Jun 23 00:12:46 2006 for phpcompta by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.4 </small></address>
</body>
</html>