From 2459db37cc67d46d7011707ac4f25a4a6b8663b9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Mon, 1 Feb 2016 17:01:47 +0100 Subject: [PATCH] =?utf8?q?Self-Tests=20Haupt-=20/=20Nebenbuchpr=C3=BCfung?= =?utf8?q?=20verbessert?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/BackgroundJob/SelfTest/Transactions.pm | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index d6c2829a3..64c4ad987 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -435,8 +435,9 @@ sub check_ar_acc_trans_amount { my ($self) = @_; my $query = qq| - select ar.invnumber, ar.netamount, ac.amount - from ar left join acc_trans ac on (ac.trans_id = ar.id) where ac.chart_link like 'AR_amount%' AND ac.amount <> ar.netamount|; + select sum(ac.amount) as amount, ar.invnumber,ar.netamount + from acc_trans ac left join ar on (ac.trans_id = ar.id) + where ac.chart_link like 'AR_amount%' group by invnumber,netamount having sum(ac.amount) <> ar.netamount|; my $ar_amount_not_ac_amount = selectall_hashref_query($::form, $self->dbh, $query); @@ -457,8 +458,9 @@ sub check_ap_acc_trans_amount { my ($self) = @_; my $query = qq| - select ap.invnumber, ap.netamount, ac.amount - from ap left join acc_trans ac on (ac.trans_id = ap.id) where ac.chart_link like 'AP_amount%' AND ac.amount <> ap.netamount*-1|; + select sum(ac.amount) as amount, ap.invnumber,ap.netamount + from acc_trans ac left join ap on (ac.trans_id = ap.id) + where ac.chart_link like 'AR_amount%' group by invnumber,netamount having sum(ac.amount) <> ap.netamount*-1|; my $ap_amount_not_ac_amount = selectall_hashref_query($::form, $self->dbh, $query); -- 2.20.1