SL::Dev::Payment - check if bank account exists
authorG. Richardson <grichardson@kivitec.de>
Tue, 19 Feb 2019 13:28:54 +0000 (14:28 +0100)
committerG. Richardson <grichardson@kivitec.de>
Sat, 10 Aug 2019 14:42:01 +0000 (16:42 +0200)
SL/Dev/Payment.pm

index 0fdb3a4..a093ed4 100644 (file)
@@ -82,6 +82,7 @@ sub create_bank_transaction {
    $bank_chart = SL::DB::Manager::Chart->find_by(description => 'Bank') or die "Can't find bank chart";
  }
  my $bank_account = SL::DB::Manager::BankAccount->find_by( chart_id => $bank_chart->id );
+ die "bank account missing" unless $bank_account;
 
  my $bt = SL::DB::BankTransaction->new(
    local_bank_account_id => $bank_account->id,