commit 642d2475100c11355670cac075d8f4b2433f6013
Author: Sven Schöling <s.schoeling@googlemail.com>
Date:   Mon May 9 14:23:40 2016 +0200

    Rechnungen löschen mit confirm nachfragen, und nicht mit Extrarequest

diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl
index 07ec02986..478060cc0 100644
--- a/bin/mozilla/is.pl
+++ b/bin/mozilla/is.pl
@@ -993,49 +993,6 @@ sub preview {
 
 }
 
-sub delete {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my $locale   = $main::locale;
-
-  $main::auth->assert('invoice_edit');
-
-  if ($form->{second_run}) {
-    $form->{print_and_post} = 0;
-  }
-  $form->header;
-
-  print qq|
-<form method="post" action="$form->{script}">
-|;
-
-  # delete action variable
-  map { delete $form->{$_} } qw(action header);
-
-  foreach my $key (keys %$form) {
-    next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key}));
-    $form->{$key} =~ s/\"/&quot;/g;
-    print qq|<input type="hidden" name="$key" value="$form->{$key}">\n|;
-  }
-
-  print qq|
-<h2 class="confirm">| . $locale->text('Confirm!') . qq|</h2>
-
-<h4>|
-    . $locale->text('Are you sure you want to delete Invoice Number')
-    . qq| $form->{invnumber}
-</h4>
-
-<p>
-<input name="action" class="submit" type="submit" value="|
-    . $locale->text('Yes') . qq|">
-</form>
-|;
-
-  $main::lxdebug->leave_sub();
-}
-
 sub credit_note {
   $main::lxdebug->enter_sub();
 
@@ -1124,29 +1081,21 @@ sub display_form {
   $::lxdebug->leave_sub;
 }
 
-sub yes {
-  $main::lxdebug->enter_sub();
-
-  my $form     = $main::form;
-  my %myconfig = %main::myconfig;
-  my $locale   = $main::locale;
-
-  $main::auth->assert('invoice_edit');
+sub delete {
+  $::auth->assert('invoice_edit');
 
-  if (IS->delete_invoice(\%myconfig, \%$form)) {
+  if (IS->delete_invoice(\%::myconfig, $::form)) {
     # saving the history
-    if(!exists $form->{addition}) {
-      $form->{snumbers}  = 'invnumber' .'_'. $form->{invnumber}; # ($form->{type} eq 'credit_note' ? 'cnnumber' : 'invnumber') .'_'. $form->{invnumber};
-      $form->{what_done} = 'invoice';
-      $form->{addition}  = "DELETED";
-      $form->save_history;
+    if(!exists $::form->{addition}) {
+      $::form->{snumbers}  = 'invnumber' .'_'. $::form->{invnumber};
+      $::form->{what_done} = 'invoice';
+      $::form->{addition}  = "DELETED";
+      $::form->save_history;
     }
     # /saving the history
-    $form->redirect($locale->text('Invoice deleted!'));
+    $::form->redirect($::locale->text('Invoice deleted!'));
   }
-  $form->error($locale->text('Cannot delete invoice!'));
-
-  $main::lxdebug->leave_sub();
+  $::form->error($::locale->text('Cannot delete invoice!'));
 }
 
 sub post_and_e_mail {
diff --git a/locale/de/all b/locale/de/all
index b8c2d6f23..be7edb740 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -944,6 +944,7 @@ $self->{texts} = {
   'Do you really want to delete AR transaction #1?' => 'Wollen Sie wirklich die Debitorenbuchung #1 löschen?',
   'Do you really want to delete GL transaction #1?' => 'Wollen Sie wirklich die Dialogbuchung #1 löschen?',
   'Do you really want to delete the selected links?' => 'Wollen Sie wirklich die ausgewählten Verknüpfungen löschen?',
+  'Do you really want to delete this invoice?' => 'Wollen Sie diese Rechnung wirklich löschen?',
   'Do you really want to delete this object?' => 'Wollen Sie dieses Objekt wirklich löschen?',
   'Do you really want to delete this warehouse?' => 'Wollen Sie dieses Lager wirklich l&ouml;schen?',
   'Do you really want to revert to this version?' => 'Wollen Sie wirklich auf diese Version zurücksetzen?',
diff --git a/templates/webpages/is/form_footer.html b/templates/webpages/is/form_footer.html
index 3212a4f42..7262aa407 100644
--- a/templates/webpages/is/form_footer.html
+++ b/templates/webpages/is/form_footer.html
@@ -155,8 +155,8 @@
 
 <p>[% print_options %]</p>
   <input type="hidden" name="action" value="dispatcher">
-  [% IF id %]
 
+  [% IF id %]
     <input class="submit" type="submit" accesskey="u" name="action_update" id="update_button" value="[% 'Update' | $T8 %]">
     <input class="submit" type="submit" name="action_ship_to" value="[% 'Ship to' | $T8 %]">
     <input class="submit" type="submit" name="action_print" value="[% 'Print' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
@@ -171,7 +171,7 @@
     <input class="submit" type="submit" name="action_credit_note" value="[% 'Credit Note' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
 [% END %]
 [% IF show_delete && (!storno || storno_id) %]
-    <input class="submit" type="submit" name="action_delete" value="[% 'Delete' | $T8 %]">
+    [% L.submit_tag("action_delete", LxERP.t8("Delete"), confirm=LxERP.t8('Do you really want to delete this invoice?')) %]
 [% END %]
 [% IF show_delete && !storno %]
     <input class="submit" type="submit" name="action_post" value="[% 'Post' | $T8 %]" data-require-transaction-description="[% INSTANCE_CONF.get_require_transaction_description_ps %]">
