#------------------------------------------------------------
# Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved
# $Id$
#------------------------------------------------------------
package RPS::Statement::Command::ShowUKMechanical;
use strict;
use warnings;

use lib '/app/tools/rps/lib';
use RPS::Mechanical::UK::UKMechanicalRun;
use RPS::Statement::UKMechanical::StatementDisplay;
use RPS::Label;
use RPS::DB::Item::MechanicalRun;
use RPS::DB::Item::MechanicalStatement;

use lib '/app/tools/common/lib';
use Common::FormObject;
use Common::WriteXML;
use RSApache::Response::XSLT;
use RSApache::Response::XSLTDownload;

use RPS::Command;
use RPS::CommandLog;
use base 'RPS::Command';

sub cmd  { return 'show_uk_mechanical'; }
sub area { return 'statement'; }

use constant kTemplate => "/app/tools/rps/templates/statement/show_uk_mechanical.xsl";

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

    my $response = $self->SUPER::execute();
    return $response if $response;

    my $printerFlag = $self->getParam('printer');

    my $id          = $self->getParam('McpsStatementID');
    my $commandName = 'ShowUKMechanical';

    # JPK - Disabling the cache for everything but hfa statements...
    #
    my $statement = RPS::Statement::UKMechanical::StatementDisplay->new( statementID => $id, );

    $self->{xml}{Statement} = $statement;

    my $template = kTemplate;

    RPS::CommandLog::Log( $self, $id );
    $response = RSApache::Response::XSLT->new( $self->{xml}, kTemplate );

    return $response;
}

1;
