From: Jan Büren Date: Mon, 1 Feb 2016 16:01:47 +0000 (+0100) Subject: Self-Tests Haupt- / Nebenbuchprüfung verbessert X-Git-Tag: release-3.4.1~441 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2459db37cc67d46d7011707ac4f25a4a6b8663b9;p=kivitendo-erp.git Self-Tests Haupt- / Nebenbuchprüfung verbessert --- 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);