Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 159ba2d4

Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt

  • ID 159ba2d48f1f698c6f986e2e4691ac47365df40a
  • Vorgänger 63fa4620
  • Nachfolger 3ecc10d2

Volltext-Suche im EK-Rechnungs- und Kreditoren-Bericht

Unterschiede anzeigen:

SL/AP.pm
701 701
    }
702 702
  }
703 703

  
704
  $form->{fulltext} = trim($form->{fulltext});
705
  if ($form->{fulltext}) {
706
    my @fulltext_fields = qw(a.notes
707
                             a.intnotes
708
                             a.shipvia
709
                             a.transaction_description
710
                             a.quonumber
711
                             a.ordnumber
712
                             a.invnumber);
713
    $where .= ' AND (';
714
    $where .= join ' OR ', map {"$_ ILIKE ?"} @fulltext_fields;
715

  
716
    $where .= <<SQL;
717
      OR EXISTS (
718
        SELECT files.id FROM files LEFT JOIN file_full_texts ON (file_full_texts.file_id = files.id)
719
          WHERE files.object_id = a.id AND files.object_type = 'purchase_invoice'
720
            AND file_full_texts.full_text ILIKE ?)
721
SQL
722
    $where .= ')'; # end AND
723

  
724
    push(@values, like($form->{fulltext})) for 1 .. (scalar @fulltext_fields) + 1;
725
  }
726

  
704 727
  if ($form->{parts_partnumber}) {
705 728
    $where .= <<SQL;
706 729
 AND EXISTS (
bin/mozilla/ap.pl
1059 1059
  my @hidden_variables = map { "l_${_}" } @columns;
1060 1060
  push @hidden_variables, "l_subtotal", qw(open closed vendor invnumber ordnumber transaction_description notes project_id
1061 1061
                                           transdatefrom transdateto duedatefrom duedateto datepaidfrom datepaidto
1062
                                           parts_partnumber parts_description department_id taxzone_id payment_id);
1062
                                           parts_partnumber parts_description department_id taxzone_id payment_id
1063
                                           fulltext);
1063 1064

  
1064 1065
  my $href = build_std_url('action=ap_transactions', grep { $form->{$_} } @hidden_variables);
1065 1066

  
......
1127 1128
  push @options, $locale->text('Transaction description') . " : $form->{transaction_description}"        if ($form->{transaction_description});
1128 1129
  push @options, $locale->text('Part Description')        . " : $form->{parts_description}"              if $form->{parts_description};
1129 1130
  push @options, $locale->text('Part Number')             . " : $form->{parts_partnumber}"               if $form->{parts_partnumber};
1131
  push @options, $locale->text('Full Text')               . " : $form->{fulltext}"                       if ($form->{fulltext});
1130 1132
  push @options, $locale->text('From') . " " . $locale->date(\%myconfig, $form->{transdatefrom}, 1)      if ($form->{transdatefrom});
1131 1133
  push @options, $locale->text('Bis')  . " " . $locale->date(\%myconfig, $form->{transdateto},   1)      if ($form->{transdateto});
1132 1134
  push @options, $locale->text('Due Date') . " " . $locale->text('from') . " " . $locale->date(\%myconfig,  $form->{duedatefrom}, 1)      if ($form->{duedatefrom});
templates/design40_webpages/ap/search.html
37 37
    <tr>
38 38
      <th>[% 'Transaction description' | $T8 %]</th>
39 39
      <td>[% L.input_tag("transaction_description", "", class="wi-normal") %]</td>
40
    </tr>
40 41
    <tr>
42
      <th>[% 'Full Text' | $T8 %]</th>
43
      <td>[% L.input_tag('fulltext', '', class="wi-lightwide") %]</td>
44
    </tr>
41 45

  
42 46
  </tbody>
43 47
</table>
templates/webpages/ap/search.html
47 47
      <th align="right">[% 'Part Description' | $T8 %]</th>
48 48
      <td>[% L.input_tag("parts_description", "", style=style) %]</td>
49 49
     </tr>
50
     <tr>
51
      <th align="right">[% 'Full Text' | $T8 %]</th>
52
      <td>[% L.input_tag('fulltext', '', style=style) %]</td>
53
     </tr>
50 54
     <tr>
51 55
      <th align="right">[% 'Project Number' | $T8 %]</th>
52 56
      <td>[% P.project.picker("project_id", project_id, active="both", valid="both", style=style) %]</td>

Auch abrufbar als: Unified diff