use SL::AP;
use SL::FU;
use SL::GL;
-use SL::Helper::Flash qw(flash);
+use SL::Helper::Flash qw(flash flash_later);
use SL::IR;
use SL::IS;
use SL::ReportGenerator;
$form->{what_done} = "invoice";
$form->save_history;
}
- # no restore_from_session_id needed. we like to have a newly generated
- # list of invoices for bank transactions
- print $form->redirect_header($form->{callback}) if ($form->{callback} =~ /BankTransaction/);
- # With version 3.5 we can add documents, but only after posting. there should be a flag in myconfig for the user
- # $form->{callback} ||= 'ap.pl?action=edit&id=' . $form->{id} if $myconfig{no_reset_arap};
- # or a client config setting
- if ($::instance_conf->get_ap_add_doc && $::instance_conf->get_doc_storage) {
- my $add_doc_url = build_std_url("script=ap.pl", 'action=edit', 'id=' . E($form->{id}), 'fragment=ui-tabs-docs');
- print $form->redirect_header($add_doc_url);
+
+ if (!$inline) {
+ my $msg = $locale->text("AP transaction '#1' posted (ID: #2)", $form->{invnumber}, $form->{id});
+ if ($form->{callback} =~ /BankTransaction/) {
+ # no restore_from_session_id needed. we like to have a newly generated
+ # list of invoices for bank transactions
+ SL::Helper::Flash::flash_later('info', $msg);
+ print $form->redirect_header($form->{callback});
+ $::dispatcher->end_request;
+
+ } elsif ($::instance_conf->get_ap_add_doc && $::instance_conf->get_doc_storage) {
+ # Redirect with callback containing a fragment does not work (by now)
+ # because the callback info is stored in the session an parsing the
+ # callback parameters does not support fragments (see SL::Form::redirect).
+ # So use flash_later for the message and redirect_headers for redirecting.
+ my $add_doc_url = build_std_url("script=ap.pl", 'action=edit', 'id=' . E($form->{id}), 'fragment=ui-tabs-docs');
+ SL::Helper::Flash::flash_later('info', $msg);
+ print $form->redirect_header($add_doc_url);
+ $::dispatcher->end_request;
+
+ } else {
+ $form->redirect($msg);
+ }
}
- $form->redirect($locale->text('AP transaction posted.') . ' ' . $locale->text('ID') . ': ' . $form->{id}) unless $inline;
} else {
$form->error($locale->text('Cannot post transaction!'));
}
'AP Transaction with Storno (abbreviation)' => 'K(S)',
'AP Transactions' => 'Kreditorenbuchungen',
'AP template suggestions' => 'Vorschlag Kreditorenbuchung',
- 'AP transaction posted.' => 'Kreditorenbuchung verbucht.',
+ 'AP transaction \'#1\' posted (ID: #2)' => 'Kreditorenbuchung \'#1\' verbucht (Buchungsnummer: #2)',
'AP transactions changeable' => 'Änderbarkeit von Kreditorenbuchungen',
'AP transactions with sales taxkeys and/or AR transactions with input taxkeys' => 'Kreditorenbuchungen mit Umsatzsteuer-Steuerschlüsseln und/oder Debitorenbuchungen mit Vorsteuer-Steuerschlüsseln',
'AP/AR Aging & Journal' => 'Offene Forderungen/Verbindlichkeiten & Buchungsjournal',
'AP Transaction with Storno (abbreviation)' => '',
'AP Transactions' => 'Purchase Transactions',
'AP template suggestions' => '',
- 'AP transaction posted.' => '',
+ 'AP transaction \'#1\' posted (ID: #2)' => '',
'AP transactions changeable' => '',
'AP transactions with sales taxkeys and/or AR transactions with input taxkeys' => '',
'AP/AR Aging & Journal' => '',