From 7b7549e7e807d691798b3424266e37192f3cf436 Mon Sep 17 00:00:00 2001 From: Niclas Zimmermann Date: Fri, 3 May 2013 16:53:59 +0200 Subject: [PATCH] =?utf8?q?Test=20auf=20Steuerschl=C3=BCssel?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Der SelfTest wird in diesem Commit so erweitert, dass überprüft wird, ob jedes Konto einen gültigen Steuerschlüssel hat. --- SL/BackgroundJob/SelfTest/Transactions.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index a7fe76364..e6c1bf3df 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -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,19 @@ 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 1 FROM chart WHERE id NOT IN (select chart_id from taxkeys) LIMIT 1|; + my ($account_without_chart) = selectfirst_array_query($::form, $self->dbh, $query); + + if ($account_without_chart){ + $self->tester->ok(0, "Es sollte keine Konten ohne Steuerschlüssel geben!"); + } else { + $self->tester->ok(1, "Jedes Konto hat einen gültigen Steuerschlüssel!"); + } +} + 1; __END__ -- 2.20.1