From: Bernd Bleßmann Date: Thu, 5 Jun 2014 20:08:06 +0000 (+0200) Subject: Filtern nach Kunden-/Lieferantentyp bei Lieferschein-Berichten. X-Git-Tag: release-3.3.0beta~120 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=d93709bdf3f56b275ae120d8a0205e666bc62b9c;p=kivitendo-erp.git Filtern nach Kunden-/Lieferantentyp bei Lieferschein-Berichten. Conflicts: bin/mozilla/do.pl --- diff --git a/SL/DO.pm b/SL/DO.pm index eb74e26c7..e764ac6c3 100644 --- a/SL/DO.pm +++ b/SL/DO.pm @@ -67,7 +67,8 @@ sub transactions { my $query = qq|SELECT dord.id, dord.donumber, dord.ordnumber, dord.cusordnumber, dord.transdate, dord.reqdate, - ct.${vc}number, ct.name, dord.${vc}_id, dord.globalproject_id, + ct.${vc}number, ct.name, ct.business_id, + dord.${vc}_id, dord.globalproject_id, dord.closed, dord.delivered, dord.shippingpoint, dord.shipvia, dord.transaction_description, dord.itime::DATE AS insertdate, pr.projectnumber AS globalprojectnumber, @@ -98,6 +99,11 @@ sub transactions { push @values, conv_i($form->{project_id}), conv_i($form->{project_id}); } + if ($form->{"business_id"}) { + push @where, qq|ct.business_id = ?|; + push @values, conv_i($form->{"business_id"}); + } + if ($form->{"${vc}_id"}) { push @where, qq|dord.${vc}_id = ?|; push @values, $form->{"${vc}_id"}; diff --git a/bin/mozilla/do.pl b/bin/mozilla/do.pl index 7e8eabb88..33ab98c01 100644 --- a/bin/mozilla/do.pl +++ b/bin/mozilla/do.pl @@ -492,10 +492,11 @@ sub search { $form->{vc} = $form->{type} eq 'purchase_delivery_order' ? 'vendor' : 'customer'; - $form->get_lists("projects" => { "key" => "ALL_PROJECTS", - "all" => 1 }, - "departments" => "ALL_DEPARTMENTS", - "$form->{vc}s" => "ALL_VC"); + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }, + "departments" => "ALL_DEPARTMENTS", + "$form->{vc}s" => "ALL_VC", + "business_types" => "ALL_BUSINESS_TYPES"); $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]); $form->{SHOW_VC_DROP_DOWN} = $myconfig{vclimit} > scalar @{ $form->{ALL_VC} }; @@ -551,7 +552,7 @@ sub orders { push @hidden_variables, $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered donumber ordnumber serialnumber cusordnumber transaction_description transdatefrom transdateto reqdatefrom reqdateto type vc employee_id salesman_id project_id - insertdatefrom insertdateto); + insertdatefrom insertdateto business_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -614,6 +615,10 @@ sub orders { push @options, $locale->text('Order Number') . " : $form->{ordnumber}"; } push @options, $locale->text('Serial Number') . " : $form->{serialnumber}" if $form->{serialnumber}; + if ($form->{business_id}) { + my $vc_type_label = $form->{vc} eq 'customer' ? $locale->text('Customer type') : $locale->text('Vendor type'); + push @options, $vc_type_label . " : " . SL::DB::Business->new(id => $form->{business_id})->load->description; + } if ($form->{transaction_description}) { push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"; } diff --git a/templates/webpages/do/search.html b/templates/webpages/do/search.html index ae86cb240..baa00bb18 100644 --- a/templates/webpages/do/search.html +++ b/templates/webpages/do/search.html @@ -9,6 +9,8 @@ [%- SET is_customer = '0' %] [%- END %] + [%- SET vctypelabel = vc == 'customer' ? LxERP.t8('Customer type') : LxERP.t8('Vendor type') %] + @@ -108,6 +110,15 @@ + [%- IF ALL_BUSINESS_TYPES.size %] + + [% vctypelabel %] + + [% L.select_tag('business_id', ALL_BUSINESS_TYPES, title_key = 'description', with_empty = 1, style='width:250px') %] + + + [%- END %] + [% 'Delivery Order Date' | $T8 %] [% 'From' | $T8 %]