Revision cbb4ef68
Von Jan Büren vor fast 8 Jahren hinzugefügt
SL/BackgroundJob/SelfTest/Transactions.pm | ||
---|---|---|
233 | 233 |
where |
234 | 234 |
(select sum(amount) from acc_trans a left join chart c on (c.id = a.chart_id) where trans_id = ar.id and c.link like '%AR_paid%') is not null |
235 | 235 |
AND storno is false |
236 |
AND transdate >= ? and transdate <= ?
|
|
236 |
AND ar.id in (SELECT id from ar where transdate >= ? and transdate <= ?)
|
|
237 | 237 |
order by diff |; |
238 | 238 |
|
239 | 239 |
my $paid_diffs_ar = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
... | ... | |
258 | 258 |
from ap |
259 | 259 |
where |
260 | 260 |
(select sum(amount) from acc_trans a left join chart c on (c.id = a.chart_id) where trans_id = ap.id and c.link like '%AP_paid%') is not null |
261 |
AND transdate >= ? and transdate <= ?
|
|
261 |
AND ap.id in (SELECT id from ap where transdate >= ? and transdate <= ?)
|
|
262 | 262 |
order by diff |; |
263 | 263 |
|
264 | 264 |
my $paid_diffs_ap = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
... | ... | |
552 | 552 |
select sum(ac.amount) as paid_amount, ar.invnumber,ar.paid |
553 | 553 |
from acc_trans ac left join ar on (ac.trans_id = ar.id) |
554 | 554 |
WHERE ac.chart_link like '%AR_paid%' |
555 |
AND ac.transdate >= ? AND ac.transdate <= ?
|
|
555 |
AND ac.trans_id in (SELECT trans_id from acc_trans ac where ac.transdate >= ? AND ac.transdate <= ?)
|
|
556 | 556 |
group by invnumber, paid having sum(ac.amount) <> ar.paid*-1|; |
557 | 557 |
|
558 | 558 |
my $ar_amount_not_ac_amount = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
... | ... | |
576 | 576 |
select sum(ac.amount) as paid_amount, ap.invnumber,ap.paid |
577 | 577 |
from acc_trans ac left join ap on (ac.trans_id = ap.id) |
578 | 578 |
WHERE ac.chart_link like '%AP_paid%' |
579 |
AND ac.transdate >= ? AND ac.transdate <= ?
|
|
579 |
AND ac.trans_id in (SELECT trans_id from acc_trans ac where ac.transdate >= ? AND ac.transdate <= ?)
|
|
580 | 580 |
group by trans_id,invnumber,paid having sum(ac.amount) <> ap.paid|; |
581 | 581 |
|
582 | 582 |
my $ap_amount_not_ac_amount = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
Auch abrufbar als: Unified diff
false positive in SelfTests gefiltert (Periode)
Hintergrund:
Um nur die Daten-Analyse auf das aktuelle Geschäftsjahr (Geschäftsjahr gleich
Kalender-Jahr) zu machen, wird für die meisten Tests mit transdate == current_year
gefiltert.
Problem: Periodenübergreifende Buchungen (Zahlungsein- und -ausgänge) werden
nicht berücksichtigt und schlagen entsprechend Fehlarlam.
Optimierung: Es werden nur die Buchungen des aktuellen Geschäftsjahr angeschaut
und weitere acc_trans Daten ohne Zeitfilter über die trans_id gruppiert.