From db791046bcff820895321c617d66843f4c28aeae Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Wed, 25 Sep 2013 11:25:58 +0200 Subject: [PATCH] =?utf8?q?Im=20Lagerstandsbericht=20nach=20Warengruppe=20f?= =?utf8?q?iltern=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Übernahme aus Kundenprojekt --- SL/WH.pm | 5 +++++ bin/mozilla/wh.pl | 14 +++++++++----- templates/webpages/wh/report_filter.html | 4 ++++ 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/SL/WH.pm b/SL/WH.pm index f0f5ef202..6afc4ff31 100644 --- a/SL/WH.pm +++ b/SL/WH.pm @@ -554,6 +554,11 @@ sub get_warehouse_report { push @filter_vars, $filter{partsid}; } + if ($filter{partsgroup_id}) { + push @filter_ary, "p.partsgroup_id = ?"; + push @filter_vars, $filter{partsgroup_id}; + } + if ($filter{chargenumber}) { push @filter_ary, "i.chargenumber ILIKE ?"; push @filter_vars, like($filter{chargenumber}); diff --git a/bin/mozilla/wh.pl b/bin/mozilla/wh.pl index 3f0a5b615..8cf3226db 100644 --- a/bin/mozilla/wh.pl +++ b/bin/mozilla/wh.pl @@ -811,7 +811,8 @@ sub report { my $locale = $main::locale; $form->get_lists('warehouses' => { 'key' => 'WAREHOUSES', - 'bins' => 'BINS', }); + 'bins' => 'BINS', }, + 'partsgroup' => 'PARTSGROUPS'); show_no_warehouses_error() if (!scalar @{ $form->{WAREHOUSES} }); @@ -827,8 +828,9 @@ sub report { $form->header(); print $form->parse_html_template("wh/report_filter", - { "WAREHOUSES" => $form->{WAREHOUSES}, - "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)), + { "WAREHOUSES" => $form->{WAREHOUSES}, + "PARTSGROUPS" => $form->{PARTSGROUPS}, + "UNITS" => AM->unit_select_data(AM->retrieve_units(\%myconfig, $form)), }); $main::lxdebug->leave_sub(); @@ -851,7 +853,7 @@ sub generate_report { my @columns = qw(warehousedescription bindescription partnumber type_and_classific partdescription chargenumber bestbefore comment qty partunit list_price purchase_price stock_value); # filter stuff - map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description chargenumber bestbefore date include_invalid_warehouses); + map { $filter{$_} = $form->{$_} if ($form->{$_}) } qw(warehouse_id bin_id classification_id partnumber description partsgroup_id chargenumber bestbefore date include_invalid_warehouses); # show filter stuff also in report my @options; @@ -868,6 +870,8 @@ sub generate_report { classification_id => sub { push @options, $locale->text('Parts Classification'). " : ". SL::DB::Manager::PartClassification->get_first(where => [ id => $form->{classification_id} ] )->description; }, description => sub { push @options, $locale->text('Description') . " : $form->{description}"}, + partsgroup_id => sub { push @options, $locale->text('Partsgroup') . " : " . + SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load->partsgroup}, chargenumber => sub { push @options, $locale->text('Charge Number') . " : $form->{chargenumber}"}, bestbefore => sub { push @options, $locale->text('Best Before') . " : $form->{bestbefore}"}, include_invalid_warehouses => sub { push @options, $locale->text('Include invalid warehouses ')}, @@ -924,7 +928,7 @@ sub generate_report { push @columns, map { "cvar_$_->{name}" } @includeable_custom_variables; my @hidden_variables = map { "l_${_}" } @columns; - push @hidden_variables, qw(warehouse_id bin_id partnumber partstypes_id description chargenumber bestbefore qty_op qty qty_unit partunit l_warehousedescription l_bindescription); + push @hidden_variables, qw(warehouse_id bin_id partnumber partstypes_id description partsgroup_id chargenumber bestbefore qty_op qty qty_unit partunit l_warehousedescription l_bindescription); push @hidden_variables, qw(include_empty_bins subtotal include_invalid_warehouses date); push @hidden_variables, qw(classification_id stock_value_basis allrows); push @hidden_variables, map({'cvar_'. $_->{name}} @searchable_custom_variables); diff --git a/templates/webpages/wh/report_filter.html b/templates/webpages/wh/report_filter.html index 3aff1b4a3..f0635c1d2 100644 --- a/templates/webpages/wh/report_filter.html +++ b/templates/webpages/wh/report_filter.html @@ -106,6 +106,10 @@ [% 'Part Description' | $T8 %]: + + [% 'Partsgroup' | $T8 %]: + [% L.select_tag('partsgroup_id', PARTSGROUPS, value_key = 'id', title_key = 'partsgroup', with_empty = 1) %] + [% 'Charge Number' | $T8 %]: -- 2.20.1