#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::DB::Item::ContractUnitEscalation;
use lib '/app/tools/common/lib';
use Common::DB::Item;
use Common::DB::ItemCollection;
use base 'Common::DB::Item';

use constant kTable => 'contract_unit_escalation';
use constant kDB => Common::DB::Item::kClientDB();



sub GetByContractID
{
	my ($class, $contractID, $mode) = @_;

	my $where = "WHERE contract_id=$contractID";
	if($mode)
	{
		$where .= " AND contract_mode=$mode";
	}

	my $sql = "SELECT * FROM contract_unit_escalation $where ORDER BY contract_mode, units";

    return $class->GetAll($sql);
}


1;
