diff --git a/SL/AP.pm b/SL/AP.pm index da57164d59..c8fca640f3 100644 --- a/SL/AP.pm +++ b/SL/AP.pm @@ -767,6 +767,19 @@ SQL push @values, like($form->{parts_description}); } + if ($form->{parts_serialnumber}) { + $where .= <{parts_serialnumber}); + } + if ($where) { $where =~ s{\s*AND\s*}{ WHERE }; $query .= $where; diff --git a/SL/AR.pm b/SL/AR.pm index 6bf390fc48..b276480f4a 100644 --- a/SL/AR.pm +++ b/SL/AR.pm @@ -667,6 +667,29 @@ sub ar_transactions { } } + $form->{fulltext} = trim($form->{fulltext}); + if ($form->{fulltext}) { + my @fulltext_fields = qw(a.notes + a.intnotes + a.shipvia + a.transaction_description + a.quonumber + a.ordnumber + a.invnumber); + $where .= ' AND ('; + $where .= join ' OR ', map {"$_ ILIKE ?"} @fulltext_fields; + + $where .= <{fulltext})) for 1 .. (scalar @fulltext_fields) + 1; + } + if ($form->{parts_partnumber}) { $where .= <{parts_description}); } + if ($form->{parts_serialnumber}) { + $where .= <{parts_serialnumber}); + } + if ($form->{show_not_mailed}) { $where .= <{$_} } @hidden_variables); @@ -1267,6 +1268,7 @@ sub ap_transactions { push @options, $locale->text('Part Description') . " : $form->{parts_description}" if $form->{parts_description}; push @options, $locale->text('Part Number') . " : $form->{parts_partnumber}" if $form->{parts_partnumber}; push @options, $locale->text('Full Text') . " : $form->{fulltext}" if ($form->{fulltext}); + push @options, $locale->text('Serial Number') . " : $form->{parts_serialnumber}" if ($form->{parts_serialnumber}); push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1) if ($form->{transdatefrom}); push @options, $locale->text('Bis') . " " . $locale->date(\%myconfig, $form->{transdateto}, 1) if ($form->{transdateto}); push @options, $locale->text('Due Date') . " " . $locale->text('from') . " " . $locale->date(\%myconfig, $form->{duedatefrom}, 1) if ($form->{duedatefrom}); diff --git a/bin/mozilla/ar.pl b/bin/mozilla/ar.pl index cc8c185be9..00a685b7fd 100644 --- a/bin/mozilla/ar.pl +++ b/bin/mozilla/ar.pl @@ -1154,7 +1154,7 @@ sub ar_transactions { business_id parts_partnumber parts_description department_id show_marked_as_closed show_not_mailed shippingpoint shipvia taxzone_id payment_id shiptoname shiptodepartment_1 shiptodepartment_2 shiptostreet - shiptozipcode shiptocity shiptocountry + shiptozipcode shiptocity shiptocountry fulltext parts_serialnumber ); push @hidden_variables, map { "cvar_$_->{name}" } @ct_searchable_custom_variables; @@ -1331,6 +1331,12 @@ sub ar_transactions { if ($form->{shiptocountry}) { push @options, $locale->text('Country (Shipping)') . " : $form->{shiptocountry}"; } + if ($form->{fulltext}) { + push @options, $locale->text('Full Text') . " : $form->{fulltext}"; + } + if ($form->{parts_serialnumber}) { + push @options, $locale->text('Serial Number') . " : $form->{parts_serialnumber}"; + } $form->{ALL_PRINTERS} = SL::DB::Manager::Printer->get_all_sorted; diff --git a/templates/design40_webpages/ap/search.html b/templates/design40_webpages/ap/search.html index afd1e0be2c..fd3cde5992 100644 --- a/templates/design40_webpages/ap/search.html +++ b/templates/design40_webpages/ap/search.html @@ -83,6 +83,10 @@

[% title %]

[% 'Part Number' | $T8 %] [% L.input_tag("parts_partnumber", "", class="wi-normal") %] + + [% 'Serial Number' | $T8 %] + [% L.input_tag("parts_serialnumber", "") %] + [% 'Project Number' | $T8 %] [% P.project.picker("project_id", project_id, active="both", valid="both", class="wi-normal") %] diff --git a/templates/design40_webpages/ar/search.html b/templates/design40_webpages/ar/search.html index ca6d247c21..5977bcc594 100644 --- a/templates/design40_webpages/ar/search.html +++ b/templates/design40_webpages/ar/search.html @@ -39,6 +39,10 @@

[% title %]

[% 'Miscellaneous' | $T8 %] + + [% 'Full Text' | $T8 %] + [% L.input_tag('fulltext', '') %] + [% 'Transaction description' | $T8 %] [% L.input_tag("transaction_description", "") %] @@ -59,6 +63,10 @@

[% title %]

[% 'Part Number' | $T8 %] [% L.input_tag("parts_partnumber", "") %] + + [% 'Serial Number' | $T8 %] + [% L.input_tag("parts_serialnumber", "") %] + diff --git a/templates/webpages/ap/search.html b/templates/webpages/ap/search.html index 080b726f16..c090a094d9 100644 --- a/templates/webpages/ap/search.html +++ b/templates/webpages/ap/search.html @@ -56,6 +56,8 @@

[% title %]

[% 'Full Text' | $T8 %] [% L.input_tag('fulltext', '', style=style) %] + [% 'Serial Number' | $T8 %] + [% L.input_tag("parts_serialnumber", "", style=style) %] [% 'Project Number' | $T8 %] diff --git a/templates/webpages/ar/search.html b/templates/webpages/ar/search.html index 007e17d2f1..5f0cbf3bb4 100644 --- a/templates/webpages/ar/search.html +++ b/templates/webpages/ar/search.html @@ -59,6 +59,12 @@

[% title %]

[% 'Part Number' | $T8 %] [% L.input_tag("parts_partnumber", "", style=style) %] + + [% 'Full Text' | $T8 %] + [% L.input_tag('fulltext', '', style=style) %] + [% 'Serial Number' | $T8 %] + [% L.input_tag("parts_serialnumber", "", style=style) %] + [% 'Shipping Point' | $T8 %] [% L.input_tag("shippingpoint", "", style=style) %]