From 4bc122b8ac1abe52aa37f0bebf56f7af799ba966 Mon Sep 17 00:00:00 2001 From: Werner Hahn Date: Fri, 8 Nov 2024 13:51:57 +0100 Subject: [PATCH] Volltextsuche auch bei Verkaufsrechnungen und Deb. Buchungen --- SL/AR.pm | 23 ++++++++++++++++++++++ bin/mozilla/ar.pl | 5 ++++- templates/design40_webpages/ar/search.html | 4 ++++ templates/webpages/ar/search.html | 4 ++++ 4 files changed, 35 insertions(+), 1 deletion(-) diff --git a/SL/AR.pm b/SL/AR.pm index 6bf390fc48..36390bee18 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 .= <{name}" } @ct_searchable_custom_variables; @@ -1331,6 +1331,9 @@ 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}"; + } $form->{ALL_PRINTERS} = SL::DB::Manager::Printer->get_all_sorted; diff --git a/templates/design40_webpages/ar/search.html b/templates/design40_webpages/ar/search.html index ca6d247c21..abd5678fb1 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", "") %] diff --git a/templates/webpages/ar/search.html b/templates/webpages/ar/search.html index 007e17d2f1..2cdf7e3da9 100644 --- a/templates/webpages/ar/search.html +++ b/templates/webpages/ar/search.html @@ -59,6 +59,10 @@

[% title %]

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