From 003d4959b86170552ee07fd964baedd150165b35 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 5 Jan 2016 17:08:18 +0100 Subject: [PATCH] =?utf8?q?SEPA:=20bei=20Liste=20noch=20zu=20erledigender?= =?utf8?q?=20Rechnungen=20Skonto=20ber=C3=BCcksichtigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/SEPA.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/SEPA.pm b/SL/SEPA.pm index 94579179b..2b5738d6e 100644 --- a/SL/SEPA.pm +++ b/SL/SEPA.pm @@ -49,7 +49,7 @@ sub retrieve_open_invoices { FROM ${arap} LEFT JOIN ${vc} vc ON (${arap}.${vc}_id = vc.id) - LEFT JOIN (SELECT sei.${arap}_id, SUM(sei.amount) AS amount + LEFT JOIN (SELECT sei.${arap}_id, SUM(sei.amount) + SUM(COALESCE(sei.skonto_amount,0)) AS amount FROM sepa_export_items sei LEFT JOIN sepa_export se ON (sei.sepa_export_id = se.id) WHERE NOT se.closed -- 2.20.1