X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/6061749dc0ece2873ef61a0c14af1b8a9e46034a..ada964d139eb652502bbdec96adf8634e49d8872:/SL/BackgroundJob/SelfTest/Transactions.pm diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index a7fe76364..9b5daed21 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -15,7 +15,7 @@ sub run { $self->_setup; - $self->tester->plan(tests => 15); + $self->tester->plan(tests => 16); $self->check_konten_mit_saldo_nicht_in_guv; $self->check_bilanzkonten_mit_pos_eur; @@ -31,6 +31,7 @@ sub run { $self->check_paid_stornos; $self->check_stornos_ohne_partner; $self->check_overpayments; + $self->check_every_account_with_taxkey; $self->calc_saldenvortraege; } @@ -392,6 +393,23 @@ sub calc_saldenvortraege { $self->tester->diag("Saldo $saldenvortragskonto am 31.12.@{[DateTime->today->year]}: @{[ $saldo_9000_jahresende * 1 ]} (sollte 0 sein)"); } +sub check_every_account_with_taxkey { + my ($self) = @_; + + my $query = qq|SELECT accno, description FROM chart WHERE id NOT IN (select chart_id from taxkeys)|; + my $accounts_without_tk = selectall_hashref_query($::form, $self->dbh, $query); + + if ( scalar @{ $accounts_without_tk } > 0 ){ + $self->tester->ok(0, "Folgende Konten haben keinen gültigen Steuerschlüssel:"); + + for my $account_without_tk (@{ $accounts_without_tk } ) { + $self->tester->diag("Kontonummer: $account_without_tk->{accno} Beschreibung: $account_without_tk->{description}"); + } + } else { + $self->tester->ok(1, "Jedes Konto hat einen gültigen Steuerschlüssel!"); + } +} + 1; __END__