commit cc5bb6402ff4a8d4fc849c8f3f90450507a2e588
Author: Frank Messerschmidt <frank.messerschmidt@opendynamic.de>
Date:   Wed Feb 17 15:24:45 2016 +0100

    SEPA-Überweisungen / Bankeinzüge : GUI-Verbesserung #1
    
    - Neusortierung umbenennen der Spalten:
      Fälligkeitsdatum, Lieferant, Rechnung, Rechnungsbetrag, offener Betrag, Rechnungsdatum, Zahlungsbedingungen, Skonto Information, Zahlungsart Überweisungsbetrag, Verwendungszweck
    - Umbenennung der Spalten (zusätzlich mit Zeilenumbruch zur reduzierung der Spaltenbreite)
      - Rechnungs-<br>betrag: vorher Betrag
      - Rechnungs-<br>datum : vorher Rechnungsdatum
      - Fälligkeits-<br>datum: vorher Fälligkeitsdatum
      - Überweisungs-<br>betrag: vorher Überweisungsbetrag
    - Deaktivierung der automatischen Auswahl der Checkboxen beim Laden der Rechnungen
    
    implementiert TICKET #4263

diff --git a/bin/mozilla/sepa.pl b/bin/mozilla/sepa.pl
index 79424eeeb..601fa7fd8 100755
--- a/bin/mozilla/sepa.pl
+++ b/bin/mozilla/sepa.pl
@@ -49,7 +49,7 @@ sub bank_transfer_add {
   # has been selected. For purchase invoices it's the other way
   # around: if direct debit is active then the vendor will collect
   # from us automatically and we don't have to send money manually.
-  $_->{checked} = ($vc eq 'customer' ? $_->{direct_debit} : !$_->{direct_debit}) for @{ $invoices };
+  #$_->{checked} = ($vc eq 'customer' ? $_->{direct_debit} : !$_->{direct_debit}) for @{ $invoices };
 
   my $translation_list = GenericTranslations->list(translation_type => 'sepa_remittance_info_pfx');
   my %translations     = map { ( ($_->{language_id} || 'default') => $_->{translation} ) } @{ $translation_list };
diff --git a/locale/de/all b/locale/de/all
index 26dffc7ff..3b32782fe 100644
--- a/locale/de/all
+++ b/locale/de/all
@@ -390,6 +390,7 @@ $self->{texts} = {
   'Bank transfer amount'        => 'Überweisungssumme',
   'Bank transfer payment list for export #1' => 'Überweisungszahlungsliste für SEPA-Export #1',
   'Bank transfer via SEPA'      => 'Überweisung via SEPA',
+  'Bank transfer<br>amount'     => 'Überweisungs-<br>betrag',
   'Bank transfers via SEPA'     => 'Überweisungen via SEPA',
   'Base unit'                   => 'Basiseinheit',
   'Basic Data'                  => 'Basisdaten',
@@ -1023,6 +1024,7 @@ $self->{texts} = {
   'Drawing'                     => 'Zeichnung',
   'Due'                         => 'Fällig',
   'Due Date'                    => 'Fälligkeitsdatum',
+  'Due<br>Date'                 => 'Fälligkeits-<br>datum',
   'Due Date missing!'           => 'Fälligkeitsdatum fehlt!',
   'Due to security concerns these files have to be deleted or moved after the migration before you can continue using kivitendo.' => 'Aus Sicherheitsgründen müssen diese Dateien nach erfolgter Migration gelöscht oder verschoben werden, bevor kivitendo weiter genutzt werden kann.',
   'Duedate +Days'               => 'Fälligkeitsdatum +Tage',
@@ -1579,6 +1581,8 @@ $self->{texts} = {
   'Invoice total'               => 'Die Rechnungssumme',
   'Invoice total less discount' => 'Rechnungssumme abzüglich Skonto',
   'Invoice with Storno (abbreviation)' => 'R(S)',
+  'Invoice<br>Amount'           => 'Rechnungs-<br>betrag',
+  'Invoice<br>Date'             => 'Rechnungs-<br>datum',
   'Invoices'                    => 'Rechnungen',
   'Invoices, Credit Notes & AR Transactions' => 'Rechnungen, Gutschriften & Debitorenbuchungen',
   'Is Searchable'               => 'Durchsuchbar',
diff --git a/templates/webpages/sepa/bank_transfer_add.html b/templates/webpages/sepa/bank_transfer_add.html
index f2b54338a..811aaace0 100644
--- a/templates/webpages/sepa/bank_transfer_add.html
+++ b/templates/webpages/sepa/bank_transfer_add.html
@@ -33,17 +33,17 @@
    <table border="0">
     <tr>
      <th class="listheading" align="center"><input type="checkbox" id="select_all"></th>
+     <th class="listheading" align="right">[% 'Due<br>Date' | $T8 %]</th>
      <th class="listheading">[% IF is_vendor %][% 'Vendor' | $T8 %][%- ELSE %][%- LxERP.t8('Customer') %][%- END %]</th>
      <th class="listheading">[% 'Invoice' | $T8 %]</th>
-     <th class="listheading" align="right">[% 'Amount' | $T8 %]</th>
+     <th class="listheading" align="right">[% 'Invoice<br>Amount' | $T8 %]</th>
      <th class="listheading" align="right">[% 'Open amount' | $T8 %]</th>
-     <th class="listheading" align="right">[% 'Invoice Date' | $T8 %]</th>
-     <th class="listheading" align="right">[% 'Due Date' | $T8 %]</th>
+     <th class="listheading" align="right">[% 'Invoice<br>Date' | $T8 %]</th>
      <th class="listheading">[% 'Payment Terms' | $T8 %]</th>
-     <th class="listheading">[% 'Purpose' | $T8 %]</th>
-     <th class="listheading" align="right">[% 'Bank transfer amount' | $T8 %]</th>
-     <th class="listheading" align="right">[% 'Payment type' | $T8 %]</th>
      <th class="listheading" align="right">[% 'Skonto information' | $T8 %]</th>
+     <th class="listheading" align="right">[% 'Payment type' | $T8 %]</th>
+     <th class="listheading" align="right">[% 'Bank transfer<br>amount' | $T8 %]</th>
+     <th class="listheading">[% 'Purpose' | $T8 %]</th>
     </tr>
 
     [%- FOREACH invoice = INVOICES %]
@@ -59,6 +59,7 @@
         <input type="checkbox" name="bank_transfers[].selected" value="1"[% IF invoice.checked %] checked[% END %]>
        [%- END %]
       </td>
+      <td align="right">[% invoice.duedate %]</td>
       <td>
        [%- IF loop.first || (previous_vcname != invoice.vcname) %]
         <a href="controller.pl?action=CustomerVendor/edit&db=[% vc %]&id=[% HTML.url(invoice.vc_id) %]&callback=[% HTML.url('sepa.pl?action=bank_transfer_add&vc=' _ vc) %]">
@@ -84,8 +85,8 @@
       <td align="right">[% LxERP.format_amount(invoice.invoice_amount-invoice.open_sepa_transfer_amount, 2) %]</td>
       <td align="right">[% LxERP.format_amount(invoice.open_amount-invoice.open_sepa_transfer_amount, 2) %]</td>
       <td align="right">[% invoice.transdate %]</td>
-      <td align="right">[% invoice.duedate %]</td>
       <td align="left">[% HTML.escape(invoice.pt_description) %]</td>
+      <td align="left" [%- IF invoice.within_skonto_period %]style="background-color: LightGreen"[%- END %]>[%- IF invoice.skonto_amount %] [% LxERP.format_amount(invoice.percent_skonto, 2) %] % = [% LxERP.format_amount(invoice.skonto_amount, 2) %] € bis [% invoice.skonto_date %] [%- END %]</td>
       <td>
     [% IF INSTANCE_CONF.get_sepa_reference_add_vc_vc_id %]
        [%- SET reference = invoice.reference_prefix _ invoice.invnumber _ invoice.reference_prefix_vc _ invoice.vc_vc_id %]
@@ -93,14 +94,15 @@
        [%- SET reference = invoice.reference_prefix _ invoice.invnumber %]
     [% END %]
        <input name="bank_transfers[].reference" value="[% HTML.escape(reference.substr(0, 140)) %]" maxlength="140" size="60">
+      [% L.select_tag('bank_transfers[].payment_type', invoice.payment_select_options, value_key => 'payment_type', title_key => 'display', id => 'payment_type_' _ loop.count, class => 'type_target' ) %]
       </td>
       <td align="right">
-       <input id=[% loop.count %] name="bank_transfers[].amount" id="amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.invoice_amount_suggestion, 2) %]" style="text-align: right" size="12">
+        <input id=[% loop.count %] name="bank_transfers[].amount" id="amount_[% loop.count %]" value="[% LxERP.format_amount(invoice.invoice_amount_suggestion, 2) %]" style="text-align: right" size="12">
       </td>
       <td>
-      [% L.select_tag('bank_transfers[].payment_type', invoice.payment_select_options, value_key => 'payment_type', title_key => 'display', id => 'payment_type_' _ loop.count, class => 'type_target' ) %]
+      [%- SET reference = invoice.reference_prefix _ invoice.invnumber _ invoice.substitution _ invoice.vc_prefix _ invoice.vc_number %]
+      <input name="bank_transfers[].reference" value="[% HTML.escape(reference.substr(0, 140)) %]" maxlength="140" size="60">
       </td>
-      <td align="left" [%- IF invoice.within_skonto_period %]style="background-color: LightGreen"[%- END %]>[%- IF invoice.skonto_amount %] [% LxERP.format_amount(invoice.percent_skonto, 2) %] % = [% LxERP.format_amount(invoice.skonto_amount, 2) %] € bis [% invoice.skonto_date %] [%- END %]</td>
      </tr>
     [%- END %]
    </table>
