Revision 6efd78c7
Von Tamino Steinert vor mehr als 1 Jahr hinzugefügt
SL/Controller/Order.pm | ||
---|---|---|
925 | 925 |
sub action_customer_vendor_changed { |
926 | 926 |
my ($self) = @_; |
927 | 927 |
|
928 |
setup_order_from_cv($self->order); |
|
928 |
$self->order(SL::Model::Record->update_after_customer_vendor_change($self->order)); |
|
929 |
|
|
929 | 930 |
$self->recalc(); |
930 | 931 |
|
931 | 932 |
my $cv_method = $self->cv; |
... | ... | |
1848 | 1849 |
my $cv_id_method = $self->cv . '_id'; |
1849 | 1850 |
if (!$::form->{id} && $::form->{$cv_id_method}) { |
1850 | 1851 |
$order->$cv_id_method($::form->{$cv_id_method}); |
1851 |
setup_order_from_cv($order);
|
|
1852 |
$order = SL::Model::Record->update_after_customer_vendor_change($order);
|
|
1852 | 1853 |
} |
1853 | 1854 |
|
1854 | 1855 |
my $form_orderitems = delete $::form->{order}->{orderitems}; |
... | ... | |
1960 | 1961 |
return $item; |
1961 | 1962 |
} |
1962 | 1963 |
|
1963 |
sub setup_order_from_cv { |
|
1964 |
my ($order) = @_; |
|
1965 |
|
|
1966 |
$order->$_($order->customervendor->$_) for (qw(taxzone_id payment_id delivery_term_id currency_id language_id)); |
|
1967 |
|
|
1968 |
$order->intnotes($order->customervendor->notes); |
|
1969 |
|
|
1970 |
return if !$order->is_sales; |
|
1971 |
|
|
1972 |
$order->salesman_id($order->customer->salesman_id || SL::DB::Manager::Employee->current->id); |
|
1973 |
$order->taxincluded(defined($order->customer->taxincluded_checked) |
|
1974 |
? $order->customer->taxincluded_checked |
|
1975 |
: $::myconfig{taxincluded_checked}); |
|
1976 |
|
|
1977 |
my $address = $order->customer->default_billing_address;; |
|
1978 |
$order->billing_address_id($address ? $address->id : undef); |
|
1979 |
} |
|
1980 |
|
|
1981 | 1964 |
# setup custom shipto from form |
1982 | 1965 |
# |
1983 | 1966 |
# The dialog returns form variables starting with 'shipto' and cvars starting |
Auch abrufbar als: Unified diff
Model::Record: Anpassen nach Kunden/Lieferanten-Änderung