X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FIS.pm;h=1df0eb2f9f5a320a4cc6dc243565ec65572a19a0;hb=c59e85c3a7538b1279e25022a6cf431ca1dee700;hp=bbf53e31ac3b203a5aaf3149b7e70c00bb6b38ad;hpb=0a64ac3db8c430756ab6260399816714e44ec16d;p=kivitendo-erp.git diff --git a/SL/IS.pm b/SL/IS.pm index bbf53e31a..1df0eb2f9 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -2130,6 +2130,11 @@ sub get_customer { my $payment_id; # get customer + my $where = ''; + if ($cid) { + $where .= 'AND c.id = ?'; + push @values, $cid; + } $query = qq|SELECT c.id AS customer_id, c.name AS customer, c.discount as customer_discount, c.creditlimit, @@ -2141,8 +2146,7 @@ sub get_customer { FROM customer c LEFT JOIN business b ON (b.id = c.business_id) LEFT JOIN currencies cu ON (c.currency_id=cu.id) - WHERE c.id = ?|; - push @values, $cid; + WHERE 1 = 1 $where|; $ref = selectfirst_hashref_query($form, $dbh, $query, @values); delete $ref->{salesman_id} if !$ref->{salesman_id};