X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/e1c3b6b77d4407069cb09897a9e79cd8686e41bf..e7a7492e:/SL/PriceSource/Pricegroup.pm 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 || (); }