X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/kivitendo-erp.git/blobdiff_plain/a5f409be8c9f981038b94d5e1822185c73ad3949..713a6d703c0b2806f6a1f8fafa6bc9b6554c4087:/SL/IS.pm diff --git a/SL/IS.pm b/SL/IS.pm index 2cf148268..367c8615f 100644 --- a/SL/IS.pm +++ b/SL/IS.pm @@ -37,6 +37,7 @@ package IS; use List::Util qw(max); use SL::AM; +use SL::CVar; use SL::Common; use SL::DBUtils; use SL::MoreCommon; @@ -463,6 +464,12 @@ sub customer_details { map { $form->{"dv_$_"} = $ref->{$_} } keys %$ref; } + + my $custom_variables = CVar->get_custom_variables('dbh' => $dbh, + 'module' => 'CT', + 'trans_id' => $form->{customer_id}); + map { $form->{"vc_cvar_$_->{name}"} = $_->{value} } @{ $custom_variables }; + $dbh->disconnect; $main::lxdebug->leave_sub(); @@ -1513,7 +1520,13 @@ sub get_customer { } my $cid = conv_i($form->{customer_id}); - my $payment_id = ($form->{payment_id}) ? "($form->{payment_id} = pt.id) OR" : ""; + my $payment_id; + + if ($form->{payment_id}) { + $payment_id = "(pt.id = ?) OR"; + push @values, conv_i($form->{payment_id}); + } + # get customer $query = qq|SELECT