Und der eigentliche Loeschmechanismus.
authorSven Schöling <s.schoeling@linet-services.de>
Tue, 19 Feb 2008 13:38:41 +0000 (13:38 +0000)
committerSven Schöling <s.schoeling@linet-services.de>
Tue, 19 Feb 2008 13:38:41 +0000 (13:38 +0000)
Loeschen in diesem Fall heisst den Eintrag verwaisen, d.h. der Eintrag ist noch im System, aber keinem Kunden zugeordnet.

SL/CT.pm
bin/mozilla/ct.pl
locale/de/all
locale/de/ct
templates/webpages/ct/form_header_de.html
templates/webpages/ct/form_header_master.html

index d22017d..6cd9b91 100644 (file)
--- 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;
index 8223a6e..f72362e 100644 (file)
@@ -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}); }
index 418df68..4835f11 100644 (file)
@@ -438,7 +438,7 @@ aktualisieren wollen?',
   'Delete'                      => 'Löschen',
   'Delete Account'              => 'Konto löschen',
   'Delete Dataset'              => 'Datenbank löschen',
-  'Delete Shipto'               => 'Lieferadresse l&ouml;schen',
+  'Delete Shipto'               => 'Lieferadresse löschen',
   'Delete delivery order'       => 'Lieferschein l&ouml;schen',
   'Delete drafts'               => 'Entwürfe löschen',
   'Delete group'                => 'Gruppe l&ouml;schen',
index e7bacf8..a2d15c6 100644 (file)
@@ -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&ouml;schen'  => 'delete_shipto',
+  'lieferadresse_löschen'       => 'delete_shipto',
   'neue_ware'                   => 'new_part',
   'speichern'                   => 'save',
   'speichern_und_debitorenbuchung_erfassen' => 'save_and_ar_transaction',
index 7ba5558..77a226a 100644 (file)
      </tr>
     </table>
 
-    <input type="submit" id="delete_shipto" name="delete_shipto" value="Lieferadresse l&ouml;schen" disabled>
+    <input type="submit" id="delete_shipto" name="action" value="Lieferadresse löschen" disabled>
     <br style="clear: left" />
    </div>
 
index b79d19a..0dadc08 100644 (file)
      </tr>
     </table>
 
-    <input type="submit" id="delete_shipto" name="delete_shipto" value="<translate>Delete Shipto</translate>" disabled>
+    <input type="submit" id="delete_shipto" name="action" value="<translate>Delete Shipto</translate>" disabled>
     <br style="clear: left" />
    </div>