Beim Anlegen von Buchungsgruppen die in den Benutzereinstellungen ausgewählten Standa...
[kivitendo-erp.git] / bin / mozilla / is.pl
index 6ef3fb2..9810748 100644 (file)
@@ -69,8 +69,6 @@ sub add {
   }
   &invoice_links;
   &prepare_invoice;
-  $form->{format} = "pdf";
-
   &display_form;
 
   $lxdebug->leave_sub();
@@ -1094,6 +1092,9 @@ if ($form->{type} eq "credit_note") {
       . $locale->text('Storno') . qq|">| unless ($form->{storno});
     print qq|<input class=submit type=submit name=action value="|
       . $locale->text('Post Payment') . qq|">
+|;
+    print qq|<input class=submit type=submit name=action value="|
+      . $locale->text('Use As Template') . qq|">
 |;
   if ($form->{id} && !($form->{type} eq "credit_note")) {
     print qq|
@@ -1440,6 +1441,18 @@ sub print_and_post {
 
 }
 
+sub use_as_template {
+  $lxdebug->enter_sub();
+
+  map { delete $form->{$_} } qw(printed emailed queued invnumber invdate deliverydate id datepaid_1 source_1 memo_1 paid_1 exchangerate_1 AP_paid_1 storno);
+  $form->{paidaccounts} = 1;
+  $form->{rowcount}--;
+  $form->{invdate} = $form->current_date(\%myconfig);
+  &display_form;
+
+  $lxdebug->leave_sub();
+}
+
 sub storno {
   $lxdebug->enter_sub();
 
@@ -1451,7 +1464,6 @@ sub storno {
   $form->{storno} = 1;
   $form->{id} = "";
   $form->{invnumber} = "Storno zu " . $form->{invnumber};
-  $form->{rowcount}--;
 
   &post();
   $lxdebug->leave_sub();