]> wagnertech.de Git - mfinanz.git/blobdiff - bin/mozilla/ir.pl
EK-Rechnung: Bei Verbleib in der Maske nach Buchen Dokumenten-Tab laden
[mfinanz.git] / bin / mozilla / ir.pl
index da168a2286a9d10f2fbc24d455a11582fee62fd1..069b9a780d33855ccea543b9f498d8648f271f55 100644 (file)
@@ -33,6 +33,7 @@
 #======================================================================
 
 use SL::FU;
+use SL::Helper::Flash qw(flash_later);
 use SL::IR;
 use SL::IS;
 use SL::DB::BankTransactionAccTrans;
@@ -935,12 +936,21 @@ sub post {
       $form->save_history;
     }
     # /saving the history
-    $form->{callback} = 'ir.pl?action=edit&id=' . $form->{id};
-    $form->redirect(  $locale->text('Invoice')
-                  . " $form->{invnumber} "
-                  . ", " . $locale->text('ID')
-                  . ': ' . $form->{id} . ' '
-                  . $locale->text('posted!'));
+
+    my $redirect_url;
+    if ($::instance_conf->get_ir_add_doc && $::instance_conf->get_doc_storage) {
+      $redirect_url = build_std_url("script=ir.pl", 'action=edit', 'id=' . E($form->{id}), 'fragment=ui-tabs-docs');
+    } else {
+      $redirect_url = build_std_url("script=ir.pl", 'action=edit', 'id=' . E($form->{id}));
+    }
+    SL::Helper::Flash::flash_later('info',
+                                   $locale->text('Invoice')
+                                   . " $form->{invnumber} "
+                                   . ", " . $locale->text('ID')
+                                   . ': ' . $form->{id} . ' '
+                                   . $locale->text('posted!'));
+    print $form->redirect_header($redirect_url);
+    $::dispatcher->end_request;
   }
   $form->error($locale->text('Cannot post invoice!'));