X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPriceSource%2FPricegroup.pm;h=532b1fffa3530d029a330e855e51635c09cfb08b;hb=d64013f4ba48d1f34e1d55f8c5f98d0ab2b5ed2b;hp=6408300b13a4de5d1260cb768c69207ea89a8d00;hpb=e1c3b6b77d4407069cb09897a9e79cd8686e41bf;p=kivitendo-erp.git diff --git a/SL/PriceSource/Pricegroup.pm b/SL/PriceSource/Pricegroup.pm index 6408300b1..532b1fffa 100644 --- a/SL/PriceSource/Pricegroup.pm +++ b/SL/PriceSource/Pricegroup.pm @@ -23,7 +23,7 @@ sub available_prices { my $prices = SL::DB::Manager::Price->get_all( query => [ parts_id => $item->parts_id, price => { gt => 0 } ], with_objects => 'pricegroup', - order_by => 'pricegroup.id', + sort_by => 'pricegroup.id', ); return () unless @$prices; @@ -54,9 +54,9 @@ sub best_price { my @prices = $self->available_prices; my $customer = $self->record->customer; - return () if !$customer || !$customer->klass; + return () if !$customer || !$customer->pricegroup_id; - my $best_price = first { $_->spec == $customer->klass } @prices; + my $best_price = first { $_->spec == $customer->pricegroup_id } @prices; return $best_price || (); }