From e810df1e042da0e1d66668a834cbb594d43e72ee Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bernd=20Ble=C3=9Fmann?= Date: Fri, 5 Jun 2020 14:30:30 +0200 Subject: [PATCH] S:D:Order: kein has_customervendor in kivitendo Anpassung nach cherry-picks aus odyn --- SL/DB/Order.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/SL/DB/Order.pm b/SL/DB/Order.pm index dac89d30e..b62823a4f 100644 --- a/SL/DB/Order.pm +++ b/SL/DB/Order.pm @@ -125,10 +125,10 @@ sub exchangerate { return 1 if $self->currency_id == $::instance_conf->get_currency_id; - # unable to determine if sales or purchase - return undef if !$self->has_customervendor; - - my $rate = $self->is_sales ? 'buy' : 'sell'; + my $rate = (any { $self->is_type($_) } qw(sales_quotation sales_order)) ? 'buy' + : (any { $self->is_type($_) } qw(request_quotation purchase_order)) ? 'sell' + : undef; + return if !$rate; if (defined $val) { croak t8('exchange rate has to be positive') if $val <= 0; -- 2.20.1