From 3879426c4db6c8a2ff8afa9a98992eeaede38a49 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 5 May 2009 09:43:16 +0000 Subject: [PATCH] =?utf8?q?Die=20Berechnung=20des=20F=C3=A4lligkeitsdatums?= =?utf8?q?=20anhand=20des=20momentan=20eingetragenen=20Rechnungsdatums=20d?= =?utf8?q?urchf=C3=BChren,=20und=20nicht=20anhand=20des=20Serverdatums.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Fix für Bug 927. --- SL/Form.pm | 12 ++++++++---- bin/mozilla/io.pl | 5 +++-- bin/mozilla/is.pl | 10 +++++----- 3 files changed, 16 insertions(+), 11 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 637bbe286..525d7329e 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1984,13 +1984,17 @@ sub get_employee_data { sub get_duedate { $main::lxdebug->enter_sub(); - my ($self, $myconfig) = @_; + my ($self, $myconfig, $reference_date) = @_; - my $dbh = $self->get_standard_dbh($myconfig); - my $query = qq|SELECT current_date + terms_netto FROM payment_terms WHERE id = ?|; - ($self->{duedate}) = selectrow_query($self, $dbh, $query, $self->{payment_id}); + my $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date'; + + my $dbh = $self->get_standard_dbh($myconfig); + my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|; + my ($duedate) = selectrow_query($self, $dbh, $query, $self->{payment_id}); $main::lxdebug->leave_sub(); + + return $duedate; } sub _get_contacts { diff --git a/bin/mozilla/io.pl b/bin/mozilla/io.pl index c2f789a01..45b756a6e 100644 --- a/bin/mozilla/io.pl +++ b/bin/mozilla/io.pl @@ -1870,9 +1870,10 @@ sub set_duedate { _check_io_auth(); - $form->get_duedate(\%myconfig); + my $invdate = $form->{invdate} eq 'undefined' ? undef : $form->{invdate}; + my $duedate = $form->get_duedate(\%myconfig, $invdate); - print $form->ajax_response_header() . $form->{duedate}; + print $form->ajax_response_header() . $duedate; $lxdebug->leave_sub(); } diff --git a/bin/mozilla/is.pl b/bin/mozilla/is.pl index f39ff1368..877b16683 100644 --- a/bin/mozilla/is.pl +++ b/bin/mozilla/is.pl @@ -529,7 +529,7 @@ sub form_header { if ($form->{type} eq "credit_note") { $button1 = qq| - |; #write Trigger @@ -540,17 +540,17 @@ sub form_header { } else { $button1 = qq| - |; $button2 = qq| - |; $button3 = qq| - |; @@ -911,7 +911,7 @@ sub form_footer { $notes $intnotes - $payment $follow_ups_block -- 2.20.1