From: Sven Schöling Date: Tue, 19 Feb 2008 13:38:41 +0000 (+0000) Subject: Und der eigentliche Loeschmechanismus. X-Git-Tag: release-2.6.0beta1~234 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ee82a6ce45291872bfb41d178352b61a9b9be957;p=kivitendo-erp.git Und der eigentliche Loeschmechanismus. Loeschen in diesem Fall heisst den Eintrag verwaisen, d.h. der Eintrag ist noch im System, aber keinem Kunden zugeordnet. --- diff --git a/SL/CT.pm b/SL/CT.pm index d22017d4f..6cd9b91db 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -986,4 +986,21 @@ sub _delete_selected_notes { $main::lxdebug->leave_sub(); } +sub delete_shipto { + $main::lxdebug->enter_sub(); + + my $self = shift; + my $shipto_id = shift; + + my $form = $main::form; + my %myconfig = %main::myconfig; + my $dbh = $form->get_standard_dbh(\%myconfig); + + do_query($form, $dbh, qq|UPDATE shipto SET trans_id = NULL WHERE shipto_id = ?|, $shipto_id); + + $dbh->commit(); + + $main::lxdebug->leave_sub(); +} + 1; diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index 8223a6ef7..f72362e03 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -594,4 +594,18 @@ sub get_delivery { $lxdebug->leave_sub(); } +sub delete_shipto { + $main::lxdebug->enter_sub(); + + $auth->assert('customer_vendor_edit'); + + CT->delete_shipto($form->{shipto_id}); + + @$form{ grep /^shipto/, keys %$form } = undef; + + display(); + + $main::lxdebug->leave_sub(); +} + sub continue { call_sub($form->{nextsub}); } diff --git a/locale/de/all b/locale/de/all index 418df68b4..4835f1103 100644 --- a/locale/de/all +++ b/locale/de/all @@ -438,7 +438,7 @@ aktualisieren wollen?', 'Delete' => 'Löschen', 'Delete Account' => 'Konto löschen', 'Delete Dataset' => 'Datenbank löschen', - 'Delete Shipto' => 'Lieferadresse löschen', + 'Delete Shipto' => 'Lieferadresse löschen', 'Delete delivery order' => 'Lieferschein löschen', 'Delete drafts' => 'Entwürfe löschen', 'Delete group' => 'Gruppe löschen', diff --git a/locale/de/ct b/locale/de/ct index e7bacf872..a2d15c631 100644 --- a/locale/de/ct +++ b/locale/de/ct @@ -197,6 +197,7 @@ $self->{subs} = { 'continue' => 'continue', 'cov_selection_internal' => 'cov_selection_internal', 'delete' => 'delete', + 'delete_shipto' => 'delete_shipto', 'delivery_customer_selection' => 'delivery_customer_selection', 'display' => 'display', 'edit' => 'edit', @@ -235,7 +236,7 @@ $self->{subs} = { 'erfassen' => 'add', 'weiter' => 'continue', 'löschen' => 'delete', - 'lieferadresse_löschen' => 'delete_shipto', + 'lieferadresse_löschen' => 'delete_shipto', 'neue_ware' => 'new_part', 'speichern' => 'save', 'speichern_und_debitorenbuchung_erfassen' => 'save_and_ar_transaction', diff --git a/templates/webpages/ct/form_header_de.html b/templates/webpages/ct/form_header_de.html index 7ba555827..77a226a57 100644 --- a/templates/webpages/ct/form_header_de.html +++ b/templates/webpages/ct/form_header_de.html @@ -302,7 +302,7 @@ - +
diff --git a/templates/webpages/ct/form_header_master.html b/templates/webpages/ct/form_header_master.html index b79d19a64..0dadc080f 100644 --- a/templates/webpages/ct/form_header_master.html +++ b/templates/webpages/ct/form_header_master.html @@ -302,7 +302,7 @@ - +