From 478da8b95cd71a275f1f77371e8ff18f06dc0cda Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Thu, 20 Feb 2014 16:56:01 +0100 Subject: [PATCH] Selftest - kaputten Test aus Commit ea8e8a62 repariert MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Die Prüfung auf verwaiste invoice-Einträge war fehlerhaft. Weitherhin wurde die Prüfung auf die gesamt Datenbank ausgeweitet. --- SL/BackgroundJob/SelfTest/Transactions.pm | 24 +++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) 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 { -- 2.20.1