From: Bernd Bleßmann Date: Mon, 26 Aug 2013 13:26:47 +0000 (+0200) Subject: Filtern nach Kunden-/Lieferantentyp bei Angeboten u. Aufträgen X-Git-Tag: release-3.1.0beta1~77 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=fac049a07ca0a2e5dacf31f297766e3517893a40;p=kivitendo-erp.git Filtern nach Kunden-/Lieferantentyp bei Angeboten u. Aufträgen --- diff --git a/SL/OE.pm b/SL/OE.pm index 694732e1d..683bb0e7c 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -87,7 +87,7 @@ sub transactions { qq| ex.$rate AS exchangerate, | . qq| pr.projectnumber AS globalprojectnumber, | . qq| e.name AS employee, s.name AS salesman, | . - qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid | . + qq| ct.${vc}number AS vcnumber, ct.country, ct.ustid, ct.business_id | . $periodic_invoices_columns . qq|FROM oe o | . qq|JOIN $vc ct ON (o.${vc}_id = ct.id) | . @@ -126,6 +126,11 @@ SQL push @values, "%" . $form->{"projectnumber"} . "%", "%" . $form->{"projectnumber"} . "%" ; } + if ($form->{"business_id"}) { + $query .= " AND ct.business_id = ?"; + push(@values, $form->{"business_id"}); + } + if ($form->{"${vc}_id"}) { $query .= " AND o.${vc}_id = ?"; push(@values, $form->{"${vc}_id"}); diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 8f42a067b..3a35b8906 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -721,7 +721,8 @@ sub search { $form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP"); $form->get_lists("projects" => { "key" => "ALL_PROJECTS", "all" => 1 }, "departments" => "ALL_DEPARTMENTS", - "$form->{vc}s" => "ALL_VC"); + "$form->{vc}s" => "ALL_VC", + "business_types" => "ALL_BUSINESS_TYPES"); $form->{ALL_EMPLOYEES} = SL::DB::Manager::Employee->get_all(query => [ deleted => 0 ]); # constants and subs for template @@ -829,7 +830,8 @@ sub orders { my @hidden_variables = map { "l_${_}" } @columns; push @hidden_variables, "l_subtotal", $form->{vc}, qw(l_closed l_notdelivered open closed delivered notdelivered ordnumber quonumber transaction_description transdatefrom transdateto type vc employee_id salesman_id - reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive); + reqdatefrom reqdateto projectnumber project_id periodic_invoices_active periodic_invoices_inactive + business_id); my $href = build_std_url('action=orders', grep { $form->{$_} } @hidden_variables); @@ -902,6 +904,11 @@ sub orders { push @options, $locale->text('Not delivered') if $form->{notdelivered}; push @options, $locale->text('Periodic invoices active') if $form->{periodic_invoices_actibe}; + 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; + } + $report->set_options('top_info_text' => join("\n", @options), 'raw_top_info_text' => $form->parse_html_template('oe/orders_top'), 'raw_bottom_info_text' => $form->parse_html_template('oe/orders_bottom', { 'SHOW_CONTINUE_BUTTON' => $allow_multiple_orders }), diff --git a/templates/webpages/oe/search.html b/templates/webpages/oe/search.html index b8823de38..c71e60f6d 100644 --- a/templates/webpages/oe/search.html +++ b/templates/webpages/oe/search.html @@ -4,6 +4,7 @@ [%- USE L %] [%- SET vclabel = vc == 'customer' ? LxERP.t8('Customer') : LxERP.t8('Vendor') %] [%- SET vcnumberlabel = vc == 'customer' ? LxERP.t8('Customer Number') : LxERP.t8('Vendor Number') %] +[%- SET vctypelabel = vc == 'customer' ? LxERP.t8('Customer type') : LxERP.t8('Vendor type') %]
@@ -79,6 +80,14 @@ -%] + [%- UNLESS ALL_BUSINESS_TYPES.size == 0 %] + + [% vctypelabel %] + + [% L.select_tag('business_id', ALL_BUSINESS_TYPES, title_key = 'description', with_empty = 1, style='width:250px') %] + + + [%- END %] [% IF is_order %][% 'Order Date' | $T8 %][% ELSE %][% 'Quotation Date' | $T8 %][% END %] [% 'From' | $T8 %]