From: Thomas Heck Date: Fri, 3 Aug 2012 14:33:34 +0000 (+0200) Subject: Autom. Update des Faelligkeitsdatums bei Kreditorenbuchungen X-Git-Tag: release-3.0.0beta1~297^2~11 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=2a0a1717444f8b0b71497c8b52275e0573db5136;p=kivitendo-erp.git Autom. Update des Faelligkeitsdatums bei Kreditorenbuchungen behebt #1936 --- diff --git a/SL/Form.pm b/SL/Form.pm index 849167363..a7ed01b73 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1995,8 +1995,17 @@ sub get_duedate { $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date'; my $dbh = $self->get_standard_dbh($myconfig); + my $payment_id; + + if($self->{payment_id}) { + $payment_id = $self->{payment_id}; + } elsif($self->{vendor_id}) { + my $query = 'SELECT payment_id FROM vendor WHERE id = ?'; + ($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, $self->{payment_id}); + my ($duedate) = selectrow_query($self, $dbh, $query, $payment_id); $main::lxdebug->leave_sub(); diff --git a/bin/mozilla/ap.pl b/bin/mozilla/ap.pl index f62294eaa..7c6d1bf4b 100644 --- a/bin/mozilla/ap.pl +++ b/bin/mozilla/ap.pl @@ -371,7 +371,7 @@ sub form_header { # with JavaScript Calendar $button1 = qq| - + text('button') . qq|> |; @@ -389,7 +389,7 @@ sub form_header { # without JavaScript Calendar $button1 = - qq||; + qq||; $button2 = qq||; } @@ -855,6 +855,24 @@ sub form_footer { $follow_ups_block + + |