From 2e4e2ba959344a6db630b5b9e9c6f8b93c666fc2 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 30 Sep 2013 15:10:30 +0200 Subject: [PATCH] =?utf8?q?Lieferscheinbericht:=20Suchm=C3=B6glichkeit=20na?= =?utf8?q?ch=20Seriennummer?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DO.pm | 5 +++++ bin/mozilla/do.pl | 3 ++- templates/webpages/do/search.html | 5 +++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/SL/DO.pm b/SL/DO.pm index 15f1c8d08..7d3a5e61d 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -130,6 +130,11 @@ sub transactions { push @where, ($form->{delivered} ? "" : "NOT ") . "COALESCE(dord.delivered, FALSE)"; } + if ($form->{serialnumber}) { + push @where, 'dord.id IN (SELECT doi.delivery_order_id FROM delivery_order_items doi WHERE doi.serialnumber LIKE ?)'; + push @values, '%' . $form->{serialnumber} . '%'; + } + if($form->{transdatefrom}) { push @where, qq|dord.transdate >= ?|; push @values, conv_date($form->{transdatefrom}); diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index ae804c8f6..e40c6727c 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -507,7 +507,7 @@ sub orders { my $report = SL::ReportGenerator->new(\%myconfig, $form); my @hidden_variables = map { "l_${_}" } @columns; - push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber + push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber chargenumber transaction_description transdatefrom transdateto type vc employee_id salesman_id project_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -565,6 +565,7 @@ sub orders { if ($form->{ordnumber}) { push @options, $locale->text('Order Number') . " : $form->{ordnumber}"; } + push @options, $locale->text('Serial Number') . " : $form->{serialnumber}" if $form->{serialnumber}; if ($form->{transaction_description}) { push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"; } diff --git a/templates/webpages/do/search.html b/templates/webpages/do/search.html index 5bc2a192b..1f7dda684 100644 --- a/templates/webpages/do/search.html +++ b/templates/webpages/do/search.html @@ -98,6 +98,11 @@ + + [% 'Serial Number' | $T8 %] + + + [% 'From' | $T8 %] -- 2.20.1