1 #=====================================================================
4 # Based on SQL-Ledger Version 2.1.9
5 # Web http://www.lx-office.org
7 #=====================================================================
8 # SQL-Ledger Accounting
9 # Copyright (c) 1998-2002
11 # Author: Dieter Simader
12 # Email: dsimader@sql-ledger.org
13 # Web: http://www.sql-ledger.org
16 # This program is free software; you can redistribute it and/or modify
17 # it under the terms of the GNU General Public License as published by
18 # the Free Software Foundation; either version 2 of the License, or
19 # (at your option) any later version.
21 # This program is distributed in the hope that it will be useful,
22 # but WITHOUT ANY WARRANTY; without even the implied warranty of
23 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 # GNU General Public License for more details.
25 # You should have received a copy of the GNU General Public License
26 # along with this program; if not, write to the Free Software
27 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
29 #======================================================================
31 # Dunning process module
33 #======================================================================
35 use POSIX qw(strftime);
37 use List::Util qw(notall);
38 use List::MoreUtils qw(none);
42 use SL::DB::Department;
44 use SL::DB::Manager::PaymentTerm;
46 use SL::Helper::Flash qw(flash);
47 use SL::Locale::String qw(t8);
48 use SL::Presenter::EmailJournal;
49 use SL::Presenter::FileObject;
50 use SL::Presenter::WebdavObject;
51 use SL::ReportGenerator;
53 require "bin/mozilla/common.pl";
54 require "bin/mozilla/reportgenerator.pl";
55 require "bin/mozilla/io.pl";
62 $main::lxdebug->enter_sub();
64 my $form = $main::form;
65 my %myconfig = %main::myconfig;
66 my $locale = $main::locale;
68 $main::auth->assert('config');
70 DN->get_config(\%myconfig, \%$form);
71 $form->get_lists('charts' => { 'key' => 'ALL_CHARTS',
72 'transdate' => 'current_date' });
74 $form->{SELECT_AR_AMOUNT} = [];
75 $form->{SELECT_AR} = [];
77 foreach my $chart (@{ $form->{ALL_CHARTS} }) {
78 $chart->{LINKS} = { map { $_, 1 } split m/:/, $chart->{link} };
80 if ($chart->{LINKS}->{AR}) {
81 $chart->{AR_selected} = "selected" if $chart->{id} == $form->{AR};
82 push @{ $form->{SELECT_AR} }, $chart;
85 if ($chart->{LINKS}->{AR_amount}) {
86 $chart->{AR_amount_fee_selected} = "selected" if $chart->{id} == $form->{AR_amount_fee};
87 $chart->{AR_amount_interest_selected} = "selected" if $chart->{id} == $form->{AR_amount_interest};
88 push @{ $form->{SELECT_AR_AMOUNT} }, $chart;
92 $form->{title} = $locale->text('Edit Dunning Process Config');
93 $form->{callback} ||= build_std_url("action=edit_config");
95 setup_dn_edit_config_action_bar();
98 print $form->parse_html_template("dunning/edit_config");
100 $main::lxdebug->leave_sub();
104 $main::lxdebug->enter_sub();
106 my $form = $main::form;
107 my %myconfig = %main::myconfig;
108 my $locale = $main::locale;
110 $main::auth->assert('dunning_edit');
112 DN->get_config(\%myconfig, \%$form);
114 $form->get_lists("departments" => "ALL_DEPARTMENTS");
115 $::form->{ALL_PAYMENT_TERMS} = SL::DB::Manager::PaymentTerm->get_all_sorted;
117 $form->{SHOW_DUNNING_LEVEL_SELECTION} = $form->{DUNNING} && scalar @{ $form->{DUNNING} };
118 $form->{SHOW_DEPARTMENT_SELECTION} = $form->{ALL_DEPARTMENTS} && scalar @{ $form->{ALL_DEPARTMENTS} || [] };
120 $form->{title} = $locale->text('Start Dunning Process');
122 setup_dn_add_action_bar();
125 print $form->parse_html_template("dunning/add");
127 $main::lxdebug->leave_sub();
131 $main::lxdebug->enter_sub();
133 my $form = $main::form;
134 my %myconfig = %main::myconfig;
135 my $locale = $main::locale;
137 $main::auth->assert('dunning_edit');
139 DN->get_invoices(\%myconfig, \%$form);
140 $form->{title} = $locale->text('Start Dunning Process');
142 foreach my $row (@{ $form->{DUNNINGS} }) {
143 $row->{DUNNING_CONFIG} = [ map +{ %{ $_ } }, @{ $form->{DUNNING_CONFIG} } ];
145 if ($row->{next_dunning_config_id}) {
146 map { $_->{SELECTED} = $_->{id} == $row->{next_dunning_config_id} } @{ $row->{DUNNING_CONFIG } };
148 map { $row->{$_} = $form->format_amount(\%myconfig, $row->{$_} * 1, 2) } qw(amount open_amount fee interest);
150 if ($row->{'language_id'}) {
151 $row->{language} = SL::DB::Manager::Language->find_by_or_create('id' => $row->{'language_id'})->{'description'};
155 $form->get_lists('printers' => 'printers',
156 'languages' => 'languages');
158 $form->{type} = 'dunning';
159 $form->{rowcount} = scalar @{ $form->{DUNNINGS} };
160 $form->{callback} ||= build_std_url("action=show_invoices", qw(customer invnumber ordnumber groupinvoices minamount dunning_level notes));
162 $form->{PRINT_OPTIONS} = print_options('inline' => 1,
164 'no_postscript' => 1,
166 'no_opendocument' => 1,);
168 setup_dn_show_invoices_action_bar();
170 print $form->parse_html_template("dunning/show_invoices");
172 $main::lxdebug->leave_sub();
176 $main::lxdebug->enter_sub();
178 my $form = $main::form;
179 my %myconfig = %main::myconfig;
180 my $locale = $main::locale;
182 $main::auth->assert('config');
184 for my $i (1 .. $form->{rowcount}) {
185 if ($form->{"dunning_description_$i"} ne "") {
186 $form->isblank("dunning_level_$i", $locale->text('Dunning Level missing in row '). $i);
187 $form->isblank("dunning_description_$i", $locale->text('Dunning Description missing in row '). $i);
188 $form->isblank("terms_$i", $locale->text('Terms missing in row '). $i);
189 $form->isblank("payment_terms_$i", $locale->text('Payment Terms missing in row '). $i);
193 DN->save_config(\%myconfig, \%$form);
195 if(!exists $form->{addition} && $form->{id} ne "") {
196 $form->{snumbers} = qq|dunning_id_| . $form->{"dunning_id"};
197 $form->{addition} = "SAVED FOR DUNNING";
200 # /saving the history
201 $form->redirect($locale->text('Dunning Process Config saved!'));
203 $main::lxdebug->leave_sub();
207 $main::lxdebug->enter_sub();
209 my $form = $main::form;
210 my %myconfig = %main::myconfig;
211 my $locale = $main::locale;
213 $main::auth->assert('dunning_edit');
218 undef($form->{DUNNING_PDFS});
220 my $saved_language_id = $form->{language_id};
222 if ($form->{groupinvoices} || $form->{l_include_credit_notes}) {
225 for my $i (1 .. $form->{rowcount}) {
226 next unless ($form->{"active_$i"});
228 $dunnings_for{$form->{"customer_id_$i"}} ||= {};
229 my $dunning_levels = $dunnings_for{$form->{"customer_id_$i"}};
231 $dunning_levels->{$form->{"next_dunning_config_id_$i"}} ||= [];
232 my $level = $dunning_levels->{$form->{"next_dunning_config_id_$i"}};
234 push @{ $level }, { "row" => $i,
235 "invoice_id" => $form->{"inv_id_$i"},
236 "credit_note" => $form->{"credit_note_$i"},
237 "customer_id" => $form->{"customer_id_$i"},
238 "language_id" => $form->{"language_id_$i"},
239 "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"},
240 "print_invoice" => $form->{"include_invoice_$i"},
241 "email" => $form->{"email_$i"}, };
244 foreach my $levels (values %dunnings_for) {
245 foreach my $level (values %{ $levels }) {
246 next unless scalar @{ $level };
247 if (!$form->{force_lang}) {
248 $form->{language_id} = @{$level}[0]->{language_id};
250 my $rc = DN->save_dunning(\%myconfig, $form, $level);
251 $rc->{error} =~ s{\n}{<br />}g if $rc->{error};
252 push @status, { invnumbers => [map { $form->{'invnumber_' . $_->{row}} } @$level],
253 map { ( $_ => $rc->{$_} ) } qw(error dunning_id print_original_invoice send_email), };
258 for my $i (1 .. $form->{rowcount}) {
259 next unless $form->{"active_$i"};
261 my $level = [ { "row" => $i,
262 "invoice_id" => $form->{"inv_id_$i"},
263 "customer_id" => $form->{"customer_id_$i"},
264 "language_id" => $form->{"language_id_$i"},
265 "next_dunning_config_id" => $form->{"next_dunning_config_id_$i"},
266 "print_invoice" => $form->{"include_invoice_$i"},
267 "email" => $form->{"email_$i"}, } ];
268 if (!$form->{force_lang}) {
269 $form->{language_id} = @{$level}[0]->{language_id};
271 my $rc = DN->save_dunning(\%myconfig, $form, $level);
272 $rc->{error} =~ s{\n}{<br />}g if $rc->{error};
273 push @status, { invnumbers => [map { $form->{'invnumber_' . $_->{row}} } @$level],
274 map { ( $_ => $rc->{$_} ) } qw(error dunning_id print_original_invoice send_email), };
278 $form->{language_id} = $saved_language_id;
282 if ($form->{DUNNING_PDFS} && scalar @{ $form->{DUNNING_PDFS} }) {
283 $form->{dunning_id} = strftime("%Y%m%d", localtime time) if scalar @{ $form->{DUNNING_PDFS}} > 1;
284 ($pdf_filename, $pdf_content) = DN->melt_pdfs(\%myconfig, $form, $form->{copies}, return_content => $form->{media} ne 'printer');
286 flash('info', t8('Dunning Process started for selected invoices!'));
287 if ($form->{media} eq 'printer') {
288 flash('info', t8('The PDF has been printed'));
290 flash('info', t8('The PDF has been created'));
295 if(!exists $form->{addition} && $form->{id} ne "") {
296 $form->{snumbers} = qq|dunning_id_| . $form->{"dunning_id"};
297 $form->{addition} = "DUNNING STARTED";
300 # /saving the history
302 setup_dn_status_action_bar();
303 $form->{"title"} = $locale->text("Dunning status");
305 print $form->parse_html_template('dunning/status', {
306 pdf_filename => $pdf_filename,
307 pdf_content => $pdf_content,
308 status => \@status, });
310 $main::lxdebug->leave_sub();
314 $main::lxdebug->enter_sub();
316 my $form = $main::form;
317 my $locale = $main::locale;
319 $main::auth->assert('dunning_edit');
321 $form->{"title"} = $locale->text("Set eMail text");
324 use_javascripts => [ qw(ckeditor5/ckeditor ckeditor5/translations/de) ],
326 print($form->parse_html_template("dunning/set_email"));
328 $main::lxdebug->leave_sub();
332 $main::lxdebug->enter_sub();
334 my $form = $main::form;
335 my %myconfig = %main::myconfig;
336 my $locale = $main::locale;
338 $main::auth->assert('dunning_edit');
340 $form->get_lists("customers" => "ALL_CUSTOMERS",
341 "departments" => "ALL_DEPARTMENTS");
342 $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
344 DN->get_config(\%myconfig, \%$form);
346 $form->{SHOW_DUNNING_LEVELS} = scalar @{ $form->{DUNNING} };
348 $form->{title} = $locale->text('Dunnings');
350 setup_dn_search_action_bar();
353 print $form->parse_html_template("dunning/search");
355 $main::lxdebug->leave_sub();
360 $main::lxdebug->enter_sub();
362 my $form = $main::form;
363 my %myconfig = %main::myconfig;
364 my $locale = $main::locale;
365 my $cgi = $::request->{cgi};
367 $main::auth->assert('dunning_edit');
369 my @filter_field_list = qw(customer_id customer dunning_id dunning_level department_id invnumber ordnumber
370 transdatefrom transdateto dunningfrom dunningto notes showold l_salesman salesman_id
371 l_mails l_webdav l_documents);
373 report_generator_set_default_sort('customername', 1);
375 DN->get_dunning(\%myconfig, \%$form);
377 if (!$form->{callback}) {
378 $form->{callback} = build_std_url("action=show_dunning", @filter_field_list);
381 $form->get_lists('printers' => 'printers',
382 'languages' => 'languages');
384 $form->{type} = 'dunning';
385 $form->{PRINT_OPTIONS} = print_options('inline' => 1,
387 'no_postscript' => 1,
389 'no_opendocument' => 1,);
390 $form->{title} = $locale->text('Dunning overview');
392 my $report = SL::ReportGenerator->new(\%myconfig, $form);
394 $report->set_options('std_column_visibility' => 1,
395 'title' => $form->{title});
396 $report->set_export_options('show_dunning', @filter_field_list, qw(sort sortdir));
399 'checkbox' => { 'text' => '', 'visible' => 'HTML' },
400 'dunning_description' => { 'text' => $locale->text('Dunning Level') },
401 'customername' => { 'text' => $locale->text('Customername') },
402 'departmentname' => { 'text' => $locale->text('Department') },
403 'language' => { 'text' => $locale->text('Language') },
404 'invnumber' => { 'text' => $locale->text('Invnumber') },
405 'transdate' => { 'text' => $locale->text('Invdate') },
406 'duedate' => { 'text' => $locale->text('Invoice Duedate') },
407 'amount' => { 'text' => $locale->text('Amount') },
408 'dunning_id' => { 'text' => $locale->text('Dunning number') },
409 'dunning_date' => { 'text' => $locale->text('Dunning Date') },
410 'dunning_duedate' => { 'text' => $locale->text('Dunning Duedate') },
411 'fee' => { 'text' => $locale->text('Total Fees') },
412 'interest' => { 'text' => $locale->text('Interest') },
413 'salesman' => { 'text' => $locale->text('Salesperson'), 'visible' => $form->{l_salesman} ? 1 : 0 },
414 'documents' => { 'text' => $locale->text('Documents'), 'visible' => $form->{l_documents}? 1 : 0 },
415 'webdav' => { 'text' => $locale->text('WebDAV'), 'visible' => $form->{l_webdav} ? 1 : 0 },
416 'mails' => { 'text' => $locale->text('Mails'), 'visible' => $form->{l_mails} ? 1 : 0 },
419 $report->set_columns(%column_defs);
420 $report->set_column_order(qw(checkbox dunning_description dunning_id customername language invnumber transdate
421 duedate amount dunning_date dunning_duedate fee interest salesman departmentname mails webdav documents));
422 $report->set_sort_indicator($form->{sort}, $form->{sortdir});
424 my $edit_url = sub { build_std_url('script=' . ($_[0]->{invoice} ? 'is' : 'ar') . '.pl', 'action=edit', 'callback') . '&id=' . $::form->escape($_[0]->{id}) };
425 my $print_url = sub { build_std_url('action=print_dunning', 'format=pdf', 'media=screen', 'dunning_id='.$_[0]->{dunning_id}, 'language_id=' . $_[0]->{language_id}) };
426 my $sort_url = build_std_url('action=show_dunning', grep { $form->{$_} } @filter_field_list);
428 foreach my $name (qw(dunning_description customername invnumber transdate duedate dunning_date dunning_duedate salesman dunning_id)) {
429 my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
430 $column_defs{$name}->{link} = $sort_url . "&sort=$name&sortdir=$sortdir";
433 my %alignment = map { $_ => 'right' } qw(transdate duedate amount dunning_date dunning_duedate fee interest salesman dunning_id);
435 my ($current_dunning_rows, $previous_dunning_id, $first_row_for_dunning);
437 $current_dunning_rows = [];
438 $first_row_for_dunning = 1;
439 $form->{rowcount} = scalar @{ $form->{DUNNINGS} };
443 foreach my $ref (@{ $form->{DUNNINGS} }) {
446 if ($previous_dunning_id != $ref->{dunning_id}) {
447 $report->add_data($current_dunning_rows) if (scalar @{ $current_dunning_rows });
448 $current_dunning_rows = [];
449 $first_row_for_dunning = 1;
452 if ($ref->{'language_id'}) {
453 $ref->{language} = SL::DB::Manager::Language->find_by('id' => $ref->{'language_id'})->{'description'};
457 foreach my $column (keys %{ $ref }) {
459 'data' => $first_row_for_dunning || (none { $_ eq $column } qw(dunning_description customername dunning_id)) ? $ref->{$column} : '',
461 'align' => $alignment{$column},
463 'link' => ( $column eq 'invnumber' ? $edit_url->($ref)
464 : $column eq 'dunning_description' ? $print_url->($ref)
465 : $column eq 'dunning_id' ? $print_url->($ref)
470 $row->{checkbox} = !$first_row_for_dunning ? { } : {
471 'raw_data' => $cgi->hidden('-name' => "dunning_id_$i", '-value' => $ref->{dunning_id})
472 . $cgi->checkbox('-name' => "selected_$i", '-value' => 1, '-label' => ''),
473 'valign' => 'center',
477 if ($first_row_for_dunning) {
478 $row->{language} = {'raw_data' => $cgi->hidden('-name' => "language_id_$i", '-value' => $ref->{language_id})
479 . " $ref->{language}" };
481 $row->{language} = { };
484 if ($form->{l_documents} && $first_row_for_dunning) {
485 my @files = SL::File->get_all_versions(object_id => $ref->{dunning_id},
486 object_type => 'dunning',
487 file_type => 'document',);
489 my $html = join '<br>', map { SL::Presenter::FileObject::file_object($_) } @files;
490 my $text = join "\n", map { $_->file_name } @files;
491 $row->{documents} = { 'raw_data' => $html, data => $text };
493 $row->{documents} = { };
496 if ($form->{l_webdav} && $first_row_for_dunning) {
497 my $webdav = SL::Webdav->new(
499 number => $ref->{dunning_id},
501 my @all_objects = $webdav->get_all_objects;
502 if (scalar @all_objects) {
503 my $html = join '<br>', map { SL::Presenter::WebdavObject::webdav_object($_) } @all_objects;
504 my $text = join "\n", map { $_->filename } @all_objects;
505 $row->{webdav} = { 'raw_data' => $html, data => $text };
507 $row->{webdav} = { };
511 if ($form->{l_mails}) {
512 my @mail_links = RecordLinks->get_links(from_table => 'dunning', to_table => 'email_journal', from_id => $ref->{dunning_table_id});
513 if (scalar @mail_links) {
514 my $email_journals = SL::DB::Manager::EmailJournal->get_all(where => [id => [ map { $_->{to_id} } @mail_links ]]);
515 my $html = join '<br>', map { SL::Presenter::EmailJournal::email_journal($_) } @$email_journals;
516 my $text = join "\n", map { $_->subject } @$email_journals;
517 $row->{mails} = { 'raw_data' => $html, data => $text };
523 push @{ $current_dunning_rows }, $row;
525 $previous_dunning_id = $ref->{dunning_id};
526 $first_row_for_dunning = 0;
529 $report->add_data($current_dunning_rows) if (scalar @{ $current_dunning_rows });
531 $report->set_options('raw_top_info_text' => $form->parse_html_template('dunning/show_dunning_top'),
532 'raw_bottom_info_text' => $form->parse_html_template('dunning/show_dunning_bottom'),
533 'output_format' => 'HTML',
534 'attachment_basename' => $locale->text('dunning_list') . strftime('_%Y%m%d', localtime time),
537 $report->set_options_from_form();
539 setup_dn_show_dunning_action_bar();
540 $report->generate_with_headers();
542 $main::lxdebug->leave_sub();
547 $main::lxdebug->enter_sub();
549 my $form = $main::form;
551 $main::auth->assert('dunning_edit');
553 $form->{rowcount} = 1;
554 $form->{selected_1} = 1;
555 $form->{dunning_id_1} = $form->{dunning_id};
556 $form->{language_id_1} = $form->{language_id};
560 $main::lxdebug->leave_sub();
564 $main::auth->assert('dunning_edit');
566 my @dunning_ids = map { $::form->{"dunning_id_$_"} } grep { $::form->{"selected_$_"} } (1..$::form->{rowcount});
568 if (!scalar @dunning_ids) {
569 $::form->error($::locale->text('No dunnings have been selected for printing.'));
572 my $dunnings = SL::DB::Manager::Dunning->get_all(query => [ dunning_id => \@dunning_ids ]);
574 SL::DB::Dunning->new->db->with_transaction(sub {
575 for my $dunning (@$dunnings) {
576 SL::DB::Manager::Invoice->find_by(id => $dunning->trans_id)->update_attributes(dunning_config_id => undef);
581 flash('info', t8('#1 dunnings have been deleted', scalar @$dunnings));
587 $main::lxdebug->enter_sub();
589 my $form = $main::form;
590 my %myconfig = %main::myconfig;
591 my $locale = $main::locale;
593 $main::auth->assert('dunning_edit');
595 $form->{title} = $locale->text('Print dunnings');
597 my @dunning_ids = map { $form->{"dunning_id_$_"} } grep { $form->{"selected_$_"} } (1..$form->{rowcount});
598 my @language_ids = map { $form->{"language_id_$_"} } grep { $form->{"selected_$_"} } (1..$form->{rowcount});
600 if (!scalar @dunning_ids) {
601 $form->error($locale->text('No dunnings have been selected for printing.'));
604 $form->{DUNNING_PDFS} = [];
606 my $saved_language_id = $form->{language_id};
608 foreach my $dunning_id (@dunning_ids) {
609 if (!$form->{force_lang}) {
610 $form->{language_id} = $language_ids[$i];
612 $form->{dunning_id} = $dunning_id;
613 DN->print_invoice_for_fees(\%myconfig, $form, $dunning_id);
614 DN->print_dunning(\%myconfig, $form, $dunning_id);
616 # print original dunned invoices, if they where printed on dunning run
617 my $dunnings = SL::DB::Manager::Dunning->get_all(where => [dunning_id => $dunning_id, original_invoice_printed => 1]);
618 DN->print_original_invoice(\%myconfig, $form, $dunning_id, $_->trans_id) for @$dunnings;
622 $form->{language_id} = $saved_language_id;
624 if (scalar @{ $form->{DUNNING_PDFS} }) {
625 $form->{dunning_id} = strftime("%Y%m%d", localtime time) if scalar @{ $form->{DUNNING_PDFS}} > 1;
626 DN->melt_pdfs(\%myconfig, $form, $form->{copies});
628 if ($form->{media} eq 'printer') {
630 $form->info($locale->text('The dunnings have been printed.'));
634 $form->redirect($locale->text('Could not print dunning.'));
637 $main::lxdebug->leave_sub();
641 call_sub($main::form->{nextsub});
645 foreach my $action (qw(delete print_multiple)) {
646 if ($::form->{"action_${action}"}) {
652 $::form->error($::locale->text('No action defined.'));
655 sub setup_dn_add_action_bar {
658 for my $bar ($::request->layout->get('actionbar')) {
662 submit => [ '#form', { action => "show_invoices" } ],
663 accesskey => 'enter',
669 sub setup_dn_show_invoices_action_bar {
672 for my $bar ($::request->layout->get('actionbar')) {
676 submit => [ '#form', { action => "save_dunning" } ],
677 checks => [ [ 'kivi.check_if_entries_selected', '[name^=active_]' ] ],
678 accesskey => 'enter',
685 sub setup_dn_search_action_bar {
688 for my $bar ($::request->layout->get('actionbar')) {
692 submit => [ '#form', { action => "show_dunning" } ],
693 accesskey => 'enter',
699 sub setup_dn_show_dunning_action_bar {
702 for my $bar ($::request->layout->get('actionbar')) {
706 submit => [ '#form', { action => "print_multiple" } ],
707 checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
708 accesskey => 'enter',
713 submit => [ '#form', { action => "delete" } ],
714 checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
715 confirm => $::locale->text('This resets the dunning process for the selected invoices. Posted dunning invoices will not be changed!'),
721 sub setup_dn_edit_config_action_bar {
724 for my $bar ($::request->layout->get('actionbar')) {
728 submit => [ '#form', { action => "save" } ],
729 accesskey => 'enter',
735 sub setup_dn_status_action_bar {
736 for my $bar ($::request->layout->get('actionbar')) {
740 link => $::form->{callback},
741 accesskey => 'enter',