From c8220164135ec7796904dc3ac5b1c2047d52172b Mon Sep 17 00:00:00 2001 From: "Martin Helmling martin.helmling@octosoft.eu" Date: Mon, 12 Sep 2016 16:44:48 +0200 Subject: [PATCH] Erstellen von Jahresabschluss-Buchungen(3) MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Für Auswahl moderne presenter Methoden statt alte cgi Methoden eingebaut. Fehlende Umbenennung in html Templates für Events korrigiert Die Auswahl der 9xxx Konten nicht mehr auf 4 Zeichen begrenzt --- SL/Controller/YearEndTransactions.pm | 26 +++++++++++------------ t/bank/cb_ob_transactions.t | 3 +-- templates/webpages/gl/yearend_bottom.html | 7 +----- templates/webpages/gl/yearend_filter.html | 2 +- 4 files changed, 15 insertions(+), 23 deletions(-) diff --git a/SL/Controller/YearEndTransactions.pm b/SL/Controller/YearEndTransactions.pm index b9bca983e..1c003bd1a 100644 --- a/SL/Controller/YearEndTransactions.pm +++ b/SL/Controller/YearEndTransactions.pm @@ -78,7 +78,7 @@ sub check_auth { sub make_booking { my ($self) = @_; $main::lxdebug->enter_sub(); - my @ids = map { $::form->{"trans_id_$_"} } grep { $::form->{"multi_id_$_"} } (1..$::form->{rowcount}); + my @ids = map { $::form->{"multi_id_$_"} } grep { $::form->{"multi_id_$_"} } (1..$::form->{rowcount}); my $cnt = 0; $main::lxdebug->message(LXDebug->DEBUG2(),"generate for ".$::form->{cbob_chart}." # ".scalar(@ids)." charts"); if (scalar(@ids) && $::form->{cbob_chart}) { @@ -108,12 +108,13 @@ sub prepare_report { my $cgi = $::request->{cgi}; my %column_defs = ( - 'ids' => { 'text' => '', 'align' => 'center' }, - 'chart' => { 'text' => $::locale->text('Account'), }, - 'description' => { 'text' => $::locale->text('Description'), }, - 'saldo' => { 'text' => $::locale->text('Saldo'), 'align' => 'right'}, - 'sum_cb' => { 'text' => $::locale->text('Sum CB Transactions'), 'align' => 'right'}, ##close == Schluss - 'sum_ob' => { 'text' => $::locale->text('Sum OB Transactions'), 'align' => 'right'}, ##open == Eingang + 'ids' => { raw_header_data => $self->presenter->checkbox_tag("", id => "check_all", + checkall => "[data-checkall=1]"), 'align' => 'center' }, + 'chart' => { text => $::locale->text('Account'), }, + 'description' => { text => $::locale->text('Description'), }, + 'saldo' => { text => $::locale->text('Saldo'), 'align' => 'right'}, + 'sum_cb' => { text => $::locale->text('Sum CB Transactions'), 'align' => 'right'}, ##close == Schluss + 'sum_ob' => { text => $::locale->text('Sum OB Transactions'), 'align' => 'right'}, ##open == Eingang ); my @columns = qw(ids chart description saldo sum_cb sum_ob); map { $column_defs{$_}->{visible} = 1 } @columns; @@ -147,10 +148,9 @@ sub prepare_report { my $chart_id = $chart->id; my $row = { map { $_ => { 'data' => '' } } @columns }; $row->{ids} = { - 'raw_data' => $cgi->hidden('-name' => "trans_id_${idx}", '-value' => $chart_id) - . $cgi->checkbox('-name' => "multi_id_${idx}",' id' => "multi_id_id_".$chart_id, '-value' => 1, '-label' => ''), - 'valign' => 'center', - 'align' => 'center', + 'raw_data' => $self->presenter->checkbox_tag("multi_id_${idx}", value => $chart_id, "data-checkall" => 1), + 'valign' => 'center', + 'align' => 'center', }; $row->{chart}->{data} = $chart->accno; $row->{description}->{data} = $chart->description; @@ -273,9 +273,7 @@ sub init_cb_reference { $::form->{cb_reference} } sub init_cb_description { $::form->{cb_description} } sub init_charts9000 { - # wie geht prüfen von länge auf 4 in rose ? - SL::DB::Manager::Chart->get_all( query => [ \ "accno like '9%' and length(accno) = 4"] ); - #SL::DB::Manager::Chart->get_all( query => [ accno => { like => '9%'}] ); + SL::DB::Manager::Chart->get_all( query => [ accno => { like => '9%'}] ); } sub init_charts { diff --git a/t/bank/cb_ob_transactions.t b/t/bank/cb_ob_transactions.t index d72c1a800..478295315 100644 --- a/t/bank/cb_ob_transactions.t +++ b/t/bank/cb_ob_transactions.t @@ -249,8 +249,7 @@ sub test1 { is($balance , '38.00000' , $chart->accno.' has right balance') if $chart->accno eq '1776'; is($balance , '-100.00000' , $chart->accno.' has right balance') if $chart->accno eq '3400'; is($balance , '200.00000' , $chart->accno.' has right balance') if $chart->accno eq '8400'; - $::form->{"trans_id_${idx}"} = $chart->id; - $::form->{"multi_id_${idx}"} = 1; + $::form->{"multi_id_${idx}"} = $chart->id; $idx++ ; } } diff --git a/templates/webpages/gl/yearend_bottom.html b/templates/webpages/gl/yearend_bottom.html index 161217c59..2938d263d 100644 --- a/templates/webpages/gl/yearend_bottom.html +++ b/templates/webpages/gl/yearend_bottom.html @@ -2,7 +2,7 @@ [%- USE LxERP %]
- [%- L.hidden_tag("action","YearlyTransactions/dispatch") %] + [%- L.hidden_tag("action","YearEndTransactions/dispatch") %] [%- L.hidden_tag("cb_date",SELF.cb_date) %] [%- L.hidden_tag("cb_startdate",SELF.cb_startdate) %] [%- L.hidden_tag("cb_reference",SELF.cb_reference) %] @@ -18,8 +18,3 @@
- diff --git a/templates/webpages/gl/yearend_filter.html b/templates/webpages/gl/yearend_filter.html index a99799cb4..28fcd1c33 100644 --- a/templates/webpages/gl/yearend_filter.html +++ b/templates/webpages/gl/yearend_filter.html @@ -57,7 +57,7 @@ -[% L.hidden_tag('action', 'YearlyTransactions/dispatch') %] +[% L.hidden_tag('action', 'YearEndTransactions/dispatch') %]

[% L.submit_tag('action_list', LxERP.t8('Continue')) %] -- 2.20.1