From: G. Richardson Date: Thu, 20 Feb 2014 15:56:01 +0000 (+0100) Subject: Selftest - kaputten Test aus Commit ea8e8a62 repariert X-Git-Tag: release-3.1.0rc1~8 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=478da8b95cd71a275f1f77371e8ff18f06dc0cda;p=kivitendo-erp.git Selftest - kaputten Test aus Commit ea8e8a62 repariert Die Prüfung auf verwaiste invoice-Einträge war fehlerhaft. Weitherhin wurde die Prüfung auf die gesamt Datenbank ausgeweitet. --- diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index 939c79571..f4f13d01a 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -130,20 +130,20 @@ sub check_verwaiste_acc_trans_eintraege { } sub check_verwaiste_invoice_eintraege { - # taxincluded is null sollte nie passieren: - # select sum(sellprice*qty) from invoice i where trans_id in (select id from ar where taxincluded is null); + # this check is always run for all invoice entries in the entire database my ($self) = @_; my $query = qq| - select * from invoice - where trans_id not in (select id from ar union select id from ap order by id) - and a.transdate >= ? and a.transdate <= ? ;|; - - my $verwaiste_invoice = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); - if (@$verwaiste_invoice) { - $self->tester->ok(0, "Es gibt verwaiste invoice Einträge! (wo ar/ap-Eintrag fehlt)"); - $self->tester->diag($_) for @$verwaiste_acs; - } else { - $self->tester->ok(1, "Keine verwaisten invoice Einträge (wo ar/ap-Eintrag fehlt)"); } + select * from invoice i + where trans_id not in (select id from ar union select id from ap order by id) |; + + my $verwaiste_invoice = selectall_hashref_query($::form, $self->dbh, $query); + if (@$verwaiste_invoice) { + $self->tester->ok(0, "Es gibt verwaiste invoice Einträge! (wo ar/ap-Eintrag fehlt)"); + for my $invoice ( @{ $verwaiste_invoice }) { + $self->tester->diag("invoice: id: $invoice->{id} trans_id: $invoice->{trans_id} description: $invoice->{description} itime: $invoice->{itime}"); + }; + } else { + $self->tester->ok(1, "Keine verwaisten invoice Einträge (wo ar/ap-Eintrag fehlt)"); } } sub check_netamount_laut_invoice_ar {