From 7512f94d087624c8a57210b96d35a813678c1b29 Mon Sep 17 00:00:00 2001 From: Arjen Baart Date: Fri, 5 Nov 2010 11:02:30 +0100 Subject: [PATCH] Added begin and end dates of the booking period 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. --- account.cpp | 18 +++++++++++------- account.h | 4 ++-- account_main.cpp | 4 ++-- balans.xsl | 2 +- profit.xsl | 1 + saldibalans.xsl | 2 +- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/account.cpp b/account.cpp index 9fa1931..ef1d0b8 100644 --- a/account.cpp +++ b/account.cpp @@ -238,12 +238,12 @@ std::ostream& operator<<(std::ostream &s, Ledger &l) return s; } -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.Text(200, 582, "Saldibalans"); + ps.Text(200, 582, header); ps.Line( 16, 595, 16, 40); ps.Line(755, 595, 755, 40); @@ -272,7 +272,7 @@ void Ledger::accounts_report(const char * filename) } } -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; @@ -281,6 +281,10 @@ void Ledger::saldi_report(const char * filename) 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); @@ -294,7 +298,7 @@ void Ledger::saldi_report(const char * filename) if (row == 64) { ps.FontSize(9); - PostScript_balans_layout(ps); + PostScript_balans_layout(ps, header); ps.NewPage(842, 595); ps.FontSize(6); y = 572; @@ -341,7 +345,7 @@ void Ledger::saldi_report(const char * filename) } ps.FontSize(9); - PostScript_balans_layout(ps); + PostScript_balans_layout(ps, header); balance profit; profit = ~Result; @@ -370,13 +374,13 @@ void Ledger::saldi_report(const char * filename) 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 << "\n"; s << "\n"; - s << "\n"; + s << "\n"; for (i=0; i -

Balans

+

Balans per

Bezittingen

diff --git a/profit.xsl b/profit.xsl index fae6ac0..26c44d4 100644 --- a/profit.xsl +++ b/profit.xsl @@ -15,6 +15,7 @@

Winst en Verlies rekening

+

Periode van tot

Opbrengsten

diff --git a/saldibalans.xsl b/saldibalans.xsl index aca4c23..7e0ba7c 100644 --- a/saldibalans.xsl +++ b/saldibalans.xsl @@ -13,7 +13,7 @@

Saldi Balans

- +

Periode van tot

-- 2.11.0
RekeningKostenBalans