Revision 991369b1
Von Bernd Bleßmann vor mehr als 2 Jahren hinzugefügt
SL/OE.pm | ||
---|---|---|
318 | 318 |
push(@values, like($form->{phone_notes}), like($form->{phone_notes})); |
319 | 319 |
} |
320 | 320 |
|
321 |
$form->{fulltext} = trim($form->{fulltext}); |
|
322 |
if ($form->{fulltext}) { |
|
323 |
my @fulltext_fields = qw(o.notes |
|
324 |
o.intnotes |
|
325 |
o.shippingpoint |
|
326 |
o.shipvia |
|
327 |
o.transaction_description |
|
328 |
o.quonumber |
|
329 |
o.ordnumber |
|
330 |
o.cusordnumber); |
|
331 |
$query .= ' AND ('; |
|
332 |
$query .= join ' ILIKE ? OR ', @fulltext_fields; |
|
333 |
$query .= ' ILIKE ?'; |
|
334 |
$query .= qq| OR EXISTS (SELECT files.id FROM files LEFT JOIN file_full_texts ON (file_full_texts.file_id = files.id) WHERE files.object_id = o.id AND files.object_type = 'sales_order' AND file_full_texts.full_text ILIKE ?)|; |
|
335 |
$query .= qq| OR EXISTS (SELECT notes.id FROM notes WHERE notes.trans_id = o.id AND notes.trans_module LIKE 'oe' AND (notes.subject ILIKE ? OR notes.body ILIKE ?))|; |
|
336 |
$query .= ')'; |
|
337 |
push(@values, like($form->{fulltext})) for 1 .. (scalar @fulltext_fields) + 3; |
|
338 |
} |
|
339 |
|
|
321 | 340 |
if ($form->{parts_partnumber}) { |
322 | 341 |
$query .= <<SQL; |
323 | 342 |
AND EXISTS ( |
Auch abrufbar als: Unified diff
Volltext-Suche im Auftragsbericht