From: Bernd Bleßmann Date: Mon, 10 Aug 2015 11:41:55 +0000 (+0200) Subject: Auftrags-Controller: cv_id in customer_id umbenannt. X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=763d39921a6e901b2322525404c358907036ec36;p=kivitendo-erp.git Auftrags-Controller: cv_id in customer_id umbenannt. --- diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index 546d58a48..9aaa1f15f 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -123,7 +123,7 @@ sub action_customer_vendor_changed { ->replaceWith('#order_cp_id', $self->build_contact_select) ->replaceWith('#order_shipto_id', $self->build_shipto_select) ->val('#order_taxzone_id', $self->order->{$self->cv}->taxzone_id) - ->focus('#order_cv_id') + ->focus('#order_' . $self->cv . ' _id') ->render($self); } @@ -151,7 +151,7 @@ sub action_set_item_values { my $item = SL::DB::Manager::OrderItem->find_by_or_create(id => $item_id); my $cv_class = "SL::DB::" . ucfirst($self->cv); - my $cv_discount = $::form->{cv_id}? $cv_class->new(id => $::form->{cv_id})->load->discount :0.0; + my $cv_discount = $::form->{cv_id}? $cv_class->new(id => $::form->{$self->cv . '_id'})->load->discount :0.0; $item->assign_attributes( parts_id => $part->id, @@ -255,7 +255,6 @@ sub _load_or_new_order { sub _setup { my ($self) = @_; - $::form->{order}->{ $self->cv . '_id' } = delete $::form->{order}->{cv_id} if $::form->{order}->{cv_id}; $self->order->assign_attributes(%{$::form->{order}}); # bb: todo: currency later diff --git a/templates/webpages/order/tabs/basic_data.html b/templates/webpages/order/tabs/basic_data.html index f3cd724b8..93f954a7b 100644 --- a/templates/webpages/order/tabs/basic_data.html +++ b/templates/webpages/order/tabs/basic_data.html @@ -11,7 +11,7 @@ [% SELF.cv | $T8 %] [% SET cv_id = SELF.cv _ '_id' %] - [% L.customer_vendor_picker('order.cv_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %] + [% L.customer_vendor_picker("order.${SELF.cv}" _ '_id', SELF.order.$cv_id, type=SELF.cv, style='width: 300px') %] @@ -178,7 +178,7 @@