#------------------------------------------------------------
# Copyright (C) 2007 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::DB::Item::ReportQueries::LabelsWithoutContracts;

use strict;
use warnings;
use lib '/app/tools/common/lib';
use Common::DB::Item;
use Common::DB::ItemCollection;
use Common::Assert;

use lib '/app/tools/rps/lib';
use RPS::DB::Item::ReportQueries;

use base 'RPS::DB::Item::ReportQueries';


sub _config
{
    return 
    {
        'label_name'        => {},
        'label_id'          => {},
        'client_label_id'   => {},

    };
}


# This will return a list of labels that are not attached to any label contracts
#
sub GetLabelsWithoutContracts
{
    my ($class) = @_;
    
    my $sql = "SELECT label_id, label_name, client_label_id FROM label WHERE label_id NOT IN (SELECT label_id FROM label_contract_group_term_label) ORDER BY label_name";

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



1;
