X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FController%2FGoBD.pm;h=7f80faf3d2539032be18b431e20f4a086a5d65e9;hb=0bfbcce6e77e0f9d83e4f54f3fe9da7edcc866f3;hp=463c6d743dc84885755c6720bbf0946630a9c59b;hpb=e2b0403982edf5a329b4dfc9d2b169eac91c3dd8;p=kivitendo-erp.git diff --git a/SL/Controller/GoBD.pm b/SL/Controller/GoBD.pm index 463c6d743..7f80faf3d 100644 --- a/SL/Controller/GoBD.pm +++ b/SL/Controller/GoBD.pm @@ -35,6 +35,7 @@ sub action_export { return; } + my $filename; my $gobd = SL::GoBD->new( company => $::instance_conf->get_company, location => $::instance_conf->get_address, @@ -42,7 +43,16 @@ sub action_export { to => $self->to, ); - my $filename = $gobd->generate_export; + eval { + $filename = $gobd->generate_export; + } or do { + my $errors = $@; + flash('error', t8('The export failed because of malformed transactions. Please fix those before exporting.')); + flash('error', $_) for @$errors; + + $self->action_filter; + return; + }; $self->send_file($filename, name => t8('gobd-#1-#2.zip', $self->from->ymd, $self->to->ymd), unlink => 1); }