X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/2d15e56a83d0f8607240839e0563e37997815052..aaa8864737fdd4c1ca6d27b423256d62b7a4b2ec:/SL/Controller/BankTransaction.pm diff --git a/SL/Controller/BankTransaction.pm b/SL/Controller/BankTransaction.pm index fcea62217..c220f3c1c 100644 --- a/SL/Controller/BankTransaction.pm +++ b/SL/Controller/BankTransaction.pm @@ -505,17 +505,22 @@ sub save_invoices { $count += scalar( @{$invoice_ids} ); } } + my $max_count = $count; foreach (@{ $self->problems }) { $count-- if $_->{result} eq 'error'; } - return $count; + return ($count, $max_count); } sub action_save_invoices { my ($self) = @_; - my $count = $self->save_invoices(); + my ($success_count, $max_count) = $self->save_invoices(); - flash('ok', t8('#1 invoice(s) saved.', $count)); + if ($success_count == $max_count) { + flash('ok', t8('#1 invoice(s) saved.', $success_count)); + } else { + flash('error', t8('At least #1 invoice(s) not saved', $max_count - $success_count)); + } $self->action_list(); }