Revision b0c61725
Von Bernd Bleßmann vor 10 Monaten hinzugefügt
SL/Controller/TopQuickSearch/GLTransaction.pm | ||
---|---|---|
25 | 25 |
my $limit = $::form->{limit} || 40; # max number of results per type (AR/AP/GL) |
26 | 26 |
my $term = $::form->{term} || ''; |
27 | 27 |
|
28 |
my $descriptionquery = { ilike => like($term) }; |
|
29 |
my $referencequery = { ilike => like($term) }; |
|
30 |
my $apinvnumberquery = { ilike => like($term) }; |
|
31 |
my $namequery = { ilike => like($term) }; |
|
32 |
my $arinvnumberquery = { ilike => '%' . SL::Util::trim($term) };
|
|
28 |
my $descriptionquery = { ilike => like($term) };
|
|
29 |
my $referencequery = { ilike => like($term) };
|
|
30 |
my $apinvnumberquery = { ilike => like($term) };
|
|
31 |
my $namequery = { ilike => like($term) };
|
|
32 |
my $arinvnumber_left_query = { ilike => '%' . SL::Util::trim($term) };
|
|
33 | 33 |
my $arinvnumber_right_query = { ilike => SL::Util::trim($term) . '%' }; |
34 | 34 |
# ar match is more restrictive. Left fuzzy beginning so it also matches "Storno zu $INVNUMBER" |
35 | 35 |
# and numbers like 000123 if you only enter 123. Right beginning searches from the begin. |
... | ... | |
37 | 37 |
my (@glfilter, @arfilter, @apfilter); |
38 | 38 |
|
39 | 39 |
push( @glfilter, (or => [ description => $descriptionquery, reference => $referencequery ] ) ); |
40 |
push( @arfilter, (or => [ invnumber => $arinvnumberquery, invnumber => $arinvnumber_right_query, name => $namequery ] ) );
|
|
40 |
push( @arfilter, (or => [ invnumber => $arinvnumber_left_query, invnumber => $arinvnumber_right_query, name => $namequery ] ) );
|
|
41 | 41 |
push( @apfilter, (or => [ invnumber => $apinvnumberquery, name => $namequery ] ) ); |
42 | 42 |
|
43 | 43 |
my $gls = SL::DB::Manager::GLTransaction->get_all( query => [ @glfilter ], limit => $limit, sort_by => 'transdate DESC'); |
Auch abrufbar als: Unified diff
Kosmetik: Ausrichtung und Variable umbenannt