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

SF.net SVN: ledger-smb: [2044] trunk/LedgerSMB/IS.pm



Revision: 2044
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2044&view=rev
Author:   einhverfr
Date:     2008-01-14 09:29:29 -0800 (Mon, 14 Jan 2008)

Log Message:
-----------
Merging bug fix 1839776 from 1.2

Modified Paths:
--------------
    trunk/LedgerSMB/IS.pm

Modified: trunk/LedgerSMB/IS.pm
===================================================================
--- trunk/LedgerSMB/IS.pm	2008-01-14 17:26:53 UTC (rev 2043)
+++ trunk/LedgerSMB/IS.pm	2008-01-14 17:29:29 UTC (rev 2044)
@@ -826,6 +826,10 @@
 
     %$form->{acc_trans} = ();
 
+    if ($form->{id}){
+        delete_invoice($self, $myconfig, $form);
+    }
+
     ( $null, $form->{employee_id} ) = split /--/, $form->{employee};
     unless ( $form->{employee_id} ) {
         ( $form->{employee}, $form->{employee_id} ) = $form->get_employee($dbh);
@@ -1837,10 +1841,21 @@
     $form->audittrail( $dbh, "", \%audittrail );
 
     # delete AR record
-    my $query = qq|DELETE FROM ar WHERE id = ?|;
+    
+    my $query = qq|DELETE FROM invoice WHERE trans_id = ?|;
     $sth = $dbh->prepare($query);
     $sth->execute( $form->{id} ) || $form->dberror($query);
+    $sth->finish;
+    $query = qq|DELETE FROM acc_trans WHERE trans_id = ?|;
+    $sth = $dbh->prepare($query);
+    $sth->execute( $form->{id} ) || $form->dberror($query);
+    $sth->finish;
 
+    $query = qq|DELETE FROM ar WHERE id = ?|;
+    $sth = $dbh->prepare($query);
+    $sth->execute( $form->{id} ) || $form->dberror($query);
+    $sth->finish;
+
     # delete spool files
     $query = qq|
 		SELECT spoolfile FROM status


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