Added experimental cashflow analysis stylesheet.
[account.git] / cashflow.xsl
diff --git a/cashflow.xsl b/cashflow.xsl
new file mode 100644 (file)
index 0000000..5d6c7f3
--- /dev/null
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+<xsl:strip-space elements="doc chapter section"/>
+<xsl:output method="xml" indent="yes" encoding="iso-8859-1"
+            doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
+            doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"/>
+
+<xsl:template match="balance-sheet">
+<html>
+  <xsl:attribute name='xmlns'>http://www.w3.org/1999/xhtml</xsl:attribute>
+<head>
+</head>
+<body>
+   <h1>Cashflow Analyze voor <xsl:value-of select='../@companyname'/></h1>
+   <h2>Periode van <xsl:value-of select='@begin'/> tot <xsl:value-of select='@end'/></h2>
+
+   <table border='1'>
+   <tr><th>Rekening</th><th colspan='2'>Kosten</th></tr>
+   <tr><th> </th><th>DEBET</th><th>CREDIT</th></tr>
+      <xsl:apply-templates/>
+   <tr>
+   <td><b>TOTAAL</b></td>
+   <td align='right'><b><xsl:value-of select="sum(account[balance='CREDIT']/amount)"/></b></td>
+   <td align='right'><b><xsl:value-of select="sum(account[balance='DEBIT']/amount)"/></b></td>
+   </tr>
+   </table>
+
+</body>
+</html>
+</xsl:template>
+
+<xsl:template match="account[balance='DEBIT']">
+  <tr>
+    <xsl:apply-templates select="name"/>
+    <xsl:apply-templates select='amount'/>
+    <td> </td>
+  </tr>
+</xsl:template>
+
+<xsl:template match="account[balance='CREDIT']">
+  <tr>
+    <xsl:apply-templates select="name"/>
+    <td> </td>
+    <xsl:apply-templates select='amount'/>
+  </tr>
+</xsl:template>
+
+
+<xsl:template match="number"/>
+<xsl:template match="type"/>
+<xsl:template match="balance"/>
+
+<xsl:template match="name">
+  <td><xsl:apply-templates/></td>
+</xsl:template>
+
+<xsl:template match="amount">
+  <td align='right'><xsl:apply-templates/></td>
+</xsl:template>
+
+</xsl:stylesheet>