X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FSEPA.pm;h=2b5738d6e74e2882aee35c10d7bac996c088b03a;hb=0b33cc602d717933791d06cb64f65dea2a7c2354;hp=c62c2ce7d5f4b92ab4d29f3bff81f9758114abf4;hpb=71dab32201ac432029963c7f0ce2b87adea2dd92;p=kivitendo-erp.git diff --git a/SL/SEPA.pm b/SL/SEPA.pm index c62c2ce7d..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 @@ -326,6 +326,17 @@ sub list_exports { $joins_sub{$arap} = 1; } + if ($filter->{message_id}) { + push @values, '%' . $filter->{message_id} . '%'; + push @where, <{vc}) { push @where_sub, "vc.name ILIKE ?"; push @values_sub, '%' . $filter->{vc} . '%';