From: G. Richardson Date: Fri, 8 Feb 2013 09:52:33 +0000 (+0100) Subject: Selftest Prüfung für Bilanzkonten in GuV-Gruppe X-Git-Tag: release-3.1.0beta1~628 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=8fff964f666e8380ab7accd8bb6952a52f4f674e;p=kivitendo-erp.git Selftest Prüfung für Bilanzkonten in GuV-Gruppe Ein Konto sollte nicht gleichzeitig in beiden Berichten auftauchen. --- diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index 84eaa8467..881298d98 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -15,9 +15,10 @@ sub run { $self->_setup; - $self->tester->plan(tests => 14); + $self->tester->plan(tests => 15); $self->check_konten_mit_saldo_nicht_in_guv; + $self->check_bilanzkonten_mit_pos_eur; $self->check_balanced_individual_transactions; $self->check_verwaiste_acc_trans_eintraege; $self->check_netamount_laut_invoice_ar; @@ -70,6 +71,20 @@ sub check_konten_mit_saldo_nicht_in_guv { } } +sub check_bilanzkonten_mit_pos_eur { + my ($self) = @_; + + my $query = qq|SELECT accno, description FROM chart WHERE (category = 'A' OR category = 'L' OR category = 'Q') AND (pos_eur IS NOT NULL OR pos_eur != 0)|; + + my $bilanzkonten_mit_pos_eur = selectall_hashref_query($::form, $self->dbh, $query); + if (@$bilanzkonten_mit_pos_eur) { + $self->tester->ok(0, "Es gibt Bilanzkonten die der GuV/EÜR zugeordnet sind)"); + $self->tester->diag("$_->{accno} $_->{description}") for @$bilanzkonten_mit_pos_eur; + } else { + $self->tester->ok(1, "Keine Bilanzkonten in der GuV"); + } +} + sub check_balanced_individual_transactions { my ($self) = @_;