summaryrefslogtreecommitdiff
path: root/contrib/non-profit-audit-reports/demo.sh
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-09-09 13:21:57 -0700
committerJohn Wiegley <johnw@newartisans.com>2012-09-09 13:21:57 -0700
commitd1fadf07a819dd55847b855253566a6307a3bee0 (patch)
treee26893a7c52ca7d288b02d760f0220381a35b7b9 /contrib/non-profit-audit-reports/demo.sh
parent6ed2c5db4e7064b595638cf96849f4b0d636081e (diff)
parent613eb6ba71f2c1198b7a679bde804226e27861fb (diff)
downloadfork-ledger-d1fadf07a819dd55847b855253566a6307a3bee0.tar.gz
fork-ledger-d1fadf07a819dd55847b855253566a6307a3bee0.tar.bz2
fork-ledger-d1fadf07a819dd55847b855253566a6307a3bee0.zip
Merge pull request #80 from bkuhn/contrib-non-profit-annual-audit-reports
Contrib: non-profit annual audit reports
Diffstat (limited to 'contrib/non-profit-audit-reports/demo.sh')
-rwxr-xr-xcontrib/non-profit-audit-reports/demo.sh43
1 files changed, 43 insertions, 0 deletions
diff --git a/contrib/non-profit-audit-reports/demo.sh b/contrib/non-profit-audit-reports/demo.sh
new file mode 100755
index 00000000..6a9dcadf
--- /dev/null
+++ b/contrib/non-profit-audit-reports/demo.sh
@@ -0,0 +1,43 @@
+#!/bin/sh
+# demo.sh
+# Demonstrate a non-profit GL export and conversion to ODS
+
+program=$(basename $0)
+dir=$(dirname $0)
+cd $dir
+dir=$(pwd -P)
+export PYTHONPATH=$dir/ooolib2
+
+getcsv=$dir/general-ledger-report.plx
+csv2ods=$dir/csv2ods.py
+
+echo "Demonstrating ledger to ODS export in $dir/tests"
+cd $dir/tests
+sampledata=non-profit-test-data.ledger
+echo " based on the sample data in $sampledata"
+
+$getcsv 2011/03/01 2012/03/01 -f $sampledata
+if [ -e general-ledger.csv ]; then
+ echo "data was exported to: general-ledger.csv"
+else
+ echo "error creating csv file"
+ exit 1
+fi
+
+$csv2ods --verbose --csv general-ledger.csv
+if [ -e general-ledger.ods ]; then
+ echo "csv was converted to: general-ledger.ods"
+else
+ echo "error creating ods file"
+ exit 1
+fi
+
+# create a portable zip file with the spreadsheet
+# and the linked artifacts
+
+echo creating portable zipfile...
+zip -r ../general-ledger.zip general-ledger.ods Financial Projects -x '*.txt'
+
+echo " "
+echo "created general-ledger.zip"
+