From 763d39921a6e901b2322525404c358907036ec36 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Mon, 10 Aug 2015 13:41:55 +0200 Subject: [PATCH] Auftrags-Controller: cv_id in customer_id umbenannt. --- SL/Controller/Order.pm | 5 ++--- templates/webpages/order/tabs/basic_data.html | 8 ++++---- 2 files changed, 6 insertions(+), 7 deletions(-) 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 @@ -- 2.20.1