[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1285] trunk/LedgerSMB



Revision: 1285
          http://svn.sourceforge.net/ledger-smb/?rev=1285&view=rev
Author:   einhverfr
Date:     2007-06-18 23:47:55 -0700 (Mon, 18 Jun 2007)

Log Message:
-----------
More voucher-related commits

Modified Paths:
--------------
    trunk/LedgerSMB/AA.pm
    trunk/LedgerSMB/GL.pm
    trunk/LedgerSMB/IR.pm
    trunk/LedgerSMB/IS.pm
    trunk/LedgerSMB/OP.pm

Modified: trunk/LedgerSMB/AA.pm
===================================================================
--- trunk/LedgerSMB/AA.pm	2007-06-19 06:37:26 UTC (rev 1284)
+++ trunk/LedgerSMB/AA.pm	2007-06-19 06:47:55 UTC (rev 1285)
@@ -326,6 +326,16 @@
         $query = qq| UPDATE $table SET approved = ? WHERE id = ?|;
         $dbh->prepare($query)->execute($form->{approved}, $form->{id}) ||
             $form->dberror($query);
+        if (!$form->{approved}){
+           if (not defined $form->{batch_id}){
+               $form->error($locale->text('Batch ID Missing'));
+           }
+           $query = qq| 
+		INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+           $dbh->prepare($query)->execute($form->{batch_id}, $form->{id}) ||
+                $form->dberror($query);
+        }
+        
     }
     @queries = $form->run_custom_queries( $table, 'INSERT' );
 

Modified: trunk/LedgerSMB/GL.pm
===================================================================
--- trunk/LedgerSMB/GL.pm	2007-06-19 06:37:26 UTC (rev 1284)
+++ trunk/LedgerSMB/GL.pm	2007-06-19 06:47:55 UTC (rev 1285)
@@ -135,6 +135,16 @@
         $query = qq| UPDATE gl SET approved = ? WHERE id = ?|;
         $dbh->prepare($query)->execute($form->{approved}, $form->{id}) 
              || $form->dberror($query);
+        if (!$form->{approved}){
+           if (not defined $form->{batch_id}){
+               $form->error($locale->text('Batch ID Missing'));
+           }
+           $query = qq| 
+			INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+           $sth = $dbh->prepare($query);
+           $sth->execute($form->{batch_id}, $form->{id}) ||
+                $form->dberror($query);
+       }
     }
     $sth = $dbh->prepare($query);
     $sth->execute( $form->{transdate}, $department_id, $form->{id} )

Modified: trunk/LedgerSMB/IR.pm
===================================================================
--- trunk/LedgerSMB/IR.pm	2007-06-19 06:37:26 UTC (rev 1284)
+++ trunk/LedgerSMB/IR.pm	2007-06-19 06:47:55 UTC (rev 1285)
@@ -300,6 +300,16 @@
                 $query = qq| UPDATE ap SET approved = ? WHERE id = ?|;
                 $dbh->prepare($query)->execute($form->{approved}, $form->{id}) 
                      || $form->dberror($query);
+                if (!$form->{approved}){
+                   if (not defined $form->{batch_id}){
+                       $form->error($locale->text('Batch ID Missing'));
+                   }
+                   $query = qq| 
+			INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+                   $sth = $dbh->prepare($query);
+                   $sth->execute($form->{batch_id}, $form->{id}) ||
+                        $form->dberror($query);
+               }
             }
 
             if ( $form->{"inventory_accno_id_$i"} ) {

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2007-06-19 06:37:26 UTC (rev 1284)
+++ trunk/LedgerSMB/IS.pm	2007-06-19 06:47:55 UTC (rev 1285)
@@ -1101,6 +1101,16 @@
                 $query = qq| UPDATE ar SET approved = ? WHERE id = ?|;
                 $dbh->prepare($query)->execute($form->{approved}, $form->{id}) 
                      || $form->dberror($query);
+                if (!$form->{approved}){
+                   if (not defined $form->{batch_id}){
+                       $form->error($locale->text('Batch ID Missing'));
+                   }
+                   $query = qq| 
+			INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+                   $sth = $dbh->prepare($query);
+                   $sth->execute($form->{batch_id}, $form->{id}) ||
+                        $form->dberror($query);
+               }
             }
 
             # add invoice_id

Modified: trunk/LedgerSMB/OP.pm
===================================================================
--- trunk/LedgerSMB/OP.pm	2007-06-19 06:37:26 UTC (rev 1284)
+++ trunk/LedgerSMB/OP.pm	2007-06-19 06:47:55 UTC (rev 1285)
@@ -96,6 +96,16 @@
     if (not defined $form->{approved}){
         $form->{approved} = 1;
     }
+    if (!$form->{approved}){
+       if (not defined $form->{batch_id}){
+           $form->error($locale->text('Batch ID Missing'));
+       }
+       $query = qq| 
+			INSERT INTO voucher (batch_id, trans_id) VALUES (?, ?)|;
+       $sth = $dbh->prepare($query);
+       $sth->execute($form->{batch_id}, $uid) ||
+            $form->dberror($query);
+       }
     $sth = $dbh->prepare($query);
     $sth->execute( $uid, $accno, $form->{datepaid}, $fxamount * $ml, 
          $form->{approved} )


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.