+sub _sepa_export_list {
+ my ($self, $list, %params) = @_;
+
+ my ($source, $destination) = $params{type} eq 'sepa_transfer' ? qw(our vc) : qw(vc our);
+ $params{title} = $params{type} eq 'sepa_transfer' ? $::locale->text('Bank transfers via SEPA') : $::locale->text('Bank collections via SEPA');
+ $params{with_columns} = [ grep { $_ ne 'record_link_direction' } @{ $params{with_columns} || [] } ];
+
+ delete $params{edit_record_links};
+
+ return $self->record_list(
+ $list,
+ columns => [
+ [ $::locale->text('Export Number'), 'sepa_export', ],
+ [ $::locale->text('Execution date'), 'execution_date' ],
+ [ $::locale->text('Export date'), sub { $_[0]->sepa_export->itime->to_kivitendo } ],
+ [ $::locale->text('Source BIC'), "${source}_bic" ],
+ [ $::locale->text('Source IBAN'), "${source}_iban" ],
+ [ $::locale->text('Destination BIC'), "${destination}_bic" ],
+ [ $::locale->text('Destination IBAN'), "${destination}_iban" ],
+ [ $::locale->text('Amount'), 'amount' ],
+ ],
+ %params,
+ );
+}
+
+sub _sepa_transfer_list {
+ my ($self, $list, %params) = @_;
+ _sepa_export_list($self, $list, %params, type => 'sepa_transfer');
+}
+
+sub _sepa_collection_list {
+ my ($self, $list, %params) = @_;
+ _sepa_export_list($self, $list, %params, type => 'sepa_collection');
+}
+