Revision ea8e8a62
Von Kivitendo Admin vor mehr als 10 Jahren hinzugefügt
SL/BackgroundJob/SelfTest/Transactions.pm | ||
---|---|---|
15 | 15 |
|
16 | 16 |
$self->_setup; |
17 | 17 |
|
18 |
$self->tester->plan(tests => 16);
|
|
18 |
$self->tester->plan(tests => 17);
|
|
19 | 19 |
|
20 | 20 |
$self->check_konten_mit_saldo_nicht_in_guv; |
21 | 21 |
$self->check_bilanzkonten_mit_pos_eur; |
22 | 22 |
$self->check_balanced_individual_transactions; |
23 | 23 |
$self->check_verwaiste_acc_trans_eintraege; |
24 |
$self->check_verwaiste_invoice_eintraege; |
|
24 | 25 |
$self->check_netamount_laut_invoice_ar; |
25 | 26 |
$self->check_invnumbers_unique; |
26 | 27 |
$self->check_summe_stornobuchungen; |
... | ... | |
128 | 129 |
} |
129 | 130 |
} |
130 | 131 |
|
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); |
|
135 |
my ($self) = @_; |
|
136 |
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)"); } |
|
147 |
} |
|
148 |
|
|
131 | 149 |
sub check_netamount_laut_invoice_ar { |
132 | 150 |
my ($self) = @_; |
133 | 151 |
my $query = qq| |
Auch abrufbar als: Unified diff
Neuer SelfTest Testfall: verwaiste invoice Einträge
Suche nach verwaisten Einträgen in invoice, die weder mit ar noch mit ap
verknüpft sind.