<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">
     <xsl:output method="html" indent="no" doctype-system="http://www.w3.org/TR/html4/strict.dtd" doctype-public="-//W3C//DTD HTML 4.01//EN" encoding="utf-8" />

    <xsl:include href="/app/tools/rps/templates/global.xsl" />
    <xsl:include href="../shared_layouts/statements.xsl" />


    <xsl:template name="pickLayout">
        <div class="section" id="runList">
            <xsl:call-template name="helpLink" />
            <xsl:call-template name="statementSuccessMessages" />
	  	    <xsl:call-template name="createRunLink" />
			<xsl:choose>
				<xsl:when test="UKMechanicalRunList/UKMechanicalRun">
					<xsl:call-template name="runTable" />
				</xsl:when>
				<xsl:otherwise>
					<br class="superBreak" />
					<p>No mechanical runs have been created.</p>
				</xsl:otherwise>
			</xsl:choose>
		</div>
    </xsl:template>

    <xsl:template name="runTable">
        <table class="textChart hiOn">
	        <tr>
              	<th># of Statements</th>
                <th>Reporting Period</th>
              	<th>Ending Sales Date</th>
                <th>Payor</th>
              	<th>Run Date</th>
              	<th>Status
					<xsl:call-template name="helpIcon">
						<xsl:with-param name="tip" select="$statusDescriptions" />
					</xsl:call-template>
      	        </th>
      	        <th>Actions</th>
			</tr>
            <xsl:for-each select="UKMechanicalRunList/UKMechanicalRun">
                <tr class="row{position() mod 2}">
                    <td>
						<xsl:call-template name="statementCount" />
                    </td>
                    <td>
          	            Q<xsl:value-of select="Quarter" /><xsl:text> </xsl:text><xsl:value-of select="Year" />
                    </td>
                    <td>
          	            <xsl:call-template name="endingSalesDate" >
			              <xsl:with-param name="endingSaleDate"><xsl:value-of select="EndingSaleDate" /></xsl:with-param>
			            </xsl:call-template>
                    </td>
                    <td>
						<xsl:call-template name="payorName" />
                    </td>
                    <td>
          	            <xsl:call-template name="runDate" />
                    </td>
                    <td>
          	            <xsl:call-template name="statusCodeToName" />
                    </td>
        	        <td>
						<xsl:call-template name="runActions" />
					</td>
                </tr>
            </xsl:for-each>
        </table>
    </xsl:template>

</xsl:stylesheet>
