X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fcommon.pl;h=8cbdac75c6c6f4fb44705525edf9bbecaefa0902;hb=40f3befb965dd6125c0da70ad292f41a5d168d1c;hp=19955c1ca26a5422b7c146593f2a5e32cad6d82c;hpb=2eaa39366f97994db3548a9b139d35b16fbb0903;p=kivitendo-erp.git diff --git a/bin/mozilla/common.pl b/bin/mozilla/common.pl index 19955c1ca..8cbdac75c 100644 --- a/bin/mozilla/common.pl +++ b/bin/mozilla/common.pl @@ -23,8 +23,8 @@ sub build_std_url { my $form = $main::form; - my $script = $form->{script}; - + my $script = $form->{script}; + my $fragment; my @parts; foreach my $key (@_) { @@ -33,6 +33,10 @@ sub build_std_url { if ($key =~ /(.*?)=(.*)/) { if ($1 eq 'script') { $script = $2; + + } elsif ($1 eq 'fragment') { + $fragment = $2; + } else { push @parts, $key; } @@ -44,7 +48,7 @@ sub build_std_url { } } - my $url = "${script}?" . join('&', @parts); + my $url = "${script}?" . join('&', @parts) . (defined $fragment ? "#$fragment" : ''); $main::lxdebug->leave_sub(2); @@ -235,10 +239,10 @@ sub show_history { 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%' OR snumbers LIKE 'emailjournal%' ) "; - } elsif ( $form->{trans_id_type} eq 'id' ) { - $restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND snumbers NOT LIKE 'emailjournal%' AND (what_done NOT LIKE '%Buchungsnummer%' OR what_done IS null))"; + if ( $form->{trans_id_type} eq 'glid' ) { # for invoices + $restriction = "AND ( snumbers LIKE 'invnumber%' OR what_done LIKE '%Buchungsnummer%' OR snumbers LIKE 'gltransaction%' OR (snumbers LIKE 'emailjournal%' AND what_done ~ 'invoice|credit_note') ) "; + } elsif ( $form->{trans_id_type} eq 'id' ) { # for non invoices + $restriction = " AND ( snumbers NOT LIKE 'invnumber_%' AND snumbers NOT LIKE 'gltransaction%' AND (what_done NOT LIKE '%Buchungsnummer%' AND what_done NOT LIKE '%invoice%' OR what_done IS null))"; } else { $restriction = ''; };