From 22a52f84da5686ecce3a55cd4c4ab2ecabab1d9c Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Tue, 14 Apr 2015 15:21:19 +0200 Subject: [PATCH] =?utf8?q?Stammdaten->Berichte->Waren:=20Nach=20Shopartike?= =?utf8?q?l=20filtern=20und=20anzeigen=20k=C3=B6nnen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/IC.pm | 14 ++++++++++++-- bin/mozilla/ic.pl | 13 ++++++++++--- templates/webpages/ic/search.html | 6 ++++++ 3 files changed, 28 insertions(+), 5 deletions(-) diff --git a/SL/IC.pm b/SL/IC.pm index 27af46a50..2455d9e0e 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -730,7 +730,7 @@ sub all_parts { my @apoe_filters = qw(transdate); my @like_filters = (@simple_filters, @invoice_oi_filters); my @all_columns = (@simple_filters, @makemodel_filters, @apoe_filters, @project_filters, qw(serialnumber)); - my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image)); + my @simple_l_switches = (@all_columns, qw(notes listprice sellprice lastcost priceupdate weight unit rop image shop)); my @oe_flags = qw(bought sold onorder ordered rfq quoted); my @qsooqr_flags = qw(invnumber ordnumber quonumber trans_id name module qty); my @deliverydate_flags = qw(deliverydate); @@ -856,6 +856,16 @@ sub all_parts { push @bind_vars, $form->{"partsgroup_id"}; } + if ($form->{shop} ne '') { + $form->{l_shop} = '1'; # show the column + if ($form->{shop} eq '0' || $form->{shop} eq 'f') { + push @where_tokens, 'NOT p.shop'; + $form->{shop} = 'f'; + } else { + push @where_tokens, 'p.shop'; + } + } + foreach (@like_filters) { next unless $form->{$_}; $form->{"l_$_"} = '1'; # show the column @@ -973,7 +983,7 @@ sub all_parts { my $token_builder = $make_token_builder->(\%joins_needed); - my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate)); + my @sort_cols = (@simple_filters, qw(id priceupdate onhand invnumber ordnumber quonumber name serialnumber soldtotal deliverydate shop)); $form->{sort} = 'id' unless grep { $form->{"l_$_"} } grep { $form->{sort} eq $_ } @sort_cols; # sort by id if unknown or invisible column my $sort_order = ($form->{revers} ? ' DESC' : ' ASC'); my $order_clause = " ORDER BY " . $token_builder->($form->{sort}) . ($form->{revers} ? ' DESC' : ' ASC'); diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 76f086938..12037639d 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -1045,6 +1045,7 @@ sub generate_report { 'transdate' => { 'text' => $locale->text('Transdate'), }, 'unit' => { 'text' => $locale->text('Unit'), }, 'weight' => { 'text' => $locale->text('Weight'), }, + 'shop' => { 'text' => $locale->text('Shopartikel'), }, 'projectnumber' => { 'text' => $locale->text('Project Number'), }, 'projectdescription' => { 'text' => $locale->text('Project Description'), }, ); @@ -1133,7 +1134,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 partsgroup_id serialnumber description make model - drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean); + drawing microfiche l_soldtotal l_deliverydate transdatefrom transdateto ean shop); # calculate dependencies for (@itemstatus_keys, @callback_keys) { @@ -1219,6 +1220,7 @@ sub generate_report { linetotallistprice sellprice linetotalsellprice lastcost linetotallastcost priceupdate weight image drawing microfiche invnumber ordnumber quonumber transdate name serialnumber deliverydate ean projectnumber projectdescription + shop ); my $pricegroups = SL::DB::Manager::Pricegroup->get_all(sort => 'id'); @@ -1243,7 +1245,7 @@ sub generate_report { %column_defs = (%column_defs, %column_defs_cvars, %column_defs_pricegroups); map { $column_defs{$_}->{visible} ||= $form->{"l_$_"} ? 1 : 0 } @columns; - map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal), @pricegroup_columns; + map { $column_defs{$_}->{align} = 'right' } qw(onhand sellprice listprice lastcost linetotalsellprice linetotallastcost linetotallistprice rop weight soldtotal shop), @pricegroup_columns; my @hidden_variables = ( qw(l_subtotal l_linetotal searchitems itemstatus bom l_pricegroups), @@ -1256,7 +1258,7 @@ sub generate_report { my $callback = build_std_url('action=generate_report', grep { $form->{$_} } @hidden_variables); - my @sort_full = qw(partnumber description onhand soldtotal deliverydate); + my @sort_full = qw(partnumber description onhand soldtotal deliverydate shop); my @sort_no_revers = qw(partsgroup bin priceupdate invnumber ordnumber quonumber name image drawing serialnumber); foreach my $col (@sort_full) { @@ -1350,6 +1352,11 @@ sub generate_report { $row->{weight}->{data} .= ' ' . $defaults->{weightunit}; + # 'yes' and 'no' for boolean value shop + if ($form->{l_shop}) { + $row->{shop}{data} = $row->{shop}{data}? $::locale->text('yes') : $::locale->text('no'); + } + if (!$ref->{assemblyitem}) { foreach my $col (@subtotal_columns) { $totals{$col} += $soldtotal * $ref->{$col}; diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index 4433c82a1..d0f0616a0 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -65,6 +65,11 @@ + + [% 'Shopartikel' | $T8 %] + [% L.yes_no_tag('shop', shop, default='', with_empty=1, empty_title='---') %] + + [% CUSTOM_VARIABLES_FILTER_CODE %] [%- IF is_assembly %] @@ -208,6 +213,7 @@ [%- L.checkbox_tag('l_notes', label=LxERP.t8('Notes'), value='Y') %] [%- L.checkbox_tag('l_name', label=LxERP.t8('Name in Selected Records'), value='Y') %] + [%- L.checkbox_tag('l_shop', label=LxERP.t8('Shopartikel'), value='Y') %] [% CUSTOM_VARIABLES_INCLUSION_CODE %] -- 2.20.1