From: Jan Büren Date: Sun, 8 Jan 2017 16:03:22 +0000 (+0100) Subject: SelfTests check_summe_stornobuchungen optimiert X-Git-Tag: release-3.5.4~1762 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=56e0744e2835cffe496531708ecfdaabc5b3bfee;p=kivitendo-erp.git SelfTests check_summe_stornobuchungen optimiert Die Summenprüfung der Stornobuchungen muss auch über den Jahreswechsel hinaus Buchungen berücksichtigen. --- diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index d75a9a991..f0d6da9c1 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -206,14 +206,12 @@ sub check_summe_stornobuchungen { my $query = qq| select sum(amount) from ar a JOIN customer c ON (a.customer_id = c.id) - WHERE storno is true - AND a.transdate >= ? and a.transdate <= ?|; + WHERE a.id in (SELECT id from ap where storno is true AND a.transdate >= ? and a.transdate <= ?)|; my ($summe_stornobuchungen_ar) = selectfirst_array_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); $query = qq| select sum(amount) from ap a JOIN vendor c ON (a.vendor_id = c.id) - WHERE storno is true - AND a.transdate >= ? and a.transdate <= ?|; + WHERE a.id in (SELECT id from ap where storno is true AND a.transdate >= ? and a.transdate <= ?)|; my ($summe_stornobuchungen_ap) = selectfirst_array_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); $self->tester->ok($summe_stornobuchungen_ap == 0, 'Summe aller Einkaufsrechnungen (stornos + stornierte) soll 0 sein');