From: Bernd Blessmann Date: Wed, 27 Jul 2011 11:22:38 +0000 (+0200) Subject: Warengruppe als Dropdown bei Stammdaten/Berichte/Waren X-Git-Tag: release-2.7.0beta1~344 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=83560c6383fec7a354753f3187c3677471ba8f06;p=kivitendo-erp.git Warengruppe als Dropdown bei Stammdaten/Berichte/Waren --- diff --git a/SL/IC.pm b/SL/IC.pm index ee9227811..c07227f54 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -911,6 +911,12 @@ sub all_parts { } } + if ($form->{"partsgroup_id"}) { + $form->{"l_partsgroup"} = '1'; # show the column + push @where_tokens, "pg.id = ?"; + push @bind_vars, $form->{"partsgroup_id"}; + } + foreach (@like_filters) { next unless $form->{$_}; $form->{"l_$_"} = '1'; # show the column diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 20a920612..2b35c7087 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -115,8 +115,10 @@ sub search { $form->header; + $form->get_lists('partsgroup' => 'ALL_PARTSGROUPS'); print $form->parse_html_template('ic/search', { %is_xyz, - dateformat => $myconfig{dateformat}, }); + dateformat => $myconfig{dateformat}, + limit => $myconfig{vclimit}, }); $lxdebug->leave_sub(); } #end search() @@ -1103,6 +1105,13 @@ sub generate_report { no_sn_joins => [ qw(bought sold) ], ); + # get name of partsgroup if id is given + my $pg_name; + if ($form->{partsgroup_id}) { + my $pg = SL::DB::PartsGroup->new(id => $form->{partsgroup_id})->load; + $pg_name = $pg->{'partsgroup'}; + } + # these strings get displayed at the top of the results to indicate the user which switches were used my %optiontexts = ( active => $locale->text('Active'), @@ -1120,6 +1129,7 @@ sub generate_report { transdateto => $locale->text('To (time)') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1), partnumber => $locale->text('Part Number') . ": '$form->{partnumber}'", partsgroup => $locale->text('Group') . ": '$form->{partsgroup}'", + partsgroup_id => $locale->text('Group') . ": '$pg_name'", serialnumber => $locale->text('Serial Number') . ": '$form->{serialnumber}'", description => $locale->text('Part Description') . ": '$form->{description}'", make => $locale->text('Make') . ": '$form->{make}'", @@ -1131,7 +1141,7 @@ sub generate_report { ); my @itemstatus_keys = qw(active obsolete orphaned onhand short); - my @callback_keys = qw(onorder ordered rfq quoted bought sold partnumber partsgroup serialnumber description make model + my @callback_keys = qw(onorder ordered rfq quoted bought sold partnumber partsgroup partsgroup_id serialnumber description make model drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean); # calculate dependencies diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index cbdad1c1d..1d94fe808 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -37,7 +37,19 @@ [% 'Group' | $T8 %] - + + [%- INCLUDE generic/multibox.html + name = 'partsgroup', + select_name = 'partsgroup_id', + DATA = ALL_PARTSGROUPS, + show_empty = 1, + id_key = 'id', + label_key = 'partsgroup', + style = 'width:250px', + limit = limit, + allow_textbox = 1 + -%] + [% 'Serial Number' | $T8 %]