From bfd5682ab8cad5878260ec2cafcd630dd3c05eff Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Fri, 30 Oct 2020 16:01:34 +0100 Subject: [PATCH] =?utf8?q?Pflichtenhefte:=20G=C3=BCltigkeitsdatum=20in=20A?= =?utf8?q?ngeboten=20auch=20ohne=20Zahlungsbedingungen=20setzen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Controller/RequirementSpecOrder.pm | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SL/Controller/RequirementSpecOrder.pm b/SL/Controller/RequirementSpecOrder.pm index a949901f1..398c86a47 100644 --- a/SL/Controller/RequirementSpecOrder.pm +++ b/SL/Controller/RequirementSpecOrder.pm @@ -365,10 +365,13 @@ sub create_order { my @orderitems = map { $self->create_order_item( section => $_, language_id => $customer->language_id) } @{ $params{sections} }; my @add_items = map { $self->create_additional_part_order_item(additional_part => $_, language_id => $customer->language_id) } @{ $params{additional_parts} }; my $employee = SL::DB::Manager::Employee->current; + my $reqdate = !$::form->{quotation} ? undef + : $customer->payment_id ? $customer->payment->calc_date + : DateTime->today_local->next_workday(extra_days => $::instance_conf->get_reqdate_interval)->to_kivitendo; my $order = SL::DB::Order->new( globalproject_id => $self->requirement_spec->project_id, transdate => DateTime->today_local, - reqdate => $::form->{quotation} && $customer->payment_id ? $customer->payment->calc_date : undef, + reqdate => $reqdate, quotation => !!$::form->{quotation}, orderitems => [ @orderitems, @add_items ], customer_id => $customer->id, -- 2.20.1