From c4b07238387eba288f94934a54847d1d432d3481 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 10 Jan 2022 17:05:12 +0100 Subject: [PATCH] Order-Controller: abweichende Rechnungsadresse nur bei Kunden behandeln --- SL/Controller/Order.pm | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SL/Controller/Order.pm b/SL/Controller/Order.pm index c8cc6ea24..24ad4a565 100644 --- a/SL/Controller/Order.pm +++ b/SL/Controller/Order.pm @@ -766,8 +766,10 @@ sub action_show_customer_vendor_details_dialog { $details{payment_terms} = $cv->payment->description if $cv->payment; $details{pricegroup} = $cv->pricegroup->pricegroup if $is_customer && $cv->pricegroup; - foreach my $entry (@{ $cv->additional_billing_addresses }) { - push @{ $details{ADDITIONAL_BILLING_ADDRESSES} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; + if ($is_customer) { + foreach my $entry (@{ $cv->additional_billing_addresses }) { + push @{ $details{ADDITIONAL_BILLING_ADDRESSES} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; + } } foreach my $entry (@{ $cv->shipto }) { push @{ $details{SHIPTO} }, { map { $_ => $entry->$_ } @{$entry->meta->columns} }; @@ -1341,6 +1343,8 @@ sub build_contact_select { sub build_billing_address_select { my ($self) = @_; + return '' if $self->cv ne 'customer'; + select_tag('order.billing_address_id', [ {displayable_id => '', id => ''}, $self->order->{$self->cv}->additional_billing_addresses ], value_key => 'id', -- 2.20.1