X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/ff0586637d90ef8f0b4b725e476ad7ccbeb32570..8f56a7e6ca6a5495f6b3bb1b7da44715c5a6389d:/bin/mozilla/common.pl diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index c51b13f7a..c88efe875 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -11,7 +11,7 @@ use SL::Common; use SL::DB::Helper::Mappings; -use SL::DBUtils; +use SL::DBUtils qw(do_query); use SL::Form; use SL::MoreCommon; use SL::Helper::Flash; @@ -385,11 +385,23 @@ sub show_history { $form->{title} = $locale->text("History"); $form->header(no_layout => 1); + + my $callback = build_std_url(qw(action longdescription trans_id_type input_name)); + my $restriction; + if ( $form->{trans_id_type} eq 'glid' ) { + $restriction = "AND ( snumbers LIKE 'invnumber%' OR what_done LIKE '%Buchungsnummer%' OR snumbers LIKE 'gltransaction%' ) "; + } elsif ( $form->{trans_id_type} eq 'id' ) { + $restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND (what_done NOT LIKE '%Buchungsnummer%' OR what_done IS null))"; + } else { + $restriction = ''; + }; + print $form->parse_html_template( "common/show_history", { - "DATEN" => $form->get_history($dbh,$form->{input_name},"",$form->{order}), + "DATEN" => $form->get_history($dbh,$form->{input_name},$restriction,$form->{order}), "SUCCESS" => ($form->get_history($dbh,$form->{input_name}) ne "0"), uc($sort) => 1, uc($sort)."BY" => $sortby, + callback => $callback, } ); $dbh->disconnect();