Revision daaac66a
Von Jan Büren vor mehr als 8 Jahren hinzugefügt
SL/BackgroundJob/SelfTest/Transactions.pm | ||
---|---|---|
15 | 15 |
|
16 | 16 |
$self->_setup; |
17 | 17 |
|
18 |
$self->tester->plan(tests => 23);
|
|
18 |
$self->tester->plan(tests => 24);
|
|
19 | 19 |
|
20 | 20 |
$self->check_konten_mit_saldo_nicht_in_guv; |
21 | 21 |
$self->check_bilanzkonten_mit_pos_eur; |
... | ... | |
40 | 40 |
$self->check_bank_transactions_overpayments; |
41 | 41 |
$self->check_ar_paid_acc_trans; |
42 | 42 |
$self->check_ap_paid_acc_trans; |
43 |
$self->check_zero_amount_paid_but_datepaid_exists; |
|
43 | 44 |
} |
44 | 45 |
|
45 | 46 |
sub _setup { |
... | ... | |
592 | 593 |
} |
593 | 594 |
} |
594 | 595 |
|
596 |
sub check_zero_amount_paid_but_datepaid_exists { |
|
597 |
my ($self) = @_; |
|
598 |
|
|
599 |
my $query = qq|(SELECT invnumber,datepaid from ar where datepaid is NOT NULL AND paid = 0 |
|
600 |
AND id not IN (select trans_id from acc_trans WHERE chart_link like '%paid%' AND acc_trans.trans_id = ar.id) |
|
601 |
AND datepaid >= ? AND datepaid <= ?) |
|
602 |
UNION |
|
603 |
(SELECT invnumber,datepaid from ap where datepaid is NOT NULL AND paid = 0 |
|
604 |
AND id not IN (select trans_id from acc_trans WHERE chart_link like '%paid%' AND acc_trans.trans_id = ap.id) |
|
605 |
AND datepaid >= ? AND datepaid <= ?)|; |
|
606 |
|
|
607 |
my $datepaid_should_be_null = selectall_hashref_query($::form, $self->dbh, $query, |
|
608 |
$self->fromdate, $self->todate, |
|
609 |
$self->fromdate, $self->todate); |
|
610 |
|
|
611 |
if ( scalar @{ $datepaid_should_be_null } > 0 ) { |
|
612 |
$self->tester->ok(0, "Folgende Rechnungen haben ein Bezahl-Datum, aber keinen Bezahl-Wert im Nebenbuch:"); |
|
613 |
|
|
614 |
for my $datepaid_should_be_null_nok (@{ $datepaid_should_be_null } ) { |
|
615 |
$self->tester->diag("Rechnungsnummer: $datepaid_should_be_null_nok->{invnumber} |
|
616 |
Bezahl-Datum: $datepaid_should_be_null_nok->{datepaid}"); |
|
617 |
} |
|
618 |
} else { |
|
619 |
$self->tester->ok(1, "Hauptbuch Bezahl-Wert und Kreditoren-Nebenbuch-Bezahlwert stimmen überein."); |
|
620 |
} |
|
621 |
} |
|
595 | 622 |
|
596 | 623 |
1; |
597 | 624 |
|
Auch abrufbar als: Unified diff
Weiteren Transaction-Selftest
Falls ein datepaid im Nebenbuch gesetzt ist, so darf paid nicht
auf 0 sein, wenn es keine Zahlungen in der acc_trans hierzu gibt.