From 32b9234509522f36795001a5298c19e3315cd2a5 Mon Sep 17 00:00:00 2001 From: "G. Richardson" Date: Sun, 29 Nov 2015 22:46:41 +0100 Subject: [PATCH] =?utf8?q?Projektzwang=20bei=20Verkaufsauftr=C3=A4gen=20-?= =?utf8?q?=20auch=20Kunden=20verlinken?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/OE.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SL/OE.pm b/SL/OE.pm index 5b7c16dba..16ce8c164 100644 --- a/SL/OE.pm +++ b/SL/OE.pm @@ -537,9 +537,13 @@ sub save { # force new project, if not set yet if ($::instance_conf->get_order_always_project && !$form->{"globalproject_id"} && ($form->{type} eq 'sales_order')) { + require SL::DB::Customer; + my $customer = SL::DB::Manager::Customer->find_by( id => $form->{customer_id} ); + die "Can't find customer" unless $customer; my $new_project = SL::DB::Project->new( projectnumber => $form->{ordnumber}, - description => $form->{customer}, + description => $customer->name, + customer_id => $customer->id, active => 1, project_type_id => $::instance_conf->get_project_type_id, project_status_id => $::instance_conf->get_project_status_id, -- 2.20.1