From: Moritz Bunkus Date: Thu, 11 Oct 2012 15:41:37 +0000 (+0200) Subject: Suche nach und Anzeige von Abteilungen bei Lieferscheinsuche X-Git-Tag: release-3.0.0beta1~225^2~1 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ed14204df3eb35e33247c5f5b0fec0298a141ef2;p=kivitendo-erp.git Suche nach und Anzeige von Abteilungen bei Lieferscheinsuche Implementiert #1952. --- diff --git a/SL/DO.pm b/SL/DO.pm index 237d523d9..4fbe8020a 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -66,13 +66,16 @@ sub transactions { dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, dord.transaction_description, pr.projectnumber AS globalprojectnumber, + dep.description AS department, e.name AS employee, sm.name AS salesman FROM delivery_orders dord LEFT JOIN $vc ct ON (dord.${vc}_id = ct.id) LEFT JOIN employee e ON (dord.employee_id = e.id) LEFT JOIN employee sm ON (dord.salesman_id = sm.id) - LEFT JOIN project pr ON (dord.globalproject_id = pr.id)|; + LEFT JOIN project pr ON (dord.globalproject_id = pr.id) + LEFT JOIN department dep ON (dord.department_id = dep.id) +|; push @where, ($form->{type} eq 'sales_delivery_order' ? '' : 'NOT ') . qq|COALESCE(dord.is_sales, FALSE)|; @@ -147,7 +150,8 @@ sub transactions { "employee" => "e.name", "salesman" => "sm.name", "shipvia" => "dord.shipvia", - "transaction_description" => "dord.transaction_description" + "transaction_description" => "dord.transaction_description", + "department" => "lower(dep.description)", ); my $sortdir = !defined $form->{sortdir} ? 'ASC' : $form->{sortdir} ? 'ASC' : 'DESC'; diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 1bcf20985..1dc880ef9 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -453,6 +453,7 @@ sub search { $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, + "departments" => "ALL_DEPARTMENTS", "$form->{vc}s" => "ALL_VC"); $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); @@ -477,6 +478,7 @@ sub orders { my $locale = $main::locale; my $cgi = $::request->{cgi}; + $form->{department_id} = (split /--/, $form->{department})[-1]; ($form->{ $form->{vc} }, $form->{"$form->{vc}_id"}) = split(/--/, $form->{ $form->{vc} }); report_generator_set_default_sort('transdate', 1); @@ -491,7 +493,7 @@ sub orders { ordnumber customernumber name employee salesman shipvia globalprojectnumber - transaction_description + transaction_description department open delivered ); @@ -525,9 +527,10 @@ sub orders { 'transaction_description' => { 'text' => $locale->text('Transaction description'), }, 'open' => { 'text' => $locale->text('Open'), }, 'delivered' => { 'text' => $locale->text('Delivered'), }, + 'department' => { 'text' => $locale->text('Department'), }, ); - foreach my $name (qw(id transdate donumber ordnumber name employee salesman shipvia transaction_description)) { + foreach my $name (qw(id transdate donumber ordnumber name employee salesman shipvia transaction_description department)) { my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir}; $column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir"; } diff --git a/templates/webpages/do/search.html b/templates/webpages/do/search.html index 66cd07f4e..f7ab5d591 100644 --- a/templates/webpages/do/search.html +++ b/templates/webpages/do/search.html @@ -62,7 +62,7 @@ @@ -182,6 +182,18 @@ [% END %] + + + + + + + + + + + + @@ -192,11 +204,6 @@ - - - - - @@ -230,4 +237,3 @@ -