From 2a0a1717444f8b0b71497c8b52275e0573db5136 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Fri, 3 Aug 2012 16:33:34 +0200 Subject: [PATCH] Autom. Update des Faelligkeitsdatums bei Kreditorenbuchungen behebt #1936 --- SL/Form.pm | 11 ++++++++++- bin/mozilla/ap.pl | 22 ++++++++++++++++++++-- 2 files changed, 30 insertions(+), 3 deletions(-) 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 + + | -- 2.20.1