X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/78c8e7ac6600a975f31242165c81e537ce28bc07..b61d4f497e0287e399dd4c3ccde2d8cebd7c643e:/SL/DN.pm diff --git a/SL/DN.pm b/SL/DN.pm index 2bead22c7..1804959f9 100644 --- a/SL/DN.pm +++ b/SL/DN.pm @@ -45,6 +45,7 @@ use SL::Template; use SL::DB::Printer; use SL::DB::Language; use SL::TransNumber; +use SL::Util qw(trim); use strict; @@ -491,7 +492,7 @@ sub get_invoices { } elsif ($form->{customer}) { $where .= qq| AND (ct.name ILIKE ?)|; - push(@values, '%' . $form->{customer} . '%'); + push(@values, like($form->{customer})); } my %columns = ( @@ -503,7 +504,7 @@ sub get_invoices { foreach my $key (keys(%columns)) { next unless ($form->{$key}); $where .= qq| AND $columns{$key} ILIKE ?|; - push(@values, '%' . $form->{$key} . '%'); + push(@values, like($form->{$key})); } if ($form->{dunning_level}) { @@ -514,7 +515,7 @@ sub get_invoices { $form->{minamount} = $form->parse_amount($myconfig,$form->{minamount}); if ($form->{minamount}) { $where .= qq| AND ((a.amount - a.paid) > ?) |; - push(@values, $form->{minamount}); + push(@values, trim($form->{minamount})); } my $query = @@ -618,7 +619,7 @@ sub get_dunning { } elsif ($form->{customer}) { $where .= qq| AND (ct.name ILIKE ?)|; - push(@values, '%' . $form->{customer} . '%'); + push(@values, like($form->{customer})); } my %columns = ( @@ -629,7 +630,7 @@ sub get_dunning { foreach my $key (keys(%columns)) { next unless ($form->{$key}); $where .= qq| AND $columns{$key} ILIKE ?|; - push(@values, '%' . $form->{$key} . '%'); + push(@values, like($form->{$key})); } if ($form->{dunning_level}) {