From 397b133c5083fc9d6c417af9ec9e4d490e6dd109 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Wed, 13 Jul 2016 12:51:20 +0200 Subject: [PATCH] =?utf8?q?Kontoauszug=20verbuchen=20-=20SEPA-Zahlungen=20b?= =?utf8?q?er=C3=BCcksichtigen=20und=20schlie=C3=9Fen=202?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit auch bei Verbuchen per "Vorschlag" die SEPA-Zahlungen schließen. --- SL/Controller/BankTransaction.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index a9a944087..c07b799e6 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -438,6 +438,7 @@ sub action_save_invoices { SL::DB::RecordLink->new(@props)->save; # "close" a sepa_export_item if it exists + # code duplicated in action_save_proposals! # 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 ) { @@ -488,6 +489,17 @@ sub action_save_proposals { ); SL::DB::RecordLink->new(@props)->save; + + # code duplicated in action_save_invoices! + # "close" a sepa_export_item if it exists + # currently only works, if there is only exactly one open sepa_export_item + if ( my $seis = $arap->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 $arap->id == $seis->[0]->arap_id; + }; + }; } flash('ok', t8('#1 proposal(s) saved.', scalar @{ $::form->{proposal_ids} })); -- 2.20.1