From: Moritz Bunkus Date: Tue, 5 May 2009 09:43:16 +0000 (+0000) Subject: Die Berechnung des Fälligkeitsdatums anhand des momentan eingetragenen Rechnungsdatum... X-Git-Tag: release-2.6.0beta2~52 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=3879426c4db6c8a2ff8afa9a98992eeaede38a49;p=kivitendo-erp.git Die Berechnung des Fälligkeitsdatums anhand des momentan eingetragenen Rechnungsdatums durchführen, und nicht anhand des Serverdatums. Fix für Bug 927. --- 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