price_type_id price_type_label 1 Sale Price 2 List Price 3 Cost #### sub SALE_PRICE_ID {1} sub LIST_PRICE_ID {2} sub COST_ID {3} #### sub cost { return $_[0]->get_price(PriceType->COST_ID); } sub list_price { return $_[0]->get_price(PriceType->LIST_PRICE_ID); } sub sale_price { return $_[0]->get_price(PriceType->SALE_PRICE_ID); } sub get_price { my ($self, $id) = @_; return unless $id and $id =~ /^[[:digit:]]+$/; my $price_type = PriceType->retrieve($id); $self->_croak "PriceType ID ($id) unknown" unless $price_type; my $sth = $self->sql_find_price; $sth->execute($self->id, $id); my ($price) = $sth->fetchrow_array; $sth->finish(); return $price; }