From: Bernd Bleßmann Date: Fri, 5 Jun 2020 12:30:30 +0000 (+0200) Subject: S:D:Order: kein has_customervendor in kivitendo X-Git-Tag: release-3.5.6.1~101 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=e810df1e042da0e1d66668a834cbb594d43e72ee;p=kivitendo-erp.git S:D:Order: kein has_customervendor in kivitendo Anpassung nach cherry-picks aus odyn --- 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;