<!--                                                                  -->
<!--  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="missedSalesLayout">
    <div class="section" id="auditReport">
    	<xsl:choose>
    		<xsl:when test="Report/MissedSale">
    			<div class="reportNavWrapper">
    				<h2>
    					Unallocated Sales
    					<xsl:call-template name="helpIcon">
								<xsl:with-param name="tip">
									Lists sales for albums or tracks that were not
									<xsl:value-of select="$tipBreak" />
									paid out for the associated royalty run
								</xsl:with-param>
							</xsl:call-template>    
						</h2>
						<xsl:call-template name="reportHeading" />
	    			<xsl:call-template name="reportNav" />
					</div>
		  		<xsl:call-template name="missedSalesTable" />
		  		<xsl:call-template name="reportNav" />
					<br class="superBreak" />
					<br />
				</xsl:when>
				<xsl:otherwise>
					<p>No missed sales were found.</p>
				</xsl:otherwise>
			</xsl:choose>
		</div>
		
		<xsl:call-template name="backToArtistRun" />
		
	</xsl:template>

	<xsl:template name="missedSalesTable">
    <table class="textChart hiOn">
      <tr>
      	<th>Catalog&#160;#</th>
      	<th>Product&#160;Type</th>
      	<th>Album&#160;Title</th>
      	<th>Artist</th>
      	<th>Track&#160;Title</th>
      	<th>Contract Title</th>
        <th class="amount">Units</th>
        <th>Reason</th>
        <th>Details</th>
      </tr>
      <xsl:for-each select="Report/MissedSale">
        <tr class="row{position() mod 2}">
          <td><xsl:value-of select="CatalogNumber" /></td>
          <td><xsl:value-of select="ProductType" /></td>
					<td>
						<a href="catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
					</td>
        	<td><xsl:value-of select="ArtistName" /></td>
					<td>
						<a href="track?c=show&amp;TrackID={TrackID}"><xsl:value-of select="TrackTitle" /></a>
					</td>
					<td>
						<a href="artist_contract?c=show&amp;ArtistContractID={ArtistContractID}"><xsl:value-of select="ArtistContractTitle" /></a>
					</td>
					<td class="amount"><xsl:value-of select="Units" /></td>
					<td><xsl:value-of select="Reason" /></td>
					<td><xsl:value-of select="Details" /></td>
        </tr>
      </xsl:for-each>
    </table>
  </xsl:template>

</xsl:stylesheet>
