From: Martin Helmling martin.helmling@octosoft.eu Date: Thu, 22 Dec 2016 08:46:44 +0000 (+0100) Subject: Zusammengefasstes Listen von Ware,Erzeugnis,Dienstleistung und Sortimenten X-Git-Tag: release-3.5.4~1746 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=6416b3bbdaadb3e9bde22095b33823e6064a1222;p=kivitendo-erp.git Zusammengefasstes Listen von Ware,Erzeugnis,Dienstleistung und Sortimenten Die Suchmaske für Ware,Erzeugnis,Dienstleistung und Sortiment gilt nun einheitlich für alle Artikeltypen, deshalb wird nur noch eine Menueauswahl dazu angeboten --- diff --git a/SL/IC.pm b/SL/IC.pm index 17867a070..ce3bc00a8 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -379,12 +379,20 @@ sub all_parts { push @select_tokens, $_; } - for ($form->{searchitems}) { - push @where_tokens, "p.part_type = 'part'" if /part/; - push @where_tokens, "p.part_type = 'service'" if /service/; - push @where_tokens, "p.part_type = 'assembly'" if /assembly/; - push @where_tokens, "p.part_type = 'assortment'" if /assortment/; + # Oder Bedingungen fuer Ware Dienstleistung Erzeugnis: + if ($form->{l_part} || $form->{l_assembly} || $form->{l_service} || $form->{l_assortment}) { + my @or_tokens = (); + push @or_tokens, "p.part_type = 'service'" if $form->{l_service}; + push @or_tokens, "p.part_type = 'assembly'" if $form->{l_assembly}; + push @or_tokens, "p.part_type = 'part'" if $form->{l_part}; + push @or_tokens, "p.part_type = 'assortment'" if $form->{l_assortment}; + push @where_tokens, join ' OR ', map { "($_)" } @or_tokens; } + else { + # gar keine Teile + push @where_tokens, q|'F' = 'T'|; + } + if ( $form->{classification_id} > 0 ) { push @where_tokens, "p.classification_id = ?"; push @bind_vars, $form->{classification_id}; diff --git a/bin/mozilla/ic.pl b/bin/mozilla/ic.pl index 7cc64acf6..d54e83db9 100644 --- a/bin/mozilla/ic.pl +++ b/bin/mozilla/ic.pl @@ -84,12 +84,12 @@ sub search { $form->{lastsort} = ""; # memory for which table was sort at last time $form->{ndxs_counter} = 0; # counter for added entries to top100 - my %is_xyz = map { +"is_$_" => ($form->{searchitems} eq $_) } qw(part service assembly assortment); + # for seach all possibibilities, is_service only used as UNLESS so == 0 + my %is_xyz = ("is_part" => 1, "is_service" => 0, "is_assembly" =>1 ); $form->{title} = (ucfirst $form->{searchitems}) . "s"; $form->{title} =~ s/ys$/ies/; $form->{title} = $locale->text($form->{title}); - $form->{title} = $locale->text('Assemblies') if ($is_xyz{is_assembly}); $form->{CUSTOM_VARIABLES} = CVar->get_configs('module' => 'IC'); ($form->{CUSTOM_VARIABLES_FILTER_CODE}, @@ -412,7 +412,7 @@ sub generate_report { } $form->{"l_type_and_classific"} = "Y"; - if ($form->{searchitems} eq 'service') { + if ($form->{l_service} && !$form->{l_assembly} && !$form->{l_part}) { # remove bin, weight and rop from list map { $form->{"l_$_"} = "" } qw(bin weight rop); @@ -527,7 +527,7 @@ sub generate_report { { PART_CLASSIFICATIONS => SL::DB::Manager::PartClassification->get_all_sorted }), 'output_format' => 'HTML', 'title' => $form->{title}, - 'attachment_basename' => $attachment_basenames{$form->{searchitems}} . strftime('_%Y%m%d', localtime time), + 'attachment_basename' => 'article_list' . strftime('_%Y%m%d', localtime time), ); $report->set_options_from_form(); $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv'; @@ -650,7 +650,7 @@ sub generate_report { (!$next_ref->{assemblyitem} && ($same_item ne $next_ref->{ $form->{sort} })))) { my $row = { map { $_ => { 'class' => 'listsubtotal', } } @columns }; - if (($form->{searchitems} ne 'assembly') || !$form->{bom}) { + if ( !$form->{l_assembly} || !$form->{bom}) { $row->{soldtotal}->{data} = $form->format_amount(\%myconfig, $subtotals{soldtotal}); } diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index b0db0eb21..0713796fe 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -142,45 +142,15 @@ action: CustomerVendor/search_contact db: customer - parent: master_data_reports - id: master_data_reports_parts - name: Parts + id: master_data_reports_articles + name: Articles icon: part_report - order: 400 - access: part_service_assembly_details - module: ic.pl - params: - action: search - searchitems: part -- parent: master_data_reports - id: master_data_reports_services - name: Services - icon: service_report order: 500 access: part_service_assembly_details module: ic.pl params: action: search - searchitems: service -- parent: master_data_reports - id: master_data_reports_assemblies - name: Assemblies - icon: assembly_report - order: 600 - access: part_service_assembly_details - module: ic.pl - params: - action: search - searchitems: assembly -- parent: master_data_reports - id: master_data_reports_assortments - name: Assortments - icon: assortment_report - order: 650 - access: part_service_assortment_details - module: ic.pl - params: - action: search - searchitems: assortment + searchitems: article - parent: master_data_reports id: master_data_reports_projects name: Projects diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index 433a25e82..c9fd837a8 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -22,6 +22,27 @@ + + + +
[% 'Part Type' | $T8 %] + + + + +
+ + + + + + + + + + + +
[% 'Part Number' | $T8 %]