Auftrags-Controller: Zahlungs- und Lieferbed. von Kunden/Lieferanten vorbelegen.
authorBernd Bleßmann <bernd@kivitendo-premium.de>
Fri, 13 Nov 2015 10:53:57 +0000 (11:53 +0100)
committerG. Richardson <information@kivitendo-premium.de>
Mon, 16 Nov 2015 15:15:59 +0000 (16:15 +0100)
SL/Controller/Order.pm

index 3203485..9683676 100644 (file)
@@ -295,13 +295,18 @@ sub action_customer_vendor_changed {
                               : $::myconfig{taxincluded_checked});
   }
 
+  $self->order->payment_id($self->order->$cv_method->payment_id);
+  $self->order->delivery_term_id($self->order->$cv_method->delivery_term_id);
+
   $self->_recalc();
 
   $self->js
-    ->replaceWith('#order_cp_id',       $self->build_contact_select)
-    ->replaceWith('#order_shipto_id',   $self->build_shipto_select)
-    ->val(        '#order_taxzone_id',  $self->order->taxzone_id)
-    ->val(        '#order_taxincluded', $self->order->taxincluded)
+    ->replaceWith('#order_cp_id',            $self->build_contact_select)
+    ->replaceWith('#order_shipto_id',        $self->build_shipto_select)
+    ->val(        '#order_taxzone_id',       $self->order->taxzone_id)
+    ->val(        '#order_taxincluded',      $self->order->taxincluded)
+    ->val(        '#order_payment_id',       $self->order->payment_id)
+    ->val(        '#order_delivery_term_id', $self->order->delivery_term_id)
     ->focus(      '#order_' . $self->cv . '_id');
 
   $self->_js_redisplay_amounts_and_taxes;