/[phpcompta]/phpcompta/html/annulation.php
ViewVC logotype

Diff of /phpcompta/html/annulation.php

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

revision 1.27 by sparkyx, Tue Sep 27 16:43:04 2005 UTC revision 1.28 by sparkyx, Wed Sep 28 10:16:14 2005 UTC
# Line 85  if  ($p_id != -1 ) { // A Line 85  if  ($p_id != -1 ) { // A
85      // Periode fermée      // Periode fermée
86      if ( PeriodeClosed ($cn,$userPref)=='t' )      if ( PeriodeClosed ($cn,$userPref)=='t' )
87        {        {
88                  $msg="This periode is closed please change your preference";          $msg="Votre periode par defaut est fermee, changez vos preferences";
89                  echo_error($msg);                  echo_error($msg);
90                  echo "<SCRIPT>alert('$msg');</SCRIPT>";                  echo "<SCRIPT>alert('$msg');</SCRIPT>";
91                  // set an incorrect pid to get out from here                  // set an incorrect pid to get out from here
# Line 100  if  ($p_id != -1 ) { // A Line 100  if  ($p_id != -1 ) { // A
100        // if the operation is in a closed or centralized period        // if the operation is in a closed or centralized period
101        // the operation is voided thanks the opposite operation        // the operation is voided thanks the opposite operation
102     StartSql($cn);     StartSql($cn);
103     $p_internal=SetInternalCode($cn,$p_id,$l_array['jr_id']);     $p_internal=SetInternalCode($cn,$p_id,$l_array['jr_def_id']);
104     $grp_new=NextSequence($cn,'s_grpt');     $grp_new=NextSequence($cn,'s_grpt');
105     $sql= "insert into jrn (     $sql= "insert into jrn (
106                  jr_def_id,jr_montant,jr_comment,                                jr_def_id,jr_montant,jr_comment,              
# Line 115  if  ($p_id != -1 ) { // A Line 115  if  ($p_id != -1 ) { // A
115     $Res=ExecSql($cn,$sql);     $Res=ExecSql($cn,$sql);
116     // Check return code     // Check return code
117     if ( $Res == false ) { Rollback($cn);exit(-1);}     if ( $Res == false ) { Rollback($cn);exit(-1);}
    // Mark the operation invalid into the ledger  
    // to avoid to nullify twice the same op.  
    $sql="update jrn set jr_valid=false where jr_grpt_id=".$_POST['p_id'];  
    $Res=ExecSql($cn,$sql);  
    // Check return code  
    if ( $Res == false ) { Rollback($cn);exit(-1);}  
118    
119    // Make also the change into jrnx    // Make also the change into jrnx
120     $sql= "insert into jrnx (     $sql= "insert into jrnx (
# Line 134  if  ($p_id != -1 ) { // A Line 128  if  ($p_id != -1 ) { // A
128     $Res=ExecSql($cn,$sql);     $Res=ExecSql($cn,$sql);
129     // Check return code     // Check return code
130     if ( $Res == false ) { Rollback($cn);exit(-1);}     if ( $Res == false ) { Rollback($cn);exit(-1);}
131        // Mark the operation invalid into the ledger
132        // to avoid to nullify twice the same op.
133        $sql="update jrn set jr_comment='Annule : '||jr_comment where jr_grpt_id=".$_POST['p_id'];
134        $Res=ExecSql($cn,$sql);
135        // Check return code
136        if ( $Res == false ) { Rollback($cn);exit(-1);}
137    
138     // the table stock must updated     // the table stock must updated
139     // also in the stock table     // also in the stock table

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

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