#======================================================================
use SL::FU;
+use SL::Helper::Flash qw(flash_later);
use SL::IR;
use SL::IS;
use SL::DB::BankTransactionAccTrans;
$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!'));
<p>[% saved_message %]</p>
[%- FOREACH key = HIDDENS %]
-<input type="hidden" name="[% HTML.escape(key) %]" value="[% HTML.escape($key) %]">
+ [% L.hidden_tag(key, $key) %]
[%- END %]
<input type="hidden" name="follow_up_trans_id_1" value="[% id %]">
<input type="hidden" name="follow_up_trans_type_1" value="purchase_invoice">
[%- END %]
[%- IF id %]
[%- IF INSTANCE_CONF.get_doc_storage %]
- <li><a href="controller.pl?action=File/list&file_type=document&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Documents' | $T8 %]</a></li>
+ <li><a href="#ui-tabs-docs">[% 'Documents' | $T8 %]</a></li>
<li><a href="controller.pl?action=File/list&file_type=attachment&object_type=purchase_invoice&object_id=[% HTML.url(id) %]">[% 'Attachments' | $T8 %]</a></li>
[%- END %]
[%- IF AUTH.assert('record_links', 1) %]
[%- END %]
</ul>
+[%- IF INSTANCE_CONF.get_doc_storage %]
+ <div id="ui-tabs-docs"></div>
+[%- END %]
+
<div id="ui-tabs-basic-data">
<table width="100%">
<tr>
[% IF creditwarning != '' %]
alert('[% 'Credit Limit exceeded!!!' | $T8 %]');
[% END %]
+ kivi.File.doc_tab_init('ir_tabs', 'ui-tabs-docs', $('#id').val(), 'purchase_invoice');
});
//-->
</script>