From c94d01852e47fec1f8580526fd116f5a58a71252 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Thu, 12 Jul 2007 20:48:40 +0000 Subject: Fixing bug 1751604-- fix not applicable to /trunk git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/branches/1.2@1390 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/IC.pm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'LedgerSMB/IC.pm') diff --git a/LedgerSMB/IC.pm b/LedgerSMB/IC.pm index 749a94e3..32771b6b 100755 --- a/LedgerSMB/IC.pm +++ b/LedgerSMB/IC.pm @@ -821,14 +821,11 @@ sub delete { my $query; - $query = qq|DELETE FROM parts WHERE id = ?|; - $sth = $dbh->prepare($query); - $sth->execute( $form->{id} ) || $form->dberror($query); - $query = qq|DELETE FROM partstax WHERE parts_id = ?|; $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); + if ( $form->{item} ne 'assembly' ) { $query = qq|DELETE FROM partsvendor WHERE parts_id = ?|; $sth = $dbh->prepare($query); @@ -860,6 +857,10 @@ sub delete { $sth = $dbh->prepare($query); $sth->execute( $form->{id} ) || $form->dberror($query); + $query = qq|DELETE FROM parts WHERE id = ?|; + $sth = $dbh->prepare($query); + $sth->execute( $form->{id} ) || $form->dberror($query); + # commit my $rc = $dbh->commit; -- cgit v1.2.3