<!--                                                                  -->
<!--  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="payeeMailingLayout">
        <div class="AuditReport" id="auditReport">
            <h2 class="AuditReport-header">
                Payee Mailing List
                <xsl:call-template name="helpIcon">
                    <xsl:with-param name="tip">
                        Provides address information for payees associated with a specific royalty run
                    </xsl:with-param>
                </xsl:call-template>
            </h2>
            <xsl:choose>
                <xsl:when test="Report/ArtistPayee">
                    <xsl:call-template name="reportHeading" />
                    <xsl:call-template name="payeeMailingTable" />
                    <xsl:call-template name="reportFooter" />
                </xsl:when>
                <xsl:otherwise>
                    <section class="Table-empty-results">
                        <p>No payees were found.</p>
                    </section>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="backToArtistRun" />
        </div>

    </xsl:template>

    <xsl:template name="payeeMailingTable">
        <table class="Table Table-with-highlight">
            <thead>
                <tr class="Table-row Table-row-header">
                    <th class="Table-col">Payee</th>
                    <th class="Table-col">Address 1</th>
                    <th class="Table-col">Address 2</th>
                    <th class="Table-col">Address 3</th>
                    <th class="Table-col">City</th>
                    <th class="Table-col">State/Province</th>
                    <th class="Table-col">Zip/Postal</th>
                    <th class="Table-col">Country</th>
                    <th class="Table-col">Client&#160;#</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="Report/ArtistPayee">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col"><a href="artist_payee?c=show&amp;ArtistPayeeID={ArtistPayeeID}"><xsl:value-of select="Name" /></a></td>
                        <td class="Table-col"><xsl:value-of select="StreetAddress" /></td>
                        <td class="Table-col"><xsl:value-of select="StreetAddress2" /></td>
                        <td class="Table-col"><xsl:value-of select="StreetAddress3" /></td>
                        <td class="Table-col"><xsl:value-of select="City" /></td>
                        <td class="Table-col"><xsl:value-of select="StateProvince" /></td>
                        <td class="Table-col"><xsl:value-of select="PostalCode" /></td>
                        <xsl:variable name="countryCode" select="CountryCode" />
                        <td class="Table-col"><xsl:value-of select="/Root/Report/CountryList/Country[CountryCode = $countryCode]/Name" /></td>
                        <td class="Table-col"><xsl:value-of select="ClientAccountID" /></td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>

</xsl:stylesheet>
