<!--                                                                  -->
<!--  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="ukMechNegativeUnitsLayout">
        <div class="AuditReport" id="auditReport">
            <xsl:choose>
                <xsl:when test="Report/Product">
                    <xsl:call-template name="ukMechNegativeUnitsDisplay" />
                </xsl:when>
                <xsl:otherwise>
                    <xsl:call-template name="ukMechNegativeUnitsHeading" />
                    <section class="Table-empty-results">
                        <p>No products have a negative unit balance in this period.</p>
                    </section>
                </xsl:otherwise>
            </xsl:choose>
            <xsl:call-template name="backToUKMechRun" />
        </div>
    </xsl:template>

    <xsl:template name="ukMechNegativeUnitsDisplay">
        <xsl:call-template name="ukMechNegativeUnitsHeading" />
        <xsl:call-template name="reportHeading" />
        <xsl:call-template name="ukMechNegativeUnitsTable" />
        <xsl:call-template name="reportFooter" />
    </xsl:template>

    <xsl:template name="ukMechNegativeUnitsHeading">
        <h2 class="AuditReport-header">
            Products with Negative Unit Balance
            <xsl:call-template name="helpIcon">
                <xsl:with-param name="tip">
                    Lists physical products that have a negative unit balance in this UK mechanical statement run.
                </xsl:with-param>
            </xsl:call-template>
        </h2>
    </xsl:template>

    <xsl:template name="ukMechNegativeUnitsTable">
        <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&#160;Title</th>
                    <th class="Table-col">Artist</th>
                    <th class="Table-col">Product</th>
                    <th class="Table-col">Product ID</th>
                    <th class="Table-col">Country</th>
                    <th class="Table-col Table-col-amount">Price</th>
                    <th class="Table-col Table-col-amount">Units</th>
                </tr>
            </thead>
            <tbody>
                <xsl:for-each select="Report/Product">
                    <tr class="Table-row Table-row-data">
                        <td class="Table-col">
                            <xsl:value-of select="CatalogNumber" />
                        </td>
                        <td class="Table-col">
                            <a href="/rps/catalog?c=show&amp;AlbumID={AlbumID}"><xsl:value-of select="AlbumTitle" /></a>
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="ArtistName" />
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="ProductType" />
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="ProductCode" />
                        </td>
                        <td class="Table-col">
                            <xsl:value-of select="CountryCode" />
                        </td>
                        <td class="Table-col Table-col-amount">
                            <xsl:value-of select="Price" />
                        </td>
                        <td class="Table-col Table-col-amount">
                            <xsl:value-of select="Units" />
                        </td>
                    </tr>
                </xsl:for-each>
            </tbody>
        </table>
    </xsl:template>

</xsl:stylesheet>
