From 329534cc42a07ab50f6e69186e81cdaf1eca2187 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 25 Nov 2013 15:48:26 +0100 Subject: [PATCH] =?utf8?q?Lieferplan:=20Filter=20f=C3=BCr=20Projektnummer?= =?utf8?q?=20und=20Kundentyp?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Conflicts: SL/Controller/DeliveryPlan.pm --- SL/Controller/DeliveryPlan.pm | 27 +++++++++++-------- templates/webpages/delivery_plan/_filter.html | 15 +++++++++++ 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index c68cc4c32..a07dc3e0c 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -5,6 +5,7 @@ use parent qw(SL::Controller::Base); use Clone qw(clone); use SL::DB::OrderItem; +use SL::DB::Business; use SL::Controller::Helper::GetModels; use SL::Controller::Helper::ReportGenerator; use SL::Locale::String; @@ -39,8 +40,9 @@ sub action_list { $self->prepare_report; my $orderitems = $self->models->get; + $self->{all_businesses} = SL::DB::Manager::Business->get_all_sorted; - $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems); + $self->report_generator_list_objects(report => $self->{report}, objects => $orderitems); } # private functions @@ -122,17 +124,20 @@ sub make_filter_summary { my $filter = $::form->{filter} || {}; my @filter_strings; + my $business = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"}; my @filters = ( - [ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ], - [ $filter->{part}{"partnumber:substr::ilike"}, $::locale->text('Part Number') ], - [ $filter->{"description:substr::ilike"}, $::locale->text('Part Description') ], - [ $filter->{"reqdate:date::ge"}, $::locale->text('Delivery Date') . " " . $::locale->text('From Date') ], - [ $filter->{"reqdate:date::le"}, $::locale->text('Delivery Date') . " " . $::locale->text('To Date') ], - [ $filter->{"qty:number"}, $::locale->text('Quantity') ], - [ $filter->{order}{vendor}{"name:substr::ilike"}, $::locale->text('Vendor') ], - [ $filter->{order}{vendor}{"vendornumber:substr::ilike"}, $::locale->text('Vendor Number') ], - [ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ], - [ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ], + [ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ], + [ $filter->{order}{globalproject}{"projectnumber:substr::ilike"}, $::locale->text('Document Project Number') ], + [ $filter->{part}{"partnumber:substr::ilike"}, $::locale->text('Part Number') ], + [ $filter->{"description:substr::ilike"}, $::locale->text('Part Description') ], + [ $filter->{"reqdate:date::ge"}, $::locale->text('Delivery Date') . " " . $::locale->text('From Date') ], + [ $filter->{"reqdate:date::le"}, $::locale->text('Delivery Date') . " " . $::locale->text('To Date') ], + [ $filter->{"qty:number"}, $::locale->text('Quantity') ], + [ $filter->{order}{vendor}{"name:substr::ilike"}, $::locale->text('Vendor') ], + [ $filter->{order}{vendor}{"vendornumber:substr::ilike"}, $::locale->text('Vendor Number') ], + [ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ], + [ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ], + [ $business, $::locale->text('Customer type') ], ); my %flags = ( diff --git a/templates/webpages/delivery_plan/_filter.html b/templates/webpages/delivery_plan/_filter.html index fef7c31dc..1bd64f12c 100644 --- a/templates/webpages/delivery_plan/_filter.html +++ b/templates/webpages/delivery_plan/_filter.html @@ -14,6 +14,10 @@ [% 'Number' | $T8 %] [% L.input_tag('filter.order.ordnumber:substr::ilike', filter.order.ordnumber_substr__ilike, size = 20) %] + + [% 'Document Project Number' | $T8 %] + [% L.input_tag('filter.order.globalproject.projectnumber:substr::ilike', filter.order.globalproject.projectnumber_substr__ilike, size = 20) %] + [% 'Part Number' | $T8 %] [% L.input_tag('filter.part.partnumber:substr::ilike', filter.part.partnumber_substr__ilike, size = 20) %] @@ -52,6 +56,17 @@ [% L.input_tag('filter.order.vendor.vendornumber:substr::ilike', filter.order.vendor.vendornumber_substr__ilike, size = 20) %] [% END %] + + [% 'Customer type' | $T8 %] + + [% L.select_tag('filter.order.customer.business_id', SELF.all_businesses, + default => filter.order.customer.business_id, + title_key => 'description', + value_key => 'id', + with_empty => 1, + style => 'width: 200px') %] + + [% 'Type' | $T8 %] -- 2.20.1