From 5ede0770885e493389494cf3be00511962d823a8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 25 Sep 2015 12:27:28 +0200 Subject: [PATCH] =?utf8?q?SEPA:=20offene=20Einz=C3=BCge=20beim=20Neuerstel?= =?utf8?q?len=20von=20Einz=C3=BCgen=20richtig=20ber=C3=BCcksichtigen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/SEPA.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/SL/SEPA.pm b/SL/SEPA.pm index 8e7306e31..f2599a8b6 100644 --- a/SL/SEPA.pm +++ b/SL/SEPA.pm @@ -49,13 +49,13 @@ sub retrieve_open_invoices { FROM ${arap} LEFT JOIN ${vc} vc ON (${arap}.${vc}_id = vc.id) - LEFT JOIN (SELECT sei.ap_id, SUM(sei.amount) AS amount + LEFT JOIN (SELECT sei.${arap}_id, SUM(sei.amount) AS amount FROM sepa_export_items sei LEFT JOIN sepa_export se ON (sei.sepa_export_id = se.id) WHERE NOT se.closed AND (se.vc = '${vc}') - GROUP BY sei.ap_id) - AS open_transfers ON (${arap}.id = open_transfers.ap_id) + GROUP BY sei.${arap}_id) + AS open_transfers ON (${arap}.id = open_transfers.${arap}_id) LEFT JOIN payment_terms pt ON (${payment_term_type}.payment_id = pt.id) -- 2.20.1