From c7f777ac5f9a7c13bf402d008cf609a7ba33a9c5 Mon Sep 17 00:00:00 2001 From: "T. Eickmeyer" Date: Thu, 13 Dec 2012 14:32:29 +0100 Subject: [PATCH] =?utf8?q?SelfTest:=20Ungepaarte=20Stornos=20auch=20im=20E?= =?utf8?q?inkauf=20pr=C3=BCfen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/BackgroundJob/SelfTest/Transactions.pm | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/SL/BackgroundJob/SelfTest/Transactions.pm b/SL/BackgroundJob/SelfTest/Transactions.pm index d635fd4b5..84eaa8467 100644 --- a/SL/BackgroundJob/SelfTest/Transactions.pm +++ b/SL/BackgroundJob/SelfTest/Transactions.pm @@ -284,16 +284,22 @@ sub check_stornos_ohne_partner { my ($self) = @_; my $query = qq| - select ar.id,invnumber,storno,amount,transdate,type,customernumber - from ar - left join customer c on (c.id = ar.customer_id) - where storno_id is null and storno is true and ar.id not in (select storno_id from ar where storno_id is not null and storno is true); + SELECT (SELECT cast ('ar' as text)) as invoice ,ar.id,invnumber,storno,amount,transdate,type,customernumber as cv_number + FROM ar + LEFT JOIN customer c on (c.id = ar.customer_id) + WHERE storno_id is null AND storno is true AND ar.id not in (SELECT storno_id FROM ar WHERE storno_id is not null AND storno is true) + UNION + SELECT (SELECT cast ('ap' as text)) as invoice,ap.id,invnumber,storno,amount,transdate,type,vendornumber as cv_number + FROM ap + LEFT JOIN vendor v on (v.id = ap.vendor_id) + WHERE storno_id is null AND storno is true AND ap.id not in (SELECT storno_id FROM ap WHERE storno_id is not null AND storno is true); |; + my $stornos_ohne_partner = selectall_hashref_query($::form, $self->dbh, $query); $self->tester->ok(@$stornos_ohne_partner == 0, 'Es sollte keine Stornos ohne Partner geben'); if (@$stornos_ohne_partner) { - $self->tester->diag("stornos ohne partner: (kann passieren wenn Stornorechnung außerhalb Zeitraum liegt)"); + $self->tester->diag("Stornos ohne Partner: (kann passieren wenn Stornorechnung außerhalb Zeitraum liegt)"); $self->tester->diag("gilt aber trotzdem als paid zu dem Zeitpunkt, oder?"); } my $stornoheader = 0; -- 2.20.1