# # if there is exactly one non-executed sepa_export_item for the invoice
if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) {
# # if there is exactly one non-executed sepa_export_item for the invoice
if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) {
my $sei = $seis->[0];
# test for amount and id matching only, sepa transfer date and bank
# transaction date needn't match
my $arap = $invoice->is_sales ? 'ar' : 'ap';
my $sei = $seis->[0];
# test for amount and id matching only, sepa transfer date and bank
# transaction date needn't match
my $arap = $invoice->is_sales ? 'ar' : 'ap';
} else {
# zero or more than one sepa_export_item, do nothing for this invoice
# zero: do nothing, no sepa_export_item exists, no match
# more than one: does this ever apply? Currently you can't create sepa
# exports for invoices that already have a non-executed sepa_export
} else {
# zero or more than one sepa_export_item, do nothing for this invoice
# zero: do nothing, no sepa_export_item exists, no match
# more than one: does this ever apply? Currently you can't create sepa
# exports for invoices that already have a non-executed sepa_export