From f850f64b1c76d4f1f5386874d7eda15dd4d3071d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Thu, 8 Jul 2021 13:17:35 +0200 Subject: [PATCH] EK-Rechnung: Bei Verbleib in der Maske nach Buchen Dokumenten-Tab laden --- bin/mozilla/ir.pl | 27 +++++++++++++++----------- templates/webpages/ir/form_header.html | 9 +++++++-- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/bin/mozilla/ir.pl b/bin/mozilla/ir.pl index 0b9a4b227..069b9a780 100644 --- a/bin/mozilla/ir.pl +++ b/bin/mozilla/ir.pl @@ -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,17 +936,21 @@ sub post { $form->save_history; } # /saving the history - # I keep the old default / comment for refactorer, pls check instance_conf: - #if ($::instance_conf->get_ir_add_doc && $::instance_conf->get_doc_storage) { - # my $add_doc_url = build_std_url("script=ir.pl", 'action=edit', 'id=' . E($form->{id})); - # print $form->redirect_header($add_doc_url); - #} - $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!')); diff --git a/templates/webpages/ir/form_header.html b/templates/webpages/ir/form_header.html index 7604566aa..680d2d1ff 100644 --- a/templates/webpages/ir/form_header.html +++ b/templates/webpages/ir/form_header.html @@ -14,7 +14,7 @@

[% saved_message %]

[%- FOREACH key = HIDDENS %] - + [% L.hidden_tag(key, $key) %] [%- END %] @@ -33,7 +33,7 @@ [%- END %] [%- IF id %] [%- IF INSTANCE_CONF.get_doc_storage %] -
  • [% 'Documents' | $T8 %]
  • +
  • [% 'Documents' | $T8 %]
  • [% 'Attachments' | $T8 %]
  • [%- END %] [%- IF AUTH.assert('record_links', 1) %] @@ -43,6 +43,10 @@ [%- END %] +[%- IF INSTANCE_CONF.get_doc_storage %] +
    +[%- END %] +
    @@ -201,6 +205,7 @@ [% IF creditwarning != '' %] alert('[% 'Credit Limit exceeded!!!' | $T8 %]'); [% END %] + kivi.File.doc_tab_init('ir_tabs', 'ui-tabs-docs', $('#id').val(), 'purchase_invoice'); }); //--> -- 2.20.1