﻿<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

  <xsl:template match="/">
    <html>
      <head>
      </head>
      <body>
        <!-- Report header -->

        <table>
          <tr style="padding-top:20px; padding-bottom: 25px;height: 17px;">
            <td style="font-size:14pt; border:0px;font-family: Segoe UI; font-weight: semibold; white-space:nowrap; padding:2px;">
              <b>
                <xsl:value-of select="/Document/@ReportHeader" />
              </b>
            </td>
          </tr>
          <tr>
            <td style="font-size:11pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding-top:20px; padding-left:2px;padding-bottom: 25px">
              License information
            </td>
          </tr>
        </table>

        <!-- License information -->
        <table width="400px">
          <tr style="padding-top:20px; padding-bottom: 5px;height: 17px;">
            <tr>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                Edition
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="/Document/@Edition" />
              </td>
            </tr>
            <tr>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                Expiration Date
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="/Document/@ExpirationDate" />
              </td>
            </tr>
            <tr>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                Company
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="/Document/@Company" />
              </td>
            </tr>
            <tr>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                Support ID
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="/Document/@SupportId" />
              </td>
            </tr>
          </tr>
        </table>

        <!-- START summary. -->
        <table cellspacing="0" cellpadding="0" width="600px" border="0" style="border-collapse: collapse;">
          <tr>
            <td style="font-size:11pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding-left:2px;padding-top:20px;padding-bottom: 25px">
              Summary
            </td>
          </tr>

          <tr>
            <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; background-color: #a7a7a7; padding:2px; font-weight:bold">
              Type
            </td>
            <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; background-color: #a7a7a7; padding:2px; font-weight:bold">
              Count
            </td>
            <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; background-color: #a7a7a7; padding:2px; font-weight:bold">
              Multiplier
            </td>
            <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; background-color: #a7a7a7; padding:2px; font-weight:bold">
              Instances
            </td>
          </tr>

          <xsl:for-each select="/Document/SummaryInfo">
            <tr>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                  <xsl:value-of select="./@TypeName" />
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="./@ObjectsCount" />
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="./@Multiplier" />
              </td>
              <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                <xsl:value-of select="./@InstancesCount" />
              </td>
            </tr>
          </xsl:for-each>
          <tr>
            <td/>
            <td/>
            <td/>
            <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; background-color: #a7a7a7; padding:2px;">
              <xsl:value-of select="/Document/@TotalInstances" />
            </td>
          </tr>
        </table>

       <!-- START PerVm. -->

        <xsl:for-each select="/Document/PerVmTable">
          <xsl:choose>
            <xsl:when test="./@BackupServer != ''">
              <p style="font-family: Segoe UI; font-size: 11pt; padding-bottom:5px;">
                <xsl:value-of select="./@BackupServer" /> (<xsl:value-of select="./@TotalInstances" /> 
	              <xsl:choose>
		              <xsl:when test="(./@TotalInstances = 1)">
			              instance)
		              </xsl:when>
		              <xsl:otherwise>
			              instances)
		              </xsl:otherwise>
	              </xsl:choose>
              </p>
            </xsl:when>
          </xsl:choose>

          <xsl:for-each select="./Counter">
            <xsl:if test="count(./Machine) > 0 or (./@Note != '')">
              <table>
                <tr>
                  <td style="width:350px;font-family: Segoe UI; font-size: 11pt; white-space:nowrap; padding-left:2px;padding-top:30px; padding-bottom:20px">
                    <xsl:value-of select="./@InstanceTypeName" /> (<xsl:value-of select="./@InstancesCount" /> 
	                  <xsl:choose>
		                  <xsl:when test="(./@InstancesCount = 1)">
			                  instance)
		                  </xsl:when>
		                  <xsl:otherwise>
			                  instances)
		                  </xsl:otherwise>
	                  </xsl:choose>
                  </td>
                </tr>
              </table>
            </xsl:if>

            <xsl:if test="count(./Machine) > 0">
              <table cellspacing="0" cellpadding="0" width="100%" border="0" style="border-collapse: collapse;">
                <tr style="background-color: #a7a7a7; font-weight:bold;height: 17px;">
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=25%">
                    Name
                  </td>
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=5%">
                    Count
                  </td>
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=10%">
                    Type
                  </td>
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=25%">
                    Job name
                  </td>
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=15%">
                    Last processed
                  </td>
                  <td style="font-family: Segoe UI; font-size: 9pt; font-weight: semibold; white-space:nowrap; border:1px solid #a7a7a7; padding:2px; width=20%">
                    Note
                  </td>
                </tr>
            
              <xsl:for-each select="./Machine">
                <tr>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=25%">
                    <xsl:value-of select="./@MachineName" />
                  </td>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=5%">
                    <xsl:value-of select="./@InstanceCount" />
                  </td>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=10%">
                    <xsl:value-of select="./@MachineType" />
                  </td>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=25%">
                    <xsl:value-of select="./@JobName" />
                  </td>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=15%">
                    <xsl:value-of select="./@LastBackupDate" />
                  </td>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; font-weight: semibold;white-space:nowrap; padding:2px; width=20%">
                    <xsl:value-of select="./@Note" />
                  </td>
                </tr>
              </xsl:for-each>
            </table>
            </xsl:if>

          <xsl:choose>
            <xsl:when test="(./@Note != '') or (./@NewInstancesNote != '')">
              <table>
                <tr>
                  <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding-top:20px; padding-left:2px">
                    <b>Note: </b>  <xsl:value-of select="./@NewInstancesNote" /> <xsl:value-of select="./@Note" />
                  </td>
                </tr>
              </table>
            </xsl:when>
          </xsl:choose>
          

        </xsl:for-each>
        </xsl:for-each>

        <!-- START Cloud -->

        <xsl:if test="count(/Document/CloudTable/CloudCounter) > 0">
          <!--<xsl:if test="count(/Document/PerVmTable) > 0">
            <br/>
            <br/>
          </xsl:if>-->

          <xsl:for-each select="/Document/CloudTable/CloudCounter">

            <xsl:if test="(./@InstancesCount > 0) or (./Tenant/@Note != '')">
              
              <table>
                <td style="font-family: Segoe UI; font-size: 11pt; white-space:nowrap; padding-left:2px; padding-bottom:20px; padding-top:30px">
					<xsl:value-of select="./@InstanceTypeName" /> (<xsl:value-of select="./@InstancesCount" />
		                <xsl:choose>
			                <xsl:when test="(./@InstancesCount = 1)">
								instance)
							</xsl:when>
			                <xsl:otherwise>
				                instances)
							</xsl:otherwise>
						</xsl:choose>
				</td>
              </table>

              <table cellspacing="0" cellpadding="0" width="100%" border="0" style="border-collapse: collapse; padding-bottom:20px; padding-top:30px">
              <tr style="background-color: #a7a7a7; font-weight:bold;height: 17px;">
                <td style="width: 40%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; border:1px solid #a7a7a7; padding:2px;">
                  User
                </td>
                <td style="width: 20%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; border:1px solid #a7a7a7; padding:2px;">
                  Instance Count
                </td>
                <td style="width: 40%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; border:1px solid #a7a7a7; padding:2px;">
                  Note
                </td>
              </tr>
              
                <xsl:for-each select="./Tenant">
                  <tr bgcolor="#ffffff">
                    <td style="width: 40%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; padding:2px;">
                      <xsl:value-of select="./@User" />
                    </td>
                    <td style="width: 20%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; padding:2px;">
                      <xsl:value-of select="./@InstancesCount" />
                    </td>
                    <td style="width: 40%; font-family: Segoe UI; font-size: 9pt; white-space:nowrap; padding:2px;">
                      <xsl:value-of select="./@Note" />
                    </td>
                  </tr>
                </xsl:for-each>
              </table>

              <!--START Cloud PerVMs trial info-->
              <xsl:choose>
                <xsl:when test="(./@Note != '') or (./@NewInstancesNote != '')">
                  <table>
                    <tr style="padding-top:20px;height: 17px;">
                      <td style="font-size:9pt; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px; padding-top: 20px">
                        <b>Note: </b>  <xsl:value-of select="./@NewInstancesNote" /> <xsl:value-of select="./@Note" />
                      </td>
                    </tr>
                  </table>
                </xsl:when>
              </xsl:choose>

            </xsl:if>
          </xsl:for-each>
        </xsl:if>

         <!--START Signature--> 
        <table>
          <xsl:choose>
            <xsl:when test="/Document/WriteSignature = 'true'">
              <tr style="padding-top:20px;height: 17px;">
                <td style="font-size:9pt;color:#626365; border:0px;font-family: Segoe UI; white-space:nowrap; padding:2px;">
                  Veeam Backup &amp; Replication <xsl:value-of select="/Document/Shell_App_Version" />
                </td>
              </tr>
            </xsl:when>
          </xsl:choose>
        </table>
      </body>
    </html>

  </xsl:template>

</xsl:stylesheet>
