From: Bernd Bleßmann Date: Wed, 28 Jan 2015 20:58:04 +0000 (+0100) Subject: Stammdaten -> Berichte -> Kunden: Nach Standardverkäufer filtern können. X-Git-Tag: release-3.2.0beta~18 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=b1c40d4de868ead7dc9f2a007d7d461b02318d29;p=kivitendo-erp.git Stammdaten -> Berichte -> Kunden: Nach Standardverkäufer filtern können. --- diff --git a/SL/CT.pm b/SL/CT.pm index b430272e0..ab931c04c 100644 --- a/SL/CT.pm +++ b/SL/CT.pm @@ -171,6 +171,11 @@ sub search { push(@values, conv_i($form->{business_id})); } + if ($form->{salesman_id}) { + $where .= qq| AND (ct.salesman_id = ?)|; + push(@values, conv_i($form->{salesman_id})); + } + # Nur Kunden finden, bei denen ich selber der Verkäufer bin # Gilt nicht für Lieferanten if ($cv eq 'customer' && !$main::auth->assert('customer_vendor_all_edit', 1)) { diff --git a/bin/mozilla/ct.pl b/bin/mozilla/ct.pl index b5b83c19f..5a2dbd6c5 100644 --- a/bin/mozilla/ct.pl +++ b/bin/mozilla/ct.pl @@ -76,7 +76,8 @@ sub search { $form->{IS_CUSTOMER} = $form->{db} eq 'customer'; - $form->get_lists("business_types" => "ALL_BUSINESS_TYPES"); + $form->get_lists("business_types" => "ALL_BUSINESS_TYPES", + "salesmen" => "ALL_SALESMEN"); $form->{SHOW_BUSINESS_TYPES} = scalar @{ $form->{ALL_BUSINESS_TYPES} } > 0; $form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'CT'); @@ -152,6 +153,12 @@ sub list_names { push @options, $label . " : " . $business->description; } } + if ($form->{salesman_id}) { + my $salesman = SL::DB::Manager::Employee->find_by(id => $form->{salesman_id}); + if ($salesman) { + push @options, $locale->text('Salesman') . " : " . $salesman->name; + } + } my @columns = ( 'id', 'name', "$form->{db}number", 'contact', 'phone', 'discount', @@ -194,7 +201,7 @@ sub list_names { my @hidden_variables = ( qw( db status obsolete name contact email cp_name addr_street addr_zipcode - addr_city addr_country business_id + addr_city addr_country business_id salesman_id ), "$form->{db}number", map({ "cvar_$_->{name}" } @searchable_custom_variables), map({'cvar_'. $_->{name} .'_qtyop'} grep({$_->{type} eq 'number'} @searchable_custom_variables)), diff --git a/templates/webpages/ct/search.html b/templates/webpages/ct/search.html index 57b970cbe..933a7d1c0 100644 --- a/templates/webpages/ct/search.html +++ b/templates/webpages/ct/search.html @@ -57,6 +57,15 @@ [% END %] + [% IF IS_CUSTOMER && ALL_SALESMEN.size %] + + [% 'Salesman' | $T8 %] + + [% L.select_tag('salesman_id', ALL_SALESMEN, title_key = 'name', with_empty = 1) %] + + + [% END %] + [% CUSTOM_VARIABLES_FILTER_CODE %]