Zusammengefasstes Listen von Ware,Erzeugnis,Dienstleistung und Sortimenten
authorMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Thu, 22 Dec 2016 08:46:44 +0000 (09:46 +0100)
committerMartin Helmling martin.helmling@octosoft.eu <martin.helmling@octosoft.eu>
Wed, 11 Jan 2017 07:20:39 +0000 (08:20 +0100)
Die Suchmaske für Ware,Erzeugnis,Dienstleistung und Sortiment gilt nun einheitlich für alle Artikeltypen,
deshalb wird nur noch eine Menueauswahl dazu angeboten

SL/IC.pm
bin/mozilla/ic.pl
menus/user/00-erp.yaml
templates/webpages/ic/search.html

index 17867a0..ce3bc00 100644 (file)
--- 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};
index 7cc64ac..d54e83d 100644 (file)
@@ -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});
       }
 
index b0db0eb..0713796 100644 (file)
     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
index 433a25e..c9fd837 100644 (file)
    <tr valign="top">
     <td>
      <table>
+      <tr>
+       <th align="right" nowrap>[% 'Part Type' | $T8 %]</th>
+       <td  colspan="4" ><table><tr>
+        <td>
+          <input name="l_part" id="l_part" class="checkbox" type="checkbox" value="Y" checked>
+          <label for="l_part">[% 'Part' | $T8 %]</label>
+        </td>
+        <td>
+          <input name="l_service" id="l_service" class="checkbox" type="checkbox" value="Y" checked>
+          <label for="l_service">[% 'Service' | $T8 %]</label>
+        </td>
+        <td>
+          <input name="l_assembly" id="l_assembly" class="checkbox" type="checkbox" value="Y" checked>
+          <label for="l_assembly">[% 'Assembly' | $T8 %]</label>
+        </td>
+        <td>
+          <input name="l_assortment" id="l_assortment" class="checkbox" type="checkbox" value="Y" checked>
+          <label for="l_assortment">[% 'Assortment' | $T8 %]</label>
+        </td>
+       </tr></table></td>
+      </tr>
       <tr>
        <th align="right" nowrap>[% 'Part Number' | $T8 %]</th>
        <td><input name="partnumber" size="20"></td>