From dc262059118923b89a2af8e7990cdb5cf3b48b57 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20B=C3=BCren?= Date: Tue, 21 Jan 2014 16:26:16 +0100 Subject: [PATCH] =?utf8?q?F=C3=A4lligkeitsdatum=20auf=20Rechnungsdatum=20s?= =?utf8?q?etzen,=20falls=20nichts=20weiter=20konfiguriert=20(#2440)=20Ist?= =?utf8?q?=20in=20io.pl=20auch=20schon=20so=20vorgesehen:=20=20=20=20=20pr?= =?utf8?q?int=20$form->ajax=5Fresponse=5Fheader()=20.=20($duedate=20||=20$?= =?utf8?q?invdate);=20Allerdings=20schmei=C3=9Ft=20die=20get=5Fduedate-Fun?= =?utf8?q?ktion=20in=20Form.pm=20einen=20Fehler,=20weil=20keine=20der=20be?= =?utf8?q?n=C3=B6tigten=20Parameter=20=C3=BCbergeben=20werden.=20S.a.=20De?= =?utf8?q?bug=20von=20$self:=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20=20=20'script'=20=3D>=20'is.pl',=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20=20=20'titlebar'=20=3D>=20'kivitendo=20Vers?= =?utf8?q?ion=203.0.0',=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20'version'=20=3D>=20'3.0.0',=20=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20'action'=20=3D>=20'set=5Fduedate',=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20'payment=5Fid'=20?= =?utf8?q?=3D>=20'',=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?'invdate'=20=3D>=20'14.01.2014',=20=20=20=20=20=20=20=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20=20'login'=20=3D>=20'jan=5Fskr04'=20=20=20?= =?utf8?q?=20=20=20=20=20=20=20=20=20=20=20=20=20},=20'Form'=20);?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Von daher die Erweiterung, ob invdate existiert und enstprechend ein undef als Rückgabewert closes #2440 --- SL/Form.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index a11b7adb6..eb3565d44 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -1955,8 +1955,8 @@ sub get_duedate { my $terms = $self->{payment_id} ? SL::DB::PaymentTerm->new(id => $self->{payment_id}) ->load : $self->{customer_id} ? SL::DB::Customer ->new(id => $self->{customer_id})->load->payment : $self->{vendor_id} ? SL::DB::Vendor ->new(id => $self->{vendor_id}) ->load->payment - : croak("Missing field in \$::form: payment_id, customer_id or vendor_id"); - + : $self->{invdate} ? undef # no payment terms, therefore invdate == duedate + : croak("Missing field in \$::form: payment_id, customer_id, vendor_id or invdate"); my $duedate = $terms ? $terms->calc_date(reference_date => $reference_date)->to_kivitendo : undef; $main::lxdebug->leave_sub(); -- 2.20.1