NAME
dfxml-homebank - parse a QSF XML file and prepare a CSV invoice for
homebank
DATAFREEDOM
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.
Please feel free to contribute any of your own scripts, under the
provisions of the GNU General Public Licence v3 or later, via the QOF-
devel mailing list.
http://lists.sourceforge.net/lists/listinfo/qof-devel
VERSION
Version 0.0.1
SYNOPSIS
dfxml-homebank FILENAME
dfxml-homebank -h|--help|--version
DESCRIPTION
dfxml-homebank parses a QSF XML file output by pilot-qof and prepares a
CSV invoice suitable for import into homebank, based on rates specified
in ~/.datafreedom/currency which will be created for you.
Specify '-' as the filename to parse STDIN.
e.g.
pilot-qof -x data.xml --invoice-city -t 2006-11-09 | dfxml-homebank -
The CSV output is intended to be compatible with homebank:
DATE;TRANS_TYPE;EXP_TYPE;CUSTOMER;DESC;AMOUNT;ACCOUNT
e.g.
13/08/2007;5;;ACustomer;Payment;-610.5;Income
30/08/2007;4;Parking;BCustomer;JobTitle;2.75;Expenses
Homebank uses digits for transaction types:
5 = internal transfer
4 = bank transfer
Homebank CSV import can take a few steps (in common with a lot of other
CSV processes, this is due to inherent weaknesses in the CSV format) so
dfxml-homebank is best used with the '>>' redirect to append to an
existing CSV file so that all relevant invoices can be imported into
Homebank in a single import - each run of dfxml-homebank only adds a
few CSV lines, homebank is suprisingly efficient at CSV import.
dfxml-homebank, 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:
#!/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-homebank -
Or, a full zenity version which allows the date to be selected in a
calendar widget:
#!/bin/bash
set -e
MSG="Select the date of the invoice to view"
DATE=`zenity --calendar --text="$MSG" --date-format="%Y-%m-%d"`
TIME=`date -d"$DATE" +"%A, %B %e %Y"`
if [ ! $DATE ]; then
echo "$0: please specify the date of the invoice you want to view."
exit
fi
pilot-qof -x /opt/data/pilot-qof/offline.xml --invoice-city -t $DATE \
| dfxml-homebank -
OBJECTS
pilot_expenses is part of pilot-qof. Can also be used with gpe-
expenses - compatibility with the default SQLite gpe-expenses backend
is pending.
<http://qof.sourceforge.net/>
<http://pilot-qof.sourceforge.net/>
<http://gpe-expenses.sourceforge.net/>
AUTHOR
Neil Williams, "<codehelp at debian.org>"
BUGS
Please report bugs via the pilot-qof package, either in the Debian BTS
or via SourceForge trackers.
COPYRIGHT & LICENSE
Copyright 2008 Neil Williams.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.