$form->{SHOW_DEPARTMENT_SELECTION} = $form->{all_departments} && scalar @{ $form->{all_departments} || [] };
$form->{title} = $locale->text('Start Dunning Process');
+
+ setup_dn_add_action_bar();
$form->header();
print $form->parse_html_template("dunning/add");
'no_html' => 1,
'no_opendocument' => 1,);
- $::request->layout->add_javascripts("kivi.Dunning.js");
+ setup_dn_show_invoices_action_bar();
$form->header();
print $form->parse_html_template("dunning/show_invoices");
$form->{title} = $locale->text('Dunnings');
+ setup_dn_search_action_bar();
$form->header();
print $form->parse_html_template("dunning/search");
$report->set_options_from_form();
- $::request->layout->add_javascripts("kivi.Dunning.js");
- $report->generate_with_headers();
+ setup_dn_show_dunning_action_bar();
+ $report->generate_with_headers(action_bar => 1);
$main::lxdebug->leave_sub();
$::form->error($::locale->text('No action defined.'));
}
+
+sub setup_dn_add_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Continue'),
+ submit => [ '#form', { action => "show_invoices" } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_dn_show_invoices_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Continue'),
+ submit => [ '#form', { action => "save_dunning" } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name^=active_]' ] ],
+ accesskey => 'enter',
+ only_once => 1,
+ ],
+ );
+ }
+}
+
+sub setup_dn_search_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Continue'),
+ submit => [ '#form', { action => "show_dunning" } ],
+ accesskey => 'enter',
+ ],
+ );
+ }
+}
+
+sub setup_dn_show_dunning_action_bar {
+ my %params = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Print'),
+ submit => [ '#form', { action => "print_multiple" } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
+ accesskey => 'enter',
+ ],
+
+ action => [
+ t8('Delete'),
+ submit => [ '#form', { action => "delete" } ],
+ checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
+ confirm => $::locale->text('This resets the dunning process for the selected invoices. Posted dunning invoices will not be changed!'),
+ ],
+ );
+ }
+}
+
# end of main
'The document has been changed by another user. No mail was sent. Please reopen it in another window and copy the changes to the new window' => 'Die Daten wurden bereits von einem anderen Benutzer verändert. Deshalb ist das Dokument ungültig und es wurde keine E-Mail verschickt. Bitte öffnen Sie das Dokument erneut in einem extra Fenster und übertragen Sie die Daten',
'The document has been changed by another user. Please reopen it in another window and copy the changes to the new window' => 'Die Daten wurden bereits von einem anderen Benutzer verändert. Deshalb ist das Dokument ungültig. Bitte öffnen Sie das Dokument erneut in einem extra Fenster und übertragen Sie die Daten',
'The documents have been sent to the printer \'#1\'.' => 'Die Dokumente sind zum Drucker \'#1\' geschickt',
- 'The dunning process started' => 'Der Mahnprozess ist gestartet.',
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
'The email has been sent.' => 'Die E-Mail wurde verschickt.',
'The employee is missing.' => 'Der Bearbeiter fehlt.',