<!--                                                                  -->
<!--  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="section" id="auditReport">
    	<xsl:choose>
    		<xsl:when test="Report/ArtistPayee">
    			<div class="reportNavWrapper">
    				<h2>
    					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:call-template name="reportHeading" />
	    			<xsl:call-template name="reportNav" />
					</div>
		  		<xsl:call-template name="payeeMailingTable" />
		  		<xsl:call-template name="reportNav" />
					<br class="superBreak" />
					<br />
				</xsl:when>
				<xsl:otherwise>
					<p>No payees were found.</p>
				</xsl:otherwise>
			</xsl:choose>
		</div>
		
		<xsl:call-template name="backToArtistRun" />
		
	</xsl:template>

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

</xsl:stylesheet>
