[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
SF.net SVN: ledger-smb: [2043] branches/1.2/LedgerSMB/IS.pm
- Subject: SF.net SVN: ledger-smb: [2043] branches/1.2/LedgerSMB/IS.pm
- From: ..hidden..
- Date: Mon, 14 Jan 2008 09:26:54 -0800
Revision: 2043
http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=2043&view=rev
Author: einhverfr
Date: 2008-01-14 09:26:53 -0800 (Mon, 14 Jan 2008)
Log Message:
-----------
Correcting bug 1839776-- reposting sales invoice causes duplication.
Modified Paths:
--------------
branches/1.2/LedgerSMB/IS.pm
Modified: branches/1.2/LedgerSMB/IS.pm
===================================================================
--- branches/1.2/LedgerSMB/IS.pm 2008-01-12 06:24:57 UTC (rev 2042)
+++ branches/1.2/LedgerSMB/IS.pm 2008-01-14 17:26:53 UTC (rev 2043)
@@ -821,6 +821,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);
@@ -1820,10 +1824,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.