my %filter = map +( $_ => $form->{"f_${_}"} ),
grep { $form->{"f_${_}"} }
my %filter = map +( $_ => $form->{"f_${_}"} ),
grep { $form->{"f_${_}"} }
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});
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});
'closed' => { 'text' => $locale->text('Closed'), },
num_invoices => { 'text' => $locale->text('Number of invoices'), },
sum_amounts => { 'text' => $locale->text('Sum of all amounts'), },
'closed' => { 'text' => $locale->text('Closed'), },
num_invoices => { 'text' => $locale->text('Number of invoices'), },
sum_amounts => { 'text' => $locale->text('Sum of all amounts'), },
my %column_alignment = map { ($_ => 'right') } qw(num_invoices sum_amounts);
foreach my $name (qw(id export_date employee executed closed)) {
my %column_alignment = map { ($_ => 'right') } qw(num_invoices sum_amounts);
foreach my $name (qw(id export_date employee executed closed)) {
my @options = ();
push @options, ($vc eq 'customer' ? $::locale->text('Customer') : $locale->text('Vendor')) . ' : ' . $form->{f_vc} if ($form->{f_vc});
push @options, $locale->text('Invoice number') . ' : ' . $form->{f_invnumber} if ($form->{f_invnumber});
my @options = ();
push @options, ($vc eq 'customer' ? $::locale->text('Customer') : $locale->text('Vendor')) . ' : ' . $form->{f_vc} if ($form->{f_vc});
push @options, $locale->text('Invoice number') . ' : ' . $form->{f_invnumber} if ($form->{f_invnumber});
push @options, $locale->text('Export date from') . ' : ' . $form->{f_export_date_from} if ($form->{f_export_date_from});
push @options, $locale->text('Export date to') . ' : ' . $form->{f_export_date_to} if ($form->{f_export_date_to});
push @options, $locale->text('Requested execution date from') . ' : ' . $form->{f_requested_execution_date_from} if ($form->{f_requested_execution_date_from});
push @options, $locale->text('Export date from') . ' : ' . $form->{f_export_date_from} if ($form->{f_export_date_from});
push @options, $locale->text('Export date to') . ' : ' . $form->{f_export_date_to} if ($form->{f_export_date_to});
push @options, $locale->text('Requested execution date from') . ' : ' . $form->{f_requested_execution_date_from} if ($form->{f_requested_execution_date_from});
+ # Store the message ID used in each of the entries in order to
+ # facilitate finding them by looking at bank statements.
+ foreach my $id (@ids) {
+ SL::DB::SepaExportMessageId->new(
+ sepa_export_id => $id,
+ message_id => $message_id,
+ )->save;
+ }
+
my $xml = $sepa_xml->to_xml();
print $cgi->header('-type' => 'application/octet-stream',
my $xml = $sepa_xml->to_xml();
print $cgi->header('-type' => 'application/octet-stream',