diff options
Diffstat (limited to 'LedgerSMB/IC.pm')
-rwxr-xr-x | LedgerSMB/IC.pm | 9 |
1 files changed, 5 insertions, 4 deletions
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; |