Added experimental cashflow analysis stylesheet.
authorArjen Baart <arjen@andromeda.nl>
Mon, 27 Dec 2010 15:40:51 +0000 (16:40 +0100)
committerArjen Baart <arjen@andromeda.nl>
Mon, 27 Dec 2010 15:40:51 +0000 (16:40 +0100)
account.cpp
account_main.cpp
cashflow.xsl [new file with mode: 0644]
makefile

index 2ed692c..39e9031 100644 (file)
@@ -59,7 +59,7 @@ std::ostream &operator<<(std::ostream &s, amount a)
    else
    {
       //s << form("%8d.%02d",a / 100, a % 100);
-      s << std::setw(8) << a / 100 << ".";
+      s << std::setw(8) << std::setfill(' ') << a / 100 << ".";
       s << std::setw(2) << std::setfill('0') << a % 100;
       s << std::setw(0) << std::setfill(' ');
    }
index fe69b86..84c1e8c 100644 (file)
@@ -50,7 +50,7 @@ main(int argc, char *argv[])
          break;
 
       case 'V':
-         std::cout << "account version 1.3.3\n";
+         std::cout << "account version 1.3.4\n";
          exit(0);
          break;
 
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>
index 5c78f0c..90bf27b 100644 (file)
--- a/makefile
+++ b/makefile
@@ -21,7 +21,7 @@ postscript.o : postscript.h
 install  : account bank
        cp account bank /usr/local/bin
        mkdir -p /usr/local/xslt
-       cp balans.xsl profit.xsl saldibalans.xsl /usr/local/xslt
+       cp balans.xsl profit.xsl saldibalans.xsl cashflow.xsl /usr/local/xslt
        mkdir -p /usr/local/share/afm
        cp Courier.afm /usr/local/share/afm