commit e64015cef8aff1dc5a1a433738472ff0d971ccd6
Author: Bernd Bleßmann <bernd@kivitendo-premium.de>
Date:   Mon Aug 30 14:44:26 2021 +0200

    Wiedervorlagen für Belege: Nicht-erledigte und erledigte WV in je einer Tabelle

diff --git a/bin/mozilla/fu.pl b/bin/mozilla/fu.pl
index d9001e35c..b987d1fd7 100644
--- a/bin/mozilla/fu.pl
+++ b/bin/mozilla/fu.pl
@@ -100,7 +100,10 @@ sub display_form {
   my %params;
   $params{not_id}     = $form->{id} if ($form->{id});
   $params{trans_id}   = $form->{LINKS}->[0]->{trans_id} if (@{ $form->{LINKS} });
-  $form->{FOLLOW_UPS} = FU->follow_ups(%params);
+
+  $form->{sort}               = 'follow_up_date';
+  $form->{FOLLOW_UPS_DONE}    = FU->follow_ups(%params,     done => 1);
+  $form->{FOLLOW_UPS_PENDING} = FU->follow_ups(%params, not_done => 1);
 
   setup_fu_display_form_action_bar() unless $::form->{POPUP_MODE};
 
diff --git a/locale/de/all b/locale/de/all
index a7f3d6489..25c15a7a0 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -1462,6 +1462,7 @@ $self->{texts} = {
   'Existing contacts (with column \'cp_id\')' => 'Existierende Ansprechpersonen (mit Spalte \'cp_id\')',
   'Existing customers/vendors with same customer/vendor number' => 'Existierende Kunden/Lieferanten mit derselben Kunden-/Lieferantennummer',
   'Existing file on server'     => 'Auf dem Server existierende Datei',
+  'Existing finished follow-ups for this item' => 'Erledigte Wiedervorlagen für dieses Dokument',
   'Existing pending follow-ups for this item' => 'Noch nicht erledigte Wiedervorlagen für dieses Dokument',
   'Existing profiles'           => 'Existierende Profile',
   'Existing templates'          => 'Vorhandene Belegvorlagen',
diff --git a/locale/en/all b/locale/en/all
index 43bfd54fe..795498de5 100644
--- a/locale/en/all
+++ b/locale/en/all
@@ -1462,6 +1462,7 @@ $self->{texts} = {
   'Existing contacts (with column \'cp_id\')' => '',
   'Existing customers/vendors with same customer/vendor number' => '',
   'Existing file on server'     => '',
+  'Existing finished follow-ups for this item' => '',
   'Existing pending follow-ups for this item' => '',
   'Existing profiles'           => '',
   'Existing templates'          => '',
diff --git a/templates/webpages/fu/add_edit.html b/templates/webpages/fu/add_edit.html
index 979061dd9..3a6f126db 100644
--- a/templates/webpages/fu/add_edit.html
+++ b/templates/webpages/fu/add_edit.html
@@ -60,7 +60,7 @@
    <input type="submit" class="submit" onclick="window.close()" value="[% 'Cancel' | $T8 %]">
   </p>
 
-  [%- IF FOLLOW_UPS.size %]
+  [%- IF FOLLOW_UPS_PENDING.size %]
   <hr height="3" noshade>
 
   <h2>[% 'Existing pending follow-ups for this item' | $T8 %]</h2>
@@ -73,7 +73,7 @@
      <th class="listheading">[% 'Follow-up for' | $T8 %]</th>
     </tr>
 
-    [%- FOREACH row = FOLLOW_UPS %]
+    [%- FOREACH row = FOLLOW_UPS_PENDING %]
     <tr class="listrow[% loop.count % 2 %]">
      <td valign="top">[% HTML.escape(row.follow_up_date) %]</td>
      <td valign="top"><a href="fu.pl?action=edit&id=[% HTML.escape(row.id) %][% IF POPUP_MODE %]&POPUP_MODE=1[% END %]">[% HTML.escape(row.subject) %]</a></td>
@@ -83,6 +83,31 @@
     [%- END %]
   </table>
   [%- END %]
+
+  [%- IF FOLLOW_UPS_DONE.size %]
+  <hr height="3" noshade>
+
+  <h2>[% 'Existing finished follow-ups for this item' | $T8 %]</h2>
+
+  <table>
+    <tr>
+     <th class="listheading">[% 'Follow-Up Date' | $T8 %]</th>
+     <th class="listheading">[% 'Subject' | $T8 %]</th>
+     <th class="listheading">[% 'Created by' | $T8 %]</th>
+     <th class="listheading">[% 'Follow-up for' | $T8 %]</th>
+    </tr>
+
+    [%- FOREACH row = FOLLOW_UPS_DONE %]
+    <tr class="listrow[% loop.count % 2 %]">
+     <td valign="top">[% HTML.escape(row.follow_up_date) %]</td>
+     <td valign="top"><a href="fu.pl?action=edit&id=[% HTML.escape(row.id) %][% IF POPUP_MODE %]&POPUP_MODE=1[% END %]">[% HTML.escape(row.subject) %]</a></td>
+     <td valign="top">[% HTML.escape(row.created_by_name) %]</td>
+     <td valign="top">[% HTML.escape(row.created_for_user_name) %]</td>
+    </tr>
+    [%- END %]
+  </table>
+  [%- END %]
+
  [%- END %]
 
   [%- FOREACH row = LINKS %]
