After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 574582 - eguile-like template processor for easier report writing
eguile-like template processor for easier report writing
Status: RESOLVED FIXED
Product: GnuCash
Classification: Other
Component: Reports
git-master
Other All
: Normal enhancement
: ---
Assigned To: Andreas Köhler
Andreas Köhler
Depends on:
Blocks:
 
 
Reported: 2009-03-08 20:03 UTC by Chris Dennis
Modified: 2018-06-29 22:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GnuCash-specific version of eguile.scm (6.71 KB, text/x-scheme)
2009-03-08 20:07 UTC, Chris Dennis
Details
Tax invoice using eguile-gnc via template taxinvoice.eguile.scm (7.39 KB, text/x-scheme)
2009-03-08 21:20 UTC, Chris Dennis
Details
eguile-gnc template for use with taxinvoice.scm (19.63 KB, text/x-scheme)
2009-03-08 21:23 UTC, Chris Dennis
Details
Sample invoice (109.16 KB, application/pdf)
2009-03-14 16:11 UTC, Chris Dennis
Details
GnuCash-specific version of eguile.scm - amended (6.81 KB, text/x-scheme)
2009-03-28 15:19 UTC, Chris Dennis
Details
Tax invoice report using eguile-gnc - amended (7.48 KB, text/x-scheme)
2009-03-28 15:22 UTC, Chris Dennis
Details
Tax invoice report using eguile-gnc - amended (12.41 KB, text/x-scheme)
2009-05-27 00:47 UTC, Chris Dennis
Details
Tax invoice report template - amended (15.57 KB, text/x-scheme)
2009-05-27 00:51 UTC, Chris Dennis
Details
Sample invoice (30.65 KB, application/pdf)
2009-05-27 00:52 UTC, Chris Dennis
Details
GnuCash-specific version of eguile.scm - amended (7.74 KB, text/x-scheme)
2009-06-19 22:45 UTC, Chris Dennis
Details
Balance sheet report using eguile (34.96 KB, text/x-scheme)
2009-06-19 22:47 UTC, Chris Dennis
Details
Balance sheet report -- template file (11.33 KB, text/x-scheme)
2009-06-19 22:48 UTC, Chris Dennis
Details
Balance sheet report -- CSS file (1.21 KB, text/css)
2009-06-19 22:48 UTC, Chris Dennis
Details
Balance sheet report -- sample output (119.21 KB, application/pdf)
2009-06-19 22:49 UTC, Chris Dennis
Details
Balance sheet report using eguile - corrected (34.96 KB, text/x-scheme)
2009-07-01 01:03 UTC, Chris Dennis
Details
Balance sheet report using eguile - correction no. 2 (35.08 KB, text/x-scheme)
2009-07-01 09:21 UTC, Chris Dennis
Details

Description Chris Dennis 2009-03-08 20:03:22 UTC
Using a template processor like eguile would make it easier to write new GnuCash reports.
Comment 1 Chris Dennis 2009-03-08 20:07:07 UTC
Created attachment 130302 [details]
GnuCash-specific version of eguile.scm

This is my version of Neale Pickett's eguile.scm.

It allows GnuCash reports to be created that get most of their HTML from a template file with embedded Guile code that supplies values and iterates over loops (e.g. invoice entries).

I will attach a sample report soon.
Comment 2 Chris Dennis 2009-03-08 21:20:08 UTC
Created attachment 130305 [details]
Tax invoice using eguile-gnc via template taxinvoice.eguile.scm
Comment 3 Chris Dennis 2009-03-08 21:23:25 UTC
Created attachment 130306 [details]
eguile-gnc template for use with taxinvoice.scm
Comment 4 Chris Dennis 2009-03-08 21:33:48 UTC
To try out the report, you need to put eguile-gnc.scm into the same folder as invoice.scm (on my system that's /usr/share/gnucash/guile-modules/gnucash/report/eguile-gnc.scm).

Install taxinvoice.scm in the usual way (see http://wiki.gnucash.org/wiki/Custom_Reports).  Put taxinvoice.eguile.scm in the same place, but note that it's location is an option in taxinvoice.scm -- it can be changed either in the source code, or from the report's option menu.   I'm not convinced that this is the best way to include the file name for the template -- suggestions for improvements are welcome.

The report should then show up in 'Sample & Custom' report sub-menu.

I've developed this on Ubuntu Intrepid, using the SVN Trunk version of GnuCash, with Guile 1.6.

taxinvoice.scm includes code to display individual taxes on a per-entry basis, i.e. on each line of the invoice.  This relies on a fix to the Swig encoding that is currently in the pipeline as bug #573645, but it includes a work-around so that it simply misses out the extra columns if that fix hasn't been applied.

Please give it a go and let me know how you get on.
Comment 5 Chris Dennis 2009-03-14 16:11:10 UTC
Created attachment 130661 [details]
Sample invoice

I've attached a PDF file of a sample invoice created using eguile and the taxinvoice.scm report.
Comment 6 Chris Dennis 2009-03-28 15:19:38 UTC
Created attachment 131565 [details]
GnuCash-specific version of eguile.scm - amended

Corrections: added 'use-modules' and 'export' lines.
Comment 7 Chris Dennis 2009-03-28 15:22:10 UTC
Created attachment 131566 [details]
Tax invoice report using eguile-gnc - amended

Corrections -- added 'use-modules' lines.
Comment 8 Chris Dennis 2009-05-27 00:47:25 UTC
Created attachment 135413 [details]
Tax invoice report using eguile-gnc - amended

New improved version.
Comment 9 Chris Dennis 2009-05-27 00:51:43 UTC
Created attachment 135414 [details]
Tax invoice report template - amended

New improved version.
Comment 10 Chris Dennis 2009-05-27 00:52:46 UTC
Created attachment 135415 [details]
Sample invoice

New improved version.
Comment 11 Chris Dennis 2009-06-19 22:45:57 UTC
Created attachment 137040 [details]
GnuCash-specific version of eguile.scm - amended

New version with better error reporting.
Comment 12 Chris Dennis 2009-06-19 22:47:19 UTC
Created attachment 137041 [details]
Balance sheet report using eguile

Uses template balsheet-eg.eguile.scm and CSS stylesheet balsheet-eg.css
Comment 13 Chris Dennis 2009-06-19 22:48:11 UTC
Created attachment 137042 [details]
Balance sheet report -- template file

For use with balsheet-eg.scm
Comment 14 Chris Dennis 2009-06-19 22:48:44 UTC
Created attachment 137043 [details]
Balance sheet report -- CSS file

For use with balsheet-eg.scm
Comment 15 Chris Dennis 2009-06-19 22:49:23 UTC
Created attachment 137044 [details]
Balance sheet report -- sample output

Sample output from balsheet-eg.scm
Comment 16 Phil Longstaff 2009-06-21 22:23:21 UTC
Comment on attachment 137040 [details]
GnuCash-specific version of eguile.scm - amended

eguile.scm committed as r18150
Comment 17 Chris Dennis 2009-07-01 01:03:09 UTC
Created attachment 137664 [details]
Balance sheet report using eguile - corrected
Comment 18 Chris Dennis 2009-07-01 09:21:56 UTC
Created attachment 137674 [details]
Balance sheet report using eguile - correction no. 2
Comment 19 Chris Dennis 2009-07-02 10:25:17 UTC
The core component eguile-gnc.scm has been commited as r18151.

Sample reports are now available on the wiki at http://wiki.gnucash.org/wiki/Custom_Reports_Using_Eguile

So this bug is effectively fixed.
Comment 20 John Ralls 2018-06-29 22:19:12 UTC
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=574582. Please update any external references or bookmarks.