X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FPriceSource%2FMakemodel.pm;h=bda7b81efd4fb036883842434faaf8ac704678e0;hb=b74d1c197c8365b14587838d999244274de12884;hp=2a4f5b043e423257e860381ab9a9c67dd0a17244;hpb=df1b03d578280d71fb839b437505dd283f6dd749;p=kivitendo-erp.git diff --git a/SL/PriceSource/Makemodel.pm b/SL/PriceSource/Makemodel.pm index 2a4f5b043..bda7b81ef 100644 --- a/SL/PriceSource/Makemodel.pm +++ b/SL/PriceSource/Makemodel.pm @@ -23,16 +23,24 @@ sub available_prices { $self->part->makemodels; } +sub available_discounts { } + sub price_from_source { my ($self, $source, $spec) = @_; my $makemodel = SL::DB::Manager::MakeModel->find_by(id => $spec); - # TODO: if someone deletes the prices entry, this fails. add a fallback + return SL::PriceSource::Price->new( + price_source => $self, + missing => t8('This makemodel price does not exist anymore'), + ) if !$makemodel; + return $self->make_price_from_makemodel($makemodel); } +sub discount_from_source { } + sub best_price { my ($self, %params) = @_; @@ -42,6 +50,8 @@ sub best_price { } +sub best_discount { } + sub make_price_from_makemodel { my ($self, $makemodel) = @_; @@ -53,5 +63,4 @@ sub make_price_from_makemodel { ); } - 1;