<!--                                                                  -->
<!--  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="AuditReport" id="auditReport">

            <h2 class="AuditReport-header">
                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:choose>
                <xsl:when test="Report/MissedSale">
                    <xsl:call-template name="reportHeading" />
                    <xsl:call-template name="missedSalesTable" />
                    <xsl:call-template name="reportFooter" />
                </xsl:when>
                <xsl:otherwise>
                    <section class="Table-empty-results">
                        <p>No missed sales were found.</p>
                    </section>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="backToArtistRun" />
        </div>
    </xsl:template>

    <xsl:template name="missedSalesTable">
        <table class="Table Table-with-highlight">
            <thead>
                <tr class="Table-row Table-row-header">
                    <th class="Table-col">Catalog&#160;#</th>
                    <th class="Table-col">Album/Artist</th>
                    <th class="Table-col">Track/Artist</th>
                    <th class="Table-col">Contract</th>
                    <th class="Table-col">Product/Format</th>
                    <xsl:choose>
                        <xsl:when test="Report/MissedSale/GrossRevenue">
                            <th class="Table-col Table-col-amount">
                                Net Revenue/Units
                                <xsl:call-template name="helpIcon">
                                    <xsl:with-param name="tip">
                                        The revenue shown here is the Net revenue.
                                        The Gross revenue associated with the
                                        unallocated sales can be found in the
                                        download text file.
                                    </xsl:with-param>
                                </xsl:call-template>
                            </th>
                        </xsl:when>
                        <xsl:otherwise>
                            <th class="Table-col Table-col-amount">Revenue/Units</th>
                        </xsl:otherwise>
                    </xsl:choose>
                    <th class="Table-col">Reason</th>
                    <th class="Table-col">Details</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="Report/MissedSale">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col">
                            <xsl:value-of select="CatalogNumber" />
                        </td>
                        <td class="Table-col">
                            <a href="catalog?c=show&amp;AlbumID={AlbumID}">
                                <xsl:value-of select="AlbumTitle" />
                            </a>
                            <br />
                            <xsl:value-of select="AlbumArtist" />
                        </td>
                        <td class="Table-col">
                            <a href="track?c=show&amp;TrackID={TrackID}">
                                <xsl:value-of select="TrackTitle" />
                            </a>
                            <br />
                            <xsl:value-of select="TrackArtist" />
                        </td>
                        <td class="Table-col">
                            <a href="artist_contract?c=show&amp;ArtistContractID={ArtistContractID}"><xsl:value-of select="ArtistContractTitle" /></a>
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="ProductType" />
                            <br/>
                            <xsl:value-of select="FormatType" />
                        </td>
                        <td class="Table-col Table-col-amount">
                            <xsl:value-of select="TotalRevenue" />
                            <br />
                            <xsl:value-of select="Units" />
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="Reason" />
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="Details" />
                        </td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>

</xsl:stylesheet>
