X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FYearEndTransactions.pm;h=a81fa3bbc968b0738b2728dd854bda6d59462f47;hb=29318a627ee21ab0b324d329f78e3c4383af98c8;hp=37517bae8a0ffcae09f8fc356966a61fd093ffee;hpb=32e7fb28ff98c5fb805638514215182b6b01e600;p=kivitendo-erp.git diff --git a/SL/Controller/YearEndTransactions.pm b/SL/Controller/YearEndTransactions.pm index 37517bae8..a81fa3bbc 100644 --- a/SL/Controller/YearEndTransactions.pm +++ b/SL/Controller/YearEndTransactions.pm @@ -15,6 +15,8 @@ use SL::DB::GLTransaction; use SL::DB::AccTransaction; use SL::DB::Helper::AccountingPeriod qw(get_balance_starting_date); +use SL::Presenter::Tag qw(checkbox_tag); + use Rose::Object::MakeMethods::Generic ( 'scalar --get_set_init' => [ qw(charts charts9000 cbob_chart cb_date cb_startdate ob_date cb_reference ob_reference cb_description ob_description) ], ); @@ -29,6 +31,8 @@ sub action_filter { $self->cb_reference(t8('CB Transaction')) if !$self->cb_reference; $self->ob_description(t8('OB Transaction')) if !$self->ob_description; $self->cb_description(t8('CB Transaction')) if !$self->cb_description; + + $self->setup_filter_action_bar; $self->render('gl/yearend_filter', title => t8('CB/OB Transactions'), make_title_of_chart => sub { $_[0]->accno.' '.$_[0]->description } @@ -52,6 +56,8 @@ sub action_list { allow_csv_export => 0, title => $::locale->text('CB/OB Transactions'), ); + + $self->setup_list_action_bar; $report->generate_with_headers(); $main::lxdebug->leave_sub(); } @@ -106,7 +112,7 @@ sub prepare_report { my $idx = 1; my %column_defs = ( - 'ids' => { raw_header_data => $self->presenter->checkbox_tag("", id => "check_all", + 'ids' => { raw_header_data => checkbox_tag("", id => "check_all", checkall => "[data-checkall=1]"), 'align' => 'center' }, 'chart' => { text => $::locale->text('Account'), }, 'description' => { text => $::locale->text('Description'), }, @@ -148,7 +154,7 @@ sub prepare_report { my $chart_id = $chart->id; my $row = { map { $_ => { 'data' => '' } } @columns }; $row->{ids} = { - 'raw_data' => $self->presenter->checkbox_tag("multi_id_${idx}", value => $chart_id, "data-checkall" => 1), + 'raw_data' => checkbox_tag("multi_id_${idx}", value => $chart_id, "data-checkall" => 1), 'valign' => 'center', 'align' => 'center', }; @@ -270,4 +276,38 @@ sub init_charts { SL::DB::Manager::Chart->get_all( query => [ \ "accno not like '9%'"], sort_by => 'accno ASC' ); } +sub setup_filter_action_bar { + my ($self) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Continue'), + submit => [ '#filter_form', { action => 'YearEndTransactions/list' } ], + accesskey => 'enter', + ], + ); + } +} + +sub setup_list_action_bar { + my ($self) = @_; + + for my $bar ($::request->layout->get('actionbar')) { + $bar->add( + action => [ + t8('Post'), + submit => [ '#form', { action => 'YearEndTransactions/generate' } ], + tooltip => t8('generate cb/ob transactions for selected charts'), + confirm => t8('Are you sure to generate cb/ob transactions?'), + accesskey => 'enter', + ], + action => [ + t8('Back'), + call => [ 'kivi.history_back' ], + ], + ); + } +} + 1;