X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FTopQuickSearch%2FGLTransaction.pm;h=8eead24de39cdd10848e3bee14fb7865a31034cd;hb=34035b33f21af21316df798b19f2a758aa86b3a8;hp=2b4facdec7b538502b169afd2af958d7051dc350;hpb=6c63020409f486043d63c3a324db96a4a162ff67;p=kivitendo-erp.git diff --git a/SL/Controller/TopQuickSearch/GLTransaction.pm b/SL/Controller/TopQuickSearch/GLTransaction.pm index 2b4facdec..8eead24de 100644 --- a/SL/Controller/TopQuickSearch/GLTransaction.pm +++ b/SL/Controller/TopQuickSearch/GLTransaction.pm @@ -8,11 +8,12 @@ use SL::DB::Invoice; use SL::DB::PurchaseInvoice; use SL::DB::AccTransaction; use SL::Locale::String qw(t8); +use SL::DBUtils qw(like); use List::Util qw(sum); sub auth { 'general_ledger' } -sub name { 'gl_transction' } +sub name { 'gl_transaction' } sub description_config { t8('GL search') } @@ -24,11 +25,11 @@ sub query_autocomplete { my $limit = $::form->{limit} || 40; # max number of results per type (AR/AP/GL) my $term = $::form->{term} || ''; - my $descriptionquery = { ilike => '%' . $term . '%' }; - my $referencequery = { ilike => '%' . $term . '%' }; - my $apinvnumberquery = { ilike => '%' . $term . '%' }; - my $namequery = { ilike => '%' . $term . '%' }; - my $arinvnumberquery = { ilike => '%' . $term }; + my $descriptionquery = { ilike => like($term) }; + my $referencequery = { ilike => like($term) }; + my $apinvnumberquery = { ilike => like($term) }; + my $namequery = { ilike => like($term) }; + my $arinvnumberquery = { ilike => '%' . SL::Util::trim($term) }; # ar match is more restrictive. Left fuzzy beginning so it also matches "Storno zu $INVNUMBER" # and numbers like 000123 if you only enter 123. # When used in quicksearch short numbers like 1 or 11 won't match because of the