From: Moritz Bunkus Date: Wed, 6 May 2009 12:48:35 +0000 (+0000) Subject: Codevereinfachung; Tabellennamen richtig benannt. X-Git-Tag: release-2.6.0beta2~19 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=85a853868cf3d04e97aaa2456a6a2ab3c2581734;p=kivitendo-erp.git Codevereinfachung; Tabellennamen richtig benannt. --- diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index f14ea6685..f1b339843 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -2847,16 +2847,11 @@ sub show_am_history { $restriction .= " OR addition = '" . $_ . "'"; } } - $restriction .= - $form->{fromdate} ne "" && $form->{todate} ne "" ? qq| AND st.itime::date >= '| . $form->{fromdate} . qq|' AND st.itime::date <= '| . $form->{todate} . qq|'| - : $form->{fromdate} ne "" && $form->{todate} eq "" ? qq| AND st.itime::date >= '| . $form->{fromdate} . qq|'| - : $form->{fromdate} eq "" && $form->{todate} ne "" ? qq| AND st.itime::date <= '| . $form->{todate} . qq|'| - : "" - ; - $restriction .= - $form->{mitarbeiter} eq "" ? "" - : $form->{mitarbeiter} =~ /^\d+$/ ? " AND employee_id = " . $form->{mitarbeiter} - : " AND employee_id = " . get_employee_id($form->{mitarbeiter}, $dbh); + + $restriction .= qq| AND h.itime::date >= | . conv_dateq($form->{fromdate}) if $form->{fromdate}; + $restriction .= qq| AND h.itime::date <= | . conv_dateq($form->{todate}) if $form->{todate}; + $restriction .= qq| AND employee_id = | . $form->{mitarbeiter} if $form->{mitarbeiter} =~ m/^\d+$/; + $restriction .= qq| AND employee_id = | . get_employee_id($form->{mitarbeiter}, $dbh) if $form->{mitarbeiter}; my $dbh = $form->dbconnect(\%myconfig); my $query = qq|SELECT trans_id AS id FROM history_erp | .