- <td align="right">[% LxERP.format_amount(invoice.invoice_amount, -2) %]</td>
- <td align="right">[% LxERP.format_amount(invoice.open_amount, -2) %]</td>
- <td><input name="bank_transfers[].reference" value="[% HTML.escape(invoice.invnumber) %]"></td>
+ <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>
+ [% 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 %]
+ [% ELSE %]
+ [%- SET reference = invoice.reference_prefix _ invoice.invnumber %]
+ [% END %]
+ <input name="bank_transfers[].reference" value="[% HTML.escape(reference.substr(0, 140)) %]" maxlength="140" size="30">
+ </td>