<?xml version="1.0" encoding="UTF-8"?>
<!-- XSLT-шаблоны для печати, отправки на e-mail: Детализированный баланс на e-mail и html -->
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" encoding="UTF-8" indent="yes"/>

<xsl:template match="/data">
<html>
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
</head>

<body>
<style type="text/css">
	td { padding: 1px 3px; }
	tr.row td:nth-child(1) { text-align: center; }
	tr.row td:nth-child(5) { text-align: right; }
	tr.row td:nth-child(6) { text-align: right; }
</style>
    <center>
    	<h2>Отчет по балансу<br/>Контракт:&#160;<xsl:value-of select="@contractTitle"/>(<xsl:value-of select="@comment"/>)</h2>
         Период с: <xsl:value-of select="@date1"/> по <xsl:value-of select="@date2"/><br/><br/>
     </center>
    <xsl:call-template name="main"/><br/>
</body>
</html>
</xsl:template>

<xsl:template name="main">
<table width="100%" border="1" cellspacing="0" cellpadding="0">

<xsl:for-each select="/data/month">
	<tr bgcolor="#f0f0f0">
	     <td nowrap="1" colspan="6" style="font-weight: bold;"><i><xsl:value-of select="@title"/></i></td>
	</tr>
	<xsl:for-each select="row">
		<tr class="row">
			<td><xsl:value-of select="@date"/></td>
			<td><xsl:value-of select="@contractTitle"/></td>
			<td><xsl:value-of select="@type"/></td>
			<td><xsl:value-of select="@comment"/></td>
			<td><xsl:value-of select="@summa"/></td>
			<td><xsl:value-of select="@summAfterCharge"/></td>
		</tr>
	</xsl:for-each>
</xsl:for-each>

</table>
</xsl:template>


</xsl:stylesheet>
