return;
}
+ my $filename;
my $gobd = SL::GoBD->new(
company => $::instance_conf->get_company,
location => $::instance_conf->get_address,
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.'));
+
+ $::lxdebug->dump(0, "GoBD errors:", \@$errors);
+ $self->action_filter;
+ return;
+ };
$self->send_file($filename, name => t8('gobd-#1-#2.zip', $self->from->ymd, $self->to->ymd), unlink => 1);
}
$datev->_get_transactions(from_to => $datev->fromto);
+ if ($datev->errors) {
+ die [ $datev->errors ];
+ }
+
for my $transaction (@{ $datev->{DATEV} }) {
for my $entry (@{ $transaction }) {
$entry->{sortkey} = join '-', map { lc } (DateTime->from_kivitendo($entry->{transdate})->strftime('%Y%m%d'), $entry->{name}, $entry->{reference});
'The execution schedule is invalid.' => 'Der Ausführungszeitplan ist ungültig.',
'The execution type is invalid.' => 'Der Ausführungstyp ist ungültig.',
'The existing record has been created from the link target to add.' => 'Der bestehende Beleg wurde aus dem auszuwählenden Verknüpfungsziel erstellt.',
+ 'The export failed because of malformed transactions. Please fix those before exporting.' => 'Es sind fehlerhafte Buchungen im Exportzeitraum vorhanden. Bitte korrigieren Sie diese vor dem Export.',
'The factor is missing in row %d.' => 'Der Faktor fehlt in Zeile %d.',
'The factor is missing.' => 'Der Faktor fehlt.',
'The file has been sent to the printer.' => 'Die Datei wurde an den Drucker geschickt.',