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

package RPS::Report::Dynamic::Transactions::PublisherBase;

use strict;
use warnings;

use lib '/app/tools/common/lib';
use lib '/app/tools/rps/lib';
use lib '/app/tools/report/lib';
use Common::Client;

use base 'RPS::Report::Dynamic::Transactions::Base';

sub _columns {
    my ($self) = @_;

    my $cols = [];

    $self->_publisherCols($cols);
    $self->_transactionCols($cols);

    return $cols;
}

sub _publisherCols {
    my ( $self, $cols ) = @_;

    push @$cols,
      {
        header => {
            name => 'publisher',
        },
        column => {
            field => 'publisher',
        }
      },
      {
        header => {
            name => 'client-account-no',
        },
        column => {
            field => 'client_account_no',
        }
      },
      {
        header => {
            name => 'rs-publisher-id',
        },
        column => {
            field => 'publisher_id',
        }
      },
      {
        header => {
            name => 'status',
        },
        column => {
            field => 'publisher_status',
        }
      },
      {
        header => {
            name => 'publisher-type',
        },
        column => {
            field => 'publisher_type',
        }
      },
      {
        header => {
            name => 'admin',
        },
        column => {
            field => 'admin_name',
        }
      },
      {
        header => {
            name => 'agent',
        },
        column => {
            field => 'agent_name',
        }
      },
      {
        header => {
            name => 'total-no-licenses',
        },
        column => {
            field  => 'license_count',
            method => '_getLicenseCount',
        }
      };
}

1;
