<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">

    <xsl:template name="statementPayorList">
        <div class="MainBaseSection ArtistRoyaltyPayors">
            <xsl:call-template name="statementPayors" />
        </div>
    </xsl:template>

    <xsl:template name="statementPayors">
        <xsl:call-template name="payorTable" />
    </xsl:template>

    <xsl:template name="payorTable">
        <table class="Table Table-with-highlight">
            <thead>
                <tr class="Table-row Table-row-header">
                    <th class="Table-col">Payor</th>
                    <th class="Table-col"># of Statements</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="ArtistRoyaltyPayorList/Payor">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col">
                            <a>
                                <xsl:attribute name="href">
                                    <xsl:choose>
                                        <xsl:when test="/Root/Params/Payments">
                                            ?c=editpay&amp;RoyaltyRunID=<xsl:value-of select="/Root/Params/RoyaltyRunID" />&amp;PayorID=<xsl:value-of select="PayorID" />
                                        </xsl:when>
                                        <xsl:otherwise>
                                            ?c=show&amp;RoyaltyRunID=<xsl:value-of select="/Root/Params/RoyaltyRunID" />&amp;PayorID=<xsl:value-of select="PayorID" />
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </xsl:attribute>
                                <xsl:value-of select="Name" />
                            </a>
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="NumStatements" />
                        </td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>

</xsl:stylesheet>

