X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FSEPA.pm;h=2809063077d8b7b3db418f47c74cabda7614af46;hb=d64013f4ba48d1f34e1d55f8c5f98d0ab2b5ed2b;hp=94579179bc559ab1def7075adafea7468d1aef77;hpb=cc14c2da6eef443c7affa5aaddae20c9f8cbb1dd;p=kivitendo-erp.git diff --git a/SL/SEPA.pm b/SL/SEPA.pm index 94579179b..280906307 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 @@ -322,12 +322,12 @@ sub list_exports { if ($filter->{invnumber}) { push @where_sub, "arap.invnumber ILIKE ?"; - push @values_sub, '%' . $filter->{invnumber} . '%'; + push @values_sub, like($filter->{invnumber}); $joins_sub{$arap} = 1; } if ($filter->{message_id}) { - push @values, '%' . $filter->{message_id} . '%'; + push @values, like($filter->{message_id}); push @where, <{vc}) { push @where_sub, "vc.name ILIKE ?"; - push @values_sub, '%' . $filter->{vc} . '%'; + push @values_sub, like($filter->{vc}); $joins_sub{$arap} = 1; $joins_sub{vc} = 1; }