From: Moritz Bunkus <m.bunkus@linet-services.de>
Date: Thu, 1 Oct 2015 12:54:07 +0000 (+0200)
Subject: SEPA-Suche: nach Nachrichten-ID suchen können
X-Git-Tag: release-3.4.1~678
X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=cc14c2da6eef443c7affa5aaddae20c9f8cbb1dd;p=kivitendo-erp.git

SEPA-Suche: nach Nachrichten-ID suchen können
---

diff --git a/SL/SEPA.pm b/SL/SEPA.pm
index c62c2ce7d..94579179b 100644
--- a/SL/SEPA.pm
+++ b/SL/SEPA.pm
@@ -326,6 +326,17 @@ sub list_exports {
     $joins_sub{$arap} = 1;
   }
 
+  if ($filter->{message_id}) {
+    push @values, '%' . $filter->{message_id} . '%';
+    push @where,  <<SQL;
+      se.id IN (
+        SELECT sepa_export_id
+        FROM sepa_export_message_ids
+        WHERE message_id ILIKE ?
+      )
+SQL
+  }
+
   if ($filter->{vc}) {
     push @where_sub,  "vc.name ILIKE ?";
     push @values_sub, '%' . $filter->{vc} . '%';
diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl
index a6fa2a470..1b712a503 100755
--- a/bin/mozilla/sepa.pl
+++ b/bin/mozilla/sepa.pl
@@ -209,7 +209,7 @@ sub bank_transfer_list {
 
   my %filter         = map  +( $_ => $form->{"f_${_}"} ),
                        grep  { $form->{"f_${_}"} }
-                             (qw(vc invnumber),
+                             (qw(vc invnumber message_id),
                               map { ("${_}_date_from", "${_}_date_to") }
                                   qw(export requested_execution execution));
   $filter{executed}  = $form->{l_executed} ? 1 : 0 if ($form->{l_executed} != $form->{l_not_executed});
diff --git a/locale/de/all b/locale/de/all
index 787259ce4..c897d962b 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -2254,6 +2254,7 @@ $self->{texts} = {
   'SEPA XML download'           => 'SEPA-XML-Download',
   'SEPA creditor ID'            => 'SEPA-Kreditoren-Identifikation',
   'SEPA exports:'               => 'SEPA-Exporte:',
+  'SEPA message ID'             => 'SEPA-Nachrichten-ID',
   'SEPA message IDs'            => 'SEPA-Nachrichten-IDs',
   'SEPA strings'                => 'SEPA-Überweisungen',
   'Saldo Credit'                => 'Saldo Haben',
diff --git a/templates/webpages/sepa/bank_transfer_search.html b/templates/webpages/sepa/bank_transfer_search.html
index a88d402be..e9fb9f67b 100644
--- a/templates/webpages/sepa/bank_transfer_search.html
+++ b/templates/webpages/sepa/bank_transfer_search.html
@@ -17,6 +17,11 @@
      <td><input name="f_invnumber"></td>
     </tr>
 
+    <tr>
+     <td align="right">[% LxERP.t8("SEPA message ID") %]</td>
+     <td>[% L.input_tag("f_message_id") %]</td>
+    </tr>
+
     <tr>
      <td align="right">[% 'Export date from' | $T8 %]</td>
      <td>