From 28fc24763b02fab97f8a81a100dd8c16ac42b650 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sven=20Sch=C3=B6ling?= Date: Mon, 26 Sep 2016 15:08:14 +0200 Subject: [PATCH] DATEV: Fehlermeldungen verbessert und lokalisiert --- SL/DATEV.pm | 17 ++++++++--------- locale/de/all | 2 ++ 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/SL/DATEV.pm b/SL/DATEV.pm index 2baba7593..779a599ef 100644 --- a/SL/DATEV.pm +++ b/SL/DATEV.pm @@ -33,6 +33,7 @@ use SL::DBUtils; use SL::DATEV::KNEFile; use SL::DB; use SL::HTML::Util (); +use SL::Locale::String qw(t8); use Data::Dumper; use DateTime; @@ -492,14 +493,11 @@ sub _get_transactions { if ($ref2->{trans_id} != $trans->[0]->{trans_id}) { require SL::DB::Manager::AccTransaction; if ( $trans->[0]->{trans_id} ) { - my $acc_trans_old_obj = SL::DB::Manager::AccTransaction->get_first(where => [ trans_id => $trans->[0]->{trans_id} ]); - $self->add_error("Unbalanced ledger! Old: " . $acc_trans_old_obj->transaction_name) if ref($acc_trans_old_obj); + my $acc_trans_obj = SL::DB::Manager::AccTransaction->get_first(where => [ trans_id => $trans->[0]->{trans_id} ]); + $self->add_error(t8("Export error in transaction #1: Unbalanced ledger before next transaction (#2)", + $acc_trans_obj->transaction_name, $ref2->{trans_id}) + ); }; - if ( $ref2->{trans_id} ) { - my $acc_trans_curr_obj = SL::DB::Manager::AccTransaction->get_first(where => [ trans_id => $ref2->{trans_id} ]); - $self->add_error("Unbalanced ledger! New:" . $acc_trans_curr_obj->transaction_name) if ref($acc_trans_curr_obj); - }; - $self->add_error("count: $count"); return; } @@ -670,8 +668,9 @@ sub _get_transactions { if (abs($absumsatz) >= (0.01 * (1 + scalar @taxed))) { require SL::DB::Manager::AccTransaction; my $acc_trans_obj = SL::DB::Manager::AccTransaction->get_first(where => [ trans_id => $trans->[0]->{trans_id} ]); - $self->add_error("Datev-Export fehlgeschlagen! Bei Transaktion " . $acc_trans_obj->transaction_name . " ($absumsatz)"); - + $self->add_error(t8("Export error in transaction #1: Rounding error too large #2", + $acc_trans_obj->transaction_name, $absumsatz) + ); } elsif (abs($absumsatz) >= 0.01) { $self->add_net_gross_differences($absumsatz); } diff --git a/locale/de/all b/locale/de/all index b4038f0c9..d9ad39728 100755 --- a/locale/de/all +++ b/locale/de/all @@ -1275,6 +1275,8 @@ $self->{texts} = { 'Export date' => 'Exportdatum', 'Export date from' => 'Exportdatum von', 'Export date to' => 'Exportdatum bis', + 'Export error in transaction #1: Rounding error too large #2' => 'Exportfehler in Transaktion #1: Zu großer Rundungsfehler (#2)', + 'Export error in transaction #1: Unbalanced ledger before next transaction (#2)' => 'Exportfehler in Transaktion #1: Unausgeglichene Buchung', 'Extend automatically by n months' => 'Automatische Verlängerung um x Monate', 'Extended' => 'Gesamt', 'Extended status' => 'Erweiterter Status', -- 2.20.1