summaryrefslogtreecommitdiff
path: root/LedgerSMB/IC.pm
diff options
context:
space:
mode:
Diffstat (limited to 'LedgerSMB/IC.pm')
-rwxr-xr-xLedgerSMB/IC.pm9
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;