$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} };
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',