#---------------------------------------------------------------
# ____                   _ _         ____  _
#|  _ \ ___  _   _  __ _| | |_ _   _/ ___|| |__   __ _ _ __ ___
#| |_) / _ \| | | |/ _` | | __| | | \___ \| '_ \ / _` | '__/ _ \
#|  _ < (_) | |_| | (_| | | |_| |_| |___) | | | | (_| | | |  __/
#|_| \_\___/ \__, |\__,_|_|\__|\__, |____/|_| |_|\__,_|_|  \___|
#            |___/             |___/
#
# Copyright (C) 2012 RoyaltyShare, Inc.   All Rights Reserved
#---------------------------------------------------------------

package RPS::ArtistRoyalty::Fast::TermType::DocumentRetail;

use strict;
use lib '/app/tools/rps/lib';
use RPS::ArtistRoyalty::Fast::Static::Sales;
use base 'RPS::ArtistRoyalty::Fast::TermType::Base';

sub isDocumentPriceBased { 1 }

sub _getPrice {
    my ( $self, $sale, $priceLevel, $productPrices ) = @_;

    my $price =
      $sale->[RPS::ArtistRoyalty::Fast::Static::Sales::kRetailPrice] * $sale->[RPS::ArtistRoyalty::Fast::Static::Sales::kConversionRate];
    return undef unless $price != 0;
    return $price;
}

1;
