The begin date and end date of the bookings are obtained from the
first and the last booking in the journal file. These dates
are subsequntly used in both the XML and Postscript saldi reports.
-void PostScript_balans_layout(PostScript &ps)
+void PostScript_balans_layout(PostScript &ps, String header)
{
ps.Line(16, 595, 755, 595);
ps.Line(16, 580, 755, 580);
ps.Line(16, 40, 755, 40);
{
ps.Line(16, 595, 755, 595);
ps.Line(16, 580, 755, 580);
ps.Line(16, 40, 755, 40);
- ps.Text(200, 582, "Saldibalans");
+ ps.Text(200, 582, header);
ps.Line( 16, 595, 16, 40);
ps.Line(755, 595, 755, 40);
ps.Line( 16, 595, 16, 40);
ps.Line(755, 595, 755, 40);
-void Ledger::saldi_report(const char * filename)
+void Ledger::saldi_report(const char * filename, date period_begin, date period_end)
{
PostScript ps(filename);
balance total, saldi;
{
PostScript ps(filename);
balance total, saldi;
float y = 572;
int row = 0;
float y = 572;
int row = 0;
+ String header("Saldibalans");
+
+ header += " van " + period_begin.format("%e %B %Y") + " tot " + period_end.format("%e %B %Y");
+
ps.NewPage(842, 595);
ps.FontSize(6);
ps.NewPage(842, 595);
ps.FontSize(6);
if (row == 64)
{
ps.FontSize(9);
if (row == 64)
{
ps.FontSize(9);
- PostScript_balans_layout(ps);
+ PostScript_balans_layout(ps, header);
ps.NewPage(842, 595);
ps.FontSize(6);
y = 572;
ps.NewPage(842, 595);
ps.FontSize(6);
y = 572;
- PostScript_balans_layout(ps);
+ PostScript_balans_layout(ps, header);
balance profit;
profit = ~Result;
balance profit;
profit = ~Result;
ps.Text(690, y, EndBalance.credit().to_string());
}
ps.Text(690, y, EndBalance.credit().to_string());
}
-void Ledger::XML_saldi(std::ostream &s)
+void Ledger::XML_saldi(std::ostream &s, date period_begin, date period_end)
{
int i;
s << "<?xml version='1.0'?>\n";
s << "<accounting>\n";
{
int i;
s << "<?xml version='1.0'?>\n";
s << "<accounting>\n";
- s << "<balance-sheet>\n";
+ s << "<balance-sheet begin='" << period_begin << "' end='" << period_end << "'>\n";
for (i=0; i<nr_accs; i++)
{
balance saldo = ~balance(accs[i]);
for (i=0; i<nr_accs; i++)
{
balance saldo = ~balance(accs[i]);
friend std::ostream & operator<<(std::ostream &, Ledger&);
void accounts_report(const char *);
friend std::ostream & operator<<(std::ostream &, Ledger&);
void accounts_report(const char *);
- void saldi_report(const char *);
- void XML_saldi(std::ostream &);
+ void saldi_report(const char *, date period_begin, date period_end);
+ void XML_saldi(std::ostream &, date period_begin, date period_end);
- ledger.saldi_report("saldibalans.ps");
+ ledger.saldi_report("saldibalans.ps", date(b[0]), date(b[n_b-1]));
std::ofstream saldi("saldi.xml");
std::ofstream saldi("saldi.xml");
- ledger.XML_saldi(saldi);
+ ledger.XML_saldi(saldi, date(b[0]), date(b[n_b-1]));
}
void read_journal(char *journal_file)
}
void read_journal(char *journal_file)
+ <h1>Balans per <xsl:value-of select='@end'/></h1>
<h2>Bezittingen</h2>
<table>
<h2>Bezittingen</h2>
<table>
</head>
<body>
<h1>Winst en Verlies rekening</h1>
</head>
<body>
<h1>Winst en Verlies rekening</h1>
+ <h2>Periode van <xsl:value-of select='@begin'/> tot <xsl:value-of select='@end'/></h2>
<h2>Opbrengsten</h2>
<table>
<h2>Opbrengsten</h2>
<table>
</head>
<body>
<h1>Saldi Balans</h1>
</head>
<body>
<h1>Saldi Balans</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><th colspan='2'>Balans</th></tr>
<table border='1'>
<tr><th>Rekening</th><th colspan='2'>Kosten</th><th colspan='2'>Balans</th></tr>