Bug fixes in Ledger::read()
[account.git] / cashflow.xsl
1 <?xml version="1.0"?>
2 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
3
4 <xsl:strip-space elements="doc chapter section"/>
5 <xsl:output method="xml" indent="yes" encoding="iso-8859-1"
6             doctype-system="http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"
7             doctype-public="-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"/>
8
9 <xsl:template match="balance-sheet">
10 <html>
11   <xsl:attribute name='xmlns'>http://www.w3.org/1999/xhtml</xsl:attribute>
12 <head>
13 </head>
14 <body>
15    <h1>Cashflow Analyze voor <xsl:value-of select='../@companyname'/></h1>
16    <h2>Periode van <xsl:value-of select='@begin'/> tot <xsl:value-of select='@end'/></h2>
17
18    <table border='1'>
19    <tr><th>Rekening</th><th colspan='2'>Kosten</th></tr>
20    <tr><th> </th><th>DEBET</th><th>CREDIT</th></tr>
21       <xsl:apply-templates/>
22    <tr>
23    <td><b>TOTAAL</b></td>
24    <td align='right'><b><xsl:value-of select="sum(account[balance='CREDIT']/amount)"/></b></td>
25    <td align='right'><b><xsl:value-of select="sum(account[balance='DEBIT']/amount)"/></b></td>
26    </tr>
27    </table>
28
29 </body>
30 </html>
31 </xsl:template>
32
33 <xsl:template match="account[balance='DEBIT']">
34   <tr>
35     <xsl:apply-templates select="name"/>
36     <xsl:apply-templates select='amount'/>
37     <td> </td>
38   </tr>
39 </xsl:template>
40
41 <xsl:template match="account[balance='CREDIT']">
42   <tr>
43     <xsl:apply-templates select="name"/>
44     <td> </td>
45     <xsl:apply-templates select='amount'/>
46   </tr>
47 </xsl:template>
48
49
50 <xsl:template match="number"/>
51 <xsl:template match="type"/>
52 <xsl:template match="balance"/>
53
54 <xsl:template match="name">
55   <td><xsl:apply-templates/></td>
56 </xsl:template>
57
58 <xsl:template match="amount">
59   <td align='right'><xsl:apply-templates/></td>
60 </xsl:template>
61
62 </xsl:stylesheet>