Revision ed11f8c7
Von Jan Büren vor fast 8 Jahren hinzugefügt
SL/BackgroundJob/SelfTest/Transactions.pm | ||
---|---|---|
205 | 205 |
my ($self) = @_; |
206 | 206 |
|
207 | 207 |
my $query = qq| |
208 |
select sum(amount) from ar a JOIN customer c ON (a.customer_id = c.id) |
|
209 |
WHERE a.id in (SELECT id from ap where storno is true AND a.transdate >= ? and a.transdate <= ?)|; |
|
208 |
SELECT sum(amount) from ar a WHERE a.id IN |
|
209 |
(SELECT id from ap where storno is true |
|
210 |
AND a.transdate >= ? and a.transdate <= ?)|; |
|
210 | 211 |
my ($summe_stornobuchungen_ar) = selectfirst_array_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
211 | 212 |
|
212 | 213 |
$query = qq| |
213 |
select sum(amount) from ap a JOIN vendor c ON (a.vendor_id = c.id) |
|
214 |
WHERE a.id in (SELECT id from ap where storno is true AND a.transdate >= ? and a.transdate <= ?)|; |
|
214 |
SELECT sum(amount) from ap a WHERE a.id IN |
|
215 |
(SELECT id from ap where storno is true |
|
216 |
AND a.transdate >= ? and a.transdate <= ?)|; |
|
215 | 217 |
my ($summe_stornobuchungen_ap) = selectfirst_array_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
216 | 218 |
|
217 | 219 |
$self->tester->ok($summe_stornobuchungen_ap == 0, 'Summe aller Einkaufsrechnungen (stornos + stornierte) soll 0 sein'); |
Auch abrufbar als: Unified diff
SelfTest Kosmetik
Ein überflüssiges JOIN entfernt und etwas sinnvoller den
Code formatiert.