Revision 478da8b9
Von Kivitendo Admin vor fast 11 Jahren hinzugefügt
SL/BackgroundJob/SelfTest/Transactions.pm | ||
---|---|---|
130 | 130 |
} |
131 | 131 |
|
132 | 132 |
sub check_verwaiste_invoice_eintraege { |
133 |
# taxincluded is null sollte nie passieren: |
|
134 |
# select sum(sellprice*qty) from invoice i where trans_id in (select id from ar where taxincluded is null); |
|
133 |
# this check is always run for all invoice entries in the entire database |
|
135 | 134 |
my ($self) = @_; |
136 | 135 |
my $query = qq| |
137 |
select * from invoice |
|
138 |
where trans_id not in (select id from ar union select id from ap order by id) |
|
139 |
and a.transdate >= ? and a.transdate <= ? ;|; |
|
140 |
|
|
141 |
my $verwaiste_invoice = selectall_hashref_query($::form, $self->dbh, $query, $self->fromdate, $self->todate); |
|
142 |
if (@$verwaiste_invoice) { |
|
143 |
$self->tester->ok(0, "Es gibt verwaiste invoice Einträge! (wo ar/ap-Eintrag fehlt)"); |
|
144 |
$self->tester->diag($_) for @$verwaiste_acs; |
|
145 |
} else { |
|
146 |
$self->tester->ok(1, "Keine verwaisten invoice Einträge (wo ar/ap-Eintrag fehlt)"); } |
|
136 |
select * from invoice i |
|
137 |
where trans_id not in (select id from ar union select id from ap order by id) |; |
|
138 |
|
|
139 |
my $verwaiste_invoice = selectall_hashref_query($::form, $self->dbh, $query); |
|
140 |
if (@$verwaiste_invoice) { |
|
141 |
$self->tester->ok(0, "Es gibt verwaiste invoice Einträge! (wo ar/ap-Eintrag fehlt)"); |
|
142 |
for my $invoice ( @{ $verwaiste_invoice }) { |
|
143 |
$self->tester->diag("invoice: id: $invoice->{id} trans_id: $invoice->{trans_id} description: $invoice->{description} itime: $invoice->{itime}"); |
|
144 |
}; |
|
145 |
} else { |
|
146 |
$self->tester->ok(1, "Keine verwaisten invoice Einträge (wo ar/ap-Eintrag fehlt)"); } |
|
147 | 147 |
} |
148 | 148 |
|
149 | 149 |
sub check_netamount_laut_invoice_ar { |
Auch abrufbar als: Unified diff
Selftest - kaputten Test aus Commit ea8e8a62 repariert
Die Prüfung auf verwaiste invoice-Einträge war fehlerhaft. Weitherhin
wurde die Prüfung auf die gesamt Datenbank ausgeweitet.