/[phpcompta]/phpcompta/include/user_action_ach.php
ViewVC logotype

Diff of /phpcompta/include/user_action_ach.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.15 by sparkyx, Sun Mar 6 18:30:13 2005 UTC revision 1.16 by stanpinte, Mon Jul 4 17:58:51 2005 UTC
# Line 37  $action=(isset($_GET['action']))?$_GET[' Line 37  $action=(isset($_GET['action']))?$_GET['
37  if ( $action == 'new' ) {  if ( $action == 'new' ) {
38  // We request a new form  // We request a new form
39    // Check privilege    // Check privilege
40    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) != 2 )    {    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) != 2 )    {
41         NoAccess();         NoAccess();
42         exit -1;         exit -1;
43    }    }
# Line 49  if ( $action == 'new' ) { Line 49  if ( $action == 'new' ) {
49            // add a one-line calculator            // add a one-line calculator
50    
51    
52            $r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,null,false);            $r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,null,false);
53            echo '<div class="u_redcontent">';            echo '<div class="u_redcontent">';
54            echo $r;            echo $r;
55            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
# Line 68  if ( $action == 'new' ) { Line 68  if ( $action == 'new' ) {
68            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
69                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
70    
71            $r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);            $r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);
72            echo '<div class="u_redcontent">';            echo '<div class="u_redcontent">';
73            echo $r;            echo $r;
74            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
# Line 83  if ( $action == 'new' ) { Line 83  if ( $action == 'new' ) {
83            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
84                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
85    
86            $r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);            $r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);
87            echo '<div class="u_redcontent">';            echo '<div class="u_redcontent">';
88            echo $r;            echo $r;
89            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";            echo "<div><h4>On-line calculator</h4>".JS_CALC_LINE."<div>";
# Line 97  if ( $action == 'new' ) { Line 97  if ( $action == 'new' ) {
97          $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';          $submit='<INPUT TYPE="SUBMIT" name="save" value="Confirmer">';
98          $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';          $submit.='<INPUT TYPE="SUBMIT" name="correct" value="Corriger">';
99    
100          $r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);          $r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,$nb_number);
101    
102          // if something goes wrong, correct it          // if something goes wrong, correct it
103          if ( $r == null ) {          if ( $r == null ) {
104            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">            $submit='<INPUT TYPE="SUBMIT" NAME="add_item" VALUE="Ajout article">
105                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';                      <INPUT TYPE="SUBMIT" NAME="view_invoice" VALUE="Sauver">';
106            $r=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);            $r=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,false,  $nb_number);
107          }          }
108          echo '<div class="u_redcontent">';          echo '<div class="u_redcontent">';
109          echo $r;          echo $r;
# Line 112  if ( $action == 'new' ) { Line 112  if ( $action == 'new' ) {
112          }          }
113          // Save the charge into database          // Save the charge into database
114          if ( isset($_POST['save'] )) {          if ( isset($_POST['save'] )) {
115            $r=RecordAchat($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_SESSION['g_jrn']);            $r=RecordAchat($cn,$HTTP_POST_VARS,$_SESSION['g_user'],$_GET['p_jrn']);
116            // Get number of  lines            // Get number of  lines
117            $nb_number=$_POST["nb_item"];            $nb_number=$_POST["nb_item"];
118    
119            // submit button in the form            // submit button in the form
120            $submit='<h2 class="info">Recorded</h2>';            $submit='<h2 class="info">Recorded</h2>';
121    
122            $r.=FormAch($cn,$_SESSION['g_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,  $nb_number,true);            $r.=FormAch($cn,$_GET['p_jrn'],$_SESSION['g_user'],$submit,$HTTP_POST_VARS,true,  $nb_number,true);
123            echo '<div class="u_redcontent">';            echo '<div class="u_redcontent">';
124            echo $r;            echo $r;
125            echo "</div>";            echo "</div>";
# Line 130  if ( $action == 'new' ) { Line 130  if ( $action == 'new' ) {
130  }  }
131  if ( $action == 'voir_jrn' ) {  if ( $action == 'voir_jrn' ) {
132    // Check privilege    // Check privilege
133    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1  )    {    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1  )    {
134         NoAccess();         NoAccess();
135         exit -1;         exit -1;
136    }    }
# Line 153  echo 'Période  '.$w->IOValue("p_periode" Line 153  echo 'Période  '.$w->IOValue("p_periode"
153   // Show list of sell   // Show list of sell
154    echo_debug ("user_action_ach.php");    echo_debug ("user_action_ach.php");
155   // Date - date of payment - Customer - amount   // Date - date of payment - Customer - amount
156     $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_SESSION['g_jrn'];     $sql=SQL_LIST_ALL_INVOICE." and jr_tech_per=".$current." and jr_def_id=".$_GET['p_jrn'];
157     $list=ListJrn($cn,$_SESSION['g_jrn'],$sql);     $list=ListJrn($cn,$_GET['p_jrn'],$sql);
158    
159     echo $list;     echo $list;
160     echo '</div>';     echo '</div>';
161  }  }
162  if ( $action == 'voir_jrn_non_paye' ) {  if ( $action == 'voir_jrn_non_paye' ) {
163    // Check privilege    // Check privilege
164    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 )    {    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 )    {
165         NoAccess();         NoAccess();
166         exit -1;         exit -1;
167    }    }
168    
169  // Show list of unpaid sell  // Show list of unpaid sell
170  // Date - date of payment - Customer - amount  // Date - date of payment - Customer - amount
171    $sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=".$_SESSION['g_jrn']  ;    $sql=SQL_LIST_UNPAID_INVOICE_DATE_LIMIT." and jr_def_id=".$_GET['p_jrn']  ;
172    $list=ListJrn($cn,$_SESSION['g_jrn'],$sql);    $list=ListJrn($cn,$_GET['p_jrn'],$sql);
173    $sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=".$_SESSION['g_jrn']  ;    $sql=SQL_LIST_UNPAID_INVOICE." and jr_def_id=".$_GET['p_jrn']  ;
174    $list2=ListJrn($cn,$_SESSION['g_jrn'],$sql);    $list2=ListJrn($cn,$_GET['p_jrn'],$sql);
175      echo '<div class="u_redcontent">';      echo '<div class="u_redcontent">';
176      echo '<h2 class="info"> Echeance dépassée </h2>';      echo '<h2 class="info"> Echeance dépassée </h2>';
177      echo $list;      echo $list;
# Line 183  if ( $action == 'voir_jrn_non_paye' ) { Line 183  if ( $action == 'voir_jrn_non_paye' ) {
183  //Search  //Search
184  if ( $action == 'search' ) {  if ( $action == 'search' ) {
185    // Check privilege    // Check privilege
186    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_SESSION['g_jrn']) < 1 )    {    if ( CheckJrn($_SESSION['g_dossier'],$_SESSION['g_user'],$_GET['p_jrn']) < 1 )    {
187         NoAccess();         NoAccess();
188         exit -1;         exit -1;
189    }    }
# Line 192  if ( $action == 'search' ) { Line 192  if ( $action == 'search' ) {
192    $sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];    $sessid=(isset ($_POST['PHPSESSID']))?$_POST['PHPSESSID']:$_GET['PHPSESSID'];
193    
194  // display a search box  // display a search box
195    $search_box=u_ShowMenuRecherche($cn,$_SESSION['g_jrn'],$sessid,$HTTP_POST_VARS);    $search_box=u_ShowMenuRecherche($cn,$_GET['p_jrn'],$sessid,$HTTP_POST_VARS);
196    echo '<DIV class="u_redcontent">';    echo '<DIV class="u_redcontent">';
197    echo $search_box;    echo $search_box;
198    // if nofirst is set then show result    // if nofirst is set then show result
199    if ( isset ($_GET['nofirst'] ) )     {    if ( isset ($_GET['nofirst'] ) )     {
200      $a=ListJrn($cn,$_SESSION['g_jrn'],"",$HTTP_POST_VARS);      $a=ListJrn($cn,$_GET['p_jrn'],"",$HTTP_POST_VARS);
201      echo $a;      echo $a;
202    }    }
203    echo '</DIV>';    echo '</DIV>';

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26