From a54fb4aaa1dfd04290aadf93f30641f9b91156b0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 25 Nov 2014 18:05:27 +0100 Subject: [PATCH] Lieferplan / Lieferwertbericht um Filter Bearbeiter erweitert --- SL/Controller/DeliveryPlan.pm | 10 ++++++++-- templates/webpages/delivery_plan/_filter.html | 13 ++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/SL/Controller/DeliveryPlan.pm b/SL/Controller/DeliveryPlan.pm index a07dc3e0c..8d2417eb5 100644 --- a/SL/Controller/DeliveryPlan.pm +++ b/SL/Controller/DeliveryPlan.pm @@ -13,7 +13,7 @@ use Carp; use Rose::Object::MakeMethods::Generic ( scalar => [ qw(db_args flat_filter) ], - 'scalar --get_set_init' => [ qw(models all_edit_right mode vc) ], + 'scalar --get_set_init' => [ qw(models all_edit_right mode vc all_employees) ], ); __PACKAGE__->run_before(sub { $::auth->assert('delivery_plan'); }); @@ -42,7 +42,7 @@ sub action_list { 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 @@ -125,6 +125,8 @@ sub make_filter_summary { my @filter_strings; my $business = SL::DB::Business->new(id => $filter->{order}{customer}{"business_id"})->load->description if $filter->{order}{customer}{"business_id"}; + my $employee = SL::DB::Employee->new(id => $filter->{order}{employee_id})->load->name if $filter->{order}{employee_id}; + my @filters = ( [ $filter->{order}{"ordnumber:substr::ilike"}, $::locale->text('Number') ], [ $filter->{order}{globalproject}{"projectnumber:substr::ilike"}, $::locale->text('Document Project Number') ], @@ -138,6 +140,7 @@ sub make_filter_summary { [ $filter->{order}{customer}{"name:substr::ilike"}, $::locale->text('Customer') ], [ $filter->{order}{customer}{"customernumber:substr::ilike"}, $::locale->text('Customer Number') ], [ $business, $::locale->text('Customer type') ], + [ $employee, $::locale->text('Employee') ], ); my %flags = ( @@ -300,6 +303,9 @@ sub init_mode { return $::form->{mode} if ($::form->{mode} eq 'delivery_value_report' || $::form->{mode} eq 'delivery_plan') || croak "self (DeliveryPlan) has no mode defined"; } +sub init_all_employees { + return SL::DB::Manager::Employee->get_all_sorted; +} sub link_to { my ($self, $object, %params) = @_; diff --git a/templates/webpages/delivery_plan/_filter.html b/templates/webpages/delivery_plan/_filter.html index 1bd64f12c..244300e55 100644 --- a/templates/webpages/delivery_plan/_filter.html +++ b/templates/webpages/delivery_plan/_filter.html @@ -67,6 +67,17 @@ style => 'width: 200px') %] + + [% 'Employee' | $T8 %] + + [% L.select_tag('filter.order.employee_id', SELF.all_employees, + default => filter.order.employee_id, + title_key => 'name', + value_key => 'id', + with_empty => 1, + style => 'width: 200px') %] + + [% 'Type' | $T8 %] @@ -83,7 +94,7 @@ [% L.hidden_tag('page', FORM.page) %] [% L.hidden_tag('vc', SELF.vc) %] [% L.hidden_tag('mode', SELF.mode) %] - [% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] +[% L.input_tag('action_list', LxERP.t8('Continue'), type = 'submit', class='submit')%] [% 'Reset' | $T8 %] -- 2.20.1