X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/3b18f3f0247c7e28eea11a8696823bb4f301a9bc..0f214df54e:/SL/Controller/BankTransaction.pm diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index 5821d3eb8..a9a944087 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -436,6 +436,17 @@ sub action_save_invoices { ); SL::DB::RecordLink->new(@props)->save; + + # "close" a sepa_export_item if it exists + # currently only works, if there is only exactly one open sepa_export_item + if ( my $seis = $invoice->find_sepa_export_items({ executed => 0 }) ) { + if ( scalar @$seis == 1 ) { + # moved the execution and the check for sepa_export into a method, + # this isn't part of a transaction, though + $seis->[0]->set_executed if $invoice->id == $seis->[0]->arap_id; + }; + }; + } $bank_transaction->save; }