X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/19e4022642c1fd958850244ec4896f964519e563..826f6eb2b3e:/SL/OE.pm diff --git a/SL/OE.pm b/SL/OE.pm index 5b7c16dba..aaaef1646 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,