From: Jan Büren Date: Thu, 26 Mar 2020 11:43:07 +0000 (+0100) Subject: Artikelsuche: Suche nach in Erzeugnis verbauten Artikeln X-Git-Tag: release-3.5.6.1~239 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=52f5223a1dcf;p=kivitendo-erp.git Artikelsuche: Suche nach in Erzeugnis verbauten Artikeln Als Ergebnis werden Erzeugnisse und deren Bestandteile angezeigt. Gültige Suchkriterien sind aktuell nur die Spalten in parts --- diff --git a/SL/IC.pm b/SL/IC.pm index 16ebef0b8..0983e2a8a 100644 --- a/SL/IC.pm +++ b/SL/IC.pm @@ -526,6 +526,22 @@ sub all_parts { push @bind_vars, @cvar_values; } + # simple search for assemblies by items used in assemblies + if ($form->{bom} eq '2' && $form->{l_assembly}) { + # nuke where clause and bind vars + $where_clause = ' 1=1 AND p.id in (SELECT id from assembly where parts_id IN ' . + ' (select id from parts where 1=1 AND '; + @bind_vars = (); + # use only like filter for items used in assemblies + foreach (@like_filters) { + next unless $form->{$_}; + $form->{"l_$_"} = '1'; # show the column + $where_clause .= " $_ ILIKE ? "; + push @bind_vars, like($form->{$_}); + } + $where_clause .='))'; + } + my $query = <<" SQL"; SELECT DISTINCT $select_clause FROM parts p diff --git a/locale/de/all b/locale/de/all index 96281457a..b25c483ec 100755 --- a/locale/de/all +++ b/locale/de/all @@ -2803,6 +2803,7 @@ $self->{texts} = { 'Search AR Aging' => 'Offene Forderungen', 'Search bank transactions' => 'Filter für Bankbuchungen', 'Search contacts' => 'Personensuche', + 'Search for Items used in Assemblies' => 'Suche nach in Erzeugnissen verbauten Artikeln', 'Search parts by customer partnumber in sales order forms' => 'Artikel nach Kunden-Art.-Nr. in Verkaufsbelegen suchen', 'Search parts by vendor partnumber (model) in purchase order forms' => 'Artikel nach Lieferanten-Art.-Nr. in Einkaufsbelegen suchen', 'Search term' => 'Suchbegriff', diff --git a/templates/webpages/ic/search.html b/templates/webpages/ic/search.html index 3e68dc0cf..42ec5fb86 100644 --- a/templates/webpages/ic/search.html +++ b/templates/webpages/ic/search.html @@ -102,6 +102,7 @@ [% L.radio_button_tag('bom', id='bom_0', value=0, checked=1, label=LxERP.t8('Top Level Designation only')) %] [% L.radio_button_tag('bom', id='bom_1', value=1, label=LxERP.t8('Individual Items')) %] + [% L.radio_button_tag('bom', id='bom_2', value=2, label=LxERP.t8('Search for Items used in Assemblies')) %]