X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=19f2b5cf59342f490a9085148d136b3720980153;hb=41b9f5c7c8067d67326c83e2d26df0898bc279ca;hp=9cc1065f5eb4d90aa07c276565b2ab6a1fc29710;hpb=980dc53321ae6c2d3e448b6ca2a0c7d11a65ee8c;p=kivitendo-erp.git diff --git a/SL/Form.pm b/SL/Form.pm index 9cc1065f5..19f2b5cf5 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1970,7 +1970,7 @@ sub get_duedate { $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date'; my $dbh = $self->get_standard_dbh($myconfig); - my $payment_id; + my ($payment_id, $duedate); if($self->{payment_id}) { $payment_id = $self->{payment_id}; @@ -1979,8 +1979,10 @@ sub get_duedate { ($payment_id) = selectrow_query($self, $dbh, $query, $self->{vendor_id}); } - my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|; - my ($duedate) = selectrow_query($self, $dbh, $query, $payment_id); + if ($payment_id) { + my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|; + ($duedate) = selectrow_query($self, $dbh, $query, $payment_id); + } $main::lxdebug->leave_sub(); @@ -3607,7 +3609,7 @@ SL::Form.pm - main data object. =head1 SYNOPSIS -This is the main data object of Lx-Office. +This is the main data object of kivitendo. Unfortunately it also acts as a god object for certain data retrieval procedures used in the entry points. Points of interest for a beginner are: @@ -3632,7 +3634,7 @@ will in this case not increase the value, and return undef. Generates a HTTP redirection header for the new C<$url>. Constructs an absolute URL including scheme, host name and port. If C<$url> is a -relative URL then it is considered relative to Lx-Office base URL. +relative URL then it is considered relative to kivitendo base URL. This function Cs if headers have already been created with C<$::form-Eheader>.