Revision 10699892
Von Tamino Steinert vor etwa 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
937 | 937 |
sub action_customer_vendor_changed { |
938 | 938 |
my ($self) = @_; |
939 | 939 |
|
940 |
setup_order_from_cv($self->order); |
|
940 |
$self->order(SL::Model::Record->update_after_customer_vendor_change($self->order)); |
|
941 |
|
|
941 | 942 |
$self->recalc(); |
942 | 943 |
|
943 | 944 |
my $cv_method = $self->cv; |
... | ... | |
1860 | 1861 |
my $cv_id_method = $self->cv . '_id'; |
1861 | 1862 |
if (!$::form->{id} && $::form->{$cv_id_method}) { |
1862 | 1863 |
$order->$cv_id_method($::form->{$cv_id_method}); |
1863 |
setup_order_from_cv($order);
|
|
1864 |
$order = SL::Model::Record->update_after_customer_vendor_change($order);
|
|
1864 | 1865 |
} |
1865 | 1866 |
|
1866 | 1867 |
my $form_orderitems = delete $::form->{order}->{orderitems}; |
... | ... | |
1972 | 1973 |
return $item; |
1973 | 1974 |
} |
1974 | 1975 |
|
1975 |
sub setup_order_from_cv { |
|
1976 |
my ($order) = @_; |
|
1977 |
|
|
1978 |
$order->$_($order->customervendor->$_) for (qw(taxzone_id payment_id delivery_term_id currency_id language_id)); |
|
1979 |
|
|
1980 |
$order->intnotes($order->customervendor->notes); |
|
1981 |
|
|
1982 |
return if !$order->is_sales; |
|
1983 |
|
|
1984 |
$order->salesman_id($order->customer->salesman_id || SL::DB::Manager::Employee->current->id); |
|
1985 |
$order->taxincluded(defined($order->customer->taxincluded_checked) |
|
1986 |
? $order->customer->taxincluded_checked |
|
1987 |
: $::myconfig{taxincluded_checked}); |
|
1988 |
|
|
1989 |
my $address = $order->customer->default_billing_address;; |
|
1990 |
$order->billing_address_id($address ? $address->id : undef); |
|
1991 |
} |
|
1992 |
|
|
1993 | 1976 |
# setup custom shipto from form |
1994 | 1977 |
# |
1995 | 1978 |
# The dialog returns form variables starting with 'shipto' and cvars starting |
Auch abrufbar als: Unified diff
Model::Record: Anpassen nach Kunden/Lieferanten-Änderung