X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/eb07117b26f569d689835471cab6665e510e123e..69bfa40a001bfd0ca75d60babdb63f9199d4e45c:/SL/Controller/Chart.pm diff --git a/SL/Controller/Chart.pm b/SL/Controller/Chart.pm index 274f2ea56..0e3e2b6fc 100644 --- a/SL/Controller/Chart.pm +++ b/SL/Controller/Chart.pm @@ -10,7 +10,7 @@ use SL::Locale::String qw(t8); use SL::JSON; use Rose::Object::MakeMethods::Generic ( - 'scalar --get_set_init' => [ qw(charts models chart) ], + 'scalar --get_set_init' => [ qw(charts models chart filter) ], ); sub action_ajax_autocomplete { @@ -29,6 +29,7 @@ sub action_ajax_autocomplete { if (1 == scalar @{ $exact_matches = SL::DB::Manager::Chart->get_all( query => [ SL::DB::Manager::Chart->type_filter($::form->{filter}{type}), + charttype => 'A', or => [ description => { ilike => $::form->{filter}{'all:substr:multi::ilike'} }, accno => { ilike => $::form->{filter}{'all:substr:multi::ilike'} }, @@ -54,7 +55,7 @@ sub action_ajax_autocomplete { } sub action_test_page { - $_[0]->render('chart/test_page'); + $_[0]->render('chart/test_page', pre_filled_chart => SL::DB::Manager::Chart->get_first); } sub action_chart_picker_search { @@ -108,7 +109,12 @@ sub init_models { accno => t8('Account number'), description => t8('Description'), }, + query => [ + charttype => 'A', + ], ); } +sub init_filter { $_[0]->models->filtered->laundered } + 1;