<!--                                                                  -->
<!--  Copyright (C) 2006 RoyaltyShare, Inc.   All Rights Reserved     -->
<!--  $Id$  -->
<!--                                                                  -->
<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:template name="payorViewLayout">
		<xsl:call-template name="payorView" />
		<xsl:call-template name="buttons" />
	</xsl:template>

	<xsl:template name="payorView">
		<xsl:call-template name="successMessageGeneral">
			<xsl:with-param name="successMessage">Payor successfully updated!</xsl:with-param>
		</xsl:call-template>

        <div class="InformationCols">
            <div class="InformationCols-item">
                <xsl:call-template name="column1Show" />
            </div>
            <div class="InformationCols-item">
                <xsl:call-template name="column2Show" />
            </div>
        </div>

		<xsl:if test="normalize-space(Form/Payor/ModifiedDate) and normalize-space(Form/Payor/ModifiedBy)">
			<div class="Last-modified HelpText">Last modified <xsl:value-of select="Form/Payor/ModifiedDate" /> by <xsl:value-of select="Form/Payor/ModifiedBy" /></div>
		</xsl:if>
	</xsl:template>

	<xsl:template name="column1Show">
		<table>
			<tr>
				<td class="View-label-payor">Payor</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/Name" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Client Payor #</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/ClientPayorID" />
				</td>
			</tr>
            <xsl:if test="Access/rps/artist_payee/edit = 1">
                <tr>
                    <td class="View-label-payor">Artist payee min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</td>
                    <td class="View-value">
                        <xsl:value-of select="Form/Payor/ArtistPayeeMinPayment" />
                    </td>
                </tr>
            </xsl:if>
            <xsl:if test="Access/rps/label_payee/edit = 1">
                <tr>
                    <td class="View-label-payor">Label payee min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</td>
                    <td class="View-value">
                        <xsl:value-of select="Form/Payor/LabelPayeeMinPayment" />
                    </td>
                </tr>
            </xsl:if>
            <xsl:if test="Access/rps/publisher/edit = 1">
                <tr>
                    <td class="View-label-payor">US Publisher min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</td>
                    <td class="View-value">
                        <xsl:value-of select="Form/Payor/USPublisherMinPayment" />
                    </td>
                </tr>
            </xsl:if>
            <xsl:if test="Access/rps/ca_publisher/edit = 1">
                <tr>
                    <td class="View-label-payor">CA Publisher min payment (<xsl:value-of select="Client/Locale/CurrencyFormat/CurrencyCode" />)</td>
                    <td class="View-value">
                        <xsl:value-of select="Form/Payor/CAPublisherMinPayment" />
                    </td>
                </tr>
            </xsl:if>
			<tr>
				<td class="View-label-payor">Status</td>
				<td class="View-value">
					<xsl:choose>
						<xsl:when test="Form/Payor/Inactive = 1">Inactive</xsl:when>
						<xsl:otherwise>Active</xsl:otherwise>
					</xsl:choose>
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Address 1</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/StreetAddress" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Address 2</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/StreetAddress2" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Address 3</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/StreetAddress3" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">City</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/City" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">State/Province</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/StateProvince" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">ZIP/Postal</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/PostalCode" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Country</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/CountryCode" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">E-mail</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/Email" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Phone</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/PhoneNumber" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Fax</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/FaxNumber" />
				</td>
			</tr>

			<xsl:if test="ClientTypes/ClientType[ClientTypeID = 6]/IsClientTypeFlag = 1">
				<tr>
					<td class="View-label-payor">Payor Supplier Code</td>
					<td class="View-value">
						<xsl:value-of select="Form/Payor/SupplierCode" />
					</td>
				</tr>
				<tr>
					<td class="View-label-payor">AP1 Supplier Code</td>
					<td class="View-value">
						<xsl:value-of select="Form/Payor/AP1SupplierCode" />
					</td>
				</tr>
				<tr>
					<td class="View-label-payor">AVP Supplier Code</td>
					<td class="View-value">
						<xsl:value-of select="Form/Payor/AVPSupplierCode" />
					</td>
				</tr>
				<tr>
					<td class="View-label-payor">DVD1 Supplier Code</td>
					<td class="View-value">
						<xsl:value-of select="Form/Payor/DVD1SupplierCode" />
					</td>
				</tr>
			</xsl:if>
			<tr>
				<td class="View-label-payor">Tax ID</td>
				<td class="View-value">
					<xsl:value-of select="Form/Payor/TaxID" />
				</td>
			</tr>
			<tr>
				<td class="View-label-payor">Comments</td>
				<td class="View-value">
					<xsl:call-template name="replaceLineBreak">
						<xsl:with-param name="string" select="Form/Payor/Comments"/>
					</xsl:call-template>
				</td>
			</tr>
		</table>
	</xsl:template>

    <xsl:template name="column2Show">
        <table>
            <tr>
				<td class="View-label-payor">Display Logo</td>
				<td class="View-value">
					<xsl:choose>
						<xsl:when test="Form/Payor/ShowLogo = 1">Yes</xsl:when>
						<xsl:otherwise>No</xsl:otherwise>
					</xsl:choose>
				</td>
			</tr>
        </table>
    	<div class="ValuePair">
		    <xsl:if test="/Root/Params/logoUpdated = 1">
				<div class="Warning Warning-type-info">
				    <div class="Warning-title">It may take a moment for your logo to appear (you may need to refresh your browser).</div>
				</div>
		    </xsl:if>
			<xsl:if test="normalize-space(Form/Payor/LogoSourceWeb)">
			    <img id="uploadImage" src="{Form/Payor/LogoSourceWeb}?v={/Root/Session}" />
			</xsl:if>
	    </div>
	</xsl:template>

</xsl:stylesheet>
