Limitations of XSL. XSL can only do so much. Converting to file formats of a similar structure and layout is relatively simple and problem-free. Converting to file formats or objects that require multiple calculations or associating data within objects of different types is less reliable. An example is the invoice XSL: It works OK for simple invoices (one client per day, one expense, one mileage claim per invoice) but fails with more complex invoices.
Modules. Data Freedom perl scripts use these Perl modules which might not be installed on your system:
These modules are dependencies of datafreedom-perl.
Currently, the perl scripts are not as complete as the XSL but work is progressing. Feel free to contribute any improvements via the QOF-devel mailing list.
http://lists.sourceforge.net/lists/listinfo/qof-devel
datafreedom-perl includes a variety of scripts to summarise or report on various types of supported data, including mileage claims (via gpe-expenses or pilot-qof) and invoices (pilot-qof). These scripts developed from the 'pilot-qof' package but now include support for other packages and formats and will continue to be extended along the lines of http://www.data-freedom.org/ - liberating user data from the application. Therefore, the datafreedom scripts use a 'df' prefix.
The scripts continue to be developed within the pilot-qof CVS until such time as the scripts are sufficiently cohesive to form a new source package. The scripts are part of the datafreedom-perl package in Debian/Ubuntu and are installed in your main system path. Please refer to the manpage for each script for full information.
dfxml-invoice
dfxml-invoice parses a QSF XML file output by pilot-qof
and prepares a simple invoice based on rates specified
in ~/.datafreedom/currency
which will be
created for you.
Specify '-' as the filename to parse STDIN.
Example 7.1. Creating plain text invoices with perl
pilot-qof -x data.xml --invoice-city -t 2006-11-09 | dfxml-invoice -
Example 7.2. Creating invoices in a Gnome dialogue box
A more complex example using 'zenity' - a Gnome dialog generator.
$ pilot-qof -x data.xml --invoice-city -t 2006-11-08 | dfxml-invoice - > /tmp/zenity zenity --text-info --title="2006-11-08" --filename=/tmp/zenity --width=500 --height=300
dfxml-invoice, like pilot-qof
,
is designed to be used in pipes like this. It is intended to provide support
for your own scripts where details like the date can be set as an option:
Example 7.3. Setting the date of the invoice as an option.
#!/bin/bash DATE=$1 if [ ! $DATE ]; then echo "$0: please specify the date of the invoice you want to view." exit fi pilot-qof -x data.xml --invoice-city -t $DATE | dfxml-invoice - | \ zenity --text-info --title="$DATE" --width=500 --height=300
dfxml-mileage
dfxml-mileage parses a QSF XML file output
by pilot-qof
and prepares a simple summary of the
mileage claims within the file.
Specify '-' as the filename to parse STDIN.
Example 7.4. Creating plain text mileage summaries
e.g.
pilot-qof -x data.xml -d pilot_expenses -t 2006-11 | dfxml-mileage -
dfvcard-pilotaddress
dfvcard-pilotaddress parses a vCard file and prepares a QSF XML file suitable for pilot-qof or datafreedom-qsfxsl.
Specify '-' as the filename to parse STDIN.
dfical-datebook
dfical-datebook parses an iCal file and prepares a QSF XML file suitable for pilot-qof or datafreedom-qsfxsl.
Specify '-' as the filename to parse STDIN.
dfvtodo-pilotttodo
dfvtodo-pilotttodo parses a vTodo file and prepares a QSF XML file suitable for pilot-qof or datafreedom-qsfxsl.
Specify '-' as the filename to parse STDIN.
dfsqlite-pilottodo
dfsqlite-pilottodo reads a gpe-todo
SQLite database and creates records suitable for pilot-qof
-d pilot_todo
. Records can be inserted into a suitable SQLite
database (which can be created for you) or output to stdout as QSF XML.
Pass the filename for the pilot-qof
SQLite
database. XML output does not use an export filename.
The gpe-todo
input data file is set as
~/.gpe/todo
.
Example scripts in /usr/share/doc/. To reduce dependencies, some scripts are provided as examples and are not installed to privileged system folders within your PATH.
zenity-invoice
zenity-invoice is an example script to provide
a simple GUI for invoice generation using dfxml-invoice
.
zenity-invoice depends on
pilot-qof
and zenity
.
zenity-invoice needs a 'workdir: /path/' setting
to be added to ~/.datafreedom/currency
. Specify a
path to your main pilot-qof data file - the file must contain records
suitable for pilot-qof
--invoice-city
,
i.e. records from pilot_address and pilot_datebook. Records from pilot_expenses
are handled, if present. pilot_todo records are omitted.
Currently the script also assumes that your main pilot-qof
data file is called offline.xml
- feel free to tweak this.
zenity-invoice is part of
datafreedom-perl
and is usually installed at
/usr/share/doc/datafreedom-perl/zenity-invoice
.
If you want to create a panel applet to execute the script from
that location, use:
Example 7.5. Example script for GUI panel applets
"bash
/usr/share/doc/datafreedom-perl/zenity-invoice
".
If you find this script useful or if you have improvements, please let me know so that I can justify making this into a part of the main package(s). Note that a usable icon will be needed too, 32x32 xpm preferably - any contributions welcome.
gtk-invoice
zenity-invoice is an example script to provide
a simple GUI for invoice generation using dfxml-invoice
.
gtk-invoice improves on the zenity implementation using dfxml-invoice by supporting monospaced fonts. This allows table layouts to be clearer by putting the invoice item in the first column instead of the second, creating a more standard invoice format.
gtk-invoice is part of
datafreedom-perl
and is usually installed at
/usr/share/doc/datafreedom-perl/gtk-invoice
,
usually compressed. If you want to create a panel applet to execute
the script, copy the file to a usable location and uncompress the it with
gunzip, then use:
"bash
/path/gtk-invoice
".
If you find this script useful or if you have improvements, please let me know so that I can justify making this into a part of the main package(s). Note that a usable icon will be needed too, 32x32 xpm preferably - any contributions welcome.
Subsequent scripts are planned to include methods to convert standard PIM formats into QSF XML for further processing.