<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--                                                                  -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0" xmlns:dyn="http://exslt.org/dynamic" extension-element-prefixes="dyn">

	<xsl:variable name="mapProductType" select="/Root/Form/MapFaceTempMapping/ProductType" />

	<xsl:variable name="isPhysicalProduct">
		<xsl:choose>
			<xsl:when test="normalize-space($saleProductType) and $saleProductType != 'A' and $saleProductType != 'T'">1</xsl:when>
			<xsl:when test="normalize-space($mapProductType) and $mapProductType != 'A' and $mapProductType != 'T'">1</xsl:when>
			<xsl:otherwise>0</xsl:otherwise>
		</xsl:choose>
	</xsl:variable>

	<xsl:template name="saleRow">
		<xsl:param name="ajax" select="'0'" />
		<tr>
			<td>
				<xsl:value-of select="LineNum" />
			</td>
			<td>
				<xsl:value-of select="ArtistName" />
			</td>
			<td>
				<xsl:value-of select="AlbumName" />
			</td>
			<td>
				<xsl:value-of select="TrackName" />
			</td>
			<td>
				<xsl:value-of select="ISRC" />
			</td>
			<td>
				<xsl:value-of select="UPC" />
			</td>
			<td>
				<xsl:choose>
					<xsl:when test="$isPhysicalProduct = 1">
						<xsl:value-of select="Sales - Returns" />
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="Units" />
					</xsl:otherwise>
				</xsl:choose>
			</td>
			<xsl:if test="$isPhysicalProduct != 1">
				<td>
					<xsl:value-of select="PriceSmart" />
				</td>
			</xsl:if>
			<xsl:if test="$isPhysicalProduct = 1">
				<td>
					<xsl:value-of select="RevenuePretty" />
				</td>
			</xsl:if>
		</tr>
	</xsl:template>

</xsl:stylesheet>
