From: G. Richardson Date: Tue, 21 Jun 2011 15:54:16 +0000 (+0200) Subject: Bug 1275: Unbenutzte Lieferadressen lassen sich nicht löschen X-Git-Tag: release-2.7.0beta1~365^2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=94d6b5f998a65c6d1932eb4439097b69801fbc4c;p=kivitendo-erp.git Bug 1275: Unbenutzte Lieferadressen lassen sich nicht löschen Code für Löschen von Lieferadresse und Kontaktperson hatte sich vermischt. --- diff --git a/SL/CT.pm b/SL/CT.pm index b36cfa3e8..6d801d488 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -1045,7 +1045,24 @@ sub delete_shipto { my %myconfig = %main::myconfig; my $dbh = $form->get_standard_dbh(\%myconfig); - do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $shipto_id); + do_query($form, $dbh, qq|UPDATE shipto SET trans_id = NULL WHERE shipto_id = ?|, $shipto_id); + + $dbh->commit(); + + $main::lxdebug->leave_sub(); +} + +sub delete_contact { + $main::lxdebug->enter_sub(); + + my $self = shift; + my $cp_id = shift; + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $dbh = $form->get_standard_dbh(\%myconfig); + + do_query($form, $dbh, qq|UPDATE contacts SET cp_cv_id = NULL WHERE cp_id = ?|, $cp_id); $dbh->commit(); diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 4121ac5e4..b25509ec6 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -717,7 +717,7 @@ sub delete_contact { CT->get_contact(\%myconfig, \%$form); unless ($form->{cp_used}) { - CT->delete_shipto($form->{cp_id}); + CT->delete_contact($form->{cp_id}); @$form{ grep /^cp_/, keys %$form } = undef; }