diff --git a/ChangeLog b/ChangeLog index 81de565541..b8c3d5f180 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2001-08-06 Bill Gribble + + * Added module/plugin system (src/gnc-module/*) + + * reshuffled source code from src/engine, src/register, and some + from src/guile, src/scm, src/gnome (see src/README.modules). + engine, backends, register, qif importer are now "modules". + + * unfinished new QIF import/export module (the old one's still + there and still works) + + * really too many files touched to get into it. + 2001-08-06 Dave Peticolas * src/register/table-html.[ch]: remove diff --git a/configure.in b/configure.in index 6097f195cd..9e40a0481a 100644 --- a/configure.in +++ b/configure.in @@ -205,7 +205,7 @@ AC_ARG_ENABLE( sql, ], [ AC_MSG_RESULT(yes) - SQL_DIR=sql + SQL_DIR=postgres ], [ AC_MSG_ERROR([Cannot find PostgreSQL libraries; will not build sql backend]) @@ -624,8 +624,15 @@ AC_OUTPUT( src/doc/Makefile src/doc/design/Makefile src/engine/Makefile - src/engine/sql/Makefile - src/engine/rpc/Makefile + src/engine/test/Makefile + src/backend/Makefile + src/backend/file/Makefile + src/backend/file/test/Makefile + src/backend/file/test/test-files/Makefile + src/backend/file/test/test-files/xml2/Makefile + src/backend/postgres/Makefile + src/backend/postgres/test/Makefile + src/backend/rpc/Makefile src/experimental/Makefile src/experimental/cbb/Makefile src/experimental/cbb/cbb-engine/Makefile @@ -635,23 +642,32 @@ AC_OUTPUT( src/experimental/ofx/dtd/Makefile src/experimental/ofx/explore/Makefile src/experimental/ofx/parser/Makefile + src/gnc-module/Makefile + src/gnc-module/test/Makefile + src/gnc-module/test/mod-foo/Makefile + src/gnc-module/test/mod-bar/Makefile + src/gnc-module/test/mod-baz/Makefile + src/gnc-module/test/misc-mods/Makefile src/gnome/Makefile src/gnome/glade/Makefile src/guile/Makefile + src/import-export/Makefile + src/import-export/qif-import/Makefile + src/import-export/qif-io-core/Makefile + src/import-export/qif-io-core/test/Makefile src/optional/Makefile src/optional/swig/Makefile src/pixmaps/Makefile src/quotes/Makefile src/register/Makefile - src/register/gnome/Makefile + src/register/ledger-core/Makefile + src/register/register-core/Makefile + src/register/register-gnome/Makefile src/scm/Makefile src/scm/gnumeric/Makefile src/scm/printing/Makefile - src/scm/qif-import/Makefile src/scm/report/Makefile src/test/Makefile - src/test/test-files/Makefile - src/test/test-files/xml2/Makefile dnl # non-makefiles dnl # Please read doc/build-system before adding *anything* here diff --git a/make-gnucash-patch.in b/make-gnucash-patch.in index 920ad94207..1126276e5a 100644 --- a/make-gnucash-patch.in +++ b/make-gnucash-patch.in @@ -266,13 +266,17 @@ exit(0); __DATA__ #*# +*.P *.a *.bak *.bin *.diff *.diffs *.gmo +*.la +*.lai *.lo +*.loT *.log *.mo *.moc diff --git a/src/Makefile.am b/src/Makefile.am index efd11735e6..d313ca8297 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,10 +1,13 @@ SUBDIRS = \ doc \ + gnc-module \ engine \ + backend \ + register \ + import-export \ calculation \ experimental \ - register \ guile \ gnome \ scm \ @@ -23,13 +26,21 @@ bin_PROGRAMS = gnucash gnucash-make-guids # problem with the current version of gwrap, and will go away when # that's fixed. gnucash_LDADD = \ - gnome/libgncgnome.a \ - register/libgncregister.a \ - register/gnome/libgncregistergnome.a \ + -L${top_srcdir}/src/gnc-module/.libs \ + -L${top_srcdir}/src/engine/.libs \ + gnc-module/libgncmodule.la \ + engine/libgncmod-engine.la \ + engine/libgw-engine.la \ + engine/libgw-glib.la \ + backend/file/libgncmod-backend-file.la \ + register/ledger-core/libgncmod-ledger-core.la \ + register/register-core/libgncmod-register-core.la \ + register/register-gnome/libgncmod-register-gnome.la \ + import-export/qif-import/libgncmod-qif-import.la \ guile/libgncguile.a \ gnome/libgncgnome.a \ calculation/libgnccalc.a \ - engine/libgncengine.la \ + guile/libgncguile.a \ ${GNOMEUI_LIBS} \ ${GNOME_LIBDIR} \ ${GNOME_PRINT_LIBS} \ @@ -44,8 +55,6 @@ gnucash_LDADD = \ ${EFENCE_LIBS} gnucash_SOURCES = \ - MultiLedger.c \ - SplitLedger.c \ EuroUtils.c \ FileDialog.c \ gnc-component-manager.c \ @@ -54,7 +63,10 @@ gnucash_SOURCES = \ gnc-ui-util.c gnucash_make_guids_LDADD = \ - engine/libgncengine.la \ + -L${top_srcdir}/src/gnc-module/.libs \ + -L${top_srcdir}/src/engine/.libs \ + gnc-module/libgncmodule.la \ + engine/libgncmod-engine.la \ ${DL_LIB} \ ${GNOME_XML_LIB} \ ${GLIB_LIBS} \ @@ -68,10 +80,7 @@ noinst_HEADERS = \ EuroUtils.h \ FileBox.h \ FileDialog.h \ - MultiLedger.h \ RecnWindow.h \ - RegWindow.h \ - SplitLedger.h \ file-history.h \ gnc-component-manager.h \ gnc-exp-parser.h \ @@ -89,4 +98,6 @@ INCLUDES = \ -I./calculation \ -I./engine \ -I./guile \ - -I./register + -I./register \ + -I./gnc-module + diff --git a/src/README.modules b/src/README.modules new file mode 100644 index 0000000000..3d78e60bf3 --- /dev/null +++ b/src/README.modules @@ -0,0 +1,28 @@ +'Modules' in Gnucash are relatively self-contained segments of code that +can be dynamically loaded at runtime. Eventually we want the whole gnucash +source tree to be a set of modules and the app itself to be a short Scheme +program that loads them all. + +We're not there yet :) + +Here are the bits that have been converted to use the module system so +far. + +gnc-module The module system (actually not a module itself) + +engine The engine module, without any backends + +backend/file Binary and XML (v1 and v2) backends +backend/postgres Postgres backend +backend/rpc RPC backend + +register/ledger-core The xacc SplitLedger and MultiLedger parts formerly + in src/ +register/register-core Toolkit independent register code, formerly in + src/register/ +register/register-gnome Gnome-specific register code, formerly in + src/register/gnome + +import-export/qif-import the old qif importer with Gnome druid +import-export/qif-io-core new qif import/export module. unfinished. + diff --git a/src/backend/Makefile.am b/src/backend/Makefile.am new file mode 100644 index 0000000000..28354fe234 --- /dev/null +++ b/src/backend/Makefile.am @@ -0,0 +1,4 @@ +SUBDIRS=file ${SQL_DIR} ${RPC_DIR} + + + diff --git a/src/backend/file/Makefile.am b/src/backend/file/Makefile.am new file mode 100644 index 0000000000..f0d53fa9de --- /dev/null +++ b/src/backend/file/Makefile.am @@ -0,0 +1,18 @@ +SUBDIRS=. test + +lib_LTLIBRARIES=libgncmod-backend-file.la + +INCLUDES= -I../../engine -I../../gnc-module ${GLIB_CFLAGS} -I../.. + +libgncmod_backend_file_la_SOURCES= gncmod-backend-file.c \ +gnc-account-xml-v2.c gnc-backend-file.c gnc-commodity-xml-v2.c \ +gnc-freqspec-xml-v2.c gnc-pricedb-xml-v1.c gnc-schedxaction-xml-v2.c \ +gnc-transaction-xml-v2.c io-example-account.c io-gncbin-r.c \ +io-gncxml-gen.c io-gncxml-v1.c io-gncxml-v2.c io-utils.c \ +sixtp-dom-generators.c sixtp-dom-parsers.c sixtp-stack.c \ +sixtp-to-dom-parser.c sixtp-utils.c sixtp.c + +libgncmod_backend_file_la_LDFLAGS=-module ${GLIB_LIBS} ${GNOME_XML_LIB} +#libgncmod_backend_file_la_LIBADD = \ +#../../engine/libgncmod-engine.la \ +#../../gnc-module/libgncmodule.la diff --git a/src/engine/gnc-account-xml-v2.c b/src/backend/file/gnc-account-xml-v2.c similarity index 100% rename from src/engine/gnc-account-xml-v2.c rename to src/backend/file/gnc-account-xml-v2.c diff --git a/src/engine/gnc-book-file.c b/src/backend/file/gnc-backend-file.c similarity index 98% rename from src/engine/gnc-book-file.c rename to src/backend/file/gnc-backend-file.c index 6e3a69808b..febd9d005a 100644 --- a/src/engine/gnc-book-file.c +++ b/src/backend/file/gnc-backend-file.c @@ -1,3 +1,7 @@ +/********************************************************************* + * gnc-backend-file.c + *********************************************************************/ + #include #include #include @@ -192,8 +196,8 @@ file_all_sync(Backend* be, AccountGroup *ag, GNCPriceDB *pricedb) gnc_file_be_write_to_file((FileBackend*)be, TRUE); } -Backend* -gncBackendInit_file(const char *book_id, void *data) +Backend * +gnc_backend_new(const char *book_id, void *data) { FileBackend *fbe; Backend *be; diff --git a/src/engine/gnc-commodity-xml-v2.c b/src/backend/file/gnc-commodity-xml-v2.c similarity index 100% rename from src/engine/gnc-commodity-xml-v2.c rename to src/backend/file/gnc-commodity-xml-v2.c diff --git a/src/engine/gnc-freqspec-xml-v2.c b/src/backend/file/gnc-freqspec-xml-v2.c similarity index 100% rename from src/engine/gnc-freqspec-xml-v2.c rename to src/backend/file/gnc-freqspec-xml-v2.c diff --git a/src/engine/gnc-pricedb-xml-v1.c b/src/backend/file/gnc-pricedb-xml-v1.c similarity index 100% rename from src/engine/gnc-pricedb-xml-v1.c rename to src/backend/file/gnc-pricedb-xml-v1.c diff --git a/src/engine/gnc-schedxaction-xml-v2.c b/src/backend/file/gnc-schedxaction-xml-v2.c similarity index 99% rename from src/engine/gnc-schedxaction-xml-v2.c rename to src/backend/file/gnc-schedxaction-xml-v2.c index 72c47f2ae4..95e95ba48c 100644 --- a/src/engine/gnc-schedxaction-xml-v2.c +++ b/src/backend/file/gnc-schedxaction-xml-v2.c @@ -424,7 +424,7 @@ gnc_schedXaction_end_handler(gpointer data_for_children, g_return_val_if_fail( tree, FALSE ); - sx = xaccSchedXactionMalloc( NULL); + sx = xaccSchedXactionMalloc( NULL ); /* FIXME: this should be removed somewhere near 1.8 release time. */ { @@ -447,11 +447,9 @@ gnc_schedXaction_end_handler(gpointer data_for_children, /* FIXME: this should be removed somewhere near 1.8 release time. */ if ( sx->template_acct == NULL ) { - AccountGroup *ag; - char *id; - Account *acct; - - ag = acct = id = NULL; + AccountGroup *ag = NULL; + char *id = NULL; + Account *acct = NULL; /* We're dealing with a pre-200107 rgmerk change re: storing template accounts. */ diff --git a/src/engine/gnc-transaction-xml-v2.c b/src/backend/file/gnc-transaction-xml-v2.c similarity index 100% rename from src/engine/gnc-transaction-xml-v2.c rename to src/backend/file/gnc-transaction-xml-v2.c diff --git a/src/engine/gnc-xml-helper.h b/src/backend/file/gnc-xml-helper.h similarity index 100% rename from src/engine/gnc-xml-helper.h rename to src/backend/file/gnc-xml-helper.h diff --git a/src/engine/gnc-xml.h b/src/backend/file/gnc-xml.h similarity index 100% rename from src/engine/gnc-xml.h rename to src/backend/file/gnc-xml.h diff --git a/src/backend/file/gncmod-backend-file.c b/src/backend/file/gncmod-backend-file.c new file mode 100644 index 0000000000..72e9515512 --- /dev/null +++ b/src/backend/file/gncmod-backend-file.c @@ -0,0 +1,58 @@ +/********************************************************************* + * gncmod-file-backend.c + * module definition/initialization for the file backend module + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include + +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +GNCModule engine; + +char * +gnc_module_path(void) +{ + return g_strdup("gnucash/backend/file"); +} + +char * +gnc_module_description(void) +{ + return g_strdup("The binary and XML (v1 and v2) backends for Gnucash"); +} + +int +gnc_module_init(int refcount) +{ + if(refcount == 0) + { + engine = gnc_module_load("gnucash/engine", 0); + + if(!engine) return FALSE; + } + return TRUE; +} + +int +gnc_module_end(int refcount) +{ + if((refcount == 0) && engine) + { + int unload = gnc_module_unload(engine); + engine = NULL; + return unload; + } + return TRUE; +} + diff --git a/src/engine/io-example-account.c b/src/backend/file/io-example-account.c similarity index 100% rename from src/engine/io-example-account.c rename to src/backend/file/io-example-account.c diff --git a/src/engine/io-example-account.h b/src/backend/file/io-example-account.h similarity index 100% rename from src/engine/io-example-account.h rename to src/backend/file/io-example-account.h diff --git a/src/engine/io-gncbin-r.c b/src/backend/file/io-gncbin-r.c similarity index 100% rename from src/engine/io-gncbin-r.c rename to src/backend/file/io-gncbin-r.c diff --git a/src/engine/io-gncbin.h b/src/backend/file/io-gncbin.h similarity index 100% rename from src/engine/io-gncbin.h rename to src/backend/file/io-gncbin.h diff --git a/src/engine/io-gncxml-gen.c b/src/backend/file/io-gncxml-gen.c similarity index 100% rename from src/engine/io-gncxml-gen.c rename to src/backend/file/io-gncxml-gen.c diff --git a/src/engine/io-gncxml-gen.h b/src/backend/file/io-gncxml-gen.h similarity index 100% rename from src/engine/io-gncxml-gen.h rename to src/backend/file/io-gncxml-gen.h diff --git a/src/engine/io-gncxml-v1.c b/src/backend/file/io-gncxml-v1.c similarity index 100% rename from src/engine/io-gncxml-v1.c rename to src/backend/file/io-gncxml-v1.c diff --git a/src/engine/io-gncxml-v2.c b/src/backend/file/io-gncxml-v2.c similarity index 100% rename from src/engine/io-gncxml-v2.c rename to src/backend/file/io-gncxml-v2.c diff --git a/src/engine/io-gncxml-v2.h b/src/backend/file/io-gncxml-v2.h similarity index 100% rename from src/engine/io-gncxml-v2.h rename to src/backend/file/io-gncxml-v2.h diff --git a/src/engine/io-gncxml.h b/src/backend/file/io-gncxml.h similarity index 100% rename from src/engine/io-gncxml.h rename to src/backend/file/io-gncxml.h diff --git a/src/engine/io-utils.c b/src/backend/file/io-utils.c similarity index 100% rename from src/engine/io-utils.c rename to src/backend/file/io-utils.c diff --git a/src/engine/io-utils.h b/src/backend/file/io-utils.h similarity index 100% rename from src/engine/io-utils.h rename to src/backend/file/io-utils.h diff --git a/src/engine/sixtp-dom-generators.c b/src/backend/file/sixtp-dom-generators.c similarity index 100% rename from src/engine/sixtp-dom-generators.c rename to src/backend/file/sixtp-dom-generators.c diff --git a/src/engine/sixtp-dom-generators.h b/src/backend/file/sixtp-dom-generators.h similarity index 100% rename from src/engine/sixtp-dom-generators.h rename to src/backend/file/sixtp-dom-generators.h diff --git a/src/engine/sixtp-dom-parsers.c b/src/backend/file/sixtp-dom-parsers.c similarity index 100% rename from src/engine/sixtp-dom-parsers.c rename to src/backend/file/sixtp-dom-parsers.c diff --git a/src/engine/sixtp-dom-parsers.h b/src/backend/file/sixtp-dom-parsers.h similarity index 100% rename from src/engine/sixtp-dom-parsers.h rename to src/backend/file/sixtp-dom-parsers.h diff --git a/src/engine/sixtp-parsers.h b/src/backend/file/sixtp-parsers.h similarity index 100% rename from src/engine/sixtp-parsers.h rename to src/backend/file/sixtp-parsers.h diff --git a/src/engine/sixtp-stack.c b/src/backend/file/sixtp-stack.c similarity index 100% rename from src/engine/sixtp-stack.c rename to src/backend/file/sixtp-stack.c diff --git a/src/engine/sixtp-stack.h b/src/backend/file/sixtp-stack.h similarity index 100% rename from src/engine/sixtp-stack.h rename to src/backend/file/sixtp-stack.h diff --git a/src/engine/sixtp-to-dom-parser.c b/src/backend/file/sixtp-to-dom-parser.c similarity index 100% rename from src/engine/sixtp-to-dom-parser.c rename to src/backend/file/sixtp-to-dom-parser.c diff --git a/src/engine/sixtp-utils.c b/src/backend/file/sixtp-utils.c similarity index 100% rename from src/engine/sixtp-utils.c rename to src/backend/file/sixtp-utils.c diff --git a/src/engine/sixtp-utils.h b/src/backend/file/sixtp-utils.h similarity index 100% rename from src/engine/sixtp-utils.h rename to src/backend/file/sixtp-utils.h diff --git a/src/engine/sixtp.c b/src/backend/file/sixtp.c similarity index 100% rename from src/engine/sixtp.c rename to src/backend/file/sixtp.c diff --git a/src/engine/sixtp.h b/src/backend/file/sixtp.h similarity index 100% rename from src/engine/sixtp.h rename to src/backend/file/sixtp.h diff --git a/src/backend/file/test/Makefile.am b/src/backend/file/test/Makefile.am new file mode 100644 index 0000000000..4196f84891 --- /dev/null +++ b/src/backend/file/test/Makefile.am @@ -0,0 +1,45 @@ +TESTS = test-load-module test-dom-converters1 test-kvp-frames \ + test-string-converters test-xml-account test-xml2-is-file \ + test-load-xml2 test-load-example-account \ + test-xml-commodity test-xml-transaction test-real-data.sh + +TESTS_ENVIRONMENT = \ + GNC_MODULE_PATH="${top_srcdir}/src/engine:${top_srcdir}/src/backend/file" \ + GUILE_LOAD_PATH="${G_WRAP_MODULE_DIR}:..:${top_srcdir}/src/gnc-module" \ + LTDL_LIBRARY_PATH=${top_srcdir}/src/gnc-module \ + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${top_srcdir}/src/gnc-module:${top_srcdir}/src/gnc-module/.libs:${top_srcdir}/src/engine:${top_srcdir}/src/engine/.libs + +noinst_PROGRAMS = test-dom-converters1 test-kvp-frames \ + test-string-converters test-xml-account test-xml2-is-file \ + test-load-xml2 test-load-example-account \ + test-xml-commodity test-xml-transaction test-save-in-lang + +LDADD = -L../../../engine/.libs -lgncengine \ + -L../../../gnc-module/.libs \ + ../../../engine/libgncmod-engine.la \ + ../libgncmod-backend-file.la + +CFLAGS=${GLIB_CFLAGS} +INCLUDES=-I ../../../engine -I ../ + + +test_kvp_frames_SOURCES = test-kvp-frames.c test-stuff.c gnc-test-stuff.c + +test_load_example_account_SOURCES = test-load-example-account.c test-stuff.c gnc-test-stuff.c + +test_dom_converters1_SOURCES = test-dom-converters1.c test-stuff.c gnc-test-stuff.c + +test_string_converters_SOURCES = test-string-converters.c test-stuff.c gnc-test-stuff.c + +test_xml_account_SOURCES = test-xml-account.c test-stuff.c gnc-test-stuff.c + +test_xml_commodity_SOURCES = test-xml-commodity.c test-stuff.c gnc-test-stuff.c + +test_xml_transaction_SOURCES = test-xml-transaction.c test-stuff.c gnc-test-stuff.c + +test_xml2_is_file_SOURCES = test-xml2-is-file.c test-stuff.c gnc-test-stuff.c + +test_load_xml2_SOURCES = test-load-xml2.c test-stuff.c gnc-test-stuff.c + +test_save_in_lang_SOURCES = test-save-in-lang.c test-stuff.c gnc-test-stuff.c + diff --git a/src/backend/file/test/README b/src/backend/file/test/README new file mode 100644 index 0000000000..483b13183d --- /dev/null +++ b/src/backend/file/test/README @@ -0,0 +1,18 @@ +These are tests of the file backend. + +TESTS: +------ + +test-dom-converters1.c: test each simple dom converter +test-dom-parser1.c: unused now +test-kvp-frames.c: test the kvp frame dom generators and parsers +test-load-xml2.c: test the larger xml loading +test-save-in-lang.c: incomplete test to test saving in different LANGs +test-string-converters.c: test some string converters +test-xml-account.c: test xml v2 converters and parsers for Account's +test-xml-commodity.c: ditto gnc_commodity's +test-xml-transaction.c: ditto Transaction's +test-xml2-is-file.c: test the is_file function +test-real-data.sh: run the test-xml-{account,commodity,transaction} programs + on real data rather than random data + diff --git a/src/backend/file/test/gnc-test-stuff.c b/src/backend/file/test/gnc-test-stuff.c new file mode 100644 index 0000000000..6395e9cfda --- /dev/null +++ b/src/backend/file/test/gnc-test-stuff.c @@ -0,0 +1,1098 @@ +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gnc-engine-util.h" +#include "gnc-test-stuff.h" +#include "sixtp-dom-parsers.h" +#include "sixtp-parsers.h" +#include "test-stuff.h" +#include "io-gncxml-gen.h" +#include "sixtp-utils.h" + +/***********************************************************************/ + +static int +files_return(int ret, const char* msg) +{ + printf(msg); + return ret; +} + +int +files_compare(const gchar* f1, const gchar* f2) +{ + gchar buf1[512]; + gchar buf2[512]; + int fd1, fd2; + int amount_read1, amount_read2; + + fd1 = open(f1, O_RDONLY); + fd2 = open(f2, O_RDONLY); + + do + { + int memcmp_ret; + + amount_read1 = read(fd1, buf1, 512); + amount_read2 = read(fd2, buf2, 512); + + if(amount_read1 > amount_read2) + return files_return(1, "read1 > read2"); + if(amount_read1 < amount_read2) + return files_return(-1, "read1 < read2"); + + if((memcmp_ret = memcmp(buf1, buf2, amount_read1)) != 0) + { + return files_return(memcmp_ret, "memcmp return"); + } + + } while(amount_read1 == 512); + + return 0; +} + +void +write_dom_node_to_file(xmlNodePtr node, int fd) +{ + FILE *out; + + out = fdopen(fd, "w"); + + xmlElemDump(out, NULL, node); + + fclose(out); +} + +gboolean +print_dom_tree(gpointer data_for_children, GSList* data_from_children, + GSList* sibling_data, gpointer parent_data, + gpointer global_data, gpointer *result, const gchar *tag) +{ + if (parent_data == NULL) + { + xmlElemDump((FILE*)global_data, NULL, (xmlNodePtr)data_for_children); + xmlFreeNode(data_for_children); + } + return TRUE; +} + +/***********************************************************************/ + +gint +get_random_int_in_range(int start, int end) +{ + return start + (int)((double)end * rand() / (RAND_MAX + 1.0)); +} + +static char random_chars[] = +"ABCDEFGHIJKLMNOPQRSTUVWXYZ" +"abcdefghijklmnopqrstuvwxyz" +"1234567890" +" " +/* ",.'\"`~!@#$%^*(){}[]/=?+-_\\|" */ +/* "<>&" */ +/* "\n\t" */ +""; + +gchar +get_random_character(void) +{ + static int rcend = 0; + if(!rcend) + { + rcend = strlen(random_chars) - 1; + } + + return random_chars[get_random_int_in_range(0, rcend)]; +} + +gchar* +get_random_string(void) +{ + gchar *ret; + int len; + int i; + + switch(get_random_int_in_range(0, 9)) + { +/* case 0: */ +/* return ""; */ +/* case 1: */ +/* return NULL; */ +/* case 2: */ +/* len = get_random_int_in_range(1000, 5000); */ +/* break; */ + case 3: + len = get_random_int_in_range(100, 500); + break; + default: + len = get_random_int_in_range(5, 20); + break; + } + ret = g_new0(gchar, len); + + for(i = 0; i < len - 1; i++) + { + ret[i] = get_random_character(); + } + return ret; +} + +Timespec* +get_random_timespec(void) +{ + Timespec *ret; + + ret = g_new(Timespec, 1); + + ret->tv_sec = rand(); + ret->tv_nsec = rand(); + + return ret; +} + +gint64 +get_random_gint64(void) +{ + gint64 ret = 0; + + ret = rand(); + ret <<= 32; + ret += rand(); + + return ret; +} + +double +get_random_double(void) +{ + union + { + double d; + gint64 i; + } ret; + + + ret.i = get_random_gint64(); + + return ret.d; +} + +gnc_numeric +get_random_gnc_numeric(void) +{ + return gnc_numeric_create(get_random_gint64(), rand()); +} + +const char *types[] = +{ + "NASDAQ", + "NYSE", + "EUREX", + "FUND", + "AMEX", + NULL +}; + +const char* +get_random_commodity_namespace(void) +{ + return get_random_string_in_array(types); +} + +gnc_commodity* +get_random_gnc_commodity_ref(void) +{ + const gchar *name; + gchar *mnemonic; + gnc_commodity *ret; + + name = get_random_commodity_namespace(); + mnemonic = get_random_string(); + + if(!name || !mnemonic) + { + return NULL; + } + + ret = gnc_commodity_new("", name, mnemonic, "", 0); + + g_free(mnemonic); + + return ret; +} + +GNCPrice * +get_random_price(void) +{ + GNCPrice *p; + Timespec *ts; + char *string; + + p = gnc_price_create (); + + gnc_price_set_commodity (p, get_random_gnc_commodity_ref ()); + gnc_price_set_currency (p, get_random_gnc_commodity_ref ()); + + ts = get_random_timespec (); + gnc_price_set_time (p, *ts); + g_free (ts); + + string = get_random_string (); + gnc_price_set_source (p, string); + g_free (string); + + string = get_random_string (); + gnc_price_set_type (p, string); + g_free (string); + + gnc_price_set_value (p, get_random_gnc_numeric ()); + + return p; +} + +GUID* +get_random_guid(void) +{ + GUID *ret; + + ret = g_new(GUID, 1); + guid_new(ret); + + return ret; +} + +GList* +get_random_glist(void) +{ + GList *ret = NULL; + int i; + int count = get_random_int_in_range(1, 5); + + for(i = 0; i < count; i++) + { + ret = g_list_prepend(ret, (gpointer)get_random_kvp_value(-2)); + } + + return ret; +} + +bin_data* +get_random_binary_data(void) +{ + int len; + bin_data *ret; + + len = get_random_int_in_range(20,100); + ret = g_new(bin_data, 1); + ret->data = g_new(char, len); + ret->len = len; + + for(len--; len >= 0; len--) + { + ret->data[len] = (char)get_random_int_in_range(0,255); + } + + return ret; +} + +kvp_frame* +get_random_kvp_frame(void) +{ + kvp_frame *ret; + int vals_to_add; + + ret = kvp_frame_new(); + + vals_to_add = get_random_int_in_range(1,10); + + for(;vals_to_add > 0; vals_to_add--) + { + gchar *key; + kvp_value *val; + + key = get_random_string(); + val = get_random_kvp_value(-1); + + if(!key) + { + return NULL; + } + + kvp_frame_set_slot_nc(ret, key, val); + + g_free(key); + } + + return ret; +} + +kvp_value* +get_random_kvp_value(int type) +{ + int datype = type; + + if(datype == -1) + { + datype = get_random_int_in_range(KVP_TYPE_GINT64, KVP_TYPE_FRAME + 1); + } + + if(datype == -2) + { + datype = get_random_int_in_range(KVP_TYPE_GINT64, KVP_TYPE_FRAME); + } + + switch(datype) + { + case KVP_TYPE_GINT64: + return kvp_value_new_gint64(get_random_gint64()); + break; + + case KVP_TYPE_DOUBLE: + return kvp_value_new_double(get_random_double()); + break; + + case KVP_TYPE_NUMERIC: + return kvp_value_new_gnc_numeric(get_random_gnc_numeric()); + break; + + case KVP_TYPE_STRING: + { + gchar *tmp_str; + kvp_value *ret; + tmp_str = get_random_string(); + if(!tmp_str) + { + return NULL; + } + + ret = kvp_value_new_string(tmp_str); + g_free(tmp_str); + return ret; + } + break; + + case KVP_TYPE_GUID: + { + GUID *tmp_guid; + kvp_value *ret; + tmp_guid = get_random_guid(); + ret = kvp_value_new_guid(tmp_guid); + g_free(tmp_guid); + return ret; + } + break; + + case KVP_TYPE_BINARY: + { + bin_data *tmp_data; + kvp_value *ret; + tmp_data = get_random_binary_data(); + ret = kvp_value_new_binary(tmp_data->data, tmp_data->len); + g_free(tmp_data->data); + g_free(tmp_data); + return ret; + } + break; + + case KVP_TYPE_GLIST: + return kvp_value_new_glist_nc(get_random_glist()); + break; + + case KVP_TYPE_FRAME: + { + kvp_frame *tmp_frame; + kvp_value *ret; + tmp_frame = get_random_kvp_frame(); + ret = kvp_value_new_frame(tmp_frame); + kvp_frame_delete(tmp_frame); + return ret; + } + break; + + default: + return NULL; + break; + } +} + +static void +set_account_random_string(Account* act, + void(*func)(Account *act, const gchar*str)) +{ + gchar *tmp_str = get_random_string(); + if(tmp_str) + { + (func)(act, tmp_str); + g_free(tmp_str); + } +} + +Account* +get_random_account(void) +{ + Account *ret; + int tmp_int; + + ret = xaccMallocAccount(); + + xaccAccountBeginEdit(ret); + + set_account_random_string(ret, xaccAccountSetName); + + tmp_int = get_random_int_in_range(BANK, CREDITLINE); + xaccAccountSetType(ret, tmp_int); + + set_account_random_string(ret, xaccAccountSetCode); + set_account_random_string(ret, xaccAccountSetDescription); + + xaccAccountSetCommodity(ret, get_random_gnc_commodity_ref()); + + xaccAccountSetSlots_nc(ret, get_random_kvp_frame()); + + xaccAccountCommitEdit(ret); + return ret; +} + +static void +set_split_random_string(Split *spl, + void(*func)(Split *act, const gchar*str)) +{ + gchar *tmp_str = get_random_string(); + if(tmp_str) + { + (func)(spl, tmp_str); + g_free(tmp_str); + } +} + +static char possible_chars[] = { 'c', 'y', 'f', 'n' }; + +Split* +get_random_split(gnc_numeric num) +{ + Split *ret; + gnc_numeric oneVal; + + ret = xaccMallocSplit(); + + set_split_random_string(ret, xaccSplitSetMemo); + set_split_random_string(ret, xaccSplitSetAction); + + xaccSplitSetReconcile(ret, possible_chars[get_random_int_in_range(0, 4)]); + + xaccSplitSetDateReconciledTS(ret, get_random_timespec()); + + xaccSplitSetValue(ret, num); + xaccSplitSetAmount(ret, num); + + oneVal = gnc_numeric_create(1,1); + xaccSplitSetSharePrice(ret, oneVal); + + xaccSplitSetSlots_nc(ret, get_random_kvp_frame()); + + { + GUID *ranguid = get_random_guid(); + xaccSplitSetAccountGUID(ret, *ranguid); + g_free(ranguid); + } + + return ret; +} + +static void +set_tran_random_string(Transaction* trn, + void(*func)(Transaction *act, const gchar*str)) +{ + gchar *tmp_str = get_random_string(); + if(tmp_str) + { + (func)(trn, tmp_str); + g_free(tmp_str); + } +} + +static void +add_random_splits(Transaction *trn) +{ + gnc_numeric num = get_random_gnc_numeric(); + xaccTransAppendSplit(trn, get_random_split(num)); + xaccTransAppendSplit(trn, get_random_split(gnc_numeric_neg(num))); +} + +static void +trn_add_ran_timespec(Transaction *trn, void (*func)(Transaction*, + const Timespec*)) +{ + Timespec *to_set; + + to_set = get_random_timespec(); + func(trn, to_set); + g_free(to_set); +} + + +Transaction* +get_random_transaction(void) +{ + Transaction* ret; + + ret = xaccMallocTransaction(); + + xaccTransBeginEdit(ret); + + xaccTransSetCurrency(ret, get_random_gnc_commodity_ref()); + + set_tran_random_string(ret, xaccTransSetNum); + + trn_add_ran_timespec(ret, xaccTransSetDatePostedTS); + trn_add_ran_timespec(ret, xaccTransSetDateEnteredTS); + + set_tran_random_string(ret, xaccTransSetDescription); + + xaccTransSetSlots_nc(ret, get_random_kvp_frame()); + + add_random_splits(ret); + + xaccTransCommitEdit(ret); + + return ret; +} + +gnc_commodity* +get_random_commodity(void) +{ + gnc_commodity *ret; + gchar *name; + const gchar *space; + gchar *mn; + gchar *xcode; + int ran_int; + + name = get_random_string(); + space = get_random_commodity_namespace(); + mn = get_random_string(); + xcode = get_random_string(); + ran_int = get_random_int_in_range(1, 100000); + + ret = gnc_commodity_new(name, space, mn, xcode, ran_int); + + g_free(name); + g_free(mn); + g_free(xcode); + + return ret; +} + +gboolean +get_random_boolean(void) +{ + return get_random_int_in_range (0, 1); +} + +static GList * +get_random_guids(int max) +{ + GList *guids = NULL; + int num_guids; + + if (max < 1) return NULL; + + num_guids = get_random_int_in_range (1, max); + + while (num_guids-- > 0) + g_list_prepend (guids, get_random_guid ()); + + return guids; +} + +static void +free_random_guids(GList *guids) +{ + GList *node; + + for (node = guids; node; node = node->next) + g_free (node->data); + + g_list_free (guids); +} + +static QueryOp +get_random_queryop(void) +{ + return get_random_int_in_range (1, QUERY_XOR); +} + +Query * +get_random_query(void) +{ + Query *q; + Query *temp_q; + int num_terms; + + num_terms = get_random_int_in_range (1, 4); + + q = xaccMallocQuery (); + + while (num_terms-- > 0) + { + pr_type_t pr_type; + Timespec *start; + Timespec *end; + GList *guids; + char *string; + GUID *guid; + + pr_type = get_random_int_in_range (1, 20); + + switch (pr_type) + { + case PR_ACCOUNT: + guids = get_random_guids (10); + xaccQueryAddAccountGUIDMatch + (q, + guids, + get_random_int_in_range (1, ACCT_MATCH_NONE), + get_random_queryop ()); + free_random_guids (guids); + break; + + case PR_ACTION: + string = get_random_string (); + xaccQueryAddActionMatch (q, + string, + get_random_boolean (), + get_random_boolean (), + get_random_queryop ()); + g_free (string); + break; + + case PR_AMOUNT: + DxaccQueryAddAmountMatch + (q, + get_random_double (), + get_random_int_in_range (1, AMT_SGN_MATCH_DEBIT), + get_random_int_in_range (1, AMT_MATCH_EXACTLY), + get_random_queryop ()); + break; + + case PR_BALANCE: + xaccQueryAddBalanceMatch + (q, + get_random_int_in_range (1, BALANCE_UNBALANCED), + get_random_queryop ()); + break; + + case PR_CLEARED: + xaccQueryAddClearedMatch + (q, + get_random_int_in_range (1, CLEARED_FROZEN), + get_random_queryop ()); + break; + + case PR_DATE: + start = get_random_timespec (); + end = get_random_timespec (); + xaccQueryAddDateMatchTS (q, + get_random_boolean (), + *start, + get_random_boolean (), + *end, + get_random_queryop ()); + g_free (start); + g_free (end); + break; + + case PR_DESC: + string = get_random_string (); + xaccQueryAddDescriptionMatch (q, + string, + get_random_boolean (), + get_random_boolean (), + get_random_queryop ()); + g_free (string); + break; + + case PR_GUID: + guid = get_random_guid (); + xaccQueryAddGUIDMatch (q, guid, get_random_queryop ()); + g_free (guid); + break; + + case PR_MEMO: + string = get_random_string (); + xaccQueryAddMemoMatch (q, + string, + get_random_boolean (), + get_random_boolean (), + get_random_queryop ()); + g_free (string); + break; + + case PR_NUM: + string = get_random_string (); + xaccQueryAddNumberMatch (q, + string, + get_random_boolean (), + get_random_boolean (), + get_random_queryop ()); + g_free (string); + break; + + case PR_PRICE: + DxaccQueryAddSharePriceMatch + (q, + get_random_double (), + get_random_int_in_range (1, AMT_MATCH_EXACTLY), + get_random_queryop ()); + break; + + case PR_SHRS: + DxaccQueryAddSharesMatch + (q, + get_random_double (), + get_random_int_in_range (1, AMT_MATCH_EXACTLY), + get_random_queryop ()); + break; + + case PR_MISC: /* PR_MISC shouldn't be used anyway :) */ + default: + num_terms++; + break; + } + } + + xaccQuerySetSortOrder (q, + get_random_int_in_range (1, BY_NONE), + get_random_int_in_range (1, BY_NONE), + get_random_int_in_range (1, BY_NONE)); + + xaccQuerySetSortIncreasing (q, + get_random_boolean (), + get_random_boolean (), + get_random_boolean ()); + + xaccQuerySetMaxSplits (q, get_random_int_in_range (-50000, 50000)); + + return q; +} + +/***********************************************************************/ + +gboolean +check_dom_tree_version(xmlNodePtr node, gchar *verstr) +{ + char *verteststr; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(verstr, FALSE); + g_return_val_if_fail(node->properties, FALSE); + g_return_val_if_fail(node->properties->xmlAttrPropertyValue, FALSE); + g_return_val_if_fail(node->properties->xmlAttrPropertyValue->content, + FALSE); + + verteststr = node->properties->xmlAttrPropertyValue->content; + if(safe_strcmp(verstr, verteststr) == 0) + { + return TRUE; + } + else + { + return FALSE; + } +} + +gboolean +equals_node_val_vs_string(xmlNodePtr node, const gchar* str) +{ + gchar *cmp1; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(str, FALSE); + + cmp1 = dom_tree_to_text(node); + + if(!cmp1) + { + return FALSE; + } + else if(safe_strcmp(cmp1, str) == 0) + { + g_free(cmp1); + return TRUE; + } + else + { + printf("Differing types: node:`%s' vs string:`%s'\n", cmp1, str); + g_free(cmp1); + return FALSE; + } +} + +gboolean +equals_node_val_vs_int(xmlNodePtr node, gint64 val) +{ + gchar *text; + gint64 test_val; + + g_return_val_if_fail(node, FALSE); + + text = dom_tree_to_text(node); + + if(!string_to_gint64(text, &test_val)) + { + g_free(text); + return FALSE; + } + + g_free(text); + + return val == test_val; +} + +gboolean +equals_node_val_vs_guid(xmlNodePtr node, const GUID *id) +{ + GUID *cmpid; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(id, FALSE); + + cmpid = dom_tree_to_guid(node); + + g_return_val_if_fail(cmpid, FALSE); + + if(guid_compare(cmpid, id) == 0) + { + g_free(cmpid); + return TRUE; + } + else + { + g_free(cmpid); + return FALSE; + } +} + +gboolean +equals_node_val_vs_commodity(xmlNodePtr node, const gnc_commodity *com) +{ + gnc_commodity *cmpcom; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(com, FALSE); + + cmpcom = dom_tree_to_commodity_ref_no_engine(node); + + g_return_val_if_fail(cmpcom, FALSE); + + if(gnc_commodity_equiv(com, cmpcom)) + { + gnc_commodity_destroy(cmpcom); + return TRUE; + } + else + { + gnc_commodity_destroy(cmpcom); + return TRUE; + } +} + +gboolean +equals_node_val_vs_kvp_frame(xmlNodePtr node, const kvp_frame *frm) +{ + kvp_frame *cmpfrm; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(frm, FALSE); + + cmpfrm = dom_tree_to_kvp_frame(node); + + g_return_val_if_fail(cmpfrm, FALSE); + + if(kvp_frame_compare(frm, cmpfrm) == 0) + { + kvp_frame_delete(cmpfrm); + return TRUE; + } + else + { + gchar *frm1str; + gchar *frm2str; + + frm1str = kvp_frame_to_string(frm); + frm2str = kvp_frame_to_string(cmpfrm); + + printf("%s vs %s\n", frm1str, frm2str); + + g_free(frm1str); + g_free(frm2str); + + kvp_frame_delete(cmpfrm); + return FALSE; + } +} + +gboolean +equals_node_val_vs_date(xmlNodePtr node, const Timespec tm) +{ + Timespec *tm_test = dom_tree_to_timespec(node); + + if(tm_test->tv_sec == tm.tv_sec && tm_test->tv_nsec == tm.tv_nsec) + { + return TRUE; + } + else + { + return TRUE; + } +} + +/***********************************************************************/ +const char* +get_random_string_in_array(const char* str_list[]) +{ + int num; + const char *to_ret = NULL; + + for(num = 0; str_list[num] != NULL; num++) + { + switch(get_random_int_in_range(0, num + 1)) + { + case 0: + to_ret = str_list[num]; + default: + if(str_list[num + 1] == NULL) + { + return to_ret; + } + to_ret = str_list[num + 1]; + } + } + return to_ret; +} + +/***********************************************************************/ + +static gboolean +just_dom_tree_end_handler(gpointer data_for_children, + GSList* data_from_children, GSList* sibling_data, + gpointer parent_data, gpointer global_data, + gpointer *result, const gchar *tag) +{ + Transaction *trn = NULL; + gboolean successful = FALSE; + xmlNodePtr achild; + xmlNodePtr tree = (xmlNodePtr)data_for_children; + xmlNodePtr *globaldata = (xmlNodePtr*)global_data; + + if(parent_data) + { + return TRUE; + } + + /* OK. For some messed up reason this is getting called again with a + NULL tag. So we ignore those cases */ + if(!tag) + { + return TRUE; + } + + g_return_val_if_fail(tree, FALSE); + + *globaldata = tree; + + return TRUE; +} + +static xmlNodePtr +grab_file_doc(const char *filename) +{ + sixtp *parser; + xmlNodePtr ret; + gpointer parse_result = NULL; + + parser = sixtp_dom_parser_new(just_dom_tree_end_handler, NULL, NULL); + + sixtp_parse_file(parser, filename, NULL, &ret, &parse_result); + + return ret; +} + +static void +test_load_file(const char *filename, gxpf_callback cb, + sixtp *parser, const char *parser_tag) +{ + xmlNodePtr node; + sixtp *main_parser; + sixtp *top_parser; + + node = grab_file_doc(filename); + + if(!node) + { + failure_args("failure of libxml to parse file", __FILE__, __LINE__, + "%s", filename); + return; + } + + top_parser = sixtp_new(); + main_parser = sixtp_new(); + + if(!sixtp_add_some_sub_parsers( + top_parser, TRUE, + "gnc-v2", main_parser, + NULL, NULL)) + { + return; + } + + if(!sixtp_add_some_sub_parsers( + main_parser, TRUE, + parser_tag, parser, + NULL, NULL)) + { + return; + } + + if(!gnc_xml_parse_file(top_parser, filename, cb, (gpointer)(node->childs))) + { + failure_args("failure to parse file", __FILE__, __LINE__, + "%s", filename); + } + + xmlFreeNode(node); +} + +void +test_files_in_dir(int argc, char **argv, gxpf_callback cb, + sixtp *parser, const char *parser_tag) +{ + int count; + + for(count = 1; count < argc; count++) + { + struct stat file_info; + const char *to_open = argv[count]; + if(stat(to_open, &file_info) != 0) + { + failure("unable to stat file"); + } + else + { + if(!S_ISDIR(file_info.st_mode)) + { + test_load_file(to_open, cb, parser, parser_tag); + } + } + } +} diff --git a/src/backend/file/test/gnc-test-stuff.h b/src/backend/file/test/gnc-test-stuff.h new file mode 100644 index 0000000000..42aee6afed --- /dev/null +++ b/src/backend/file/test/gnc-test-stuff.h @@ -0,0 +1,89 @@ +/* Created by bstanley 20010323 + * moved contents from test-stuff.h + * + * This file declares testing functions which rely on other parts + * of gnucash. + * + */ + +#ifndef GNC_TEST_STUFF_H +#define GNC_TEST_STUFF_H + +#include "config.h" + +#include +#include + +#include "test-stuff.h" + +#include "gnc-xml-helper.h" +#include "io-gncxml-gen.h" +#include "sixtp.h" + +#include "gnc-commodity.h" +#include "gnc-pricedb.h" +#include "guid.h" +#include "kvp_frame.h" +#include "date.h" +#include "Account.h" +#include "Query.h" + +gchar get_random_character(void); +gchar* get_random_string(void); +Timespec* get_random_timespec(void); +kvp_value* get_random_kvp_value(int type); + +struct _bin_data +{ + guchar *data; + int len; +}; +typedef struct _bin_data bin_data; + +bin_data* get_random_binary_data(void); + +kvp_frame* get_random_kvp_frame(void); +gint64 get_random_gint64(void); +double get_random_double(void); +gnc_numeric get_random_gnc_numeric(void); +gnc_commodity* get_random_gnc_commodity_ref(void); +GUID* get_random_guid(void); +GList* get_random_glist(void); +gint get_random_int_in_range(int start, int end); +const char* get_random_string_in_array(const char* str_list[]); +gboolean get_random_boolean(void); + +GNCPrice * get_random_price(void); +Account* get_random_account(void); +Split* get_random_split(gnc_numeric num); +Transaction* get_random_transaction(void); +gnc_commodity* get_random_commodity(void); +const char *get_random_commodity_namespace(void); + +Query* get_random_query(void); + +/**/ +void write_dom_node_to_file(xmlNodePtr node, int fd); + +int files_compare(const gchar* f1, const gchar* f2); + +gboolean print_dom_tree(gpointer data_for_children, GSList* data_from_children, + GSList* sibling_data, gpointer parent_data, + gpointer global_data, gpointer *result, + const gchar *tag); + +/**/ +gboolean check_dom_tree_version(xmlNodePtr node, gchar *verstr); +gboolean equals_node_val_vs_string(xmlNodePtr node, const gchar* str); +gboolean equals_node_val_vs_guid(xmlNodePtr node, const GUID *id); +gboolean equals_node_val_vs_commodity(xmlNodePtr node, + const gnc_commodity *com); +gboolean equals_node_val_vs_kvp_frame(xmlNodePtr node, const kvp_frame *frm); +gboolean equals_node_val_vs_date(xmlNodePtr node, const Timespec tm); +gboolean equals_node_val_vs_int(xmlNodePtr node, gint64 val); + +void +test_files_in_dir(int argc, char **argv, gxpf_callback cb, + sixtp *parser, const char *parser_tag); + +#endif /* GNC_TEST_STUFF_H */ diff --git a/src/backend/file/test/grab-types.pl b/src/backend/file/test/grab-types.pl new file mode 100644 index 0000000000..48c0389c2d --- /dev/null +++ b/src/backend/file/test/grab-types.pl @@ -0,0 +1,51 @@ +#!/usr/bin/perl -w + +use strict; + +my $tag = shift @ARGV; +my $filename = shift @ARGV; +my $file_to_write_to_pattern = shift @ARGV; +my $files_written = ""; + +open(XMLFILE, $filename); + +sub write_file +{ + my $data = shift; + my $num = shift; + + my $towriteto = $file_to_write_to_pattern; + $towriteto =~ s/XXX/$num/; + + open(TOWRITE, ">$towriteto"); + + print TOWRITE $data; + + close TOWRITE; + + $files_written .= " $towriteto"; +} + +my $xml_header = "\n\n"; +my $to_write = $xml_header; +my $grabbing = 0; +my $grab_num = 0; + +while () { + if ($grabbing) { + $to_write .= $_; + if ($_ =~ m/\<\/$tag\>/) { + $to_write .= "\n"; + write_file($to_write, $grab_num); + $to_write = $xml_header; + $grab_num++; + $grabbing = 0; + } + } + elsif ($_ =~ m/\<$tag .*\>/) { + $grabbing = 1; + $to_write .= $_; + } +} + +print $files_written diff --git a/src/backend/file/test/test-dom-converters1.c b/src/backend/file/test/test-dom-converters1.c new file mode 100644 index 0000000000..45efe5984d --- /dev/null +++ b/src/backend/file/test/test-dom-converters1.c @@ -0,0 +1,254 @@ +#include "config.h" + +#include +#include + +#include + +#include "gnc-test-stuff.h" + +#include "gnc-xml-helper.h" +#include "gnc-engine-util.h" +#include "sixtp.h" +#include "sixtp-parsers.h" +#include "sixtp-utils.h" +#include "sixtp-dom-parsers.h" +#include "sixtp-dom-generators.h" + +#include "gnc-commodity.h" +#include "guid.h" + +static void +test_dom_tree_to_commodity_ref(void) +{ + int i; + for(i = 0; i < 20; i++) + { + gnc_commodity *test_com1; + gchar *test_str1; + gchar *test_str2; + gnc_commodity *test_com2; + xmlNodePtr test_node; + + test_str1 = get_random_string(); + test_str2 = get_random_string(); + + test_com1 = gnc_commodity_new(NULL, test_str1, test_str2, NULL, 0); + test_node = commodity_ref_to_dom_tree("test-com", test_com1); + + test_com2 = dom_tree_to_commodity_ref_no_engine(test_node); + + do_test(gnc_commodity_equiv(test_com1, test_com2), + "dom_tree_to_commodity_ref_no_engine"); + + xmlFreeNode(test_node); + gnc_commodity_destroy(test_com1); + gnc_commodity_destroy(test_com2); + g_free(test_str1); + g_free(test_str2); + } +} + +static void +test_dom_tree_to_text(void) +{ + int i; + + for(i = 0; i < 20; i++) + { + gchar *test_string1; + gchar *test_string2; + xmlNodePtr test_node; + + test_node = xmlNewNode(NULL, "test-node"); + test_string1 = get_random_string(); + + xmlNodeAddContent(test_node, test_string1); + + test_string2 = dom_tree_to_text(test_node); + + if(!test_string2) + { + failure_args("dom_tree_to_text", __FILE__, __LINE__, + "null return from dom_tree_to_text"); + xmlElemDump(stdout, NULL, test_node); + } + else if(safe_strcmp(test_string1, test_string2) == 0) + { + success_args("dom_tree_to_text", __FILE__, __LINE__, "with string %s", + test_string1); + } + else + { + failure_args("dom_tree_to_text", __FILE__, __LINE__, + "with string %s", test_string1); + } + + xmlFreeNode(test_node); + g_free(test_string1); + if(test_string2) g_free(test_string2); + } +} + + +static void +test_dom_tree_to_timespec(void) +{ + int i; + for(i = 0; i < 20; i++) + { + Timespec *test_spec1; + Timespec *test_spec2; + xmlNodePtr test_node; + + test_spec1 = get_random_timespec(); + + test_node = timespec_to_dom_tree("test-spec", test_spec1); + + test_spec2 = dom_tree_to_timespec(test_node); + + if(test_spec2 == NULL) + { + failure_args("dom_tree_to_timespec", + __FILE__, __LINE__, "NULL return"); + printf("Node looks like:\n"); + xmlElemDump(stdout, NULL, test_node); + printf("\n"); + } + + else if(timespec_cmp(test_spec1, test_spec2) == 0) + { + success("dom_tree_to_timespec"); + } + else + { + failure("dom_tree_to_timespec"); + printf("Node looks like:\n"); + xmlElemDump(stdout, NULL, test_node); + printf("\n"); + printf("Secs are %lld vs %lld :: ", + test_spec1->tv_sec, + test_spec2->tv_sec); + printf("NSecs are %ld vs %ld\n", + test_spec1->tv_nsec, + test_spec2->tv_nsec); + } + + g_free(test_spec1); + g_free(test_spec2); + xmlFreeNode(test_node); + } +} + +static gchar * +test_gnc_nums_internal(gnc_numeric to_test) +{ + gchar *ret = NULL; + gnc_numeric *to_compare = NULL; + xmlNodePtr to_gen = NULL; + + to_gen = gnc_numeric_to_dom_tree("test-num", &to_test); + if(!to_gen) + { + ret = "no dom tree created"; + } + else + { + to_compare = dom_tree_to_gnc_numeric(to_gen); + if(!to_compare) + { + ret = "no gnc_numeric parsed"; + } + else + { + if(!gnc_numeric_equal(to_test, *to_compare)) + { + ret = "numerics compared different"; + } + } + } + + if(to_compare) + { + g_free(to_compare); + } + if(to_gen) + { + xmlFreeNode(to_gen); + } + + return ret; +} + +static void +test_dom_tree_to_gnc_numeric(void) +{ + int i; + + for(i = 0; i < 20; i++) + { + gchar *message = NULL; + + message = test_gnc_nums_internal(get_random_gnc_numeric()); + + do_test_args(message == NULL, "dom_tree_to_gnc_numeric", + __FILE__, __LINE__, message); + } + + { + gchar *message = NULL; + + message = test_gnc_nums_internal + (gnc_numeric_create(18768786810, 100000)); + + do_test_args(message == NULL, "gnc_num 18768786810/100000", + __FILE__, __LINE__, message); + } +} + + +static void +test_dom_tree_to_guid(void) +{ + int i; + for(i = 0;i < 20; i++) + { + GUID *test_guid1; + GUID *test_guid2; + xmlNodePtr test_node; + + test_guid1 = get_random_guid(); + + if (!(test_node = guid_to_dom_tree("test-guid", test_guid1))) + { + failure_args("guid_to_dom_tree", __FILE__, __LINE__, + "conversion to dom tree failed"); + } + + test_guid2 = dom_tree_to_guid(test_node); + + do_test(guid_equal(test_guid1, test_guid2), + "dom_tree_to_guid" ); + + xmlFreeNode(test_node); + g_free(test_guid1); + g_free(test_guid2); + } +} + +int +main(int argc, char **argv) +{ + test_dom_tree_to_guid(); + fflush(stdout); + test_dom_tree_to_commodity_ref(); + fflush(stdout); + test_dom_tree_to_text(); + fflush(stdout); + test_dom_tree_to_timespec(); + fflush(stdout); + test_dom_tree_to_gnc_numeric(); + fflush(stdout); + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-dom-parser1-1.xml b/src/backend/file/test/test-dom-parser1-1.xml new file mode 100644 index 0000000000..673af6ee2a --- /dev/null +++ b/src/backend/file/test/test-dom-parser1-1.xml @@ -0,0 +1,14 @@ + + + + + is a silly idea + + is nothing you can do + + I'll try to shoot + + + the foot + + diff --git a/src/backend/file/test/test-dom-parser1.c b/src/backend/file/test/test-dom-parser1.c new file mode 100644 index 0000000000..1ca91a8115 --- /dev/null +++ b/src/backend/file/test/test-dom-parser1.c @@ -0,0 +1,73 @@ +#include "config.h" + +#include +#include + +#include + +#include "gnc-test-stuff.h" + +#include "gnc-xml-helper.h" +#include "sixtp.h" +#include "sixtp-parsers.h" +#include "sixtp-utils.h" + +static void parse_file(char *filename, sixtp *parser); + +static sixtp* +get_parser1_1_parser1(void) +{ + sixtp *ret; + + ret = sixtp_new(); + g_return_val_if_fail(ret, NULL); + sixtp_set_chars(ret, allow_and_ignore_only_whitespace); + + sixtp_add_sub_parser(ret, "foobar", + sixtp_dom_parser_new(print_dom_tree, NULL, NULL)); + + return ret; +} + +static sixtp* +simple_parser(void) +{ + sixtp*ret; + ret = sixtp_new(); + sixtp_set_chars(ret, allow_and_ignore_only_whitespace); + return ret; +} + +static sixtp* +get_parser1_1_parser2(void) +{ + sixtp *ret; + sixtp *foobarer; + + ret = simple_parser(); + foobarer = simple_parser(); + + sixtp_add_sub_parser(ret, "foobar", foobarer); + sixtp_add_sub_parser(foobarer, "blah", + sixtp_dom_parser_new(print_dom_tree, NULL, NULL)); + sixtp_add_sub_parser(foobarer, "you", + sixtp_dom_parser_new(print_dom_tree, NULL, NULL)); + return ret; +} + +int +main(int argc, char **argv) +{ + parse_file("test-dom-parser1-1.xml", get_parser1_1_parser1()); + parse_file("test-dom-parser1-1.xml", get_parser1_1_parser2()); + exit(0); +} + +static void +parse_file(char *filename, sixtp* parser) +{ + printf("STARTING: %s\n", filename); + sixtp_parse_file(parser, filename, NULL, (gpointer)stdout, NULL); + printf("\nENDING: %s\n", filename); + sixtp_destroy(parser); +} diff --git a/src/register/.cvsignore b/src/backend/file/test/test-files/.cvsignore similarity index 77% rename from src/register/.cvsignore rename to src/backend/file/test/test-files/.cvsignore index 051d1bd50b..282522db03 100644 --- a/src/register/.cvsignore +++ b/src/backend/file/test/test-files/.cvsignore @@ -1,3 +1,2 @@ Makefile Makefile.in -.deps diff --git a/src/backend/file/test/test-files/Makefile.am b/src/backend/file/test/test-files/Makefile.am new file mode 100644 index 0000000000..4e53d89a0b --- /dev/null +++ b/src/backend/file/test/test-files/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = xml2 diff --git a/src/backend/file/test/test-files/xml1/.cvsignore b/src/backend/file/test/test-files/xml1/.cvsignore new file mode 100644 index 0000000000..7d3afa6f25 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/.cvsignore @@ -0,0 +1,3 @@ +*.LNK +*.LCK +*.xac diff --git a/src/backend/file/test/test-files/xml1/Money95bank_fr.gml b/src/backend/file/test/test-files/xml1/Money95bank_fr.gml new file mode 100644 index 0000000000..8a7d0da4be --- /dev/null +++ b/src/backend/file/test/test-files/xml1/Money95bank_fr.gml @@ -0,0 +1,4968 @@ + + + 1 + + + + + Compte courant + de3be9d4e8f598584db381c56092f351 + BANK + + ISO4217 + USD + + + + + + Livret bleu + cfb34c39585b58904baa3c1f9be9b8c4 + BANK + + ISO4217 + USD + + + + + + Salaire + 547e0f4df1fb2f3a124f09cddd90add4 + INCOME + + ISO4217 + USD + + + + + + Primes + 4840ebbf3d52f81ad87acd6f79b4cb6d + INCOME + + ISO4217 + USD + + + 547e0f4df1fb2f3a124f09cddd90add4 + + + + + + Salaire net + 6de38f0a8881dd2368610d32363fb463 + INCOME + + ISO4217 + USD + + + 547e0f4df1fb2f3a124f09cddd90add4 + + + + + + Alimentation + fb45010dd73162faf7870d23451773e7 + EXPENSE + + ISO4217 + USD + + + + + + Epicerie + 63ab8d5de094c6ac7c11ae06645ea667 + EXPENSE + + ISO4217 + USD + + + fb45010dd73162faf7870d23451773e7 + + + + + + Restaurant + b9e482629dfadf0675facd9bbf76d4f3 + EXPENSE + + ISO4217 + USD + + + fb45010dd73162faf7870d23451773e7 + + + + + + Assurance + 24e0d1cb0af579d19129ec79f16f9205 + EXPENSE + + ISO4217 + USD + + + + + + Automobile + e89232e4cdd3a66a5c3b229cea2d0fda + EXPENSE + + ISO4217 + USD + + + 24e0d1cb0af579d19129ec79f16f9205 + + + + + + Multi-risques habitation + 472918bd0bf48e41f507878041efcb4d + EXPENSE + + ISO4217 + USD + + + 24e0d1cb0af579d19129ec79f16f9205 + + + + + + Automobile + 343f5c0ccf4c7a3d54443ece59073d4c + EXPENSE + + ISO4217 + USD + + + + + + Crédit auto + 56c0e0eae313a1804d8d1183166a34af + EXPENSE + + ISO4217 + USD + + + 343f5c0ccf4c7a3d54443ece59073d4c + + + + + + Essence + b5ff22c2b91ca04c20a36782d9c750cc + EXPENSE + + ISO4217 + USD + + + 343f5c0ccf4c7a3d54443ece59073d4c + + + + + + Cadeaux + 324d517fa7427163088ed8a2422b4943 + EXPENSE + + ISO4217 + USD + + + + + + Divers + d9f9dda3d1a61bd15b3b4c67b40c2769 + EXPENSE + + ISO4217 + USD + + + + + + Fournitures diverses + cbfd18621567322c77b9a5b3d6aa3a49 + EXPENSE + + ISO4217 + USD + + + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + + + + Déplacements prof. + 3af7ef0f555aa2a41d75d034c6afd436 + EXPENSE + + ISO4217 + USD + + + + + + Frais de transport + 96f0ca2b62ae6909cac058d1b876f6ef + EXPENSE + + ISO4217 + USD + + + 3af7ef0f555aa2a41d75d034c6afd436 + + + + + + Frais bancaires + 011ba398b7c38291d50cd10de44d4710 + EXPENSE + + ISO4217 + USD + + + + + + Personnels + ef0041623a6b317860e84b847af785c7 + EXPENSE + + ISO4217 + USD + + + 011ba398b7c38291d50cd10de44d4710 + + + + + + Frais financiers + e6501ba2005ac400866b117379443af3 + EXPENSE + + ISO4217 + USD + + + + + + Autres frais + a673b6830d9fdc782ed408168f6b4f06 + EXPENSE + + ISO4217 + USD + + + e6501ba2005ac400866b117379443af3 + + + + + + Habillement + 674e7f3ba414c8c31b93282247b04213 + EXPENSE + + ISO4217 + USD + + + + + + Impôts + 0a5c854c367926d4ce7ffaa60f99a85a + EXPENSE + + ISO4217 + USD + + + + + + Impôts sur le revenu + 0a5d0546390d60dab623114e6f136d7a + EXPENSE + + ISO4217 + USD + + + 0a5c854c367926d4ce7ffaa60f99a85a + + + + + + Logement + 436e114c09ccaa489be81be1a24f1656 + EXPENSE + + ISO4217 + USD + + + + + + Loyer + 779db6be3d2098d0a2561322f43612c9 + EXPENSE + + ISO4217 + USD + + + 436e114c09ccaa489be81be1a24f1656 + + + + + + Loisirs + ae47cf420aa54ba58fb1906b4edba98f + EXPENSE + + ISO4217 + USD + + + + + + Canal Plus-Câble + 6a2a8fed6fbad778df8a5292148d1582 + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Cinéma-Théâtre + b2a4e65fd87146b8199f46c31fa215f1 + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Disques-cassettes + 52a3df54b9e7fb80b22e64a2572a89bb + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Equipement + d7620d56c56e8b2cb0e052411f12cd0a + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Livres-Journaux + 6406d28576114d95f1a6d9561a0b65e3 + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Photographie + 9c0f50a450219f9275d7c4ae3b3cbaa9 + EXPENSE + + ISO4217 + USD + + + ae47cf420aa54ba58fb1906b4edba98f + + + + + + Maison + a648b21f385e784fbe2b26cb3f718a79 + EXPENSE + + ISO4217 + USD + + + + + + Chauffage + d04143b5e1486b50f154614b3369ba9c + EXPENSE + + ISO4217 + USD + + + a648b21f385e784fbe2b26cb3f718a79 + + + + + + Electricité + a74cdda295ca3f404ca97a5e94a564c3 + EXPENSE + + ISO4217 + USD + + + a648b21f385e784fbe2b26cb3f718a79 + + + + + + Téléphone + 3a6503c7c577f1beb48a620e905b207d + EXPENSE + + ISO4217 + USD + + + a648b21f385e784fbe2b26cb3f718a79 + + + + + + Mobilier + 8f5104499ca8138b3c48f5c900d7b285 + EXPENSE + + ISO4217 + USD + + + + + + Cuisine-Salle de bains + d0a283d1c384e5ee67f2135f308688bb + EXPENSE + + ISO4217 + USD + + + 8f5104499ca8138b3c48f5c900d7b285 + + + + + + Eclairage + 11f39397fe9ff09741bb4d9530b21945 + EXPENSE + + ISO4217 + USD + + + 8f5104499ca8138b3c48f5c900d7b285 + + + + + + Electro-ménager + 3b925233706cf676b2e8f40054f34a68 + EXPENSE + + ISO4217 + USD + + + 8f5104499ca8138b3c48f5c900d7b285 + + + + + + Santé + 1c3053f62d72017f9faacec828e3b874 + EXPENSE + + ISO4217 + USD + + + + + + Dentiste + 5816cdbc45a11a5747f7ca286550c73a + EXPENSE + + ISO4217 + USD + + + 1c3053f62d72017f9faacec828e3b874 + + + + + + Ordonnances + 672b9edafeae9eb5c17316688678ee3d + EXPENSE + + ISO4217 + USD + + + 1c3053f62d72017f9faacec828e3b874 + + + + + + Soins personnels + 5d9afede4f8d14de29b0f64ebd23a649 + EXPENSE + + ISO4217 + USD + + + + + + Coiffeur + 1e52527b3d343c4719a265a454753df7 + EXPENSE + + ISO4217 + USD + + + 5d9afede4f8d14de29b0f64ebd23a649 + + + + + + Vacances + 37563222f8bfa2ef6edb653a3b492d0b + EXPENSE + + ISO4217 + USD + + + + + + Devises + 13e72266b7b88c8bb23d747dbd3ebd23 + EXPENSE + + ISO4217 + USD + + + 37563222f8bfa2ef6edb653a3b492d0b + + + + + + Voyage + 592d53a1ecb323212d3e1da50239473f + EXPENSE + + ISO4217 + USD + + + 37563222f8bfa2ef6edb653a3b492d0b + + + + + + Retained Earnings + afe841ab5436faa629103cfbb93c6a74 + EQUITY + + ISO4217 + USD + + + + + + 9643f159a0522e203df526c2125ccdd4 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 167565000 + + Opening Balance + + cb07c0c9643bbb7e16743e26928ccb18 + n + -576236/100 + -576236/100 + afe841ab5436faa629103cfbb93c6a74 + + + b801cbac54167138bf1830bdfe2796ad + y + 576236/100 + 576236/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ed5de8fcc01dc81be4c931546ed28b93 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 183423000 + + Canal Satellite + + 174946258a987b2006dc2d9ecfeda659 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + cce41a8d7fb5cdd0245bf1ef68cebcba + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b1ca331fcc284e01738c702211844ddb + + 1995-01-03 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 186234000 + + Cash + + 264d351fb20bc1ad062a668d8f664b37 + n + 35700/100 + 35700/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 660500d26e458892526029eeac2c205e + Disquettes + n + 7500/100 + 7500/100 + 52a3df54b9e7fb80b22e64a2572a89bb + + + 6094e7577fc4d00d36ef503585c14aeb + n + 6800/100 + 6800/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 5c8668fe8f35fbd275c83f900eccafe1 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 58a662ebe98a022355d07b86f13ad55b + 6351 + + 1995-01-05 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 188671000 + + MACIF + + 3b0948d446002b8982704b31c260be0e + Assurance appartement/vie + n + 83761/100 + 83761/100 + 472918bd0bf48e41f507878041efcb4d + + + d097d21a2c40065bb839c77f083edc3e + Assurance appartement/vie + y + -83761/100 + -83761/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 067bfaa1146c6a98dc32f18c8deeea41 + + 1995-01-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 203492000 + + E.D.F. + + f8cd0aa3f9dcee3ff01935dfffad0c38 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + a91163ada8711c702b55888636dd42b4 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 1892990631606792b4db6cb71caf4a5d + + 1995-01-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 205833000 + + Employeur + + 111dd486387133db464d5c39592bea71 + Prime de fin d'année + n + -400000/100 + -400000/100 + 4840ebbf3d52f81ad87acd6f79b4cb6d + + + accbf5fbf4804eae2935da86449e2a34 + Prime de fin d'année + y + 400000/100 + 400000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d82af5e8d601582abbc4129959065253 + 6352 + + 1995-01-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 208154000 + + Intermarché + + a7bc6259cfc9b39e77c6d6b410ec11d9 + n + 25650/100 + 25650/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 5d6040d6929390f59e7ed3ce011fb2e9 + y + -25650/100 + -25650/100 + de3be9d4e8f598584db381c56092f351 + + + + + + df17330745d5a6e5052e60b53eee27aa + 6353 + + 1995-01-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 210949000 + + Propriétaire + + aa083e6f07b56377db5d645ecef0d0c2 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 86f7092a06e6746459016860ab8678a9 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 745b3a8912254f8573b35c5c83f25170 + + 1995-01-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 213577000 + + France Télécom + + e251d07209a3e92ff77b78eb5fe7b5dd + n + 34225/100 + 34225/100 + 3a6503c7c577f1beb48a620e905b207d + + + 460defb163ef958152d809755884120f + y + -34225/100 + -34225/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 6d10f67b15184edc013326d5ea6fa77c + + 1995-01-18 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 215972000 + + Cash + + d461e06ec5d2a570535441d3b93a2cb5 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + ef030f9bc687bd4da2ba4d5633429dfb + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 96b32acde3ad762189dcd1d50a34bcd4 + 6354 + + 1995-01-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 218347000 + + RATP + + 57f446c0615ddadb81acd6da5c9c1164 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + d4d8ce1b7f8d3201464f7aa8ee1201e0 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 0265712bd16817e7e4b32a69831f80d6 + + 1995-01-24 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 221853000 + + Cash + + 200cfdd593539c6dcc5b294d0e9e0687 + Retrait distributeur + n + 25000/100 + 25000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 03b5e2bbba407adb80d9a76b4f514792 + Retrait distributeur + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 99883512582728a299b53a30a70fd22a + + 1995-01-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 224353000 + + Employeur + + 9e1efea30615ab86e4451725e50a1bbc + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + d1b101b3e5a3b7b4325b6a32af15b820 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ba3ef8eafa91005c6aafe34992d6c876 + + 1995-01-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 226714000 + + + 577b4939e60f5a6d7978ce2ec3096de7 + Economies + n + 250000/100 + 250000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 7bf6cd575f3d4e632a2304fb2fe59327 + Economies + y + -250000/100 + -250000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b466968f727ac90afb88ac2afdef39c1 + + 1995-02-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 229067000 + + Canal Satellite + + 437027d363ebc37e25c093847cdfacbe + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 70cd6712d436e84f7c94732acd403113 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 8d07b6b5b83036d3665f86b8abe9310e + + 1995-02-02 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 232995000 + + Cash + + b75eff0b712d13288b6ce7476eb04127 + n + 41600/100 + 41600/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 233de55d9e2ed1fba21854a410c02e43 + n + 8400/100 + 8400/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 7a7a64805120e6cd75071d7779fb5bc9 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ac9b873ae20a4cb77e2533d27917b1cd + 6355 + + 1995-02-07 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 235421000 + + Restaurant Saint-Paul + + 004fd03693c3c7880fad5bcc57ef3780 + n + 32700/100 + 32700/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 4a9c571eb8489060a0ec2fcc3af95258 + y + -32700/100 + -32700/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7781b87fc3ee84b2c16a173ae705b8c9 + 6356 + + 1995-02-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 237851000 + + Centre des Impôts + + 6541a71714ce087f2ab837717606d620 + 1er tiers + n + 415869/100 + 415869/100 + 0a5d0546390d60dab623114e6f136d7a + + + fc289b2f702ac718a7ff51714dc3cf3f + 1er tiers + y + -415869/100 + -415869/100 + de3be9d4e8f598584db381c56092f351 + + + + + + aed0d7c65a9539e677ad6f612ff6c970 + 6357 + + 1995-02-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 248545000 + + Propriétaire + + 20f24bcba69db1efa10312d2cba31827 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 001aff4b1b9205f610f08b5191aba0cf + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f4e84f0e270f573810ee3c81ea8dcb2b + + 1995-02-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 251624000 + + Cash + + f07b254d6bc44371af9d3ac81f6b8b41 + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + efc203663e7f443a4f28a223d5903204 + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 5710c51ecc97916484217b4c1017d0e8 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 697d53f57fd11d6b05f342fd73e90380 + 6358 + + 1995-02-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 254112000 + + RATP + + c4d57ee46e92a2321f02c87f5e1e123b + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5589562c40258757028a4b0af3d5fc4d + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f0859433a7cf73cc85bd680e79596f5e + + 1995-02-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 256503000 + + Employeur + + 4b3e39d494c3553530523f6f14e3abd5 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 730979124e6b32a5546e825c2b906015 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b1f807d8d972858334f6b7cd543d7949 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 258906000 + + + 15ce8733ce77fc910f4bbc432d5e4546 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 5d25ba0a388a0bde9f65bd0e6d93a37b + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d385a9795d2853dee693d6027c33d383 + 6359 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 263748000 + + Carrefour + + b5e893a57342e35d9a4d6bbcc84f2185 + n + 18180/100 + 18180/100 + fb45010dd73162faf7870d23451773e7 + + + 73f6e148bf18fcb1a72cfddd728c4bbe + y + -18180/100 + -18180/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 08efefeff498f0a42009b3a46490d7e6 + 6360 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 266339000 + + SNCF + + 97a54adc68b0b7bcf31305aeb707d92f + n + 59600/100 + 59600/100 + 592d53a1ecb323212d3e1da50239473f + + + 084daa6f396f54c0c7f8c2291720f145 + y + -59600/100 + -59600/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 2473301bd952ece04b6280ad3afee778 + + 1995-02-28 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 268792000 + + Cash + + fd9570528262189fe95a169c78cdd6da + Retrait distributeur + n + 20000/100 + 20000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 61f05a2876395638db92b0e3a97eb32f + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 8301607cbdb90859c1bced0a531e6891 + + 1995-03-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 271678000 + + Canal Satellite + + 33db282a73377efe06474424e746e706 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + a930bcc474375df088f071415c1275a0 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 6af8c26792ecd6cb00905893997bbe4e + + 1995-03-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 274153000 + + E.D.F. + + bd73504fafd4568090772d654dca10b7 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + 4a79326b4690055ac6e3e3ef3fffe47d + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 10dadb1570d588282ad318bcbcb1aa85 + 6361 + + 1995-03-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 276654000 + + Propriétaire + + 953ad1020f5c5671e086505c240cdac1 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + ebc91eec16a7e8cd73e8fd1cc9561693 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + bbfb01e2de3b2d13044ac5d7bf05829b + + 1995-03-14 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 279359000 + + Cash + + 2b68ac0f310937925d5638c4f558a39f + n + 38600/100 + 38600/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + cc47bcb3cd4d876b12a37cc57202b88f + n + 11400/100 + 11400/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 3829d69956cd099ea858643b0ef650a6 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7c245360fc50657ac97c1665ba1cf7ff + 6362 + + 1995-03-15 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 282341000 + + Senzo Alimentation + + f7abb8b243600a8bf9d488fe933356c9 + n + 20910/100 + 20910/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 6df85419570d325e30c8480419a90d5f + y + -20910/100 + -20910/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d383f0a0676f4ffc80f72b6101c75f67 + + 1995-03-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 284285000 + + France Télécom + + 3cb2fe62d682065c8e68601e9c436467 + n + 21286/100 + 21286/100 + 3a6503c7c577f1beb48a620e905b207d + + + b8bb75b3ddcb18ffa4e0209c0d8223fe + y + -21286/100 + -21286/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7c3db6a038d2911b42b923b36fa98af7 + 6363 + + 1995-03-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 285984000 + + Interflora + + 1cc7927b08860218d975045f48204f71 + Pour Hélène... + n + 16000/100 + 16000/100 + 324d517fa7427163088ed8a2422b4943 + + + b726807deceb214465c4a8f462a6c06b + Pour Hélène... + y + -16000/100 + -16000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 54e7a97ba00d52e72ea6b96730afb238 + + 1995-03-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 287674000 + + Cash + + 24bcc4e7cb201c5471f5a8da93775e80 + Retrait distributeur + n + 15000/100 + 15000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 6265b1aa70523dddea71570cdb023caf + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f2e2f7531e3eab3d2ae1c2416407e925 + + 1995-03-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 289339000 + + Employeur + + 470d2554d1c191d6977275af99e17671 + n + -1005390/100 + -1005390/100 + 6de38f0a8881dd2368610d32363fb463 + + + 7ad973a1af2ef78238f4ebe8659d0486 + y + 1005390/100 + 1005390/100 + de3be9d4e8f598584db381c56092f351 + + + + + + a27379eaf9cfa31587a4548863eca708 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 292612000 + + + b1b72a14fa1cb0cb2fd4d4c919a92287 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 82948fab247b06f8615e0f0726313d04 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ea88fbe8a0d670ae76b492e47148fce3 + 6365 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 294495000 + + RATP + + 6b259b9869d9df2d9d8e80216b674d29 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5e6d23c4a962f5722643fd0f50cc0b72 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 55bbe99b34e19dfbba1c9141a8994db2 + 6364 + + 1995-03-30 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 297133000 + + Carrefour + + 8ea9aab1bbd60804490d106cb8ae7c28 + n + 14665/100 + 14665/100 + d0a283d1c384e5ee67f2135f308688bb + + + 7732d0b3b5d0b5b4cb59d5ffaf386881 + n + 22650/100 + 22650/100 + 52a3df54b9e7fb80b22e64a2572a89bb + + + 8d119a98eb04a71be2fcba78a1d2ecbc + n + 15500/100 + 15500/100 + 674e7f3ba414c8c31b93282247b04213 + + + 3f852c1e1901a539bda0fec73705c979 + n + 4500/100 + 4500/100 + 11f39397fe9ff09741bb4d9530b21945 + + + 898c600e88ab3a3a9282b3a9e2c7bb68 + n + 11020/100 + 11020/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + bb915f97c631cea641f5da9f13bf74f1 + y + -68335/100 + -68335/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 5caacfb0608ec06a252b4709ea524941 + + 1995-03-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 299253000 + + Cash + + d912e38e2297c4e61f93c7554581357a + n + 34140/100 + 34140/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 8f8560e23cdc283e4645c07289b3e101 + FNAC + n + 5860/100 + 5860/100 + 9c0f50a450219f9275d7c4ae3b3cbaa9 + + + e317b5e73405e5ea7e586aee6cff5190 + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 3d7264cf91c1a92441799415e9e4ebdc + + 1995-04-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 301715000 + + Canal Satellite + + cba4c8d290e19be9bf37684f6b051422 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 1978e141ce4f4de81d377f87248eb8b6 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 0094a3b4076b9b8112a6d07b05a118ec + + 1995-04-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 303495000 + + Cash + + 20f153574d00620c9c520c103b1d3fcc + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + fd3730b50f858802aeea0a5337b4e960 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ef75cabe8325a376f9461e60bc2c87d1 + 6366 + + 1995-04-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 305222000 + + Propriétaire + + 84a279b745056859c0946bd20f87c1ad + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + e23caec6ee52954c230ed107b74fd436 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 8baad80b1b4ee539229b8d3d8dad2f04 + 6367 + + 1995-04-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 307007000 + + RATP + + b9ae847bbb5897ec534d39aa1de36bf2 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + a0ec6e318b400889f4cfc2c892a4b293 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 5b2bf3a7f76b84597fb70125790a6a21 + + 1995-04-23 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 309211000 + + Cash + + 1d309078a0d8d737b3eb896e8eee5994 + n + 16400/100 + 16400/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 8b4868ab051ead7252f824e21a0e2827 + n + 8600/100 + 8600/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + b1d7bd0d2dfa2d268d2a1eb3b0bd01cb + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 75692d6bccefd4a3a3bfd25ca219bc3b + y + -35000/100 + -35000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + c04781886177cc54567d43d57e29e51d + + 1995-04-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 314980000 + + Employeur + + d9b436a4f2a0d1bcf39f585176894fe1 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + a97844b69dfbd92abd7c249d5bcf8c84 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 9e6dc1d3ed796ddf62dcfb7bc624cf99 + + 1995-04-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 317563000 + + + f69ff88e9d2f481c21864fda2862dc94 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 790698573620832ac06cbe0e837d0a2e + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 94e1cae214f99ded0c496e35c6bb195a + + 1995-05-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 322056000 + + Canal Satellite + + 62d6b24a6dd89e71126346f540b3a1bf + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + e3d33a03fe3980b7b8a0646811955d6b + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ffa20aa7c8297db7dec4f3d956b72407 + + 1995-05-02 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 324996000 + + Cash + + 1fafbc8d5ec0e96ba11e784da045dfaf + n + 44700/100 + 44700/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5d4e6f43743464ced237008428383902 + n + 5300/100 + 5300/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + be1f6f192d58c9f62f792edf9da8a3e9 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 9ab90db1ae4a9f94dcbbfe7ebf74e0bc + + 1995-05-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 327622000 + + E.D.F. + + 5bc5663f9fce7624151c29d5ee75c048 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + d588513b2dcc8c30b6ce10f4bb1816d7 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + a569d012402a6f678b10baa2a2610413 + + 1995-05-09 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 332010000 + + Cash + + 11a513b16d10607fc82d2833f7b8c420 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 09d33bb21dba13b02a879ef2fa419389 + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 3b241208a447c421a2f141897e40e8d2 + 6368 + + 1995-05-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 334793000 + + Gaz de France + + 370bed7d9e1994116e8be4905d524e0e + (exceptionnel) + n + 42500/100 + 42500/100 + d04143b5e1486b50f154614b3369ba9c + + + 90fea1066728a2b88f54ba5f04e6eecf + (exceptionnel) + y + -42500/100 + -42500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 14bcd23a9c272ba01c8790575d93195e + 6369 + + 1995-05-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 337431000 + + Propriétaire + + 916da32758c23c3d162805030dbd3e97 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 7dbd58662428565ce5ec8bea0ec920e9 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 0bfb10b9c5ab2b53d26f319803b1cf4f + 6370 + + 1995-05-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 340082000 + + Intermarché + + 92e4346fe5c3ede19898c591030238f7 + n + 29950/100 + 29950/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 4560960472c979dfb7d25bb34aa05563 + y + -29950/100 + -29950/100 + de3be9d4e8f598584db381c56092f351 + + + + + + e95766339f5c1c31ecc1870a7f04dac3 + + 1995-05-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 356863000 + + France Télécom + + f645aea37c114f3a7cd87eebda33430c + n + 40311/100 + 40311/100 + 3a6503c7c577f1beb48a620e905b207d + + + 7f293aa4719537f9936372118b545922 + y + -40311/100 + -40311/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d57af6327f7d3b06f6ffe074e768e09d + + 1995-05-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 359576000 + + Cash + + 2dfb9c4e79e6456fe570adfcd64648b6 + Retrait distributeur + n + 60000/100 + 60000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 33b2b9f9aeadc8a85a6c42a746faf911 + Retrait distributeur + y + -60000/100 + -60000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 9dcdd812d2419a8e6d649c5e95b62d61 + 6371 + + 1995-05-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 362888000 + + La Bonne Franquette + + 2ce923e0fea7d2116960c051221ab0c4 + n + 11000/100 + 11000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 58d143c96f80044cdd255587aecc25ac + y + -11000/100 + -11000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + fe95baf6d4e15b865e526720ec21d688 + + 1995-05-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 365525000 + + Employeur + + d30fcdbc8e23f08100a5b5ee38146ad9 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 320d4de22b3d7600a8f653844eaf8b6c + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 49734566504a7358ab35af1ed41244e0 + + 1995-05-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 368171000 + + + 4c42a427d59303ec20b550763a62d27a + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 19d23b24962bce9128a2e995d704d630 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 93fd47f496bf5289b08d7e77c6818dc6 + 6372 + + 1995-05-29 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 372900000 + + RATP + + c216911d9abbd9e61e31a93549f4de25 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 8ff6666c809313b1693630047754cc58 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 863bb8cd20e4f3ac904110903fab57db + + 1995-05-30 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 375638000 + + Cash + + b47245c6af0e3eb5868cacc1169a3a1a + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 9b677ccd6338e0bb5686271e5f78c8d7 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + c29b96b9a0e2e2e7ae1aa00d66252f75 + + 1995-06-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 378315000 + + Canal Satellite + + d4783ba8f1523668fddfb06a0c22b927 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + b7e1342f782ebfc1b7eb706d5b6dc9a9 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 346de50ad5b9d67e6772420ff190fe06 + 6373 + + 1995-06-02 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 383273000 + + FNAC + + c192f01c5da803866442b8cb2c54182e + n + 14200/100 + 14200/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 06a3caa978b87934bd38d23470126cda + y + -14200/100 + -14200/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 3ee6837c82c4ee32be90497e1ca93e94 + + 1995-06-06 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 386246000 + + Cash + + c338ff5dca9aeaab3a24a8481786c781 + n + 41545/100 + 41545/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + fde73ab21d1cb68024789890fa99c5c3 + n + 8455/100 + 8455/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 8f1e8302717b2b917b856066a2af9ad8 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + bdb459884de124cc0e4785ce061199f1 + 6375 + + 1995-06-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 389039000 + + Centre des Impôts + + bcd1f96e743a3159b102da59b0b9c9d0 + 2ème tiers + n + 415869/100 + 415869/100 + 0a5d0546390d60dab623114e6f136d7a + + + 54fd36753ee2647200e77958947777d3 + 2ème tiers + y + -415869/100 + -415869/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 6e6259844ab3bf7628dd1b629f569161 + 6376 + + 1995-06-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 398857000 + + Gaz de France + + 0c17a92efb7bff44bf8a49f68a9e4359 + (exceptionnel) + n + 16500/100 + 16500/100 + d04143b5e1486b50f154614b3369ba9c + + + 2d37f8b31aa19b02674a9bbba370eadb + (exceptionnel) + y + -16500/100 + -16500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 357a6578f4bc97601f789a994956b651 + + 1995-06-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 402216000 + + Cash + + 03c31f060dfff6c13793d4f7fe0cb44d + Retrait distributeur + n + 30000/100 + 30000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 259868bd3d6147b4be088be544e58f87 + Retrait distributeur + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + c2fa0f42fc76499c281e258c57d027c6 + 6378 + + 1995-06-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 405222000 + + Propriétaire + + 31bf13f3c9f965700690600ffd1df95f + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + d97f45cdf496746bc276090c515937d4 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 5b0f8e066bc92a2f7f25ed54c8da7ca6 + + 1995-06-20 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 407965000 + + Cash + + 42237f22921e089ab2782688dd33dc4f + Crêperie + n + 15000/100 + 15000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 69eb2af803222be1dd3492475958d954 + Crêperie + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 1edabfb6b2a1211a7b7a9a69bf7bf070 + 6380 + + 1995-06-20 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 413702000 + + RATP + + 25e24b78489a62196577b6cd1b3c7900 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 9095cf299d9101ddb91d4aab1410a857 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 28bc1c801c6c0aa16bb1bdcce27b5c1b + 6379 + + 1995-06-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 416534000 + + Nasa Electronics + + 1ab86e50ce8baefc233d2686c8dd1682 + Nouvelles enceintes + n + 184900/100 + 184900/100 + 3b925233706cf676b2e8f40054f34a68 + + + 4d03eb90f23e6efed5c74930e74284d0 + Nouvelles enceintes + y + -184900/100 + -184900/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d0ac192ea8d1aea0906d5c4779dc2290 + + 1995-06-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 419365000 + + Employeur + + f35b431be099a4376bc9cb0e4b19c403 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 086d39be8ee372db1e748c743afd656b + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + dfeaee9b9858f158bfa4cfa2fb82c082 + + 1995-06-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 422808000 + + + fbbf76647076be608fd7c8bc634a8dcb + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 31d2238fa846633700370ba9a2d474d8 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + dc0ba8106381f550322e26cffdf7b1d5 + + 1995-07-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 425562000 + + Canal Satellite + + a4d8ec360fe4b552773cbd66963689a2 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + bc8ba7ca4d6d8c9a01615e986bde6c55 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d721c6fb45b9fb1710fbd4a13fc8fccd + + 1995-07-04 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 428365000 + + Cash + + a2f3f754416e402441c040881b7b0f8f + Retrait distributeur + n + 30000/100 + 30000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5b25ddc23c27024cfb8ada402a1a4e00 + Retrait distributeur + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ed14be91c46bcd7d880da6b157276cc4 + 6381 + + 1995-07-07 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 432394000 + + U.G.C. + + e6e075097d0d4ff6d64829848fcf243f + Carte UGC 10 places + n + 38000/100 + 38000/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 2f20797ab29e0537165d4947ed89dd17 + Carte UGC 10 places + y + -38000/100 + -38000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 66b5c99f72b1be0ba9426d38e076f8d7 + + 1995-07-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 435165000 + + E.D.F. + + 1f0cb5a12dcdae0ce28f7ca3875b47a7 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + 4dc05332a84abd4c691fc33cf1e7a88c + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 8e0aca938ddc76a9ee590f6075c84eee + 6382 + + 1995-07-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 437958000 + + Propriétaire + + fca544a05f29062d58ccb9cb71a078e5 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 66c92335291df89b8a7a6b09a391a3f1 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 1e2fb202b6ba42aed5d81e456215986d + 6383 + + 1995-07-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 442987000 + + Gaz de France + + 79913dc5716fe5f3942c6831bb1a0240 + (exceptionnel) + n + 16500/100 + 16500/100 + d04143b5e1486b50f154614b3369ba9c + + + 94689fc4c2b537c199edc5128c2805a8 + (exceptionnel) + y + -16500/100 + -16500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 2a5d5f33fd190f683e2249cbb41fd601 + + 1995-07-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 445826000 + + France Télécom + + a40615dc6726c1b80fff5d1dea7926af + n + 35977/100 + 35977/100 + 3a6503c7c577f1beb48a620e905b207d + + + 84f2e5011ec4b3ac339435dfa22b3c20 + y + -35977/100 + -35977/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 07d5f8168f78782b53a78e587e4b3baa + + 1995-07-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 448887000 + + Cash + + 4ade33c9d2f62b848fe74e285d3ce043 + n + 46535/100 + 46535/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + ab890532f750a21eadd9334a8d1fefd6 + n + 13465/100 + 13465/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 8de059eb363f9235196f2bb3209285c9 + y + -60000/100 + -60000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + cf0f388ab6e2e89c4dc39a2ff142e35f + 6384 + + 1995-07-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 453674000 + + RATP + + d7ee8ee70edfb170bee542f02dfca8a5 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5f19d59b55876014b745dc2e71650bf5 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 82a2af377157b6ca5c98651469611526 + + 1995-07-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 456495000 + + Employeur + + 86c0122071730b21f67e407a7d1e96f1 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + c80b69ab4998dbd95168893af0fdfb8a + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 26049300752338235172eea036ac4f6c + + 1995-07-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 459319000 + + Cash + + 1fd9b0d80a0811bd367f3b1bd5cba11e + Soirée entre amis + n + 25000/100 + 25000/100 + d7620d56c56e8b2cb0e052411f12cd0a + + + 0f2fe8868576abf6d57f5ec055971fb3 + Soirée entre amis + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f4b99fc3e1cf46731d530696a44fc404 + + 1995-07-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 462946000 + + + 9b6ac2304426d8330553cca37ddb3665 + Economies + n + 250000/100 + 250000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 0911a2bef06dfa1ac942e8541ad9bb01 + Economies + y + -250000/100 + -250000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + fba574e0bac22371b60ce84a97280dc8 + + 1995-08-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 466061000 + + Crédit Mutuel + + 69822db9b83e409a2d79d5e3c4c14b5a + Intérêts + n + 14927/100 + 14927/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 2fa9c46c5aea8e797ef466a0ef842b0b + Capital + n + 406387/100 + 406387/100 + 56c0e0eae313a1804d8d1183166a34af + + + ee1ade23ed8dfe4ab537448bbb79baae + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 743cac2d56954e70925eff5a778d80df + + 1995-08-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 468931000 + + Canal Satellite + + 062fc3e14dbb8c115f857314248b18c6 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + da7196d3f0ac3870c85e8bae4ad07298 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + a79f558531f48fedb938dcb597848ef5 + + 1995-08-03 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 473481000 + + Cash + + 5b2fa71de1503f676c800de0ee973418 + n + 35000/100 + 35000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 83e6d6c5d3d5bf7a960e64eac7acb2e4 + n + 15000/100 + 15000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 4097ccbec7e71cc1cf713fc6314532c4 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 54777d757317cffd5224c7dd23fdfcd6 + 6353 + + 1995-08-07 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 476473000 + + MACIF + + 5654afa4b117d4ad1943f8dbc94c3439 + Jusqu'au 01/07/96 + n + 46190/100 + 46190/100 + e89232e4cdd3a66a5c3b229cea2d0fda + + + 806ccc0a5cd736437cf9afccd375adc6 + Jusqu'au 01/07/96 + y + -46190/100 + -46190/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 6513e90a2b2ade9397a40a9884b78531 + + 1995-08-09 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 479386000 + + Cash + + 6a1e0536b65156f9a86c1a16d71c9308 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + a09753d84046bdf847d554fdfcdf5ea5 + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + fa9d3ab8c2f224b484e44a4b3d598b44 + 6385 + + 1995-08-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 482935000 + + Propriétaire + + 957eabe77ddbc56b250499b1acb47731 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 05b52f52d833b59c5d55d06135225b44 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 2160bafdee142a1c0cdcf93eb152ac70 + 6386 + + 1995-08-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 486845000 + + C & A + + bf167dc398ff8b93c9c6d205ee5a9e9b + cirage + n + 1300/100 + 1300/100 + 674e7f3ba414c8c31b93282247b04213 + + + fac17c8b8f8c78946c6627aef406740a + 2 teeshirts + n + 9800/100 + 9800/100 + 674e7f3ba414c8c31b93282247b04213 + + + 019376e03d81025da7a4a888eb17db17 + 2 chemises + n + 28000/100 + 28000/100 + 674e7f3ba414c8c31b93282247b04213 + + + e17adfd5665258fcf5c81253f9ff804b + chaussures + n + 25900/100 + 25900/100 + 674e7f3ba414c8c31b93282247b04213 + + + 3fdf0236efc2f5c4753d98d3917c904a + jeans + n + 19900/100 + 19900/100 + 674e7f3ba414c8c31b93282247b04213 + + + 6e52fb66153dd528c7360c9dee6c19a0 + cirage + y + -84900/100 + -84900/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 714a3365c041af7542479ef9eb1571a7 + + 1995-08-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 492331000 + + Cash + + 0132023af8ac1e9ed9c6bdc5aba128f8 + n + 38200/100 + 38200/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + d0a88693e4b774de96c5351b75aa38e5 + n + 6800/100 + 6800/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + fadaf644365575e2ced10b0de898b198 + y + -45000/100 + -45000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + c85c719889cf8ba5e5b674c40534b4ca + 6387 + + 1995-08-22 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 495542000 + + RATP + + adfb9893a984b24089e309a197d41be3 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 0c6ac21107bc420d02dae670b4f01603 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 4c1aa5c5cd07ed557472ccbc6b09fbeb + + 1995-08-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 498561000 + + Employeur + + 72924326be90e638bd35be6689bfa4de + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + dae5f1b1e1e42b23dcc25193a996b0f4 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 23a510b2080b450e71d3eeb66c3b59ba + + 1995-08-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 504389000 + + Cash + + 2e1cfacc36db51c7381dbe8a6d57225c + n + 1500/100 + 1500/100 + 5816cdbc45a11a5747f7ca286550c73a + + + 95e26a960d5b7b0cabe3a0a1f571d691 + n + 18500/100 + 18500/100 + 672b9edafeae9eb5c17316688678ee3d + + + 6424a65127208e891626161587951e93 + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 913472a09814368bd2d4a177b8590bd3 + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + e93bd22645a2463539ff72b0fb002854 + + 1995-08-30 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 507381000 + + Cash + + db16f55098fe03facc4df5416cef016d + Retrait distributeur + n + 20000/100 + 20000/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 0ca18a97407847011f2c92cad272c877 + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 770def13c9521414e8d9e9ff017a8ab6 + + 1995-09-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 511918000 + + Crédit Mutuel + + 278373bc4ce1a55db5ec05ce41283292 + Intérêts + n + 12828/100 + 12828/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 472ad8358c7eeb4f50a7b79e5802cac2 + Capital + n + 408486/100 + 408486/100 + 56c0e0eae313a1804d8d1183166a34af + + + 8f9f8bccf2658b122b1d0b07ce1e3153 + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 49a39e961ec0b5cc2fad449908bb676a + + 1995-09-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 514903000 + + Canal Satellite + + 351b24fedf3917eb147facd9c6bba42d + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 2972f1d0f6e62c5cfc76e6072a7e94fb + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 335c527135df465c5026c57a5085187a + + 1995-09-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 517817000 + + E.D.F. + + 5d07ade13fbe84b5ad9c53c58a58484e + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + eec7f6be92c7c26171e5efb9d7f1c5ae + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 3a153e5ad16b57608e0f75c8f353f9be + + 1995-09-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 521727000 + + Cash + + fd75af9f788941a8d22c4915abf3da35 + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + eba6efba5dc1e775b9c9eb9aa2d45eda + n + 10000/100 + 10000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + c21a8d1cb326c5965f17011f78a9bd21 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 553ebcbadf3b4f35116d797149387dac + 6388 + + 1995-09-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 524796000 + + Propriétaire + + e7e74614eb04d0bcc653fe2adaa318b0 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 3c843176d779815a29cd59ec6cc19046 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b054d81668877f2f0209094dd37c74b4 + + 1995-09-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 527753000 + + France Télécom + + 3ed384570b0c557ef846cb6f61888ed1 + n + 34200/100 + 34200/100 + 3a6503c7c577f1beb48a620e905b207d + + + 9d84fb78a9abde4006918f8dc1e55471 + y + -34200/100 + -34200/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 9e78c8044b9bd816e9d0b0d1b9714ac3 + + 1995-09-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 533919000 + + Cash + + 6b13c73f807ac67a9c5a7b541e486bab + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 21ac5dd04e3b8d358d297e0c9852f871 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 0c0126f159b22e90d6874ac4d74b3076 + + 1995-09-22 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 537055000 + + Cash + + ec2d78e0cb9bea8fd8dfe6b921a85cf0 + Retrait distributeur + n + 20000/100 + 20000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + b9d78b411e6c245f671d1e55b7db53e1 + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + bc7261e3e53d6a625791dba52e6cd72a + + 1995-09-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 541242000 + + Employeur + + 151f292449fb9d5371b9e2f8ca4a5f26 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 150bbfc248bf92cd3dd82d1ea94fb338 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 6709366f4970d47b02225b4126ce2946 + 6389 + + 1995-09-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 544686000 + + RATP + + 40b6a273d88b4964a67028323ac37d3a + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 02fab5c53bd208e8c159f3c5e5568dab + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 858c8c15d01bb20b175e7511d0a338cc + + 1995-09-29 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 547748000 + + Cash + + f10d18bb070508000071b2e9943d7417 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 39a06c6cec0ac7bcdea0b1415b20574d + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 4586437067fd9c845c8c76d1f3dbff95 + + 1995-10-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 552274000 + + Crédit Mutuel + + a91b974f498517b5e062775734d85354 + Intérêts + n + 10717/100 + 10717/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 36e11802ea8c81594d108d18ea4db490 + Capital + n + 410597/100 + 410597/100 + 56c0e0eae313a1804d8d1183166a34af + + + 67bd96955adb2962f330e4c68a71671a + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + + dc4df550a92073ab26c373ec4be97395 + + 1995-10-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 556896000 + + Canal Satellite + + 5241622b9755bb9da6b07bf05cdbd551 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + ce39fd24901a23c0eb3340becf1b8583 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 78091133ada4b45030448db72483d18a + + 1995-10-03 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 561884000 + + Cash + + 2cb6a0b2bb7a4d6f4fb7b0fcd38983da + n + 17500/100 + 17500/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + cf2a801e6ad90b9db4b758c9a970e430 + n + 17500/100 + 17500/100 + cbfd18621567322c77b9a5b3d6aa3a49 + + + c252bf3c6da08b38b410a6e688acf4a6 + y + -35000/100 + -35000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + afe9e93d68e876ac57767b055c5dccb5 + + 1995-10-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 565406000 + + Cash + + 78bce048c4a0ee82b2cb05cc8ff67e7a + n + 20800/100 + 20800/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + cd380f8a34e415bd21bb663cc3898304 + n + 4200/100 + 4200/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 856cf4f80d7c50613e08b1769bdfeab8 + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 2a0e299746191a713346f3d36f7d582e + 6390 + + 1995-10-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 568517000 + + Propriétaire + + f9eca05c03f31aed02ef84b25b12a7b8 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 0f5f34bca78008e13d953c8aa2b48408 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7bbaa9d35599fb3d01fb994077781852 + 6391 + + 1995-10-15 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 573311000 + + Centre des Impôts + + 96304441c2ea5f99b9315a81239f126e + Dernier tiers + n + 443004/100 + 443004/100 + 0a5d0546390d60dab623114e6f136d7a + + + 14e0efbf413207b06594149f2e98f2cc + Dernier tiers + y + -443004/100 + -443004/100 + de3be9d4e8f598584db381c56092f351 + + + + + + a704e168a1dcda16924cd39f49012e78 + + 1995-10-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 576614000 + + Cash + + 42738fe7c187422790b00972b7fbf626 + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + e36277849a566079eafb638d22d57b3a + n + 10000/100 + 10000/100 + 5d9afede4f8d14de29b0f64ebd23a649 + + + 8524d98513827797285fb9d490a7e7c3 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 0fa57dae34554853891a3ad20b1792fc + 6392 + + 1995-10-24 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 579799000 + + RATP + + 77e7c531693da7b9a44d3977f4c787ab + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 535afb954addaf9c77dfe525ce619807 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 604b26f5e027d859363fafac298e629a + + 1995-10-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 583949000 + + Employeur + + 49bdd6d7c7e7adcc88629fe6aba7bbe0 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + a8e825d249adbd268640f158121f6c9b + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 644300b8dd43f4193801505ecc388189 + + 1995-10-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 587324000 + + Cash + + adb74a8b2b5ddefc6e88704ebd1343a4 + n + 21800/100 + 21800/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 3c839f0eb35c9e96123a88b7b04b4445 + n + 8200/100 + 8200/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + a4c8264ab036d41bcc07b7c4e8b3375c + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + bd90ec06cec68c8935a5e054a4f7d591 + + 1995-10-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 592288000 + + Cash + + 28dc73f87f32cda0234ca8ec7778d2eb + Retrait distributeur + n + 15000/100 + 15000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 5e625b1051bc9fb1355cf68d75aff7c2 + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + de35ca9402d2fdf8ba877d70861f4732 + + 1995-11-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 597275000 + + Crédit Mutuel + + 246a46e75b7459d80770f4403001deaf + Intérêts + n + 8596/100 + 8596/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 498f8c22f1536867cd42ed41eccb2f46 + Capital + n + 412718/100 + 412718/100 + 56c0e0eae313a1804d8d1183166a34af + + + ca766b2283d60321d1deb3c55e4c6dcf + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 398743bf3c2f7e6dbee6a4f858837dfe + + 1995-11-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 601111000 + + Canal Satellite + + 26656ca4c8de644db324e84826ae5582 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + c6bc81b919c8aaa9161f49f584306960 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 661e393b9e181676766932984f8c7d33 + + 1995-11-06 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 604563000 + + Cash + + b3937a025ee160ebd563c61d177e4f6f + n + 10000/100 + 10000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 81f60490d84ff12f1f44896a8756d5c5 + Anniversaire Hélène + n + 40000/100 + 40000/100 + 324d517fa7427163088ed8a2422b4943 + + + 7e37e21b544a0f3b6fc7ae6f6baa5890 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + acaddb2bd6450ae1d37c98b1e6efdac6 + + 1995-11-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 607676000 + + E.D.F. + + 3607632080bd58c5ab11b4d66cf9edbd + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + e701603fefbe56db6215bc1a1540980d + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ab881f29254f18d36cb1f99249908fbf + + 1995-11-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 612951000 + + + 84f80f973bcd0323a10f48f6abc9d4fd + Pour équilibrage + n + -450000/100 + -450000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + a356d43da70a3c0b9db41485f8155fb0 + Pour équilibrage + y + 450000/100 + 450000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + df1e7b8eff998e08300f10747786bfc8 + 6393 + + 1995-11-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 616130000 + + Propriétaire + + 9e7a280f7f3ad8d15c66233a72acd4b3 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 0e248e8dc6e627250166b28ec6b7b4e6 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 2c7d5688168cd5e77c63ec5d28ad5ef5 + + 1995-11-14 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 619305000 + + Cash + + 63cdf3df02dc376d2b841c8092f8d866 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5ca3818da015ec9a21c204df6cb94d6b + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + c829367e2f2661cb9bfd00429daabd70 + 6394 + + 1995-11-16 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 637291000 + + Toys'R'Us + + c46d6ecc5eb791fe9fc801288474d7d9 + Cadeaux de Noël juniors + n + 87500/100 + 87500/100 + 324d517fa7427163088ed8a2422b4943 + + + 957173f88373dad1bfb9b71a41870592 + Cadeaux de Noël juniors + y + -87500/100 + -87500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f347eea571aabef74c89e09168c2abe0 + + 1995-11-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 647476000 + + France Télécom + + 3363e39ad18ebc386a755b4f547f30b5 + n + 50525/100 + 50525/100 + 3a6503c7c577f1beb48a620e905b207d + + + 6d65ed937fe8e63897296da9208eb93b + y + -50525/100 + -50525/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 553da78ac4e6d1fabff16549250ff3e0 + + 1995-11-20 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 653861000 + + Crédit Mutuel + + 664dff9f268ca9d0710d7d50c7025050 + Dollars pour vacances à Redmond + n + 150000/100 + 150000/100 + 13e72266b7b88c8bb23d747dbd3ebd23 + + + eb7917c873b0c104acf9c72e91481a2e + Dollars pour vacances à Redmond + y + -150000/100 + -150000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 51a1a9f5090a9dbe8f347f79015f73ce + + 1995-11-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 657132000 + + Cash + + 013003558e580b0575be08cc1e2e8341 + Retrait distributeur + n + 15000/100 + 15000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 9e0e81445f398c6dc7d7f77aa73619a7 + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b1e49deb289a12c6260f0c0eec4a8850 + 6395 + + 1995-11-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 661081000 + + RATP + + 136f103fd3e81bdf19bd7a6f839f745a + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + df788538cd0254139dc90ae93af9ad3a + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + e6729c246af31c6dc1c4cba9aa5a6c98 + + 1995-11-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 664349000 + + Employeur + + 136441a6f02976dda9f774d3f06bbc0e + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 98d29f5e47c681b521fac8d95da80910 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + ca411b893bcb18140eba6258c737d86c + + 1995-11-28 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 667602000 + + Cash + + e1e57f8576fc722a72e9b3d02aec8ebc + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + e0bcd23b5ce44eeb2af611a5b025cfa6 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7a548de962765c14800eca45a6f90523 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 672518000 + + Crédit Mutuel + + 26dffc4e91d8d02a8c70290444138455 + Intérêts + n + 6463/100 + 6463/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 76144a6506a69f025e515d935d15b645 + Capital + n + 414851/100 + 414851/100 + 56c0e0eae313a1804d8d1183166a34af + + + 330574ff34234aaeb2980a2e97098245 + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + + f4062fbf5097fbd1cb9a0b10a1917922 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 675778000 + + Canal Satellite + + e20c9db431732800e34de2c0560132bf + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + be332f8c39d0184a5a4ba1ee8eb6cede + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b47c4349e3050b9ae28b1e120529349e + 6396 + + 1995-12-04 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 679388000 + + C & A + + 475ca859036fed847462489d2d5388c2 + n + 10000/100 + 10000/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 7c67b189a5234e93d1a950050fac338c + n + 15875/100 + 15875/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 01219e3ca98d7d972410fcc85373a1d5 + y + -25875/100 + -25875/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 28f562c4f190045d1811e9c45cf03399 + + 1995-12-05 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 684337000 + + Cash + + 5cfd6ce029feedc7f87dc0dfc84edf82 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 7541783684cc97ca6ac2c5a1840ae0a7 + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + d5ff033a68daf33a8ab36479b9cfc562 + 6397 + + 1995-12-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 687601000 + + Propriétaire + + 5f428015626116293b5cd6771243227f + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 1e207243e734316cfb1cff54238d10ed + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 061348767dc2f9f60a7702853c64039e + + 1995-12-15 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 699051000 + + Cash + + fd082052248f75134ce33c636d3af0b2 + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + eea53c8394466b625affa524b953216c + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 3eb206827dd0099e0d7b4a982ddecf86 + 6398 + + 1995-12-20 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 703136000 + + RATP + + 60fe4e698107953b96ed4d3770bce33c + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 8709e84f1f399b264879c88dd090660b + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 7577789ff328119d6ba43ca3db4cd8c6 + + 1995-12-23 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 706639000 + + Cash + + 4aad18549df1e6489abffc72381d6efc + n + 13000/100 + 13000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 217e90e4e3dce1b98618d8834263f3a7 + n + 12000/100 + 12000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 7273934f29d6cf8fd66b1d2d7991c381 + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + b7a5b462216d49a02221c18ad1bb2bb2 + + 1995-12-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 710061000 + + Employeur + + 02bb2087bc17d3fcef028ce2a121d01b + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 00b35b728c22fdd59a27b1d31a620084 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + + 943398a5d516ccc8384243a8987c1bc1 + + 1995-12-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 716695000 + + + 560fdf0893f91335de53ed7c5280f8d5 + Economies + n + 350000/100 + 350000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 156c7cf2a5aa1711bc706105eb02b02c + Economies + y + -350000/100 + -350000/100 + de3be9d4e8f598584db381c56092f351 + + + + + + cda659ff332c30b5767051f73426c886 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 719976000 + + Crédit Mutuel + + 80b03ef24c38e447349f154d5a0f43e2 + Agios pour découvert du 15/10 au 24/10 + n + 9763/100 + 9763/100 + ef0041623a6b317860e84b847af785c7 + + + 6afa7b7aa4ca5f3eed94ab04cccaf4b1 + Agios pour découvert du 15/10 au 24/10 + y + -9763/100 + -9763/100 + de3be9d4e8f598584db381c56092f351 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/Money95invst.gml b/src/backend/file/test/test-files/xml1/Money95invst.gml new file mode 100644 index 0000000000..d6f291e969 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/Money95invst.gml @@ -0,0 +1,321 @@ + + + 1 + + + + Compte courant + a68387e637bb8e7405bc949764b9aefd + BANK + + ISO4217 + USD + + + + + + Livret bleu + cec92cd077aee62305910cfd929cc341 + BANK + + ISO4217 + USD + + + + + + Retained Earnings + afed1334dfcdc53865cafe61edbb0fc6 + EQUITY + + ISO4217 + USD + + + + + + ad7c592d0603871110acb8f2c7bcd215 + + 1995-01-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 31238000 + + + 524f8a36ece0437ba8b27284a2b78e06 + Economies + n + -250000/100 + -250000/100 + a68387e637bb8e7405bc949764b9aefd + + + 4b93c9e41c978f00b3c4e0de5fa2fbef + Economies + y + 250000/100 + 250000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 9c381dc6f595933f06ff11b574333f44 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 32417000 + + + 85f79dde160ba7f2f021d95d190b34c3 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + 98b2c538910821d9cf37a9bff01ef60b + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 3fd5cdd6a6772412d702124c1a786ef3 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 33369000 + + + 535b36edb9230c04b575034bde669ea3 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + 249fbfb7601774a1f089f030299c8a3f + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + ebff5d6fbfd69632db47a362789035c0 + + 1995-04-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 34356000 + + + 8f559a4b006fd31a238fc1c1819b911e + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + adda51b98341607acccbe48bc1c37dff + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 4d44e44e9b16a58c562e0d938e58a69d + + 1995-05-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 36554000 + + + f7ff3dbb314786218f638276f8b3c3a8 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + e8a489904a8a4e684d7054fba8b288f2 + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 328e2319a21e15c8eaac3c5ae9e2f8d7 + + 1995-06-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 37673000 + + + 15e631fad619fffe13e291ca187bd7c9 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + d2e699960572bca531413fd4fcd530a3 + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 2f70aee8552b4929b9009a4cde3f3095 + + 1995-07-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 38685000 + + + 33b9ddd3fa6d915ce6d8b8440d4cd1b3 + Economies + n + -250000/100 + -250000/100 + a68387e637bb8e7405bc949764b9aefd + + + 53935088af8824f72ebcb29571443e2f + Economies + y + 250000/100 + 250000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + 4564825b74f81412d309a8eb8cc58222 + + 1995-11-12 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 39707000 + + + 912aa7c8f0c8c01fdedd4c44ac7c4ade + Pour équilibrage + n + 450000/100 + 450000/100 + a68387e637bb8e7405bc949764b9aefd + + + d8d24b073589acfda00585b67e2a4bf0 + Pour équilibrage + y + -450000/100 + -450000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + ec6f0cc19c5651db2c2dc8ff93efe697 + + 1995-12-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 40707000 + + + 11d0b29b056fc64215dbb37d0dfdd062 + Economies + n + -350000/100 + -350000/100 + a68387e637bb8e7405bc949764b9aefd + + + 20dad7ae612bd303bc2d070bef3604ac + Economies + y + 350000/100 + 350000/100 + cec92cd077aee62305910cfd929cc341 + + + + + + f56c0707159f36caabc22df8ac71887a + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 30261000 + + Opening Balance + + d20b8eff18aa85f3731145b77f0bc5de + n + -14560800/100 + -14560800/100 + afed1334dfcdc53865cafe61edbb0fc6 + + + 9b4e17c7c367bf37367dda356a7e2670 + y + 14560800/100 + 14560800/100 + cec92cd077aee62305910cfd929cc341 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/Money95mutual.gml b/src/backend/file/test/test-files/xml1/Money95mutual.gml new file mode 100644 index 0000000000..5ca16c9593 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/Money95mutual.gml @@ -0,0 +1,174 @@ + + + 1 + + + + NYSE + O-Sicav Plus + O-Sicav Plus + 100000 + + + + + Livret bleu + 3bcb236af583d5bd7b6e0153fe97e7e3 + BANK + + ISO4217 + FRF + + + + + + Money95mfunds fr + 89e091b3489a50957b400a868f101d59 + STOCK + + ISO4217 + FRF + + + + + + O-Sicav Plus + e0e954412d6b31dfa1fcbb9937a125b0 + STOCK + + ISO4217 + FRF + + + NYSE + O-Sicav Plus + + + 89e091b3489a50957b400a868f101d59 + + + + + + Commissions + 41b9e953585cd5662712d62848e71789 + EXPENSE + + ISO4217 + FRF + + + + + + Money95mfunds fr + c7a4746248d0677c6421077833477bba + EXPENSE + + ISO4217 + FRF + + + 41b9e953585cd5662712d62848e71789 + + + + + + 88ed4f76d273256aaa05eab3010731bf + + 1995-07-24 00:00:00 -0400 + + + 2001-03-26 15:30:31 -0500 + 435420000 + + + df25dcb351c89a20062a5ea5d294e8e8 + n + 1828080/100 + 6000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + a44971f955fa03a9318fff369962820a + n + -2461820/100 + -2461820/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + 1ec08747892bf80d01ff1dab46ccb150 + n + 633735/100 + 633735/100 + c7a4746248d0677c6421077833477bba + + + + + + 21f58d6ddf8e529905db462291963e68 + + 1995-10-08 00:00:00 -0400 + + + 2001-03-26 15:30:31 -0500 + 436816000 + + + 30f46d6ea24efb8f57ea386be57370c2 + n + 3051000/100 + 9000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + 15160cb2e5b32864c451842cde8ffcd9 + n + -3254400/100 + -3254400/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + 66a01b46ebec63544ca133efa6706f6b + n + 203400/100 + 203400/100 + c7a4746248d0677c6421077833477bba + + + + + + 4cb943c207e102dbc22e5ef829bbc29d + + 1995-12-10 00:00:00 -0500 + + + 2001-03-26 15:30:31 -0500 + 437989000 + + + 27a56b13c4d24744f3cbb53329120abc + n + 2053200/100 + 6000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + 19355bfa2d1208dd144aa7c32de06aa5 + n + -2053200/100 + -2053200/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/Money95stocks.gml b/src/backend/file/test/test-files/xml1/Money95stocks.gml new file mode 100644 index 0000000000..a2434cdcc1 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/Money95stocks.gml @@ -0,0 +1,866 @@ + + + 1 + + + + NYSE + MSFT + Microsoft + 100000 + + + + + NYSE + USSA + Usinor/Sacilor + 100000 + + + + + Livret bleu + 21db466b6be8b3f6a3043d0c0316de8c + BANK + + ISO4217 + BRL + + + + + + Money95stocks fr + 2a42eb5710ad4ddbf9352f070d603fe2 + STOCK + + ISO4217 + BRL + + + + + + Microsoft + c28902afc0e2168dab793b63dbf56e1f + STOCK + + ISO4217 + BRL + + + NYSE + MSFT + + + 2a42eb5710ad4ddbf9352f070d603fe2 + + + + + + Usinor/Sacilor + b3955645bed5651123986f415d0e81d6 + STOCK + + ISO4217 + BRL + + + NYSE + USSA + + + 2a42eb5710ad4ddbf9352f070d603fe2 + + + + + + Unspecified + 37d287c3550ab2810c386d1b33cc2d0b + INCOME + + ISO4217 + BRL + + + + + + Commissions + 5efcfb966ef97810de2fbaaa2b352205 + EXPENSE + + ISO4217 + BRL + + + + + + Money95stocks fr + da8e001155343694bd34f6aa248b1c28 + EXPENSE + + ISO4217 + BRL + + + 5efcfb966ef97810de2fbaaa2b352205 + + + + + + Retained Earnings + 1aaa099850fe7a07e2b5ae97f18b9af2 + EQUITY + + ISO4217 + BRL + + + + + + 67da2dc62331fb318640aa5a1a3da937 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 563969000 + + + b05ab9cccb7addce264e3b5614f2d620 + y + 48210/100 + 363849/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 58a836c409c2e4982bb89e9d98e6b65c + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + ef2ad6ef1a0d827db4b01caa6b340fbf + + 1995-01-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 569022000 + + + 1395f3eb7d951d441962acee30ebb240 + y + 48210/100 + 327773/100000 + c28902afc0e2168dab793b63dbf56e1f + + + b9cabeca13b398fb62a6d385ed4916a1 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 22b16ec9c03e00dd0150a22780426c93 + + 1995-02-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 572348000 + + + c25135399d6f3f65e66ccdb541975a70 + y + 48210/100 + 324101/100000 + c28902afc0e2168dab793b63dbf56e1f + + + f74b03f7a1b731f5a85afb2a99b11dc7 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 6fdeaddf8e62e0167f657eed23ea27c8 + + 1995-02-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 576414000 + + + d6ac7052f05f821d4feeeda1ef746b65 + y + 48210/100 + 321400/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 47c446ca0b094d087715591b7acefd76 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + e205d59680a7d1b3100c6f9c5fbd619c + + 1995-03-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 580193000 + + + 8980728679535dcc6fbd5d0d3e187baf + y + 48210/100 + 320510/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 6757952464d7cf759ba6af1cedde80af + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 147fb5b3bf9c64a2cfa678b899617a1b + + 1995-03-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 584377000 + + + b0f2227be0f37117ff16816a9bba6bf8 + y + 48210/100 + 317868/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 59f7f0a41217d556acab6df6315c416b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 847b3db3292d79f04385d50678617d8f + + 1995-04-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 591148000 + + + d6e212645b08ac2db0029f302eaefa06 + y + 48210/100 + 291079/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 02525e8f79dd3f95a6531b7b0a1eb9a7 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 01b7f8239992fe56d640e8db18b357d4 + + 1995-04-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 607128000 + + + dccef28c5a743eabc50ed961fedce162 + y + 48210/100 + 300140/100000 + c28902afc0e2168dab793b63dbf56e1f + + + abb5d05de4cb51be2e4e05a70e4ece1b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + ba6f65b4506f3bab59fa821fc35edffc + + 1995-05-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 612605000 + + + b45c6aee3f5802971f66a9da91d01212 + y + 48210/100 + 285689/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 64750ea3cec777596f1eb2062fb1f8b9 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 2dd0477429d450166c9995e753c01331 + + 1995-05-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 760444000 + + + 69748f8a33b3e85fc46adfa9af9a2c8f + y + 48210/100 + 287107/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 53d079dc07ea51d10f07f922dcb7c9c9 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 4f221b72a33d2e5403ebea07b30c60f8 + + 1995-06-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 767487000 + + + f323236b9c860bd7582d8516cab014d2 + y + 48210/100 + 279478/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 52fa897efe40206378e38ce37d25545c + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 97c6d186d2c827c0add7fa251adb80f5 + + 1995-06-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 774300000 + + + 69783df027e525bc1f4fe2aa61f1c5e3 + y + 48210/100 + 259717/100000 + c28902afc0e2168dab793b63dbf56e1f + + + ebb117aa19dfef5ce5cceb9378c0bd6b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 61bc2fba66b1b4a2b9d70a79c23d6b2a + + 1995-07-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 782986000 + + + eb33e77786d816e4df8c9b089a2417fe + y + 48210/100 + 228890/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 39d1bd743942efb895c00e1c8dad312b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 044cff4a8437cba0611d3f1634ed1766 + + 1995-07-06 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 788855000 + + + 2158435efd7fba4b85440e2b291597dc + n + 1800000/100 + 10000000/100000 + b3955645bed5651123986f415d0e81d6 + + + 4a07fb7b6207731dba32e088b2f2273c + n + -1800000/100 + -1800000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + d30a071d0c23e1f7de5122768f572783 + + 1995-07-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 793677000 + + + ee5be141ec71575e8d133dafb17fc475 + y + 48210/100 + 223583/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 85fd606ec412640bdc2394dceabb2863 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 3c1a1f2b9b25c700a529a88ea37673fa + + 1995-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 810277000 + + + 9106d261d9313b94a1791c0346026ab5 + n + 48210/100 + 234456/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 01f9fa805620e2753a088d5c7926a2a4 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + ef3e43991d16cedd21ae30424314ded3 + + 1995-08-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 820724000 + + + 70edfee7fda47ab599440e56c74d07bc + n + 48210/100 + 223583/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 6e6de8bc8de8edadd03d12fa27f8d3cf + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + ad374dbca2ceb69c621729110075eb6c + + 1995-09-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 831302000 + + + 593961cd24af8fec7b7dded7980572a0 + n + 48210/100 + 246441/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 0290760bda0c1263a29275dbc80c6e8e + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 3ecdbc520d5995c743b968df766dac53 + + 1995-09-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 842924000 + + + a19fb70b311ab1d2995e99da8cc0dd60 + n + 48210/100 + 234456/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e8188b2256f426671644de3833c63823 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + b78ee35076e3c33e119b28ed28d9899e + + 1995-10-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 870500000 + + + edceb57dd1ae14b92495e6b802ea1fd0 + n + 48210/100 + 240299/100000 + c28902afc0e2168dab793b63dbf56e1f + + + a2913b7d9d6b46f98f8312a18091435a + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 55e60fdaab33f498f39f00fdd7b90a54 + + 1995-10-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 882549000 + + + b28c48aea5b2590373a9d7b30daac854 + n + 48210/100 + 232805/100000 + c28902afc0e2168dab793b63dbf56e1f + + + fc7ea77d5aa50580342d7e96b2f49989 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 99346e3803a33ab9eca34b0c07950ca4 + + 1995-11-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 903735000 + + + 6498e7c2e6fb5904dd5cec26c24435ef + n + 48210/100 + 225105/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 1f017018b6a8e4d819e5b4cc7a390025 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 99e86a13ff4f2c9682de72afe1a88e93 + + 1995-11-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 918545000 + + + dc7a3ba0b30130597a4fdcc6c3dcf369 + n + 48210/100 + 246179/100000 + c28902afc0e2168dab793b63dbf56e1f + + + efaa1a65c36b2aa767ef5038205775d2 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 2622a1080ff6c00ea26a08b2b4ced682 + + 1995-11-18 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 924478000 + + + de65d2b5bbf96ea77a2a68f6e1c9b78e + n + 1720000/100 + 8000000/100000 + b3955645bed5651123986f415d0e81d6 + + + 1d2ee8256a1205440df2a8fc8aafbbca + n + -1720000/100 + -1720000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + a881bcba9acd5cc108fc0a98036c5bc3 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 933363000 + + + f64fda83b5354abc300e0daeacdbaf9d + n + 48210/100 + 246179/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e5110d8191bf1d6fda128942062569ad + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + c00f255b41f7d2c35d67354264999478 + + 1995-12-10 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 940053000 + + + b5effb985dc0657eec87fd8dbfc57451 + n + 1744000/100 + 8000000/100000 + b3955645bed5651123986f415d0e81d6 + + + a4db6abc4a2effb3f73275fb29948523 + n + -1744000/100 + -1744000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 8e8e5d4125418c0579f3731e25777596 + + 1995-12-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 958106000 + + + 1557c89238dd07a8972b0686a0fa178b + n + 48210/100 + 245917/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e005c31d25bd98288550acf63d16cfd2 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + + 2b59e457646dd04a190dcb17e050ef92 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 561450000 + + + 6d87f9e8bb10413b90e956356641630c + Initial balance + y + 249123/100 + 9400850/100000 + c28902afc0e2168dab793b63dbf56e1f + + + f778537b61dab90054fe976b501cd986 + n + -449122/100 + -449122/100 + 1aaa099850fe7a07e2b5ae97f18b9af2 + + + b3a36622a46daa0cb4291ed15874fcf6 + n + 200000/100 + 200000/100 + da8e001155343694bd34f6aa248b1c28 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/abc.gml b/src/backend/file/test/test-files/xml1/abc.gml new file mode 100644 index 0000000000..75645ac209 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/abc.gml @@ -0,0 +1,266 @@ + + + 1 + + + + Swipe Brokers + 8a2778a7eef9bc606de8a12b489f737c + BANK + My Investment Account + + ISO4217 + EUR + + + + + + abc + 8c054c66321f7be82287dbb0c6b7b8a2 + BANK + + ISO4217 + EUR + + + + + + Gift Received + 07212c5f31968d8d55144f1fd5651d8c + INCOME + Gift Received + + ISO4217 + EUR + + + + + + Other Inc + a2d8b63955baad46ddca87bbd96d399f + INCOME + Other Income + + ISO4217 + EUR + + + + + + f5f0146e8a242f5869cfa143e9c3ad82 + TXFR + + 1997-09-12 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 421794000 + + move a pile of money to trading acct + + 3a460828038c8dfb7840c9c869372ad3 + another memo + n + 500000/100 + 500000/100 + 8a2778a7eef9bc606de8a12b489f737c + + + e9924d2b6802002852cec90774e41f0f + another memo + n + -500000/100 + -500000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + 25b6474f1d5f2cf787d52af107f41f91 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 422791000 + + hal stock + + f6de5ff6932e0652b54160a945345378 + income + n + -1200/100 + -1200/100 + 8a2778a7eef9bc606de8a12b489f737c + + + a599cd75681fa150211fc28f46da50a4 + income + n + 1200/100 + 1200/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + b15e27a638b77c04eb23aea715845627 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 423736000 + + hal stock + + e944efe51adf6a037d2a05e975de0b9e + income + n + -1100/100 + -1100/100 + 8a2778a7eef9bc606de8a12b489f737c + + + 39b2adbce47a9a878c72dc802b8eb19d + income + n + 1100/100 + 1100/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + eede2259804df7746d1a5508f994f3cb + TXFR + + 1997-11-12 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 424738000 + + hal stock + + 6f795a04a0822e46488b82f49745db78 + sold some stock! + n + -50000/100 + -50000/100 + 8a2778a7eef9bc606de8a12b489f737c + + + 325b94fb8e080a5a08b025a9cae2fd2a + sold some stock! + n + 50000/100 + 50000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + 2830957d31809c4c450db2c5d5d134a2 + DEP + + 1997-06-17 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 418417000 + + from my pillow case + + f5e209e5d118c1edeca8dc3d82dbd1aa + my memo + n + -234500/100 + -234500/100 + a2d8b63955baad46ddca87bbd96d399f + + + df70142a754e943592bec193b9a208ee + my memo + n + 234500/100 + 234500/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + 8a6f53be74b84e3557abdba90b8c325b + 101 + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 420785000 + + paycheck + + e6c7440d846774962fd62c68a89145cb + the boss paid me today! + n + -54300/100 + -54300/100 + 07212c5f31968d8d55144f1fd5651d8c + + + 91e6498ede7e1c5964c677e8cf14d2c1 + the boss paid me today! + n + 54300/100 + 54300/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + 976137eadff7b9c19fa0bf4527385781 + DEP + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 419571000 + + put in more money + + eb7df1a49af1a9bbeac7484003dec5e1 + this came out of my pillowcas + n + -330000/100 + -330000/100 + a2d8b63955baad46ddca87bbd96d399f + + + d2d6443cc766f3bf1cfc891530903f1e + this came out of my pillowcas + n + 330000/100 + 330000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/abcall.gml b/src/backend/file/test/test-files/xml1/abcall.gml new file mode 100644 index 0000000000..c14bf3a09c --- /dev/null +++ b/src/backend/file/test/test-files/xml1/abcall.gml @@ -0,0 +1,401 @@ + + + 1 + + + + ABC Bank + eda56e3c0c402d1816f845430caf362e + BANK + Some Old Bank Acct + + ISO4217 + USD + + + + + + Swipe Brokers + 729ae65a6c202a83a5335bcd32709888 + BANK + My Investment Account + + ISO4217 + USD + + + + + + pocket cash + 5d0b89cb9bcc5074cda514d0d4c10af4 + CASH + + ISO4217 + USD + + + + + + SlaveCardt + 2b804a30e16e54a97da593fc1f71c386 + CREDIT + my credit card + + ISO4217 + USD + + + + + + Gift Received + 04b5cbc4192f4790fac0586c5cc152f4 + INCOME + Gift Received + + ISO4217 + USD + + + + + + Invest Inc + d4f69b07cf7bb1a77c134f1b2c128684 + INCOME + Investment Income + + ISO4217 + USD + + + + + + Other Inc + 0a241ed16a10c3be1836ce37f8a069e9 + INCOME + Other Income + + ISO4217 + USD + + + + + + 2277a65f698a0902c751d8d44db12eeb + DEP + + 1997-06-17 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 994727000 + + from my pillow case + + 12afd90bcb29753d5572ebec9b3a6fe8 + my memo + n + -234500/100 + -234500/100 + 0a241ed16a10c3be1836ce37f8a069e9 + + + be0a8539128014e1f0d247eb54e8b07a + my memo + n + 234500/100 + 234500/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 62bb507b39f9cb5ce13cdbfe85d5dde9 + + 1997-07-16 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 996065000 + + more from my pillow + + 066346c0a87434491957713da1f3a3be + n + -233300/100 + -233300/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + 6552ad49f7202988165f0bfb0cab9f1d + n + 233300/100 + 233300/100 + eda56e3c0c402d1816f845430caf362e + + + + + + ac62a8dedb6fafc4864d980e167d93b0 + 101 + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 998739000 + + paycheck + + 2f0880d0d28f0a38de0784f40f1364a1 + the boss paid me today! + n + -54300/100 + -54300/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + f01abb3378f6a2c7dde4f4894540507b + the boss paid me today! + n + 54300/100 + 54300/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 5d33e9906feeb57fc22b723447c81605 + DEP + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 997654000 + + put in more money + + cf74014d73e0ef079c0f10797b19ed55 + some other inc + n + -30000/100 + -30000/100 + 0a241ed16a10c3be1836ce37f8a069e9 + + + 686e0a76ab0ae02b10526729d4309509 + soem as invst + n + -190000/100 + -190000/100 + d4f69b07cf7bb1a77c134f1b2c128684 + + + 8f08ab3bcae4fda2996a4d4ba58b2a65 + some as gift + n + -110000/100 + -110000/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + 008fcb736cbc9dda100dba888769caec + some other inc + n + 330000/100 + 330000/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 5e8d9293d5903ea18dc79e139b26dbc2 + TXFR + + 1997-09-12 00:00:00 -0400 + + + 2001-03-26 15:32:56 -0500 + 9661000 + + move a pile of money to trading acct + + 1630fe79d89d59a1c1b879dd705aaa41 + another memo + n + 500000/100 + 500000/100 + 729ae65a6c202a83a5335bcd32709888 + + + 6113d75cfcdea42bf1bf001df8e8ef8c + another memo + n + -500000/100 + -500000/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 5be926417dfce34c825504c32470f78f + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 10837000 + + hal stock + + cd7d47aaee2a435c3901b3efd8e319fe + income + n + -1200/100 + -1200/100 + 729ae65a6c202a83a5335bcd32709888 + + + ceab9089fbca47c83a487f8ea5f06c50 + income + n + 1200/100 + 1200/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 99fd0615f2db665f4bf90f438b2b5733 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 11847000 + + hal stock + + bfa9de544784620d566abc08c6e91b3a + income + n + -1100/100 + -1100/100 + 729ae65a6c202a83a5335bcd32709888 + + + 73a9e08aa5a660ca2fa2ab85acdff84f + income + n + 1100/100 + 1100/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 698e47a93b21837fd83babbfc5f6320d + TXFR + + 1997-11-12 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 12862000 + + hal stock + + 90e62018f0f3add84eb0ed68702ae942 + sold some stock! + n + -50000/100 + -50000/100 + 729ae65a6c202a83a5335bcd32709888 + + + 73fc5c8ae0c0468304bc9650d34f4194 + sold some stock! + n + 50000/100 + 50000/100 + eda56e3c0c402d1816f845430caf362e + + + + + + 249c2ccc0ada34b5027a64e0c18774c3 + + 1997-11-28 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 13872000 + + pay the balance on the credit c + + d4b7da3a080da8fc44e75c4389790ada + another memo + n + 44500/100 + 44500/100 + 2b804a30e16e54a97da593fc1f71c386 + + + 51fc2af007ad07027dfbe3ba4d4b6304 + another memo + n + -44500/100 + -44500/100 + eda56e3c0c402d1816f845430caf362e + + + + + + b1a6b7fad984e769bd6c3dd56abcfbe8 + + 1997-11-28 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 14844000 + + cash in my pocket + + c862917ad2379a5710b1431c395e658b + n + 4500/100 + 4500/100 + 5d0b89cb9bcc5074cda514d0d4c10af4 + + + b4ceb078101fd7b78f4a0a2c9d3e2768 + n + -4500/100 + -4500/100 + eda56e3c0c402d1816f845430caf362e + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/carols-data-file b/src/backend/file/test/test-files/xml1/carols-data-file new file mode 100644 index 0000000000..b9571d3742 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/carols-data-file @@ -0,0 +1,1270 @@ + + + 1 + + + + NASDAQ + Adbe + Adobe + 100000 + + + + + NASDAQ + Dell + Dell + 100000 + + + + + NASDAQ + ISWCX + ISWCX + 100000 + + + + + NASDAQ + jamrx + Janus Mercury + 100000 + + + + + NASDAQ + lnux + VA Linux + 100000 + + + + + NASDAQ + orcl + Oracle + 100000 + + + + + NASDAQ + rbus + Rambus + 100000 + + + + + NASDAQ + rhat + RedHat + 100000 + + + + + NASDAQ + slab + Silicon Labs + 100000 + + + + + NASDAQ + swpix + Schwab S&P 500 Index + 100000 + + + + + NASDAQ + tvqfx + Firsthand Technology Value Fun + 100000 + + + + + NYSE + AMD + AMD + 1000 + + + + + NYSE + AMD Opt- #2 8/14/98 + AMD Opt- #2 8/14/98 + 1000 + + + + + NYSE + AMD Opt-8/14/98 + AMD Opt-8/14/98 + 1000 + + + + + NYSE + AMD Opt-9/10/98 + AMD Opt-9/10/98 + 1000 + + + + + NYSE + AMD Opt. #3 8/14/98 + AMD Opt. #3 8/14/98 + 1000 + + + + + NYSE + AMD Opt. 5/3/99 + AMD Opt. 5/3/99 + 1000 + + + + + NYSE + AMD Opt. 9/10/98 + AMD Opt. 9/10/98 + 1000 + + + + + NYSE + Adobe + Adobe + 1000 + + + + + NYSE + Charles Schwab + Charles Schwab + 1000 + + + + + NYSE + Dell + Dell + 1000 + + + + + NYSE + Firsthand Technology Value Fun + Firsthand Technology Value Fun + 1000 + + + + + NYSE + Growth Equity Fund + Growth Equity Fund + 1000 + + + + + NYSE + IBM + IBM + 1000 + + + + + NYSE + ISWCX + ISWCX + 1000 + + + + + NYSE + Janus Mercury + Janus Mercury + 1000 + + + + + NYSE + Lucent Technologies + Lucent Technologies + 1000 + + + + + NYSE + Oracle + Oracle + 1000 + + + + + NYSE + QQQ + QQQ + 100000 + + + + + NYSE + Rambus + Rambus + 1000 + + + + + NYSE + RedHat + RedHat + 1000 + + + + + NYSE + Schwab S&P 500 Index + Schwab S&P 500 Index + 1000 + + + + + NYSE + Silicon Graphics + Silicon Graphics + 1000 + + + + + NYSE + Silicon Labs + Silicon Labs + 1000 + + + + + NYSE + Small Cap Growth Fund + Small Cap Growth Fund + 1000 + + + + + NYSE + VA Linux + VA Linux + 1000 + + + + + NYSE + amd + amd + 1000 + + + + + NYSE + lu + Lucent Technologies + 100000 + + + + + NYSE + sch + Charles Schwab + 100000 + + + + + NYSE + sgi + Silicon Graphics + 100000 + + + + + + Checking + 7cce1d8ee29f0e4c30c949f77bb2a447 + BANK + + ISO4217 + USD + + + + notes + + + + last-num + 100 + + + reconcile-info + + + last-date + 979624800 + + + + + + + + + Savings + 7117b00944ea5def8959751832990c9e + BANK + + ISO4217 + USD + + + + notes + + + + + + + + Cash + 15468df1e7097e7c317fb7a541010d69 + CASH + + ISO4217 + USD + + + + notes + + + + + + + + Credit Card + bdc5ed7168216d6df0f8d00767299bc7 + CREDIT + + ISO4217 + USD + + + + notes + + + + reconcile-info + + + last-date + 983340000 + + + + + + + + + Salary + d77f5ecb0a800748fdbae42e98908a85 + INCOME + + ISO4217 + USD + + + + notes + + + + + + + + Clothes + 52c89f4b1d0b7b445e0793278fd5ff62 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Dining + f4472ff237862ece69a1d3a58f293220 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + FICA + 1b211cffcf23b31e80666dadf57a37b0 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + FedTax + 9372c7685bfaf9086cb3cb53190b2ce2 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Finance Charge + 4ca91a8240c1df8068fa4dc7c1da147e + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Fuel + a13c10f2c32dc74c2e70f894351ef209 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Groceries + 17e25505b81c735adec6d10aa1536a0a + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Household + 62479a9add5ae8bb253da6ab3d713083 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Service Charges + 630a8066fdf69ac977808b2295ed9f68 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Tools + 126f38b941cfe865f811e1c011e5bc51 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Utilities + 00adc8fb6cc29e7ae5de56d6f8624ac5 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Electric + 554b4134fc4a9c0361e9c8ca8f744229 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + 00adc8fb6cc29e7ae5de56d6f8624ac5 + + + + + + Opening Balances + f61553abd3d8029455441267f6530f3d + EQUITY + + ISO4217 + USD + + + + notes + + + + + + + + c25df6ca60518acb3044016e7c799f3c + + 2000-12-20 00:00:00 -0600 + + + 2000-12-20 12:05:39 -0600 + + Paycheck deposit + + 26399b198b8beab9c11a84cabbd22da4 + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 3bfc8952ec151252d1797087be4f7751 + n + -80000/100 + -80000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + + + + eab3726a1157800a147285dbb6ef091e + + 2000-12-27 00:00:00 -0600 + + + 2000-12-20 12:25:30 -0600 + 54442000 + + Paycheck deposit + + 6a1892e895b31a5a2e65a8d7a718d2a5 + Effect on checking + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + fa8a34aab999ecb849f14c4e089272e8 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 067ba239023aa1450002f2f960241500 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 5ecafd54335e2a993047d80c9b0a1335 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + + 8f9d9b1d8f179a20f69d1104756cbf70 + + 2001-01-03 00:00:00 -0600 + + + 2000-12-20 12:05:39 -0600 + 389786000 + + Paycheck deposit + + c9d13d1243281e0e37011901e02dba51 + Effect on checking + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 8902cfce8bf774b82f55d31f03abc0a0 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 98490994785921ee6fd9e5d29f8a7435 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 4fad0c6ee1cd7fd3fe37a487aff39a94 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + + 104059201725c15eab8157a46542305c + + 2001-01-15 00:00:00 -0600 + + + 2001-01-16 10:38:22 -0600 + + Service charge + + 42b82c4437208eba6afaa9e7ce76bb61 + y + + 2001-01-16 00:00:00 -0600 + + -500/100 + -500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + e3f93abe380fa9d9068825b36af9f34f + n + 500/100 + 500/100 + 630a8066fdf69ac977808b2295ed9f68 + + + + + + 5e8d0bf91d65b3385d39e2fbc7528f92 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 09:52:39 -0600 + + Transfer from Savings + + ff61df2aa1ff54a7683ded3312c7cde9 + y + + 2001-01-16 00:00:00 -0600 + + 50000/100 + 50000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + c934c0a35454cb4757f04ec6d9bf28f9 + n + -50000/100 + -50000/100 + 7117b00944ea5def8959751832990c9e + + + + + + 4ad0609e6e66fc623db8a0d051aa9162 + 100 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:14:37 -0600 + + Home Town Grocery + + 2244e92f65e67e37f4d237278a70aa8f + y + + 2001-01-16 00:00:00 -0600 + + -7500/100 + -7500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 52e27b3bb5cba4d978479228d8e0e11c + n + 7500/100 + 7500/100 + 17e25505b81c735adec6d10aa1536a0a + + + + + + 190c55a7637a8f6622fab4eb31f4afed + 101 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:19:55 -0600 + + ABC Hardware + + f7b76a73f8e7574bcf07219e422da54a + Parts and tools + Check + y + + 2001-01-16 00:00:00 -0600 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + ebad73b5da75bf3af18974612e8b41b6 + Household parts + n + 5000/100 + 5000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + ff6838a2385e6330f6e6c5f70665d537 + Tools needed + n + 5000/100 + 5000/100 + 126f38b941cfe865f811e1c011e5bc51 + + + + + + f09f609caacaa2168d69751b6cc59688 + ATM + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:25:34 -0600 + + Cash withdrawal + + 9d5f50ab638f22ec7be2833c3dc2487d + y + + 2001-01-16 00:00:00 -0600 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + f9a4088f52083b30afd9b0c437a59eec + n + 10000/100 + 10000/100 + 15468df1e7097e7c317fb7a541010d69 + + + + + + cfcc79959b18613cca530c4ead7fc8e6 + + 2001-02-05 00:00:00 -0600 + + + 2001-02-19 19:36:36 -0600 + + Payment of bill + + eed91ed9af5677c13e860157aed999d1 + y + + 2001-02-28 00:00:00 -0600 + + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 657b2ffac761f1a4e5a4a8e878308fd8 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + + 162b5e1934b047b7b227d5dd4fc512a2 + 104 + + 2001-03-05 00:00:00 -0600 + + + 2001-02-19 19:47:42 -0600 + 926968000 + + Payment of bill + + a31a9ad6d93260b8c8a1c5820c8b639b + n + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + bd388be7c46cabda67617974555b9638 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + + fda224619e2ae85255c5177b926e65e1 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 09:33:53 -0600 + + Opening Balance + + 7fb6737ab23ca40c0aed10e05d0655ef + n + 100000/100 + 100000/100 + 7117b00944ea5def8959751832990c9e + + + de1a7dd8d9b6ca3872bc68f688c6cd95 + n + -100000/100 + -100000/100 + f61553abd3d8029455441267f6530f3d + + + + + + 4fbd0a30a57f69bbb9059f6b809894e2 + + 2001-01-31 00:00:00 -0600 + + + 2001-02-19 16:36:43 -0600 + + Opening Balance + + cc135c8a137d846a963066bfc423c021 + y + + 2001-02-28 00:00:00 -0600 + + -100000/100 + -100000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 084f7d3dea30f86928468126b818e0e5 + n + 100000/100 + 100000/100 + f61553abd3d8029455441267f6530f3d + + + + + + fe2e8993ad17c78c4feabd143f2a40fe + + 2001-02-01 00:00:00 -0600 + + + 2001-02-19 17:25:02 -0600 + + Greasy Spoon Cafe + + 54f62e99004b96a3ee68f039dc31bf73 + y + + 2001-02-28 00:00:00 -0600 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 3aa7d0f3f6648aa926fd8fe828135be1 + n + 2500/100 + 2500/100 + f4472ff237862ece69a1d3a58f293220 + + + + + + 3d0abd508aec96dab340949fd03b525d + + 2001-02-03 00:00:00 -0600 + + + 2001-02-19 17:25:43 -0600 + + Faux Pas Fashions + + db1fdfb171f7c20f6ac5e8086010faf2 + y + + 2001-02-28 00:00:00 -0600 + + -10000/100 + -10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0256d2ca85b92698e768f1e85e98961e + n + 10000/100 + 10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + + dd25a6957eee648969d60b77e56c34f9 + + 2001-02-15 00:00:00 -0600 + + + 2001-02-19 17:26:38 -0600 + + Premium Gasoline + + b8479d346c1ccec3371c7f6e51e94850 + y + + 2001-02-28 00:00:00 -0600 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0fee1efce1b9ad24ae13cf99b35db5dd + n + 2500/100 + 2500/100 + a13c10f2c32dc74c2e70f894351ef209 + + + + + + ff65fe32421def4c6e3feaa27ae84844 + + 2001-02-20 00:00:00 -0600 + + + 2001-02-19 17:28:01 -0600 + + Groceries R Us + + acceaee63a2292ae8c05c4a908f33b79 + Total charge + y + + 2001-02-28 00:00:00 -0600 + + -12500/100 + -12500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + f9305776dd37e70ac119d7ae9b876dab + Amount for food + n + 8500/100 + 8500/100 + 17e25505b81c735adec6d10aa1536a0a + + + f218012a54ab33909cd244bbaf4d21ef + Amount for household + n + 4000/100 + 4000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + + d8f825f93a4241c836fdcdd0e5926086 + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 17:29:38 -0600 + + CheapMart + + e5cce296604b1eee149bec0957316238 + y + + 2001-02-28 00:00:00 -0600 + + -6000/100 + -6000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 530a9d431a1df41b86a1ddb7064e7a35 + n + 6000/100 + 6000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + + 15c667f0235e41ddacb0bacd47a4a8ff + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 17:39:32 -0600 + + Faux Pas Fashions + + ac79d516c3d665eadc58272dae5c87f9 + y + + 2001-02-28 00:00:00 -0600 + + 10000/100 + 10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + c33b6a8abb949a1e6086a63ccc70ba5c + n + -10000/100 + -10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + + e32a43f88cfad521b4b3dc533e9d84ec + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 18:19:27 -0600 + + Finance Charge + + cb8b3b3cb076ec3b6a46325ea6b65eaa + y + + 2001-02-28 00:00:00 -0600 + + -2000/100 + -2000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + dcc0f4093ad558b74e505c63ca4f0ee7 + n + 2000/100 + 2000/100 + 4ca91a8240c1df8068fa4dc7c1da147e + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/carols-data-file.gml b/src/backend/file/test/test-files/xml1/carols-data-file.gml new file mode 100644 index 0000000000..b9571d3742 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/carols-data-file.gml @@ -0,0 +1,1270 @@ + + + 1 + + + + NASDAQ + Adbe + Adobe + 100000 + + + + + NASDAQ + Dell + Dell + 100000 + + + + + NASDAQ + ISWCX + ISWCX + 100000 + + + + + NASDAQ + jamrx + Janus Mercury + 100000 + + + + + NASDAQ + lnux + VA Linux + 100000 + + + + + NASDAQ + orcl + Oracle + 100000 + + + + + NASDAQ + rbus + Rambus + 100000 + + + + + NASDAQ + rhat + RedHat + 100000 + + + + + NASDAQ + slab + Silicon Labs + 100000 + + + + + NASDAQ + swpix + Schwab S&P 500 Index + 100000 + + + + + NASDAQ + tvqfx + Firsthand Technology Value Fun + 100000 + + + + + NYSE + AMD + AMD + 1000 + + + + + NYSE + AMD Opt- #2 8/14/98 + AMD Opt- #2 8/14/98 + 1000 + + + + + NYSE + AMD Opt-8/14/98 + AMD Opt-8/14/98 + 1000 + + + + + NYSE + AMD Opt-9/10/98 + AMD Opt-9/10/98 + 1000 + + + + + NYSE + AMD Opt. #3 8/14/98 + AMD Opt. #3 8/14/98 + 1000 + + + + + NYSE + AMD Opt. 5/3/99 + AMD Opt. 5/3/99 + 1000 + + + + + NYSE + AMD Opt. 9/10/98 + AMD Opt. 9/10/98 + 1000 + + + + + NYSE + Adobe + Adobe + 1000 + + + + + NYSE + Charles Schwab + Charles Schwab + 1000 + + + + + NYSE + Dell + Dell + 1000 + + + + + NYSE + Firsthand Technology Value Fun + Firsthand Technology Value Fun + 1000 + + + + + NYSE + Growth Equity Fund + Growth Equity Fund + 1000 + + + + + NYSE + IBM + IBM + 1000 + + + + + NYSE + ISWCX + ISWCX + 1000 + + + + + NYSE + Janus Mercury + Janus Mercury + 1000 + + + + + NYSE + Lucent Technologies + Lucent Technologies + 1000 + + + + + NYSE + Oracle + Oracle + 1000 + + + + + NYSE + QQQ + QQQ + 100000 + + + + + NYSE + Rambus + Rambus + 1000 + + + + + NYSE + RedHat + RedHat + 1000 + + + + + NYSE + Schwab S&P 500 Index + Schwab S&P 500 Index + 1000 + + + + + NYSE + Silicon Graphics + Silicon Graphics + 1000 + + + + + NYSE + Silicon Labs + Silicon Labs + 1000 + + + + + NYSE + Small Cap Growth Fund + Small Cap Growth Fund + 1000 + + + + + NYSE + VA Linux + VA Linux + 1000 + + + + + NYSE + amd + amd + 1000 + + + + + NYSE + lu + Lucent Technologies + 100000 + + + + + NYSE + sch + Charles Schwab + 100000 + + + + + NYSE + sgi + Silicon Graphics + 100000 + + + + + + Checking + 7cce1d8ee29f0e4c30c949f77bb2a447 + BANK + + ISO4217 + USD + + + + notes + + + + last-num + 100 + + + reconcile-info + + + last-date + 979624800 + + + + + + + + + Savings + 7117b00944ea5def8959751832990c9e + BANK + + ISO4217 + USD + + + + notes + + + + + + + + Cash + 15468df1e7097e7c317fb7a541010d69 + CASH + + ISO4217 + USD + + + + notes + + + + + + + + Credit Card + bdc5ed7168216d6df0f8d00767299bc7 + CREDIT + + ISO4217 + USD + + + + notes + + + + reconcile-info + + + last-date + 983340000 + + + + + + + + + Salary + d77f5ecb0a800748fdbae42e98908a85 + INCOME + + ISO4217 + USD + + + + notes + + + + + + + + Clothes + 52c89f4b1d0b7b445e0793278fd5ff62 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Dining + f4472ff237862ece69a1d3a58f293220 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + FICA + 1b211cffcf23b31e80666dadf57a37b0 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + FedTax + 9372c7685bfaf9086cb3cb53190b2ce2 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Finance Charge + 4ca91a8240c1df8068fa4dc7c1da147e + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Fuel + a13c10f2c32dc74c2e70f894351ef209 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Groceries + 17e25505b81c735adec6d10aa1536a0a + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Household + 62479a9add5ae8bb253da6ab3d713083 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Service Charges + 630a8066fdf69ac977808b2295ed9f68 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Tools + 126f38b941cfe865f811e1c011e5bc51 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Utilities + 00adc8fb6cc29e7ae5de56d6f8624ac5 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + + + + Electric + 554b4134fc4a9c0361e9c8ca8f744229 + EXPENSE + + ISO4217 + USD + + + + notes + + + + + 00adc8fb6cc29e7ae5de56d6f8624ac5 + + + + + + Opening Balances + f61553abd3d8029455441267f6530f3d + EQUITY + + ISO4217 + USD + + + + notes + + + + + + + + c25df6ca60518acb3044016e7c799f3c + + 2000-12-20 00:00:00 -0600 + + + 2000-12-20 12:05:39 -0600 + + Paycheck deposit + + 26399b198b8beab9c11a84cabbd22da4 + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 3bfc8952ec151252d1797087be4f7751 + n + -80000/100 + -80000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + + + + eab3726a1157800a147285dbb6ef091e + + 2000-12-27 00:00:00 -0600 + + + 2000-12-20 12:25:30 -0600 + 54442000 + + Paycheck deposit + + 6a1892e895b31a5a2e65a8d7a718d2a5 + Effect on checking + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + fa8a34aab999ecb849f14c4e089272e8 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 067ba239023aa1450002f2f960241500 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 5ecafd54335e2a993047d80c9b0a1335 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + + 8f9d9b1d8f179a20f69d1104756cbf70 + + 2001-01-03 00:00:00 -0600 + + + 2000-12-20 12:05:39 -0600 + 389786000 + + Paycheck deposit + + c9d13d1243281e0e37011901e02dba51 + Effect on checking + y + + 2001-01-16 00:00:00 -0600 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 8902cfce8bf774b82f55d31f03abc0a0 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 98490994785921ee6fd9e5d29f8a7435 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 4fad0c6ee1cd7fd3fe37a487aff39a94 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + + 104059201725c15eab8157a46542305c + + 2001-01-15 00:00:00 -0600 + + + 2001-01-16 10:38:22 -0600 + + Service charge + + 42b82c4437208eba6afaa9e7ce76bb61 + y + + 2001-01-16 00:00:00 -0600 + + -500/100 + -500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + e3f93abe380fa9d9068825b36af9f34f + n + 500/100 + 500/100 + 630a8066fdf69ac977808b2295ed9f68 + + + + + + 5e8d0bf91d65b3385d39e2fbc7528f92 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 09:52:39 -0600 + + Transfer from Savings + + ff61df2aa1ff54a7683ded3312c7cde9 + y + + 2001-01-16 00:00:00 -0600 + + 50000/100 + 50000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + c934c0a35454cb4757f04ec6d9bf28f9 + n + -50000/100 + -50000/100 + 7117b00944ea5def8959751832990c9e + + + + + + 4ad0609e6e66fc623db8a0d051aa9162 + 100 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:14:37 -0600 + + Home Town Grocery + + 2244e92f65e67e37f4d237278a70aa8f + y + + 2001-01-16 00:00:00 -0600 + + -7500/100 + -7500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 52e27b3bb5cba4d978479228d8e0e11c + n + 7500/100 + 7500/100 + 17e25505b81c735adec6d10aa1536a0a + + + + + + 190c55a7637a8f6622fab4eb31f4afed + 101 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:19:55 -0600 + + ABC Hardware + + f7b76a73f8e7574bcf07219e422da54a + Parts and tools + Check + y + + 2001-01-16 00:00:00 -0600 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + ebad73b5da75bf3af18974612e8b41b6 + Household parts + n + 5000/100 + 5000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + ff6838a2385e6330f6e6c5f70665d537 + Tools needed + n + 5000/100 + 5000/100 + 126f38b941cfe865f811e1c011e5bc51 + + + + + + f09f609caacaa2168d69751b6cc59688 + ATM + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 10:25:34 -0600 + + Cash withdrawal + + 9d5f50ab638f22ec7be2833c3dc2487d + y + + 2001-01-16 00:00:00 -0600 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + f9a4088f52083b30afd9b0c437a59eec + n + 10000/100 + 10000/100 + 15468df1e7097e7c317fb7a541010d69 + + + + + + cfcc79959b18613cca530c4ead7fc8e6 + + 2001-02-05 00:00:00 -0600 + + + 2001-02-19 19:36:36 -0600 + + Payment of bill + + eed91ed9af5677c13e860157aed999d1 + y + + 2001-02-28 00:00:00 -0600 + + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 657b2ffac761f1a4e5a4a8e878308fd8 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + + 162b5e1934b047b7b227d5dd4fc512a2 + 104 + + 2001-03-05 00:00:00 -0600 + + + 2001-02-19 19:47:42 -0600 + 926968000 + + Payment of bill + + a31a9ad6d93260b8c8a1c5820c8b639b + n + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + bd388be7c46cabda67617974555b9638 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + + fda224619e2ae85255c5177b926e65e1 + + 2001-01-16 00:00:00 -0600 + + + 2001-01-16 09:33:53 -0600 + + Opening Balance + + 7fb6737ab23ca40c0aed10e05d0655ef + n + 100000/100 + 100000/100 + 7117b00944ea5def8959751832990c9e + + + de1a7dd8d9b6ca3872bc68f688c6cd95 + n + -100000/100 + -100000/100 + f61553abd3d8029455441267f6530f3d + + + + + + 4fbd0a30a57f69bbb9059f6b809894e2 + + 2001-01-31 00:00:00 -0600 + + + 2001-02-19 16:36:43 -0600 + + Opening Balance + + cc135c8a137d846a963066bfc423c021 + y + + 2001-02-28 00:00:00 -0600 + + -100000/100 + -100000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 084f7d3dea30f86928468126b818e0e5 + n + 100000/100 + 100000/100 + f61553abd3d8029455441267f6530f3d + + + + + + fe2e8993ad17c78c4feabd143f2a40fe + + 2001-02-01 00:00:00 -0600 + + + 2001-02-19 17:25:02 -0600 + + Greasy Spoon Cafe + + 54f62e99004b96a3ee68f039dc31bf73 + y + + 2001-02-28 00:00:00 -0600 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 3aa7d0f3f6648aa926fd8fe828135be1 + n + 2500/100 + 2500/100 + f4472ff237862ece69a1d3a58f293220 + + + + + + 3d0abd508aec96dab340949fd03b525d + + 2001-02-03 00:00:00 -0600 + + + 2001-02-19 17:25:43 -0600 + + Faux Pas Fashions + + db1fdfb171f7c20f6ac5e8086010faf2 + y + + 2001-02-28 00:00:00 -0600 + + -10000/100 + -10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0256d2ca85b92698e768f1e85e98961e + n + 10000/100 + 10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + + dd25a6957eee648969d60b77e56c34f9 + + 2001-02-15 00:00:00 -0600 + + + 2001-02-19 17:26:38 -0600 + + Premium Gasoline + + b8479d346c1ccec3371c7f6e51e94850 + y + + 2001-02-28 00:00:00 -0600 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0fee1efce1b9ad24ae13cf99b35db5dd + n + 2500/100 + 2500/100 + a13c10f2c32dc74c2e70f894351ef209 + + + + + + ff65fe32421def4c6e3feaa27ae84844 + + 2001-02-20 00:00:00 -0600 + + + 2001-02-19 17:28:01 -0600 + + Groceries R Us + + acceaee63a2292ae8c05c4a908f33b79 + Total charge + y + + 2001-02-28 00:00:00 -0600 + + -12500/100 + -12500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + f9305776dd37e70ac119d7ae9b876dab + Amount for food + n + 8500/100 + 8500/100 + 17e25505b81c735adec6d10aa1536a0a + + + f218012a54ab33909cd244bbaf4d21ef + Amount for household + n + 4000/100 + 4000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + + d8f825f93a4241c836fdcdd0e5926086 + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 17:29:38 -0600 + + CheapMart + + e5cce296604b1eee149bec0957316238 + y + + 2001-02-28 00:00:00 -0600 + + -6000/100 + -6000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 530a9d431a1df41b86a1ddb7064e7a35 + n + 6000/100 + 6000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + + 15c667f0235e41ddacb0bacd47a4a8ff + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 17:39:32 -0600 + + Faux Pas Fashions + + ac79d516c3d665eadc58272dae5c87f9 + y + + 2001-02-28 00:00:00 -0600 + + 10000/100 + 10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + c33b6a8abb949a1e6086a63ccc70ba5c + n + -10000/100 + -10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + + e32a43f88cfad521b4b3dc533e9d84ec + + 2001-02-25 00:00:00 -0600 + + + 2001-02-19 18:19:27 -0600 + + Finance Charge + + cb8b3b3cb076ec3b6a46325ea6b65eaa + y + + 2001-02-28 00:00:00 -0600 + + -2000/100 + -2000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + dcc0f4093ad558b74e505c63ca4f0ee7 + n + 2000/100 + 2000/100 + 4ca91a8240c1df8068fa4dc7c1da147e + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/cbb-export.gml b/src/backend/file/test/test-files/xml1/cbb-export.gml new file mode 100644 index 0000000000..7eb0dc29bd --- /dev/null +++ b/src/backend/file/test/test-files/xml1/cbb-export.gml @@ -0,0 +1,430 @@ + + + 1 + + + + cbb export + 504a8f7f0ff8e1e53c6df8b1bb714c47 + BANK + + ISO4217 + HRK + + + + + + Gifts + 8cd43c12f1dc32ea8a51ec997fcf35ef + INCOME + Gift Expenses + + ISO4217 + HRK + + + + + + Reimbursements + 4f502fe69043087c2186dcac27cc56bf + INCOME + + ISO4217 + HRK + + + + + + Salary + 077894556323647344da06d5f5fe6449 + INCOME + Salary Income + + ISO4217 + HRK + + + + + + Clothing + 37539261eaf4bcf82c17eba0a5bf5949 + EXPENSE + Clothing + + ISO4217 + HRK + + + + + + Credit Card + 3b09243ca91d85c7b2984dd5f2490701 + EXPENSE + + ISO4217 + HRK + + + + + + Dining-Out + cd6d68365b6c9f80e4b68a552b71950b + EXPENSE + + ISO4217 + HRK + + + + + + Entertainment + 47585dff7df1969ea961e4b1a7fa9f27 + EXPENSE + + ISO4217 + HRK + + + + + + Household + 46d28144c136899835833bca6cda4e52 + EXPENSE + Household Misc. Exp + + ISO4217 + HRK + + + + + + Personal Cash + 98e07d070ecce19416db949e9124a45d + EXPENSE + + ISO4217 + HRK + + + + + + Telephone + 72e555d138c8a1e7c5e8c7953a54a55e + EXPENSE + Telephone Expense + + ISO4217 + HRK + + + + + + Textbooks + 224840878e17f4f7c6a5d6418747cafa + EXPENSE + + ISO4217 + HRK + + + + + + 9d2c18d552ab4a405bee914ca188eb70 + 323 + + 1997-06-23 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 256981000 + + Eurest Dining + + d62de62239db355ba3597b6a68722cbf + n + 435/100 + 435/100 + cd6d68365b6c9f80e4b68a552b71950b + + + 7cbe9fae8a6a7b5f53fb233e6cb19490 + n + -435/100 + -435/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 7b855de3a9f29605b1d5e0cb63d4b4cf + 331 + + 1997-07-12 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 251045000 + + Sally Wood + + 2c298a4d03fbe7cf10a416d06f83abc0 + VISA Bill - June + n + 51343/100 + 51343/100 + 3b09243ca91d85c7b2984dd5f2490701 + + + 31e772f55b364e2cdef8e02e12287e1f + VISA Bill - June + n + -51343/100 + -51343/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 1964523ed04475405c7f841548c0ae75 + ATM + + 1997-09-20 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 252071000 + + Withdrawal + + fe76f038b9d07bc9a47c1824f9752f68 + Claremont + n + 4000/100 + 4000/100 + 98e07d070ecce19416db949e9124a45d + + + bc707d062a5900ebb3ca4e313a7d0e96 + Claremont + n + -4000/100 + -4000/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + d32f7312b4970cde93b1814a69604c72 + ATM + + 1997-09-29 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 258296000 + + Deposit + + 937572eea8894521984a6364b0a98128 + HMC Orientation -97 + n + -5042/100 + -5042/100 + 4f502fe69043087c2186dcac27cc56bf + + + 6e99285a28ef72ff06bc0e61a7af13d1 + AE paycheck + n + -14300/100 + -14300/100 + 077894556323647344da06d5f5fe6449 + + + 18927d376a09bad9b06565df5402518d + HMC Orientation -97 + n + 19342/100 + 19342/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 6622109f3b62c5ccf1a95918c7a1c248 + 276 + + 1997-09-30 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 253063000 + + TCI + + 605eeca327a57a30af2ed3ff6518c174 + Cable - August + n + 1399/100 + 1399/100 + 47585dff7df1969ea961e4b1a7fa9f27 + + + 0c48c1184a392f5b95e998b4dca76ebc + Cable - August + n + -1399/100 + -1399/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 3048039143626c17d3109ff7fc37467e + 277 + + 1997-10-11 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 248714000 + + AT&T/063 + + eac0bf2d0950dedbaae474e0c1d4e085 + Phone Bill - September + n + 619/100 + 619/100 + 72e555d138c8a1e7c5e8c7953a54a55e + + + 79e1478ef9dcd2b207b22b943283049a + Phone Bill - September + n + -619/100 + -619/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 8bf78f94bb539e8f904cc49ec7f99444 + 278 + + 1997-10-11 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 249996000 + + BofA + + 3743498b2f1c99256bde3d3160826579 + Wal-Mart + n + 4475/100 + 4475/100 + 46d28144c136899835833bca6cda4e52 + + + c22bfdb9021873b31caedd002c22f036 + Fall 1997 - Huntley + n + 5330/100 + 5330/100 + 224840878e17f4f7c6a5d6418747cafa + + + d67f1387b0bb534372a80e168cb6e1b8 + Wal-Mart + n + -9805/100 + -9805/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + 4097ea8244e81a99d5862a7313e51ff8 + 279 + + 1997-10-27 00:00:00 -0500 + + + 2001-03-26 15:37:09 -0500 + 255798000 + + Scripps College + + 30a555c9081c84934ca827f652c2e1d3 + Orchestra T-Shirt + n + 1000/100 + 1000/100 + 37539261eaf4bcf82c17eba0a5bf5949 + + + a02cc758726391ec2c64e21d2188e987 + Orchestra T-Shirt + n + -1000/100 + -1000/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + c1b75a304185a70beefd55f9f3b5cb17 + 283 + + 1997-11-24 00:00:00 -0500 + + + 2001-03-26 15:37:09 -0500 + 254099000 + + West Dorm + + ee024d6fed778265b1e6513d6ee7d8d4 + Dorm T-Shirts + n + 1500/100 + 1500/100 + 8cd43c12f1dc32ea8a51ec997fcf35ef + + + cd59b6089604201628093e13dfd4bced + Dorm T-Shirts + n + -1500/100 + -1500/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/conrads-file b/src/backend/file/test/test-files/xml1/conrads-file new file mode 100644 index 0000000000..e8e65a93c0 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/conrads-file @@ -0,0 +1,449 @@ + + + 1 + + + + AMEX + stk + Stock + 100 + + + + + Imbalance-AUD + ca36693eb25a602c171d07cb682b3e1b + BANK + + ISO4217 + AUD + + + + + + Assets + a947017cbd3b26198484086f8d93863b + STOCK + A0000 + + ISO4217 + AUD + + + + notes + + + + + + + + Stock1 + 33181c172f50aaa24792256f2db4690e + STOCK + A0001 + + ISO4217 + AUD + + + AMEX + stk + + + + notes + + + + + a947017cbd3b26198484086f8d93863b + + + + + + Stock2 + 4ca39e2f16ccf288ea0d956d2371bf82 + STOCK + A0002 + + ISO4217 + AUD + + + AMEX + stk + + + + notes + + + + + a947017cbd3b26198484086f8d93863b + + + + + + Cash + dd0cfd17078251ec6ef03da8a081f2a3 + ASSET + C0000 + + ISO4217 + AUD + + + + notes + + + + + + + + Bank + 6f8df62ae08403ee2a8eb5aa61cec772 + BANK + C0001 + + ISO4217 + AUD + + + + notes + + + + + dd0cfd17078251ec6ef03da8a081f2a3 + + + + + + 5a77b2d61485f286aff878be6febef64 + + 2000-11-28 16:04:14 +1100 + + + 2000-11-28 16:05:23 +1100 + + Initial purchase of stock + + 0c92275921282ef27f8ebf7389735ad2 + n + 15000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 4a2b02002eb5d1f854d4269dc42c6952 + n + -15000/100 + -15000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + edc6b34f5d5f2a571843eb6033f7b8d9 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:28 +1100 + + Sale (1) + + 1dffcfc068e38f78ca5801e3487e6bdb + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + ce0457f98bf2e1f2db98cefa1e418631 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + e1382f1ac62f7c0d5e3be35b7c829a69 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:30 +1100 + 66309000 + + Sale (1) + + 3146350195a33643ba3ab29a6cea463e + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + a2ab877a4ab0387538d08493402bd186 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 8243a16bf6e7baa7c3f03d1269b0af59 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:46 +1100 + 664262000 + + Sale (1) + + fc1ff0f23ef547885da036b1b9900a34 + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 99e7f2948ccaf69b77d3f5179e2236eb + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 29d5624b4640a6020d9d37d9bc60b29b + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:32:08 +1100 + 413532000 + + Sale (1) + + e945659fa802e7b66a88674f1adc8cbb + n + -6400/100 + -3000/100 + 33181c172f50aaa24792256f2db4690e + + + e9b926f5a8a48b12048e274119c119d3 + n + 6400/100 + 6400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 9dc249c5bbcea69ac8c7bf7c60ca34e0 + + 2000-11-29 11:01:14 +1100 + + + 2000-11-29 11:01:39 +1100 + + buy more + + 7048bec4fcce79b3941de51944a48231 + n + 11000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 1e7d08ae4724c49593982e73449e9788 + n + -11000/100 + -11000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + b585a0ac253ce4316fedab1b495a2006 + + 2000-11-30 11:18:25 +1100 + + + 2000-11-30 11:19:12 +1100 + + Sell lots + + 18c80178f75af440f5a1a87081b2fecb + n + -50000/100 + -40000/100 + 33181c172f50aaa24792256f2db4690e + + + 5c96b06788eb8ab218c886ddb31dcd71 + n + 50000/100 + 50000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 507c9bcd04bb43dc96a58ba418fe86c5 + + 2000-11-30 11:43:12 +1100 + + + 2000-11-30 11:45:18 +1100 + + some purchases + + 71ac0831a93fb732f93106f26a007469 + n + 32400/100 + 30000/100 + 33181c172f50aaa24792256f2db4690e + + + 4ea809cd49577ec887c10eb0022eb695 + n + -32400/100 + -32400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 791ce0217b5edf0c923f9cc3dc64c169 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 15:56:02 +1100 + + gargle + + 46fac7edef736a1cf3c3411de467dc14 + n + -2800/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 234e1618beaaeb3dac31e931338020f2 + n + 2800/100 + 2800/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 716b216f13e16d9e7afd49b3e8e4ffb6 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 20:22:12 +1100 + + fandangle + + e673423c75e9eb1b9443aa40bed778d0 + n + 25000/100 + 20000/100 + 33181c172f50aaa24792256f2db4690e + + + 49d24a29bb1bb67e44f9426265597262 + n + -25000/100 + -25000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + b74ee5f973e0b477eddc968384d2a594 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 22:57:22 +1100 + + A small sale + + da6264665f23b934aa5913308bfeb172 + n + -38000/100 + -19000/100 + 33181c172f50aaa24792256f2db4690e + + + 8c22cbc933e39c0c0226938c0eca8751 + n + 38000/100 + 24000/100 + 4ca39e2f16ccf288ea0d956d2371bf82 + + + + + + f9386ebc4654856d9f2c8d991f9060d8 + + 2000-11-28 16:03:09 +1100 + + + 2000-11-28 16:03:58 +1100 + + + 59d526f5b19077cded2e38a7726d69f7 + Deposit + n + 100000000/100 + 100000000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + 615e1758e9b8c958e596747191ec3226 + n + -100000000000/100000 + 0/100000 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/conrads-file.gml b/src/backend/file/test/test-files/xml1/conrads-file.gml new file mode 100644 index 0000000000..e8e65a93c0 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/conrads-file.gml @@ -0,0 +1,449 @@ + + + 1 + + + + AMEX + stk + Stock + 100 + + + + + Imbalance-AUD + ca36693eb25a602c171d07cb682b3e1b + BANK + + ISO4217 + AUD + + + + + + Assets + a947017cbd3b26198484086f8d93863b + STOCK + A0000 + + ISO4217 + AUD + + + + notes + + + + + + + + Stock1 + 33181c172f50aaa24792256f2db4690e + STOCK + A0001 + + ISO4217 + AUD + + + AMEX + stk + + + + notes + + + + + a947017cbd3b26198484086f8d93863b + + + + + + Stock2 + 4ca39e2f16ccf288ea0d956d2371bf82 + STOCK + A0002 + + ISO4217 + AUD + + + AMEX + stk + + + + notes + + + + + a947017cbd3b26198484086f8d93863b + + + + + + Cash + dd0cfd17078251ec6ef03da8a081f2a3 + ASSET + C0000 + + ISO4217 + AUD + + + + notes + + + + + + + + Bank + 6f8df62ae08403ee2a8eb5aa61cec772 + BANK + C0001 + + ISO4217 + AUD + + + + notes + + + + + dd0cfd17078251ec6ef03da8a081f2a3 + + + + + + 5a77b2d61485f286aff878be6febef64 + + 2000-11-28 16:04:14 +1100 + + + 2000-11-28 16:05:23 +1100 + + Initial purchase of stock + + 0c92275921282ef27f8ebf7389735ad2 + n + 15000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 4a2b02002eb5d1f854d4269dc42c6952 + n + -15000/100 + -15000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + edc6b34f5d5f2a571843eb6033f7b8d9 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:28 +1100 + + Sale (1) + + 1dffcfc068e38f78ca5801e3487e6bdb + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + ce0457f98bf2e1f2db98cefa1e418631 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + e1382f1ac62f7c0d5e3be35b7c829a69 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:30 +1100 + 66309000 + + Sale (1) + + 3146350195a33643ba3ab29a6cea463e + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + a2ab877a4ab0387538d08493402bd186 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 8243a16bf6e7baa7c3f03d1269b0af59 + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:31:46 +1100 + 664262000 + + Sale (1) + + fc1ff0f23ef547885da036b1b9900a34 + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 99e7f2948ccaf69b77d3f5179e2236eb + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 29d5624b4640a6020d9d37d9bc60b29b + + 2000-11-28 22:39:20 +1100 + + + 2000-11-28 23:32:08 +1100 + 413532000 + + Sale (1) + + e945659fa802e7b66a88674f1adc8cbb + n + -6400/100 + -3000/100 + 33181c172f50aaa24792256f2db4690e + + + e9b926f5a8a48b12048e274119c119d3 + n + 6400/100 + 6400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 9dc249c5bbcea69ac8c7bf7c60ca34e0 + + 2000-11-29 11:01:14 +1100 + + + 2000-11-29 11:01:39 +1100 + + buy more + + 7048bec4fcce79b3941de51944a48231 + n + 11000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 1e7d08ae4724c49593982e73449e9788 + n + -11000/100 + -11000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + b585a0ac253ce4316fedab1b495a2006 + + 2000-11-30 11:18:25 +1100 + + + 2000-11-30 11:19:12 +1100 + + Sell lots + + 18c80178f75af440f5a1a87081b2fecb + n + -50000/100 + -40000/100 + 33181c172f50aaa24792256f2db4690e + + + 5c96b06788eb8ab218c886ddb31dcd71 + n + 50000/100 + 50000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 507c9bcd04bb43dc96a58ba418fe86c5 + + 2000-11-30 11:43:12 +1100 + + + 2000-11-30 11:45:18 +1100 + + some purchases + + 71ac0831a93fb732f93106f26a007469 + n + 32400/100 + 30000/100 + 33181c172f50aaa24792256f2db4690e + + + 4ea809cd49577ec887c10eb0022eb695 + n + -32400/100 + -32400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 791ce0217b5edf0c923f9cc3dc64c169 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 15:56:02 +1100 + + gargle + + 46fac7edef736a1cf3c3411de467dc14 + n + -2800/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 234e1618beaaeb3dac31e931338020f2 + n + 2800/100 + 2800/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + 716b216f13e16d9e7afd49b3e8e4ffb6 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 20:22:12 +1100 + + fandangle + + e673423c75e9eb1b9443aa40bed778d0 + n + 25000/100 + 20000/100 + 33181c172f50aaa24792256f2db4690e + + + 49d24a29bb1bb67e44f9426265597262 + n + -25000/100 + -25000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + + b74ee5f973e0b477eddc968384d2a594 + + 2001-01-09 00:00:00 +1100 + + + 2001-01-09 22:57:22 +1100 + + A small sale + + da6264665f23b934aa5913308bfeb172 + n + -38000/100 + -19000/100 + 33181c172f50aaa24792256f2db4690e + + + 8c22cbc933e39c0c0226938c0eca8751 + n + 38000/100 + 24000/100 + 4ca39e2f16ccf288ea0d956d2371bf82 + + + + + + f9386ebc4654856d9f2c8d991f9060d8 + + 2000-11-28 16:03:09 +1100 + + + 2000-11-28 16:03:58 +1100 + + + 59d526f5b19077cded2e38a7726d69f7 + Deposit + n + 100000000/100 + 100000000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + 615e1758e9b8c958e596747191ec3226 + n + -100000000000/100000 + 0/100000 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/every.gml b/src/backend/file/test/test-files/xml1/every.gml new file mode 100644 index 0000000000..8c31fbd379 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/every.gml @@ -0,0 +1,4760 @@ + + + 1 + + + + NYSE + FID Cap & Income + FID Cap & Income + 100000 + + + + + NYSE + FID Eq Inc II + FID Eq Inc II + 100000 + + + + + NYSE + FID Govt Res + FID Govt Res + 100000 + + + + + NYSE + FID Growth & Inc + FID Growth & Inc + 100000 + + + + + NYSE + FID NewMkt Inc + FID NewMkt Inc + 100000 + + + + + Fidelity Inv + 1b791374ee19ad07b06c3e0a99aeb4fa + BANK + Mutual Fund Family + + ISO4217 + IRR + + + + + + FID Cap & Income + 31123b56c4780f491050562fc2bbdc20 + STOCK + + ISO4217 + IRR + + + NYSE + FID Cap & Income + + + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + FID Eq Inc II + db2182ba7d730b4e90c755d29c64c894 + STOCK + + ISO4217 + IRR + + + NYSE + FID Eq Inc II + + + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + FID Govt Res + 504f743d68e663efff21fc66b85cc491 + STOCK + + ISO4217 + IRR + + + NYSE + FID Govt Res + + + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + FID Growth & Inc + ebec8d5a26522f4a0865fa5f837af17b + STOCK + + ISO4217 + IRR + + + NYSE + FID Growth & Inc + + + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + FID NewMkt Inc + 0fac2553ae5a682f5ae978d081566ea5 + STOCK + + ISO4217 + IRR + + + NYSE + FID NewMkt Inc + + + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + Dummy Cash + 049676696675474217124e24f44fbaa7 + CASH + Reconcile Accounts + + ISO4217 + IRR + + + + + + Cap. gain (long) + 1ade3e58381c463d8a8c2703d134ccea + INCOME + + ISO4217 + IRR + + + + + + Fidelity Inv + b7eaa97e2760274bd7eb5104a3f6fd84 + INCOME + + ISO4217 + IRR + + + 1ade3e58381c463d8a8c2703d134ccea + + + + + + FID Eq Inc II + 2998f1baa86deced08bf21cb73d4d194 + INCOME + + ISO4217 + IRR + + + NYSE + FID Eq Inc II + + + b7eaa97e2760274bd7eb5104a3f6fd84 + + + + + + FID Growth & Inc + 5b7c74145709c67b9fa6d33ea12c9163 + INCOME + + ISO4217 + IRR + + + NYSE + FID Growth & Inc + + + b7eaa97e2760274bd7eb5104a3f6fd84 + + + + + + Cap. gain (short) + fec86ac037ee8dd3cfe9512f7fced74b + INCOME + + ISO4217 + IRR + + + + + + Fidelity Inv + 57e365b7b895c5a9ef328a69367c49e5 + INCOME + + ISO4217 + IRR + + + fec86ac037ee8dd3cfe9512f7fced74b + + + + + + FID Eq Inc II + f9599ed5ecf62d2c9326766617d6e5e7 + INCOME + + ISO4217 + IRR + + + NYSE + FID Eq Inc II + + + 57e365b7b895c5a9ef328a69367c49e5 + + + + + + FID Growth & Inc + d023c36ca9c320b873c5be9993078451 + INCOME + + ISO4217 + IRR + + + NYSE + FID Growth & Inc + + + 57e365b7b895c5a9ef328a69367c49e5 + + + + + + FID NewMkt Inc + 5f4d3dd84f8df6527d5091152aadb4d6 + INCOME + + ISO4217 + IRR + + + NYSE + FID NewMkt Inc + + + 57e365b7b895c5a9ef328a69367c49e5 + + + + + + Dividends + 0406079e56613a22d8112b8dbfbed622 + INCOME + + ISO4217 + IRR + + + + + + Fidelity Inv + 928026d717b302da3d24fb64f086b18a + INCOME + + ISO4217 + IRR + + + 0406079e56613a22d8112b8dbfbed622 + + + + + + FID Cap & Income + 98a3d87a9305f733420ceee444cbfbe4 + INCOME + + ISO4217 + IRR + + + NYSE + FID Cap & Income + + + 928026d717b302da3d24fb64f086b18a + + + + + + FID Eq Inc II + 6344d1b4710050ba1fd600c56eee740b + INCOME + + ISO4217 + IRR + + + NYSE + FID Eq Inc II + + + 928026d717b302da3d24fb64f086b18a + + + + + + FID Govt Res + 11709b1c45e84450d7a282228e69b56c + INCOME + + ISO4217 + IRR + + + NYSE + FID Govt Res + + + 928026d717b302da3d24fb64f086b18a + + + + + + FID Growth & Inc + 55d69cebd7b9b64b6e9678b6588e64a1 + INCOME + + ISO4217 + IRR + + + NYSE + FID Growth & Inc + + + 928026d717b302da3d24fb64f086b18a + + + + + + FID NewMkt Inc + 4ed39bec2d9009028bc277e7ca58b372 + INCOME + + ISO4217 + IRR + + + NYSE + FID NewMkt Inc + + + 928026d717b302da3d24fb64f086b18a + + + + + + Unspecified + 5f856918b8284a11ebc757485d853667 + INCOME + + ISO4217 + IRR + + + + + + Commissions + c4ab48d47126697c3ee461627fedbc86 + EXPENSE + + ISO4217 + IRR + + + + + + Fidelity Inv + 01ebde432dcc5dee900ce670743eab41 + EXPENSE + + ISO4217 + IRR + + + c4ab48d47126697c3ee461627fedbc86 + + + + + + Retained Earnings + 7914214426a5a0d6f1d6d64c6614f80a + EQUITY + + ISO4217 + IRR + + + + + + d6e78e4275e257da6c333a9876c3b644 + + 1990-07-06 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 741484000 + + + 00eefbfbf6cbc2087201547d60869e6e + Exch to Gov't Res + n + -3458/1 + -20000000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 356c4b8988eb64b3b536e45b674b431d + n + 3458/1 + 3458/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + 2a3ace35d28647deb539be077ded27d3 + + 1991-04-16 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 944175000 + + + d0ad508bed58a23e859f852cdcc71178 + Exch To Gov't Reserves + n + -1990/1 + -10000000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 6dd7c0040101979cb52d9c8ded76ee8e + n + 1990/1 + 1990/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + + b8a38afaa9d3b82344fc7020eb9d099f + + 1992-11-13 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 473011000 + + + af958174d9ea862dad7af6ad329ba728 + Exch From Gov't Reserves + n + 2000/1 + 10357300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + ed4ef7d90b31b1cbd8d940407901af3c + n + -2000/1 + -2000/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + b61403494bf7aa882aace4ed93bfb61b + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 2bef856b1e707cc5feab81fa1495eea3 + + 1993-03-24 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 712028000 + + + ac68542da789a7dc0af6c5720fbb34a3 + cash purchase of new shares + n + 10000/1 + 108108000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 1061d81adb4fd29b8c0cf4ca9b8749ce + n + -10000/1 + -10000/1 + 049676696675474217124e24f44fbaa7 + + + + + + 807b16cf00bc2ccaaf1211e9b2381a78 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 739492000 + + + 1bc6565a14e00c0d6a6a7db76f41a4c9 + n + 12/1 + 127800/100000 + 31123b56c4780f491050562fc2bbdc20 + + + e14124bc06eae1af067a643ba92eff37 + n + -12/1 + -1185000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + a8736c9099432aa7fd29e4cf9d2c970d + + 1993-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 795666000 + + + 3dd37a9242ec74996893160e5d71f855 + n + 48/1 + 513000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + b11e0746d5e760cf2f718bbf14b9841f + n + -48/1 + -4771000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 59778b68e3d8b5693bb715feba57a77e + + 1993-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 799715000 + + + 6da711d886f3da8ae604be4d5f0652c0 + n + 50/1 + 534400/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 750870806cb38d6df774e0b51a972d08 + n + -50/1 + -5045000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + e92ccdbe06a83860a78222466284dc53 + + 1993-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 852837000 + + + 3632bd8b8c1d4ff0149cc8c28e139aa0 + n + 226/1 + 2354500/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 88b6bff1f9fc2edfe7664189bb3d840f + n + -226/1 + -22603000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + aa9dac0057c046197512332844ac9827 + + 1993-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 887346000 + + + 4bce5fe956a23977cc88a47cc4b260b9 + n + 55/1 + 568900/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 7376dc1e8143c0ba3bebc4de2af4856a + n + -55/1 + -5484000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + f01d18bd7c09e76656ba7786fdbf9fc5 + + 1993-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 920642000 + + + 9ea03b2098642d0df9461d1150cfa9c5 + n + 55/1 + 569300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 226f733b11e7b3ab495c45f547356b20 + n + -55/1 + -5505000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + ae8001b1ec50f8236076febf23490d52 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 195612000 + + + fb4a9a74d2bf79e02840a95b9199a7d2 + n + 59/1 + 606200/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 61c5423316bedf031161ae265757cfc2 + n + -59/1 + -5862000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 94cd334f796417977e30d75d77c86e22 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 242264000 + + + 98053dd6c8f196706d655b1675e1a775 + n + 62/1 + 628700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 4ece3b478a25224ba650866982aa67ea + n + -62/1 + -6168000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 702b53683bcd9c8c1e159eb9369c2ee2 + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 292049000 + + + 0c6d7369a398d029b4ae04ce836595b5 + n + 62/1 + 632300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + f90f3a84572baab0b9d75905d0dbe916 + n + -62/1 + -6234000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 6c7cfd9e102e1af0f49c6e53754bf3ad + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 426822000 + + + ee7c8aa6d4cc0bb212f362cc79931167 + n + 157/1 + 1597300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 95936e8396168df8e2a18abeb5261025 + n + -157/1 + -15749000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + f1ae27cb77d1795348cbbb16d3ff2ff2 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 481957000 + + + 036e63c27a9d15f40538555dbb10c72e + n + 65/1 + 645700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 98e55a5dc74421e8c2501d50c0542fe1 + n + -65/1 + -6522000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + cf4b289a3f94b40146399663dc80a6e0 + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 564263000 + + + 76a9e0105dab132b9c429d647dfc1413 + n + 53/1 + 524700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + e8a57377cf20cda9b751f2b306a83dd6 + n + -53/1 + -5273000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 458f3f6be3288fadb9b6440065e5ef93 + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 664060000 + + + b9673d952ad2f802cc98654c3262edd9 + n + 59/1 + 605400/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 49f78ff1076ddac8920fcd2d97761286 + n + -59/1 + -5897000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + f7e538ef05270d922fda8c5298988e01 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 716774000 + + + 85052eee575a6492da7fe6ad88c84ad1 + n + 56/1 + 583700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 60f520f2fa00574621e14eba96647912 + n + -56/1 + -5598000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + fdc8b19dc6369cec2a43d4c80046afe4 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 764011000 + + + 3644e52fef6f6892c06e5fae6389c54c + n + 58/1 + 605000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 0072681a2f7762843e83e2e09ca23db7 + n + -58/1 + -5766000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 96c4757f5cca3a9c368d1905a74732b4 + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 849025000 + + + ae3ea80590e756f606c0b8da843cc990 + n + 271/1 + 2952100/100000 + 31123b56c4780f491050562fc2bbdc20 + + + bc258404fad94724f70dc9ab47d878b9 + n + -271/1 + -27100000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + 8aa8a081a1d3555b12bdbd48a7ab11e5 + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 900265000 + + + de885837bfb6e4e337cf9181e12a2918 + n + 62/1 + 676600/100000 + 31123b56c4780f491050562fc2bbdc20 + + + f649aaf59096635af00416fab27f318b + n + -62/1 + -6218000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + + e474a781b6dd39d47df7054a00967351 + + 1993-04-28 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 792210000 + + + 31819b1d0297836715e133668cc22d3f + Cash Purchase Shares + n + 15000/1 + 84602400/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 6934c83abe5eb7d2c5d7f615884dd0ce + n + -15000/1 + -15000/1 + 049676696675474217124e24f44fbaa7 + + + e2aa4945790c5f3827d236f83be1f8cd + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 11eb86bdb962aaa3b9b6fad8c072ac90 + + 1993-06-11 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 831653000 + + + 4a53c002e046a2731d97e7d7ce81cf85 + n + 76/1 + 426800/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 54fecb8b9f9afa5329aec37fc3d03561 + n + -76/1 + -7614000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + + 51cb01edc64bba0e2993125bce17df01 + + 1993-09-10 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 183541000 + + + 2e479785411ce1d08762495aec13d461 + n + 77/1 + 407700/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 5b2e5df3f9a40b0800848583b8631546 + n + -77/1 + -7653000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + + ad9b481b333437cab0b4f4c06b11551d + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 390709000 + + + b4c314bf4a41c728c352d645ad6f081c + n + 154/1 + 843100/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 13e7aa9d0c6eb8706b327dbf060aec27 + n + -154/1 + -15379000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + 946c37823a95f7b9b92c25d8789d79d0 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + ca7a1c3b3ab909c9dc31da6305b93452 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 395796000 + + + 26cc55521b3c2e65b1e9bcdf2a5b2071 + n + 367/1 + 2014100/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 89867bf0a499d288e80d854616810def + n + -367/1 + -36738000/100000 + f9599ed5ecf62d2c9326766617d6e5e7 + + + 5a42ac80db6d1ce43177dc26cde65f33 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 5af90318a04065fe126ee556561331a0 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 401628000 + + + afab0a7d86d8fa27f25b05f734315d3a + n + 214/1 + 1171000/100000 + db2182ba7d730b4e90c755d29c64c894 + + + fa3fc263acf9ea772ceb58ccdc7896fb + n + -214/1 + -21359000/100000 + 2998f1baa86deced08bf21cb73d4d194 + + + + + + 7a54b46f2cef91ace91f0c87544bb067 + + 1994-01-07 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 463277000 + + + edb4434b3a8c49bf76a3250fa876d85c + n + 27/1 + 143600/100000 + db2182ba7d730b4e90c755d29c64c894 + + + cde6f16e51027a569c2b23ca5dc0c10e + n + -27/1 + -2684000/100000 + f9599ed5ecf62d2c9326766617d6e5e7 + + + + + + 665953e9d700d68bc28db4afe13a4e8a + + 1994-03-11 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 613627000 + + + b9a8fbba701dc5b6a22adce249474c6c + n + 81/1 + 431700/100000 + db2182ba7d730b4e90c755d29c64c894 + + + a2ca29098d344753ea37638733dafdf2 + n + -81/1 + -8064000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + + 9c41db9da4c14a6440b6c45cfe09cae9 + + 1994-06-17 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 839384000 + + + 3ee99a601013abd81e2ddda8041f3274 + n + 90/1 + 475900/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 28e2e349e98342dcac45c6e9a2b55b3c + n + -90/1 + -9004000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + + e6babb418cdfa6cf7fbca87b26ed1cc9 + + 1989-01-01 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 389282000 + + + 96d4d8f635a24068e09c73e6fb953539 + Begining balance + n + 1035/1 + 103534000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 75d166405c5dd0602d4e2d92d252f0c7 + n + -1035/1 + -1035/1 + 7914214426a5a0d6f1d6d64c6614f80a + + + + + + 5c334d6efca5066702c73a8390044188 + + 1989-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 394957000 + + + d337975b9b80b9afb4c06e409ca405f3 + n + 7/1 + 715000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 9e4af5d40e7d6bf5908ab77f7a13c89e + n + -7/1 + -715000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 8f02fa6a632677e28db8d974b9c9315a + + 1989-02-03 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 400522000 + + + 11e7384b7d6ecdbf7faa26b093f891f2 + purchase shares + n + 1091/1 + 109066000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8432d0aa4cc02a276f1f45fe3ae14825 + n + -1091/1 + -1091/1 + 049676696675474217124e24f44fbaa7 + + + + + + 38b5580e05778d99045023e671de91a9 + + 1989-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 403213000 + + + 58ca624f452c025769c282e30c314861 + n + 13/1 + 1278000/100000 + 504f743d68e663efff21fc66b85cc491 + + + eb2b11486353dce3bca0c504597e8b20 + n + -13/1 + -1278000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + c25f1a743d6fb8864cda7ee6e19953d2 + + 1989-03-22 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 415826000 + + + 0c3e5a0ab693676b3b84fab5d3e956d1 + n + 5666/1 + 566589000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 54a1174f4e9702c09b56ae1681d6c5ef + n + -5666/1 + -5666/1 + 049676696675474217124e24f44fbaa7 + + + + + + 3f26366daa3b50c6fd7d2ce5e3c3584d + + 1989-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 419387000 + + + 0884d78380b56a1e9b90586268259c7c + n + 29/1 + 2856000/100000 + 504f743d68e663efff21fc66b85cc491 + + + cfc52aead2461b3a95abb33328e3515d + n + -29/1 + -2856000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + a835f2c0abf07e7549d5daf10bc42aec + + 1989-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 422649000 + + + 3a927a15a41fcf7c8f9d0f447c907e4f + n + 58/1 + 5818000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f546d7d2e2003043c73649f090dbea71 + n + -58/1 + -5818000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 95f60d468310a3950d83e5f08a7b1c16 + + 1989-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 426211000 + + + 1de0cba62a5faf210f8b867819f9722f + n + 61/1 + 6098000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4cb8e72e13810b24a9e9fe265ed55087 + n + -61/1 + -6098000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + c859526e0d4668d02f9897bc319d51b4 + + 1989-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 515035000 + + + b57da2c9f2404a189b7a4a27d1d0b793 + n + 58/1 + 5788000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ab6dc7118f2aa49e971c10187ab39709 + n + -58/1 + -5788000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 0741d26f2f8d0fd82f37c90f084780af + + 1989-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 523107000 + + + ec1f84110de1dd028c40c88509b4c000 + n + 59/1 + 5854000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 7d8f938c0988a8e2f403131f678cb352 + n + -59/1 + -5854000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 539ea424b94115c3332764743d7fe2e3 + + 1989-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 529783000 + + + 55749d7ad029749d22b145b2c642c2b4 + n + 56/1 + 5601000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 84f06f119d194ae033e785df319bb51b + n + -56/1 + -5601000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ac907f0c0a2deaf17de862f5856862ee + + 1989-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 543932000 + + + c4092c32aba244e0fd93263b1cc9c865 + n + 57/1 + 5653000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ddb33cdbc173804ad8708d9d244beaa8 + n + -57/1 + -5653000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 55d2535d747a99c84f22b0180725f0e5 + + 1989-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 553825000 + + + 7f15db289e0818b99f0c740a1d238168 + n + 54/1 + 5443000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 11e3aa802adfaaef68f0fffdff311ee4 + n + -54/1 + -5443000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 4aa4446650e67ec366c8f569a8576702 + + 1989-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 572519000 + + + 06200f95e271200176fcb36e24dacfa0 + n + 54/1 + 5360000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ff5453213d2bcac617886531c9aa0849 + n + -54/1 + -5360000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 5eabc4731bd0d2b2308b05071f6a2418 + + 1989-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 624189000 + + + cc786f774da1fb052e0e3171036511df + n + 57/1 + 5691000/100000 + 504f743d68e663efff21fc66b85cc491 + + + dd4327f729ad89ff44e233284d800aef + n + -57/1 + -5691000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 34f0c44231e4a2174a2946f19790a5df + + 1990-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 632046000 + + + 754a6519a183b44d57d451b2335dd0e1 + n + 52/1 + 5159000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a9ab80d0e4bb4a70f01195662a44d72a + n + -52/1 + -5159000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + d214295b9d3d35ce5c28c92c658b4a38 + + 1990-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 642472000 + + + ad15d3114f57b5f7e783737acaa42fd6 + n + 48/1 + 4791000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e2871523aa0c231f85e038a8c6858ee5 + n + -48/1 + -4791000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 5e68ffea30d5c1d8b28f76bcf069f7ff + + 1990-03-12 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 658326000 + + + eba68249ed49fd4a51d3fc3530052ed5 + transfer from fido cash res + n + 5397/1 + 539675000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 637677169bedd2b16433b002a7e5463b + n + -5397/1 + -5397/1 + 049676696675474217124e24f44fbaa7 + + + + + + 692eeee39ddc1987a71b6dfc2c4aabbf + + 1990-03-16 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 665613000 + + + d56aae4b1d0c8480f8b348ec3981176d + take cash out (buy house) + n + -7500/1 + -750000000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ff3d61007b332deab2af4b1e1838b19c + n + 7500/1 + 7500/1 + 049676696675474217124e24f44fbaa7 + + + + + + 630212e7a9af48d2bdce7dd53077d047 + + 1990-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 683102000 + + + 8d11af144c82d5c46488796105436ebe + n + 56/1 + 5597000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 0148f9c81156f3dadca1e94463b4c542 + n + -56/1 + -5597000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 4fcf15a9ffad57a8a6a59fa460a04c7e + + 1990-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 692027000 + + + eeb7751a7ab68c8ef4f3fb7c35d5f91b + n + 38/1 + 3837000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4403f534186364dc823350fd98504937 + n + -38/1 + -3837000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + dd0348326ab9b484c77db8dab8d7b8cd + + 1990-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 706155000 + + + 06e5bde29cc69c45f2789fdf050d1373 + n + 41/1 + 4129000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6fbdb1d02bd30ddd8f2eb266655380a7 + n + -41/1 + -4129000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 9b8df0176ea5bbe8a553d4494870fe0a + + 1990-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 732758000 + + + 8d805bd823c72681ee9426d917cc83a7 + n + 40/1 + 4042000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4b93d32188f02c7215638abe41cf02dd + n + -40/1 + -4042000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 82f32d501f776aaf9719bca5f45e81d0 + + 1990-07-09 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 750573000 + + + 3df9af77ec71c1b04f4608a75fca5a32 + cash out (buy House) + n + -8433/1 + -843295000/100000 + 504f743d68e663efff21fc66b85cc491 + + + bb74c0aeb5375f38d352404c42d4e234 + n + 8428/1 + 8428/1 + 049676696675474217124e24f44fbaa7 + + + 8f7ab2ad8d1022c3de07be459aaab076 + n + 5/1 + 5/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 7e8694dc9b9ce81b345f0b4c730762c1 + + 1990-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 763310000 + + + 304ac1b62b8df46b36db8f205cb0f0a4 + n + 20/1 + 1997000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ce2a535aa847148dfc7853d3141c9209 + n + -20/1 + -1997000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + cf1a6e82398177074bf8a4d5217cd56a + + 1990-08-27 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 781712000 + + + d5f91865493ba37d382f0a4bf6a5210a + cash out (buy House) + n + -1000/1 + -100000000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1247dad386de42e1c4dea321d6283578 + n + 1000/1 + 1000/1 + 049676696675474217124e24f44fbaa7 + + + + + + 078bc06b99dbed94c4995583379e8d1b + + 1990-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 793770000 + + + fb0a02d43964143d8256d9636c8863c4 + n + 9/1 + 909000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a6b88e7dee354790f0c93cb309eacbb2 + n + -9/1 + -909000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 0e62079bb110e69045e87fb7f3fba34f + + 1990-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 822127000 + + + d90c480abea60549c91242ee53f45224 + n + 4/1 + 354000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 24bcefc310d6a052cd40c4022b4b450f + n + -4/1 + -354000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 9b10bc1d277192d347e2627072397574 + + 1990-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 832680000 + + + 7a3e9ab55e1d259a1ac913dee4643183 + n + 4/1 + 366000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 42c47572ad9785f3ada14996e84e2adc + n + -4/1 + -366000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 47404368925a74736fc986cb775e4d56 + + 1990-11-16 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 843406000 + + + 93c5a6789b1f00e0b318e6a4cd5ed76b + purchase shares + n + 425/1 + 42500000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a374ebb0eac8a9f657550ea96d48de6f + n + -425/1 + -425/1 + 049676696675474217124e24f44fbaa7 + + + + + + d4ef6eb81b9feba3ee47271361b8603f + + 1990-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 855909000 + + + b1ff8381e75c27b035a808f5015b68c1 + n + 4/1 + 447000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b17c3d997d3a8994f31eb5dec39998cd + n + -4/1 + -447000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 0d85f4ce30ce71ed8e19ab28fe1ade2f + + 1990-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 875804000 + + + cd4a0e875d5f30a14bfade0f7a072fe4 + n + 6/1 + 605000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 35b89055943c253ed7e8e9d6181f5fcb + n + -6/1 + -605000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 7dbfd4541c986e69c978ccd77270cb8a + + 1991-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 889309000 + + + 79a0a41f0bff4c1d2afa4ebb2a561904 + n + 6/1 + 585000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 368ade1c0db96fc1f559c3604d38a88c + n + -6/1 + -585000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 74ba2148e61532354383bd42e57cf72b + + 1991-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 902153000 + + + 3275e6942ef10e12a9b033167d1e0289 + n + 5/1 + 497000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e7f079f483e0611ef8fcad08fa211e1c + n + -5/1 + -497000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ae215ac4450c7fdc9cfae43ded18a6eb + + 1991-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 931615000 + + + b94649e35b73722efc091d1327741542 + n + 5/1 + 525000/100000 + 504f743d68e663efff21fc66b85cc491 + + + cce34d274be7aac5733c88edf02d70c0 + n + -5/1 + -525000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 19e144969f80691b55f520d9f7e1693c + + 1991-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 954218000 + + + 3fd446e24ab39007c0ac7d792f1e906f + n + 9/1 + 920000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 480658716ecb1dfd8158da9d41519b7a + n + -9/1 + -920000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 033f95a4a7de32e2fae99207a04dacbc + + 1991-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 965787000 + + + d58e5de8f98b9d85170f2ab21b131339 + n + 14/1 + 1432000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8654ed4dee8acefad698097c85746bd3 + n + -14/1 + -1432000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 51844fed5bb3020423a08e4e23cd1d9f + + 1991-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 35491000 + + + efa0e6671b9544ef6ddba54810438a7e + n + 14/1 + 1379000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8213b451f6dec5530ef8833d837236d8 + n + -14/1 + -1379000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 23c2280097f26cc4e504f97a9dd8fb5a + + 1991-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 50028000 + + + 59c871254f1fca125996ad1ce3ca85f6 + n + 14/1 + 1426000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1085be41c4701b0f8a8e2627b1412dc9 + n + -14/1 + -1426000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ca24f0b0433cc40b1fe4b9a06778d379 + + 1991-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 65209000 + + + 7d2d52263114ec0de700e5f5475b9fac + n + 14/1 + 1402000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 42fce7ace0f4b2b9fb6534663ebbb20c + n + -14/1 + -1402000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 4f8ac60168907d0e11ce5904c8e659f7 + + 1991-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 130770000 + + + 5b6ec599799869f7147d5ea707c84188 + n + 13/1 + 1328000/100000 + 504f743d68e663efff21fc66b85cc491 + + + fc03e7e14cffd8889df403d75e14c408 + n + -13/1 + -1328000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 7303272548cabff2e55e85961abc7089 + + 1991-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 144398000 + + + 2b43d6592111776698e05ed597300218 + n + 13/1 + 1328000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a765829123655bc68b167fb53995535f + n + -13/1 + -1328000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + a7f3271591f62f5a6ad058584f4992b9 + + 1991-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 160459000 + + + 9a680e409958aef3365b904a5eaeeba6 + n + 12/1 + 1206000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b0fb80246186505ce12f6a0aa4b21a37 + n + -12/1 + -1206000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ac804db71bf60a0da9893aab43b606a3 + + 1991-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 193766000 + + + f820b7a9d458d3240cf82b6a75d1226a + n + 12/1 + 1209000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 67bf73e03580162f208370de02cf8c74 + n + -12/1 + -1209000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 9042b1546b60746e1915c964adc8b946 + + 1992-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 210773000 + + + c8d8236fef054e084eaeb478bf123a20 + n + 11/1 + 1137000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 16da27ff728677d7f96e404a668ab046 + n + -11/1 + -1137000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 04e396b2528f924fd0fcee423501b765 + + 1992-02-29 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 225678000 + + + eba830bc519da51d0f5401eda4a5c6c8 + n + 10/1 + 990000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8aa931136d51ff2e60b26949a4e0de4d + n + -10/1 + -990000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + b1097c2a04b334c4c4fbcd6e47dbfd06 + + 1992-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 262643000 + + + 4bdd241e78a7bb2bf39dfc52aeec3d51 + n + 10/1 + 1016000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 05c28431acdb016c5d3e019d42ee36ad + n + -10/1 + -1016000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 2cf4558c2ed4427629ce642cdabdaa36 + + 1992-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 280782000 + + + c0b51b204f08bae0eaf048c6bbe2ac7a + n + 10/1 + 964000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 982b60403b679389bcf32c0c38c490de + n + -10/1 + -964000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 8131576d5232037bbd5300fbf6725aba + + 1992-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 295354000 + + + ac0417fd4b173fc2496e4e0a8a13de5b + n + 10/1 + 977000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a8f1be4742363871768dbb3b4086588a + n + -10/1 + -977000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 255c7f61d284a2d9f85867b67dfcf57d + + 1992-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 324440000 + + + e00642aca866b48a88d3bfacec563ee7 + n + 9/1 + 941000/100000 + 504f743d68e663efff21fc66b85cc491 + + + fd2390ea514e6069f3dd61bab97d9758 + n + -9/1 + -941000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 129fd901eae714632e44c0bfea4e65d3 + + 1992-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 344988000 + + + 0fd5f403cc687066cfd8ea0c6a9c3f82 + n + 9/1 + 883000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 91f34ca6157341b89c2febc0b2ab6067 + n + -9/1 + -883000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 751f44bb883bb03146dcc35a0fb8cfb0 + + 1992-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 370192000 + + + 8730b5f538e382c10c525d2d8471dfbc + n + 9/1 + 853000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 604dedc86c272bd1e50ff2fed42b7a0b + n + -9/1 + -853000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 9b90c1a6b84db4ae1eeb39f44be2ea5c + + 1992-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 432558000 + + + 05a8a3074aead03cb6b84aeab89597dd + n + 8/1 + 779000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8a301cd2e7bcb7e9179067ebfd4ca615 + n + -8/1 + -779000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 3b61063f49affd817d6bc54007b75e6e + + 1992-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 459844000 + + + d0b1464eeb0b33e6445b454e1d17f865 + n + 7/1 + 745000/100000 + 504f743d68e663efff21fc66b85cc491 + + + adecb93d2eafeb4a5f37c5c8c47642c5 + n + -7/1 + -745000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + b6818336b95441bf9110bbd009a65c9f + + 1992-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 526076000 + + + 9436b1afbe7df1bcb1fcc45afddef645 + n + 5/1 + 480000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b1cadab9c8afb87a32b51adb06f49ef0 + n + -5/1 + -480000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + dce8d1b3cc504f38db473b620befee8a + + 1992-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 591693000 + + + de92596ce277ae625af138e8aeb32e0e + n + 3/1 + 278000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 83e945b7518aadf9cdc4c0d13bb4a6fd + n + -3/1 + -278000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 02af01c94469d4a7c0f9f4386b3022ff + + 1993-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 640235000 + + + bd229859f21da83c0322433055e2fa96 + n + 3/1 + 272000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 377cc39754d197eae3473ecefc5bd4fa + n + -3/1 + -272000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 7185987ca229e586b5559d057c1778ec + + 1993-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 667629000 + + + 56af691f67daf003793b6738af6af9cc + n + 2/1 + 233000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 86caf3ba4acf80af6cf152ba5b408d71 + n + -2/1 + -233000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + e8bfcab70cb2cf146eef4cd99510b250 + + 1993-03-26 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 724378000 + + + 19a250aec8e0d953757a5f9818226517 + n + 2/1 + 234000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f28263afe61faf6c3a6a99960879110d + n + -2/1 + -234000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + a35e0cc2081fbeaad001cd6a325b2421 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 761094000 + + + 5afdde2446a7a37ebcc0952ebb125869 + n + 0/1 + 26000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f06294070bc12a6b4eb9b8dc3784c026 + n + 0/1 + -26000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 1c9a855b202087f52650b7085d827708 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 781218000 + + + bda09deb15ebf03ab9238278cdf5a70b + n + 2/1 + 249000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 46f89f5961f87c6ef02a0c62ca21b242 + n + -2/1 + -249000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 2764ca2edcea3954172cc441d2c7d90f + + 1993-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 820663000 + + + 440c19e324948ae3edc27e4a12a2421f + n + 3/1 + 257000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 10b492490ddd9f1bc163fb27b8cd80f2 + n + -3/1 + -257000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 4bf18f4c3d11cca5dc7dfff1e6bf589c + + 1993-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 873979000 + + + ada5fb98cffd6349ce27e51f48294ccb + n + 3/1 + 253000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 7ec6ff2b2959a858eb8dcae79feb78c8 + n + -3/1 + -253000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 954fd23c103cd5318f22b6752a244f5f + + 1993-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 902174000 + + + 53a76540735369c6657e3005d8470fb1 + n + 3/1 + 262000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 48e97a32c2b09d45d679ff1d69f8fe35 + n + -3/1 + -262000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 39fa16b35817b4783a52c5e733c28c2e + + 1993-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 934365000 + + + f2b3d37311886a13d1d3859f25d0696f + n + 3/1 + 267000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6dc8461c1079d2c38716ac66e471925c + n + -3/1 + -267000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ca3d4b34bd366fab161c257b6e6e1d74 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 221118000 + + + 455295f1ad8bc7b7e965848106f5c766 + n + 3/1 + 294000/100000 + 504f743d68e663efff21fc66b85cc491 + + + d9b79576122e51313739ea2488e9e94e + n + -3/1 + -294000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + e5b1dc58c3ea6bb2ec3a4b2ecf1436a5 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 271797000 + + + 17aa3ebd0e6e31a088c642db883d8d4b + n + 3/1 + 303000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 9a0d55353c1f87d395e0b824df740dc5 + n + -3/1 + -303000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + b59979b6f4b4833b8a61620420f23aed + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 311218000 + + + 1a86f3fe915764283f4b45ed95d1c9a4 + n + 3/1 + 299000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6a0dd87d95a6c34a892a6e7e769a659f + n + -3/1 + -299000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + ca634e532d36113a082175d1e06662c0 + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 448368000 + + + 0d56232f699d960fa474834b23d08a3b + n + 3/1 + 315000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4c0cca6f7b66351ac80fd15cc3f1011a + n + -3/1 + -315000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + b276dae985a2c3a97d3b2330378b6297 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 540528000 + + + 856dd4d6545ec548fc29f0d948e1b2e6 + n + 3/1 + 309000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8dcb67197a1fa0c9b44bb130e021d4e9 + n + -3/1 + -309000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 8fbb472426c3ca614088d67e8f5b0152 + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 600129000 + + + 1b669a50da328d349b69956e298c16e4 + n + 3/1 + 277000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f651749f0cf251c849e71ee2d98c7006 + n + -3/1 + -277000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + a277ce0a96bc349205bd324ab6f8cb54 + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 691841000 + + + b07882460f9a6ec409894705590fe770 + n + 3/1 + 317000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 0bd2ef253060a2dab65671fd0d8476ef + n + -3/1 + -317000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + c70ac48517d009defdd706045569e8f1 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 750397000 + + + 53f04c4112f05256f1d5f720918c8f70 + n + 3/1 + 329000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8ea4e0e8172c4e43ece6e227d6c677a5 + n + -3/1 + -329000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 0be7260f31dd7e2b4f6f76fe500e2659 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 798535000 + + + 8ac813c74b15d31857387e2b0f4397c9 + n + 4/1 + 367000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e005f80663e2ea0ca84417276745126f + n + -4/1 + -367000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 967e81d2ab739becc7c36ef594011230 + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 873703000 + + + 57e940882e772653ecf750e2852e4ca9 + n + 4/1 + 382000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1764cb1267dcea247be22e19476a6670 + n + -4/1 + -382000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + a5bb6168c59780b6ce7367f9f26995f0 + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 923053000 + + + 7af76d3548fb7afcf755b325759b166c + n + 4/1 + 418000/100000 + 504f743d68e663efff21fc66b85cc491 + + + c2a2ea53d2bb8d3a774c9a77a1402b65 + n + -4/1 + -418000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + + 149ed9ea42cc89e08ef96300b3080d16 + + 1989-01-01 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 387023000 + + + 65ae85436328d0d6ab0800c3b6f5f366 + Open account in Quicken + n + 47/1 + 304900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4518a65ee0ec3e10ea9dddbe6499f541 + n + -47/1 + -47/1 + 7914214426a5a0d6f1d6d64c6614f80a + + + + + + 365c9a0167086387f6ccb8fcdecb837f + + 1989-01-06 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 392268000 + + + 97c3ad87d053aab532fd5b3c6d0fc10c + Cash purchase of shares + n + 500/1 + 3261600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 851a7c2c88dc2970da3c80bf5c26939f + n + -500/1 + -500/1 + 049676696675474217124e24f44fbaa7 + + + + + + 21e754661b3e94c7b30daf3a937d7a00 + + 1989-03-22 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 406030000 + + + 566ce60f563de98589a9934d9dd6a859 + n + 5/1 + 31800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a1f84a720324c83aab24feb18870125b + n + -5/1 + -499000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + d50bb3ef3c3874be6ad3fa7d7747c18f + + 1989-06-21 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 502484000 + + + 3b6e6325264ef5047d53044e8697073a + n + 5/1 + 28900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8618553266c7792f56f3eef7ccad5c3f + n + -5/1 + -504000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 853e90a843bc6ca754e0020f880ef2e1 + + 1989-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 534827000 + + + 43a864456b7123bac2ba62ce56018f77 + n + 25/1 + 136400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4ea6145f1a537b11359c5a4c0ce955fb + n + -25/1 + -2466000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + 43dfa6fae54c4aff73790aa4ba0aa0c9 + + 1989-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 539150000 + + + 200e6596b0041b4813a98817283e5af6 + n + 5/1 + 28100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 36e0c9b9f1d91123bcaec148d51715d2 + n + -5/1 + -508000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 73a130f18115279128d42807eecd9d17 + + 1989-11-10 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 566126000 + + + 282cd6c6458cea3b89bef3590eb83ccb + Cash purchase shares + n + 7000/1 + 40045800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + fc0c9984db19d22c0080c274096908c7 + n + -7000/1 + -7000/1 + 049676696675474217124e24f44fbaa7 + + + 66ca33deec7dc6bbc78add0607119ece + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 23cb1f7f4409e51a476adc9ef195900b + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 580938000 + + + f1b677ba88b8fa17b03a9768d7716e75 + n + 219/1 + 1293900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 292aaed2f44da96b0de02f2239004b66 + n + -219/1 + -21919000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + + 2b08ee848c95f18f12db77217eb36b4e + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 599777000 + + + 05e092d86bde4e58ccde836f1bb97b78 + n + 39/1 + 232900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 7a799696a5ff64873b78831eda310584 + n + -39/1 + -3945000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + 58d7805fcf5932e1a5f0500963d96450 + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 605179000 + + + af046937a608b87d08b5f11d62c6719b + n + 145/1 + 854000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a61bf38bd8c7a3ff10b2102096f39ff0 + n + -145/1 + -14467000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 08ea79689b54b587b246bea23125f998 + + 1990-03-09 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 650450000 + + + d0872878240512ae65ca17068a914909 + n + 65/1 + 388600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 93f7d49022ac65f90bbc3fc53eaf2b96 + n + -65/1 + -6470000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 6ab9b6845369243f6551f22f9525e582 + + 1990-06-15 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 715197000 + + + 28caae2a98bb78da3a71f2a905299b1d + n + 65/1 + 376100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1b39b7011524db6f6e2991876822e4a3 + n + -65/1 + -6525000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 680d192c14288d0ed7637fb851a29be8 + + 1990-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 802554000 + + + 809e546b9f88e57482cf9e6a5d5cca8e + n + 59/1 + 387200/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a5c2aa715587537eb4e360b7c7a3bab7 + n + -59/1 + -5936000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + + 13db67067727f862cdee747851412a42 + + 1990-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 809391000 + + + 5e2677cb59f886298068cf7adfccd6d2 + n + 38/1 + 246400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4d2c8bc73228c127091b9545542d56b5 + n + -38/1 + -3778000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + bed35a0912239f4a0f0b9911e640ab92 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + a9ac82622309af3adbbb3863f99f6574 + + 1990-12-14 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 867579000 + + + 4e936b3f336d88a496bc028425cd85bf + n + 44/1 + 292800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 339c1d82ea13e3638f015ffc192badf7 + n + -44/1 + -4419000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 30c67568c9f6bcef04554aa66ba918b0 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 28cd07143b428794f4a06eae5ecacb02 + + 1991-03-08 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 915250000 + + + be884d993442652f1eb2b6daa1b0d08f + n + 33/1 + 180400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + fe036a7cfe1cdcd097553265e00f1298 + n + -33/1 + -3348000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 8b49f2c93c966b41993f643760400feb + + 1991-06-14 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 9336000 + + + 55ce7fda5ef77face473882660e5cf92 + n + 18/1 + 91900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 5efe020018b2f5f4b3e543a2c5f39c0a + n + -18/1 + -1809000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + d443f15fdb90108970a3a2816aa832f1 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + f751b22486e6c264adff44f5222e0bab + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 84032000 + + + 3811f3094ab0b7fce236b5d7269e924c + n + 69/1 + 357400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 34127722283abfdbb20760bf54eaa751 + n + -69/1 + -6909000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + 4e4b7413fc3c654d36941e6ac38584e5 + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 101337000 + + + e463c0d19439e55a8fd191cbde39a40c + n + 18/1 + 94100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 34699eb644cc32a207fa804228e6f5c9 + n + -18/1 + -1818000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 4f0e9a20946ab3f48bf42624b6955935 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 60015b9113b9c1fc9ae8f9741c9f3d98 + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 110059000 + + + a8f2a9e9f53f86ee2bcfe4d09631bbbd + n + 47/1 + 244500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 70cd251135221dd0d741d859d5a3c242 + n + -47/1 + -4726000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 2f28a3dc872fa18648c555e84e528e3d + + 1991-12-06 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 171475000 + + + c80432358e199c99d62da70c8c09cbdc + n + 11/1 + 59300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 6af85c51032b652c0bcfa1213bc778bb + n + -11/1 + -1133000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 376483f378a511050e4a30e4251fe4c6 + + 1992-03-13 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 250396000 + + + 206c29a967fe63de592935d3b7f0a878 + n + 19/1 + 90300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 7709a6924ce69fcda1004ffafc285696 + n + -19/1 + -1894000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 723f94b81b3e839a17cb3571c263a92c + + 1992-06-12 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 312749000 + + + 73a654e5d18b53c178873951bd77cacf + n + 23/1 + 107800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1450d0a1b0306e4a613223808c4bee8c + n + -23/1 + -2283000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + e889663b2b331ec1e4cc85702a7da666 + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 384390000 + + + fccae23b917d5f32ee03bcc40b859624 + n + 197/1 + 1043400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 546f786c11c73954c46900690151db82 + n + -197/1 + -19709000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + + 1d68fd78b1e5c0fc13bda01b00b9b39c + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 404235000 + + + e3333a92a3a022e37f04bc3852916638 + n + 237/1 + 1256100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 28a9d26d3faa0349d3f1150d34a58159 + n + -237/1 + -23728000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + 89033b8faf4c55804c04d17922a828c4 + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 414657000 + + + 99585495d4d90f3518bc65e80f383f8f + n + 23/1 + 121500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 3cc24b671c09f3759f4310e0816d5746 + n + -23/1 + -2296000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + ead272cc9bb339f291b3402376927be0 + + 1992-11-16 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 512951000 + + + 117553a5784faaa2459a1fcb34ad2f4f + Cash purchase + n + 500/1 + 2548400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2abb34ac5e093adc1a476df743dd017d + n + -500/1 + -500/1 + 049676696675474217124e24f44fbaa7 + + + + + + efdfa9e23bc696eb52d2bc12c6707443 + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 553043000 + + + 29df2eac11ba656319e1d574d3e98696 + n + 38/1 + 196100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8a760fa274caf409fa79e0c9e101e156 + n + -38/1 + -3791000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + + 6b4c51f5557800e1c57ecb715b64021f + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 564845000 + + + 9521d167ec6083591f07693f6b2d33ec + n + 7/1 + 35600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1fc683d7fee739d0921bf87cf5e8cd80 + n + -7/1 + -688000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + 1af404c3705adbbdfd3ace86ee1b1e44 + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 578623000 + + + a311c0359e76ce0b8ec73908be336375 + n + 79/1 + 410000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 05b3e3615297baf14779f0f84bb57de1 + n + -79/1 + -7926000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 1cb120babe020bc6d3f27736debafb53 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 90007910c263187cc555646cea767093 + + 1993-03-12 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 682752000 + + + 162c6847bbaa7e002983133b755219e9 + n + 42/1 + 202800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2e528934d31ec1e1eb4543f54e247175 + n + -42/1 + -4212000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 54b3dfe257713caa06f3cbf409db8ace + + 1993-03-24 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 695791000 + + + e2d6affec3a4c49d0ff3a7757ca79346 + cash purchase of new shares + n + 5000/1 + 23485200/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 5ae76ee2a0de29fa0b6524fae5153260 + n + -5000/1 + -5000/1 + 049676696675474217124e24f44fbaa7 + + + + + + 631806d8503d4fb7d28cf239c23cf6c9 + + 1993-06-25 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 844998000 + + + 6c86e3c928c06ebd20053a8bab39aa27 + n + 71/1 + 328600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 63797e39d23f80d75b45e14fcea27cee + n + -71/1 + -7055000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + d2d7f56bda985ccce1a0ebecf89c6d50 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 950696000 + + + e355bd6326c30478b9eaa1b4341f3b28 + n + 154/1 + 693000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 10aa4145f6fce7a29834f32c4ffa8d6d + n + -154/1 + -15371000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + + 84005d0c927673979de40acf3e6970d8 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 972770000 + + + bb4559923e98c4df5535b8cb0164ce79 + n + 95/1 + 426500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + b65c1a346a7e71e95860a1400b260510 + n + -95/1 + -9459000/100000 + d023c36ca9c320b873c5be9993078451 + + + ebd8f2aaed67d7bf4de3b81085e69dae + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 3fd16f527fd978a266d0d91faf95eb24 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 5018000 + + + b3501c1e38ef6817cd0a75d028a8b54c + n + 71/1 + 319800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8e3d0d56e2328522d92f968f99112e48 + n + -71/1 + -7093000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + e25c7404323b7e79f5756bd2a77f44c5 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 339053000 + + + 4565bd443b712b4f6a2405d51d503116 + n + 97/1 + 444700/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + f2794e58478b54c8668ebb3ad4e7c966 + n + -97/1 + -9690000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 35fd1ee961e2f78097dc7f7de8db6116 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 357816000 + + + 63c0bbaa7bb26fbde0d122514b9466a0 + n + 97/1 + 444700/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 993ab7e26c3441bf55ebc2053e255985 + n + -97/1 + -9690000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + + ef61b2fc0e6afc2420df67e26a311d35 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 381700000 + + + 5920c6c276608dd8b01334d677e46259 + n + 115/1 + 528000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2a8ec163df287a9c639a001356126708 + n + -115/1 + -11506000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + 212ca07f10e6521475e5cd15688262c4 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + + 73571733be8d7c8c456c675aa845b3fb + + 1994-03-18 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 632156000 + + + 208bb330b910a33b745b3790ac31834c + n + 62/1 + 273300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 014a78d4e05c62d13d6169ea9eece435 + n + -62/1 + -6198000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 34e3582727f48f45854d0e890f8ce1b6 + + 1994-06-17 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 818547000 + + + 003272498db7bba53825bfcbdc5a729d + n + 62/1 + 282100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + bb19f3b1a0573d752ddcd5ea11ee4846 + n + -62/1 + -6226000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + + 823f3c36840f5467ca9239ae1d6809ec + + 1993-09-16 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 188235000 + + + e4a445dc759e8abe6642683594805098 + Cash Purchase Shares + n + 5000/1 + 42992300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 6da3d2779e8df88964a9d5d81b868064 + n + -5000/1 + -5000/1 + 049676696675474217124e24f44fbaa7 + + + + + + 7fef1c436ebe86aa96d36413f321ae32 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 201862000 + + + d993e8aa9d3a776255a8ffafc53a9fcc + n + 12/1 + 103000/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 8260fc59d1b3eb80dc8ff2a88856e4d5 + n + -12/1 + -1195000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + aa9e227079076b70a233408688c8d1f8 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 249386000 + + + 790eb44b7273c4b9631843cbd0a311f2 + n + 24/1 + 195300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 9a146bec706e7171419b139cdfa92af8 + n + -24/1 + -2433000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + 7511f02356105aa42f378e0f5edc3f33 + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 300351000 + + + 5da0d6bf03058755af8118e6c7d9de17 + n + 25/1 + 195500/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 68fb98ef0b084dd328bad9cdacdbf642 + n + -25/1 + -2452000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + 6b23e55ae225e7f230fd0a4b2d7427c4 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 410525000 + + + 259dfe4f85dea0b3c96eba22c3a2be38 + n + 74/1 + 581700/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + fa277d5b6e9b670c5540b68b5f0cc823 + n + -74/1 + -7393000/100000 + 5f4d3dd84f8df6527d5091152aadb4d6 + + + + + + 33faf9899a4a6e2d990a42704892ab98 + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 434149000 + + + 39a73d933f6b16e1e020c87ac145aac9 + n + 45/1 + 346100/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + a86ddbe40653a54b736f043f424fd23c + n + -45/1 + -4524000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + 9dc9fe98441ca61e817531cf55331b55 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 488179000 + + + e363d8bd89db035e1d7e4364cb743e22 + n + 22/1 + 164000/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 9acbdd9b8d6da136b275afc24dbcf661 + n + -22/1 + -2216000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + a1d9094171881e9ff1d6f954dee11b45 + + 1994-02-04 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 554177000 + + + 9c931116b323d2edd8c468e061e92673 + n + 89/1 + 669900/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + c364fa516c863144a7896e6bf38b93d9 + n + -89/1 + -8916000/100000 + 5f4d3dd84f8df6527d5091152aadb4d6 + + + + + + 0ef4b9dc4ef40a158be6218fba7e07bd + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 572522000 + + + 0aa1cab5bd473e8aa0de96fd23954310 + n + 23/1 + 190300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + e39ef0ace88c5d762b18811372c51ddd + n + -23/1 + -2266000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + 60ef810e4fc8e6c68f5184acfee489be + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 671287000 + + + 2e9bd8a660525096a4a89bff20283956 + n + 22/1 + 216600/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 3964627fc6d4ee837111b90317dcdba7 + n + -22/1 + -2183000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + c7b88f05485f6491eee28e15af2de163 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 733134000 + + + 2f11ce5bbb83e4314595fad43e84f391 + n + 16/1 + 166900/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + fa962b6cf19cb252de960bc2e8cb8b8e + n + -16/1 + -1606000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + c31086d0195a6c14231a9a4e7f4beaa6 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 775582000 + + + 54ef9845da30c3e67469c79b116fd23e + n + 16/1 + 156700/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + dda0f5ee0c544c70f897c21870109f36 + n + -16/1 + -1581000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + 967f9ac08912e8cd882811394ae9cd5a + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 861245000 + + + b8acd0dde533d8ae0bf28259ce5b244b + n + 21/1 + 222400/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 677ea41cdd9236df34c27a8362b8c393 + n + -21/1 + -2111000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + c9a2c3862a3c2f6db81480552e43396c + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 908364000 + + + 81fa7e919ca3627f8731fff26a2bbe95 + n + 23/1 + 240500/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 462625978077b6148074c3d2db8978c9 + n + -23/1 + -2328000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/ms-money.gml b/src/backend/file/test/test-files/xml1/ms-money.gml new file mode 100644 index 0000000000..413329076b --- /dev/null +++ b/src/backend/file/test/test-files/xml1/ms-money.gml @@ -0,0 +1,10085 @@ + + + 1 + + + + Cathy Bank + 7be24f20929f644872ca1718cdd80bee + BANK + + ISO4217 + USD + + + + + + New Bank + ab52d1a8fbd5883a788d51bd29c77e84 + BANK + + ISO4217 + USD + + + + + + School Credit + 6cdb61279507abc41065ae0cfc49e314 + BANK + + ISO4217 + USD + + + + + + Dividend + 4ac81d62b599798f057b2dd83a5d89fb + INCOME + + ISO4217 + USD + + + + + + Other Income + fd1d2d2d58ceefc149f572a1e6936cec + INCOME + + ISO4217 + USD + + + + + + Credit balance + 65adcfc02d0f936916bb49b994895c89 + INCOME + + ISO4217 + USD + + + fd1d2d2d58ceefc149f572a1e6936cec + + + + + + Refund + c1c71598e096d9ab5565f096db36ed59 + INCOME + + ISO4217 + USD + + + + + + Reimbursement + 60a59d2467d55241a1f13d5c0c43fa1b + INCOME + + ISO4217 + USD + + + + + + Camcorder + 56c1924305fc9b5667ff93ed389f571a + INCOME + + ISO4217 + USD + + + 60a59d2467d55241a1f13d5c0c43fa1b + + + + + + Tax Refund + 15a7de112614d62d993dfcc43ff70142 + INCOME + + ISO4217 + USD + + + + + + Unspecified + 9defb6c42135fa2f4036762c8926c8ca + INCOME + + ISO4217 + USD + + + + + + WS + 4da6e3f697287c126a6827efd63a0b43 + INCOME + + ISO4217 + USD + + + + + + A + 74446cb1e9d9fb729f0d002aea325430 + EXPENSE + + ISO4217 + USD + + + + + + Insurance + 73f01092a778ac5f25d1f95c1f34a6eb + EXPENSE + + ISO4217 + USD + + + 74446cb1e9d9fb729f0d002aea325430 + + + + + + M + 2dba4680e7c14b4f1b3f60cc75959daa + EXPENSE + + ISO4217 + USD + + + 74446cb1e9d9fb729f0d002aea325430 + + + + + + Membership + f5b32f79be8cc4952e6e2ddd4077b0fa + EXPENSE + + ISO4217 + USD + + + 74446cb1e9d9fb729f0d002aea325430 + + + + + + T + ee3d0e82c9b191091e61d4d1bc8da9f3 + EXPENSE + + ISO4217 + USD + + + 74446cb1e9d9fb729f0d002aea325430 + + + + + + W + 3451d55fd6957c001991ac7b98402b04 + EXPENSE + + ISO4217 + USD + + + 74446cb1e9d9fb729f0d002aea325430 + + + + + + Bank Charges + 94f1725a16858da2a9832cec4d7c78fa + EXPENSE + + ISO4217 + USD + + + + + + Bills + b978ff4097c571ecbbd134bd50cb439f + EXPENSE + + ISO4217 + USD + + + + + + Electricity + 92b05cc5070282b02b05e60f161a5882 + EXPENSE + + ISO4217 + USD + + + b978ff4097c571ecbbd134bd50cb439f + + + + + + Natural Gas + 51feb1a2384a8b12a1738d5561c9ea7a + EXPENSE + + ISO4217 + USD + + + b978ff4097c571ecbbd134bd50cb439f + + + + + + Rent + 329b2c5196efdaf54e1321e05b9f0875 + EXPENSE + + ISO4217 + USD + + + b978ff4097c571ecbbd134bd50cb439f + + + + + + Telephone + 8d9a8e4928257f0b0aaee042057d8012 + EXPENSE + + ISO4217 + USD + + + b978ff4097c571ecbbd134bd50cb439f + + + + + + Clothing + baaf4f690ee338fe4b0cf67dd6c2bf8a + EXPENSE + Clothing + + ISO4217 + USD + + + + + + Credit Card + 5fc1c6a2a79889318f644120ac82c8ee + EXPENSE + + ISO4217 + USD + + + + + + Education + f981711ab9d0c5ca6b75d0b5a8ee261b + EXPENSE + Education + + ISO4217 + USD + + + + + + Food + 073d73615847b401ef859cc852509ab7 + EXPENSE + + ISO4217 + USD + + + + + + Groceries + 594ee4adb251ad1515794a77837ae15c + EXPENSE + + ISO4217 + USD + + + 073d73615847b401ef859cc852509ab7 + + + + + + Healthcare + 60845136829c50ec4a09675a08c2da24 + EXPENSE + + ISO4217 + USD + + + + + + Insurance + 2f38dff5dceaa7e0ee4d645a19215103 + EXPENSE + + ISO4217 + USD + + + + + + A + cc640e911a739a6f58675333704ce9de + EXPENSE + + ISO4217 + USD + + + 2f38dff5dceaa7e0ee4d645a19215103 + + + + + + Leisure + 246d4bbc03fd4ebfc817afda54011ebc + EXPENSE + + ISO4217 + USD + + + + + + Photo + 9963d86a4c411a32c1991a9b91f634fd + EXPENSE + + ISO4217 + USD + + + 246d4bbc03fd4ebfc817afda54011ebc + + + + + + Misc + e9b94c2baee4d4f9489a856f4a8a06e0 + EXPENSE + Miscellaneous + + ISO4217 + USD + + + + + + Miscellaneous + 96d92c6744c5df991da54c700630fe72 + EXPENSE + + ISO4217 + USD + + + + + + Student account + a4267ec85727c7c75d9ddea58f2fd26e + EXPENSE + + ISO4217 + USD + + + 96d92c6744c5df991da54c700630fe72 + + + + + + TD + c791e88d9c25ef9cbdab5d4b9f51fde9 + EXPENSE + + ISO4217 + USD + + + + + + Retained Earnings + c4eb84e774bfe977982edc87793e44cf + EQUITY + + ISO4217 + USD + + + + + + 58a96777671bde4e1352e2b061edd814 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 179866000 + + + c07554061a7c1edc94b6d817ce95cf70 + n + -200000/100 + -200000/100 + 7be24f20929f644872ca1718cdd80bee + + + 148a4765dc4436ee5c1eaafd6d3c9139 + n + 200000/100 + 200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 44c29ce13894bb26ff6f0d3bc4f0375e + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 378164000 + + + 6d17fc63b9326c16e61db10e85509d6c + n + -400000/100 + -400000/100 + 7be24f20929f644872ca1718cdd80bee + + + dfcc23eee0f32911ae005b90538c379c + n + 400000/100 + 400000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bead2eb49dcc8ee8167d0e524de98b30 + + 1997-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 502983000 + + + 1977cbb7a2d16a694a8f1fe78761f17c + n + -150000/100 + -150000/100 + 7be24f20929f644872ca1718cdd80bee + + + 284a6d6f1c251e7abede285836c8789e + n + 150000/100 + 150000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b8c1dbc879e5bc8a14afc2fbc82af2a4 + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 558557000 + + Opening Balance + + ec448413f05dfb65c088e8789a20ac97 + n + -470657/100 + -470657/100 + c4eb84e774bfe977982edc87793e44cf + + + ea16b703a9ce91510924473dd0f0048f + y + 470657/100 + 470657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3cc45b7b981a2bd05bfc51822adb09bc + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 560035000 + + Boss1 + + dac5b60425b0978a9b7416f91c7cb1a6 + n + -100481/100 + -100481/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 719c7d0d65e5025d825c8aa400dba02f + n + 100481/100 + 100481/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + db2d8a1b112173618809ebdae946d23b + 106 + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 562204000 + + Landlord + + 3f8fc3f8bdbc5c7fa5c5e963494d4f71 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 71d905dbaedb78e9059bfdbafc5ea340 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 244ca826ec18de09a4b2105b9bda9b16 + 107 + + 1995-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 563780000 + + Insurance + + a4cae54129c6b39885d89220f7756498 + n + 53960/100 + 53960/100 + cc640e911a739a6f58675333704ce9de + + + 089831a2e80c59c44b13c06282843c66 + n + -53960/100 + -53960/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 99975bb56e4e9a36fd83d72519664897 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 566323000 + + School + + 7cbab3a5591c284001411fed936303e4 + n + -126788/100 + -126788/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 8ef8c5f78462b8485c4e172f23701acf + n + 126788/100 + 126788/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e1d961019b80933e892b77610a35749e + 108 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 567822000 + + Pacific Bell + + 8569dd0591d5da86d3b593136c0353ff + n + 5683/100 + 5683/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 98b820e98a4af4e8fb843c5f40dce0c0 + n + -5683/100 + -5683/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ab4c64adb83c07941bd80813e4f1e7bf + 109 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 569328000 + + W Bank + + 3401b82fd2a508916d991e64596a7fe2 + n + 75127/100 + 75127/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4f42b001d243c12f11259450ceaa3a73 + n + -75127/100 + -75127/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d71beebfa9c719845519f6926da5dbf8 + + 1995-12-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 570809000 + + Boss1 + + 0b6af5c8050e7d4361ae105a648dd27e + n + -60000/100 + -60000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 4f3fe6ac31c84792091900dec0e1e451 + n + 60000/100 + 60000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 67111f21a8a48dfe515d60fb2f958689 + 110 + + 1995-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 572524000 + + F Visa + + e9215e7cc45b4882850acd71073efede + n + 500000/100 + 500000/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ed864071ab0d34239b4b3ca75ae1aaa3 + n + -500000/100 + -500000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 94a3ca9fe21b81cc55d445f9b9161232 + + 1995-12-20 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 574826000 + + C Master Card + + 9623f2d3b69e4e26d2ad1d5ca4b7119b + n + -106594/100 + -106594/100 + 65adcfc02d0f936916bb49b994895c89 + + + 12aae15e9edd0e18cfe1aa13c21ef6c4 + n + 106594/100 + 106594/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2c99b41f07fa877b188eb2405edc67a0 + + 1995-12-22 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 576494000 + + Cash + + 37a67df948b79054d620b2f629cc5f05 + n + 8000/100 + 8000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 37aa6d6b304d566ad3f90d5d35761e96 + n + -8000/100 + -8000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7a3b3c10be8a7f2ec56e2bdbcca5a451 + 111 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 578040000 + + B's Supermarket + + 35cc0b70617e750b45f1cf72cfd68fa8 + n + 989/100 + 989/100 + 073d73615847b401ef859cc852509ab7 + + + 0ecef524de9db3a4356813b129083302 + n + -989/100 + -989/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3407d28b579ff5ed0d6973bb4b14d49c + 112 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 579581000 + + Court + + 539442ca9b8b3dbfcacde2703a76fedc + n + 8600/100 + 8600/100 + 96d92c6744c5df991da54c700630fe72 + + + c6effc172d1ad69b0e34cb40e13d34af + n + -8600/100 + -8600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + caeac9580d30089b57d7b4e323776ede + 113 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 581273000 + + AAA + + f366762dd8bf22924a1bca5967d6e5f7 + n + 3900/100 + 3900/100 + 2dba4680e7c14b4f1b3f60cc75959daa + + + 85e313f24bd248efa3fec4eb5097a7f8 + n + -3900/100 + -3900/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 549349e9bdb7d97ffe02e06e0c9663b1 + 114 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 582830000 + + BN + + e3a691da9f6fc9ce68a4eac524b33c4c + n + 5255/100 + 5255/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ea7697a7a73532226068f1381df61f01 + n + -5255/100 + -5255/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + abaf65bf081874a1f6f6da0633236e70 + 115 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 589237000 + + Gas Co. + + a6468cb57d10b1a59e21e2c3b6d911bb + n + 7804/100 + 7804/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 2d8df6b69f568015a2754d7e76b6be27 + n + -7804/100 + -7804/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b2efc388db5d717d1b8e16a71b0d0885 + + 1996-01-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 590867000 + + Boss1 + + 5247fdb13f75f322248d417687a47382 + n + -105865/100 + -105865/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 28cb5517d262144cbbba93f60e5f81c6 + n + 105865/100 + 105865/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2ab373c3a045ae77a512db19c0a7b8f9 + 116 + + 1996-01-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 592447000 + + Landlord + + 7ccf4302c96ca0335797daefd11473e0 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + e1ed8d92ddf4f05899ee01c3f5d86259 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7f4a113bbed1dce6cf81093b767ee96b + + 1996-01-05 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 605634000 + + Cash + + 05c78a8ca732b1094c9183e8ba0d10a6 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3e6c21678984d47fa74aca76f8fdfd84 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3056e7713976f6fe884f5d9e5e8f5d9e + + 1996-01-06 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 607373000 + + Boss1 + + 6868fd553b621906ab8cc5f397245572 + n + -60000/100 + -60000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + fd3fa34b6eecc6de89efc38e0a4495bb + n + 60000/100 + 60000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bfffa71d4e39ad348dc9f1c3ecad3d37 + + 1996-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 608948000 + + School + + ab53a179e4761a3da85b0ebcaaf0fb0f + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + e778314a94c5d337c5590171d40084fd + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 75d80bf1e40a45c99fcfb292808b394c + 117 + + 1996-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 610540000 + + MCL + + 7ac9ccd3e020ae6d131cc216f392b5f9 + n + 820/100 + 820/100 + 9963d86a4c411a32c1991a9b91f634fd + + + 06abd9fda7bcf819373824364e11c178 + n + -820/100 + -820/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d4bf7454a1b95390d602c341c8512628 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 612161000 + + Cash + + 492925603c3d92cdb2f07634b54b6559 + From other checking account + n + -50000/100 + -50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b30c7965d706ef8f23449148eb8b48e4 + From other checking account + n + 50000/100 + 50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 60811ab05afd68fc802a5aabb7592c9b + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 613763000 + + Cash + + 65f0b22915539e3be24ace80f8f7d64c + n + 6000/100 + 6000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ac35d24d9c477d0e2d8d16b64415dc13 + n + -6000/100 + -6000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 54c96dd1ecffd6aefdd9abd7d01f30c1 + 118 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 672151000 + + C Master Card + + ccb6dd4150f646532018d8dee5f74409 + n + 4456/100 + 4456/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 02408a8449606c933076b268c7f5255d + n + -4456/100 + -4456/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8d64b6b645c7740d9e9ecf7271891113 + 119 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 676861000 + + DC + + fdd639f370f1851f8bcd04c00449da05 + n + 3136/100 + 3136/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cf55b893eadd13fec8d00476b812fd26 + n + -3136/100 + -3136/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + db594347f6ff07453eb56b632260a487 + 120 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 679339000 + + Pacific Bell + + f17a2a776a1e9fb561aeed40a89e5063 + n + 9531/100 + 9531/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + b5065984e976359a4cb9765fdf803524 + n + -9531/100 + -9531/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6b998a4355c2933178ebe4e794f98f2c + 121 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 681885000 + + W Bank + + 6e52872aa1cd2164f29f1473e4f2a90d + n + 116284/100 + 116284/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d34989dc920e958ae769e25d8c4b3afa + n + -116284/100 + -116284/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2aa51eaed9428ed5c5760044332404ad + 122 + + 1996-01-26 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 685851000 + + XM + + 1df24366bff95c8fb827b66f83f15629 + n + 50000/100 + 50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 49e8406d3a2c4c18bcbfc8576d258ac6 + n + -50000/100 + -50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d9bdc634f2e839293ca0ec36497c5c96 + + 1996-01-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 688510000 + + Cash + + a0a7931d97e083b819fc793603ebd046 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2152b83a635f8d1049abd97cc4661d73 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b9d764fbf1561d9f568b90499ff733e0 + 123 + + 1996-01-28 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 690988000 + + Gas Co. + + d3a590c8d832a2528052ba68728d4409 + n + 5595/100 + 5595/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + d25f730f03836ee98a0894247096916c + n + -5595/100 + -5595/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1daeda076e9bdb08a0f6225ab740386a + + 1996-01-30 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 693430000 + + Cash + + dc9d7304132c73485cef6e604a46eade + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 549844caa87a91e21f3570094da82545 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9fa2f4939318542dc80f9c193f26f11d + 126 + + 1996-02-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 706467000 + + Landlord + + 4dd1e6594a457a998546c1eca0075947 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 397dac23518a951b1d8d0b9df56a5d8b + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 78702548cf71f48df96ca96b63d09c6b + 124 + + 1996-02-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 708997000 + + DBC + + 1b327f0f69dc129138e64f9ffb76b6b0 + n + 2489/100 + 2489/100 + b978ff4097c571ecbbd134bd50cb439f + + + ce122195b8bec42be441235376f35343 + n + -2489/100 + -2489/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5e8852f054682c04ddd2f3ce9591228f + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 711596000 + + Power Co. + + 86cb41a71a331f3267b66d82cb6971c7 + n + 4653/100 + 4653/100 + 92b05cc5070282b02b05e60f161a5882 + + + b4ceebd97b0f59b69cd65ca8a40d3a7e + n + -4653/100 + -4653/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6b776d96ed513397184884ad217c2e4c + 125 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 716622000 + + LJ + + c7948a74ef81097fd55d1d33ea6d8cc4 + n + 50000/100 + 50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 84dacdebdaa573ed0e13b602510b2bd3 + n + -50000/100 + -50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 57785edfda3409a5c00ade8d2afab7b9 + 127 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 719201000 + + M&W Trading Co. + + ae2b2af2930619c63ceff5bbe6dc2b22 + n + 1260/100 + 1260/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a26e83ac119b14054125ca63f2b9dc0f + n + -1260/100 + -1260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bf439735c7c5fbace46adccaa7bb1556 + 128 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 721697000 + + Pacific Bell + + 6c37d787c5fec032850f7b76e660d024 + n + 5061/100 + 5061/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e258cc87d11c4ede4c24215fbd483553 + n + -5061/100 + -5061/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + dde0ca3bac54a0199431885482728853 + 129 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 724509000 + + AG + + 21397778edff585c46eb55c3105a7048 + n + 700/100 + 700/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 01e726710062d231d368a2262c24d98c + n + -700/100 + -700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2a602d23a4a088a1726b9d41e3dadf8a + + 1996-02-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 727025000 + + School + + 6c3a843cf0f33be8a8b7c83e42a64539 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 37abf8fadca616a7b917fc434638850f + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b49cba5b11efbbf288cce03f3905626d + + 1996-02-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 729511000 + + Cash + + c407d918f1d2991747608e4b72c5e504 + n + 20000/100 + 20000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 8de680a54346802842f0a87893a8c6d1 + n + -20000/100 + -20000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ed218e5cc6fc8d470d77099ded6e1975 + 130 + + 1996-02-10 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 732145000 + + B's Supermarket + + bb1e8e9e6d1be2e30ec2187bedf33fe9 + n + 240/100 + 240/100 + 073d73615847b401ef859cc852509ab7 + + + 2070d66284abdcd2caa68064b2db992c + n + -240/100 + -240/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fe7841cdbed4903f3383add83e9d9c97 + 131 + + 1996-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 739185000 + + C Master Card + + d27a0fe0778a2f4ecabdc6bc9b189d74 + n + 9870/100 + 9870/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ca787367ffb37d3b9ddc193f27aa1d20 + n + -9870/100 + -9870/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 19a6c39b69502b286bbc4072a8d84705 + 132 + + 1996-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 741786000 + + W Visa Gold + + e32ab4146ce6378f580091d93053ff29 + n + 36578/100 + 36578/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 190391bd8eb9e3bbb416fc462aab7643 + n + -36578/100 + -36578/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e6b4e63a082ab9ae9fa22814c7e184ba + 133 + + 1996-02-14 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 751336000 + + AUC + + d41f72605a62213595349c09b4ecc683 + n + 3688/100 + 3688/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 1df94974a71f9bed7f55031516a52c0b + n + -3688/100 + -3688/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1e0a2c8ea727a3d17f85f7cc2767d281 + + 1996-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 753902000 + + C Master Card + + aa364783b9e1149ed57d55aa17b529db + n + -10082/100 + -10082/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4af055bcc8b5569dae99b5247a7381f2 + n + 10082/100 + 10082/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bdda9615c58122c178ff14d81334f906 + + 1996-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 757483000 + + Cash + + e79a6dd5960d2fb2f3cfc3170f3e6dc1 + n + 6000/100 + 6000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b108bcc660d88b68ce2b1a09655c7a2b + n + -6000/100 + -6000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + eb2b9ed876e548a90eb136e827f7afe0 + 134 + + 1996-02-21 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 760209000 + + HCA + + 2cef78e55e46bb88f7cad8f6400d43d6 + n + 398/100 + 398/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + 585325d313a9b4e7f3a4591580f546be + n + -398/100 + -398/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 98f94bb488eaf523d5e590cf36e9f957 + + 1996-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 762701000 + + Power Co. + + ec9932d96902a2fabbcf0b350dbdf8c9 + n + 2314/100 + 2314/100 + 92b05cc5070282b02b05e60f161a5882 + + + 578df5930c873a0319aa0962d9b5f56b + n + -2314/100 + -2314/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ef13af2b4e9060c9ff83074269e92107 + 135 + + 1996-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 766747000 + + Landlord + + b3daa6c86e5a97939ee74b6df651ec1f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 304a8b49fdc225dc1562ee8e3b520fda + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7f6185a9eb09755ce79cac760ee23d15 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 769283000 + + School + + 7f64c12262e14cc91306e9cf4a0ce85b + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 0236bf1cf3f764ec4de91c9f9c14bf72 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a2c873bf6860feee0d4a11310d493cfd + 136 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 772624000 + + Toy's R Us Visa Gold + + 76b739526f0af702e15aab08b7031aae + n + 23619/100 + 23619/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3334c4dff65918f00eda9484584f25c8 + n + -23619/100 + -23619/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b34f6c21cf40858daf1efcf625a1736d + 137 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 778152000 + + Gas Co. + + d036fa6b252de3c37cd0c5e78e434b08 + n + 1875/100 + 1875/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 1be446d8f78a8cbeb05166d87ad29d79 + n + -1875/100 + -1875/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d7360a4388b5b172f35cd52c74d4b86c + 138 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 780710000 + + DC + + 47468f681f6e30780d3f7ff00890134c + n + 5379/100 + 5379/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 90cb945a0bdcb2a314a3914e3507132d + n + -5379/100 + -5379/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bcaa3dbb06f0a64ada1c6f1e9e8ef7eb + 139 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 783566000 + + Pacific Bell + + e76878541bace7354bd3dc53c1210533 + n + 4951/100 + 4951/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + fb0b00a49362f777a1fc31a018e7b6af + n + -4951/100 + -4951/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bfc6994411f0b8bfc89677ba6a566aec + 140 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 786394000 + + W Visa Gold + + 1315024aa3e3694d409df78de02ecd2d + n + 30023/100 + 30023/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d9b75fdbdb9cdc9e3c289d772459b536 + n + -30023/100 + -30023/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 83f91ff38502afbf0fff000963ddf483 + 141 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 788979000 + + C Master Card + + c7aac2cdfdb241e9ef621f86ede9a3a2 + n + 27896/100 + 27896/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 093b4285f3e03b5bcf79c3f31a88c8f9 + n + -27896/100 + -27896/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6d9288c9fb8412a47f8cf5d0fc17ed42 + + 1996-03-12 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 791570000 + + C + + b11411b07c8d8348b0f7ba0b1d5d3681 + n + -28545/100 + -28545/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a61d9f5d05c10724be47961fcc95c5da + n + 28545/100 + 28545/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2aff96c3547da2f9d3a1b7dd04904976 + + 1996-03-24 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 803249000 + + Cash + + 923b79b699acd4fd9ef665241aa2f1b0 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7a4419456383a6e3c915be3600f558ec + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7117c608e41ec940f2f0c30c465bac4e + 142 + + 1996-03-24 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 807419000 + + B's Supermarket + + 88ba254874ffb71137658942382db4ae + n + 1010/100 + 1010/100 + 594ee4adb251ad1515794a77837ae15c + + + c7d830fb108ab4709ea0a788f9799dbc + n + -1010/100 + -1010/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e860a6dfb8e2e670a5daae8c6384dcd5 + + 1996-03-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 809992000 + + BB + + 33f85e5c07cd13d0f8d3c807667d9557 + n + -15431/100 + -15431/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + 7b972087d1bf6cf3db8f873c2dd7f19b + n + 15431/100 + 15431/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4bda1ee838f7070e1a7d3275ef9ed04c + 143 + + 1996-03-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 812589000 + + NB + + 66ad7a8d85e0f90e29031230cf70de42 + n + 2272/100 + 2272/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 21d73ed6de6c1df88b6560313e9b13ec + n + -2272/100 + -2272/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f2f278ff86ec09ca53aeb879ac872846 + 144 + + 1996-04-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 833270000 + + Landlord + + 32d91d513b05763a35de6626b64b6c16 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fcda4428c8c30d4f44b121161cd22b0c + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b56d909b0b776081aa1de20d52a56aee + + 1996-04-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 837125000 + + Power Co. + + c534110ce97bc51f53b8fde02c17af5d + n + 1928/100 + 1928/100 + 92b05cc5070282b02b05e60f161a5882 + + + 7f085f565301c91fa026ee7aa7373882 + n + -1928/100 + -1928/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4a409cb8e8e9f96bb3d480072859859f + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 839712000 + + BB + + 6ea713a372d27e141678cc6923acd3f6 + n + -57787/100 + -57787/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + c6f07b4dfebc14d074b64f21e4509cb9 + n + 57787/100 + 57787/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a42700d3aea95224e01232174ff2f6b2 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 842309000 + + School + + 29609c8f7262b2ec82b892c56747fc95 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 106bd290a0729783792d3704f6eae14d + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6c9e9e7958c80622a126c15836b2d2bc + 145 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 852045000 + + Gas Co. + + d793b5234572d417c4dd9d2045eef843 + n + 2309/100 + 2309/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 77a1683fbcf6d0ddbba3189de75e95f1 + n + -2309/100 + -2309/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0c33ef952eac12b4106338d89c7ae729 + 146 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 858871000 + + Pacific Bell + + db37f78a632f49284da3d7e2d57f1b0e + n + 2274/100 + 2274/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e6e7d6c51d248213d4004b0d76c4e664 + n + -2274/100 + -2274/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 62fb43b96ef8645b25f55c6c85705d61 + 147 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 861689000 + + C Master Card + + ca010be124fd392ccaaa9f5b1d28777f + n + 35050/100 + 35050/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + a0066d3bcbc67befc0046c5f16cf0c06 + n + -35050/100 + -35050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6417235a5ee5027f81fdf925748fbbe0 + 148 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 865127000 + + Toy's R Us Visa Gold + + 004187e432a13486e9cfe870ab3a3f87 + n + 2202/100 + 2202/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2f0534d386179fc36803f3e9d66237f6 + n + -2202/100 + -2202/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + cb86fdd6e3a719fd5de1e1de80df1141 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 867802000 + + Power Co. + + 00d15203e00a76278c3aed0968980af2 + n + 1978/100 + 1978/100 + 92b05cc5070282b02b05e60f161a5882 + + + 53c08091348eb6b879304a4da80af21c + n + -1978/100 + -1978/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7edcc3ab2e840fec5d43c4a5e5a6153a + 149 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 870503000 + + Landlord + + c529b65eeb2b47cef6e427eb52525907 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 05aa13c120f2dff181f3888cc28c8a72 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 01694a4486d7288bd1fd108bd5f7402d + 150 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 875485000 + + BN + + fabddef084bdad2deeef1fb59be67afc + n + 60849/100 + 60849/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d8e28f186c207d5f0ccd045278207068 + n + -60849/100 + -60849/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1fb645f141a78d755eb7ea64be25e50d + 151 + + 1996-05-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 878330000 + + LDPC Co. + + 9e755346e77a9cc0239f0010d300daa4 + n + 4170/100 + 4170/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 48c3521f7449d649a7966f8c972f8997 + n + -4170/100 + -4170/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 71788c4eddac3e4442d1ad4e777ccd86 + 152 + + 1996-05-09 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 881011000 + + PC + + f785d9a95b1a939a59d89ac76135f4b9 + n + 2938/100 + 2938/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7aaf39ac5f9bef89522b2f478fbda6ce + n + -2938/100 + -2938/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ef93759a27d5b6af6247e6d9177338f7 + + 1996-05-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 883666000 + + School + + 936168d4d9e522575a9bfe701bfb727e + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a23c6fbaf8a3f7624ec90f30eeda2259 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6fe1093d00f20d8dfc67661e1ca91e3f + + 1996-05-17 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 887889000 + + Gas Co. + + 9064122d45f5b2474e68b376cff85b38 + n + -1700/100 + -1700/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 8fb78068233b66703dac90caa5c834ab + n + 1700/100 + 1700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 44afec66dd4285798fb5f4e307c9461a + 153 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 890537000 + + DW + + e5247fe9747d6098d79d43d7ae1cdfcd + n + 26500/100 + 26500/100 + 74446cb1e9d9fb729f0d002aea325430 + + + f6cdda65e7ded8a3c26c2e990d185aed + n + -26500/100 + -26500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 880a44337b802d9d58524bffaadfeadd + 154 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 893182000 + + Pacific Bell + + 757ae25a35465c5f922a8feb6b8faac0 + n + 5607/100 + 5607/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 32bf0a3f2f8394220798f36e7513d20f + n + -5607/100 + -5607/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d07ff7d8db380979b383c4efdc1d14a0 + 155 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 905451000 + + NB + + 246be7ff1fc347929027e715de655b4b + n + 77404/100 + 77404/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 08542b5d96a138857361bbd6d73452d7 + n + -77404/100 + -77404/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 791764c9b88f493bcb2ab2677721f1e6 + 156 + + 1996-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 908184000 + + PC + + 5929a1102e15c8457170ca417ffbc20c + n + 1299/100 + 1299/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 69415a5377ea272e5571f7403e14b0fe + n + -1299/100 + -1299/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5361e7a38a600143d2efa7381d90e886 + + 1996-05-28 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 910861000 + + Boss1 + + 127a75e510df126d3a20c47a020152d1 + n + -58280/100 + -58280/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 6db74d2a8dd3d3d2ecb3ae77a18e0139 + n + 58280/100 + 58280/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5685bb01c49df0e26df521b56c0a923d + 157 + + 1996-05-31 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 913672000 + + Dr. Lin + + b3a5898f708891b07b703e8683123fc1 + n + 1000/100 + 1000/100 + 60845136829c50ec4a09675a08c2da24 + + + 577064b50b647f947233fc7a6f7ce69c + n + -1000/100 + -1000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8150fe1d52e594e42d5f62ba3698296e + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 919411000 + + Boss1 + + c880f2c370ded6fbf6b8d74f78dbf96f + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 15c01c2812df2b9b8846a4a7c54c558b + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 93eeb5c9b17b7b0290aacd884736da4d + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 922316000 + + Cash + + d8a81670d60b3bd149482a2b40ec51c1 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c21835fa5eaa414edf098754497a90ef + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 51d6c9b07b71b5f2394efee66ac03663 + 158 + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 926588000 + + Landlord + + de6d5dca32aade8598ed2395d93fdd41 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 9fdb2b3988d377bb6389e1959eb4350e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 31ef83d148b3db98c78f8d5ea4590921 + 159 + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 929352000 + + BN + + d7f1ee11be88ddb198c769edb972c128 + n + 5839/100 + 5839/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 26da9682adf31df8edfe0c8d0a676dd2 + n + -5839/100 + -5839/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + cf125b99804bedffef347ca3faae3268 + 160 + + 1996-06-06 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 932110000 + + LDPC Co. + + ca57c095e73c100f0f1b11b2a01b89fe + n + 4272/100 + 4272/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 342c456e67f09ff660d9e7114544c972 + n + -4272/100 + -4272/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9e69a56937827ee86a5d61b6a4b8e8f9 + 161 + + 1996-06-06 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 936779000 + + Pacific Bell + + 3155ac938b0c530fc5d4fd3fec88d447 + n + 4825/100 + 4825/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 693e36469e3650a2c9d8c8da0a1217f7 + n + -4825/100 + -4825/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b5f4a8fa3fbd8d8d7be989fb1dcbaeb6 + 162 + + 1996-06-07 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 939543000 + + Insurance Co. + + 5fe23541ee174671004bdd551d978253 + n + 53700/100 + 53700/100 + cc640e911a739a6f58675333704ce9de + + + 68e6e01217e4b2d4a4ebf586385d084a + n + -53700/100 + -53700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e3eca2d3e24c3699985d8a5333688c36 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 942243000 + + School + + 76c63e3507cd0cd261b7803892960177 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 767a2cfaa7b5460434172107b6d1fbc6 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 827f465fce33844e27701408a712e95a + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 965302000 + + Power Co. + + cc0b3b8522b718bfcd14972c3ed6007d + n + 2536/100 + 2536/100 + 92b05cc5070282b02b05e60f161a5882 + + + 4f60a895cdcf6d9fad2025e417d5c27d + n + -2536/100 + -2536/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bdadf3d9d218123fde4fc222e201060f + 163 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 968340000 + + W Visa Gold + + b4d2875407a1d23b91cdc4dc8ea83b73 + n + 53380/100 + 53380/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2cbb626807d92add1ffe432d08facfc6 + n + -53380/100 + -53380/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ff335d7748589f987f5264581d698ee4 + 164 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 971146000 + + DC + + 26bd650eb79addb479acf50e21edf749 + n + 2565/100 + 2565/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4452db63db9e9d297f4f419b1960776d + n + -2565/100 + -2565/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c4ae7ccd12d1161d4dbdea8dde7ea8e7 + 165 + + 1996-06-11 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 975957000 + + C Master Card + + ff3fca29ab0dfa859bee8a2ff6fae23a + n + 7116/100 + 7116/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d032f4fec5ac9f44bfcb8452cc0addfd + n + -7116/100 + -7116/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8b6f44c8914998ca440d9e7098c1e787 + 166 + + 1996-06-13 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 979005000 + + NB + + 01e0503bf0a33cfd11644d7d3d4857ca + n + 168224/100 + 168224/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6c5ecb934ed6229fdbc18ad234667dcc + n + -168224/100 + -168224/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 13cbb2faf0a5e634c3303a0b6e5f5228 + + 1996-06-28 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 982656000 + + Cash + + 6c1b8da73502218cc794acc0fa24bcb6 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6263191d1db47c49786f295322b1db4d + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b53505bdc19ec5f0c0abb67c54a243f9 + 167 + + 1996-07-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 987122000 + + Landlord + + ac8b874b440604a0afe97cff80743e47 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 072e2abcec072f2bafe0369a29077c62 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c80ab1d0b5b85ecb6875bd22807adb28 + + 1996-07-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 989865000 + + Power Co. + + 80e23b07aae7dcb2a517ea8e7db8fee9 + n + 1222/100 + 1222/100 + 92b05cc5070282b02b05e60f161a5882 + + + ad8f72d860006be316b5813b769a94cd + n + -1222/100 + -1222/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 65420803005c09711a139a8818567f12 + 168 + + 1996-07-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 992871000 + + Toy's R Us Visa Gold + + c4bea13f45fd7f60257a97120926ea13 + n + 1000/100 + 1000/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 72aca212314006703869549932a7b19a + n + -1000/100 + -1000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7a86fafa9c7d405307d5f417213b750a + 169 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 3717000 + + NB + + 10a986e3288f5e708f7097afd7eda775 + n + 32566/100 + 32566/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2d14da9cb078c20ade5929133fa608de + n + -32566/100 + -32566/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 69f5054da696183a5bcb890dacecef37 + 170 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 8422000 + + Pacific Bell + + a34dcdac101ed7dee764105d9c6318ab + n + 4577/100 + 4577/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 8e69f5c480dd1ecc74f56f2666ac7422 + n + -4577/100 + -4577/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 78800a0181e5691c34ec3c999c931072 + 171 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 11227000 + + Time + + 470688ff141f7385f1105e3f478519fd + n + 2997/100 + 2997/100 + f981711ab9d0c5ca6b75d0b5a8ee261b + + + 87320fbcc1a2c509eeb02544cddc3f9e + n + -2997/100 + -2997/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d1002cb7e6a1897da27f743834a624ed + 173 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 14951000 + + C Master Card + + d45d4e63c88c6405ed76674728918d8a + n + 40165/100 + 40165/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7c91a4e3ce75b98774adf549df0524bd + n + -40165/100 + -40165/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9364962fb22a7dbbd8ab3331005276e4 + 174 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 17848000 + + City + + e614f2407ed31c96f91bd9143b043bee + n + 4400/100 + 4400/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 051240eac8b00202ebe9c0925caf09f5 + n + -4400/100 + -4400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 869d749275759cdad7600a6a897c56f3 + 175 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 20629000 + + City + + a83ddfda38cb4a9b27bae3072635e949 + n + 2800/100 + 2800/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 7a941aff4f549ca310c2093ffe462702 + n + -2800/100 + -2800/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f1e7806e3793cda21e7b9a46f719bb35 + + 1996-07-18 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 23418000 + + School + + aaf5c02e66ff8695af23277dd3ee897a + n + -126963/100 + -126963/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 4f7e07821154b619b518e75273fadc52 + n + 126963/100 + 126963/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f97ed5019297ed296d8add672ad47da8 + 176 + + 1996-08-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 28954000 + + Landlord + + 9d9549c48e995d79864fa5deb57a95e6 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 99c85df22c35a6f8f63e8944a8539dcc + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 255cc64d2efd39d180147273e7b0beee + + 1996-08-06 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 31779000 + + Power Co. + + 959c84ae24b87804e4ffe379d26377f7 + n + 2040/100 + 2040/100 + 92b05cc5070282b02b05e60f161a5882 + + + e7775e9f11ced47731b9bb277f025a38 + n + -2040/100 + -2040/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1e8dfa5a0e8299d0c5b9b0429032698c + 177 + + 1996-08-08 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 37056000 + + Pacific Bell + + dab5d77f99187ae3faf3a2b4220f686d + n + 4273/100 + 4273/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + ea9664178f2e60e78753780875eb7973 + n + -4273/100 + -4273/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + dfc1b034a09c8d323bed621ff045d377 + + 1996-08-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 39923000 + + School + + 2c0fa8a5bb32159749a049b35778c6cd + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 8fee2684fb6350565a4ffcc5d3b4f4b6 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 43060122cbc22c78e2b8a671c7ee52a2 + + 1996-08-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 42746000 + + Boss1 + + 12894902cf28dfc8b15e506b99db0ad2 + n + -32420/100 + -32420/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 4b642b9930da675849ef7c299b784c44 + n + 32420/100 + 32420/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2e58b252640f47edbfdd26c3ba045c77 + + 1996-08-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 55164000 + + Cash + + acf5c71ea234cf1f020506fe93da05ea + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5fe2a446f25ec5d26d6b49ad6f465022 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f943f0aaab26d0829cddb27bb47758b9 + 178 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 58303000 + + C + + 5ae27b3e479f930aac234e352bf2e5a9 + n + 20800/100 + 20800/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5c52759d0128417550c0b08c24db1544 + n + -20800/100 + -20800/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 92ac0f8f8dd1020604464f1ac24f57c7 + 179 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 61378000 + + AUC + + 847228c1cc64581774bb1a4839be0bc0 + n + 13890/100 + 13890/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7a6b9723dc881a09f58129b765a8c9f1 + n + -13890/100 + -13890/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a2d400215a07ce6e07f40b7545a7f583 + 180 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 68177000 + + NB + + 908bd17c63b4ed8147bf57f5325dd1eb + n + 45929/100 + 45929/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 724dc458cca24734980b50466234cadb + n + -45929/100 + -45929/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d58fa35ddc91a1bd7e28b534f1e43ac0 + 181 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 71140000 + + Landlord + + 9435125f1377883d24986af8e2e7987a + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 39e93873056b11f121dccd606a2c20e7 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 34dd57ade85417fa1668a0a611b69527 + 182 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 74700000 + + Toy's R Us Visa Gold + + ba23b04c1e282f84530093d4e3958334 + n + 2671/100 + 2671/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bd7bb0be8755dd8306b328b7867b58bd + n + -2671/100 + -2671/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2e0f1d5cd24037de767e811ebdc2951c + 183 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 77730000 + + City + + 305610372745dab6d5243ec054818639 + n + 2200/100 + 2200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + a79aec4f5d7df9089ec1c8150d121b9e + n + -2200/100 + -2200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ddf5dfb3c316d4fc11937e88b891a5a3 + 184 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 80595000 + + LDPC Co. + + c31b3593ab7d4d47be4b20536c0f1c1d + n + 2466/100 + 2466/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + aebc83eacc0c2206c22cd7ffd2c0b3c7 + n + -2466/100 + -2466/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4526a8a7f14363424f98559e4d87f728 + 185 + + 1996-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 83703000 + + School C. + + 63f924779b133221f5debd1d17aba5c0 + n + 2000/100 + 2000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 45f4df551c02e6f831ffef64381f1d21 + n + -2000/100 + -2000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6ea69c8af617af90ecd476f1eed961af + 186 + + 1996-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 87724000 + + Pasadena Municipal Court + + 05cae5c67e2d08998ef0f0d914d531a9 + n + 16500/100 + 16500/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2d653a413f8d6a5748526fc276f3e93e + n + -16500/100 + -16500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 70ceb2f49e70f1e63236a35e0e7a767d + + 1996-09-04 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 90616000 + + Power Co. + + 28de07198cb3e70d288ed2633dcd3f79 + n + 2527/100 + 2527/100 + 92b05cc5070282b02b05e60f161a5882 + + + dd4b32db4a502a57479113438e199078 + n + -2527/100 + -2527/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + aee715c6258a873cfdc2d1c2aea1e676 + + 1996-09-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 102595000 + + School + + 91135a80089b21d38f147cb8b25f78ea + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 30b0d3be4277a6e5204e6e981c4d00bf + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 49cf9ca6a884335e0ce5d1231c1be689 + 187 + + 1996-09-15 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 107417000 + + PC + + 3ee5c9dd00545c02a09f74cc6192afc1 + n + 7634/100 + 7634/100 + 9defb6c42135fa2f4036762c8926c8ca + + + edb74abf6230454dadb92b452274ae1f + n + -7634/100 + -7634/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9c99e5488766cd2379dc81671324346f + 188 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 110405000 + + NB + + 77a0eccf105276f1ddbc5879678cb250 + n + 46931/100 + 46931/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 302a049f33aeba040546411ffb0d67a8 + n + -46931/100 + -46931/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f0d8ed10085ef55b0197acea37d57679 + 189 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 113406000 + + C Master Card + + 4e591ff66b34c9718b981cf7d19820a5 + n + 43669/100 + 43669/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 0ecd0e9052c333570096ade6ff26c69f + n + -43669/100 + -43669/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5f089311ddc8e4913a6c5263ce497f1a + 190 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 118109000 + + Pacific Bell + + f8ef84b1165439bd5530fdc6e7b37dc2 + n + 4501/100 + 4501/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3618dea3cf080d2638eab994236d2333 + n + -4501/100 + -4501/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bff922ca0aed3f3c703e192a3e3712e3 + 191 + + 1996-09-23 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 121032000 + + School + + 7265a66d333654e3f9230ffeeb589a41 + n + 12752/100 + 12752/100 + a4267ec85727c7c75d9ddea58f2fd26e + + + b518d510590947b7dca855f9e00bcbca + n + -12752/100 + -12752/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c67b05f39b0d88876a9dff447c901239 + 192 + + 1996-09-26 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 127069000 + + Kee Wah Bakery + + 1d6a24bae489a10894924ebd507e3b9b + n + 20390/100 + 20390/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 800850d9084bbaa4bb2019421598ec93 + n + -20390/100 + -20390/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4824c739bf872359319ba608c695416a + 193 + + 1996-09-26 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 130450000 + + Kee Wah Bakery + + 2fc4610ba04f7f610bb08aa1858a5908 + n + 1960/100 + 1960/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5ed4f6374ce425584531eb0258e9df7e + n + -1960/100 + -1960/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e3f92a6d468672df3fcde0a12f497cb0 + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 133402000 + + Hu Hua + + 289e4b367c52afdbdbf504d874ea3d43 + n + -20390/100 + -20390/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + b5782d3a7f275c14720d65965105bd42 + n + 20390/100 + 20390/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8472d78118b6c166cf69fe537b743e9e + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 136960000 + + Boss1 + + 20ab1fe2d5395d7cbd20bb2e6535a639 + n + -1940/100 + -1940/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + c3a9d7a262e2e69d97fc2ba625f38294 + n + 1940/100 + 1940/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6768c49020d91663385416514abb5a29 + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 139863000 + + P.C.C. + + bfbbf149128a97330a37222423cb899f + n + -3400/100 + -3400/100 + c1c71598e096d9ab5565f096db36ed59 + + + e356c4030969d7d9f49d4fc8f400ddbb + n + 3400/100 + 3400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c090f8894aa77a52dc8e13694171945b + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 142788000 + + Cash + + 8ceba475904e6408eacc526bc8a805b2 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5fc3101e7c85e6f45ff79c3ee8e7cc57 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f24e857adf2c300ec2fc0a6bfd471b4b + 194 + + 1996-10-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 157064000 + + Landlord + + 1d2c6bea76b55b72743c7942e15748dd + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 5939456ac77860e7517eab84767d547c + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ea831858a646fbfd30ac1c26f5660a75 + + 1996-10-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 160041000 + + Boss1 + + 7dafb77d16742e8ec70bfedfadbb5ac7 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a4dad6e5b4d7b7a48ee3319a8b87a6bd + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0f46c494d2d5c28667891e8b5b3aae03 + + 1996-10-04 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 163102000 + + Power Co. + + d329627161d9ffef215338597fc875bd + n + 1669/100 + 1669/100 + 92b05cc5070282b02b05e60f161a5882 + + + 58277610dd60c0676e1c52da642cb179 + n + -1669/100 + -1669/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 55109167f9720f30949f0b41af58402e + 195 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 166726000 + + Pacific Bell + + caeec50fdf0ac900492f938c99d1f684 + n + 1695/100 + 1695/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 64c9a1802eb024cd781ab556341d0408 + n + -1695/100 + -1695/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 06a3e8a15917dd0a209edf3970eb17bb + 196 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 169711000 + + Pacific Bell + + f1c8ab31ae210a41ce1ee0e6421f7d6f + n + 4767/100 + 4767/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1384118d400086db358a825c11a51bab + n + -4767/100 + -4767/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 390c3d2084ff725aa1ff2b7c8bd49823 + 197 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 172709000 + + LDPC + + 02e0691aae750245f646e7ccc14d33b1 + n + 6539/100 + 6539/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a6f8fd0e4b7110b6b792030281b0cd81 + n + -6539/100 + -6539/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 028942913d7e42ff6ff232c95fcf356c + + 1996-10-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 176912000 + + School + + f59469b91a4472689dbab9fe0acbd544 + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ea5e693d96e460cb3d6c2b280cf660e0 + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5eaf034dc351b4dd4f058a87c9fa5446 + 198 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 182862000 + + C Master Card + + 90462fea92a00597f1b6fd8719517faf + n + 390248/100 + 390248/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e1d996aeb05b8a6087c78996abdc2063 + n + -390248/100 + -390248/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 045353a65a2fea445b68d7731cbb865c + 199 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 189657000 + + NB + + a93e2f904693d658059b506a9e37dd39 + n + 93332/100 + 93332/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7bd52aaadf619d2e715a68c25a76a015 + n + -93332/100 + -93332/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0d2c90ff9131b7339f2ea90dba7e0fdd + 200 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 193487000 + + PC + + 89f54bb006a41cdde83b02a66eb0955d + n + 5439/100 + 5439/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e89b46fe95d912dc110d300c757e37c9 + n + -5439/100 + -5439/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 075a3d055c5a19d250b2fc815e93d0f8 + + 1996-10-22 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 203573000 + + C + + 4a0fe281a6ad2c98e4f7794e29f6d845 + n + -10274/100 + -10274/100 + 4ac81d62b599798f057b2dd83a5d89fb + + + f43f96b4b1f961caa770a30b9f05386d + n + 10274/100 + 10274/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d3258cd7b6654058cec8c19d03a36b97 + 201 + + 1996-10-27 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 208776000 + + Toy's R Us Visa Gold + + 1df209cc21266e6ef778abf511de040b + n + 6429/100 + 6429/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ef8efe3a4e752793c9656e4beb319c22 + n + -6429/100 + -6429/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 211873214242b01249c21b7093693276 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 211814000 + + Boss1 + + 716866b02b905107510a68b5a0c39706 + n + -367026/100 + -367026/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 2118745900c6efb76728839883999e61 + n + 367026/100 + 367026/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 10f28276e75237e2cb00398ae84d5227 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 216936000 + + Cash + + f1003c9c0bfdad7ac36ef56681911874 + n + 4000/100 + 4000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + d61f0c0895f2fa3f739566e42c005525 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 90a9cac6a5ba376fbb14d7badb07af77 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 219998000 + + Boss1 + + 0b3bb158c93b4c5692cc820fd3ddc962 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 9b5ad86d21c963daf81893d1a415520a + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ba8ccc56708da2a1d3277b282ea0d730 + 202 + + 1996-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 223390000 + + Landlord + + 5c8743233c7246aa40b0be9ae63c6b4f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + c3a12fee64dfa92d0c21c7489b7b442e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a61aa7f2fc9f20c68c102d3d7012d371 + 203 + + 1996-11-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 228139000 + + LDPC + + 40ab915b5dad63e6e24121eba8ecfe78 + n + 3694/100 + 3694/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3427381a9f22c0992587734b5f4f961c + n + -3694/100 + -3694/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e568fc0fe1000690216f486e0eb0e167 + 204 + + 1996-11-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 231184000 + + Pacific Bell + + 97c865d4503ebbd5c4870f861170ea27 + n + 2240/100 + 2240/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 173a805df8d8144ed13d8cee5fb98d5b + n + -2240/100 + -2240/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + eaf44ab64ceb89862135424dfde362a7 + + 1996-11-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 236009000 + + School + + b8520374babec2dafa33df01cf8f2af4 + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + d4a4e6eeb45a06bf6f03958e984c783c + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 10c95f9b37a2a157b3fdde06135dfd6d + + 1996-11-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 239094000 + + WJ + + 13b195a4500340075cb64a33f5adc7ec + n + -4871/100 + -4871/100 + c1c71598e096d9ab5565f096db36ed59 + + + 7b938311efc917932c2bb4a10a2d9ae9 + n + 4871/100 + 4871/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c38e23bfce5f0b316365600f168fbfa4 + 205 + + 1996-11-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 242110000 + + Pacific Bell + + e6438748dcfc86ebe3bc89d2fef4b45d + n + 2458/100 + 2458/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 69364fc792a6aa5659dfa558d04de110 + n + -2458/100 + -2458/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8774e37edb882e0dbc9f374b14fd442b + 206 + + 1996-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 254863000 + + C Master Card + + 301ae34776ad43f07b03fc385630c40a + n + 293757/100 + 293757/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2e550baf1c4c77b89026df5450f411d6 + n + -293757/100 + -293757/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 44746f72a1d18b7d8e347f05334dcb06 + 207 + + 1996-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 258436000 + + NB + + 5c1f6a10946a7a743fa109c8005e917e + n + 224262/100 + 224262/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d05288968192893abd8e6d6dd96773e3 + n + -224262/100 + -224262/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1d11f77fe74c64792acb879671959277 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 261793000 + + Boss1 + + 440dc39c2bbda8681247c40c0eda008f + n + -7425/100 + -7425/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 13a069abbbe2c301743bb003b9c99ebe + n + 7425/100 + 7425/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 72fe28cb0d3fa73686b006be0507d841 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 269089000 + + Cash + + 664f54a6f8bb41e64fa406847dc4fb8f + n + 8000/100 + 8000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a7b6a75a9e3662c19eb1261bf319ccfb + n + -8000/100 + -8000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5a6f3ff081b65f129e7ce37f0f2e536b + 209 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 272213000 + + LJ + + 89e53ce98ce18255bb252c7bef22678b + n + 38018/100 + 38018/100 + 246d4bbc03fd4ebfc817afda54011ebc + + + f61d94640c5667a82f3ee4f3ec3235e9 + n + -38018/100 + -38018/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 889c788cba4bc237410effe38a6e31d5 + 210 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 278063000 + + AUC + + 47f6cb20625105c1cabed298b7db6ac8 + n + 2260/100 + 2260/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 90c4ec53c84b38d7b78bb97715b76cf2 + n + -2260/100 + -2260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 95611e8b31fb8df3b401435ede574652 + 211 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 281192000 + + LJ + + cc3ef0168ce23aff1b9a2b2646112070 + n + 5100/100 + 5100/100 + 246d4bbc03fd4ebfc817afda54011ebc + + + c3ec11924ad66b32d449c8fd873d3ccd + n + -5100/100 + -5100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5848880ba55e33ce46c21bb12bca8475 + 212 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 285845000 + + PC + + d7763fc007727b1b448f274de3e30a20 + n + 22564/100 + 22564/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + f176be8f883c49d975081747251cf5e6 + n + -22564/100 + -22564/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a2cf57372ca3c8903c34cd0664f2498a + + 1996-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 289008000 + + Boss1 + + 1b8f0dedf59a4ace3721b7d99103f2d0 + n + -109069/100 + -109069/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 4773c01c98e5b6643951f79fd40506c7 + n + 109069/100 + 109069/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c90a99ca08eb147fa23f8674d3536710 + + 1996-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 293007000 + + Boss1 + + 6b2fe0a2386ede1b0aa39f440f913031 + n + -7260/100 + -7260/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 8cbcb98344e9b9f2f36e4041922f2315 + n + 7260/100 + 7260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ebf43960c8c1d746e8d103f402520dd4 + 213 + + 1996-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 307201000 + + Landlord + + 1238bde559b6cb1aac7200a79c32e39f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 8adeea3bd71855c9d711c131c1486ead + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f8b6af5a90ae401e489d6fb263915c9b + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 310400000 + + Boss1 + + e45fd72a4a820df7ea2ac141cbdc1a93 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 97141dd67ad0f5e1cbd432c9143e5423 + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 31dbd5ad5b019fcf627065dac86daad3 + 214 + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 313491000 + + Insurance + + 9b7669ffdebb372a56b6ede7a2b59343 + n + 42400/100 + 42400/100 + cc640e911a739a6f58675333704ce9de + + + e1fbf6f5de2b1a9b1f9f66d4de3e7cc9 + n + -42400/100 + -42400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + db333052ad4423d1057e257dd9940783 + 215 + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 317456000 + + BN + + 0aff5783f48fa6ab43f814262644623a + n + 35265/100 + 35265/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4f48d6b864ad8b334fa01b6a8aed5e86 + n + -35265/100 + -35265/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f8f52804024e2578154c1abe106d65fd + 216 + + 1996-12-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 320628000 + + Pacific Bell + + 6e84c717b6b2788540d5bb690e97c52e + n + 5794/100 + 5794/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e182249d8c66d620fa5152c568ba479a + n + -5794/100 + -5794/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 101c8aa6af2d90cb658c043a495850f2 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 323736000 + + School + + 238f72686aa9d51de1a15ae56fe92d2f + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 593c567cce02a08db023c2427e990462 + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4fff54108c7ff4fb7f53bd1ad6e2510d + 217 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 356093000 + + C + + b9f943a25a2ed123790f06dc17f84617 + n + 167647/100 + 167647/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 06753cb032081c592bf4d74044037096 + n + -167647/100 + -167647/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 785ffda7d3fe26ebdaeefbad3dacc8cb + 218 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 359532000 + + W Bank + + 5b52000405f8f61ef8635a660d7bbad3 + n + 6846/100 + 6846/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4408864cf2b56394f387778aac9613e3 + n + -6846/100 + -6846/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fbd8c918b461bcad2bb89728a695e7c1 + 219 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 362917000 + + Pacific Bell + + fe4f52f2b23176f12a94424314027f6d + n + 2543/100 + 2543/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + c96dae2c8e8063f4ee8b45bccbdb4658 + n + -2543/100 + -2543/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3ce4052babc781b935eb11a77c5c2cf9 + + 1996-12-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 370828000 + + Boss1 + + 560adc05bb8cc54c1c204d1e99e424ba + n + -28197/100 + -28197/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + dc669b9c580ba1ed6961684c6bf2cc0a + n + 28197/100 + 28197/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6dd89dea4fdd2d90e51a8a168e0e4e89 + + 1996-12-15 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 374577000 + + Wei yan Shi + + 9248889050cfc7049cd78d60707f2396 + n + -200000/100 + -200000/100 + 56c1924305fc9b5667ff93ed389f571a + + + 854c2f86bb46139789b786522f6a995b + n + 200000/100 + 200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c5fad55e2bf1d35ee6e0c99ccd6b4910 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 381256000 + + Wei yan Shi + + c663d7e359f019a206a75ac291b78191 + n + -100000/100 + -100000/100 + 56c1924305fc9b5667ff93ed389f571a + + + 39bb8675d7b5528820aebbfa3e1a6b9a + n + 100000/100 + 100000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a6a68d4fe2de9825d6fb2c2e83979dc0 + 220 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 386877000 + + OppenheimerFunds + + a2bbca7eeacee2370612d6905f63d38d + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7220a7e13133c18c793f6f2235495d5e + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2543d4925154936850d3845532445996 + 221 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 390151000 + + OppenheimerFunds + + f322ac9bf72383cad642cc31d293c06e + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c04bc2ee60083a6f275bd61fdbd8b92e + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 87f141e51cf76d53a844758bd1464787 + 222 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 393388000 + + NB + + 37b57d58cf82a11472871aea4e8b6cb7 + n + 41047/100 + 41047/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6d46b50de4768c25884812c810514175 + n + -41047/100 + -41047/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ac5a052aabb9a2919d54cd3d69204ab0 + + 1996-12-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 406198000 + + Cash + + ec938761e10f926f91f59413a7c29c0f + n + 4000/100 + 4000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6c246ff769910f4173b5fe868361d858 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a57548603dfe2a2622acd7cbfe2ae4f9 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 409596000 + + Cash + + fcc465c76ecb6c88056610aa93f22156 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a8a448c16510f59945db80104ceac0a8 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b900ebc25a48bdda08af81b68367dcd0 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 412834000 + + ATM Charge + + 46d73396d99e01e023ff43eaae3dd791 + n + 100/100 + 100/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 554ec7c3c5794ac334fb28a6ccc6ce7c + n + -100/100 + -100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 849d594cded5afa4939bc39454ed1ae6 + 223 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 417677000 + + Landlord + + 5f6b1b66dd6fdc6b75a2e1e950d4c911 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 83db6dd043e4dae6319b6ef57b55ba0d + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 453714d0f6bf310baa75b4c3ae1ae40e + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 420881000 + + Cash + + b8ec3304866596d5150ae277c24908a7 + n + -20000/100 + -20000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + caa2e873c07a7bb008e29d097c9f06be + n + 20000/100 + 20000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1193ad0cfae7cc631787ef2c057fa2ca + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 427138000 + + LJ + + 821b5ad33183169c4507298ea47489ed + n + -23050/100 + -23050/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a809165ebffe5f4b51c40d2fb130f17f + n + 23050/100 + 23050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0c298574d52ec79f430bacbb432e6a06 + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 430542000 + + Boss1 + + 23875c0d737d0623ed3d51dd365d6406 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + c57052c5d506e15c4e024ff212a05bd7 + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bb473d397573c1e491292cc2f12450d2 + 224 + + 1997-01-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 434489000 + + Mellon Bank + + efee0da2c30ca08eee67ae8820d4ab49 + n + 4000/100 + 4000/100 + f5b32f79be8cc4952e6e2ddd4077b0fa + + + 1c4d6dee9fce92b2fc2ea80654641694 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 827067e615b526598f1120ae0a622c05 + 225 + + 1997-01-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 437911000 + + LDPC + + c0a9371cd2edd2a3c56c1b7e9cf53313 + n + 11224/100 + 11224/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1ed88eca4d4f84bec438f96e01900585 + n + -11224/100 + -11224/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fa2ee4a96fa779ad903e679cf2cde07a + + 1997-01-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 441404000 + + Power Co. + + 32f8283f41147bf98b8c1acacc0d36b5 + n + 1158/100 + 1158/100 + 92b05cc5070282b02b05e60f161a5882 + + + a78b8be9342fe2ff07553c0ded182868 + n + -1158/100 + -1158/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1a00e4f34ad980e606de99a2860dade5 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 453760000 + + School + + c427d7272777ee94aac629e95730a19c + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f260d536d1384a35272b899cd0d76815 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 068e74d0d92645e4d2f3b45fd085e380 + 226 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 459321000 + + W Bank + + 4d9c764c8fabe5660a8d21c3bdb70601 + n + 31535/100 + 31535/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3e8c2ff1bbdd75856323bce05ac6be6e + n + -31535/100 + -31535/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bf09d118378c87abb11007ad6dd8ce82 + 227 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 462643000 + + Pacific Bell + + 39d189e8299b7603666deec3bda87cd5 + n + 1707/100 + 1707/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 88036c73327945790bb9a9c08c7dac17 + n + -1707/100 + -1707/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 303d54dedff263a91e6cb51a4b26c4da + 228 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 467534000 + + Pacific Bell + + ca1bcf2e2dd6f0cd4a9a7628664eddb3 + n + 1626/100 + 1626/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 9b22f04de4a412973edda84b6595e58f + n + -1626/100 + -1626/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6343a2e1654477b9b54141392667737d + 229 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 470852000 + + C + + c6579b6c63dd0564c70542038736314b + n + 680327/100 + 680327/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 8839e3cf3943596f1f2bf74f58e864d6 + n + -680327/100 + -680327/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4fecc1c9b6010bf89908640fd812cba2 + 230 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 475292000 + + P.C.C. + + e293f2d5d724ac399a68a3048181bc93 + n + 2311/100 + 2311/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ca83e0c3714b32d9e401a945d38db33f + n + -2311/100 + -2311/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 460e51588f368b8e84ad9aa772ec165b + 231 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 478886000 + + DWV + + c0f7c0c3e7beb68ddaf8c6c60db3e4d2 + n + 1200/100 + 1200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 27dd616c8a76bb6673080628dd18a838 + n + -1200/100 + -1200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 735654b22025b9f8ad8a22ce96a2dbb9 + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 482153000 + + C Master Card + + f03653c9b32d51e3f1e4a8a5a65a693b + n + -17096/100 + -17096/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 63c3fc193b315eefd3c1fd6f9f96d897 + n + 17096/100 + 17096/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 592aed41008b941447d1d4bcdb94822e + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 488775000 + + Boss1 + + 820242db57c538d05bc6fb752e8427ae + n + -13017/100 + -13017/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 186f8f8bde40f01681a93eaf2de72528 + n + 13017/100 + 13017/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 74c9364b0a8b94aeb08b2383268782f5 + 232 + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 492079000 + + PC + + 8e9d4a71a15aee3dcf078b1a8cec4a71 + n + 7498/100 + 7498/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c24cef8e60671892a5930c725d129b7e + n + -7498/100 + -7498/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 106ab0176f02a9405ee3c66a3e60c18c + 233 + + 1997-01-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 508842000 + + NB + + de2fc1757cc61edf78440778a3e0160e + n + 151053/100 + 151053/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 48bf9b20c837a8149855f8c3a8475756 + n + -151053/100 + -151053/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5077695379011b26b6d41a5b3720bc7c + 234 + + 1997-01-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 512202000 + + Landlord + + f7d85b8b01438f8cfd6bde938bd4a701 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fba2fe633d45c6f56e5627156f8ee687 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 981db9b1911401ff58e7c13821f33067 + 235 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 517500000 + + LDPC + + de2486ff4869026c28e2a269ba8a2e45 + n + 335/100 + 335/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + d7267288e06524de8254fcc8394b7cdf + n + -335/100 + -335/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7e5db81c3b4899c562c2d8c8d7fcc7be + 236 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 520886000 + + BN + + 1952bc2fd059541937e8d5b8f6de7133 + n + 30232/100 + 30232/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bea949cf0b653173e02e5747683ee425 + n + -30232/100 + -30232/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 623285c9fa3c25c378d86939a858ae47 + 237 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 525629000 + + + 70ded020b2233741773d5787ab7e8a59 + n + 3391/100 + 3391/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 70bd7cdccd92d30660179dd28393a50a + n + -3391/100 + -3391/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e2366d2e7499896d7a12a9dd7ea82652 + 238 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 529106000 + + + aeb878c3da824b10b4b1691b28faea92 + n + 7722/100 + 7722/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a5ac8bb14a7da137602bb8312ea1507f + n + -7722/100 + -7722/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6a165fc10b3d9c4b20cb25ba3ea4a1c6 + + 1997-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 532437000 + + Power Co. + + 4911061c6a78c0a8f5a789949bb03945 + n + 2143/100 + 2143/100 + 92b05cc5070282b02b05e60f161a5882 + + + b3f9a114abaafc395d9c816b15174f85 + n + -2143/100 + -2143/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 28f8eaa0613af2a549293c6f40e7a2a2 + + 1997-02-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 537275000 + + School + + fedd8785ce35b56c9e0d4347a2dde6d4 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ee757456393d407ab066221d75df15e5 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3816d09ab7393110551bbb59cc69f5bf + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 540603000 + + Boss1 + + d405e8bbbf242bc69e6242e2a27a029f + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ba90582969349f61b8706340436526e3 + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2aade6f549b63446db480424074f2e4f + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 553538000 + + Cash + + 9d2385274ec67b2eaba6ddf09d8baf4c + n + -80000/100 + -80000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + dc1487ac053a15c80b09b34eb8c23794 + n + 80000/100 + 80000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d6b73506faf50e51335ab7d1c49189a2 + 239 + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 557560000 + + CAF + + 5a9879799ddfbd30412dc8bca9a0acaa + n + 30000/100 + 30000/100 + 3451d55fd6957c001991ac7b98402b04 + + + 0ba8cfedec4d16bc594970aabcfa2d87 + n + -30000/100 + -30000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 78b99452bdcdecb8d63b9390be80eae4 + 240 + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 560832000 + + City + + 83a2eebda4369578a71bbcb278b61071 + n + 5000/100 + 5000/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 61b7931fe91a68af2e32c7c94df47a42 + n + -5000/100 + -5000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f3d060a115a4be3774d61fdb8e902a63 + + 1997-02-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 566132000 + + Cash + + 092d80ec5d65fde0ac6ead589cd5f92f + n + 6150/100 + 6150/100 + 9defb6c42135fa2f4036762c8926c8ca + + + feee66ad4fbb2ed0c663dac7bd83b258 + n + -6150/100 + -6150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4cfee07d500b18b3e032eb60f6deff22 + + 1997-02-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 569607000 + + Cash + + 298cc3ccfddcdfbff733ada6f776798b + n + 150/100 + 150/100 + 94f1725a16858da2a9832cec4d7c78fa + + + f3ef4110d5aa8b1cc264e52c64b35e35 + n + -150/100 + -150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f5d03cfc591689004f0123a0e08cb79c + 241 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 573105000 + + Pacific Bell + + 2bfa2759cd7544f7989c8d3ae5bff3a0 + n + 1610/100 + 1610/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 10c54193a837cd30401b415707a45696 + n + -1610/100 + -1610/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7980ac4ffe2c6d148012383ddee31724 + 242 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 579170000 + + NB + + 184c093e3d5a3a43bbf920db69896a63 + n + 60486/100 + 60486/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e6e4db6627ad72dc98927608919742f5 + n + -60486/100 + -60486/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + eedd158ca6ce1c9ca48027b4be9563e9 + 243 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 582956000 + + C Master Card + + 66234970380282cba6f89e868d52f81c + n + 62141/100 + 62141/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 59c5fb45451b70bf0ae45f3efa4151ae + n + -62141/100 + -62141/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f08803c9a31de343e3da4106a8750765 + 244 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 591970000 + + PC + + 27067851a5a891ecd86ddf35ff8e62f7 + n + 21583/100 + 21583/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6d05242aea96343a8f168d2319cff39d + n + -21583/100 + -21583/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6ece4d7a1c447ec807770b55bd9ab3be + 245 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 602746000 + + AUC + + a6d6b312d86ef6e0494643eb00c14140 + n + 350/100 + 350/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7e6ea743f6b7f7b9951fa18a4fe7f6a0 + n + -350/100 + -350/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d2018c35add9d2b262b7509ecf29eeab + 246 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 608475000 + + HCA + + f6bebb35efb516c7583a8bec1135cdc1 + n + 448/100 + 448/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + 41c8b22c30269a42634dd4e1f72e2a7d + n + -448/100 + -448/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ed552474f3ab1b4cc6d2218956f75e0f + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 612462000 + + + 3b847da548ea51768f7a33acd2e66bce + n + -250000/100 + -250000/100 + 6cdb61279507abc41065ae0cfc49e314 + + + b23fa8445e8aae5272eb49b2a37bd1d4 + n + 250000/100 + 250000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a487ff2fc3ce9255ac93f8dceb56877c + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 616230000 + + Boss1 + + 2de9dd4d409aed7fb0a2fef069dfc425 + n + -125608/100 + -125608/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + e07e60818435429fdc83603f935acf7a + n + 125608/100 + 125608/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8ac0168472e08d89b57f3963aec0468b + 247 + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 619861000 + + W Bank + + 3e3bf2ddac3e25e47269701d44ce5453 + n + 261754/100 + 261754/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 67417405d30995a6a757d4b133e03de6 + n + -261754/100 + -261754/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f8dddef70105ec69639039676cd8ed0b + 249 + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 623421000 + + Siphon + + 5e8238d981ea81eb7c6d34ab209cfadf + n + 150000/100 + 150000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 23e1220d24b7d45f699f7edda9b55a42 + n + -150000/100 + -150000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c790b43cd97022b2a2ddb51372f153cc + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 630005000 + + Boss1 + + ba0fb38b45665c40986563af5297b4a7 + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f05a3774c784d224ccc64471a7a04dcd + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1a661288abf9f2a7b11cffb2fb18ad94 + 248 + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 633489000 + + Void + + c6f823af201e1f6c961831a769104e6a + n + 0/100 + 0/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ac2598e139ef2ee6aed835c5754d5dd3 + n + 0/100 + 0/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 667068ff874ca5e7fe68df6f3eb5f2ab + 250 + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 638849000 + + Landlord + + 8cfdd80812cc2db7597e76070e0191bd + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 7ab4b3fce54920d96384894d7fea6749 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1543035a3b6345afb761a2de84865e7e + + 1997-03-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 642395000 + + Coast Federal Bank + + 2849d97068ee2fb7fb1d7ba135fd49d3 + n + 200/100 + 200/100 + 94f1725a16858da2a9832cec4d7c78fa + + + 4c75cfca188ec246b0a7827e3e809858 + n + -200/100 + -200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2e906cf02a4862ca515d96cd6207c9ab + + 1997-03-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 653068000 + + School + + 0aff81e8c77fb0d8b986603220b00068 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 066ffc5eadab79b80ce91c28d56a73c7 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 7c1fd036103780221f9745a0de6f988c + 251 + + 1997-03-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 658138000 + + Image Check + + 6aa7bfd8210a80ac06470940c5c63748 + n + 676/100 + 676/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 0625ccce2aa6767bc6261ae2627f349e + n + -676/100 + -676/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0d36273a9aa67523c06d881c09fe2124 + 252 + + 1997-03-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 662085000 + + 1HR Photo + + 9d8a0ae0b2eeb42db3a67fdfd2c44f65 + n + 464/100 + 464/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3b32b12fff414f6470395230d2afa34e + n + -464/100 + -464/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 53b37bf0d9e06cb00b86cbd741ca0493 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 670018000 + + Power Co. + + 997b40c6799a9f7217d9d62cc6a20863 + n + 2062/100 + 2062/100 + 92b05cc5070282b02b05e60f161a5882 + + + 3281a328f8582ef5f91fe5fb70a33915 + n + -2062/100 + -2062/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 15f0b1996a76f06a7dce6208aca94a47 + 253 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 673432000 + + HCA + + 21f0a8e2c5f598ff06978259b56c84a8 + n + 1227/100 + 1227/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + a63494a82c2052828ee68246b81bae90 + n + -1227/100 + -1227/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ed3640628baa32651320fa9d467c3e92 + 254 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 677388000 + + NB + + 9516531560ad5fe100e6ec9ea39754ac + n + 97609/100 + 97609/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 311d5fc277f22fe63109feb48adc4662 + n + -97609/100 + -97609/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e445c17b5001a0c2804cc1d55a154cb1 + 255 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 680980000 + + LDPC + + 2db3299b015d462eef4a452c89422953 + n + 1387/100 + 1387/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 39d86f2837c5ee8cbbb2e2f1bd57877f + n + -1387/100 + -1387/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3fd9726e1ad270aa966fd281b6fa98b2 + 256 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 687025000 + + Pacific Bell + + 61f429b7e61caf5bf90849e4ad186c44 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 05d7ef8e536b7048a33981b07b29c7f5 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1923f06e083014020089c084dfc0cb8f + 257 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 690690000 + + C + + c89b32cd0df296141c7f2b8510c1a26d + n + 76269/100 + 76269/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 8ad74938a9ef6e20acd7cce2499f2a05 + n + -76269/100 + -76269/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a1526a7c736b8ecd601500f53d5907a9 + 258 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 702455000 + + MA + + d5afc833b2ceae7af393bfe7abb22ed9 + n + 3765/100 + 3765/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + befcb8f4a369ddea19ee3e1041cec53c + n + -3765/100 + -3765/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1d284f2bf2194d3f637ad9cf012b5e5f + 259 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 707847000 + + Pacific Bell + + 7405ad9f2fc398dcb80642654b8425e4 + n + 10856/100 + 10856/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + f83716c9834fe7d530068bbd69440ac9 + n + -10856/100 + -10856/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 94a09e390026305e5f687922b2e00919 + 260 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 712283000 + + FTB + + d35bfb3500fbe769aa3491839750aa7a + n + 8987/100 + 8987/100 + c791e88d9c25ef9cbdab5d4b9f51fde9 + + + b2f0487977bc46f1ead8f6b4fcd57fc8 + n + -8987/100 + -8987/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3767b2b000c6be1934f41549fa38aed6 + 261 + + 1997-03-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 717441000 + + Dr + + 4a94b12ba846fda1efb68fb922119e47 + n + 4000/100 + 4000/100 + 60845136829c50ec4a09675a08c2da24 + + + 626bb63127a414e072dd75d60f80c1af + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0827d64897c3c2c51907e31a9bfa22a5 + 262 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 720990000 + + PC + + d6d6f0a0ce97326656fc5a8d5d6be398 + n + 23947/100 + 23947/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d08dc078fd9da8a8264dce2eb1b2807b + n + -23947/100 + -23947/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f3e52a242480b1dce5b7f22d8daf4d2c + 263 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 726757000 + + LDPC + + 5bf8275c51a42748dd822d3069dbc66e + n + 480/100 + 480/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1fab7a3fe9691ad20dd89c3fc1e2be11 + n + -480/100 + -480/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c2264c22efa108f6af9678ded1b9beb8 + 264 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 730375000 + + Landlord + + 08e6b80b6d2281262f85c6aa3938c090 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 997b2b2111205898e64c27426c6b3cac + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3cd732cb4a7bf33e91b4819dcf21e702 + 265 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 734748000 + + HMH + + 37212595735b2d8251e35a8f4ffd9f98 + n + 4530/100 + 4530/100 + 60845136829c50ec4a09675a08c2da24 + + + adbb4271ff307222874e3ccd2eaf6ffe + n + -4530/100 + -4530/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ca3ebd5bb83ecd464073d569770766b9 + 266 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 738338000 + + Pacific Bell + + c947a78e5aca982d5cc010e9f7d82739 + n + 4691/100 + 4691/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 46a9d67bb9dd0b1d0cab06841de6d9ac + n + -4691/100 + -4691/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 338b36ee0a5b2a1cbc7a3e1a223b1d3b + 267 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 741918000 + + City + + 7cd754a77660fccd622771f6bc3367ba + n + 2200/100 + 2200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 73f93616a798114e77d141fc708d3969 + n + -2200/100 + -2200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d7cf017ed3b30e0b6ca03523cf7042ec + + 1997-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 756517000 + + Power Co. + + 5e35b38bcea75e790ed3e912cebf279c + n + 1987/100 + 1987/100 + 92b05cc5070282b02b05e60f161a5882 + + + 9cec2e4f568eecc78a71d8d08d9452e7 + n + -1987/100 + -1987/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9b37ec252f99f1dd19d51900726ac6b1 + + 1997-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 760170000 + + School + + fc375e8dfebdcc24af94943b4d02e65d + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 21e040595fb25e07c36febf6304d6210 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a884f8e5735fa714d63f9c43275f88c3 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 763725000 + + U.S. Treasure + + f077213808a9b0dcf3fa471fc40d1dd6 + n + -17881/100 + -17881/100 + 15a7de112614d62d993dfcc43ff70142 + + + bc1add7959726c38d6e1b226fabf5600 + n + 17881/100 + 17881/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c63439722c2df5b7c0fff748fdcfa8cc + 268 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 768828000 + + C Master Card + + 20b7158a55ea608ee8419b7842d860ee + n + 62734/100 + 62734/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6841b326115d1d25ff6c6826b23b748a + n + -62734/100 + -62734/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ede777e9b012725c09d68cb7eda91f27 + 269 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 772557000 + + Pacific Bell + + 72623bae9b029ddd25f6b049a032ee59 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 623290551347f6c3575cd80edb32f975 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5bc7e6069181ba2d61fc7a721c8e53ef + 270 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 777173000 + + PC + + 5901539c3bd871ac5df892d20f4c0650 + n + 2131/100 + 2131/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d7137ca202dc10a4db7e64fc6127ff6f + n + -2131/100 + -2131/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 24e4a033871209b811d0e58a091b5878 + 271 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 781147000 + + NB + + e7adc36f61eae8daf1d5d1b01f0f1bb1 + n + 82709/100 + 82709/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cd001fe4252a3ba3277520a3595056bd + n + -82709/100 + -82709/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5119345ed2553f2914671003c08be51e + 272 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 788261000 + + AN + + de06fe5fb322c587deb9dfc2559d81cf + n + 3600/100 + 3600/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 00e33482d86208da4f70746d32a3f73f + n + -3600/100 + -3600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b59255575e261e6b8c170e9378573fa2 + 273 + + 1997-04-25 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 791897000 + + Time + + 9f9dbb6d75c01077417b83c223781a01 + n + 6032/100 + 6032/100 + f981711ab9d0c5ca6b75d0b5a8ee261b + + + 659e1c4eaa022164d7aa05e26631aeeb + n + -6032/100 + -6032/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 90beabe2d85e83f4993b2bace4624017 + 275 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 802258000 + + DWV + + 94a77513c21c26d1d06b93eb1d42fb9b + n + 23600/100 + 23600/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 54ffe4fef8a63ff49efb446f6bbc1650 + n + -23600/100 + -23600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + cd2c3c85b514820836717d12ef118527 + 276 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 807296000 + + Landlord + + 820abd3f59513d18f0aafeabb702efd5 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + a08de56b45e502e40e8558b16f9eca0b + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d5019bbaf588479582720127553fb662 + 277 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 811931000 + + WJ + + 994c5d2f22cb6d15f63a1b360a8a7b6a + n + 7026/100 + 7026/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 1e1e679fcbeff5a29a49398c74b80811 + n + -7026/100 + -7026/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5c3c21ac72e9987e525a1a51bfbb2648 + + 1997-05-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 818111000 + + Boss1 + + b52c889b4725bf103114786bf272b1e9 + n + -500000/100 + -500000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + b0506760368c7f0c44700b9654e45da1 + n + 500000/100 + 500000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f31bb257cc534a99b28cdeeb61b7d7e1 + + 1997-05-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 821754000 + + Power Co. + + e7083ca2706194fabaf14b1b2080eac8 + n + 1879/100 + 1879/100 + 92b05cc5070282b02b05e60f161a5882 + + + f970c39abe00ab00b1e91420e10cb8cc + n + -1879/100 + -1879/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9f38637634c9ca8177926e6d4323eccc + + 1997-05-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 827293000 + + School + + 093f13f06a2777f8ed82c28d8b6590c4 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 2b0765c638e48309646f9cde2faaec2a + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e76bb9b743b6d287a11dcbe0b0869e83 + 278 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 831052000 + + C + + f10d84333eca0612c84e88b72592652e + n + 14700/100 + 14700/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4d5533b370f4fac3be475337d5044d5c + n + -14700/100 + -14700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9384c499de53be49bd488728ac2d0d72 + 279 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 878146000 + + NB + + 215eca347c1a672a45568fd7a39b33bd + n + 62979/100 + 62979/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + fc1048ce4dd3e691df4b4a061325bda8 + n + -62979/100 + -62979/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 80005cb3f573a01ca784b81c5cb0622b + 280 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 882010000 + + Pacific Bell + + 8f8a652f18ceff552982a85c6a7a069b + n + 6009/100 + 6009/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 22888f59b1e7b9edaa02562976606c89 + n + -6009/100 + -6009/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d1d647017fea0b84df6775f10efd864f + 281 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 886369000 + + LDPC + + c7b2809afca1ff24d3dcf75aeddadd54 + n + 5318/100 + 5318/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 05c9ceb2aea157d5f4bf4f302d43359a + n + -5318/100 + -5318/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0a337e0f3dca16ffced22be15281a0d7 + 283 + + 1997-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 890152000 + + MA + + b852f1af0133f6b88d6e83d793b90795 + n + 5844/100 + 5844/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 39f2f3aa7d6c7ed9edf0cbc446588e81 + n + -5844/100 + -5844/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f4121e9ee5950e9b3f7256e66459625f + 284 + + 1997-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 902096000 + + Boss1 + + 45a91af09ecabe0b631b4e399d72b606 + n + 7200/100 + 7200/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 4abb279f582d0f6496ce605a6b2ef928 + n + -7200/100 + -7200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a0537ab37f187113f8159296eb35b230 + 282 + + 1997-05-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 910229000 + + Landlord + + 7db3cc65f8c984fdaf5fed128d629101 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 9a9ab1a120889414bce6bd3b4c92fb7e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ce7165530584bee35a5dd7978a044932 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 915272000 + + LDPC Co. + + a291289c090f68da1f9db04019b436fa + n + -10000/100 + -10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ae73f7bbc613e8310e4e1ffc9d90b712 + n + 10000/100 + 10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 945f95941db96567f0758ed55be7ef13 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 919308000 + + AN + + c2d05d847f205b590e6714b4ccfe3706 + n + -1657/100 + -1657/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2c80561c8d595ca6e8825b95e14aa53e + n + 1657/100 + 1657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6d59952c3fd084f3975f0b03a3754762 + 285 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 923215000 + + LDPC + + 0ae9bb7d6f819ec29f2e9054a52611ab + n + 557/100 + 557/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + c356713b1cc44e278292ff19fe78a88d + n + -557/100 + -557/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5814d7d7dbf20973ede0b9a5f858478f + 286 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 929466000 + + PC + + 459ef59f94bf5dec6a78d95b3f2347e3 + n + 4462/100 + 4462/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 5d1a2eb53c7cb96990b9a8ca771c21e7 + n + -4462/100 + -4462/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + a0c7b2f3a8bd21cc20a956f3e1f1e213 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 933294000 + + Boss1 + + 08f51b4a7661553dd748f0749366354c + n + -79580/100 + -79580/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 6fa26a9227791f5584d451291d310aa9 + n + 79580/100 + 79580/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e767808c76ef6beedaece0dfd14d01f8 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 938773000 + + Boss1 + + dfbeac03e9486bb62ae8bd9fb7247582 + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a8b45da8569d554a36b2a7044de6be32 + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 022e64fdb68b4103020fd69957ce7767 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 942684000 + + Boss1 + + 65b8017061e290f22c2fbc5c2f710b6a + n + -40000/100 + -40000/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + b7cb2138962a722aa0fb843a907faf6d + n + 40000/100 + 40000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 651a5e321a645022b055de7ff25e6db4 + + 1997-06-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 956025000 + + Power Co. + + 65a3ba67425fe2fdaed4ea3e9986f4e1 + n + 1898/100 + 1898/100 + 92b05cc5070282b02b05e60f161a5882 + + + 6f869a9af38bf5e1f2c4dcd427cb45ab + n + -1898/100 + -1898/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fc085b8b12c6d0e2bcfc4926c487bf38 + + 1997-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 959771000 + + School + + 186266d6fc91f0a99588c26c3a6c5fbf + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 519addd050903148b123c0b9a90445f3 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ad0b49172f5f3cfdc36d8e77f9300d22 + + 1997-06-11 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 963589000 + + PC + + acab4e7ebe17d3f569fbe74929a6707d + n + 5897/100 + 5897/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 61302c167f8d3bfa17c7d2c84d57fd80 + n + -5897/100 + -5897/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 897cfd2f277906a23aa23abb860427e4 + 287 + + 1997-06-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 983797000 + + Insurance + + 3f6b3abc82a6a74ecae20466263e6e48 + n + 50100/100 + 50100/100 + cc640e911a739a6f58675333704ce9de + + + 0ab0b745807a3268d877d90de7f861f1 + n + -50100/100 + -50100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + de6de8178ac4fb1dea5aa72a40c04409 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 11908000 + + Cash + + 3aa9b07b1460ca1b5f1b7996220c71af + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b9f24970b66bb96731b86404314e093b + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4a2b7825cd82365d3e948ac1ca36fa69 + 288 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 17571000 + + NB + + 05a69453f66b4c7dbdb7bad032de8f9c + n + 160040/100 + 160040/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d1597bc93fcb85b3bd0643423095eabf + n + -160040/100 + -160040/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e40a87e2b15b271ea3e0c61c5eed9136 + 289 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 21529000 + + Pacific Bell + + 0fe2b2046e845c2d434c6013907f3ce3 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3b52b1c474ca249aa8b97ff581516cf2 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4fdca16d29e90da560796d93b26ada6f + 290 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 27169000 + + C Master Card + + aa8c51f36d3dc503fa958b394c66307e + n + 19707/100 + 19707/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bd256365fb15957e5ae0966075c3d3a6 + n + -19707/100 + -19707/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ebeed163269757bc5399be61e889e321 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 31076000 + + School + + 152d2f8773303341d0209109c93a05e0 + n + -7650/100 + -7650/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + bb4eae87754d159bb3c6cd479365ec5b + n + 7650/100 + 7650/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d3b8043b3196da237eea9a143e26431e + 291 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 39088000 + + MC + + e9e6466cdd13c2337df13895267db192 + n + 24257/100 + 24257/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + abeded579dda59f0f8e62776107714e6 + n + -24257/100 + -24257/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4302b0d7a1e8e7f94ebfb7556e306686 + 292 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 42937000 + + PC + + 44ed1fba7f70c1f3e653ac60baf09d1b + n + 4203/100 + 4203/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2e222aacc4577c8c102c7d60a0dc2a92 + n + -4203/100 + -4203/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 897dad8df9174b77150e38e36cbabc35 + 293 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 52741000 + + HMH + + 924e05194f60bca43f2239b3a45511ed + n + 3020/100 + 3020/100 + 60845136829c50ec4a09675a08c2da24 + + + 617993e05ef9f4d27c075bf6d746692a + n + -3020/100 + -3020/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d8cedee0d2458f504a0f9a1621faa569 + 294 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 67385000 + + Landlord + + b116072250be8208f80e994fe121efb6 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 10206b5ae941175845308c0a398dff93 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 99ca076f81649296fa7e71194b2bb618 + + 1997-07-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 71163000 + + Power Co. + + f3ae02db04d51fe05598a0f3d67aa2ac + n + 2369/100 + 2369/100 + 92b05cc5070282b02b05e60f161a5882 + + + 0a223bdc3842aaf89031056028db7495 + n + -2369/100 + -2369/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 4468644fe09284cf64d29da418f03805 + 295 + + 1997-07-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 75908000 + + LDPC + + 1506207b9579dc4f1aa13017e2c88b40 + n + 1824/100 + 1824/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 13e3521cebf660d1aa288cf1c48578de + n + -1824/100 + -1824/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5833a5d89a377c1b7ed78afb17210d70 + 296 + + 1997-07-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 79830000 + + Pacific Bell + + e42a0df7ca6fcd7e29dca382dca8f180 + n + 6403/100 + 6403/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a4ad94d75253eafc99b421abf49e3afa + n + -6403/100 + -6403/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 40b948feefb4f7282083d330da4f3bb8 + + 1997-07-10 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 86821000 + + School + + 8cda3ca9ccfed1c2d84920789471731e + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 6711ed19549b67d69c221d05b4880024 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3c43cb682217599720d97883e05d17b2 + 297 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 91686000 + + NB + + aa3c0ee7b1e440b03d4ca31921571300 + n + 43343/100 + 43343/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + abad7638636568d073b8c58900cc929f + n + -43343/100 + -43343/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 394ee7a0ab7014566da7a11a81c48e10 + 298 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 98862000 + + C Master Card + + a4635cf13fb19baeb76838f6f6840cdd + n + 78050/100 + 78050/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ec5787436adc2bc8d3f6646c95668fa3 + n + -78050/100 + -78050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1d0a0c09a591bcb2d1b71563d52fd0a9 + 299 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 102930000 + + Pacific Bell + + a6dc948f17564a60f5d1ebaa4c4c1bfe + n + 1657/100 + 1657/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 09c63542fe2f793f9e84ce5c62548a56 + n + -1657/100 + -1657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ce4bb57aeb6ff0f331fe775bf554cf59 + 300 + + 1997-07-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 113775000 + + SL + + 5bf77b7b17e567d7f20c9b52007b99be + n + 75000/100 + 75000/100 + 96d92c6744c5df991da54c700630fe72 + + + fa56bf17b8d61e956da18139a01728ca + n + -75000/100 + -75000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c88269043c5fa6f7269d91c6b3569cf6 + 301 + + 1997-07-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 119797000 + + Landlord + + 9970e1cf2905d15049d63b79df308af3 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 2f29ecc303f67d052aa6c1a61ae41361 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ada1f7d5db1d5940e00e2f8704f2a417 + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 123707000 + + Power Co. + + 7aced176458b42ca438e42fa189560d4 + n + 1901/100 + 1901/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 48d5629a0fd79ac54f7635d1db0bbf32 + n + -1901/100 + -1901/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 46c3e7c59c0f1b7ef700f33eac7e00dc + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 130494000 + + LDPC + + 5c8712bc5d87c3ae55fc5fc1fe5e216a + n + -10000/100 + -10000/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + 6786edde55236622b04e73518e2144de + n + 10000/100 + 10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8657a748ebcf8db88b39877178e0bf28 + 302 + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 136270000 + + LDPC + + e46ae9653f9bca90745156e890416cf1 + n + 324/100 + 324/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 024c824a4c8e804e2dfb1b08e7920811 + n + -324/100 + -324/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 18036f6797801ef311d8f6c82b0980a0 + + 1997-08-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 437157000 + + Gov + + 1dc73cd2cbc8fe231663b599a46e5cb6 + n + 8500/100 + 8500/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 669f8b681f06bb2ebffc7b5544b1bdb6 + n + -8500/100 + -8500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fa45b682d2d763a8c06f04852ad31e0c + 303 + + 1997-08-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 441318000 + + Pacific Bell + + d29736bd0e5486fb5b842a091a6d6813 + n + 32575/100 + 32575/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + f495e1fcdbe3b3d28b74111fcfe743e0 + n + -32575/100 + -32575/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + c619cdd99573dd31d4443ba4b7580734 + 304 + + 1997-08-04 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 447733000 + + Pacific Bell + + 4a5006552a46776ae5aa1f54bd05bf14 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + ede912527d09b6dd4748ffcf80d0c55c + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9812d1ee0a6c2a6b07c00fe542edcc87 + 305 + + 1997-08-04 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 451762000 + + Community Hospital + + f2db08e473f15fc9226056911c1bce3b + n + 3530/100 + 3530/100 + 60845136829c50ec4a09675a08c2da24 + + + 76ec26162e8199cd74114d213dbe0885 + n + -3530/100 + -3530/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 37274e49468f77d6cb5c7a4ac27f7b94 + + 1997-08-10 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 465571000 + + School + + 36529a24509ed8ec995f111545f17c86 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + da4bea0fba94cf2f54b4f9b64a3fe040 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5a5073b643394f9132d92e055f2b9ddf + + 1997-08-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 469555000 + + College + + c0dda888c4bb5febf0a3991524ab0edc + n + -4700/100 + -4700/100 + c1c71598e096d9ab5565f096db36ed59 + + + 8c7d9c30eabb2778841276e4e865e149 + n + 4700/100 + 4700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b6103380b09fa52b8d9ce3dc7022458e + 306 + + 1997-08-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 473567000 + + C + + 3777e5827f6a6209338e6d9acb874301 + n + 113191/100 + 113191/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 1bfd96fc1318c77160030d6894c83b84 + n + -113191/100 + -113191/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 98af80106192829119277b2ec70c505f + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 480303000 + + Power Co. + + 69fc6f978b47d605fe40595eca7b40e1 + n + 1776/100 + 1776/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 81f342f62b79fa10938029f8c34fd4a9 + n + -1776/100 + -1776/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + e58d04ea5ab0a405244b3df03bf165a7 + 307 + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 485219000 + + School + + 83c4b6627646d08575ab5f3de188d581 + n + 58642/100 + 58642/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7e8ecf29165860fe0a33ae24fc1bb12d + n + -58642/100 + -58642/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b583ae684477765c7639c9210e2a9103 + 309 + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 489474000 + + School + + e522a5b59f8d0fe04a5bc253c28f2922 + n + 10483/100 + 10483/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 38cea2908bb235848cfb4ff545a58b73 + n + -10483/100 + -10483/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 17b839c0dae6b48d512225312bd085e6 + 310 + + 1997-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 493645000 + + Robo + + e7e8414d043369c18fda4b6ba46aa242 + n + 5728/100 + 5728/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a954f5435dda86b27740f587125448b4 + n + -5728/100 + -5728/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + ba794353f51709430af700a69e1ec8ac + + 1997-09-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 500369000 + + Boss2 + + 43f9792616b2e18c1a0ce1a178377ea9 + n + -242653/100 + -242653/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ef775b23e44bc0fef2be091b0d6e8db6 + n + 242653/100 + 242653/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2e3b3fb5572d1a89117cf7d425e81c12 + 311 + + 1997-09-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 507537000 + + Landlord + + fe10fe62872341bc0e0bf8cbcd50b188 + Deposit + 1st, last months' ren + n + 200000/100 + 200000/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + d98f1bc7bc8d4f8cf69944944ec90d0b + Deposit + 1st, last months' ren + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 3c5df0fc4b2353c26b749a562ff45da0 + 312 + + 1997-09-08 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 512414000 + + Travel + + b0871ffd76d7a78053cfa8a3e144a78b + airfare + n + 38000/100 + 38000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3b3c584dca23f23914c35fadd63a8aea + airfare + n + -38000/100 + -38000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0f11a5061061f6a059832bcbdee6c9f1 + 314 + + 1997-09-25 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 518612000 + + Landlord + + f7fbc52fded04834e27efd501c61862b + Oct. + n + 36747/100 + 36747/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + e021b4e03cb5906d40e394ca9002eea7 + Oct. + n + -36747/100 + -36747/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6041c068d720a761474c534018da0713 + 313 + + 1997-09-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 522918000 + + C + + a719c38c3700ff6117c374337bdc2c4a + n + 28648/100 + 28648/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cd0020e3d51b6072f17ad6851cf978fb + n + -28648/100 + -28648/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f97e362e0dfdc735422be36d7b9d7b80 + + 1997-10-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 527472000 + + Boss2 + + a21fe67963e462b661eea725790f4358 + n + -92689/100 + -92689/100 + 4da6e3f697287c126a6827efd63a0b43 + + + bc46fc199164249dee7b8aaf3abd3815 + n + 92689/100 + 92689/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 5c64c9ddf9891a5e755dcfca9296d121 + 315 + + 1997-10-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 531555000 + + Power Co. + + ac217272a15847f7672bc1a63e9dda93 + n + 2247/100 + 2247/100 + 92b05cc5070282b02b05e60f161a5882 + + + 8bdbdca3540791a6bbe1798b3200b4cc + n + -2247/100 + -2247/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f52ea1261340b682e6451bec65a87e78 + 316 + + 1997-10-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 538809000 + + City of + + f3e66f46590f21fd1d7bd55bc3376479 + Parking + n + 2000/100 + 2000/100 + ee3d0e82c9b191091e61d4d1bc8da9f3 + + + 404ae482236ee576a13fc7d2704580f6 + Parking + n + -2000/100 + -2000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 1e1be3d06dd61a7c14a2e73af8bd3a6c + + 1997-10-17 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 542802000 + + Boss2 + + 509b51caa99fcc7dc819dcc23aa1d484 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ed4d99af4e28874dce4fb4b122353361 + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 02cd8b554862aa8af1d4594b6b01b026 + 317 + + 1997-10-17 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 548608000 + + C + + 5e880cfa5a71fd8a7b72e14e8a74959e + n + 122723/100 + 122723/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7334a9bd2e1f43683abf4dd3e3fcb5e5 + n + -122723/100 + -122723/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 8dbb15e8d691297e6841ba2d2876e5ac + 318 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 552892000 + + Pacific Bell + + e520d308634b5dea9492b09a30846358 + n + 7730/100 + 7730/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 00371dbe56093972affedc9cec009c29 + n + -7730/100 + -7730/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 60d4d5e2f751685ed5724d5727f5a91e + 319 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 565974000 + + CO + + 8d77b8ff136a4545ba248e0092ff9062 + n + 11700/100 + 11700/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + abd01fc5453475dbefbcb6434cc1791a + n + -11700/100 + -11700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 9ca3e3f01216b2b94a7799c38fb3a02e + 320 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 570461000 + + Insurance Co. + + 5763774ccefd5fff2719f74e8b26e025 + 25% + n + 7150/100 + 7150/100 + 73f01092a778ac5f25d1f95c1f34a6eb + + + 71052afe4f4cd8910e1c39262f0b278e + 25% + n + -7150/100 + -7150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2c446631de5c84d03c1df0a840516758 + 321 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 577093000 + + Landlord + + 5d1c4bc1a11f7130efd76f71096ef4c8 + n + 100000/100 + 100000/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 5e0e808e3d229d9ce9d49cbd3d4e63da + n + -100000/100 + -100000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 0b32b6d2a14a76cb172cea6771c081db + + 1997-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 581233000 + + Boss2 + + a3cf2af5940cca7a7c23dce67d67133e + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f12ae1807326c9256821c185cdb812ef + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 228d18949e04c7d8820e022b60afd638 + 322 + + 1997-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 586006000 + + AUC + + 76eba388cfd642295c56834898acde6f + n + 159/100 + 159/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2dcb882d3d6013b5a084d457052794eb + n + -159/100 + -159/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bcc55c52b9a3c36558b6c1ec8427c373 + 323 + + 1997-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 590257000 + + Power Co. + + 89cec80f045ca971ca32da47398cf991 + n + 4524/100 + 4524/100 + 92b05cc5070282b02b05e60f161a5882 + + + f4a77f39d221ce4f3d76341bce66ab21 + n + -4524/100 + -4524/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 2e2566816e30bf361b4a3cb151234882 + 324 + + 1997-11-05 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 597900000 + + Robo + + 4c5ce317a7640bd664a4af7d96e5e29a + n + 9023/100 + 9023/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a93bb03a28013bc647f6125aad181005 + n + -9023/100 + -9023/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f49d9f78393641206738d2009a602dd7 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 602860000 + + Boss2 + + 17244e00aa18082766409004e8cc13b2 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 51d932e9c4bfaf4b17662c6efedfed24 + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + f28b7923a79d20db9c983c8cb5777c63 + 326 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 608886000 + + C + + 27191c314877b98b85093b501e1f29c6 + n + 170733/100 + 170733/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3e1ed49cb0f18791c7ce77ecfb95ce53 + n + -170733/100 + -170733/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 69dfd956e9799ef1ffceb28152b58d6b + 327 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 613282000 + + APSR + + 874717c1496ffa8f1cf160991eb13531 + n + 5000/100 + 5000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6cbc1e994b4b860f1dda727fc3b4a3db + n + -5000/100 + -5000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d30aba4cfda217f78d90e800fb9c158f + 325 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 619988000 + + CO + + 85f3a0aede095cf737a8ae417d46485d + n + 11600/100 + 11600/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3dc64482623c97ead17257baa9a38d6d + n + -11600/100 + -11600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 573e1fa279f8cd5b922103290dc8f00b + 328 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 629870000 + + Pacific Bell + + ae3f61d441584e38b2de42b4e5191551 + n + 22798/100 + 22798/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 9d30ac4e1a12b31eb67af07c583f2c3f + n + -22798/100 + -22798/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + fa7ee38cc9df47a4140fd81164198149 + 329 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 636357000 + + Landlord + + 5d718e1b3a3d3a3edb45b7dbcdb0a31d + Dec. + n + 71612/100 + 71612/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fa28aae14d88434c73bca0b747f4457f + Dec. + n + -71612/100 + -71612/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 6872d489f35eeadc610500711cee3fe8 + + 1997-11-26 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 640787000 + + Boss2 + + 1b853eb5535448f95164026e0bdd5df8 + n + -92689/100 + -92689/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 6bf8ab13a9d56a262bbbe0d522bd756e + n + 92689/100 + 92689/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + bbb8f3eaf2cf94336ceb081c70723eba + 330 + + 1997-11-26 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 645435000 + + Travel + + c7a56ac15188ac28a9ec791902316365 + n + 20200/100 + 20200/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6540770c085f0187308121c78ea8a300 + n + -20200/100 + -20200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + b9ac8690528e41fbb7576df639a9a86e + + 1997-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 649666000 + + C + + 90cd445c80e9ba7357dac5dc2051025b + n + -11205/100 + -11205/100 + fd1d2d2d58ceefc149f572a1e6936cec + + + 38d1297fddff33666e00dadae504c0fa + n + 11205/100 + 11205/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 841ded9d33426c92ffc9feb57fab49f4 + + 1997-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 653723000 + + Insurance + + 734505c5ef26be30613f0994f0db187c + n + -8940/100 + -8940/100 + c1c71598e096d9ab5565f096db36ed59 + + + a766404f0ba54d9f2a38fa0461856f4a + n + 8940/100 + 8940/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + 75b0b4d236d5ed90421f81362f729f40 + + 1997-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 668608000 + + Power Co. + + 2cbe654e960839d11f7aef72ecf58024 + n + 3647/100 + 3647/100 + 92b05cc5070282b02b05e60f161a5882 + + + b9c1d5913ee35de931a0e6b1bc930747 + n + -3647/100 + -3647/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + d8dcacdbae5ceda6e986716a8127e946 + 331 + + 1997-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 679027000 + + Robo + + de580c914d042b14ad9086ada2eaf05f + n + 30476/100 + 30476/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3e63f35f3cac812b94781a890385f80d + n + -30476/100 + -30476/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + dd0036886d2de3f89b0a1c5105f15b88 + + 1997-12-12 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 683306000 + + Boss2 + + 8c768f341ac8a19bfd74e68348a509c8 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 64b19552beeb1d512a26abd53574702f + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml1/pricedb1.gml b/src/backend/file/test/test-files/xml1/pricedb1.gml new file mode 100644 index 0000000000..706704bba2 --- /dev/null +++ b/src/backend/file/test/test-files/xml1/pricedb1.gml @@ -0,0 +1,5361 @@ + + + 1 + + + + AMEX + stk + Stock + 100 + + + + + NASDAQ + ANDN + Andover.net Inc + 034318-10-5 + 32 + + + + + NASDAQ + CORL + Corel Corp + 32 + + + + + NASDAQ + EGRP + E*Trade Group Inc + 32 + + + + + NASDAQ + GNSS + Genesis Microchip Inc + 371933-10-2 + 32 + + + + + NASDAQ + LNX + VA Linux + 100 + + + + + NASDAQ + RHAT + Red Hat Inc + 32 + + + + + NYSE + AMD + Advanced Micro Devices Inc + 007903-10-7 + 32 + + + + + NYSE + DIS + Walt Disney Company + 254687-10-6 + 32 + + + + + NYSE + MAT + Mattel Incorporated + 577081-10-2 + 32 + + + + + NYSE + SGI + Silicon Graphics NEW9/86 + 827056-10-2 + 32 + + + + + NYSE + T + AT&T Corp + 32 + + + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 286900000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 287000000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 279100000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 180000000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 179900000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 404000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 403000000/100000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 224000000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 223400000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/.cvsignore b/src/backend/file/test/test-files/xml2/.cvsignore new file mode 100644 index 0000000000..befaf9a4e4 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/.cvsignore @@ -0,0 +1,6 @@ +*.LNK +*.LCK +*.xac +*.log +Makefile +Makefile.in diff --git a/src/backend/file/test/test-files/xml2/Makefile.am b/src/backend/file/test/test-files/xml2/Makefile.am new file mode 100644 index 0000000000..600245abe7 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/Makefile.am @@ -0,0 +1,15 @@ +EXTRA_DIST = \ + Money95bank_fr.gml2 \ + Money95invst.gml2 \ + Money95mutual.gml2 \ + Money95stocks.gml2 \ + abc.gml2 \ + abcall.gml2 \ + carols-data-file.gml2 \ + cbb-export.gml2 \ + conrads-file.gml2 \ + every.gml2 \ + goonies-file.gml2 \ + hierachical-data-file.gml2 \ + ms-money.gml2 \ + pricedb1.gml2 diff --git a/src/backend/file/test/test-files/xml2/Money95bank_fr.gml2 b/src/backend/file/test/test-files/xml2/Money95bank_fr.gml2 new file mode 100644 index 0000000000..01901df52a --- /dev/null +++ b/src/backend/file/test/test-files/xml2/Money95bank_fr.gml2 @@ -0,0 +1,4862 @@ + + +52 +143 + + Compte courant + de3be9d4e8f598584db381c56092f351 + BANK + + ISO4217 + USD + + 100 + + + Livret bleu + cfb34c39585b58904baa3c1f9be9b8c4 + BANK + + ISO4217 + USD + + 100 + + + Salaire + 547e0f4df1fb2f3a124f09cddd90add4 + INCOME + + ISO4217 + USD + + 100 + + + Primes + 4840ebbf3d52f81ad87acd6f79b4cb6d + INCOME + + ISO4217 + USD + + 100 + 547e0f4df1fb2f3a124f09cddd90add4 + + + Salaire net + 6de38f0a8881dd2368610d32363fb463 + INCOME + + ISO4217 + USD + + 100 + 547e0f4df1fb2f3a124f09cddd90add4 + + + Alimentation + fb45010dd73162faf7870d23451773e7 + EXPENSE + + ISO4217 + USD + + 100 + + + Epicerie + 63ab8d5de094c6ac7c11ae06645ea667 + EXPENSE + + ISO4217 + USD + + 100 + fb45010dd73162faf7870d23451773e7 + + + Restaurant + b9e482629dfadf0675facd9bbf76d4f3 + EXPENSE + + ISO4217 + USD + + 100 + fb45010dd73162faf7870d23451773e7 + + + Assurance + 24e0d1cb0af579d19129ec79f16f9205 + EXPENSE + + ISO4217 + USD + + 100 + + + Automobile + e89232e4cdd3a66a5c3b229cea2d0fda + EXPENSE + + ISO4217 + USD + + 100 + 24e0d1cb0af579d19129ec79f16f9205 + + + Multi-risques habitation + 472918bd0bf48e41f507878041efcb4d + EXPENSE + + ISO4217 + USD + + 100 + 24e0d1cb0af579d19129ec79f16f9205 + + + Automobile + 343f5c0ccf4c7a3d54443ece59073d4c + EXPENSE + + ISO4217 + USD + + 100 + + + Crédit auto + 56c0e0eae313a1804d8d1183166a34af + EXPENSE + + ISO4217 + USD + + 100 + 343f5c0ccf4c7a3d54443ece59073d4c + + + Essence + b5ff22c2b91ca04c20a36782d9c750cc + EXPENSE + + ISO4217 + USD + + 100 + 343f5c0ccf4c7a3d54443ece59073d4c + + + Cadeaux + 324d517fa7427163088ed8a2422b4943 + EXPENSE + + ISO4217 + USD + + 100 + + + Divers + d9f9dda3d1a61bd15b3b4c67b40c2769 + EXPENSE + + ISO4217 + USD + + 100 + + + Fournitures diverses + cbfd18621567322c77b9a5b3d6aa3a49 + EXPENSE + + ISO4217 + USD + + 100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + Déplacements prof. + 3af7ef0f555aa2a41d75d034c6afd436 + EXPENSE + + ISO4217 + USD + + 100 + + + Frais de transport + 96f0ca2b62ae6909cac058d1b876f6ef + EXPENSE + + ISO4217 + USD + + 100 + 3af7ef0f555aa2a41d75d034c6afd436 + + + Frais bancaires + 011ba398b7c38291d50cd10de44d4710 + EXPENSE + + ISO4217 + USD + + 100 + + + Personnels + ef0041623a6b317860e84b847af785c7 + EXPENSE + + ISO4217 + USD + + 100 + 011ba398b7c38291d50cd10de44d4710 + + + Frais financiers + e6501ba2005ac400866b117379443af3 + EXPENSE + + ISO4217 + USD + + 100 + + + Autres frais + a673b6830d9fdc782ed408168f6b4f06 + EXPENSE + + ISO4217 + USD + + 100 + e6501ba2005ac400866b117379443af3 + + + Habillement + 674e7f3ba414c8c31b93282247b04213 + EXPENSE + + ISO4217 + USD + + 100 + + + Impôts + 0a5c854c367926d4ce7ffaa60f99a85a + EXPENSE + + ISO4217 + USD + + 100 + + + Impôts sur le revenu + 0a5d0546390d60dab623114e6f136d7a + EXPENSE + + ISO4217 + USD + + 100 + 0a5c854c367926d4ce7ffaa60f99a85a + + + Logement + 436e114c09ccaa489be81be1a24f1656 + EXPENSE + + ISO4217 + USD + + 100 + + + Loyer + 779db6be3d2098d0a2561322f43612c9 + EXPENSE + + ISO4217 + USD + + 100 + 436e114c09ccaa489be81be1a24f1656 + + + Loisirs + ae47cf420aa54ba58fb1906b4edba98f + EXPENSE + + ISO4217 + USD + + 100 + + + Canal Plus-Câble + 6a2a8fed6fbad778df8a5292148d1582 + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Cinéma-Théâtre + b2a4e65fd87146b8199f46c31fa215f1 + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Disques-cassettes + 52a3df54b9e7fb80b22e64a2572a89bb + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Equipement + d7620d56c56e8b2cb0e052411f12cd0a + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Livres-Journaux + 6406d28576114d95f1a6d9561a0b65e3 + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Photographie + 9c0f50a450219f9275d7c4ae3b3cbaa9 + EXPENSE + + ISO4217 + USD + + 100 + ae47cf420aa54ba58fb1906b4edba98f + + + Maison + a648b21f385e784fbe2b26cb3f718a79 + EXPENSE + + ISO4217 + USD + + 100 + + + Chauffage + d04143b5e1486b50f154614b3369ba9c + EXPENSE + + ISO4217 + USD + + 100 + a648b21f385e784fbe2b26cb3f718a79 + + + Electricité + a74cdda295ca3f404ca97a5e94a564c3 + EXPENSE + + ISO4217 + USD + + 100 + a648b21f385e784fbe2b26cb3f718a79 + + + Téléphone + 3a6503c7c577f1beb48a620e905b207d + EXPENSE + + ISO4217 + USD + + 100 + a648b21f385e784fbe2b26cb3f718a79 + + + Mobilier + 8f5104499ca8138b3c48f5c900d7b285 + EXPENSE + + ISO4217 + USD + + 100 + + + Cuisine-Salle de bains + d0a283d1c384e5ee67f2135f308688bb + EXPENSE + + ISO4217 + USD + + 100 + 8f5104499ca8138b3c48f5c900d7b285 + + + Eclairage + 11f39397fe9ff09741bb4d9530b21945 + EXPENSE + + ISO4217 + USD + + 100 + 8f5104499ca8138b3c48f5c900d7b285 + + + Electro-ménager + 3b925233706cf676b2e8f40054f34a68 + EXPENSE + + ISO4217 + USD + + 100 + 8f5104499ca8138b3c48f5c900d7b285 + + + Santé + 1c3053f62d72017f9faacec828e3b874 + EXPENSE + + ISO4217 + USD + + 100 + + + Dentiste + 5816cdbc45a11a5747f7ca286550c73a + EXPENSE + + ISO4217 + USD + + 100 + 1c3053f62d72017f9faacec828e3b874 + + + Ordonnances + 672b9edafeae9eb5c17316688678ee3d + EXPENSE + + ISO4217 + USD + + 100 + 1c3053f62d72017f9faacec828e3b874 + + + Soins personnels + 5d9afede4f8d14de29b0f64ebd23a649 + EXPENSE + + ISO4217 + USD + + 100 + + + Coiffeur + 1e52527b3d343c4719a265a454753df7 + EXPENSE + + ISO4217 + USD + + 100 + 5d9afede4f8d14de29b0f64ebd23a649 + + + Vacances + 37563222f8bfa2ef6edb653a3b492d0b + EXPENSE + + ISO4217 + USD + + 100 + + + Devises + 13e72266b7b88c8bb23d747dbd3ebd23 + EXPENSE + + ISO4217 + USD + + 100 + 37563222f8bfa2ef6edb653a3b492d0b + + + Voyage + 592d53a1ecb323212d3e1da50239473f + EXPENSE + + ISO4217 + USD + + 100 + 37563222f8bfa2ef6edb653a3b492d0b + + + Retained Earnings + afe841ab5436faa629103cfbb93c6a74 + EQUITY + + ISO4217 + USD + + 100 + + + 9643f159a0522e203df526c2125ccdd4 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 167565000 + + Opening Balance + + + cb07c0c9643bbb7e16743e26928ccb18 + n + -576236/100 + -576236/100 + afe841ab5436faa629103cfbb93c6a74 + + + b801cbac54167138bf1830bdfe2796ad + y + 576236/100 + 576236/100 + de3be9d4e8f598584db381c56092f351 + + + + + ed5de8fcc01dc81be4c931546ed28b93 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 183423000 + + Canal Satellite + + + 174946258a987b2006dc2d9ecfeda659 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + cce41a8d7fb5cdd0245bf1ef68cebcba + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + b1ca331fcc284e01738c702211844ddb + + 1995-01-03 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 186234000 + + Cash + + + 264d351fb20bc1ad062a668d8f664b37 + n + 35700/100 + 35700/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 660500d26e458892526029eeac2c205e + Disquettes + n + 7500/100 + 7500/100 + 52a3df54b9e7fb80b22e64a2572a89bb + + + 6094e7577fc4d00d36ef503585c14aeb + n + 6800/100 + 6800/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 5c8668fe8f35fbd275c83f900eccafe1 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 58a662ebe98a022355d07b86f13ad55b + 6351 + + 1995-01-05 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 188671000 + + MACIF + + + 3b0948d446002b8982704b31c260be0e + Assurance appartement/vie + n + 83761/100 + 83761/100 + 472918bd0bf48e41f507878041efcb4d + + + d097d21a2c40065bb839c77f083edc3e + Assurance appartement/vie + y + -83761/100 + -83761/100 + de3be9d4e8f598584db381c56092f351 + + + + + 067bfaa1146c6a98dc32f18c8deeea41 + + 1995-01-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 203492000 + + E.D.F. + + + f8cd0aa3f9dcee3ff01935dfffad0c38 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + a91163ada8711c702b55888636dd42b4 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 1892990631606792b4db6cb71caf4a5d + + 1995-01-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 205833000 + + Employeur + + + 111dd486387133db464d5c39592bea71 + Prime de fin d'année + n + -400000/100 + -400000/100 + 4840ebbf3d52f81ad87acd6f79b4cb6d + + + accbf5fbf4804eae2935da86449e2a34 + Prime de fin d'année + y + 400000/100 + 400000/100 + de3be9d4e8f598584db381c56092f351 + + + + + d82af5e8d601582abbc4129959065253 + 6352 + + 1995-01-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 208154000 + + Intermarché + + + a7bc6259cfc9b39e77c6d6b410ec11d9 + n + 25650/100 + 25650/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 5d6040d6929390f59e7ed3ce011fb2e9 + y + -25650/100 + -25650/100 + de3be9d4e8f598584db381c56092f351 + + + + + df17330745d5a6e5052e60b53eee27aa + 6353 + + 1995-01-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 210949000 + + Propriétaire + + + aa083e6f07b56377db5d645ecef0d0c2 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 86f7092a06e6746459016860ab8678a9 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 745b3a8912254f8573b35c5c83f25170 + + 1995-01-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 213577000 + + France Télécom + + + e251d07209a3e92ff77b78eb5fe7b5dd + n + 34225/100 + 34225/100 + 3a6503c7c577f1beb48a620e905b207d + + + 460defb163ef958152d809755884120f + y + -34225/100 + -34225/100 + de3be9d4e8f598584db381c56092f351 + + + + + 6d10f67b15184edc013326d5ea6fa77c + + 1995-01-18 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 215972000 + + Cash + + + d461e06ec5d2a570535441d3b93a2cb5 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + ef030f9bc687bd4da2ba4d5633429dfb + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 96b32acde3ad762189dcd1d50a34bcd4 + 6354 + + 1995-01-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 218347000 + + RATP + + + 57f446c0615ddadb81acd6da5c9c1164 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + d4d8ce1b7f8d3201464f7aa8ee1201e0 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 0265712bd16817e7e4b32a69831f80d6 + + 1995-01-24 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 221853000 + + Cash + + + 200cfdd593539c6dcc5b294d0e9e0687 + Retrait distributeur + n + 25000/100 + 25000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 03b5e2bbba407adb80d9a76b4f514792 + Retrait distributeur + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 99883512582728a299b53a30a70fd22a + + 1995-01-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 224353000 + + Employeur + + + 9e1efea30615ab86e4451725e50a1bbc + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + d1b101b3e5a3b7b4325b6a32af15b820 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + ba3ef8eafa91005c6aafe34992d6c876 + + 1995-01-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 226714000 + + + + + 577b4939e60f5a6d7978ce2ec3096de7 + Economies + n + 250000/100 + 250000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 7bf6cd575f3d4e632a2304fb2fe59327 + Economies + y + -250000/100 + -250000/100 + de3be9d4e8f598584db381c56092f351 + + + + + b466968f727ac90afb88ac2afdef39c1 + + 1995-02-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 229067000 + + Canal Satellite + + + 437027d363ebc37e25c093847cdfacbe + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 70cd6712d436e84f7c94732acd403113 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 8d07b6b5b83036d3665f86b8abe9310e + + 1995-02-02 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 232995000 + + Cash + + + b75eff0b712d13288b6ce7476eb04127 + n + 41600/100 + 41600/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 233de55d9e2ed1fba21854a410c02e43 + n + 8400/100 + 8400/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 7a7a64805120e6cd75071d7779fb5bc9 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + ac9b873ae20a4cb77e2533d27917b1cd + 6355 + + 1995-02-07 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 235421000 + + Restaurant Saint-Paul + + + 004fd03693c3c7880fad5bcc57ef3780 + n + 32700/100 + 32700/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 4a9c571eb8489060a0ec2fcc3af95258 + y + -32700/100 + -32700/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7781b87fc3ee84b2c16a173ae705b8c9 + 6356 + + 1995-02-10 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 237851000 + + Centre des Impôts + + + 6541a71714ce087f2ab837717606d620 + 1er tiers + n + 415869/100 + 415869/100 + 0a5d0546390d60dab623114e6f136d7a + + + fc289b2f702ac718a7ff51714dc3cf3f + 1er tiers + y + -415869/100 + -415869/100 + de3be9d4e8f598584db381c56092f351 + + + + + aed0d7c65a9539e677ad6f612ff6c970 + 6357 + + 1995-02-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 248545000 + + Propriétaire + + + 20f24bcba69db1efa10312d2cba31827 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 001aff4b1b9205f610f08b5191aba0cf + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + f4e84f0e270f573810ee3c81ea8dcb2b + + 1995-02-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 251624000 + + Cash + + + f07b254d6bc44371af9d3ac81f6b8b41 + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + efc203663e7f443a4f28a223d5903204 + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 5710c51ecc97916484217b4c1017d0e8 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 697d53f57fd11d6b05f342fd73e90380 + 6358 + + 1995-02-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 254112000 + + RATP + + + c4d57ee46e92a2321f02c87f5e1e123b + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5589562c40258757028a4b0af3d5fc4d + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + f0859433a7cf73cc85bd680e79596f5e + + 1995-02-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 256503000 + + Employeur + + + 4b3e39d494c3553530523f6f14e3abd5 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 730979124e6b32a5546e825c2b906015 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + b1f807d8d972858334f6b7cd543d7949 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 258906000 + + + + + 15ce8733ce77fc910f4bbc432d5e4546 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 5d25ba0a388a0bde9f65bd0e6d93a37b + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + d385a9795d2853dee693d6027c33d383 + 6359 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 263748000 + + Carrefour + + + b5e893a57342e35d9a4d6bbcc84f2185 + n + 18180/100 + 18180/100 + fb45010dd73162faf7870d23451773e7 + + + 73f6e148bf18fcb1a72cfddd728c4bbe + y + -18180/100 + -18180/100 + de3be9d4e8f598584db381c56092f351 + + + + + 08efefeff498f0a42009b3a46490d7e6 + 6360 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 266339000 + + SNCF + + + 97a54adc68b0b7bcf31305aeb707d92f + n + 59600/100 + 59600/100 + 592d53a1ecb323212d3e1da50239473f + + + 084daa6f396f54c0c7f8c2291720f145 + y + -59600/100 + -59600/100 + de3be9d4e8f598584db381c56092f351 + + + + + 2473301bd952ece04b6280ad3afee778 + + 1995-02-28 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 268792000 + + Cash + + + fd9570528262189fe95a169c78cdd6da + Retrait distributeur + n + 20000/100 + 20000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 61f05a2876395638db92b0e3a97eb32f + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 8301607cbdb90859c1bced0a531e6891 + + 1995-03-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 271678000 + + Canal Satellite + + + 33db282a73377efe06474424e746e706 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + a930bcc474375df088f071415c1275a0 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 6af8c26792ecd6cb00905893997bbe4e + + 1995-03-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 274153000 + + E.D.F. + + + bd73504fafd4568090772d654dca10b7 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + 4a79326b4690055ac6e3e3ef3fffe47d + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 10dadb1570d588282ad318bcbcb1aa85 + 6361 + + 1995-03-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 276654000 + + Propriétaire + + + 953ad1020f5c5671e086505c240cdac1 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + ebc91eec16a7e8cd73e8fd1cc9561693 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + bbfb01e2de3b2d13044ac5d7bf05829b + + 1995-03-14 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 279359000 + + Cash + + + 2b68ac0f310937925d5638c4f558a39f + n + 38600/100 + 38600/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + cc47bcb3cd4d876b12a37cc57202b88f + n + 11400/100 + 11400/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 3829d69956cd099ea858643b0ef650a6 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7c245360fc50657ac97c1665ba1cf7ff + 6362 + + 1995-03-15 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 282341000 + + Senzo Alimentation + + + f7abb8b243600a8bf9d488fe933356c9 + n + 20910/100 + 20910/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 6df85419570d325e30c8480419a90d5f + y + -20910/100 + -20910/100 + de3be9d4e8f598584db381c56092f351 + + + + + d383f0a0676f4ffc80f72b6101c75f67 + + 1995-03-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 284285000 + + France Télécom + + + 3cb2fe62d682065c8e68601e9c436467 + n + 21286/100 + 21286/100 + 3a6503c7c577f1beb48a620e905b207d + + + b8bb75b3ddcb18ffa4e0209c0d8223fe + y + -21286/100 + -21286/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7c3db6a038d2911b42b923b36fa98af7 + 6363 + + 1995-03-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 285984000 + + Interflora + + + 1cc7927b08860218d975045f48204f71 + Pour Hélène... + n + 16000/100 + 16000/100 + 324d517fa7427163088ed8a2422b4943 + + + b726807deceb214465c4a8f462a6c06b + Pour Hélène... + y + -16000/100 + -16000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 54e7a97ba00d52e72ea6b96730afb238 + + 1995-03-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 287674000 + + Cash + + + 24bcc4e7cb201c5471f5a8da93775e80 + Retrait distributeur + n + 15000/100 + 15000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 6265b1aa70523dddea71570cdb023caf + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + f2e2f7531e3eab3d2ae1c2416407e925 + + 1995-03-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 289339000 + + Employeur + + + 470d2554d1c191d6977275af99e17671 + n + -1005390/100 + -1005390/100 + 6de38f0a8881dd2368610d32363fb463 + + + 7ad973a1af2ef78238f4ebe8659d0486 + y + 1005390/100 + 1005390/100 + de3be9d4e8f598584db381c56092f351 + + + + + a27379eaf9cfa31587a4548863eca708 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 292612000 + + + + + b1b72a14fa1cb0cb2fd4d4c919a92287 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 82948fab247b06f8615e0f0726313d04 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + ea88fbe8a0d670ae76b492e47148fce3 + 6365 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 294495000 + + RATP + + + 6b259b9869d9df2d9d8e80216b674d29 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5e6d23c4a962f5722643fd0f50cc0b72 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 55bbe99b34e19dfbba1c9141a8994db2 + 6364 + + 1995-03-30 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 297133000 + + Carrefour + + + 8ea9aab1bbd60804490d106cb8ae7c28 + n + 14665/100 + 14665/100 + d0a283d1c384e5ee67f2135f308688bb + + + 7732d0b3b5d0b5b4cb59d5ffaf386881 + n + 22650/100 + 22650/100 + 52a3df54b9e7fb80b22e64a2572a89bb + + + 8d119a98eb04a71be2fcba78a1d2ecbc + n + 15500/100 + 15500/100 + 674e7f3ba414c8c31b93282247b04213 + + + 3f852c1e1901a539bda0fec73705c979 + n + 4500/100 + 4500/100 + 11f39397fe9ff09741bb4d9530b21945 + + + 898c600e88ab3a3a9282b3a9e2c7bb68 + n + 11020/100 + 11020/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + bb915f97c631cea641f5da9f13bf74f1 + y + -68335/100 + -68335/100 + de3be9d4e8f598584db381c56092f351 + + + + + 5caacfb0608ec06a252b4709ea524941 + + 1995-03-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 299253000 + + Cash + + + d912e38e2297c4e61f93c7554581357a + n + 34140/100 + 34140/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 8f8560e23cdc283e4645c07289b3e101 + FNAC + n + 5860/100 + 5860/100 + 9c0f50a450219f9275d7c4ae3b3cbaa9 + + + e317b5e73405e5ea7e586aee6cff5190 + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 3d7264cf91c1a92441799415e9e4ebdc + + 1995-04-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 301715000 + + Canal Satellite + + + cba4c8d290e19be9bf37684f6b051422 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 1978e141ce4f4de81d377f87248eb8b6 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 0094a3b4076b9b8112a6d07b05a118ec + + 1995-04-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 303495000 + + Cash + + + 20f153574d00620c9c520c103b1d3fcc + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + fd3730b50f858802aeea0a5337b4e960 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + ef75cabe8325a376f9461e60bc2c87d1 + 6366 + + 1995-04-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 305222000 + + Propriétaire + + + 84a279b745056859c0946bd20f87c1ad + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + e23caec6ee52954c230ed107b74fd436 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 8baad80b1b4ee539229b8d3d8dad2f04 + 6367 + + 1995-04-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 307007000 + + RATP + + + b9ae847bbb5897ec534d39aa1de36bf2 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + a0ec6e318b400889f4cfc2c892a4b293 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 5b2bf3a7f76b84597fb70125790a6a21 + + 1995-04-23 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 309211000 + + Cash + + + 1d309078a0d8d737b3eb896e8eee5994 + n + 16400/100 + 16400/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 8b4868ab051ead7252f824e21a0e2827 + n + 8600/100 + 8600/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + b1d7bd0d2dfa2d268d2a1eb3b0bd01cb + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 75692d6bccefd4a3a3bfd25ca219bc3b + y + -35000/100 + -35000/100 + de3be9d4e8f598584db381c56092f351 + + + + + c04781886177cc54567d43d57e29e51d + + 1995-04-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 314980000 + + Employeur + + + d9b436a4f2a0d1bcf39f585176894fe1 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + a97844b69dfbd92abd7c249d5bcf8c84 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 9e6dc1d3ed796ddf62dcfb7bc624cf99 + + 1995-04-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 317563000 + + + + + f69ff88e9d2f481c21864fda2862dc94 + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 790698573620832ac06cbe0e837d0a2e + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 94e1cae214f99ded0c496e35c6bb195a + + 1995-05-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 322056000 + + Canal Satellite + + + 62d6b24a6dd89e71126346f540b3a1bf + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + e3d33a03fe3980b7b8a0646811955d6b + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + ffa20aa7c8297db7dec4f3d956b72407 + + 1995-05-02 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 324996000 + + Cash + + + 1fafbc8d5ec0e96ba11e784da045dfaf + n + 44700/100 + 44700/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5d4e6f43743464ced237008428383902 + n + 5300/100 + 5300/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + be1f6f192d58c9f62f792edf9da8a3e9 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 9ab90db1ae4a9f94dcbbfe7ebf74e0bc + + 1995-05-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 327622000 + + E.D.F. + + + 5bc5663f9fce7624151c29d5ee75c048 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + d588513b2dcc8c30b6ce10f4bb1816d7 + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + a569d012402a6f678b10baa2a2610413 + + 1995-05-09 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 332010000 + + Cash + + + 11a513b16d10607fc82d2833f7b8c420 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 09d33bb21dba13b02a879ef2fa419389 + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 3b241208a447c421a2f141897e40e8d2 + 6368 + + 1995-05-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 334793000 + + Gaz de France + + + 370bed7d9e1994116e8be4905d524e0e + (exceptionnel) + n + 42500/100 + 42500/100 + d04143b5e1486b50f154614b3369ba9c + + + 90fea1066728a2b88f54ba5f04e6eecf + (exceptionnel) + y + -42500/100 + -42500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 14bcd23a9c272ba01c8790575d93195e + 6369 + + 1995-05-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 337431000 + + Propriétaire + + + 916da32758c23c3d162805030dbd3e97 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 7dbd58662428565ce5ec8bea0ec920e9 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 0bfb10b9c5ab2b53d26f319803b1cf4f + 6370 + + 1995-05-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 340082000 + + Intermarché + + + 92e4346fe5c3ede19898c591030238f7 + n + 29950/100 + 29950/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 4560960472c979dfb7d25bb34aa05563 + y + -29950/100 + -29950/100 + de3be9d4e8f598584db381c56092f351 + + + + + e95766339f5c1c31ecc1870a7f04dac3 + + 1995-05-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 356863000 + + France Télécom + + + f645aea37c114f3a7cd87eebda33430c + n + 40311/100 + 40311/100 + 3a6503c7c577f1beb48a620e905b207d + + + 7f293aa4719537f9936372118b545922 + y + -40311/100 + -40311/100 + de3be9d4e8f598584db381c56092f351 + + + + + d57af6327f7d3b06f6ffe074e768e09d + + 1995-05-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 359576000 + + Cash + + + 2dfb9c4e79e6456fe570adfcd64648b6 + Retrait distributeur + n + 60000/100 + 60000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 33b2b9f9aeadc8a85a6c42a746faf911 + Retrait distributeur + y + -60000/100 + -60000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 9dcdd812d2419a8e6d649c5e95b62d61 + 6371 + + 1995-05-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 362888000 + + La Bonne Franquette + + + 2ce923e0fea7d2116960c051221ab0c4 + n + 11000/100 + 11000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 58d143c96f80044cdd255587aecc25ac + y + -11000/100 + -11000/100 + de3be9d4e8f598584db381c56092f351 + + + + + fe95baf6d4e15b865e526720ec21d688 + + 1995-05-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 365525000 + + Employeur + + + d30fcdbc8e23f08100a5b5ee38146ad9 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 320d4de22b3d7600a8f653844eaf8b6c + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 49734566504a7358ab35af1ed41244e0 + + 1995-05-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 368171000 + + + + + 4c42a427d59303ec20b550763a62d27a + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 19d23b24962bce9128a2e995d704d630 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 93fd47f496bf5289b08d7e77c6818dc6 + 6372 + + 1995-05-29 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 372900000 + + RATP + + + c216911d9abbd9e61e31a93549f4de25 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 8ff6666c809313b1693630047754cc58 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 863bb8cd20e4f3ac904110903fab57db + + 1995-05-30 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 375638000 + + Cash + + + b47245c6af0e3eb5868cacc1169a3a1a + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 9b677ccd6338e0bb5686271e5f78c8d7 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + c29b96b9a0e2e2e7ae1aa00d66252f75 + + 1995-06-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 378315000 + + Canal Satellite + + + d4783ba8f1523668fddfb06a0c22b927 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + b7e1342f782ebfc1b7eb706d5b6dc9a9 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 346de50ad5b9d67e6772420ff190fe06 + 6373 + + 1995-06-02 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 383273000 + + FNAC + + + c192f01c5da803866442b8cb2c54182e + n + 14200/100 + 14200/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 06a3caa978b87934bd38d23470126cda + y + -14200/100 + -14200/100 + de3be9d4e8f598584db381c56092f351 + + + + + 3ee6837c82c4ee32be90497e1ca93e94 + + 1995-06-06 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 386246000 + + Cash + + + c338ff5dca9aeaab3a24a8481786c781 + n + 41545/100 + 41545/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + fde73ab21d1cb68024789890fa99c5c3 + n + 8455/100 + 8455/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 8f1e8302717b2b917b856066a2af9ad8 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + bdb459884de124cc0e4785ce061199f1 + 6375 + + 1995-06-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 389039000 + + Centre des Impôts + + + bcd1f96e743a3159b102da59b0b9c9d0 + 2ème tiers + n + 415869/100 + 415869/100 + 0a5d0546390d60dab623114e6f136d7a + + + 54fd36753ee2647200e77958947777d3 + 2ème tiers + y + -415869/100 + -415869/100 + de3be9d4e8f598584db381c56092f351 + + + + + 6e6259844ab3bf7628dd1b629f569161 + 6376 + + 1995-06-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 398857000 + + Gaz de France + + + 0c17a92efb7bff44bf8a49f68a9e4359 + (exceptionnel) + n + 16500/100 + 16500/100 + d04143b5e1486b50f154614b3369ba9c + + + 2d37f8b31aa19b02674a9bbba370eadb + (exceptionnel) + y + -16500/100 + -16500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 357a6578f4bc97601f789a994956b651 + + 1995-06-11 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 402216000 + + Cash + + + 03c31f060dfff6c13793d4f7fe0cb44d + Retrait distributeur + n + 30000/100 + 30000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 259868bd3d6147b4be088be544e58f87 + Retrait distributeur + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + c2fa0f42fc76499c281e258c57d027c6 + 6378 + + 1995-06-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 405222000 + + Propriétaire + + + 31bf13f3c9f965700690600ffd1df95f + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + d97f45cdf496746bc276090c515937d4 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 5b0f8e066bc92a2f7f25ed54c8da7ca6 + + 1995-06-20 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 407965000 + + Cash + + + 42237f22921e089ab2782688dd33dc4f + Crêperie + n + 15000/100 + 15000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 69eb2af803222be1dd3492475958d954 + Crêperie + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 1edabfb6b2a1211a7b7a9a69bf7bf070 + 6380 + + 1995-06-20 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 413702000 + + RATP + + + 25e24b78489a62196577b6cd1b3c7900 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 9095cf299d9101ddb91d4aab1410a857 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 28bc1c801c6c0aa16bb1bdcce27b5c1b + 6379 + + 1995-06-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 416534000 + + Nasa Electronics + + + 1ab86e50ce8baefc233d2686c8dd1682 + Nouvelles enceintes + n + 184900/100 + 184900/100 + 3b925233706cf676b2e8f40054f34a68 + + + 4d03eb90f23e6efed5c74930e74284d0 + Nouvelles enceintes + y + -184900/100 + -184900/100 + de3be9d4e8f598584db381c56092f351 + + + + + d0ac192ea8d1aea0906d5c4779dc2290 + + 1995-06-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 419365000 + + Employeur + + + f35b431be099a4376bc9cb0e4b19c403 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 086d39be8ee372db1e748c743afd656b + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + dfeaee9b9858f158bfa4cfa2fb82c082 + + 1995-06-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 422808000 + + + + + fbbf76647076be608fd7c8bc634a8dcb + Economies + n + 300000/100 + 300000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 31d2238fa846633700370ba9a2d474d8 + Economies + y + -300000/100 + -300000/100 + de3be9d4e8f598584db381c56092f351 + + + + + dc0ba8106381f550322e26cffdf7b1d5 + + 1995-07-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 425562000 + + Canal Satellite + + + a4d8ec360fe4b552773cbd66963689a2 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + bc8ba7ca4d6d8c9a01615e986bde6c55 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + d721c6fb45b9fb1710fbd4a13fc8fccd + + 1995-07-04 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 428365000 + + Cash + + + a2f3f754416e402441c040881b7b0f8f + Retrait distributeur + n + 30000/100 + 30000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5b25ddc23c27024cfb8ada402a1a4e00 + Retrait distributeur + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + ed14be91c46bcd7d880da6b157276cc4 + 6381 + + 1995-07-07 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 432394000 + + U.G.C. + + + e6e075097d0d4ff6d64829848fcf243f + Carte UGC 10 places + n + 38000/100 + 38000/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 2f20797ab29e0537165d4947ed89dd17 + Carte UGC 10 places + y + -38000/100 + -38000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 66b5c99f72b1be0ba9426d38e076f8d7 + + 1995-07-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 435165000 + + E.D.F. + + + 1f0cb5a12dcdae0ce28f7ca3875b47a7 + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + 4dc05332a84abd4c691fc33cf1e7a88c + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 8e0aca938ddc76a9ee590f6075c84eee + 6382 + + 1995-07-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 437958000 + + Propriétaire + + + fca544a05f29062d58ccb9cb71a078e5 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 66c92335291df89b8a7a6b09a391a3f1 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 1e2fb202b6ba42aed5d81e456215986d + 6383 + + 1995-07-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 442987000 + + Gaz de France + + + 79913dc5716fe5f3942c6831bb1a0240 + (exceptionnel) + n + 16500/100 + 16500/100 + d04143b5e1486b50f154614b3369ba9c + + + 94689fc4c2b537c199edc5128c2805a8 + (exceptionnel) + y + -16500/100 + -16500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 2a5d5f33fd190f683e2249cbb41fd601 + + 1995-07-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 445826000 + + France Télécom + + + a40615dc6726c1b80fff5d1dea7926af + n + 35977/100 + 35977/100 + 3a6503c7c577f1beb48a620e905b207d + + + 84f2e5011ec4b3ac339435dfa22b3c20 + y + -35977/100 + -35977/100 + de3be9d4e8f598584db381c56092f351 + + + + + 07d5f8168f78782b53a78e587e4b3baa + + 1995-07-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 448887000 + + Cash + + + 4ade33c9d2f62b848fe74e285d3ce043 + n + 46535/100 + 46535/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + ab890532f750a21eadd9334a8d1fefd6 + n + 13465/100 + 13465/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 8de059eb363f9235196f2bb3209285c9 + y + -60000/100 + -60000/100 + de3be9d4e8f598584db381c56092f351 + + + + + cf0f388ab6e2e89c4dc39a2ff142e35f + 6384 + + 1995-07-21 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 453674000 + + RATP + + + d7ee8ee70edfb170bee542f02dfca8a5 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 5f19d59b55876014b745dc2e71650bf5 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 82a2af377157b6ca5c98651469611526 + + 1995-07-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 456495000 + + Employeur + + + 86c0122071730b21f67e407a7d1e96f1 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + c80b69ab4998dbd95168893af0fdfb8a + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 26049300752338235172eea036ac4f6c + + 1995-07-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 459319000 + + Cash + + + 1fd9b0d80a0811bd367f3b1bd5cba11e + Soirée entre amis + n + 25000/100 + 25000/100 + d7620d56c56e8b2cb0e052411f12cd0a + + + 0f2fe8868576abf6d57f5ec055971fb3 + Soirée entre amis + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + f4b99fc3e1cf46731d530696a44fc404 + + 1995-07-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 462946000 + + + + + 9b6ac2304426d8330553cca37ddb3665 + Economies + n + 250000/100 + 250000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 0911a2bef06dfa1ac942e8541ad9bb01 + Economies + y + -250000/100 + -250000/100 + de3be9d4e8f598584db381c56092f351 + + + + + fba574e0bac22371b60ce84a97280dc8 + + 1995-08-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 466061000 + + Crédit Mutuel + + + 69822db9b83e409a2d79d5e3c4c14b5a + Intérêts + n + 14927/100 + 14927/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 2fa9c46c5aea8e797ef466a0ef842b0b + Capital + n + 406387/100 + 406387/100 + 56c0e0eae313a1804d8d1183166a34af + + + ee1ade23ed8dfe4ab537448bbb79baae + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + 743cac2d56954e70925eff5a778d80df + + 1995-08-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 468931000 + + Canal Satellite + + + 062fc3e14dbb8c115f857314248b18c6 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + da7196d3f0ac3870c85e8bae4ad07298 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + a79f558531f48fedb938dcb597848ef5 + + 1995-08-03 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 473481000 + + Cash + + + 5b2fa71de1503f676c800de0ee973418 + n + 35000/100 + 35000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 83e6d6c5d3d5bf7a960e64eac7acb2e4 + n + 15000/100 + 15000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 4097ccbec7e71cc1cf713fc6314532c4 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 54777d757317cffd5224c7dd23fdfcd6 + 6353 + + 1995-08-07 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 476473000 + + MACIF + + + 5654afa4b117d4ad1943f8dbc94c3439 + Jusqu'au 01/07/96 + n + 46190/100 + 46190/100 + e89232e4cdd3a66a5c3b229cea2d0fda + + + 806ccc0a5cd736437cf9afccd375adc6 + Jusqu'au 01/07/96 + y + -46190/100 + -46190/100 + de3be9d4e8f598584db381c56092f351 + + + + + 6513e90a2b2ade9397a40a9884b78531 + + 1995-08-09 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 479386000 + + Cash + + + 6a1e0536b65156f9a86c1a16d71c9308 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + a09753d84046bdf847d554fdfcdf5ea5 + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + fa9d3ab8c2f224b484e44a4b3d598b44 + 6385 + + 1995-08-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 482935000 + + Propriétaire + + + 957eabe77ddbc56b250499b1acb47731 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 05b52f52d833b59c5d55d06135225b44 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 2160bafdee142a1c0cdcf93eb152ac70 + 6386 + + 1995-08-13 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 486845000 + + C & A + + + bf167dc398ff8b93c9c6d205ee5a9e9b + cirage + n + 1300/100 + 1300/100 + 674e7f3ba414c8c31b93282247b04213 + + + fac17c8b8f8c78946c6627aef406740a + 2 teeshirts + n + 9800/100 + 9800/100 + 674e7f3ba414c8c31b93282247b04213 + + + 019376e03d81025da7a4a888eb17db17 + 2 chemises + n + 28000/100 + 28000/100 + 674e7f3ba414c8c31b93282247b04213 + + + e17adfd5665258fcf5c81253f9ff804b + chaussures + n + 25900/100 + 25900/100 + 674e7f3ba414c8c31b93282247b04213 + + + 3fdf0236efc2f5c4753d98d3917c904a + jeans + n + 19900/100 + 19900/100 + 674e7f3ba414c8c31b93282247b04213 + + + 6e52fb66153dd528c7360c9dee6c19a0 + cirage + y + -84900/100 + -84900/100 + de3be9d4e8f598584db381c56092f351 + + + + + 714a3365c041af7542479ef9eb1571a7 + + 1995-08-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 492331000 + + Cash + + + 0132023af8ac1e9ed9c6bdc5aba128f8 + n + 38200/100 + 38200/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + d0a88693e4b774de96c5351b75aa38e5 + n + 6800/100 + 6800/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + fadaf644365575e2ced10b0de898b198 + y + -45000/100 + -45000/100 + de3be9d4e8f598584db381c56092f351 + + + + + c85c719889cf8ba5e5b674c40534b4ca + 6387 + + 1995-08-22 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 495542000 + + RATP + + + adfb9893a984b24089e309a197d41be3 + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 0c6ac21107bc420d02dae670b4f01603 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 4c1aa5c5cd07ed557472ccbc6b09fbeb + + 1995-08-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 498561000 + + Employeur + + + 72924326be90e638bd35be6689bfa4de + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + dae5f1b1e1e42b23dcc25193a996b0f4 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 23a510b2080b450e71d3eeb66c3b59ba + + 1995-08-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 504389000 + + Cash + + + 2e1cfacc36db51c7381dbe8a6d57225c + n + 1500/100 + 1500/100 + 5816cdbc45a11a5747f7ca286550c73a + + + 95e26a960d5b7b0cabe3a0a1f571d691 + n + 18500/100 + 18500/100 + 672b9edafeae9eb5c17316688678ee3d + + + 6424a65127208e891626161587951e93 + n + 10000/100 + 10000/100 + 1e52527b3d343c4719a265a454753df7 + + + 913472a09814368bd2d4a177b8590bd3 + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + e93bd22645a2463539ff72b0fb002854 + + 1995-08-30 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 507381000 + + Cash + + + db16f55098fe03facc4df5416cef016d + Retrait distributeur + n + 20000/100 + 20000/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 0ca18a97407847011f2c92cad272c877 + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 770def13c9521414e8d9e9ff017a8ab6 + + 1995-09-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 511918000 + + Crédit Mutuel + + + 278373bc4ce1a55db5ec05ce41283292 + Intérêts + n + 12828/100 + 12828/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 472ad8358c7eeb4f50a7b79e5802cac2 + Capital + n + 408486/100 + 408486/100 + 56c0e0eae313a1804d8d1183166a34af + + + 8f9f8bccf2658b122b1d0b07ce1e3153 + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + 49a39e961ec0b5cc2fad449908bb676a + + 1995-09-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 514903000 + + Canal Satellite + + + 351b24fedf3917eb147facd9c6bba42d + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + 2972f1d0f6e62c5cfc76e6072a7e94fb + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 335c527135df465c5026c57a5085187a + + 1995-09-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 517817000 + + E.D.F. + + + 5d07ade13fbe84b5ad9c53c58a58484e + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + eec7f6be92c7c26171e5efb9d7f1c5ae + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 3a153e5ad16b57608e0f75c8f353f9be + + 1995-09-08 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 521727000 + + Cash + + + fd75af9f788941a8d22c4915abf3da35 + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + eba6efba5dc1e775b9c9eb9aa2d45eda + n + 10000/100 + 10000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + c21a8d1cb326c5965f17011f78a9bd21 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 553ebcbadf3b4f35116d797149387dac + 6388 + + 1995-09-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 524796000 + + Propriétaire + + + e7e74614eb04d0bcc653fe2adaa318b0 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 3c843176d779815a29cd59ec6cc19046 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + b054d81668877f2f0209094dd37c74b4 + + 1995-09-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 527753000 + + France Télécom + + + 3ed384570b0c557ef846cb6f61888ed1 + n + 34200/100 + 34200/100 + 3a6503c7c577f1beb48a620e905b207d + + + 9d84fb78a9abde4006918f8dc1e55471 + y + -34200/100 + -34200/100 + de3be9d4e8f598584db381c56092f351 + + + + + 9e78c8044b9bd816e9d0b0d1b9714ac3 + + 1995-09-17 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 533919000 + + Cash + + + 6b13c73f807ac67a9c5a7b541e486bab + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 21ac5dd04e3b8d358d297e0c9852f871 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 0c0126f159b22e90d6874ac4d74b3076 + + 1995-09-22 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 537055000 + + Cash + + + ec2d78e0cb9bea8fd8dfe6b921a85cf0 + Retrait distributeur + n + 20000/100 + 20000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + b9d78b411e6c245f671d1e55b7db53e1 + Retrait distributeur + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + bc7261e3e53d6a625791dba52e6cd72a + + 1995-09-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 541242000 + + Employeur + + + 151f292449fb9d5371b9e2f8ca4a5f26 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 150bbfc248bf92cd3dd82d1ea94fb338 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 6709366f4970d47b02225b4126ce2946 + 6389 + + 1995-09-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 544686000 + + RATP + + + 40b6a273d88b4964a67028323ac37d3a + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 02fab5c53bd208e8c159f3c5e5568dab + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 858c8c15d01bb20b175e7511d0a338cc + + 1995-09-29 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 547748000 + + Cash + + + f10d18bb070508000071b2e9943d7417 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 39a06c6cec0ac7bcdea0b1415b20574d + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 4586437067fd9c845c8c76d1f3dbff95 + + 1995-10-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 552274000 + + Crédit Mutuel + + + a91b974f498517b5e062775734d85354 + Intérêts + n + 10717/100 + 10717/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 36e11802ea8c81594d108d18ea4db490 + Capital + n + 410597/100 + 410597/100 + 56c0e0eae313a1804d8d1183166a34af + + + 67bd96955adb2962f330e4c68a71671a + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + dc4df550a92073ab26c373ec4be97395 + + 1995-10-01 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 556896000 + + Canal Satellite + + + 5241622b9755bb9da6b07bf05cdbd551 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + ce39fd24901a23c0eb3340becf1b8583 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 78091133ada4b45030448db72483d18a + + 1995-10-03 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 561884000 + + Cash + + + 2cb6a0b2bb7a4d6f4fb7b0fcd38983da + n + 17500/100 + 17500/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + cf2a801e6ad90b9db4b758c9a970e430 + n + 17500/100 + 17500/100 + cbfd18621567322c77b9a5b3d6aa3a49 + + + c252bf3c6da08b38b410a6e688acf4a6 + y + -35000/100 + -35000/100 + de3be9d4e8f598584db381c56092f351 + + + + + afe9e93d68e876ac57767b055c5dccb5 + + 1995-10-10 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 565406000 + + Cash + + + 78bce048c4a0ee82b2cb05cc8ff67e7a + n + 20800/100 + 20800/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + cd380f8a34e415bd21bb663cc3898304 + n + 4200/100 + 4200/100 + b2a4e65fd87146b8199f46c31fa215f1 + + + 856cf4f80d7c50613e08b1769bdfeab8 + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 2a0e299746191a713346f3d36f7d582e + 6390 + + 1995-10-12 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 568517000 + + Propriétaire + + + f9eca05c03f31aed02ef84b25b12a7b8 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 0f5f34bca78008e13d953c8aa2b48408 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7bbaa9d35599fb3d01fb994077781852 + 6391 + + 1995-10-15 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 573311000 + + Centre des Impôts + + + 96304441c2ea5f99b9315a81239f126e + Dernier tiers + n + 443004/100 + 443004/100 + 0a5d0546390d60dab623114e6f136d7a + + + 14e0efbf413207b06594149f2e98f2cc + Dernier tiers + y + -443004/100 + -443004/100 + de3be9d4e8f598584db381c56092f351 + + + + + a704e168a1dcda16924cd39f49012e78 + + 1995-10-18 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 576614000 + + Cash + + + 42738fe7c187422790b00972b7fbf626 + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + e36277849a566079eafb638d22d57b3a + n + 10000/100 + 10000/100 + 5d9afede4f8d14de29b0f64ebd23a649 + + + 8524d98513827797285fb9d490a7e7c3 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 0fa57dae34554853891a3ad20b1792fc + 6392 + + 1995-10-24 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 579799000 + + RATP + + + 77e7c531693da7b9a44d3977f4c787ab + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 535afb954addaf9c77dfe525ce619807 + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 604b26f5e027d859363fafac298e629a + + 1995-10-25 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 583949000 + + Employeur + + + 49bdd6d7c7e7adcc88629fe6aba7bbe0 + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + a8e825d249adbd268640f158121f6c9b + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 644300b8dd43f4193801505ecc388189 + + 1995-10-26 00:00:00 -0400 + + + 2001-03-20 00:40:27 -0500 + 587324000 + + Cash + + + adb74a8b2b5ddefc6e88704ebd1343a4 + n + 21800/100 + 21800/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 3c839f0eb35c9e96123a88b7b04b4445 + n + 8200/100 + 8200/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + a4c8264ab036d41bcc07b7c4e8b3375c + y + -30000/100 + -30000/100 + de3be9d4e8f598584db381c56092f351 + + + + + bd90ec06cec68c8935a5e054a4f7d591 + + 1995-10-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 592288000 + + Cash + + + 28dc73f87f32cda0234ca8ec7778d2eb + Retrait distributeur + n + 15000/100 + 15000/100 + b9e482629dfadf0675facd9bbf76d4f3 + + + 5e625b1051bc9fb1355cf68d75aff7c2 + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + de35ca9402d2fdf8ba877d70861f4732 + + 1995-11-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 597275000 + + Crédit Mutuel + + + 246a46e75b7459d80770f4403001deaf + Intérêts + n + 8596/100 + 8596/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 498f8c22f1536867cd42ed41eccb2f46 + Capital + n + 412718/100 + 412718/100 + 56c0e0eae313a1804d8d1183166a34af + + + ca766b2283d60321d1deb3c55e4c6dcf + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + 398743bf3c2f7e6dbee6a4f858837dfe + + 1995-11-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 601111000 + + Canal Satellite + + + 26656ca4c8de644db324e84826ae5582 + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + c6bc81b919c8aaa9161f49f584306960 + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 661e393b9e181676766932984f8c7d33 + + 1995-11-06 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 604563000 + + Cash + + + b3937a025ee160ebd563c61d177e4f6f + n + 10000/100 + 10000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 81f60490d84ff12f1f44896a8756d5c5 + Anniversaire Hélène + n + 40000/100 + 40000/100 + 324d517fa7427163088ed8a2422b4943 + + + 7e37e21b544a0f3b6fc7ae6f6baa5890 + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + acaddb2bd6450ae1d37c98b1e6efdac6 + + 1995-11-08 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 607676000 + + E.D.F. + + + 3607632080bd58c5ab11b4d66cf9edbd + n + 20000/100 + 20000/100 + a74cdda295ca3f404ca97a5e94a564c3 + + + e701603fefbe56db6215bc1a1540980d + y + -20000/100 + -20000/100 + de3be9d4e8f598584db381c56092f351 + + + + + ab881f29254f18d36cb1f99249908fbf + + 1995-11-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 612951000 + + + + + 84f80f973bcd0323a10f48f6abc9d4fd + Pour équilibrage + n + -450000/100 + -450000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + a356d43da70a3c0b9db41485f8155fb0 + Pour équilibrage + y + 450000/100 + 450000/100 + de3be9d4e8f598584db381c56092f351 + + + + + df1e7b8eff998e08300f10747786bfc8 + 6393 + + 1995-11-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 616130000 + + Propriétaire + + + 9e7a280f7f3ad8d15c66233a72acd4b3 + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 0e248e8dc6e627250166b28ec6b7b4e6 + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 2c7d5688168cd5e77c63ec5d28ad5ef5 + + 1995-11-14 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 619305000 + + Cash + + + 63cdf3df02dc376d2b841c8092f8d866 + Retrait distributeur + n + 10000/100 + 10000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 5ca3818da015ec9a21c204df6cb94d6b + Retrait distributeur + y + -10000/100 + -10000/100 + de3be9d4e8f598584db381c56092f351 + + + + + c829367e2f2661cb9bfd00429daabd70 + 6394 + + 1995-11-16 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 637291000 + + Toys'R'Us + + + c46d6ecc5eb791fe9fc801288474d7d9 + Cadeaux de Noël juniors + n + 87500/100 + 87500/100 + 324d517fa7427163088ed8a2422b4943 + + + 957173f88373dad1bfb9b71a41870592 + Cadeaux de Noël juniors + y + -87500/100 + -87500/100 + de3be9d4e8f598584db381c56092f351 + + + + + f347eea571aabef74c89e09168c2abe0 + + 1995-11-17 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 647476000 + + France Télécom + + + 3363e39ad18ebc386a755b4f547f30b5 + n + 50525/100 + 50525/100 + 3a6503c7c577f1beb48a620e905b207d + + + 6d65ed937fe8e63897296da9208eb93b + y + -50525/100 + -50525/100 + de3be9d4e8f598584db381c56092f351 + + + + + 553da78ac4e6d1fabff16549250ff3e0 + + 1995-11-20 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 653861000 + + Crédit Mutuel + + + 664dff9f268ca9d0710d7d50c7025050 + Dollars pour vacances à Redmond + n + 150000/100 + 150000/100 + 13e72266b7b88c8bb23d747dbd3ebd23 + + + eb7917c873b0c104acf9c72e91481a2e + Dollars pour vacances à Redmond + y + -150000/100 + -150000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 51a1a9f5090a9dbe8f347f79015f73ce + + 1995-11-21 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 657132000 + + Cash + + + 013003558e580b0575be08cc1e2e8341 + Retrait distributeur + n + 15000/100 + 15000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 9e0e81445f398c6dc7d7f77aa73619a7 + Retrait distributeur + y + -15000/100 + -15000/100 + de3be9d4e8f598584db381c56092f351 + + + + + b1e49deb289a12c6260f0c0eec4a8850 + 6395 + + 1995-11-22 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 661081000 + + RATP + + + 136f103fd3e81bdf19bd7a6f839f745a + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + df788538cd0254139dc90ae93af9ad3a + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + e6729c246af31c6dc1c4cba9aa5a6c98 + + 1995-11-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 664349000 + + Employeur + + + 136441a6f02976dda9f774d3f06bbc0e + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 98d29f5e47c681b521fac8d95da80910 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + ca411b893bcb18140eba6258c737d86c + + 1995-11-28 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 667602000 + + Cash + + + e1e57f8576fc722a72e9b3d02aec8ebc + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + e0bcd23b5ce44eeb2af611a5b025cfa6 + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7a548de962765c14800eca45a6f90523 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 672518000 + + Crédit Mutuel + + + 26dffc4e91d8d02a8c70290444138455 + Intérêts + n + 6463/100 + 6463/100 + a673b6830d9fdc782ed408168f6b4f06 + + + 76144a6506a69f025e515d935d15b645 + Capital + n + 414851/100 + 414851/100 + 56c0e0eae313a1804d8d1183166a34af + + + 330574ff34234aaeb2980a2e97098245 + Intérêts + y + -421314/100 + -421314/100 + de3be9d4e8f598584db381c56092f351 + + + + + f4062fbf5097fbd1cb9a0b10a1917922 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 675778000 + + Canal Satellite + + + e20c9db431732800e34de2c0560132bf + n + 40500/100 + 40500/100 + 6a2a8fed6fbad778df8a5292148d1582 + + + be332f8c39d0184a5a4ba1ee8eb6cede + y + -40500/100 + -40500/100 + de3be9d4e8f598584db381c56092f351 + + + + + b47c4349e3050b9ae28b1e120529349e + 6396 + + 1995-12-04 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 679388000 + + C & A + + + 475ca859036fed847462489d2d5388c2 + n + 10000/100 + 10000/100 + 6406d28576114d95f1a6d9561a0b65e3 + + + 7c67b189a5234e93d1a950050fac338c + n + 15875/100 + 15875/100 + 63ab8d5de094c6ac7c11ae06645ea667 + + + 01219e3ca98d7d972410fcc85373a1d5 + y + -25875/100 + -25875/100 + de3be9d4e8f598584db381c56092f351 + + + + + 28f562c4f190045d1811e9c45cf03399 + + 1995-12-05 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 684337000 + + Cash + + + 5cfd6ce029feedc7f87dc0dfc84edf82 + Retrait distributeur + n + 40000/100 + 40000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 7541783684cc97ca6ac2c5a1840ae0a7 + Retrait distributeur + y + -40000/100 + -40000/100 + de3be9d4e8f598584db381c56092f351 + + + + + d5ff033a68daf33a8ab36479b9cfc562 + 6397 + + 1995-12-12 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 687601000 + + Propriétaire + + + 5f428015626116293b5cd6771243227f + n + 370000/100 + 370000/100 + 779db6be3d2098d0a2561322f43612c9 + + + 1e207243e734316cfb1cff54238d10ed + y + -370000/100 + -370000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 061348767dc2f9f60a7702853c64039e + + 1995-12-15 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 699051000 + + Cash + + + fd082052248f75134ce33c636d3af0b2 + Retrait distributeur + n + 50000/100 + 50000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + eea53c8394466b625affa524b953216c + Retrait distributeur + y + -50000/100 + -50000/100 + de3be9d4e8f598584db381c56092f351 + + + + + 3eb206827dd0099e0d7b4a982ddecf86 + 6398 + + 1995-12-20 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 703136000 + + RATP + + + 60fe4e698107953b96ed4d3770bce33c + Coupon mensuel 4 zones + n + 39500/100 + 39500/100 + 96f0ca2b62ae6909cac058d1b876f6ef + + + 8709e84f1f399b264879c88dd090660b + Coupon mensuel 4 zones + y + -39500/100 + -39500/100 + de3be9d4e8f598584db381c56092f351 + + + + + 7577789ff328119d6ba43ca3db4cd8c6 + + 1995-12-23 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 706639000 + + Cash + + + 4aad18549df1e6489abffc72381d6efc + n + 13000/100 + 13000/100 + d9f9dda3d1a61bd15b3b4c67b40c2769 + + + 217e90e4e3dce1b98618d8834263f3a7 + n + 12000/100 + 12000/100 + b5ff22c2b91ca04c20a36782d9c750cc + + + 7273934f29d6cf8fd66b1d2d7991c381 + y + -25000/100 + -25000/100 + de3be9d4e8f598584db381c56092f351 + + + + + b7a5b462216d49a02221c18ad1bb2bb2 + + 1995-12-25 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 710061000 + + Employeur + + + 02bb2087bc17d3fcef028ce2a121d01b + n + -1135120/100 + -1135120/100 + 6de38f0a8881dd2368610d32363fb463 + + + 00b35b728c22fdd59a27b1d31a620084 + y + 1135120/100 + 1135120/100 + de3be9d4e8f598584db381c56092f351 + + + + + 943398a5d516ccc8384243a8987c1bc1 + + 1995-12-26 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 716695000 + + + + + 560fdf0893f91335de53ed7c5280f8d5 + Economies + n + 350000/100 + 350000/100 + cfb34c39585b58904baa3c1f9be9b8c4 + + + 156c7cf2a5aa1711bc706105eb02b02c + Economies + y + -350000/100 + -350000/100 + de3be9d4e8f598584db381c56092f351 + + + + + cda659ff332c30b5767051f73426c886 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-20 00:40:27 -0500 + 719976000 + + Crédit Mutuel + + + 80b03ef24c38e447349f154d5a0f43e2 + Agios pour découvert du 15/10 au 24/10 + n + 9763/100 + 9763/100 + ef0041623a6b317860e84b847af785c7 + + + 6afa7b7aa4ca5f3eed94ab04cccaf4b1 + Agios pour découvert du 15/10 au 24/10 + y + -9763/100 + -9763/100 + de3be9d4e8f598584db381c56092f351 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/Money95invst.gml2 b/src/backend/file/test/test-files/xml2/Money95invst.gml2 new file mode 100644 index 0000000000..b1e8e9fe50 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/Money95invst.gml2 @@ -0,0 +1,327 @@ + + +3 +10 + + Compte courant + a68387e637bb8e7405bc949764b9aefd + BANK + + ISO4217 + USD + + 100 + + + Livret bleu + cec92cd077aee62305910cfd929cc341 + BANK + + ISO4217 + USD + + 100 + + + Retained Earnings + afed1334dfcdc53865cafe61edbb0fc6 + EQUITY + + ISO4217 + USD + + 100 + + + ad7c592d0603871110acb8f2c7bcd215 + + 1995-01-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 31238000 + + + + + 524f8a36ece0437ba8b27284a2b78e06 + Economies + n + -250000/100 + -250000/100 + a68387e637bb8e7405bc949764b9aefd + + + 4b93c9e41c978f00b3c4e0de5fa2fbef + Economies + y + 250000/100 + 250000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 9c381dc6f595933f06ff11b574333f44 + + 1995-02-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 32417000 + + + + + 85f79dde160ba7f2f021d95d190b34c3 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + 98b2c538910821d9cf37a9bff01ef60b + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 3fd5cdd6a6772412d702124c1a786ef3 + + 1995-03-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 33369000 + + + + + 535b36edb9230c04b575034bde669ea3 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + 249fbfb7601774a1f089f030299c8a3f + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + ebff5d6fbfd69632db47a362789035c0 + + 1995-04-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 34356000 + + + + + 8f559a4b006fd31a238fc1c1819b911e + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + adda51b98341607acccbe48bc1c37dff + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 4d44e44e9b16a58c562e0d938e58a69d + + 1995-05-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 36554000 + + + + + f7ff3dbb314786218f638276f8b3c3a8 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + e8a489904a8a4e684d7054fba8b288f2 + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 328e2319a21e15c8eaac3c5ae9e2f8d7 + + 1995-06-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 37673000 + + + + + 15e631fad619fffe13e291ca187bd7c9 + Economies + n + -300000/100 + -300000/100 + a68387e637bb8e7405bc949764b9aefd + + + d2e699960572bca531413fd4fcd530a3 + Economies + y + 300000/100 + 300000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 2f70aee8552b4929b9009a4cde3f3095 + + 1995-07-26 00:00:00 -0400 + + + 2001-03-26 15:28:38 -0500 + 38685000 + + + + + 33b9ddd3fa6d915ce6d8b8440d4cd1b3 + Economies + n + -250000/100 + -250000/100 + a68387e637bb8e7405bc949764b9aefd + + + 53935088af8824f72ebcb29571443e2f + Economies + y + 250000/100 + 250000/100 + cec92cd077aee62305910cfd929cc341 + + + + + 4564825b74f81412d309a8eb8cc58222 + + 1995-11-12 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 39707000 + + + + + 912aa7c8f0c8c01fdedd4c44ac7c4ade + Pour équilibrage + n + 450000/100 + 450000/100 + a68387e637bb8e7405bc949764b9aefd + + + d8d24b073589acfda00585b67e2a4bf0 + Pour équilibrage + y + -450000/100 + -450000/100 + cec92cd077aee62305910cfd929cc341 + + + + + ec6f0cc19c5651db2c2dc8ff93efe697 + + 1995-12-26 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 40707000 + + + + + 11d0b29b056fc64215dbb37d0dfdd062 + Economies + n + -350000/100 + -350000/100 + a68387e637bb8e7405bc949764b9aefd + + + 20dad7ae612bd303bc2d070bef3604ac + Economies + y + 350000/100 + 350000/100 + cec92cd077aee62305910cfd929cc341 + + + + + f56c0707159f36caabc22df8ac71887a + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:28:38 -0500 + 30261000 + + Opening Balance + + + d20b8eff18aa85f3731145b77f0bc5de + n + -14560800/100 + -14560800/100 + afed1334dfcdc53865cafe61edbb0fc6 + + + 9b4e17c7c367bf37367dda356a7e2670 + y + 14560800/100 + 14560800/100 + cec92cd077aee62305910cfd929cc341 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/Money95mutual.gml2 b/src/backend/file/test/test-files/xml2/Money95mutual.gml2 new file mode 100644 index 0000000000..ae14e81436 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/Money95mutual.gml2 @@ -0,0 +1,168 @@ + + +1 +5 +3 + + NYSE + O-Sicav Plus + O-Sicav Plus + 100000 + + + Livret bleu + 3bcb236af583d5bd7b6e0153fe97e7e3 + BANK + + ISO4217 + FRF + + 100 + + + Money95mfunds fr + 89e091b3489a50957b400a868f101d59 + STOCK + + ISO4217 + FRF + + 100 + + + O-Sicav Plus + e0e954412d6b31dfa1fcbb9937a125b0 + STOCK + + ISO4217 + FRF + + 100 + + NYSE + O-Sicav Plus + + 100000 + 89e091b3489a50957b400a868f101d59 + + + Commissions + 41b9e953585cd5662712d62848e71789 + EXPENSE + + ISO4217 + FRF + + 100 + + + Money95mfunds fr + c7a4746248d0677c6421077833477bba + EXPENSE + + ISO4217 + FRF + + 100 + 41b9e953585cd5662712d62848e71789 + + + 88ed4f76d273256aaa05eab3010731bf + + 1995-07-24 00:00:00 -0400 + + + 2001-03-26 15:30:31 -0500 + 435420000 + + + + + df25dcb351c89a20062a5ea5d294e8e8 + n + 1828080/100 + 6000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + a44971f955fa03a9318fff369962820a + n + -2461820/100 + -2461820/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + 1ec08747892bf80d01ff1dab46ccb150 + n + 633735/100 + 633735/100 + c7a4746248d0677c6421077833477bba + + + + + 21f58d6ddf8e529905db462291963e68 + + 1995-10-08 00:00:00 -0400 + + + 2001-03-26 15:30:31 -0500 + 436816000 + + + + + 30f46d6ea24efb8f57ea386be57370c2 + n + 3051000/100 + 9000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + 15160cb2e5b32864c451842cde8ffcd9 + n + -3254400/100 + -3254400/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + 66a01b46ebec63544ca133efa6706f6b + n + 203400/100 + 203400/100 + c7a4746248d0677c6421077833477bba + + + + + 4cb943c207e102dbc22e5ef829bbc29d + + 1995-12-10 00:00:00 -0500 + + + 2001-03-26 15:30:31 -0500 + 437989000 + + + + + 27a56b13c4d24744f3cbb53329120abc + n + 2053200/100 + 6000000/100000 + e0e954412d6b31dfa1fcbb9937a125b0 + + + 19355bfa2d1208dd144aa7c32de06aa5 + n + -2053200/100 + -2053200/100 + 3bcb236af583d5bd7b6e0153fe97e7e3 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/Money95stocks.gml2 b/src/backend/file/test/test-files/xml2/Money95stocks.gml2 new file mode 100644 index 0000000000..9fa6266622 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/Money95stocks.gml2 @@ -0,0 +1,879 @@ + + +2 +8 +28 + + NYSE + MSFT + Microsoft + 100000 + + + NYSE + USSA + Usinor/Sacilor + 100000 + + + Livret bleu + 21db466b6be8b3f6a3043d0c0316de8c + BANK + + ISO4217 + BRL + + 100 + + + Money95stocks fr + 2a42eb5710ad4ddbf9352f070d603fe2 + STOCK + + ISO4217 + BRL + + 100 + + + Microsoft + c28902afc0e2168dab793b63dbf56e1f + STOCK + + ISO4217 + BRL + + 100 + + NYSE + MSFT + + 100000 + 2a42eb5710ad4ddbf9352f070d603fe2 + + + Usinor/Sacilor + b3955645bed5651123986f415d0e81d6 + STOCK + + ISO4217 + BRL + + 100 + + NYSE + USSA + + 100000 + 2a42eb5710ad4ddbf9352f070d603fe2 + + + Unspecified + 37d287c3550ab2810c386d1b33cc2d0b + INCOME + + ISO4217 + BRL + + 100 + + + Commissions + 5efcfb966ef97810de2fbaaa2b352205 + EXPENSE + + ISO4217 + BRL + + 100 + + + Money95stocks fr + da8e001155343694bd34f6aa248b1c28 + EXPENSE + + ISO4217 + BRL + + 100 + 5efcfb966ef97810de2fbaaa2b352205 + + + Retained Earnings + 1aaa099850fe7a07e2b5ae97f18b9af2 + EQUITY + + ISO4217 + BRL + + 100 + + + 67da2dc62331fb318640aa5a1a3da937 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 563969000 + + + + + b05ab9cccb7addce264e3b5614f2d620 + y + 48210/100 + 363849/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 58a836c409c2e4982bb89e9d98e6b65c + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + ef2ad6ef1a0d827db4b01caa6b340fbf + + 1995-01-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 569022000 + + + + + 1395f3eb7d951d441962acee30ebb240 + y + 48210/100 + 327773/100000 + c28902afc0e2168dab793b63dbf56e1f + + + b9cabeca13b398fb62a6d385ed4916a1 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 22b16ec9c03e00dd0150a22780426c93 + + 1995-02-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 572348000 + + + + + c25135399d6f3f65e66ccdb541975a70 + y + 48210/100 + 324101/100000 + c28902afc0e2168dab793b63dbf56e1f + + + f74b03f7a1b731f5a85afb2a99b11dc7 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 6fdeaddf8e62e0167f657eed23ea27c8 + + 1995-02-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 576414000 + + + + + d6ac7052f05f821d4feeeda1ef746b65 + y + 48210/100 + 321400/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 47c446ca0b094d087715591b7acefd76 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + e205d59680a7d1b3100c6f9c5fbd619c + + 1995-03-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 580193000 + + + + + 8980728679535dcc6fbd5d0d3e187baf + y + 48210/100 + 320510/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 6757952464d7cf759ba6af1cedde80af + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 147fb5b3bf9c64a2cfa678b899617a1b + + 1995-03-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 584377000 + + + + + b0f2227be0f37117ff16816a9bba6bf8 + y + 48210/100 + 317868/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 59f7f0a41217d556acab6df6315c416b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 847b3db3292d79f04385d50678617d8f + + 1995-04-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 591148000 + + + + + d6e212645b08ac2db0029f302eaefa06 + y + 48210/100 + 291079/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 02525e8f79dd3f95a6531b7b0a1eb9a7 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 01b7f8239992fe56d640e8db18b357d4 + + 1995-04-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 607128000 + + + + + dccef28c5a743eabc50ed961fedce162 + y + 48210/100 + 300140/100000 + c28902afc0e2168dab793b63dbf56e1f + + + abb5d05de4cb51be2e4e05a70e4ece1b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + ba6f65b4506f3bab59fa821fc35edffc + + 1995-05-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 612605000 + + + + + b45c6aee3f5802971f66a9da91d01212 + y + 48210/100 + 285689/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 64750ea3cec777596f1eb2062fb1f8b9 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 2dd0477429d450166c9995e753c01331 + + 1995-05-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 760444000 + + + + + 69748f8a33b3e85fc46adfa9af9a2c8f + y + 48210/100 + 287107/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 53d079dc07ea51d10f07f922dcb7c9c9 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 4f221b72a33d2e5403ebea07b30c60f8 + + 1995-06-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 767487000 + + + + + f323236b9c860bd7582d8516cab014d2 + y + 48210/100 + 279478/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 52fa897efe40206378e38ce37d25545c + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 97c6d186d2c827c0add7fa251adb80f5 + + 1995-06-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 774300000 + + + + + 69783df027e525bc1f4fe2aa61f1c5e3 + y + 48210/100 + 259717/100000 + c28902afc0e2168dab793b63dbf56e1f + + + ebb117aa19dfef5ce5cceb9378c0bd6b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 61bc2fba66b1b4a2b9d70a79c23d6b2a + + 1995-07-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 782986000 + + + + + eb33e77786d816e4df8c9b089a2417fe + y + 48210/100 + 228890/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 39d1bd743942efb895c00e1c8dad312b + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 044cff4a8437cba0611d3f1634ed1766 + + 1995-07-06 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 788855000 + + + + + 2158435efd7fba4b85440e2b291597dc + n + 1800000/100 + 10000000/100000 + b3955645bed5651123986f415d0e81d6 + + + 4a07fb7b6207731dba32e088b2f2273c + n + -1800000/100 + -1800000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + d30a071d0c23e1f7de5122768f572783 + + 1995-07-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 793677000 + + + + + ee5be141ec71575e8d133dafb17fc475 + y + 48210/100 + 223583/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 85fd606ec412640bdc2394dceabb2863 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 3c1a1f2b9b25c700a529a88ea37673fa + + 1995-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 810277000 + + + + + 9106d261d9313b94a1791c0346026ab5 + n + 48210/100 + 234456/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 01f9fa805620e2753a088d5c7926a2a4 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + ef3e43991d16cedd21ae30424314ded3 + + 1995-08-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 820724000 + + + + + 70edfee7fda47ab599440e56c74d07bc + n + 48210/100 + 223583/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 6e6de8bc8de8edadd03d12fa27f8d3cf + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + ad374dbca2ceb69c621729110075eb6c + + 1995-09-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 831302000 + + + + + 593961cd24af8fec7b7dded7980572a0 + n + 48210/100 + 246441/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 0290760bda0c1263a29275dbc80c6e8e + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 3ecdbc520d5995c743b968df766dac53 + + 1995-09-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 842924000 + + + + + a19fb70b311ab1d2995e99da8cc0dd60 + n + 48210/100 + 234456/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e8188b2256f426671644de3833c63823 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + b78ee35076e3c33e119b28ed28d9899e + + 1995-10-01 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 870500000 + + + + + edceb57dd1ae14b92495e6b802ea1fd0 + n + 48210/100 + 240299/100000 + c28902afc0e2168dab793b63dbf56e1f + + + a2913b7d9d6b46f98f8312a18091435a + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 55e60fdaab33f498f39f00fdd7b90a54 + + 1995-10-16 00:00:00 -0400 + + + 2001-03-26 15:32:05 -0500 + 882549000 + + + + + b28c48aea5b2590373a9d7b30daac854 + n + 48210/100 + 232805/100000 + c28902afc0e2168dab793b63dbf56e1f + + + fc7ea77d5aa50580342d7e96b2f49989 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 99346e3803a33ab9eca34b0c07950ca4 + + 1995-11-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 903735000 + + + + + 6498e7c2e6fb5904dd5cec26c24435ef + n + 48210/100 + 225105/100000 + c28902afc0e2168dab793b63dbf56e1f + + + 1f017018b6a8e4d819e5b4cc7a390025 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 99e86a13ff4f2c9682de72afe1a88e93 + + 1995-11-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 918545000 + + + + + dc7a3ba0b30130597a4fdcc6c3dcf369 + n + 48210/100 + 246179/100000 + c28902afc0e2168dab793b63dbf56e1f + + + efaa1a65c36b2aa767ef5038205775d2 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 2622a1080ff6c00ea26a08b2b4ced682 + + 1995-11-18 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 924478000 + + + + + de65d2b5bbf96ea77a2a68f6e1c9b78e + n + 1720000/100 + 8000000/100000 + b3955645bed5651123986f415d0e81d6 + + + 1d2ee8256a1205440df2a8fc8aafbbca + n + -1720000/100 + -1720000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + a881bcba9acd5cc108fc0a98036c5bc3 + + 1995-12-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 933363000 + + + + + f64fda83b5354abc300e0daeacdbaf9d + n + 48210/100 + 246179/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e5110d8191bf1d6fda128942062569ad + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + c00f255b41f7d2c35d67354264999478 + + 1995-12-10 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 940053000 + + + + + b5effb985dc0657eec87fd8dbfc57451 + n + 1744000/100 + 8000000/100000 + b3955645bed5651123986f415d0e81d6 + + + a4db6abc4a2effb3f73275fb29948523 + n + -1744000/100 + -1744000/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 8e8e5d4125418c0579f3731e25777596 + + 1995-12-16 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 958106000 + + + + + 1557c89238dd07a8972b0686a0fa178b + n + 48210/100 + 245917/100000 + c28902afc0e2168dab793b63dbf56e1f + + + e005c31d25bd98288550acf63d16cfd2 + n + -48210/100 + -48210/100 + 21db466b6be8b3f6a3043d0c0316de8c + + + + + 2b59e457646dd04a190dcb17e050ef92 + + 1995-01-01 00:00:00 -0500 + + + 2001-03-26 15:32:05 -0500 + 561450000 + + + + + 6d87f9e8bb10413b90e956356641630c + Initial balance + y + 249123/100 + 9400850/100000 + c28902afc0e2168dab793b63dbf56e1f + + + f778537b61dab90054fe976b501cd986 + n + -449122/100 + -449122/100 + 1aaa099850fe7a07e2b5ae97f18b9af2 + + + b3a36622a46daa0cb4291ed15874fcf6 + n + 200000/100 + 200000/100 + da8e001155343694bd34f6aa248b1c28 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/abc.gml2 b/src/backend/file/test/test-files/xml2/abc.gml2 new file mode 100644 index 0000000000..c72334f8ff --- /dev/null +++ b/src/backend/file/test/test-files/xml2/abc.gml2 @@ -0,0 +1,262 @@ + + +4 +7 + + Swipe Brokers + 8a2778a7eef9bc606de8a12b489f737c + BANK + + ISO4217 + EUR + + 100 + My Investment Account + + + abc + 8c054c66321f7be82287dbb0c6b7b8a2 + BANK + + ISO4217 + EUR + + 100 + + + Gift Received + 07212c5f31968d8d55144f1fd5651d8c + INCOME + + ISO4217 + EUR + + 100 + Gift Received + + + Other Inc + a2d8b63955baad46ddca87bbd96d399f + INCOME + + ISO4217 + EUR + + 100 + Other Income + + + f5f0146e8a242f5869cfa143e9c3ad82 + TXFR + + 1997-09-12 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 421794000 + + move a pile of money to trading acct + + + 3a460828038c8dfb7840c9c869372ad3 + another memo + n + 500000/100 + 500000/100 + 8a2778a7eef9bc606de8a12b489f737c + + + e9924d2b6802002852cec90774e41f0f + another memo + n + -500000/100 + -500000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + 25b6474f1d5f2cf787d52af107f41f91 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 422791000 + + hal stock + + + f6de5ff6932e0652b54160a945345378 + income + n + -1200/100 + -1200/100 + 8a2778a7eef9bc606de8a12b489f737c + + + a599cd75681fa150211fc28f46da50a4 + income + n + 1200/100 + 1200/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + b15e27a638b77c04eb23aea715845627 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 423736000 + + hal stock + + + e944efe51adf6a037d2a05e975de0b9e + income + n + -1100/100 + -1100/100 + 8a2778a7eef9bc606de8a12b489f737c + + + 39b2adbce47a9a878c72dc802b8eb19d + income + n + 1100/100 + 1100/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + eede2259804df7746d1a5508f994f3cb + TXFR + + 1997-11-12 00:00:00 -0500 + + + 2001-03-26 15:35:15 -0500 + 424738000 + + hal stock + + + 6f795a04a0822e46488b82f49745db78 + sold some stock! + n + -50000/100 + -50000/100 + 8a2778a7eef9bc606de8a12b489f737c + + + 325b94fb8e080a5a08b025a9cae2fd2a + sold some stock! + n + 50000/100 + 50000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + 2830957d31809c4c450db2c5d5d134a2 + DEP + + 1997-06-17 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 418417000 + + from my pillow case + + + f5e209e5d118c1edeca8dc3d82dbd1aa + my memo + n + -234500/100 + -234500/100 + a2d8b63955baad46ddca87bbd96d399f + + + df70142a754e943592bec193b9a208ee + my memo + n + 234500/100 + 234500/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + 8a6f53be74b84e3557abdba90b8c325b + 101 + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 420785000 + + paycheck + + + e6c7440d846774962fd62c68a89145cb + the boss paid me today! + n + -54300/100 + -54300/100 + 07212c5f31968d8d55144f1fd5651d8c + + + 91e6498ede7e1c5964c677e8cf14d2c1 + the boss paid me today! + n + 54300/100 + 54300/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + 976137eadff7b9c19fa0bf4527385781 + DEP + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:35:15 -0500 + 419571000 + + put in more money + + + eb7df1a49af1a9bbeac7484003dec5e1 + this came out of my pillowcas + n + -330000/100 + -330000/100 + a2d8b63955baad46ddca87bbd96d399f + + + d2d6443cc766f3bf1cfc891530903f1e + this came out of my pillowcas + n + 330000/100 + 330000/100 + 8c054c66321f7be82287dbb0c6b7b8a2 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/abcall.gml2 b/src/backend/file/test/test-files/xml2/abcall.gml2 new file mode 100644 index 0000000000..af89c05564 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/abcall.gml2 @@ -0,0 +1,394 @@ + + +7 +10 + + ABC Bank + eda56e3c0c402d1816f845430caf362e + BANK + + ISO4217 + USD + + 100 + Some Old Bank Acct + + + Swipe Brokers + 729ae65a6c202a83a5335bcd32709888 + BANK + + ISO4217 + USD + + 100 + My Investment Account + + + pocket cash + 5d0b89cb9bcc5074cda514d0d4c10af4 + CASH + + ISO4217 + USD + + 100 + + + SlaveCardt + 2b804a30e16e54a97da593fc1f71c386 + CREDIT + + ISO4217 + USD + + 100 + my credit card + + + Gift Received + 04b5cbc4192f4790fac0586c5cc152f4 + INCOME + + ISO4217 + USD + + 100 + Gift Received + + + Invest Inc + d4f69b07cf7bb1a77c134f1b2c128684 + INCOME + + ISO4217 + USD + + 100 + Investment Income + + + Other Inc + 0a241ed16a10c3be1836ce37f8a069e9 + INCOME + + ISO4217 + USD + + 100 + Other Income + + + 2277a65f698a0902c751d8d44db12eeb + DEP + + 1997-06-17 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 994727000 + + from my pillow case + + + 12afd90bcb29753d5572ebec9b3a6fe8 + my memo + n + -234500/100 + -234500/100 + 0a241ed16a10c3be1836ce37f8a069e9 + + + be0a8539128014e1f0d247eb54e8b07a + my memo + n + 234500/100 + 234500/100 + eda56e3c0c402d1816f845430caf362e + + + + + 62bb507b39f9cb5ce13cdbfe85d5dde9 + + 1997-07-16 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 996065000 + + more from my pillow + + + 066346c0a87434491957713da1f3a3be + n + -233300/100 + -233300/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + 6552ad49f7202988165f0bfb0cab9f1d + n + 233300/100 + 233300/100 + eda56e3c0c402d1816f845430caf362e + + + + + ac62a8dedb6fafc4864d980e167d93b0 + 101 + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 998739000 + + paycheck + + + 2f0880d0d28f0a38de0784f40f1364a1 + the boss paid me today! + n + -54300/100 + -54300/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + f01abb3378f6a2c7dde4f4894540507b + the boss paid me today! + n + 54300/100 + 54300/100 + eda56e3c0c402d1816f845430caf362e + + + + + 5d33e9906feeb57fc22b723447c81605 + DEP + + 1997-08-01 00:00:00 -0400 + + + 2001-03-26 15:32:55 -0500 + 997654000 + + put in more money + + + cf74014d73e0ef079c0f10797b19ed55 + some other inc + n + -30000/100 + -30000/100 + 0a241ed16a10c3be1836ce37f8a069e9 + + + 686e0a76ab0ae02b10526729d4309509 + soem as invst + n + -190000/100 + -190000/100 + d4f69b07cf7bb1a77c134f1b2c128684 + + + 8f08ab3bcae4fda2996a4d4ba58b2a65 + some as gift + n + -110000/100 + -110000/100 + 04b5cbc4192f4790fac0586c5cc152f4 + + + 008fcb736cbc9dda100dba888769caec + some other inc + n + 330000/100 + 330000/100 + eda56e3c0c402d1816f845430caf362e + + + + + 5e8d9293d5903ea18dc79e139b26dbc2 + TXFR + + 1997-09-12 00:00:00 -0400 + + + 2001-03-26 15:32:56 -0500 + 9661000 + + move a pile of money to trading acct + + + 1630fe79d89d59a1c1b879dd705aaa41 + another memo + n + 500000/100 + 500000/100 + 729ae65a6c202a83a5335bcd32709888 + + + 6113d75cfcdea42bf1bf001df8e8ef8c + another memo + n + -500000/100 + -500000/100 + eda56e3c0c402d1816f845430caf362e + + + + + 5be926417dfce34c825504c32470f78f + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 10837000 + + hal stock + + + cd7d47aaee2a435c3901b3efd8e319fe + income + n + -1200/100 + -1200/100 + 729ae65a6c202a83a5335bcd32709888 + + + ceab9089fbca47c83a487f8ea5f06c50 + income + n + 1200/100 + 1200/100 + eda56e3c0c402d1816f845430caf362e + + + + + 99fd0615f2db665f4bf90f438b2b5733 + TXFR + + 1997-11-11 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 11847000 + + hal stock + + + bfa9de544784620d566abc08c6e91b3a + income + n + -1100/100 + -1100/100 + 729ae65a6c202a83a5335bcd32709888 + + + 73a9e08aa5a660ca2fa2ab85acdff84f + income + n + 1100/100 + 1100/100 + eda56e3c0c402d1816f845430caf362e + + + + + 698e47a93b21837fd83babbfc5f6320d + TXFR + + 1997-11-12 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 12862000 + + hal stock + + + 90e62018f0f3add84eb0ed68702ae942 + sold some stock! + n + -50000/100 + -50000/100 + 729ae65a6c202a83a5335bcd32709888 + + + 73fc5c8ae0c0468304bc9650d34f4194 + sold some stock! + n + 50000/100 + 50000/100 + eda56e3c0c402d1816f845430caf362e + + + + + 249c2ccc0ada34b5027a64e0c18774c3 + + 1997-11-28 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 13872000 + + pay the balance on the credit c + + + d4b7da3a080da8fc44e75c4389790ada + another memo + n + 44500/100 + 44500/100 + 2b804a30e16e54a97da593fc1f71c386 + + + 51fc2af007ad07027dfbe3ba4d4b6304 + another memo + n + -44500/100 + -44500/100 + eda56e3c0c402d1816f845430caf362e + + + + + b1a6b7fad984e769bd6c3dd56abcfbe8 + + 1997-11-28 00:00:00 -0500 + + + 2001-03-26 15:32:56 -0500 + 14844000 + + cash in my pocket + + + c862917ad2379a5710b1431c395e658b + n + 4500/100 + 4500/100 + 5d0b89cb9bcc5074cda514d0d4c10af4 + + + b4ceb078101fd7b78f4a0a2c9d3e2768 + n + -4500/100 + -4500/100 + eda56e3c0c402d1816f845430caf362e + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/carols-data-file.gml2 b/src/backend/file/test/test-files/xml2/carols-data-file.gml2 new file mode 100644 index 0000000000..19ca6d6435 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/carols-data-file.gml2 @@ -0,0 +1,1169 @@ + + +40 +18 +19 + + NASDAQ + Adbe + Adobe + 100000 + + + NASDAQ + Dell + Dell + 100000 + + + NASDAQ + ISWCX + ISWCX + 100000 + + + NASDAQ + jamrx + Janus Mercury + 100000 + + + NASDAQ + lnux + VA Linux + 100000 + + + NASDAQ + orcl + Oracle + 100000 + + + NASDAQ + rbus + Rambus + 100000 + + + NASDAQ + rhat + RedHat + 100000 + + + NASDAQ + slab + Silicon Labs + 100000 + + + NASDAQ + swpix + Schwab S&P 500 Index + 100000 + + + NASDAQ + tvqfx + Firsthand Technology Value Fun + 100000 + + + NYSE + AMD + AMD + 1000 + + + NYSE + AMD Opt- #2 8/14/98 + AMD Opt- #2 8/14/98 + 1000 + + + NYSE + AMD Opt-8/14/98 + AMD Opt-8/14/98 + 1000 + + + NYSE + AMD Opt-9/10/98 + AMD Opt-9/10/98 + 1000 + + + NYSE + AMD Opt. #3 8/14/98 + AMD Opt. #3 8/14/98 + 1000 + + + NYSE + AMD Opt. 5/3/99 + AMD Opt. 5/3/99 + 1000 + + + NYSE + AMD Opt. 9/10/98 + AMD Opt. 9/10/98 + 1000 + + + NYSE + Adobe + Adobe + 1000 + + + NYSE + Charles Schwab + Charles Schwab + 1000 + + + NYSE + Dell + Dell + 1000 + + + NYSE + Firsthand Technology Value Fun + Firsthand Technology Value Fun + 1000 + + + NYSE + Growth Equity Fund + Growth Equity Fund + 1000 + + + NYSE + IBM + IBM + 1000 + + + NYSE + ISWCX + ISWCX + 1000 + + + NYSE + Janus Mercury + Janus Mercury + 1000 + + + NYSE + Lucent Technologies + Lucent Technologies + 1000 + + + NYSE + Oracle + Oracle + 1000 + + + NYSE + QQQ + QQQ + 100000 + + + NYSE + Rambus + Rambus + 1000 + + + NYSE + RedHat + RedHat + 1000 + + + NYSE + Schwab S&P 500 Index + Schwab S&P 500 Index + 1000 + + + NYSE + Silicon Graphics + Silicon Graphics + 1000 + + + NYSE + Silicon Labs + Silicon Labs + 1000 + + + NYSE + Small Cap Growth Fund + Small Cap Growth Fund + 1000 + + + NYSE + VA Linux + VA Linux + 1000 + + + NYSE + amd + amd + 1000 + + + NYSE + lu + Lucent Technologies + 100000 + + + NYSE + sch + Charles Schwab + 100000 + + + NYSE + sgi + Silicon Graphics + 100000 + + + Checking + 7cce1d8ee29f0e4c30c949f77bb2a447 + BANK + + ISO4217 + USD + + 100 + + + notes + + + + last-num + 100 + + + reconcile-info + + + last-date + 979624800 + + + + + + + Savings + 7117b00944ea5def8959751832990c9e + BANK + + ISO4217 + USD + + 100 + + + notes + + + + + + Cash + 15468df1e7097e7c317fb7a541010d69 + CASH + + ISO4217 + USD + + 100 + + + notes + + + + + + Credit Card + bdc5ed7168216d6df0f8d00767299bc7 + CREDIT + + ISO4217 + USD + + 100 + + + notes + + + + reconcile-info + + + last-date + 983340000 + + + + + + + Salary + d77f5ecb0a800748fdbae42e98908a85 + INCOME + + ISO4217 + USD + + 100 + + + notes + + + + + + Clothes + 52c89f4b1d0b7b445e0793278fd5ff62 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Dining + f4472ff237862ece69a1d3a58f293220 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + FICA + 1b211cffcf23b31e80666dadf57a37b0 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + FedTax + 9372c7685bfaf9086cb3cb53190b2ce2 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Finance Charge + 4ca91a8240c1df8068fa4dc7c1da147e + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Fuel + a13c10f2c32dc74c2e70f894351ef209 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Groceries + 17e25505b81c735adec6d10aa1536a0a + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Household + 62479a9add5ae8bb253da6ab3d713083 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Service Charges + 630a8066fdf69ac977808b2295ed9f68 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Tools + 126f38b941cfe865f811e1c011e5bc51 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Utilities + 00adc8fb6cc29e7ae5de56d6f8624ac5 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + + + Electric + 554b4134fc4a9c0361e9c8ca8f744229 + EXPENSE + + ISO4217 + USD + + 100 + + + notes + + + + 00adc8fb6cc29e7ae5de56d6f8624ac5 + + + Opening Balances + f61553abd3d8029455441267f6530f3d + EQUITY + + ISO4217 + USD + + 100 + + + notes + + + + + + c25df6ca60518acb3044016e7c799f3c + + 2000-12-20 01:00:00 -0500 + + + 2000-12-20 13:05:39 -0500 + + Paycheck deposit + + + 26399b198b8beab9c11a84cabbd22da4 + y + + 2001-01-16 01:00:00 -0500 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 3bfc8952ec151252d1797087be4f7751 + n + -80000/100 + -80000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + + + eab3726a1157800a147285dbb6ef091e + + 2000-12-27 01:00:00 -0500 + + + 2000-12-20 13:25:30 -0500 + 54442000 + + Paycheck deposit + + + 6a1892e895b31a5a2e65a8d7a718d2a5 + Effect on checking + y + + 2001-01-16 01:00:00 -0500 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + fa8a34aab999ecb849f14c4e089272e8 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 067ba239023aa1450002f2f960241500 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 5ecafd54335e2a993047d80c9b0a1335 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + 8f9d9b1d8f179a20f69d1104756cbf70 + + 2001-01-03 01:00:00 -0500 + + + 2000-12-20 13:05:39 -0500 + 389786000 + + Paycheck deposit + + + c9d13d1243281e0e37011901e02dba51 + Effect on checking + y + + 2001-01-16 01:00:00 -0500 + + 80000/100 + 80000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 8902cfce8bf774b82f55d31f03abc0a0 + Effect on Salary + n + -105000/100 + -105000/100 + d77f5ecb0a800748fdbae42e98908a85 + + + 98490994785921ee6fd9e5d29f8a7435 + Effect on federal tax + n + 20000/100 + 20000/100 + 9372c7685bfaf9086cb3cb53190b2ce2 + + + 4fad0c6ee1cd7fd3fe37a487aff39a94 + Effect on FICA + n + 5000/100 + 5000/100 + 1b211cffcf23b31e80666dadf57a37b0 + + + + + 104059201725c15eab8157a46542305c + + 2001-01-15 01:00:00 -0500 + + + 2001-01-16 11:38:22 -0500 + + Service charge + + + 42b82c4437208eba6afaa9e7ce76bb61 + y + + 2001-01-16 01:00:00 -0500 + + -500/100 + -500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + e3f93abe380fa9d9068825b36af9f34f + n + 500/100 + 500/100 + 630a8066fdf69ac977808b2295ed9f68 + + + + + 5e8d0bf91d65b3385d39e2fbc7528f92 + + 2001-01-16 01:00:00 -0500 + + + 2001-01-16 10:52:39 -0500 + + Transfer from Savings + + + ff61df2aa1ff54a7683ded3312c7cde9 + y + + 2001-01-16 01:00:00 -0500 + + 50000/100 + 50000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + c934c0a35454cb4757f04ec6d9bf28f9 + n + -50000/100 + -50000/100 + 7117b00944ea5def8959751832990c9e + + + + + 4ad0609e6e66fc623db8a0d051aa9162 + 100 + + 2001-01-16 01:00:00 -0500 + + + 2001-01-16 11:14:37 -0500 + + Home Town Grocery + + + 2244e92f65e67e37f4d237278a70aa8f + y + + 2001-01-16 01:00:00 -0500 + + -7500/100 + -7500/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + 52e27b3bb5cba4d978479228d8e0e11c + n + 7500/100 + 7500/100 + 17e25505b81c735adec6d10aa1536a0a + + + + + 190c55a7637a8f6622fab4eb31f4afed + 101 + + 2001-01-16 01:00:00 -0500 + + + 2001-01-16 11:19:55 -0500 + + ABC Hardware + + + f7b76a73f8e7574bcf07219e422da54a + Parts and tools + y + + 2001-01-16 01:00:00 -0500 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + ebad73b5da75bf3af18974612e8b41b6 + Household parts + n + 5000/100 + 5000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + ff6838a2385e6330f6e6c5f70665d537 + Tools needed + n + 5000/100 + 5000/100 + 126f38b941cfe865f811e1c011e5bc51 + + + + + f09f609caacaa2168d69751b6cc59688 + ATM + + 2001-01-16 01:00:00 -0500 + + + 2001-01-16 11:25:34 -0500 + + Cash withdrawal + + + 9d5f50ab638f22ec7be2833c3dc2487d + y + + 2001-01-16 01:00:00 -0500 + + -10000/100 + -10000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + f9a4088f52083b30afd9b0c437a59eec + n + 10000/100 + 10000/100 + 15468df1e7097e7c317fb7a541010d69 + + + + + cfcc79959b18613cca530c4ead7fc8e6 + + 2001-02-05 01:00:00 -0500 + + + 2001-02-19 20:36:36 -0500 + + Payment of bill + + + eed91ed9af5677c13e860157aed999d1 + y + + 2001-02-28 01:00:00 -0500 + + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 657b2ffac761f1a4e5a4a8e878308fd8 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + 162b5e1934b047b7b227d5dd4fc512a2 + 104 + + 2001-03-05 01:00:00 -0500 + + + 2001-02-19 20:47:42 -0500 + 926968000 + + Payment of bill + + + a31a9ad6d93260b8c8a1c5820c8b639b + n + 30000/100 + 30000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + bd388be7c46cabda67617974555b9638 + n + -30000/100 + -30000/100 + 7cce1d8ee29f0e4c30c949f77bb2a447 + + + + + fda224619e2ae85255c5177b926e65e1 + + 2001-01-16 01:00:00 -0500 + + + 2001-01-16 10:33:53 -0500 + + Opening Balance + + + 7fb6737ab23ca40c0aed10e05d0655ef + n + 100000/100 + 100000/100 + 7117b00944ea5def8959751832990c9e + + + de1a7dd8d9b6ca3872bc68f688c6cd95 + n + -100000/100 + -100000/100 + f61553abd3d8029455441267f6530f3d + + + + + 4fbd0a30a57f69bbb9059f6b809894e2 + + 2001-01-31 01:00:00 -0500 + + + 2001-02-19 17:36:43 -0500 + + Opening Balance + + + cc135c8a137d846a963066bfc423c021 + y + + 2001-02-28 01:00:00 -0500 + + -100000/100 + -100000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 084f7d3dea30f86928468126b818e0e5 + n + 100000/100 + 100000/100 + f61553abd3d8029455441267f6530f3d + + + + + fe2e8993ad17c78c4feabd143f2a40fe + + 2001-02-01 01:00:00 -0500 + + + 2001-02-19 18:25:02 -0500 + + Greasy Spoon Cafe + + + 54f62e99004b96a3ee68f039dc31bf73 + y + + 2001-02-28 01:00:00 -0500 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 3aa7d0f3f6648aa926fd8fe828135be1 + n + 2500/100 + 2500/100 + f4472ff237862ece69a1d3a58f293220 + + + + + 3d0abd508aec96dab340949fd03b525d + + 2001-02-03 01:00:00 -0500 + + + 2001-02-19 18:25:43 -0500 + + Faux Pas Fashions + + + db1fdfb171f7c20f6ac5e8086010faf2 + y + + 2001-02-28 01:00:00 -0500 + + -10000/100 + -10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0256d2ca85b92698e768f1e85e98961e + n + 10000/100 + 10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + dd25a6957eee648969d60b77e56c34f9 + + 2001-02-15 01:00:00 -0500 + + + 2001-02-19 18:26:38 -0500 + + Premium Gasoline + + + b8479d346c1ccec3371c7f6e51e94850 + y + + 2001-02-28 01:00:00 -0500 + + -2500/100 + -2500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 0fee1efce1b9ad24ae13cf99b35db5dd + n + 2500/100 + 2500/100 + a13c10f2c32dc74c2e70f894351ef209 + + + + + ff65fe32421def4c6e3feaa27ae84844 + + 2001-02-20 01:00:00 -0500 + + + 2001-02-19 18:28:01 -0500 + + Groceries R Us + + + acceaee63a2292ae8c05c4a908f33b79 + Total charge + y + + 2001-02-28 01:00:00 -0500 + + -12500/100 + -12500/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + f9305776dd37e70ac119d7ae9b876dab + Amount for food + n + 8500/100 + 8500/100 + 17e25505b81c735adec6d10aa1536a0a + + + f218012a54ab33909cd244bbaf4d21ef + Amount for household + n + 4000/100 + 4000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + d8f825f93a4241c836fdcdd0e5926086 + + 2001-02-25 01:00:00 -0500 + + + 2001-02-19 18:29:38 -0500 + + CheapMart + + + e5cce296604b1eee149bec0957316238 + y + + 2001-02-28 01:00:00 -0500 + + -6000/100 + -6000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + 530a9d431a1df41b86a1ddb7064e7a35 + n + 6000/100 + 6000/100 + 62479a9add5ae8bb253da6ab3d713083 + + + + + 15c667f0235e41ddacb0bacd47a4a8ff + + 2001-02-25 01:00:00 -0500 + + + 2001-02-19 18:39:32 -0500 + + Faux Pas Fashions + + + ac79d516c3d665eadc58272dae5c87f9 + y + + 2001-02-28 01:00:00 -0500 + + 10000/100 + 10000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + c33b6a8abb949a1e6086a63ccc70ba5c + n + -10000/100 + -10000/100 + 52c89f4b1d0b7b445e0793278fd5ff62 + + + + + e32a43f88cfad521b4b3dc533e9d84ec + + 2001-02-25 01:00:00 -0500 + + + 2001-02-19 19:19:27 -0500 + + Finance Charge + + + cb8b3b3cb076ec3b6a46325ea6b65eaa + y + + 2001-02-28 01:00:00 -0500 + + -2000/100 + -2000/100 + bdc5ed7168216d6df0f8d00767299bc7 + + + dcc0f4093ad558b74e505c63ca4f0ee7 + n + 2000/100 + 2000/100 + 4ca91a8240c1df8068fa4dc7c1da147e + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/cbb-export.gml2 b/src/backend/file/test/test-files/xml2/cbb-export.gml2 new file mode 100644 index 0000000000..52c18be30b --- /dev/null +++ b/src/backend/file/test/test-files/xml2/cbb-export.gml2 @@ -0,0 +1,418 @@ + + +12 +9 + + cbb export + 504a8f7f0ff8e1e53c6df8b1bb714c47 + BANK + + ISO4217 + HRK + + 100 + + + Gifts + 8cd43c12f1dc32ea8a51ec997fcf35ef + INCOME + + ISO4217 + HRK + + 100 + Gift Expenses + + + Reimbursements + 4f502fe69043087c2186dcac27cc56bf + INCOME + + ISO4217 + HRK + + 100 + + + Salary + 077894556323647344da06d5f5fe6449 + INCOME + + ISO4217 + HRK + + 100 + Salary Income + + + Clothing + 37539261eaf4bcf82c17eba0a5bf5949 + EXPENSE + + ISO4217 + HRK + + 100 + Clothing + + + Credit Card + 3b09243ca91d85c7b2984dd5f2490701 + EXPENSE + + ISO4217 + HRK + + 100 + + + Dining-Out + cd6d68365b6c9f80e4b68a552b71950b + EXPENSE + + ISO4217 + HRK + + 100 + + + Entertainment + 47585dff7df1969ea961e4b1a7fa9f27 + EXPENSE + + ISO4217 + HRK + + 100 + + + Household + 46d28144c136899835833bca6cda4e52 + EXPENSE + + ISO4217 + HRK + + 100 + Household Misc. Exp + + + Personal Cash + 98e07d070ecce19416db949e9124a45d + EXPENSE + + ISO4217 + HRK + + 100 + + + Telephone + 72e555d138c8a1e7c5e8c7953a54a55e + EXPENSE + + ISO4217 + HRK + + 100 + Telephone Expense + + + Textbooks + 224840878e17f4f7c6a5d6418747cafa + EXPENSE + + ISO4217 + HRK + + 100 + + + 9d2c18d552ab4a405bee914ca188eb70 + 323 + + 1997-06-23 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 256981000 + + Eurest Dining + + + d62de62239db355ba3597b6a68722cbf + n + 435/100 + 435/100 + cd6d68365b6c9f80e4b68a552b71950b + + + 7cbe9fae8a6a7b5f53fb233e6cb19490 + n + -435/100 + -435/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 7b855de3a9f29605b1d5e0cb63d4b4cf + 331 + + 1997-07-12 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 251045000 + + Sally Wood + + + 2c298a4d03fbe7cf10a416d06f83abc0 + VISA Bill - June + n + 51343/100 + 51343/100 + 3b09243ca91d85c7b2984dd5f2490701 + + + 31e772f55b364e2cdef8e02e12287e1f + VISA Bill - June + n + -51343/100 + -51343/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 1964523ed04475405c7f841548c0ae75 + ATM + + 1997-09-20 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 252071000 + + Withdrawal + + + fe76f038b9d07bc9a47c1824f9752f68 + Claremont + n + 4000/100 + 4000/100 + 98e07d070ecce19416db949e9124a45d + + + bc707d062a5900ebb3ca4e313a7d0e96 + Claremont + n + -4000/100 + -4000/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + d32f7312b4970cde93b1814a69604c72 + ATM + + 1997-09-29 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 258296000 + + Deposit + + + 937572eea8894521984a6364b0a98128 + HMC Orientation -97 + n + -5042/100 + -5042/100 + 4f502fe69043087c2186dcac27cc56bf + + + 6e99285a28ef72ff06bc0e61a7af13d1 + AE paycheck + n + -14300/100 + -14300/100 + 077894556323647344da06d5f5fe6449 + + + 18927d376a09bad9b06565df5402518d + HMC Orientation -97 + n + 19342/100 + 19342/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 6622109f3b62c5ccf1a95918c7a1c248 + 276 + + 1997-09-30 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 253063000 + + TCI + + + 605eeca327a57a30af2ed3ff6518c174 + Cable - August + n + 1399/100 + 1399/100 + 47585dff7df1969ea961e4b1a7fa9f27 + + + 0c48c1184a392f5b95e998b4dca76ebc + Cable - August + n + -1399/100 + -1399/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 3048039143626c17d3109ff7fc37467e + 277 + + 1997-10-11 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 248714000 + + AT&T/063 + + + eac0bf2d0950dedbaae474e0c1d4e085 + Phone Bill - September + n + 619/100 + 619/100 + 72e555d138c8a1e7c5e8c7953a54a55e + + + 79e1478ef9dcd2b207b22b943283049a + Phone Bill - September + n + -619/100 + -619/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 8bf78f94bb539e8f904cc49ec7f99444 + 278 + + 1997-10-11 00:00:00 -0400 + + + 2001-03-26 15:37:09 -0500 + 249996000 + + BofA + + + 3743498b2f1c99256bde3d3160826579 + Wal-Mart + n + 4475/100 + 4475/100 + 46d28144c136899835833bca6cda4e52 + + + c22bfdb9021873b31caedd002c22f036 + Fall 1997 - Huntley + n + 5330/100 + 5330/100 + 224840878e17f4f7c6a5d6418747cafa + + + d67f1387b0bb534372a80e168cb6e1b8 + Wal-Mart + n + -9805/100 + -9805/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + 4097ea8244e81a99d5862a7313e51ff8 + 279 + + 1997-10-27 00:00:00 -0500 + + + 2001-03-26 15:37:09 -0500 + 255798000 + + Scripps College + + + 30a555c9081c84934ca827f652c2e1d3 + Orchestra T-Shirt + n + 1000/100 + 1000/100 + 37539261eaf4bcf82c17eba0a5bf5949 + + + a02cc758726391ec2c64e21d2188e987 + Orchestra T-Shirt + n + -1000/100 + -1000/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + c1b75a304185a70beefd55f9f3b5cb17 + 283 + + 1997-11-24 00:00:00 -0500 + + + 2001-03-26 15:37:09 -0500 + 254099000 + + West Dorm + + + ee024d6fed778265b1e6513d6ee7d8d4 + Dorm T-Shirts + n + 1500/100 + 1500/100 + 8cd43c12f1dc32ea8a51ec997fcf35ef + + + cd59b6089604201628093e13dfd4bced + Dorm T-Shirts + n + -1500/100 + -1500/100 + 504a8f7f0ff8e1e53c6df8b1bb714c47 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/conrads-file.gml2 b/src/backend/file/test/test-files/xml2/conrads-file.gml2 new file mode 100644 index 0000000000..a6d9ca0f0c --- /dev/null +++ b/src/backend/file/test/test-files/xml2/conrads-file.gml2 @@ -0,0 +1,439 @@ + + +1 +6 +12 + + AMEX + stk + Stock + 100 + + + Imbalance-AUD + ca36693eb25a602c171d07cb682b3e1b + BANK + + ISO4217 + AUD + + 100 + + + Assets + a947017cbd3b26198484086f8d93863b + STOCK + + ISO4217 + AUD + + 100 + A0000 + + + notes + + + + + + Stock1 + 33181c172f50aaa24792256f2db4690e + STOCK + + ISO4217 + AUD + + 100 + A0001 + + AMEX + stk + + 100 + + + notes + + + + a947017cbd3b26198484086f8d93863b + + + Stock2 + 4ca39e2f16ccf288ea0d956d2371bf82 + STOCK + + ISO4217 + AUD + + 100 + A0002 + + AMEX + stk + + 100 + + + notes + + + + a947017cbd3b26198484086f8d93863b + + + Cash + dd0cfd17078251ec6ef03da8a081f2a3 + ASSET + + ISO4217 + AUD + + 100 + C0000 + + + notes + + + + + + Bank + 6f8df62ae08403ee2a8eb5aa61cec772 + BANK + + ISO4217 + AUD + + 100 + C0001 + + + notes + + + + dd0cfd17078251ec6ef03da8a081f2a3 + + + 5a77b2d61485f286aff878be6febef64 + + 2000-11-28 00:04:14 -0500 + + + 2000-11-28 00:05:23 -0500 + + Initial purchase of stock + + + 0c92275921282ef27f8ebf7389735ad2 + n + 15000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 4a2b02002eb5d1f854d4269dc42c6952 + n + -15000/100 + -15000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + edc6b34f5d5f2a571843eb6033f7b8d9 + + 2000-11-28 06:39:20 -0500 + + + 2000-11-28 07:31:28 -0500 + + Sale (1) + + + 1dffcfc068e38f78ca5801e3487e6bdb + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + ce0457f98bf2e1f2db98cefa1e418631 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + e1382f1ac62f7c0d5e3be35b7c829a69 + + 2000-11-28 06:39:20 -0500 + + + 2000-11-28 07:31:30 -0500 + 66309000 + + Sale (1) + + + 3146350195a33643ba3ab29a6cea463e + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + a2ab877a4ab0387538d08493402bd186 + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 8243a16bf6e7baa7c3f03d1269b0af59 + + 2000-11-28 06:39:20 -0500 + + + 2000-11-28 07:31:46 -0500 + 664262000 + + Sale (1) + + + fc1ff0f23ef547885da036b1b9900a34 + n + -3600/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 99e7f2948ccaf69b77d3f5179e2236eb + n + 3600/100 + 3600/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 29d5624b4640a6020d9d37d9bc60b29b + + 2000-11-28 06:39:20 -0500 + + + 2000-11-28 07:32:08 -0500 + 413532000 + + Sale (1) + + + e945659fa802e7b66a88674f1adc8cbb + n + -6400/100 + -3000/100 + 33181c172f50aaa24792256f2db4690e + + + e9b926f5a8a48b12048e274119c119d3 + n + 6400/100 + 6400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 9dc249c5bbcea69ac8c7bf7c60ca34e0 + + 2000-11-28 19:01:14 -0500 + + + 2000-11-28 19:01:39 -0500 + + buy more + + + 7048bec4fcce79b3941de51944a48231 + n + 11000/100 + 10000/100 + 33181c172f50aaa24792256f2db4690e + + + 1e7d08ae4724c49593982e73449e9788 + n + -11000/100 + -11000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + b585a0ac253ce4316fedab1b495a2006 + + 2000-11-29 19:18:25 -0500 + + + 2000-11-29 19:19:12 -0500 + + Sell lots + + + 18c80178f75af440f5a1a87081b2fecb + n + -50000/100 + -40000/100 + 33181c172f50aaa24792256f2db4690e + + + 5c96b06788eb8ab218c886ddb31dcd71 + n + 50000/100 + 50000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 507c9bcd04bb43dc96a58ba418fe86c5 + + 2000-11-29 19:43:12 -0500 + + + 2000-11-29 19:45:18 -0500 + + some purchases + + + 71ac0831a93fb732f93106f26a007469 + n + 32400/100 + 30000/100 + 33181c172f50aaa24792256f2db4690e + + + 4ea809cd49577ec887c10eb0022eb695 + n + -32400/100 + -32400/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 791ce0217b5edf0c923f9cc3dc64c169 + + 2001-01-08 08:00:00 -0500 + + + 2001-01-08 23:56:02 -0500 + + gargle + + + 46fac7edef736a1cf3c3411de467dc14 + n + -2800/100 + -2000/100 + 33181c172f50aaa24792256f2db4690e + + + 234e1618beaaeb3dac31e931338020f2 + n + 2800/100 + 2800/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + 716b216f13e16d9e7afd49b3e8e4ffb6 + + 2001-01-08 08:00:00 -0500 + + + 2001-01-09 04:22:12 -0500 + + fandangle + + + e673423c75e9eb1b9443aa40bed778d0 + n + 25000/100 + 20000/100 + 33181c172f50aaa24792256f2db4690e + + + 49d24a29bb1bb67e44f9426265597262 + n + -25000/100 + -25000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + + + b74ee5f973e0b477eddc968384d2a594 + + 2001-01-08 08:00:00 -0500 + + + 2001-01-09 06:57:22 -0500 + + A small sale + + + da6264665f23b934aa5913308bfeb172 + n + -38000/100 + -19000/100 + 33181c172f50aaa24792256f2db4690e + + + 8c22cbc933e39c0c0226938c0eca8751 + n + 38000/100 + 24000/100 + 4ca39e2f16ccf288ea0d956d2371bf82 + + + + + f9386ebc4654856d9f2c8d991f9060d8 + + 2000-11-28 00:03:09 -0500 + + + 2000-11-28 00:03:58 -0500 + + + + + 59d526f5b19077cded2e38a7726d69f7 + n + 100000000/100 + 100000000/100 + 6f8df62ae08403ee2a8eb5aa61cec772 + + + 615e1758e9b8c958e596747191ec3226 + n + -100000000000/100000 + 0/100000 + 00000000000000000000000000000000 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/every.gml2 b/src/backend/file/test/test-files/xml2/every.gml2 new file mode 100644 index 0000000000..79709f67fc --- /dev/null +++ b/src/backend/file/test/test-files/xml2/every.gml2 @@ -0,0 +1,4862 @@ + + +5 +27 +161 + + NYSE + FID Cap & Income + FID Cap & Income + 100000 + + + NYSE + FID Eq Inc II + FID Eq Inc II + 100000 + + + NYSE + FID Govt Res + FID Govt Res + 100000 + + + NYSE + FID Growth & Inc + FID Growth & Inc + 100000 + + + NYSE + FID NewMkt Inc + FID NewMkt Inc + 100000 + + + Fidelity Inv + 1b791374ee19ad07b06c3e0a99aeb4fa + BANK + + ISO4217 + IRR + + 1 + Mutual Fund Family + + + FID Cap & Income + 31123b56c4780f491050562fc2bbdc20 + STOCK + + ISO4217 + IRR + + 1 + + NYSE + FID Cap & Income + + 100000 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + FID Eq Inc II + db2182ba7d730b4e90c755d29c64c894 + STOCK + + ISO4217 + IRR + + 1 + + NYSE + FID Eq Inc II + + 100000 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + FID Govt Res + 504f743d68e663efff21fc66b85cc491 + STOCK + + ISO4217 + IRR + + 1 + + NYSE + FID Govt Res + + 100000 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + FID Growth & Inc + ebec8d5a26522f4a0865fa5f837af17b + STOCK + + ISO4217 + IRR + + 1 + + NYSE + FID Growth & Inc + + 100000 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + FID NewMkt Inc + 0fac2553ae5a682f5ae978d081566ea5 + STOCK + + ISO4217 + IRR + + 1 + + NYSE + FID NewMkt Inc + + 100000 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + Dummy Cash + 049676696675474217124e24f44fbaa7 + CASH + + ISO4217 + IRR + + 1 + Reconcile Accounts + + + Cap. gain (long) + 1ade3e58381c463d8a8c2703d134ccea + INCOME + + ISO4217 + IRR + + 1 + + + Fidelity Inv + b7eaa97e2760274bd7eb5104a3f6fd84 + INCOME + + ISO4217 + IRR + + 1 + 1ade3e58381c463d8a8c2703d134ccea + + + FID Eq Inc II + 2998f1baa86deced08bf21cb73d4d194 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Eq Inc II + + 100000 + b7eaa97e2760274bd7eb5104a3f6fd84 + + + FID Growth & Inc + 5b7c74145709c67b9fa6d33ea12c9163 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Growth & Inc + + 100000 + b7eaa97e2760274bd7eb5104a3f6fd84 + + + Cap. gain (short) + fec86ac037ee8dd3cfe9512f7fced74b + INCOME + + ISO4217 + IRR + + 1 + + + Fidelity Inv + 57e365b7b895c5a9ef328a69367c49e5 + INCOME + + ISO4217 + IRR + + 1 + fec86ac037ee8dd3cfe9512f7fced74b + + + FID Eq Inc II + f9599ed5ecf62d2c9326766617d6e5e7 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Eq Inc II + + 100000 + 57e365b7b895c5a9ef328a69367c49e5 + + + FID Growth & Inc + d023c36ca9c320b873c5be9993078451 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Growth & Inc + + 100000 + 57e365b7b895c5a9ef328a69367c49e5 + + + FID NewMkt Inc + 5f4d3dd84f8df6527d5091152aadb4d6 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID NewMkt Inc + + 100000 + 57e365b7b895c5a9ef328a69367c49e5 + + + Dividends + 0406079e56613a22d8112b8dbfbed622 + INCOME + + ISO4217 + IRR + + 1 + + + Fidelity Inv + 928026d717b302da3d24fb64f086b18a + INCOME + + ISO4217 + IRR + + 1 + 0406079e56613a22d8112b8dbfbed622 + + + FID Cap & Income + 98a3d87a9305f733420ceee444cbfbe4 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Cap & Income + + 100000 + 928026d717b302da3d24fb64f086b18a + + + FID Eq Inc II + 6344d1b4710050ba1fd600c56eee740b + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Eq Inc II + + 100000 + 928026d717b302da3d24fb64f086b18a + + + FID Govt Res + 11709b1c45e84450d7a282228e69b56c + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Govt Res + + 100000 + 928026d717b302da3d24fb64f086b18a + + + FID Growth & Inc + 55d69cebd7b9b64b6e9678b6588e64a1 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID Growth & Inc + + 100000 + 928026d717b302da3d24fb64f086b18a + + + FID NewMkt Inc + 4ed39bec2d9009028bc277e7ca58b372 + INCOME + + ISO4217 + IRR + + 1 + + NYSE + FID NewMkt Inc + + 100000 + 928026d717b302da3d24fb64f086b18a + + + Unspecified + 5f856918b8284a11ebc757485d853667 + INCOME + + ISO4217 + IRR + + 1 + + + Commissions + c4ab48d47126697c3ee461627fedbc86 + EXPENSE + + ISO4217 + IRR + + 1 + + + Fidelity Inv + 01ebde432dcc5dee900ce670743eab41 + EXPENSE + + ISO4217 + IRR + + 1 + c4ab48d47126697c3ee461627fedbc86 + + + Retained Earnings + 7914214426a5a0d6f1d6d64c6614f80a + EQUITY + + ISO4217 + IRR + + 1 + + + d6e78e4275e257da6c333a9876c3b644 + + 1990-07-06 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 741484000 + + + + + 00eefbfbf6cbc2087201547d60869e6e + Exch to Gov't Res + n + -3458/1 + -20000000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 356c4b8988eb64b3b536e45b674b431d + n + 3458/1 + 3458/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + 2a3ace35d28647deb539be077ded27d3 + + 1991-04-16 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 944175000 + + + + + d0ad508bed58a23e859f852cdcc71178 + Exch To Gov't Reserves + n + -1990/1 + -10000000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 6dd7c0040101979cb52d9c8ded76ee8e + n + 1990/1 + 1990/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + + + b8a38afaa9d3b82344fc7020eb9d099f + + 1992-11-13 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 473011000 + + + + + af958174d9ea862dad7af6ad329ba728 + Exch From Gov't Reserves + n + 2000/1 + 10357300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + ed4ef7d90b31b1cbd8d940407901af3c + n + -2000/1 + -2000/1 + 1b791374ee19ad07b06c3e0a99aeb4fa + + + b61403494bf7aa882aace4ed93bfb61b + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 2bef856b1e707cc5feab81fa1495eea3 + + 1993-03-24 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 712028000 + + + + + ac68542da789a7dc0af6c5720fbb34a3 + cash purchase of new shares + n + 10000/1 + 108108000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 1061d81adb4fd29b8c0cf4ca9b8749ce + n + -10000/1 + -10000/1 + 049676696675474217124e24f44fbaa7 + + + + + 807b16cf00bc2ccaaf1211e9b2381a78 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 739492000 + + + + + 1bc6565a14e00c0d6a6a7db76f41a4c9 + n + 12/1 + 127800/100000 + 31123b56c4780f491050562fc2bbdc20 + + + e14124bc06eae1af067a643ba92eff37 + n + -12/1 + -1185000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + a8736c9099432aa7fd29e4cf9d2c970d + + 1993-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 795666000 + + + + + 3dd37a9242ec74996893160e5d71f855 + n + 48/1 + 513000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + b11e0746d5e760cf2f718bbf14b9841f + n + -48/1 + -4771000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 59778b68e3d8b5693bb715feba57a77e + + 1993-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 799715000 + + + + + 6da711d886f3da8ae604be4d5f0652c0 + n + 50/1 + 534400/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 750870806cb38d6df774e0b51a972d08 + n + -50/1 + -5045000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + e92ccdbe06a83860a78222466284dc53 + + 1993-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 852837000 + + + + + 3632bd8b8c1d4ff0149cc8c28e139aa0 + n + 226/1 + 2354500/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 88b6bff1f9fc2edfe7664189bb3d840f + n + -226/1 + -22603000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + aa9dac0057c046197512332844ac9827 + + 1993-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 887346000 + + + + + 4bce5fe956a23977cc88a47cc4b260b9 + n + 55/1 + 568900/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 7376dc1e8143c0ba3bebc4de2af4856a + n + -55/1 + -5484000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + f01d18bd7c09e76656ba7786fdbf9fc5 + + 1993-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 920642000 + + + + + 9ea03b2098642d0df9461d1150cfa9c5 + n + 55/1 + 569300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 226f733b11e7b3ab495c45f547356b20 + n + -55/1 + -5505000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + ae8001b1ec50f8236076febf23490d52 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 195612000 + + + + + fb4a9a74d2bf79e02840a95b9199a7d2 + n + 59/1 + 606200/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 61c5423316bedf031161ae265757cfc2 + n + -59/1 + -5862000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 94cd334f796417977e30d75d77c86e22 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 242264000 + + + + + 98053dd6c8f196706d655b1675e1a775 + n + 62/1 + 628700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 4ece3b478a25224ba650866982aa67ea + n + -62/1 + -6168000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 702b53683bcd9c8c1e159eb9369c2ee2 + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 292049000 + + + + + 0c6d7369a398d029b4ae04ce836595b5 + n + 62/1 + 632300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + f90f3a84572baab0b9d75905d0dbe916 + n + -62/1 + -6234000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 6c7cfd9e102e1af0f49c6e53754bf3ad + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 426822000 + + + + + ee7c8aa6d4cc0bb212f362cc79931167 + n + 157/1 + 1597300/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 95936e8396168df8e2a18abeb5261025 + n + -157/1 + -15749000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + f1ae27cb77d1795348cbbb16d3ff2ff2 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 481957000 + + + + + 036e63c27a9d15f40538555dbb10c72e + n + 65/1 + 645700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 98e55a5dc74421e8c2501d50c0542fe1 + n + -65/1 + -6522000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + cf4b289a3f94b40146399663dc80a6e0 + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 564263000 + + + + + 76a9e0105dab132b9c429d647dfc1413 + n + 53/1 + 524700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + e8a57377cf20cda9b751f2b306a83dd6 + n + -53/1 + -5273000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 458f3f6be3288fadb9b6440065e5ef93 + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 664060000 + + + + + b9673d952ad2f802cc98654c3262edd9 + n + 59/1 + 605400/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 49f78ff1076ddac8920fcd2d97761286 + n + -59/1 + -5897000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + f7e538ef05270d922fda8c5298988e01 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 716774000 + + + + + 85052eee575a6492da7fe6ad88c84ad1 + n + 56/1 + 583700/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 60f520f2fa00574621e14eba96647912 + n + -56/1 + -5598000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + fdc8b19dc6369cec2a43d4c80046afe4 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 764011000 + + + + + 3644e52fef6f6892c06e5fae6389c54c + n + 58/1 + 605000/100000 + 31123b56c4780f491050562fc2bbdc20 + + + 0072681a2f7762843e83e2e09ca23db7 + n + -58/1 + -5766000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 96c4757f5cca3a9c368d1905a74732b4 + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 849025000 + + + + + ae3ea80590e756f606c0b8da843cc990 + n + 271/1 + 2952100/100000 + 31123b56c4780f491050562fc2bbdc20 + + + bc258404fad94724f70dc9ab47d878b9 + n + -271/1 + -27100000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + 8aa8a081a1d3555b12bdbd48a7ab11e5 + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 900265000 + + + + + de885837bfb6e4e337cf9181e12a2918 + n + 62/1 + 676600/100000 + 31123b56c4780f491050562fc2bbdc20 + + + f649aaf59096635af00416fab27f318b + n + -62/1 + -6218000/100000 + 98a3d87a9305f733420ceee444cbfbe4 + + + + + e474a781b6dd39d47df7054a00967351 + + 1993-04-28 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 792210000 + + + + + 31819b1d0297836715e133668cc22d3f + Cash Purchase Shares + n + 15000/1 + 84602400/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 6934c83abe5eb7d2c5d7f615884dd0ce + n + -15000/1 + -15000/1 + 049676696675474217124e24f44fbaa7 + + + e2aa4945790c5f3827d236f83be1f8cd + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 11eb86bdb962aaa3b9b6fad8c072ac90 + + 1993-06-11 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 831653000 + + + + + 4a53c002e046a2731d97e7d7ce81cf85 + n + 76/1 + 426800/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 54fecb8b9f9afa5329aec37fc3d03561 + n + -76/1 + -7614000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + 51cb01edc64bba0e2993125bce17df01 + + 1993-09-10 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 183541000 + + + + + 2e479785411ce1d08762495aec13d461 + n + 77/1 + 407700/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 5b2e5df3f9a40b0800848583b8631546 + n + -77/1 + -7653000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + ad9b481b333437cab0b4f4c06b11551d + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 390709000 + + + + + b4c314bf4a41c728c352d645ad6f081c + n + 154/1 + 843100/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 13e7aa9d0c6eb8706b327dbf060aec27 + n + -154/1 + -15379000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + 946c37823a95f7b9b92c25d8789d79d0 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + ca7a1c3b3ab909c9dc31da6305b93452 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 395796000 + + + + + 26cc55521b3c2e65b1e9bcdf2a5b2071 + n + 367/1 + 2014100/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 89867bf0a499d288e80d854616810def + n + -367/1 + -36738000/100000 + f9599ed5ecf62d2c9326766617d6e5e7 + + + 5a42ac80db6d1ce43177dc26cde65f33 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 5af90318a04065fe126ee556561331a0 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 401628000 + + + + + afab0a7d86d8fa27f25b05f734315d3a + n + 214/1 + 1171000/100000 + db2182ba7d730b4e90c755d29c64c894 + + + fa3fc263acf9ea772ceb58ccdc7896fb + n + -214/1 + -21359000/100000 + 2998f1baa86deced08bf21cb73d4d194 + + + + + 7a54b46f2cef91ace91f0c87544bb067 + + 1994-01-07 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 463277000 + + + + + edb4434b3a8c49bf76a3250fa876d85c + n + 27/1 + 143600/100000 + db2182ba7d730b4e90c755d29c64c894 + + + cde6f16e51027a569c2b23ca5dc0c10e + n + -27/1 + -2684000/100000 + f9599ed5ecf62d2c9326766617d6e5e7 + + + + + 665953e9d700d68bc28db4afe13a4e8a + + 1994-03-11 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 613627000 + + + + + b9a8fbba701dc5b6a22adce249474c6c + n + 81/1 + 431700/100000 + db2182ba7d730b4e90c755d29c64c894 + + + a2ca29098d344753ea37638733dafdf2 + n + -81/1 + -8064000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + 9c41db9da4c14a6440b6c45cfe09cae9 + + 1994-06-17 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 839384000 + + + + + 3ee99a601013abd81e2ddda8041f3274 + n + 90/1 + 475900/100000 + db2182ba7d730b4e90c755d29c64c894 + + + 28e2e349e98342dcac45c6e9a2b55b3c + n + -90/1 + -9004000/100000 + 6344d1b4710050ba1fd600c56eee740b + + + + + e6babb418cdfa6cf7fbca87b26ed1cc9 + + 1989-01-01 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 389282000 + + + + + 96d4d8f635a24068e09c73e6fb953539 + Begining balance + n + 1035/1 + 103534000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 75d166405c5dd0602d4e2d92d252f0c7 + n + -1035/1 + -1035/1 + 7914214426a5a0d6f1d6d64c6614f80a + + + + + 5c334d6efca5066702c73a8390044188 + + 1989-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 394957000 + + + + + d337975b9b80b9afb4c06e409ca405f3 + n + 7/1 + 715000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 9e4af5d40e7d6bf5908ab77f7a13c89e + n + -7/1 + -715000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 8f02fa6a632677e28db8d974b9c9315a + + 1989-02-03 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 400522000 + + + + + 11e7384b7d6ecdbf7faa26b093f891f2 + purchase shares + n + 1091/1 + 109066000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8432d0aa4cc02a276f1f45fe3ae14825 + n + -1091/1 + -1091/1 + 049676696675474217124e24f44fbaa7 + + + + + 38b5580e05778d99045023e671de91a9 + + 1989-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 403213000 + + + + + 58ca624f452c025769c282e30c314861 + n + 13/1 + 1278000/100000 + 504f743d68e663efff21fc66b85cc491 + + + eb2b11486353dce3bca0c504597e8b20 + n + -13/1 + -1278000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + c25f1a743d6fb8864cda7ee6e19953d2 + + 1989-03-22 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 415826000 + + + + + 0c3e5a0ab693676b3b84fab5d3e956d1 + n + 5666/1 + 566589000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 54a1174f4e9702c09b56ae1681d6c5ef + n + -5666/1 + -5666/1 + 049676696675474217124e24f44fbaa7 + + + + + 3f26366daa3b50c6fd7d2ce5e3c3584d + + 1989-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 419387000 + + + + + 0884d78380b56a1e9b90586268259c7c + n + 29/1 + 2856000/100000 + 504f743d68e663efff21fc66b85cc491 + + + cfc52aead2461b3a95abb33328e3515d + n + -29/1 + -2856000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + a835f2c0abf07e7549d5daf10bc42aec + + 1989-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 422649000 + + + + + 3a927a15a41fcf7c8f9d0f447c907e4f + n + 58/1 + 5818000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f546d7d2e2003043c73649f090dbea71 + n + -58/1 + -5818000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 95f60d468310a3950d83e5f08a7b1c16 + + 1989-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 426211000 + + + + + 1de0cba62a5faf210f8b867819f9722f + n + 61/1 + 6098000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4cb8e72e13810b24a9e9fe265ed55087 + n + -61/1 + -6098000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + c859526e0d4668d02f9897bc319d51b4 + + 1989-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 515035000 + + + + + b57da2c9f2404a189b7a4a27d1d0b793 + n + 58/1 + 5788000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ab6dc7118f2aa49e971c10187ab39709 + n + -58/1 + -5788000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 0741d26f2f8d0fd82f37c90f084780af + + 1989-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 523107000 + + + + + ec1f84110de1dd028c40c88509b4c000 + n + 59/1 + 5854000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 7d8f938c0988a8e2f403131f678cb352 + n + -59/1 + -5854000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 539ea424b94115c3332764743d7fe2e3 + + 1989-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 529783000 + + + + + 55749d7ad029749d22b145b2c642c2b4 + n + 56/1 + 5601000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 84f06f119d194ae033e785df319bb51b + n + -56/1 + -5601000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ac907f0c0a2deaf17de862f5856862ee + + 1989-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 543932000 + + + + + c4092c32aba244e0fd93263b1cc9c865 + n + 57/1 + 5653000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ddb33cdbc173804ad8708d9d244beaa8 + n + -57/1 + -5653000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 55d2535d747a99c84f22b0180725f0e5 + + 1989-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 553825000 + + + + + 7f15db289e0818b99f0c740a1d238168 + n + 54/1 + 5443000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 11e3aa802adfaaef68f0fffdff311ee4 + n + -54/1 + -5443000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 4aa4446650e67ec366c8f569a8576702 + + 1989-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 572519000 + + + + + 06200f95e271200176fcb36e24dacfa0 + n + 54/1 + 5360000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ff5453213d2bcac617886531c9aa0849 + n + -54/1 + -5360000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 5eabc4731bd0d2b2308b05071f6a2418 + + 1989-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 624189000 + + + + + cc786f774da1fb052e0e3171036511df + n + 57/1 + 5691000/100000 + 504f743d68e663efff21fc66b85cc491 + + + dd4327f729ad89ff44e233284d800aef + n + -57/1 + -5691000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 34f0c44231e4a2174a2946f19790a5df + + 1990-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 632046000 + + + + + 754a6519a183b44d57d451b2335dd0e1 + n + 52/1 + 5159000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a9ab80d0e4bb4a70f01195662a44d72a + n + -52/1 + -5159000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + d214295b9d3d35ce5c28c92c658b4a38 + + 1990-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 642472000 + + + + + ad15d3114f57b5f7e783737acaa42fd6 + n + 48/1 + 4791000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e2871523aa0c231f85e038a8c6858ee5 + n + -48/1 + -4791000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 5e68ffea30d5c1d8b28f76bcf069f7ff + + 1990-03-12 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 658326000 + + + + + eba68249ed49fd4a51d3fc3530052ed5 + transfer from fido cash res + n + 5397/1 + 539675000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 637677169bedd2b16433b002a7e5463b + n + -5397/1 + -5397/1 + 049676696675474217124e24f44fbaa7 + + + + + 692eeee39ddc1987a71b6dfc2c4aabbf + + 1990-03-16 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 665613000 + + + + + d56aae4b1d0c8480f8b348ec3981176d + take cash out (buy house) + n + -7500/1 + -750000000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ff3d61007b332deab2af4b1e1838b19c + n + 7500/1 + 7500/1 + 049676696675474217124e24f44fbaa7 + + + + + 630212e7a9af48d2bdce7dd53077d047 + + 1990-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 683102000 + + + + + 8d11af144c82d5c46488796105436ebe + n + 56/1 + 5597000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 0148f9c81156f3dadca1e94463b4c542 + n + -56/1 + -5597000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 4fcf15a9ffad57a8a6a59fa460a04c7e + + 1990-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 692027000 + + + + + eeb7751a7ab68c8ef4f3fb7c35d5f91b + n + 38/1 + 3837000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4403f534186364dc823350fd98504937 + n + -38/1 + -3837000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + dd0348326ab9b484c77db8dab8d7b8cd + + 1990-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 706155000 + + + + + 06e5bde29cc69c45f2789fdf050d1373 + n + 41/1 + 4129000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6fbdb1d02bd30ddd8f2eb266655380a7 + n + -41/1 + -4129000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 9b8df0176ea5bbe8a553d4494870fe0a + + 1990-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 732758000 + + + + + 8d805bd823c72681ee9426d917cc83a7 + n + 40/1 + 4042000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4b93d32188f02c7215638abe41cf02dd + n + -40/1 + -4042000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 82f32d501f776aaf9719bca5f45e81d0 + + 1990-07-09 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 750573000 + + + + + 3df9af77ec71c1b04f4608a75fca5a32 + cash out (buy House) + n + -8433/1 + -843295000/100000 + 504f743d68e663efff21fc66b85cc491 + + + bb74c0aeb5375f38d352404c42d4e234 + n + 8428/1 + 8428/1 + 049676696675474217124e24f44fbaa7 + + + 8f7ab2ad8d1022c3de07be459aaab076 + n + 5/1 + 5/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 7e8694dc9b9ce81b345f0b4c730762c1 + + 1990-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 763310000 + + + + + 304ac1b62b8df46b36db8f205cb0f0a4 + n + 20/1 + 1997000/100000 + 504f743d68e663efff21fc66b85cc491 + + + ce2a535aa847148dfc7853d3141c9209 + n + -20/1 + -1997000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + cf1a6e82398177074bf8a4d5217cd56a + + 1990-08-27 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 781712000 + + + + + d5f91865493ba37d382f0a4bf6a5210a + cash out (buy House) + n + -1000/1 + -100000000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1247dad386de42e1c4dea321d6283578 + n + 1000/1 + 1000/1 + 049676696675474217124e24f44fbaa7 + + + + + 078bc06b99dbed94c4995583379e8d1b + + 1990-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 793770000 + + + + + fb0a02d43964143d8256d9636c8863c4 + n + 9/1 + 909000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a6b88e7dee354790f0c93cb309eacbb2 + n + -9/1 + -909000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 0e62079bb110e69045e87fb7f3fba34f + + 1990-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 822127000 + + + + + d90c480abea60549c91242ee53f45224 + n + 4/1 + 354000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 24bcefc310d6a052cd40c4022b4b450f + n + -4/1 + -354000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 9b10bc1d277192d347e2627072397574 + + 1990-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 832680000 + + + + + 7a3e9ab55e1d259a1ac913dee4643183 + n + 4/1 + 366000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 42c47572ad9785f3ada14996e84e2adc + n + -4/1 + -366000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 47404368925a74736fc986cb775e4d56 + + 1990-11-16 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 843406000 + + + + + 93c5a6789b1f00e0b318e6a4cd5ed76b + purchase shares + n + 425/1 + 42500000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a374ebb0eac8a9f657550ea96d48de6f + n + -425/1 + -425/1 + 049676696675474217124e24f44fbaa7 + + + + + d4ef6eb81b9feba3ee47271361b8603f + + 1990-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 855909000 + + + + + b1ff8381e75c27b035a808f5015b68c1 + n + 4/1 + 447000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b17c3d997d3a8994f31eb5dec39998cd + n + -4/1 + -447000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 0d85f4ce30ce71ed8e19ab28fe1ade2f + + 1990-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 875804000 + + + + + cd4a0e875d5f30a14bfade0f7a072fe4 + n + 6/1 + 605000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 35b89055943c253ed7e8e9d6181f5fcb + n + -6/1 + -605000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 7dbfd4541c986e69c978ccd77270cb8a + + 1991-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 889309000 + + + + + 79a0a41f0bff4c1d2afa4ebb2a561904 + n + 6/1 + 585000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 368ade1c0db96fc1f559c3604d38a88c + n + -6/1 + -585000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 74ba2148e61532354383bd42e57cf72b + + 1991-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 902153000 + + + + + 3275e6942ef10e12a9b033167d1e0289 + n + 5/1 + 497000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e7f079f483e0611ef8fcad08fa211e1c + n + -5/1 + -497000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ae215ac4450c7fdc9cfae43ded18a6eb + + 1991-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 931615000 + + + + + b94649e35b73722efc091d1327741542 + n + 5/1 + 525000/100000 + 504f743d68e663efff21fc66b85cc491 + + + cce34d274be7aac5733c88edf02d70c0 + n + -5/1 + -525000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 19e144969f80691b55f520d9f7e1693c + + 1991-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 954218000 + + + + + 3fd446e24ab39007c0ac7d792f1e906f + n + 9/1 + 920000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 480658716ecb1dfd8158da9d41519b7a + n + -9/1 + -920000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 033f95a4a7de32e2fae99207a04dacbc + + 1991-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 965787000 + + + + + d58e5de8f98b9d85170f2ab21b131339 + n + 14/1 + 1432000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8654ed4dee8acefad698097c85746bd3 + n + -14/1 + -1432000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 51844fed5bb3020423a08e4e23cd1d9f + + 1991-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 35491000 + + + + + efa0e6671b9544ef6ddba54810438a7e + n + 14/1 + 1379000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8213b451f6dec5530ef8833d837236d8 + n + -14/1 + -1379000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 23c2280097f26cc4e504f97a9dd8fb5a + + 1991-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 50028000 + + + + + 59c871254f1fca125996ad1ce3ca85f6 + n + 14/1 + 1426000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1085be41c4701b0f8a8e2627b1412dc9 + n + -14/1 + -1426000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ca24f0b0433cc40b1fe4b9a06778d379 + + 1991-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 65209000 + + + + + 7d2d52263114ec0de700e5f5475b9fac + n + 14/1 + 1402000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 42fce7ace0f4b2b9fb6534663ebbb20c + n + -14/1 + -1402000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 4f8ac60168907d0e11ce5904c8e659f7 + + 1991-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 130770000 + + + + + 5b6ec599799869f7147d5ea707c84188 + n + 13/1 + 1328000/100000 + 504f743d68e663efff21fc66b85cc491 + + + fc03e7e14cffd8889df403d75e14c408 + n + -13/1 + -1328000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 7303272548cabff2e55e85961abc7089 + + 1991-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 144398000 + + + + + 2b43d6592111776698e05ed597300218 + n + 13/1 + 1328000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a765829123655bc68b167fb53995535f + n + -13/1 + -1328000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + a7f3271591f62f5a6ad058584f4992b9 + + 1991-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 160459000 + + + + + 9a680e409958aef3365b904a5eaeeba6 + n + 12/1 + 1206000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b0fb80246186505ce12f6a0aa4b21a37 + n + -12/1 + -1206000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ac804db71bf60a0da9893aab43b606a3 + + 1991-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 193766000 + + + + + f820b7a9d458d3240cf82b6a75d1226a + n + 12/1 + 1209000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 67bf73e03580162f208370de02cf8c74 + n + -12/1 + -1209000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 9042b1546b60746e1915c964adc8b946 + + 1992-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 210773000 + + + + + c8d8236fef054e084eaeb478bf123a20 + n + 11/1 + 1137000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 16da27ff728677d7f96e404a668ab046 + n + -11/1 + -1137000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 04e396b2528f924fd0fcee423501b765 + + 1992-02-29 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 225678000 + + + + + eba830bc519da51d0f5401eda4a5c6c8 + n + 10/1 + 990000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8aa931136d51ff2e60b26949a4e0de4d + n + -10/1 + -990000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + b1097c2a04b334c4c4fbcd6e47dbfd06 + + 1992-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 262643000 + + + + + 4bdd241e78a7bb2bf39dfc52aeec3d51 + n + 10/1 + 1016000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 05c28431acdb016c5d3e019d42ee36ad + n + -10/1 + -1016000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 2cf4558c2ed4427629ce642cdabdaa36 + + 1992-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 280782000 + + + + + c0b51b204f08bae0eaf048c6bbe2ac7a + n + 10/1 + 964000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 982b60403b679389bcf32c0c38c490de + n + -10/1 + -964000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 8131576d5232037bbd5300fbf6725aba + + 1992-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 295354000 + + + + + ac0417fd4b173fc2496e4e0a8a13de5b + n + 10/1 + 977000/100000 + 504f743d68e663efff21fc66b85cc491 + + + a8f1be4742363871768dbb3b4086588a + n + -10/1 + -977000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 255c7f61d284a2d9f85867b67dfcf57d + + 1992-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 324440000 + + + + + e00642aca866b48a88d3bfacec563ee7 + n + 9/1 + 941000/100000 + 504f743d68e663efff21fc66b85cc491 + + + fd2390ea514e6069f3dd61bab97d9758 + n + -9/1 + -941000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 129fd901eae714632e44c0bfea4e65d3 + + 1992-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 344988000 + + + + + 0fd5f403cc687066cfd8ea0c6a9c3f82 + n + 9/1 + 883000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 91f34ca6157341b89c2febc0b2ab6067 + n + -9/1 + -883000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 751f44bb883bb03146dcc35a0fb8cfb0 + + 1992-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 370192000 + + + + + 8730b5f538e382c10c525d2d8471dfbc + n + 9/1 + 853000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 604dedc86c272bd1e50ff2fed42b7a0b + n + -9/1 + -853000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 9b90c1a6b84db4ae1eeb39f44be2ea5c + + 1992-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 432558000 + + + + + 05a8a3074aead03cb6b84aeab89597dd + n + 8/1 + 779000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8a301cd2e7bcb7e9179067ebfd4ca615 + n + -8/1 + -779000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 3b61063f49affd817d6bc54007b75e6e + + 1992-10-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 459844000 + + + + + d0b1464eeb0b33e6445b454e1d17f865 + n + 7/1 + 745000/100000 + 504f743d68e663efff21fc66b85cc491 + + + adecb93d2eafeb4a5f37c5c8c47642c5 + n + -7/1 + -745000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + b6818336b95441bf9110bbd009a65c9f + + 1992-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 526076000 + + + + + 9436b1afbe7df1bcb1fcc45afddef645 + n + 5/1 + 480000/100000 + 504f743d68e663efff21fc66b85cc491 + + + b1cadab9c8afb87a32b51adb06f49ef0 + n + -5/1 + -480000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + dce8d1b3cc504f38db473b620befee8a + + 1992-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 591693000 + + + + + de92596ce277ae625af138e8aeb32e0e + n + 3/1 + 278000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 83e945b7518aadf9cdc4c0d13bb4a6fd + n + -3/1 + -278000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 02af01c94469d4a7c0f9f4386b3022ff + + 1993-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 640235000 + + + + + bd229859f21da83c0322433055e2fa96 + n + 3/1 + 272000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 377cc39754d197eae3473ecefc5bd4fa + n + -3/1 + -272000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 7185987ca229e586b5559d057c1778ec + + 1993-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 667629000 + + + + + 56af691f67daf003793b6738af6af9cc + n + 2/1 + 233000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 86caf3ba4acf80af6cf152ba5b408d71 + n + -2/1 + -233000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + e8bfcab70cb2cf146eef4cd99510b250 + + 1993-03-26 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 724378000 + + + + + 19a250aec8e0d953757a5f9818226517 + n + 2/1 + 234000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f28263afe61faf6c3a6a99960879110d + n + -2/1 + -234000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + a35e0cc2081fbeaad001cd6a325b2421 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 761094000 + + + + + 5afdde2446a7a37ebcc0952ebb125869 + n + 0/1 + 26000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f06294070bc12a6b4eb9b8dc3784c026 + n + 0/1 + -26000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 1c9a855b202087f52650b7085d827708 + + 1993-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 781218000 + + + + + bda09deb15ebf03ab9238278cdf5a70b + n + 2/1 + 249000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 46f89f5961f87c6ef02a0c62ca21b242 + n + -2/1 + -249000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 2764ca2edcea3954172cc441d2c7d90f + + 1993-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 820663000 + + + + + 440c19e324948ae3edc27e4a12a2421f + n + 3/1 + 257000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 10b492490ddd9f1bc163fb27b8cd80f2 + n + -3/1 + -257000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 4bf18f4c3d11cca5dc7dfff1e6bf589c + + 1993-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 873979000 + + + + + ada5fb98cffd6349ce27e51f48294ccb + n + 3/1 + 253000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 7ec6ff2b2959a858eb8dcae79feb78c8 + n + -3/1 + -253000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 954fd23c103cd5318f22b6752a244f5f + + 1993-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 902174000 + + + + + 53a76540735369c6657e3005d8470fb1 + n + 3/1 + 262000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 48e97a32c2b09d45d679ff1d69f8fe35 + n + -3/1 + -262000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 39fa16b35817b4783a52c5e733c28c2e + + 1993-08-31 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 934365000 + + + + + f2b3d37311886a13d1d3859f25d0696f + n + 3/1 + 267000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6dc8461c1079d2c38716ac66e471925c + n + -3/1 + -267000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ca3d4b34bd366fab161c257b6e6e1d74 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 221118000 + + + + + 455295f1ad8bc7b7e965848106f5c766 + n + 3/1 + 294000/100000 + 504f743d68e663efff21fc66b85cc491 + + + d9b79576122e51313739ea2488e9e94e + n + -3/1 + -294000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + e5b1dc58c3ea6bb2ec3a4b2ecf1436a5 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 271797000 + + + + + 17aa3ebd0e6e31a088c642db883d8d4b + n + 3/1 + 303000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 9a0d55353c1f87d395e0b824df740dc5 + n + -3/1 + -303000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + b59979b6f4b4833b8a61620420f23aed + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 311218000 + + + + + 1a86f3fe915764283f4b45ed95d1c9a4 + n + 3/1 + 299000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 6a0dd87d95a6c34a892a6e7e769a659f + n + -3/1 + -299000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + ca634e532d36113a082175d1e06662c0 + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 448368000 + + + + + 0d56232f699d960fa474834b23d08a3b + n + 3/1 + 315000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 4c0cca6f7b66351ac80fd15cc3f1011a + n + -3/1 + -315000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + b276dae985a2c3a97d3b2330378b6297 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 540528000 + + + + + 856dd4d6545ec548fc29f0d948e1b2e6 + n + 3/1 + 309000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8dcb67197a1fa0c9b44bb130e021d4e9 + n + -3/1 + -309000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 8fbb472426c3ca614088d67e8f5b0152 + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 600129000 + + + + + 1b669a50da328d349b69956e298c16e4 + n + 3/1 + 277000/100000 + 504f743d68e663efff21fc66b85cc491 + + + f651749f0cf251c849e71ee2d98c7006 + n + -3/1 + -277000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + a277ce0a96bc349205bd324ab6f8cb54 + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 691841000 + + + + + b07882460f9a6ec409894705590fe770 + n + 3/1 + 317000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 0bd2ef253060a2dab65671fd0d8476ef + n + -3/1 + -317000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + c70ac48517d009defdd706045569e8f1 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 750397000 + + + + + 53f04c4112f05256f1d5f720918c8f70 + n + 3/1 + 329000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 8ea4e0e8172c4e43ece6e227d6c677a5 + n + -3/1 + -329000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 0be7260f31dd7e2b4f6f76fe500e2659 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 798535000 + + + + + 8ac813c74b15d31857387e2b0f4397c9 + n + 4/1 + 367000/100000 + 504f743d68e663efff21fc66b85cc491 + + + e005f80663e2ea0ca84417276745126f + n + -4/1 + -367000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 967e81d2ab739becc7c36ef594011230 + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 873703000 + + + + + 57e940882e772653ecf750e2852e4ca9 + n + 4/1 + 382000/100000 + 504f743d68e663efff21fc66b85cc491 + + + 1764cb1267dcea247be22e19476a6670 + n + -4/1 + -382000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + a5bb6168c59780b6ce7367f9f26995f0 + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 923053000 + + + + + 7af76d3548fb7afcf755b325759b166c + n + 4/1 + 418000/100000 + 504f743d68e663efff21fc66b85cc491 + + + c2a2ea53d2bb8d3a774c9a77a1402b65 + n + -4/1 + -418000/100000 + 11709b1c45e84450d7a282228e69b56c + + + + + 149ed9ea42cc89e08ef96300b3080d16 + + 1989-01-01 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 387023000 + + + + + 65ae85436328d0d6ab0800c3b6f5f366 + Open account in Quicken + n + 47/1 + 304900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4518a65ee0ec3e10ea9dddbe6499f541 + n + -47/1 + -47/1 + 7914214426a5a0d6f1d6d64c6614f80a + + + + + 365c9a0167086387f6ccb8fcdecb837f + + 1989-01-06 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 392268000 + + + + + 97c3ad87d053aab532fd5b3c6d0fc10c + Cash purchase of shares + n + 500/1 + 3261600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 851a7c2c88dc2970da3c80bf5c26939f + n + -500/1 + -500/1 + 049676696675474217124e24f44fbaa7 + + + + + 21e754661b3e94c7b30daf3a937d7a00 + + 1989-03-22 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 406030000 + + + + + 566ce60f563de98589a9934d9dd6a859 + n + 5/1 + 31800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a1f84a720324c83aab24feb18870125b + n + -5/1 + -499000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + d50bb3ef3c3874be6ad3fa7d7747c18f + + 1989-06-21 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 502484000 + + + + + 3b6e6325264ef5047d53044e8697073a + n + 5/1 + 28900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8618553266c7792f56f3eef7ccad5c3f + n + -5/1 + -504000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 853e90a843bc6ca754e0020f880ef2e1 + + 1989-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 534827000 + + + + + 43a864456b7123bac2ba62ce56018f77 + n + 25/1 + 136400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4ea6145f1a537b11359c5a4c0ce955fb + n + -25/1 + -2466000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + 43dfa6fae54c4aff73790aa4ba0aa0c9 + + 1989-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 539150000 + + + + + 200e6596b0041b4813a98817283e5af6 + n + 5/1 + 28100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 36e0c9b9f1d91123bcaec148d51715d2 + n + -5/1 + -508000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 73a130f18115279128d42807eecd9d17 + + 1989-11-10 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 566126000 + + + + + 282cd6c6458cea3b89bef3590eb83ccb + Cash purchase shares + n + 7000/1 + 40045800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + fc0c9984db19d22c0080c274096908c7 + n + -7000/1 + -7000/1 + 049676696675474217124e24f44fbaa7 + + + 66ca33deec7dc6bbc78add0607119ece + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 23cb1f7f4409e51a476adc9ef195900b + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 580938000 + + + + + f1b677ba88b8fa17b03a9768d7716e75 + n + 219/1 + 1293900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 292aaed2f44da96b0de02f2239004b66 + n + -219/1 + -21919000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + 2b08ee848c95f18f12db77217eb36b4e + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 599777000 + + + + + 05e092d86bde4e58ccde836f1bb97b78 + n + 39/1 + 232900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 7a799696a5ff64873b78831eda310584 + n + -39/1 + -3945000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + 58d7805fcf5932e1a5f0500963d96450 + + 1989-12-07 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 605179000 + + + + + af046937a608b87d08b5f11d62c6719b + n + 145/1 + 854000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a61bf38bd8c7a3ff10b2102096f39ff0 + n + -145/1 + -14467000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 08ea79689b54b587b246bea23125f998 + + 1990-03-09 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 650450000 + + + + + d0872878240512ae65ca17068a914909 + n + 65/1 + 388600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 93f7d49022ac65f90bbc3fc53eaf2b96 + n + -65/1 + -6470000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 6ab9b6845369243f6551f22f9525e582 + + 1990-06-15 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 715197000 + + + + + 28caae2a98bb78da3a71f2a905299b1d + n + 65/1 + 376100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1b39b7011524db6f6e2991876822e4a3 + n + -65/1 + -6525000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 680d192c14288d0ed7637fb851a29be8 + + 1990-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 802554000 + + + + + 809e546b9f88e57482cf9e6a5d5cca8e + n + 59/1 + 387200/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + a5c2aa715587537eb4e360b7c7a3bab7 + n + -59/1 + -5936000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + 13db67067727f862cdee747851412a42 + + 1990-09-07 00:00:00 -0400 + + + 2001-03-26 15:41:48 -0500 + 809391000 + + + + + 5e2677cb59f886298068cf7adfccd6d2 + n + 38/1 + 246400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 4d2c8bc73228c127091b9545542d56b5 + n + -38/1 + -3778000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + bed35a0912239f4a0f0b9911e640ab92 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + a9ac82622309af3adbbb3863f99f6574 + + 1990-12-14 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 867579000 + + + + + 4e936b3f336d88a496bc028425cd85bf + n + 44/1 + 292800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 339c1d82ea13e3638f015ffc192badf7 + n + -44/1 + -4419000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 30c67568c9f6bcef04554aa66ba918b0 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 28cd07143b428794f4a06eae5ecacb02 + + 1991-03-08 00:00:00 -0500 + + + 2001-03-26 15:41:48 -0500 + 915250000 + + + + + be884d993442652f1eb2b6daa1b0d08f + n + 33/1 + 180400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + fe036a7cfe1cdcd097553265e00f1298 + n + -33/1 + -3348000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 8b49f2c93c966b41993f643760400feb + + 1991-06-14 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 9336000 + + + + + 55ce7fda5ef77face473882660e5cf92 + n + 18/1 + 91900/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 5efe020018b2f5f4b3e543a2c5f39c0a + n + -18/1 + -1809000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + d443f15fdb90108970a3a2816aa832f1 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + f751b22486e6c264adff44f5222e0bab + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 84032000 + + + + + 3811f3094ab0b7fce236b5d7269e924c + n + 69/1 + 357400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 34127722283abfdbb20760bf54eaa751 + n + -69/1 + -6909000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + 4e4b7413fc3c654d36941e6ac38584e5 + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 101337000 + + + + + e463c0d19439e55a8fd191cbde39a40c + n + 18/1 + 94100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 34699eb644cc32a207fa804228e6f5c9 + n + -18/1 + -1818000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 4f0e9a20946ab3f48bf42624b6955935 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 60015b9113b9c1fc9ae8f9741c9f3d98 + + 1991-09-06 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 110059000 + + + + + a8f2a9e9f53f86ee2bcfe4d09631bbbd + n + 47/1 + 244500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 70cd251135221dd0d741d859d5a3c242 + n + -47/1 + -4726000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 2f28a3dc872fa18648c555e84e528e3d + + 1991-12-06 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 171475000 + + + + + c80432358e199c99d62da70c8c09cbdc + n + 11/1 + 59300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 6af85c51032b652c0bcfa1213bc778bb + n + -11/1 + -1133000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 376483f378a511050e4a30e4251fe4c6 + + 1992-03-13 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 250396000 + + + + + 206c29a967fe63de592935d3b7f0a878 + n + 19/1 + 90300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 7709a6924ce69fcda1004ffafc285696 + n + -19/1 + -1894000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 723f94b81b3e839a17cb3571c263a92c + + 1992-06-12 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 312749000 + + + + + 73a654e5d18b53c178873951bd77cacf + n + 23/1 + 107800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1450d0a1b0306e4a613223808c4bee8c + n + -23/1 + -2283000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + e889663b2b331ec1e4cc85702a7da666 + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 384390000 + + + + + fccae23b917d5f32ee03bcc40b859624 + n + 197/1 + 1043400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 546f786c11c73954c46900690151db82 + n + -197/1 + -19709000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + 1d68fd78b1e5c0fc13bda01b00b9b39c + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 404235000 + + + + + e3333a92a3a022e37f04bc3852916638 + n + 237/1 + 1256100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 28a9d26d3faa0349d3f1150d34a58159 + n + -237/1 + -23728000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + 89033b8faf4c55804c04d17922a828c4 + + 1992-09-04 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 414657000 + + + + + 99585495d4d90f3518bc65e80f383f8f + n + 23/1 + 121500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 3cc24b671c09f3759f4310e0816d5746 + n + -23/1 + -2296000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + ead272cc9bb339f291b3402376927be0 + + 1992-11-16 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 512951000 + + + + + 117553a5784faaa2459a1fcb34ad2f4f + Cash purchase + n + 500/1 + 2548400/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2abb34ac5e093adc1a476df743dd017d + n + -500/1 + -500/1 + 049676696675474217124e24f44fbaa7 + + + + + efdfa9e23bc696eb52d2bc12c6707443 + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 553043000 + + + + + 29df2eac11ba656319e1d574d3e98696 + n + 38/1 + 196100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8a760fa274caf409fa79e0c9e101e156 + n + -38/1 + -3791000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + 6b4c51f5557800e1c57ecb715b64021f + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 564845000 + + + + + 9521d167ec6083591f07693f6b2d33ec + n + 7/1 + 35600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 1fc683d7fee739d0921bf87cf5e8cd80 + n + -7/1 + -688000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + 1af404c3705adbbdfd3ace86ee1b1e44 + + 1992-12-04 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 578623000 + + + + + a311c0359e76ce0b8ec73908be336375 + n + 79/1 + 410000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 05b3e3615297baf14779f0f84bb57de1 + n + -79/1 + -7926000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + 1cb120babe020bc6d3f27736debafb53 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 90007910c263187cc555646cea767093 + + 1993-03-12 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 682752000 + + + + + 162c6847bbaa7e002983133b755219e9 + n + 42/1 + 202800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2e528934d31ec1e1eb4543f54e247175 + n + -42/1 + -4212000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 54b3dfe257713caa06f3cbf409db8ace + + 1993-03-24 00:00:00 -0500 + + + 2001-03-26 15:41:49 -0500 + 695791000 + + + + + e2d6affec3a4c49d0ff3a7757ca79346 + cash purchase of new shares + n + 5000/1 + 23485200/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 5ae76ee2a0de29fa0b6524fae5153260 + n + -5000/1 + -5000/1 + 049676696675474217124e24f44fbaa7 + + + + + 631806d8503d4fb7d28cf239c23cf6c9 + + 1993-06-25 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 844998000 + + + + + 6c86e3c928c06ebd20053a8bab39aa27 + n + 71/1 + 328600/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 63797e39d23f80d75b45e14fcea27cee + n + -71/1 + -7055000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + d2d7f56bda985ccce1a0ebecf89c6d50 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 950696000 + + + + + e355bd6326c30478b9eaa1b4341f3b28 + n + 154/1 + 693000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 10aa4145f6fce7a29834f32c4ffa8d6d + n + -154/1 + -15371000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + + + 84005d0c927673979de40acf3e6970d8 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:49 -0500 + 972770000 + + + + + bb4559923e98c4df5535b8cb0164ce79 + n + 95/1 + 426500/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + b65c1a346a7e71e95860a1400b260510 + n + -95/1 + -9459000/100000 + d023c36ca9c320b873c5be9993078451 + + + ebd8f2aaed67d7bf4de3b81085e69dae + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 3fd16f527fd978a266d0d91faf95eb24 + + 1993-09-03 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 5018000 + + + + + b3501c1e38ef6817cd0a75d028a8b54c + n + 71/1 + 319800/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 8e3d0d56e2328522d92f968f99112e48 + n + -71/1 + -7093000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + e25c7404323b7e79f5756bd2a77f44c5 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 339053000 + + + + + 4565bd443b712b4f6a2405d51d503116 + n + 97/1 + 444700/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + f2794e58478b54c8668ebb3ad4e7c966 + n + -97/1 + -9690000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 35fd1ee961e2f78097dc7f7de8db6116 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 357816000 + + + + + 63c0bbaa7bb26fbde0d122514b9466a0 + n + 97/1 + 444700/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 993ab7e26c3441bf55ebc2053e255985 + n + -97/1 + -9690000/100000 + d023c36ca9c320b873c5be9993078451 + + + + + ef61b2fc0e6afc2420df67e26a311d35 + + 1993-12-03 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 381700000 + + + + + 5920c6c276608dd8b01334d677e46259 + n + 115/1 + 528000/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 2a8ec163df287a9c639a001356126708 + n + -115/1 + -11506000/100000 + 5b7c74145709c67b9fa6d33ea12c9163 + + + 212ca07f10e6521475e5cd15688262c4 + n + 0/1 + 0/1 + 01ebde432dcc5dee900ce670743eab41 + + + + + 73571733be8d7c8c456c675aa845b3fb + + 1994-03-18 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 632156000 + + + + + 208bb330b910a33b745b3790ac31834c + n + 62/1 + 273300/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + 014a78d4e05c62d13d6169ea9eece435 + n + -62/1 + -6198000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 34e3582727f48f45854d0e890f8ce1b6 + + 1994-06-17 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 818547000 + + + + + 003272498db7bba53825bfcbdc5a729d + n + 62/1 + 282100/100000 + ebec8d5a26522f4a0865fa5f837af17b + + + bb19f3b1a0573d752ddcd5ea11ee4846 + n + -62/1 + -6226000/100000 + 55d69cebd7b9b64b6e9678b6588e64a1 + + + + + 823f3c36840f5467ca9239ae1d6809ec + + 1993-09-16 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 188235000 + + + + + e4a445dc759e8abe6642683594805098 + Cash Purchase Shares + n + 5000/1 + 42992300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 6da3d2779e8df88964a9d5d81b868064 + n + -5000/1 + -5000/1 + 049676696675474217124e24f44fbaa7 + + + + + 7fef1c436ebe86aa96d36413f321ae32 + + 1993-09-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 201862000 + + + + + d993e8aa9d3a776255a8ffafc53a9fcc + n + 12/1 + 103000/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 8260fc59d1b3eb80dc8ff2a88856e4d5 + n + -12/1 + -1195000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + aa9e227079076b70a233408688c8d1f8 + + 1993-10-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 249386000 + + + + + 790eb44b7273c4b9631843cbd0a311f2 + n + 24/1 + 195300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 9a146bec706e7171419b139cdfa92af8 + n + -24/1 + -2433000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + 7511f02356105aa42f378e0f5edc3f33 + + 1993-11-30 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 300351000 + + + + + 5da0d6bf03058755af8118e6c7d9de17 + n + 25/1 + 195500/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 68fb98ef0b084dd328bad9cdacdbf642 + n + -25/1 + -2452000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + 6b23e55ae225e7f230fd0a4b2d7427c4 + + 1993-12-17 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 410525000 + + + + + 259dfe4f85dea0b3c96eba22c3a2be38 + n + 74/1 + 581700/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + fa277d5b6e9b670c5540b68b5f0cc823 + n + -74/1 + -7393000/100000 + 5f4d3dd84f8df6527d5091152aadb4d6 + + + + + 33faf9899a4a6e2d990a42704892ab98 + + 1993-12-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 434149000 + + + + + 39a73d933f6b16e1e020c87ac145aac9 + n + 45/1 + 346100/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + a86ddbe40653a54b736f043f424fd23c + n + -45/1 + -4524000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + 9dc9fe98441ca61e817531cf55331b55 + + 1994-01-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 488179000 + + + + + e363d8bd89db035e1d7e4364cb743e22 + n + 22/1 + 164000/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 9acbdd9b8d6da136b275afc24dbcf661 + n + -22/1 + -2216000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + a1d9094171881e9ff1d6f954dee11b45 + + 1994-02-04 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 554177000 + + + + + 9c931116b323d2edd8c468e061e92673 + n + 89/1 + 669900/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + c364fa516c863144a7896e6bf38b93d9 + n + -89/1 + -8916000/100000 + 5f4d3dd84f8df6527d5091152aadb4d6 + + + + + 0ef4b9dc4ef40a158be6218fba7e07bd + + 1994-02-28 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 572522000 + + + + + 0aa1cab5bd473e8aa0de96fd23954310 + n + 23/1 + 190300/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + e39ef0ace88c5d762b18811372c51ddd + n + -23/1 + -2266000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + 60ef810e4fc8e6c68f5184acfee489be + + 1994-03-31 00:00:00 -0500 + + + 2001-03-26 15:41:50 -0500 + 671287000 + + + + + 2e9bd8a660525096a4a89bff20283956 + n + 22/1 + 216600/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 3964627fc6d4ee837111b90317dcdba7 + n + -22/1 + -2183000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + c7b88f05485f6491eee28e15af2de163 + + 1994-04-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 733134000 + + + + + 2f11ce5bbb83e4314595fad43e84f391 + n + 16/1 + 166900/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + fa962b6cf19cb252de960bc2e8cb8b8e + n + -16/1 + -1606000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + c31086d0195a6c14231a9a4e7f4beaa6 + + 1994-05-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 775582000 + + + + + 54ef9845da30c3e67469c79b116fd23e + n + 16/1 + 156700/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + dda0f5ee0c544c70f897c21870109f36 + n + -16/1 + -1581000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + 967f9ac08912e8cd882811394ae9cd5a + + 1994-06-30 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 861245000 + + + + + b8acd0dde533d8ae0bf28259ce5b244b + n + 21/1 + 222400/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 677ea41cdd9236df34c27a8362b8c393 + n + -21/1 + -2111000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + c9a2c3862a3c2f6db81480552e43396c + + 1994-07-31 00:00:00 -0400 + + + 2001-03-26 15:41:50 -0500 + 908364000 + + + + + 81fa7e919ca3627f8731fff26a2bbe95 + n + 23/1 + 240500/100000 + 0fac2553ae5a682f5ae978d081566ea5 + + + 462625978077b6148074c3d2db8978c9 + n + -23/1 + -2328000/100000 + 4ed39bec2d9009028bc277e7ca58b372 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/goonies-file.gml2 b/src/backend/file/test/test-files/xml2/goonies-file.gml2 new file mode 100644 index 0000000000..1ccb497311 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/goonies-file.gml2 @@ -0,0 +1,203 @@ + + +2 +4 +4 + + NYSE + HAL + HAL Stock + 1 + + + NYSE + HN + HN Stock + 100 + + + Bank Account + 117841ae858b1700a017d752b7f02b09 + BANK + + ISO4217 + USD + + 100 + + + notes + + + + + + HAL Stock + 3619a4f1c902a2f6e39ed311321034c3 + STOCK + + ISO4217 + USD + + 100 + + NYSE + HAL + + 1 + + + notes + + + + + + HN Stock + b0a11711e0f804f7a51981f32556191d + STOCK + + ISO4217 + USD + + 100 + + NYSE + HN + + 100 + + + notes + + + + + + Initial Equity + c421c81f4c3c4c8337b9c9bcac82c8d5 + EQUITY + + ISO4217 + USD + + 100 + + + notes + + + + + + 69ebbc554a972eaf56f8817990cf4cd9 + + 2001-03-26 09:00:00 -0500 + + + 2001-03-26 21:26:10 -0500 + + Initial Balance + + + d17d077b72b60b8a2181579d8ac67d60 + n + 100000/100 + 100000/100 + 117841ae858b1700a017d752b7f02b09 + + + 1c8624f5f9c9fbb5117cdc14d56e4544 + n + -100000/100 + -100000/100 + c421c81f4c3c4c8337b9c9bcac82c8d5 + + + + + f7aa7c9b3b8b9de253919540af3d0de0 + 0001 + + 2001-03-26 09:00:00 -0500 + + + 2001-03-26 21:26:30 -0500 + + Buy stock + + + 33ae98439eca012d42a0da3920784421 + n + 7500/100 + 25/1 + 3619a4f1c902a2f6e39ed311321034c3 + + + ceb6b5a44cf012760ec29a1ed538d4ec + n + -7500/100 + -7500/100 + 117841ae858b1700a017d752b7f02b09 + + + + + 2cefabdbeaf2c66aa1998024efda6dab + 002 + + 2001-03-26 09:00:00 -0500 + + + 2001-03-26 21:26:44 -0500 + + Buy stock + + + 61dc6e69f93bb92779404ee67218c762 + n + 6670/100 + 23/1 + 3619a4f1c902a2f6e39ed311321034c3 + + + 3271a6089c6b05bd688ddf34a4032b21 + n + -6670/100 + -6670/100 + 117841ae858b1700a017d752b7f02b09 + + + + + df124638424fb790b19e7b02ad1a6237 + 003 + + 2001-03-26 09:00:00 -0500 + + + 2001-03-26 21:27:05 -0500 + + Buy Stock + + + 81474a2c840ed5a7ffea8e5943481b05 + n + 57500/100 + 2500/100 + b0a11711e0f804f7a51981f32556191d + + + 1ab439d20097af8eba6fc5ea2df2bc22 + n + -57500/100 + -57500/100 + 117841ae858b1700a017d752b7f02b09 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/hierachical-data-file.gml2 b/src/backend/file/test/test-files/xml2/hierachical-data-file.gml2 new file mode 100644 index 0000000000..fe3e317760 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/hierachical-data-file.gml2 @@ -0,0 +1,297 @@ + + +8 +6 + + Bank Accounts + ec511fd83bdb2fb877d7b23042968c7e + BANK + + ISO4217 + USD + + 100 + + + notes + + + + + + Bank 1 + c8ceb48e3378ae638357508a041ca61a + BANK + + ISO4217 + USD + + 100 + + + notes + + + + ec511fd83bdb2fb877d7b23042968c7e + + + Credit Card B + f5423230f8cb39ef01fc0a2696627d5d + CREDIT + + ISO4217 + USD + + 100 + + + notes + + + + + + Liabilities + 7241c921241f5ccb8f8fade580109f75 + LIABILITY + + ISO4217 + USD + + 100 + + + notes + + + + + + Credit card A + 9b2119ed0a2eb7449d0209137a2410de + CREDIT + + ISO4217 + USD + + 100 + + + notes + + + + 7241c921241f5ccb8f8fade580109f75 + + + Liability 1 + 37bdf5369928876a5f20900458bc84a8 + LIABILITY + + ISO4217 + USD + + 100 + + + notes + + + + 7241c921241f5ccb8f8fade580109f75 + + + Liability 2 + 4178e5b449bdec62dd02ff69d45795ef + LIABILITY + + ISO4217 + USD + + 100 + + + notes + + + + 7241c921241f5ccb8f8fade580109f75 + + + Equity + 7f7955a48b6a2436d8f4d0d31ca4f6c8 + EQUITY + + ISO4217 + USD + + 100 + + + notes + + + + + + 9926159b3af5a5cdb1f0de7ff72fe751 + + 2001-04-04 10:00:00 -0400 + + + 2001-04-05 03:43:14 -0400 + + + + + 55d3805d566ec9516c0c0bcc8a265e8d + n + -100000/100 + -100000/100 + 7241c921241f5ccb8f8fade580109f75 + + + 1f7d223dd36ff745a9463bdc17d20d2f + n + 100000/100 + 100000/100 + ec511fd83bdb2fb877d7b23042968c7e + + + + + 3ae95f7210a67e83bf7f53adac572857 + + 2001-04-04 10:00:00 -0400 + + + 2001-04-05 03:00:17 -0400 + + + + + 0dd5b1d3676282c89bc88c54c53828b8 + n + 50000/100 + 50000/100 + c8ceb48e3378ae638357508a041ca61a + + + 0cb370b15cf16fbaa772ae10b53ba906 + n + -50000/100 + -50000/100 + 7f7955a48b6a2436d8f4d0d31ca4f6c8 + + + + + 50eae9025b2f98260d372d017c13ad00 + + 2001-04-04 10:00:00 -0400 + + + 2001-04-05 03:00:40 -0400 + + + + + 0301fada51604eaf37eb180c29b1397a + n + 50000/100 + 50000/100 + c8ceb48e3378ae638357508a041ca61a + + + 85bb45926405afa3bb790df1fca10a11 + n + -50000/100 + -50000/100 + 4178e5b449bdec62dd02ff69d45795ef + + + + + ca0b226a20d5d30387c5cdeee9033fb2 + + 2001-04-04 10:00:00 -0400 + + + 2001-04-05 03:21:15 -0400 + + + + + b298ee084fc4fb7992097d25c567cdf4 + n + -25000/100 + -25000/100 + 9b2119ed0a2eb7449d0209137a2410de + + + 012ecbeb74ee4e64f4704fff9956abd7 + n + 25000/100 + 25000/100 + c8ceb48e3378ae638357508a041ca61a + + + + + 1c9c58d27d44a85565eb9d2a01341052 + + 2001-04-04 10:00:00 -0400 + + + 2001-04-05 03:22:12 -0400 + + + + + c9a9e4dafebcfefb21f34ab439958d30 + n + -25000/100 + -25000/100 + f5423230f8cb39ef01fc0a2696627d5d + + + e9eadfab55cafb17e02b71aba6ac9b80 + n + 25000/100 + 25000/100 + c8ceb48e3378ae638357508a041ca61a + + + + + c8762190f365c705d10fc1e34e01b44a + + 2002-08-12 10:00:00 -0400 + + + 2001-04-05 03:00:32 -0400 + + + + + 3cd2306aee06cf7e99254b520782feee + n + 50000/100 + 50000/100 + c8ceb48e3378ae638357508a041ca61a + + + c99dd9d7c59c53ac79e4eea0e477eb73 + n + -50000/100 + -50000/100 + 37bdf5369928876a5f20900458bc84a8 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/ms-money.gml2 b/src/backend/file/test/test-files/xml2/ms-money.gml2 new file mode 100644 index 0000000000..90908bca90 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/ms-money.gml2 @@ -0,0 +1,10022 @@ + + +39 +347 + + Cathy Bank + 7be24f20929f644872ca1718cdd80bee + BANK + + ISO4217 + USD + + 100 + + + New Bank + ab52d1a8fbd5883a788d51bd29c77e84 + BANK + + ISO4217 + USD + + 100 + + + School Credit + 6cdb61279507abc41065ae0cfc49e314 + BANK + + ISO4217 + USD + + 100 + + + Dividend + 4ac81d62b599798f057b2dd83a5d89fb + INCOME + + ISO4217 + USD + + 100 + + + Other Income + fd1d2d2d58ceefc149f572a1e6936cec + INCOME + + ISO4217 + USD + + 100 + + + Credit balance + 65adcfc02d0f936916bb49b994895c89 + INCOME + + ISO4217 + USD + + 100 + fd1d2d2d58ceefc149f572a1e6936cec + + + Refund + c1c71598e096d9ab5565f096db36ed59 + INCOME + + ISO4217 + USD + + 100 + + + Reimbursement + 60a59d2467d55241a1f13d5c0c43fa1b + INCOME + + ISO4217 + USD + + 100 + + + Camcorder + 56c1924305fc9b5667ff93ed389f571a + INCOME + + ISO4217 + USD + + 100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + Tax Refund + 15a7de112614d62d993dfcc43ff70142 + INCOME + + ISO4217 + USD + + 100 + + + Unspecified + 9defb6c42135fa2f4036762c8926c8ca + INCOME + + ISO4217 + USD + + 100 + + + WS + 4da6e3f697287c126a6827efd63a0b43 + INCOME + + ISO4217 + USD + + 100 + + + A + 74446cb1e9d9fb729f0d002aea325430 + EXPENSE + + ISO4217 + USD + + 100 + + + Insurance + 73f01092a778ac5f25d1f95c1f34a6eb + EXPENSE + + ISO4217 + USD + + 100 + 74446cb1e9d9fb729f0d002aea325430 + + + M + 2dba4680e7c14b4f1b3f60cc75959daa + EXPENSE + + ISO4217 + USD + + 100 + 74446cb1e9d9fb729f0d002aea325430 + + + Membership + f5b32f79be8cc4952e6e2ddd4077b0fa + EXPENSE + + ISO4217 + USD + + 100 + 74446cb1e9d9fb729f0d002aea325430 + + + T + ee3d0e82c9b191091e61d4d1bc8da9f3 + EXPENSE + + ISO4217 + USD + + 100 + 74446cb1e9d9fb729f0d002aea325430 + + + W + 3451d55fd6957c001991ac7b98402b04 + EXPENSE + + ISO4217 + USD + + 100 + 74446cb1e9d9fb729f0d002aea325430 + + + Bank Charges + 94f1725a16858da2a9832cec4d7c78fa + EXPENSE + + ISO4217 + USD + + 100 + + + Bills + b978ff4097c571ecbbd134bd50cb439f + EXPENSE + + ISO4217 + USD + + 100 + + + Electricity + 92b05cc5070282b02b05e60f161a5882 + EXPENSE + + ISO4217 + USD + + 100 + b978ff4097c571ecbbd134bd50cb439f + + + Natural Gas + 51feb1a2384a8b12a1738d5561c9ea7a + EXPENSE + + ISO4217 + USD + + 100 + b978ff4097c571ecbbd134bd50cb439f + + + Rent + 329b2c5196efdaf54e1321e05b9f0875 + EXPENSE + + ISO4217 + USD + + 100 + b978ff4097c571ecbbd134bd50cb439f + + + Telephone + 8d9a8e4928257f0b0aaee042057d8012 + EXPENSE + + ISO4217 + USD + + 100 + b978ff4097c571ecbbd134bd50cb439f + + + Clothing + baaf4f690ee338fe4b0cf67dd6c2bf8a + EXPENSE + + ISO4217 + USD + + 100 + Clothing + + + Credit Card + 5fc1c6a2a79889318f644120ac82c8ee + EXPENSE + + ISO4217 + USD + + 100 + + + Education + f981711ab9d0c5ca6b75d0b5a8ee261b + EXPENSE + + ISO4217 + USD + + 100 + Education + + + Food + 073d73615847b401ef859cc852509ab7 + EXPENSE + + ISO4217 + USD + + 100 + + + Groceries + 594ee4adb251ad1515794a77837ae15c + EXPENSE + + ISO4217 + USD + + 100 + 073d73615847b401ef859cc852509ab7 + + + Healthcare + 60845136829c50ec4a09675a08c2da24 + EXPENSE + + ISO4217 + USD + + 100 + + + Insurance + 2f38dff5dceaa7e0ee4d645a19215103 + EXPENSE + + ISO4217 + USD + + 100 + + + A + cc640e911a739a6f58675333704ce9de + EXPENSE + + ISO4217 + USD + + 100 + 2f38dff5dceaa7e0ee4d645a19215103 + + + Leisure + 246d4bbc03fd4ebfc817afda54011ebc + EXPENSE + + ISO4217 + USD + + 100 + + + Photo + 9963d86a4c411a32c1991a9b91f634fd + EXPENSE + + ISO4217 + USD + + 100 + 246d4bbc03fd4ebfc817afda54011ebc + + + Misc + e9b94c2baee4d4f9489a856f4a8a06e0 + EXPENSE + + ISO4217 + USD + + 100 + Miscellaneous + + + Miscellaneous + 96d92c6744c5df991da54c700630fe72 + EXPENSE + + ISO4217 + USD + + 100 + + + Student account + a4267ec85727c7c75d9ddea58f2fd26e + EXPENSE + + ISO4217 + USD + + 100 + 96d92c6744c5df991da54c700630fe72 + + + TD + c791e88d9c25ef9cbdab5d4b9f51fde9 + EXPENSE + + ISO4217 + USD + + 100 + + + Retained Earnings + c4eb84e774bfe977982edc87793e44cf + EQUITY + + ISO4217 + USD + + 100 + + + 58a96777671bde4e1352e2b061edd814 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 179866000 + + + + + c07554061a7c1edc94b6d817ce95cf70 + n + -200000/100 + -200000/100 + 7be24f20929f644872ca1718cdd80bee + + + 148a4765dc4436ee5c1eaafd6d3c9139 + n + 200000/100 + 200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 44c29ce13894bb26ff6f0d3bc4f0375e + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 378164000 + + + + + 6d17fc63b9326c16e61db10e85509d6c + n + -400000/100 + -400000/100 + 7be24f20929f644872ca1718cdd80bee + + + dfcc23eee0f32911ae005b90538c379c + n + 400000/100 + 400000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bead2eb49dcc8ee8167d0e524de98b30 + + 1997-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 502983000 + + + + + 1977cbb7a2d16a694a8f1fe78761f17c + n + -150000/100 + -150000/100 + 7be24f20929f644872ca1718cdd80bee + + + 284a6d6f1c251e7abede285836c8789e + n + 150000/100 + 150000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b8c1dbc879e5bc8a14afc2fbc82af2a4 + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 558557000 + + Opening Balance + + + ec448413f05dfb65c088e8789a20ac97 + n + -470657/100 + -470657/100 + c4eb84e774bfe977982edc87793e44cf + + + ea16b703a9ce91510924473dd0f0048f + y + 470657/100 + 470657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3cc45b7b981a2bd05bfc51822adb09bc + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 560035000 + + Boss1 + + + dac5b60425b0978a9b7416f91c7cb1a6 + n + -100481/100 + -100481/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 719c7d0d65e5025d825c8aa400dba02f + n + 100481/100 + 100481/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + db2d8a1b112173618809ebdae946d23b + 106 + + 1995-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 562204000 + + Landlord + + + 3f8fc3f8bdbc5c7fa5c5e963494d4f71 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 71d905dbaedb78e9059bfdbafc5ea340 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 244ca826ec18de09a4b2105b9bda9b16 + 107 + + 1995-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 563780000 + + Insurance + + + a4cae54129c6b39885d89220f7756498 + n + 53960/100 + 53960/100 + cc640e911a739a6f58675333704ce9de + + + 089831a2e80c59c44b13c06282843c66 + n + -53960/100 + -53960/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 99975bb56e4e9a36fd83d72519664897 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 566323000 + + School + + + 7cbab3a5591c284001411fed936303e4 + n + -126788/100 + -126788/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 8ef8c5f78462b8485c4e172f23701acf + n + 126788/100 + 126788/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e1d961019b80933e892b77610a35749e + 108 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 567822000 + + Pacific Bell + + + 8569dd0591d5da86d3b593136c0353ff + n + 5683/100 + 5683/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 98b820e98a4af4e8fb843c5f40dce0c0 + n + -5683/100 + -5683/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ab4c64adb83c07941bd80813e4f1e7bf + 109 + + 1995-12-08 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 569328000 + + W Bank + + + 3401b82fd2a508916d991e64596a7fe2 + n + 75127/100 + 75127/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4f42b001d243c12f11259450ceaa3a73 + n + -75127/100 + -75127/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d71beebfa9c719845519f6926da5dbf8 + + 1995-12-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 570809000 + + Boss1 + + + 0b6af5c8050e7d4361ae105a648dd27e + n + -60000/100 + -60000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 4f3fe6ac31c84792091900dec0e1e451 + n + 60000/100 + 60000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 67111f21a8a48dfe515d60fb2f958689 + 110 + + 1995-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 572524000 + + F Visa + + + e9215e7cc45b4882850acd71073efede + n + 500000/100 + 500000/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ed864071ab0d34239b4b3ca75ae1aaa3 + n + -500000/100 + -500000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 94a3ca9fe21b81cc55d445f9b9161232 + + 1995-12-20 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 574826000 + + C Master Card + + + 9623f2d3b69e4e26d2ad1d5ca4b7119b + n + -106594/100 + -106594/100 + 65adcfc02d0f936916bb49b994895c89 + + + 12aae15e9edd0e18cfe1aa13c21ef6c4 + n + 106594/100 + 106594/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2c99b41f07fa877b188eb2405edc67a0 + + 1995-12-22 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 576494000 + + Cash + + + 37a67df948b79054d620b2f629cc5f05 + n + 8000/100 + 8000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 37aa6d6b304d566ad3f90d5d35761e96 + n + -8000/100 + -8000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7a3b3c10be8a7f2ec56e2bdbcca5a451 + 111 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 578040000 + + B's Supermarket + + + 35cc0b70617e750b45f1cf72cfd68fa8 + n + 989/100 + 989/100 + 073d73615847b401ef859cc852509ab7 + + + 0ecef524de9db3a4356813b129083302 + n + -989/100 + -989/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3407d28b579ff5ed0d6973bb4b14d49c + 112 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 579581000 + + Court + + + 539442ca9b8b3dbfcacde2703a76fedc + n + 8600/100 + 8600/100 + 96d92c6744c5df991da54c700630fe72 + + + c6effc172d1ad69b0e34cb40e13d34af + n + -8600/100 + -8600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + caeac9580d30089b57d7b4e323776ede + 113 + + 1995-12-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 581273000 + + AAA + + + f366762dd8bf22924a1bca5967d6e5f7 + n + 3900/100 + 3900/100 + 2dba4680e7c14b4f1b3f60cc75959daa + + + 85e313f24bd248efa3fec4eb5097a7f8 + n + -3900/100 + -3900/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 549349e9bdb7d97ffe02e06e0c9663b1 + 114 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 582830000 + + BN + + + e3a691da9f6fc9ce68a4eac524b33c4c + n + 5255/100 + 5255/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ea7697a7a73532226068f1381df61f01 + n + -5255/100 + -5255/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + abaf65bf081874a1f6f6da0633236e70 + 115 + + 1995-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 589237000 + + Gas Co. + + + a6468cb57d10b1a59e21e2c3b6d911bb + n + 7804/100 + 7804/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 2d8df6b69f568015a2754d7e76b6be27 + n + -7804/100 + -7804/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b2efc388db5d717d1b8e16a71b0d0885 + + 1996-01-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 590867000 + + Boss1 + + + 5247fdb13f75f322248d417687a47382 + n + -105865/100 + -105865/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 28cb5517d262144cbbba93f60e5f81c6 + n + 105865/100 + 105865/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2ab373c3a045ae77a512db19c0a7b8f9 + 116 + + 1996-01-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 592447000 + + Landlord + + + 7ccf4302c96ca0335797daefd11473e0 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + e1ed8d92ddf4f05899ee01c3f5d86259 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7f4a113bbed1dce6cf81093b767ee96b + + 1996-01-05 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 605634000 + + Cash + + + 05c78a8ca732b1094c9183e8ba0d10a6 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3e6c21678984d47fa74aca76f8fdfd84 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3056e7713976f6fe884f5d9e5e8f5d9e + + 1996-01-06 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 607373000 + + Boss1 + + + 6868fd553b621906ab8cc5f397245572 + n + -60000/100 + -60000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + fd3fa34b6eecc6de89efc38e0a4495bb + n + 60000/100 + 60000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bfffa71d4e39ad348dc9f1c3ecad3d37 + + 1996-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 608948000 + + School + + + ab53a179e4761a3da85b0ebcaaf0fb0f + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + e778314a94c5d337c5590171d40084fd + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 75d80bf1e40a45c99fcfb292808b394c + 117 + + 1996-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 610540000 + + MCL + + + 7ac9ccd3e020ae6d131cc216f392b5f9 + n + 820/100 + 820/100 + 9963d86a4c411a32c1991a9b91f634fd + + + 06abd9fda7bcf819373824364e11c178 + n + -820/100 + -820/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d4bf7454a1b95390d602c341c8512628 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 612161000 + + Cash + + + 492925603c3d92cdb2f07634b54b6559 + From other checking account + n + -50000/100 + -50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b30c7965d706ef8f23449148eb8b48e4 + From other checking account + n + 50000/100 + 50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 60811ab05afd68fc802a5aabb7592c9b + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 613763000 + + Cash + + + 65f0b22915539e3be24ace80f8f7d64c + n + 6000/100 + 6000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ac35d24d9c477d0e2d8d16b64415dc13 + n + -6000/100 + -6000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 54c96dd1ecffd6aefdd9abd7d01f30c1 + 118 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 672151000 + + C Master Card + + + ccb6dd4150f646532018d8dee5f74409 + n + 4456/100 + 4456/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 02408a8449606c933076b268c7f5255d + n + -4456/100 + -4456/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8d64b6b645c7740d9e9ecf7271891113 + 119 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 676861000 + + DC + + + fdd639f370f1851f8bcd04c00449da05 + n + 3136/100 + 3136/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cf55b893eadd13fec8d00476b812fd26 + n + -3136/100 + -3136/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + db594347f6ff07453eb56b632260a487 + 120 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 679339000 + + Pacific Bell + + + f17a2a776a1e9fb561aeed40a89e5063 + n + 9531/100 + 9531/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + b5065984e976359a4cb9765fdf803524 + n + -9531/100 + -9531/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6b998a4355c2933178ebe4e794f98f2c + 121 + + 1996-01-23 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 681885000 + + W Bank + + + 6e52872aa1cd2164f29f1473e4f2a90d + n + 116284/100 + 116284/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d34989dc920e958ae769e25d8c4b3afa + n + -116284/100 + -116284/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2aa51eaed9428ed5c5760044332404ad + 122 + + 1996-01-26 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 685851000 + + XM + + + 1df24366bff95c8fb827b66f83f15629 + n + 50000/100 + 50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 49e8406d3a2c4c18bcbfc8576d258ac6 + n + -50000/100 + -50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d9bdc634f2e839293ca0ec36497c5c96 + + 1996-01-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 688510000 + + Cash + + + a0a7931d97e083b819fc793603ebd046 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2152b83a635f8d1049abd97cc4661d73 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b9d764fbf1561d9f568b90499ff733e0 + 123 + + 1996-01-28 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 690988000 + + Gas Co. + + + d3a590c8d832a2528052ba68728d4409 + n + 5595/100 + 5595/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + d25f730f03836ee98a0894247096916c + n + -5595/100 + -5595/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1daeda076e9bdb08a0f6225ab740386a + + 1996-01-30 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 693430000 + + Cash + + + dc9d7304132c73485cef6e604a46eade + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 549844caa87a91e21f3570094da82545 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9fa2f4939318542dc80f9c193f26f11d + 126 + + 1996-02-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 706467000 + + Landlord + + + 4dd1e6594a457a998546c1eca0075947 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 397dac23518a951b1d8d0b9df56a5d8b + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 78702548cf71f48df96ca96b63d09c6b + 124 + + 1996-02-03 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 708997000 + + DBC + + + 1b327f0f69dc129138e64f9ffb76b6b0 + n + 2489/100 + 2489/100 + b978ff4097c571ecbbd134bd50cb439f + + + ce122195b8bec42be441235376f35343 + n + -2489/100 + -2489/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5e8852f054682c04ddd2f3ce9591228f + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 711596000 + + Power Co. + + + 86cb41a71a331f3267b66d82cb6971c7 + n + 4653/100 + 4653/100 + 92b05cc5070282b02b05e60f161a5882 + + + b4ceebd97b0f59b69cd65ca8a40d3a7e + n + -4653/100 + -4653/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6b776d96ed513397184884ad217c2e4c + 125 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 716622000 + + LJ + + + c7948a74ef81097fd55d1d33ea6d8cc4 + n + 50000/100 + 50000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 84dacdebdaa573ed0e13b602510b2bd3 + n + -50000/100 + -50000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 57785edfda3409a5c00ade8d2afab7b9 + 127 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 719201000 + + M&W Trading Co. + + + ae2b2af2930619c63ceff5bbe6dc2b22 + n + 1260/100 + 1260/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a26e83ac119b14054125ca63f2b9dc0f + n + -1260/100 + -1260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bf439735c7c5fbace46adccaa7bb1556 + 128 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 721697000 + + Pacific Bell + + + 6c37d787c5fec032850f7b76e660d024 + n + 5061/100 + 5061/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e258cc87d11c4ede4c24215fbd483553 + n + -5061/100 + -5061/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + dde0ca3bac54a0199431885482728853 + 129 + + 1996-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 724509000 + + AG + + + 21397778edff585c46eb55c3105a7048 + n + 700/100 + 700/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 01e726710062d231d368a2262c24d98c + n + -700/100 + -700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2a602d23a4a088a1726b9d41e3dadf8a + + 1996-02-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 727025000 + + School + + + 6c3a843cf0f33be8a8b7c83e42a64539 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 37abf8fadca616a7b917fc434638850f + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b49cba5b11efbbf288cce03f3905626d + + 1996-02-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 729511000 + + Cash + + + c407d918f1d2991747608e4b72c5e504 + n + 20000/100 + 20000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 8de680a54346802842f0a87893a8c6d1 + n + -20000/100 + -20000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ed218e5cc6fc8d470d77099ded6e1975 + 130 + + 1996-02-10 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 732145000 + + B's Supermarket + + + bb1e8e9e6d1be2e30ec2187bedf33fe9 + n + 240/100 + 240/100 + 073d73615847b401ef859cc852509ab7 + + + 2070d66284abdcd2caa68064b2db992c + n + -240/100 + -240/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fe7841cdbed4903f3383add83e9d9c97 + 131 + + 1996-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 739185000 + + C Master Card + + + d27a0fe0778a2f4ecabdc6bc9b189d74 + n + 9870/100 + 9870/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ca787367ffb37d3b9ddc193f27aa1d20 + n + -9870/100 + -9870/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 19a6c39b69502b286bbc4072a8d84705 + 132 + + 1996-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 741786000 + + W Visa Gold + + + e32ab4146ce6378f580091d93053ff29 + n + 36578/100 + 36578/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 190391bd8eb9e3bbb416fc462aab7643 + n + -36578/100 + -36578/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e6b4e63a082ab9ae9fa22814c7e184ba + 133 + + 1996-02-14 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 751336000 + + AUC + + + d41f72605a62213595349c09b4ecc683 + n + 3688/100 + 3688/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 1df94974a71f9bed7f55031516a52c0b + n + -3688/100 + -3688/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1e0a2c8ea727a3d17f85f7cc2767d281 + + 1996-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 753902000 + + C Master Card + + + aa364783b9e1149ed57d55aa17b529db + n + -10082/100 + -10082/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4af055bcc8b5569dae99b5247a7381f2 + n + 10082/100 + 10082/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bdda9615c58122c178ff14d81334f906 + + 1996-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 757483000 + + Cash + + + e79a6dd5960d2fb2f3cfc3170f3e6dc1 + n + 6000/100 + 6000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b108bcc660d88b68ce2b1a09655c7a2b + n + -6000/100 + -6000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + eb2b9ed876e548a90eb136e827f7afe0 + 134 + + 1996-02-21 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 760209000 + + HCA + + + 2cef78e55e46bb88f7cad8f6400d43d6 + n + 398/100 + 398/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + 585325d313a9b4e7f3a4591580f546be + n + -398/100 + -398/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 98f94bb488eaf523d5e590cf36e9f957 + + 1996-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 762701000 + + Power Co. + + + ec9932d96902a2fabbcf0b350dbdf8c9 + n + 2314/100 + 2314/100 + 92b05cc5070282b02b05e60f161a5882 + + + 578df5930c873a0319aa0962d9b5f56b + n + -2314/100 + -2314/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ef13af2b4e9060c9ff83074269e92107 + 135 + + 1996-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 766747000 + + Landlord + + + b3daa6c86e5a97939ee74b6df651ec1f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 304a8b49fdc225dc1562ee8e3b520fda + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7f6185a9eb09755ce79cac760ee23d15 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 769283000 + + School + + + 7f64c12262e14cc91306e9cf4a0ce85b + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 0236bf1cf3f764ec4de91c9f9c14bf72 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a2c873bf6860feee0d4a11310d493cfd + 136 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 772624000 + + Toy's R Us Visa Gold + + + 76b739526f0af702e15aab08b7031aae + n + 23619/100 + 23619/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3334c4dff65918f00eda9484584f25c8 + n + -23619/100 + -23619/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b34f6c21cf40858daf1efcf625a1736d + 137 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 778152000 + + Gas Co. + + + d036fa6b252de3c37cd0c5e78e434b08 + n + 1875/100 + 1875/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 1be446d8f78a8cbeb05166d87ad29d79 + n + -1875/100 + -1875/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d7360a4388b5b172f35cd52c74d4b86c + 138 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 780710000 + + DC + + + 47468f681f6e30780d3f7ff00890134c + n + 5379/100 + 5379/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 90cb945a0bdcb2a314a3914e3507132d + n + -5379/100 + -5379/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bcaa3dbb06f0a64ada1c6f1e9e8ef7eb + 139 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 783566000 + + Pacific Bell + + + e76878541bace7354bd3dc53c1210533 + n + 4951/100 + 4951/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + fb0b00a49362f777a1fc31a018e7b6af + n + -4951/100 + -4951/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bfc6994411f0b8bfc89677ba6a566aec + 140 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 786394000 + + W Visa Gold + + + 1315024aa3e3694d409df78de02ecd2d + n + 30023/100 + 30023/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d9b75fdbdb9cdc9e3c289d772459b536 + n + -30023/100 + -30023/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 83f91ff38502afbf0fff000963ddf483 + 141 + + 1996-03-09 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 788979000 + + C Master Card + + + c7aac2cdfdb241e9ef621f86ede9a3a2 + n + 27896/100 + 27896/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 093b4285f3e03b5bcf79c3f31a88c8f9 + n + -27896/100 + -27896/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6d9288c9fb8412a47f8cf5d0fc17ed42 + + 1996-03-12 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 791570000 + + C + + + b11411b07c8d8348b0f7ba0b1d5d3681 + n + -28545/100 + -28545/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a61d9f5d05c10724be47961fcc95c5da + n + 28545/100 + 28545/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2aff96c3547da2f9d3a1b7dd04904976 + + 1996-03-24 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 803249000 + + Cash + + + 923b79b699acd4fd9ef665241aa2f1b0 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7a4419456383a6e3c915be3600f558ec + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7117c608e41ec940f2f0c30c465bac4e + 142 + + 1996-03-24 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 807419000 + + B's Supermarket + + + 88ba254874ffb71137658942382db4ae + n + 1010/100 + 1010/100 + 594ee4adb251ad1515794a77837ae15c + + + c7d830fb108ab4709ea0a788f9799dbc + n + -1010/100 + -1010/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e860a6dfb8e2e670a5daae8c6384dcd5 + + 1996-03-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 809992000 + + BB + + + 33f85e5c07cd13d0f8d3c807667d9557 + n + -15431/100 + -15431/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + 7b972087d1bf6cf3db8f873c2dd7f19b + n + 15431/100 + 15431/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4bda1ee838f7070e1a7d3275ef9ed04c + 143 + + 1996-03-27 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 812589000 + + NB + + + 66ad7a8d85e0f90e29031230cf70de42 + n + 2272/100 + 2272/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 21d73ed6de6c1df88b6560313e9b13ec + n + -2272/100 + -2272/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f2f278ff86ec09ca53aeb879ac872846 + 144 + + 1996-04-01 00:00:00 -0500 + + + 2001-03-26 15:43:51 -0500 + 833270000 + + Landlord + + + 32d91d513b05763a35de6626b64b6c16 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fcda4428c8c30d4f44b121161cd22b0c + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b56d909b0b776081aa1de20d52a56aee + + 1996-04-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 837125000 + + Power Co. + + + c534110ce97bc51f53b8fde02c17af5d + n + 1928/100 + 1928/100 + 92b05cc5070282b02b05e60f161a5882 + + + 7f085f565301c91fa026ee7aa7373882 + n + -1928/100 + -1928/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4a409cb8e8e9f96bb3d480072859859f + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 839712000 + + BB + + + 6ea713a372d27e141678cc6923acd3f6 + n + -57787/100 + -57787/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + c6f07b4dfebc14d074b64f21e4509cb9 + n + 57787/100 + 57787/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a42700d3aea95224e01232174ff2f6b2 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 842309000 + + School + + + 29609c8f7262b2ec82b892c56747fc95 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 106bd290a0729783792d3704f6eae14d + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6c9e9e7958c80622a126c15836b2d2bc + 145 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 852045000 + + Gas Co. + + + d793b5234572d417c4dd9d2045eef843 + n + 2309/100 + 2309/100 + 51feb1a2384a8b12a1738d5561c9ea7a + + + 77a1683fbcf6d0ddbba3189de75e95f1 + n + -2309/100 + -2309/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0c33ef952eac12b4106338d89c7ae729 + 146 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 858871000 + + Pacific Bell + + + db37f78a632f49284da3d7e2d57f1b0e + n + 2274/100 + 2274/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e6e7d6c51d248213d4004b0d76c4e664 + n + -2274/100 + -2274/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 62fb43b96ef8645b25f55c6c85705d61 + 147 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 861689000 + + C Master Card + + + ca010be124fd392ccaaa9f5b1d28777f + n + 35050/100 + 35050/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + a0066d3bcbc67befc0046c5f16cf0c06 + n + -35050/100 + -35050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6417235a5ee5027f81fdf925748fbbe0 + 148 + + 1996-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 865127000 + + Toy's R Us Visa Gold + + + 004187e432a13486e9cfe870ab3a3f87 + n + 2202/100 + 2202/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2f0534d386179fc36803f3e9d66237f6 + n + -2202/100 + -2202/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + cb86fdd6e3a719fd5de1e1de80df1141 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 867802000 + + Power Co. + + + 00d15203e00a76278c3aed0968980af2 + n + 1978/100 + 1978/100 + 92b05cc5070282b02b05e60f161a5882 + + + 53c08091348eb6b879304a4da80af21c + n + -1978/100 + -1978/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7edcc3ab2e840fec5d43c4a5e5a6153a + 149 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 870503000 + + Landlord + + + c529b65eeb2b47cef6e427eb52525907 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 05aa13c120f2dff181f3888cc28c8a72 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 01694a4486d7288bd1fd108bd5f7402d + 150 + + 1996-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 875485000 + + BN + + + fabddef084bdad2deeef1fb59be67afc + n + 60849/100 + 60849/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d8e28f186c207d5f0ccd045278207068 + n + -60849/100 + -60849/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1fb645f141a78d755eb7ea64be25e50d + 151 + + 1996-05-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 878330000 + + LDPC Co. + + + 9e755346e77a9cc0239f0010d300daa4 + n + 4170/100 + 4170/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 48c3521f7449d649a7966f8c972f8997 + n + -4170/100 + -4170/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 71788c4eddac3e4442d1ad4e777ccd86 + 152 + + 1996-05-09 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 881011000 + + PC + + + f785d9a95b1a939a59d89ac76135f4b9 + n + 2938/100 + 2938/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7aaf39ac5f9bef89522b2f478fbda6ce + n + -2938/100 + -2938/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ef93759a27d5b6af6247e6d9177338f7 + + 1996-05-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 883666000 + + School + + + 936168d4d9e522575a9bfe701bfb727e + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a23c6fbaf8a3f7624ec90f30eeda2259 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6fe1093d00f20d8dfc67661e1ca91e3f + + 1996-05-17 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 887889000 + + Gas Co. + + + 9064122d45f5b2474e68b376cff85b38 + n + -1700/100 + -1700/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 8fb78068233b66703dac90caa5c834ab + n + 1700/100 + 1700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 44afec66dd4285798fb5f4e307c9461a + 153 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 890537000 + + DW + + + e5247fe9747d6098d79d43d7ae1cdfcd + n + 26500/100 + 26500/100 + 74446cb1e9d9fb729f0d002aea325430 + + + f6cdda65e7ded8a3c26c2e990d185aed + n + -26500/100 + -26500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 880a44337b802d9d58524bffaadfeadd + 154 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 893182000 + + Pacific Bell + + + 757ae25a35465c5f922a8feb6b8faac0 + n + 5607/100 + 5607/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 32bf0a3f2f8394220798f36e7513d20f + n + -5607/100 + -5607/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d07ff7d8db380979b383c4efdc1d14a0 + 155 + + 1996-05-19 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 905451000 + + NB + + + 246be7ff1fc347929027e715de655b4b + n + 77404/100 + 77404/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 08542b5d96a138857361bbd6d73452d7 + n + -77404/100 + -77404/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 791764c9b88f493bcb2ab2677721f1e6 + 156 + + 1996-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 908184000 + + PC + + + 5929a1102e15c8457170ca417ffbc20c + n + 1299/100 + 1299/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 69415a5377ea272e5571f7403e14b0fe + n + -1299/100 + -1299/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5361e7a38a600143d2efa7381d90e886 + + 1996-05-28 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 910861000 + + Boss1 + + + 127a75e510df126d3a20c47a020152d1 + n + -58280/100 + -58280/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 6db74d2a8dd3d3d2ecb3ae77a18e0139 + n + 58280/100 + 58280/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5685bb01c49df0e26df521b56c0a923d + 157 + + 1996-05-31 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 913672000 + + Dr. Lin + + + b3a5898f708891b07b703e8683123fc1 + n + 1000/100 + 1000/100 + 60845136829c50ec4a09675a08c2da24 + + + 577064b50b647f947233fc7a6f7ce69c + n + -1000/100 + -1000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8150fe1d52e594e42d5f62ba3698296e + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 919411000 + + Boss1 + + + c880f2c370ded6fbf6b8d74f78dbf96f + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 15c01c2812df2b9b8846a4a7c54c558b + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 93eeb5c9b17b7b0290aacd884736da4d + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 922316000 + + Cash + + + d8a81670d60b3bd149482a2b40ec51c1 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c21835fa5eaa414edf098754497a90ef + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 51d6c9b07b71b5f2394efee66ac03663 + 158 + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 926588000 + + Landlord + + + de6d5dca32aade8598ed2395d93fdd41 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 9fdb2b3988d377bb6389e1959eb4350e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 31ef83d148b3db98c78f8d5ea4590921 + 159 + + 1996-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 929352000 + + BN + + + d7f1ee11be88ddb198c769edb972c128 + n + 5839/100 + 5839/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 26da9682adf31df8edfe0c8d0a676dd2 + n + -5839/100 + -5839/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + cf125b99804bedffef347ca3faae3268 + 160 + + 1996-06-06 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 932110000 + + LDPC Co. + + + ca57c095e73c100f0f1b11b2a01b89fe + n + 4272/100 + 4272/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 342c456e67f09ff660d9e7114544c972 + n + -4272/100 + -4272/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9e69a56937827ee86a5d61b6a4b8e8f9 + 161 + + 1996-06-06 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 936779000 + + Pacific Bell + + + 3155ac938b0c530fc5d4fd3fec88d447 + n + 4825/100 + 4825/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 693e36469e3650a2c9d8c8da0a1217f7 + n + -4825/100 + -4825/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b5f4a8fa3fbd8d8d7be989fb1dcbaeb6 + 162 + + 1996-06-07 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 939543000 + + Insurance Co. + + + 5fe23541ee174671004bdd551d978253 + n + 53700/100 + 53700/100 + cc640e911a739a6f58675333704ce9de + + + 68e6e01217e4b2d4a4ebf586385d084a + n + -53700/100 + -53700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e3eca2d3e24c3699985d8a5333688c36 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 942243000 + + School + + + 76c63e3507cd0cd261b7803892960177 + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 767a2cfaa7b5460434172107b6d1fbc6 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 827f465fce33844e27701408a712e95a + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 965302000 + + Power Co. + + + cc0b3b8522b718bfcd14972c3ed6007d + n + 2536/100 + 2536/100 + 92b05cc5070282b02b05e60f161a5882 + + + 4f60a895cdcf6d9fad2025e417d5c27d + n + -2536/100 + -2536/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bdadf3d9d218123fde4fc222e201060f + 163 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 968340000 + + W Visa Gold + + + b4d2875407a1d23b91cdc4dc8ea83b73 + n + 53380/100 + 53380/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2cbb626807d92add1ffe432d08facfc6 + n + -53380/100 + -53380/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ff335d7748589f987f5264581d698ee4 + 164 + + 1996-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 971146000 + + DC + + + 26bd650eb79addb479acf50e21edf749 + n + 2565/100 + 2565/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4452db63db9e9d297f4f419b1960776d + n + -2565/100 + -2565/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c4ae7ccd12d1161d4dbdea8dde7ea8e7 + 165 + + 1996-06-11 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 975957000 + + C Master Card + + + ff3fca29ab0dfa859bee8a2ff6fae23a + n + 7116/100 + 7116/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d032f4fec5ac9f44bfcb8452cc0addfd + n + -7116/100 + -7116/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8b6f44c8914998ca440d9e7098c1e787 + 166 + + 1996-06-13 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 979005000 + + NB + + + 01e0503bf0a33cfd11644d7d3d4857ca + n + 168224/100 + 168224/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6c5ecb934ed6229fdbc18ad234667dcc + n + -168224/100 + -168224/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 13cbb2faf0a5e634c3303a0b6e5f5228 + + 1996-06-28 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 982656000 + + Cash + + + 6c1b8da73502218cc794acc0fa24bcb6 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6263191d1db47c49786f295322b1db4d + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b53505bdc19ec5f0c0abb67c54a243f9 + 167 + + 1996-07-01 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 987122000 + + Landlord + + + ac8b874b440604a0afe97cff80743e47 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 072e2abcec072f2bafe0369a29077c62 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c80ab1d0b5b85ecb6875bd22807adb28 + + 1996-07-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 989865000 + + Power Co. + + + 80e23b07aae7dcb2a517ea8e7db8fee9 + n + 1222/100 + 1222/100 + 92b05cc5070282b02b05e60f161a5882 + + + ad8f72d860006be316b5813b769a94cd + n + -1222/100 + -1222/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 65420803005c09711a139a8818567f12 + 168 + + 1996-07-08 00:00:00 -0400 + + + 2001-03-26 15:43:51 -0500 + 992871000 + + Toy's R Us Visa Gold + + + c4bea13f45fd7f60257a97120926ea13 + n + 1000/100 + 1000/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 72aca212314006703869549932a7b19a + n + -1000/100 + -1000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7a86fafa9c7d405307d5f417213b750a + 169 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 3717000 + + NB + + + 10a986e3288f5e708f7097afd7eda775 + n + 32566/100 + 32566/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2d14da9cb078c20ade5929133fa608de + n + -32566/100 + -32566/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 69f5054da696183a5bcb890dacecef37 + 170 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 8422000 + + Pacific Bell + + + a34dcdac101ed7dee764105d9c6318ab + n + 4577/100 + 4577/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 8e69f5c480dd1ecc74f56f2666ac7422 + n + -4577/100 + -4577/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 78800a0181e5691c34ec3c999c931072 + 171 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 11227000 + + Time + + + 470688ff141f7385f1105e3f478519fd + n + 2997/100 + 2997/100 + f981711ab9d0c5ca6b75d0b5a8ee261b + + + 87320fbcc1a2c509eeb02544cddc3f9e + n + -2997/100 + -2997/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d1002cb7e6a1897da27f743834a624ed + 173 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 14951000 + + C Master Card + + + d45d4e63c88c6405ed76674728918d8a + n + 40165/100 + 40165/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7c91a4e3ce75b98774adf549df0524bd + n + -40165/100 + -40165/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9364962fb22a7dbbd8ab3331005276e4 + 174 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 17848000 + + City + + + e614f2407ed31c96f91bd9143b043bee + n + 4400/100 + 4400/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 051240eac8b00202ebe9c0925caf09f5 + n + -4400/100 + -4400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 869d749275759cdad7600a6a897c56f3 + 175 + + 1996-07-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 20629000 + + City + + + a83ddfda38cb4a9b27bae3072635e949 + n + 2800/100 + 2800/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 7a941aff4f549ca310c2093ffe462702 + n + -2800/100 + -2800/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f1e7806e3793cda21e7b9a46f719bb35 + + 1996-07-18 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 23418000 + + School + + + aaf5c02e66ff8695af23277dd3ee897a + n + -126963/100 + -126963/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 4f7e07821154b619b518e75273fadc52 + n + 126963/100 + 126963/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f97ed5019297ed296d8add672ad47da8 + 176 + + 1996-08-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 28954000 + + Landlord + + + 9d9549c48e995d79864fa5deb57a95e6 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 99c85df22c35a6f8f63e8944a8539dcc + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 255cc64d2efd39d180147273e7b0beee + + 1996-08-06 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 31779000 + + Power Co. + + + 959c84ae24b87804e4ffe379d26377f7 + n + 2040/100 + 2040/100 + 92b05cc5070282b02b05e60f161a5882 + + + e7775e9f11ced47731b9bb277f025a38 + n + -2040/100 + -2040/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1e8dfa5a0e8299d0c5b9b0429032698c + 177 + + 1996-08-08 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 37056000 + + Pacific Bell + + + dab5d77f99187ae3faf3a2b4220f686d + n + 4273/100 + 4273/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + ea9664178f2e60e78753780875eb7973 + n + -4273/100 + -4273/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + dfc1b034a09c8d323bed621ff045d377 + + 1996-08-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 39923000 + + School + + + 2c0fa8a5bb32159749a049b35778c6cd + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 8fee2684fb6350565a4ffcc5d3b4f4b6 + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 43060122cbc22c78e2b8a671c7ee52a2 + + 1996-08-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 42746000 + + Boss1 + + + 12894902cf28dfc8b15e506b99db0ad2 + n + -32420/100 + -32420/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 4b642b9930da675849ef7c299b784c44 + n + 32420/100 + 32420/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2e58b252640f47edbfdd26c3ba045c77 + + 1996-08-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 55164000 + + Cash + + + acf5c71ea234cf1f020506fe93da05ea + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5fe2a446f25ec5d26d6b49ad6f465022 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f943f0aaab26d0829cddb27bb47758b9 + 178 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 58303000 + + C + + + 5ae27b3e479f930aac234e352bf2e5a9 + n + 20800/100 + 20800/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5c52759d0128417550c0b08c24db1544 + n + -20800/100 + -20800/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 92ac0f8f8dd1020604464f1ac24f57c7 + 179 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 61378000 + + AUC + + + 847228c1cc64581774bb1a4839be0bc0 + n + 13890/100 + 13890/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7a6b9723dc881a09f58129b765a8c9f1 + n + -13890/100 + -13890/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a2d400215a07ce6e07f40b7545a7f583 + 180 + + 1996-08-19 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 68177000 + + NB + + + 908bd17c63b4ed8147bf57f5325dd1eb + n + 45929/100 + 45929/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 724dc458cca24734980b50466234cadb + n + -45929/100 + -45929/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d58fa35ddc91a1bd7e28b534f1e43ac0 + 181 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 71140000 + + Landlord + + + 9435125f1377883d24986af8e2e7987a + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 39e93873056b11f121dccd606a2c20e7 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 34dd57ade85417fa1668a0a611b69527 + 182 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 74700000 + + Toy's R Us Visa Gold + + + ba23b04c1e282f84530093d4e3958334 + n + 2671/100 + 2671/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bd7bb0be8755dd8306b328b7867b58bd + n + -2671/100 + -2671/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2e0f1d5cd24037de767e811ebdc2951c + 183 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 77730000 + + City + + + 305610372745dab6d5243ec054818639 + n + 2200/100 + 2200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + a79aec4f5d7df9089ec1c8150d121b9e + n + -2200/100 + -2200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ddf5dfb3c316d4fc11937e88b891a5a3 + 184 + + 1996-09-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 80595000 + + LDPC Co. + + + c31b3593ab7d4d47be4b20536c0f1c1d + n + 2466/100 + 2466/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + aebc83eacc0c2206c22cd7ffd2c0b3c7 + n + -2466/100 + -2466/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4526a8a7f14363424f98559e4d87f728 + 185 + + 1996-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 83703000 + + School C. + + + 63f924779b133221f5debd1d17aba5c0 + n + 2000/100 + 2000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 45f4df551c02e6f831ffef64381f1d21 + n + -2000/100 + -2000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6ea69c8af617af90ecd476f1eed961af + 186 + + 1996-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 87724000 + + Pasadena Municipal Court + + + 05cae5c67e2d08998ef0f0d914d531a9 + n + 16500/100 + 16500/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2d653a413f8d6a5748526fc276f3e93e + n + -16500/100 + -16500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 70ceb2f49e70f1e63236a35e0e7a767d + + 1996-09-04 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 90616000 + + Power Co. + + + 28de07198cb3e70d288ed2633dcd3f79 + n + 2527/100 + 2527/100 + 92b05cc5070282b02b05e60f161a5882 + + + dd4b32db4a502a57479113438e199078 + n + -2527/100 + -2527/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + aee715c6258a873cfdc2d1c2aea1e676 + + 1996-09-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 102595000 + + School + + + 91135a80089b21d38f147cb8b25f78ea + n + -126961/100 + -126961/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 30b0d3be4277a6e5204e6e981c4d00bf + n + 126961/100 + 126961/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 49cf9ca6a884335e0ce5d1231c1be689 + 187 + + 1996-09-15 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 107417000 + + PC + + + 3ee5c9dd00545c02a09f74cc6192afc1 + n + 7634/100 + 7634/100 + 9defb6c42135fa2f4036762c8926c8ca + + + edb74abf6230454dadb92b452274ae1f + n + -7634/100 + -7634/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9c99e5488766cd2379dc81671324346f + 188 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 110405000 + + NB + + + 77a0eccf105276f1ddbc5879678cb250 + n + 46931/100 + 46931/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 302a049f33aeba040546411ffb0d67a8 + n + -46931/100 + -46931/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f0d8ed10085ef55b0197acea37d57679 + 189 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 113406000 + + C Master Card + + + 4e591ff66b34c9718b981cf7d19820a5 + n + 43669/100 + 43669/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 0ecd0e9052c333570096ade6ff26c69f + n + -43669/100 + -43669/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5f089311ddc8e4913a6c5263ce497f1a + 190 + + 1996-09-16 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 118109000 + + Pacific Bell + + + f8ef84b1165439bd5530fdc6e7b37dc2 + n + 4501/100 + 4501/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3618dea3cf080d2638eab994236d2333 + n + -4501/100 + -4501/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bff922ca0aed3f3c703e192a3e3712e3 + 191 + + 1996-09-23 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 121032000 + + School + + + 7265a66d333654e3f9230ffeeb589a41 + n + 12752/100 + 12752/100 + a4267ec85727c7c75d9ddea58f2fd26e + + + b518d510590947b7dca855f9e00bcbca + n + -12752/100 + -12752/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c67b05f39b0d88876a9dff447c901239 + 192 + + 1996-09-26 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 127069000 + + Kee Wah Bakery + + + 1d6a24bae489a10894924ebd507e3b9b + n + 20390/100 + 20390/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 800850d9084bbaa4bb2019421598ec93 + n + -20390/100 + -20390/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4824c739bf872359319ba608c695416a + 193 + + 1996-09-26 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 130450000 + + Kee Wah Bakery + + + 2fc4610ba04f7f610bb08aa1858a5908 + n + 1960/100 + 1960/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5ed4f6374ce425584531eb0258e9df7e + n + -1960/100 + -1960/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e3f92a6d468672df3fcde0a12f497cb0 + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 133402000 + + Hu Hua + + + 289e4b367c52afdbdbf504d874ea3d43 + n + -20390/100 + -20390/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + b5782d3a7f275c14720d65965105bd42 + n + 20390/100 + 20390/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8472d78118b6c166cf69fe537b743e9e + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 136960000 + + Boss1 + + + 20ab1fe2d5395d7cbd20bb2e6535a639 + n + -1940/100 + -1940/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + c3a9d7a262e2e69d97fc2ba625f38294 + n + 1940/100 + 1940/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6768c49020d91663385416514abb5a29 + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 139863000 + + P.C.C. + + + bfbbf149128a97330a37222423cb899f + n + -3400/100 + -3400/100 + c1c71598e096d9ab5565f096db36ed59 + + + e356c4030969d7d9f49d4fc8f400ddbb + n + 3400/100 + 3400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c090f8894aa77a52dc8e13694171945b + + 1996-09-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 142788000 + + Cash + + + 8ceba475904e6408eacc526bc8a805b2 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 5fc3101e7c85e6f45ff79c3ee8e7cc57 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f24e857adf2c300ec2fc0a6bfd471b4b + 194 + + 1996-10-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 157064000 + + Landlord + + + 1d2c6bea76b55b72743c7942e15748dd + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 5939456ac77860e7517eab84767d547c + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ea831858a646fbfd30ac1c26f5660a75 + + 1996-10-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 160041000 + + Boss1 + + + 7dafb77d16742e8ec70bfedfadbb5ac7 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a4dad6e5b4d7b7a48ee3319a8b87a6bd + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0f46c494d2d5c28667891e8b5b3aae03 + + 1996-10-04 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 163102000 + + Power Co. + + + d329627161d9ffef215338597fc875bd + n + 1669/100 + 1669/100 + 92b05cc5070282b02b05e60f161a5882 + + + 58277610dd60c0676e1c52da642cb179 + n + -1669/100 + -1669/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 55109167f9720f30949f0b41af58402e + 195 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 166726000 + + Pacific Bell + + + caeec50fdf0ac900492f938c99d1f684 + n + 1695/100 + 1695/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 64c9a1802eb024cd781ab556341d0408 + n + -1695/100 + -1695/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 06a3e8a15917dd0a209edf3970eb17bb + 196 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 169711000 + + Pacific Bell + + + f1c8ab31ae210a41ce1ee0e6421f7d6f + n + 4767/100 + 4767/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1384118d400086db358a825c11a51bab + n + -4767/100 + -4767/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 390c3d2084ff725aa1ff2b7c8bd49823 + 197 + + 1996-10-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 172709000 + + LDPC + + + 02e0691aae750245f646e7ccc14d33b1 + n + 6539/100 + 6539/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a6f8fd0e4b7110b6b792030281b0cd81 + n + -6539/100 + -6539/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 028942913d7e42ff6ff232c95fcf356c + + 1996-10-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 176912000 + + School + + + f59469b91a4472689dbab9fe0acbd544 + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ea5e693d96e460cb3d6c2b280cf660e0 + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5eaf034dc351b4dd4f058a87c9fa5446 + 198 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 182862000 + + C Master Card + + + 90462fea92a00597f1b6fd8719517faf + n + 390248/100 + 390248/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e1d996aeb05b8a6087c78996abdc2063 + n + -390248/100 + -390248/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 045353a65a2fea445b68d7731cbb865c + 199 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 189657000 + + NB + + + a93e2f904693d658059b506a9e37dd39 + n + 93332/100 + 93332/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7bd52aaadf619d2e715a68c25a76a015 + n + -93332/100 + -93332/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0d2c90ff9131b7339f2ea90dba7e0fdd + 200 + + 1996-10-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 193487000 + + PC + + + 89f54bb006a41cdde83b02a66eb0955d + n + 5439/100 + 5439/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e89b46fe95d912dc110d300c757e37c9 + n + -5439/100 + -5439/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 075a3d055c5a19d250b2fc815e93d0f8 + + 1996-10-22 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 203573000 + + C + + + 4a0fe281a6ad2c98e4f7794e29f6d845 + n + -10274/100 + -10274/100 + 4ac81d62b599798f057b2dd83a5d89fb + + + f43f96b4b1f961caa770a30b9f05386d + n + 10274/100 + 10274/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d3258cd7b6654058cec8c19d03a36b97 + 201 + + 1996-10-27 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 208776000 + + Toy's R Us Visa Gold + + + 1df209cc21266e6ef778abf511de040b + n + 6429/100 + 6429/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ef8efe3a4e752793c9656e4beb319c22 + n + -6429/100 + -6429/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 211873214242b01249c21b7093693276 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 211814000 + + Boss1 + + + 716866b02b905107510a68b5a0c39706 + n + -367026/100 + -367026/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 2118745900c6efb76728839883999e61 + n + 367026/100 + 367026/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 10f28276e75237e2cb00398ae84d5227 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 216936000 + + Cash + + + f1003c9c0bfdad7ac36ef56681911874 + n + 4000/100 + 4000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + d61f0c0895f2fa3f739566e42c005525 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 90a9cac6a5ba376fbb14d7badb07af77 + + 1996-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 219998000 + + Boss1 + + + 0b3bb158c93b4c5692cc820fd3ddc962 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 9b5ad86d21c963daf81893d1a415520a + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ba8ccc56708da2a1d3277b282ea0d730 + 202 + + 1996-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 223390000 + + Landlord + + + 5c8743233c7246aa40b0be9ae63c6b4f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + c3a12fee64dfa92d0c21c7489b7b442e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a61aa7f2fc9f20c68c102d3d7012d371 + 203 + + 1996-11-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 228139000 + + LDPC + + + 40ab915b5dad63e6e24121eba8ecfe78 + n + 3694/100 + 3694/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3427381a9f22c0992587734b5f4f961c + n + -3694/100 + -3694/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e568fc0fe1000690216f486e0eb0e167 + 204 + + 1996-11-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 231184000 + + Pacific Bell + + + 97c865d4503ebbd5c4870f861170ea27 + n + 2240/100 + 2240/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 173a805df8d8144ed13d8cee5fb98d5b + n + -2240/100 + -2240/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + eaf44ab64ceb89862135424dfde362a7 + + 1996-11-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 236009000 + + School + + + b8520374babec2dafa33df01cf8f2af4 + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + d4a4e6eeb45a06bf6f03958e984c783c + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 10c95f9b37a2a157b3fdde06135dfd6d + + 1996-11-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 239094000 + + WJ + + + 13b195a4500340075cb64a33f5adc7ec + n + -4871/100 + -4871/100 + c1c71598e096d9ab5565f096db36ed59 + + + 7b938311efc917932c2bb4a10a2d9ae9 + n + 4871/100 + 4871/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c38e23bfce5f0b316365600f168fbfa4 + 205 + + 1996-11-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 242110000 + + Pacific Bell + + + e6438748dcfc86ebe3bc89d2fef4b45d + n + 2458/100 + 2458/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 69364fc792a6aa5659dfa558d04de110 + n + -2458/100 + -2458/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8774e37edb882e0dbc9f374b14fd442b + 206 + + 1996-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 254863000 + + C Master Card + + + 301ae34776ad43f07b03fc385630c40a + n + 293757/100 + 293757/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2e550baf1c4c77b89026df5450f411d6 + n + -293757/100 + -293757/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 44746f72a1d18b7d8e347f05334dcb06 + 207 + + 1996-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 258436000 + + NB + + + 5c1f6a10946a7a743fa109c8005e917e + n + 224262/100 + 224262/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d05288968192893abd8e6d6dd96773e3 + n + -224262/100 + -224262/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1d11f77fe74c64792acb879671959277 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 261793000 + + Boss1 + + + 440dc39c2bbda8681247c40c0eda008f + n + -7425/100 + -7425/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 13a069abbbe2c301743bb003b9c99ebe + n + 7425/100 + 7425/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 72fe28cb0d3fa73686b006be0507d841 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 269089000 + + Cash + + + 664f54a6f8bb41e64fa406847dc4fb8f + n + 8000/100 + 8000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a7b6a75a9e3662c19eb1261bf319ccfb + n + -8000/100 + -8000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5a6f3ff081b65f129e7ce37f0f2e536b + 209 + + 1996-11-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 272213000 + + LJ + + + 89e53ce98ce18255bb252c7bef22678b + n + 38018/100 + 38018/100 + 246d4bbc03fd4ebfc817afda54011ebc + + + f61d94640c5667a82f3ee4f3ec3235e9 + n + -38018/100 + -38018/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 889c788cba4bc237410effe38a6e31d5 + 210 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 278063000 + + AUC + + + 47f6cb20625105c1cabed298b7db6ac8 + n + 2260/100 + 2260/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 90c4ec53c84b38d7b78bb97715b76cf2 + n + -2260/100 + -2260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 95611e8b31fb8df3b401435ede574652 + 211 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 281192000 + + LJ + + + cc3ef0168ce23aff1b9a2b2646112070 + n + 5100/100 + 5100/100 + 246d4bbc03fd4ebfc817afda54011ebc + + + c3ec11924ad66b32d449c8fd873d3ccd + n + -5100/100 + -5100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5848880ba55e33ce46c21bb12bca8475 + 212 + + 1996-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 285845000 + + PC + + + d7763fc007727b1b448f274de3e30a20 + n + 22564/100 + 22564/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + f176be8f883c49d975081747251cf5e6 + n + -22564/100 + -22564/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a2cf57372ca3c8903c34cd0664f2498a + + 1996-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 289008000 + + Boss1 + + + 1b8f0dedf59a4ace3721b7d99103f2d0 + n + -109069/100 + -109069/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 4773c01c98e5b6643951f79fd40506c7 + n + 109069/100 + 109069/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c90a99ca08eb147fa23f8674d3536710 + + 1996-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 293007000 + + Boss1 + + + 6b2fe0a2386ede1b0aa39f440f913031 + n + -7260/100 + -7260/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 8cbcb98344e9b9f2f36e4041922f2315 + n + 7260/100 + 7260/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ebf43960c8c1d746e8d103f402520dd4 + 213 + + 1996-12-03 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 307201000 + + Landlord + + + 1238bde559b6cb1aac7200a79c32e39f + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 8adeea3bd71855c9d711c131c1486ead + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f8b6af5a90ae401e489d6fb263915c9b + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 310400000 + + Boss1 + + + e45fd72a4a820df7ea2ac141cbdc1a93 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 97141dd67ad0f5e1cbd432c9143e5423 + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 31dbd5ad5b019fcf627065dac86daad3 + 214 + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 313491000 + + Insurance + + + 9b7669ffdebb372a56b6ede7a2b59343 + n + 42400/100 + 42400/100 + cc640e911a739a6f58675333704ce9de + + + e1fbf6f5de2b1a9b1f9f66d4de3e7cc9 + n + -42400/100 + -42400/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + db333052ad4423d1057e257dd9940783 + 215 + + 1996-12-05 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 317456000 + + BN + + + 0aff5783f48fa6ab43f814262644623a + n + 35265/100 + 35265/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4f48d6b864ad8b334fa01b6a8aed5e86 + n + -35265/100 + -35265/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f8f52804024e2578154c1abe106d65fd + 216 + + 1996-12-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 320628000 + + Pacific Bell + + + 6e84c717b6b2788540d5bb690e97c52e + n + 5794/100 + 5794/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + e182249d8c66d620fa5152c568ba479a + n + -5794/100 + -5794/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 101c8aa6af2d90cb658c043a495850f2 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 323736000 + + School + + + 238f72686aa9d51de1a15ae56fe92d2f + n + -131659/100 + -131659/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 593c567cce02a08db023c2427e990462 + n + 131659/100 + 131659/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4fff54108c7ff4fb7f53bd1ad6e2510d + 217 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 356093000 + + C + + + b9f943a25a2ed123790f06dc17f84617 + n + 167647/100 + 167647/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 06753cb032081c592bf4d74044037096 + n + -167647/100 + -167647/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 785ffda7d3fe26ebdaeefbad3dacc8cb + 218 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 359532000 + + W Bank + + + 5b52000405f8f61ef8635a660d7bbad3 + n + 6846/100 + 6846/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4408864cf2b56394f387778aac9613e3 + n + -6846/100 + -6846/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fbd8c918b461bcad2bb89728a695e7c1 + 219 + + 1996-12-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 362917000 + + Pacific Bell + + + fe4f52f2b23176f12a94424314027f6d + n + 2543/100 + 2543/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + c96dae2c8e8063f4ee8b45bccbdb4658 + n + -2543/100 + -2543/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3ce4052babc781b935eb11a77c5c2cf9 + + 1996-12-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 370828000 + + Boss1 + + + 560adc05bb8cc54c1c204d1e99e424ba + n + -28197/100 + -28197/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + dc669b9c580ba1ed6961684c6bf2cc0a + n + 28197/100 + 28197/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6dd89dea4fdd2d90e51a8a168e0e4e89 + + 1996-12-15 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 374577000 + + Wei yan Shi + + + 9248889050cfc7049cd78d60707f2396 + n + -200000/100 + -200000/100 + 56c1924305fc9b5667ff93ed389f571a + + + 854c2f86bb46139789b786522f6a995b + n + 200000/100 + 200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c5fad55e2bf1d35ee6e0c99ccd6b4910 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 381256000 + + Wei yan Shi + + + c663d7e359f019a206a75ac291b78191 + n + -100000/100 + -100000/100 + 56c1924305fc9b5667ff93ed389f571a + + + 39bb8675d7b5528820aebbfa3e1a6b9a + n + 100000/100 + 100000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a6a68d4fe2de9825d6fb2c2e83979dc0 + 220 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 386877000 + + OppenheimerFunds + + + a2bbca7eeacee2370612d6905f63d38d + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7220a7e13133c18c793f6f2235495d5e + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2543d4925154936850d3845532445996 + 221 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 390151000 + + OppenheimerFunds + + + f322ac9bf72383cad642cc31d293c06e + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c04bc2ee60083a6f275bd61fdbd8b92e + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 87f141e51cf76d53a844758bd1464787 + 222 + + 1996-12-16 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 393388000 + + NB + + + 37b57d58cf82a11472871aea4e8b6cb7 + n + 41047/100 + 41047/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6d46b50de4768c25884812c810514175 + n + -41047/100 + -41047/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ac5a052aabb9a2919d54cd3d69204ab0 + + 1996-12-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 406198000 + + Cash + + + ec938761e10f926f91f59413a7c29c0f + n + 4000/100 + 4000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6c246ff769910f4173b5fe868361d858 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a57548603dfe2a2622acd7cbfe2ae4f9 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 409596000 + + Cash + + + fcc465c76ecb6c88056610aa93f22156 + n + 10000/100 + 10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a8a448c16510f59945db80104ceac0a8 + n + -10000/100 + -10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b900ebc25a48bdda08af81b68367dcd0 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 412834000 + + ATM Charge + + + 46d73396d99e01e023ff43eaae3dd791 + n + 100/100 + 100/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 554ec7c3c5794ac334fb28a6ccc6ce7c + n + -100/100 + -100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 849d594cded5afa4939bc39454ed1ae6 + 223 + + 1996-12-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 417677000 + + Landlord + + + 5f6b1b66dd6fdc6b75a2e1e950d4c911 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 83db6dd043e4dae6319b6ef57b55ba0d + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 453714d0f6bf310baa75b4c3ae1ae40e + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 420881000 + + Cash + + + b8ec3304866596d5150ae277c24908a7 + n + -20000/100 + -20000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + caa2e873c07a7bb008e29d097c9f06be + n + 20000/100 + 20000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1193ad0cfae7cc631787ef2c057fa2ca + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 427138000 + + LJ + + + 821b5ad33183169c4507298ea47489ed + n + -23050/100 + -23050/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a809165ebffe5f4b51c40d2fb130f17f + n + 23050/100 + 23050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0c298574d52ec79f430bacbb432e6a06 + + 1997-01-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 430542000 + + Boss1 + + + 23875c0d737d0623ed3d51dd365d6406 + n + -198587/100 + -198587/100 + 4da6e3f697287c126a6827efd63a0b43 + + + c57052c5d506e15c4e024ff212a05bd7 + n + 198587/100 + 198587/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bb473d397573c1e491292cc2f12450d2 + 224 + + 1997-01-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 434489000 + + Mellon Bank + + + efee0da2c30ca08eee67ae8820d4ab49 + n + 4000/100 + 4000/100 + f5b32f79be8cc4952e6e2ddd4077b0fa + + + 1c4d6dee9fce92b2fc2ea80654641694 + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 827067e615b526598f1120ae0a622c05 + 225 + + 1997-01-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 437911000 + + LDPC + + + c0a9371cd2edd2a3c56c1b7e9cf53313 + n + 11224/100 + 11224/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1ed88eca4d4f84bec438f96e01900585 + n + -11224/100 + -11224/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fa2ee4a96fa779ad903e679cf2cde07a + + 1997-01-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 441404000 + + Power Co. + + + 32f8283f41147bf98b8c1acacc0d36b5 + n + 1158/100 + 1158/100 + 92b05cc5070282b02b05e60f161a5882 + + + a78b8be9342fe2ff07553c0ded182868 + n + -1158/100 + -1158/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1a00e4f34ad980e606de99a2860dade5 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 453760000 + + School + + + c427d7272777ee94aac629e95730a19c + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f260d536d1384a35272b899cd0d76815 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 068e74d0d92645e4d2f3b45fd085e380 + 226 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 459321000 + + W Bank + + + 4d9c764c8fabe5660a8d21c3bdb70601 + n + 31535/100 + 31535/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3e8c2ff1bbdd75856323bce05ac6be6e + n + -31535/100 + -31535/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bf09d118378c87abb11007ad6dd8ce82 + 227 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 462643000 + + Pacific Bell + + + 39d189e8299b7603666deec3bda87cd5 + n + 1707/100 + 1707/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 88036c73327945790bb9a9c08c7dac17 + n + -1707/100 + -1707/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 303d54dedff263a91e6cb51a4b26c4da + 228 + + 1997-01-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 467534000 + + Pacific Bell + + + ca1bcf2e2dd6f0cd4a9a7628664eddb3 + n + 1626/100 + 1626/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 9b22f04de4a412973edda84b6595e58f + n + -1626/100 + -1626/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6343a2e1654477b9b54141392667737d + 229 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 470852000 + + C + + + c6579b6c63dd0564c70542038736314b + n + 680327/100 + 680327/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 8839e3cf3943596f1f2bf74f58e864d6 + n + -680327/100 + -680327/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4fecc1c9b6010bf89908640fd812cba2 + 230 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 475292000 + + P.C.C. + + + e293f2d5d724ac399a68a3048181bc93 + n + 2311/100 + 2311/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ca83e0c3714b32d9e401a945d38db33f + n + -2311/100 + -2311/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 460e51588f368b8e84ad9aa772ec165b + 231 + + 1997-01-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 478886000 + + DWV + + + c0f7c0c3e7beb68ddaf8c6c60db3e4d2 + n + 1200/100 + 1200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 27dd616c8a76bb6673080628dd18a838 + n + -1200/100 + -1200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 735654b22025b9f8ad8a22ce96a2dbb9 + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 482153000 + + C Master Card + + + f03653c9b32d51e3f1e4a8a5a65a693b + n + -17096/100 + -17096/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 63c3fc193b315eefd3c1fd6f9f96d897 + n + 17096/100 + 17096/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 592aed41008b941447d1d4bcdb94822e + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 488775000 + + Boss1 + + + 820242db57c538d05bc6fb752e8427ae + n + -13017/100 + -13017/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 186f8f8bde40f01681a93eaf2de72528 + n + 13017/100 + 13017/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 74c9364b0a8b94aeb08b2383268782f5 + 232 + + 1997-01-20 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 492079000 + + PC + + + 8e9d4a71a15aee3dcf078b1a8cec4a71 + n + 7498/100 + 7498/100 + 9defb6c42135fa2f4036762c8926c8ca + + + c24cef8e60671892a5930c725d129b7e + n + -7498/100 + -7498/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 106ab0176f02a9405ee3c66a3e60c18c + 233 + + 1997-01-25 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 508842000 + + NB + + + de2fc1757cc61edf78440778a3e0160e + n + 151053/100 + 151053/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 48bf9b20c837a8149855f8c3a8475756 + n + -151053/100 + -151053/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5077695379011b26b6d41a5b3720bc7c + 234 + + 1997-01-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 512202000 + + Landlord + + + f7d85b8b01438f8cfd6bde938bd4a701 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fba2fe633d45c6f56e5627156f8ee687 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 981db9b1911401ff58e7c13821f33067 + 235 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 517500000 + + LDPC + + + de2486ff4869026c28e2a269ba8a2e45 + n + 335/100 + 335/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + d7267288e06524de8254fcc8394b7cdf + n + -335/100 + -335/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7e5db81c3b4899c562c2d8c8d7fcc7be + 236 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 520886000 + + BN + + + 1952bc2fd059541937e8d5b8f6de7133 + n + 30232/100 + 30232/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bea949cf0b653173e02e5747683ee425 + n + -30232/100 + -30232/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 623285c9fa3c25c378d86939a858ae47 + 237 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 525629000 + + + + + 70ded020b2233741773d5787ab7e8a59 + n + 3391/100 + 3391/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 70bd7cdccd92d30660179dd28393a50a + n + -3391/100 + -3391/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e2366d2e7499896d7a12a9dd7ea82652 + 238 + + 1997-02-06 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 529106000 + + + + + aeb878c3da824b10b4b1691b28faea92 + n + 7722/100 + 7722/100 + 9defb6c42135fa2f4036762c8926c8ca + + + a5ac8bb14a7da137602bb8312ea1507f + n + -7722/100 + -7722/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6a165fc10b3d9c4b20cb25ba3ea4a1c6 + + 1997-02-07 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 532437000 + + Power Co. + + + 4911061c6a78c0a8f5a789949bb03945 + n + 2143/100 + 2143/100 + 92b05cc5070282b02b05e60f161a5882 + + + b3f9a114abaafc395d9c816b15174f85 + n + -2143/100 + -2143/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 28f8eaa0613af2a549293c6f40e7a2a2 + + 1997-02-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 537275000 + + School + + + fedd8785ce35b56c9e0d4347a2dde6d4 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ee757456393d407ab066221d75df15e5 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3816d09ab7393110551bbb59cc69f5bf + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 540603000 + + Boss1 + + + d405e8bbbf242bc69e6242e2a27a029f + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ba90582969349f61b8706340436526e3 + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2aade6f549b63446db480424074f2e4f + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 553538000 + + Cash + + + 9d2385274ec67b2eaba6ddf09d8baf4c + n + -80000/100 + -80000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + dc1487ac053a15c80b09b34eb8c23794 + n + 80000/100 + 80000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d6b73506faf50e51335ab7d1c49189a2 + 239 + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 557560000 + + CAF + + + 5a9879799ddfbd30412dc8bca9a0acaa + n + 30000/100 + 30000/100 + 3451d55fd6957c001991ac7b98402b04 + + + 0ba8cfedec4d16bc594970aabcfa2d87 + n + -30000/100 + -30000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 78b99452bdcdecb8d63b9390be80eae4 + 240 + + 1997-02-11 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 560832000 + + City + + + 83a2eebda4369578a71bbcb278b61071 + n + 5000/100 + 5000/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 61b7931fe91a68af2e32c7c94df47a42 + n + -5000/100 + -5000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f3d060a115a4be3774d61fdb8e902a63 + + 1997-02-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 566132000 + + Cash + + + 092d80ec5d65fde0ac6ead589cd5f92f + n + 6150/100 + 6150/100 + 9defb6c42135fa2f4036762c8926c8ca + + + feee66ad4fbb2ed0c663dac7bd83b258 + n + -6150/100 + -6150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4cfee07d500b18b3e032eb60f6deff22 + + 1997-02-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 569607000 + + Cash + + + 298cc3ccfddcdfbff733ada6f776798b + n + 150/100 + 150/100 + 94f1725a16858da2a9832cec4d7c78fa + + + f3ef4110d5aa8b1cc264e52c64b35e35 + n + -150/100 + -150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f5d03cfc591689004f0123a0e08cb79c + 241 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 573105000 + + Pacific Bell + + + 2bfa2759cd7544f7989c8d3ae5bff3a0 + n + 1610/100 + 1610/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 10c54193a837cd30401b415707a45696 + n + -1610/100 + -1610/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7980ac4ffe2c6d148012383ddee31724 + 242 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 579170000 + + NB + + + 184c093e3d5a3a43bbf920db69896a63 + n + 60486/100 + 60486/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + e6e4db6627ad72dc98927608919742f5 + n + -60486/100 + -60486/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + eedd158ca6ce1c9ca48027b4be9563e9 + 243 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 582956000 + + C Master Card + + + 66234970380282cba6f89e868d52f81c + n + 62141/100 + 62141/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 59c5fb45451b70bf0ae45f3efa4151ae + n + -62141/100 + -62141/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f08803c9a31de343e3da4106a8750765 + 244 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 591970000 + + PC + + + 27067851a5a891ecd86ddf35ff8e62f7 + n + 21583/100 + 21583/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6d05242aea96343a8f168d2319cff39d + n + -21583/100 + -21583/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6ece4d7a1c447ec807770b55bd9ab3be + 245 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 602746000 + + AUC + + + a6d6b312d86ef6e0494643eb00c14140 + n + 350/100 + 350/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7e6ea743f6b7f7b9951fa18a4fe7f6a0 + n + -350/100 + -350/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d2018c35add9d2b262b7509ecf29eeab + 246 + + 1997-02-19 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 608475000 + + HCA + + + f6bebb35efb516c7583a8bec1135cdc1 + n + 448/100 + 448/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + 41c8b22c30269a42634dd4e1f72e2a7d + n + -448/100 + -448/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ed552474f3ab1b4cc6d2218956f75e0f + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 612462000 + + + + + 3b847da548ea51768f7a33acd2e66bce + n + -250000/100 + -250000/100 + 6cdb61279507abc41065ae0cfc49e314 + + + b23fa8445e8aae5272eb49b2a37bd1d4 + n + 250000/100 + 250000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a487ff2fc3ce9255ac93f8dceb56877c + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 616230000 + + Boss1 + + + 2de9dd4d409aed7fb0a2fef069dfc425 + n + -125608/100 + -125608/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + e07e60818435429fdc83603f935acf7a + n + 125608/100 + 125608/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8ac0168472e08d89b57f3963aec0468b + 247 + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 619861000 + + W Bank + + + 3e3bf2ddac3e25e47269701d44ce5453 + n + 261754/100 + 261754/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 67417405d30995a6a757d4b133e03de6 + n + -261754/100 + -261754/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f8dddef70105ec69639039676cd8ed0b + 249 + + 1997-02-27 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 623421000 + + Siphon + + + 5e8238d981ea81eb7c6d34ab209cfadf + n + 150000/100 + 150000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 23e1220d24b7d45f699f7edda9b55a42 + n + -150000/100 + -150000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c790b43cd97022b2a2ddb51372f153cc + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 630005000 + + Boss1 + + + ba0fb38b45665c40986563af5297b4a7 + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f05a3774c784d224ccc64471a7a04dcd + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1a661288abf9f2a7b11cffb2fb18ad94 + 248 + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 633489000 + + Void + + + c6f823af201e1f6c961831a769104e6a + n + 0/100 + 0/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ac2598e139ef2ee6aed835c5754d5dd3 + n + 0/100 + 0/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 667068ff874ca5e7fe68df6f3eb5f2ab + 250 + + 1997-03-02 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 638849000 + + Landlord + + + 8cfdd80812cc2db7597e76070e0191bd + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 7ab4b3fce54920d96384894d7fea6749 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1543035a3b6345afb761a2de84865e7e + + 1997-03-04 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 642395000 + + Coast Federal Bank + + + 2849d97068ee2fb7fb1d7ba135fd49d3 + n + 200/100 + 200/100 + 94f1725a16858da2a9832cec4d7c78fa + + + 4c75cfca188ec246b0a7827e3e809858 + n + -200/100 + -200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2e906cf02a4862ca515d96cd6207c9ab + + 1997-03-10 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 653068000 + + School + + + 0aff81e8c77fb0d8b986603220b00068 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 066ffc5eadab79b80ce91c28d56a73c7 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 7c1fd036103780221f9745a0de6f988c + 251 + + 1997-03-12 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 658138000 + + Image Check + + + 6aa7bfd8210a80ac06470940c5c63748 + n + 676/100 + 676/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 0625ccce2aa6767bc6261ae2627f349e + n + -676/100 + -676/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0d36273a9aa67523c06d881c09fe2124 + 252 + + 1997-03-13 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 662085000 + + 1HR Photo + + + 9d8a0ae0b2eeb42db3a67fdfd2c44f65 + n + 464/100 + 464/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3b32b12fff414f6470395230d2afa34e + n + -464/100 + -464/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 53b37bf0d9e06cb00b86cbd741ca0493 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 670018000 + + Power Co. + + + 997b40c6799a9f7217d9d62cc6a20863 + n + 2062/100 + 2062/100 + 92b05cc5070282b02b05e60f161a5882 + + + 3281a328f8582ef5f91fe5fb70a33915 + n + -2062/100 + -2062/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 15f0b1996a76f06a7dce6208aca94a47 + 253 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 673432000 + + HCA + + + 21f0a8e2c5f598ff06978259b56c84a8 + n + 1227/100 + 1227/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + a63494a82c2052828ee68246b81bae90 + n + -1227/100 + -1227/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ed3640628baa32651320fa9d467c3e92 + 254 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 677388000 + + NB + + + 9516531560ad5fe100e6ec9ea39754ac + n + 97609/100 + 97609/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 311d5fc277f22fe63109feb48adc4662 + n + -97609/100 + -97609/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e445c17b5001a0c2804cc1d55a154cb1 + 255 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 680980000 + + LDPC + + + 2db3299b015d462eef4a452c89422953 + n + 1387/100 + 1387/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 39d86f2837c5ee8cbbb2e2f1bd57877f + n + -1387/100 + -1387/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3fd9726e1ad270aa966fd281b6fa98b2 + 256 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 687025000 + + Pacific Bell + + + 61f429b7e61caf5bf90849e4ad186c44 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 05d7ef8e536b7048a33981b07b29c7f5 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1923f06e083014020089c084dfc0cb8f + 257 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 690690000 + + C + + + c89b32cd0df296141c7f2b8510c1a26d + n + 76269/100 + 76269/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 8ad74938a9ef6e20acd7cce2499f2a05 + n + -76269/100 + -76269/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a1526a7c736b8ecd601500f53d5907a9 + 258 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 702455000 + + MA + + + d5afc833b2ceae7af393bfe7abb22ed9 + n + 3765/100 + 3765/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + befcb8f4a369ddea19ee3e1041cec53c + n + -3765/100 + -3765/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1d284f2bf2194d3f637ad9cf012b5e5f + 259 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 707847000 + + Pacific Bell + + + 7405ad9f2fc398dcb80642654b8425e4 + n + 10856/100 + 10856/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + f83716c9834fe7d530068bbd69440ac9 + n + -10856/100 + -10856/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 94a09e390026305e5f687922b2e00919 + 260 + + 1997-03-14 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 712283000 + + FTB + + + d35bfb3500fbe769aa3491839750aa7a + n + 8987/100 + 8987/100 + c791e88d9c25ef9cbdab5d4b9f51fde9 + + + b2f0487977bc46f1ead8f6b4fcd57fc8 + n + -8987/100 + -8987/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3767b2b000c6be1934f41549fa38aed6 + 261 + + 1997-03-18 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 717441000 + + Dr + + + 4a94b12ba846fda1efb68fb922119e47 + n + 4000/100 + 4000/100 + 60845136829c50ec4a09675a08c2da24 + + + 626bb63127a414e072dd75d60f80c1af + n + -4000/100 + -4000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0827d64897c3c2c51907e31a9bfa22a5 + 262 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 720990000 + + PC + + + d6d6f0a0ce97326656fc5a8d5d6be398 + n + 23947/100 + 23947/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d08dc078fd9da8a8264dce2eb1b2807b + n + -23947/100 + -23947/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f3e52a242480b1dce5b7f22d8daf4d2c + 263 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 726757000 + + LDPC + + + 5bf8275c51a42748dd822d3069dbc66e + n + 480/100 + 480/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 1fab7a3fe9691ad20dd89c3fc1e2be11 + n + -480/100 + -480/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c2264c22efa108f6af9678ded1b9beb8 + 264 + + 1997-03-31 00:00:00 -0500 + + + 2001-03-26 15:43:52 -0500 + 730375000 + + Landlord + + + 08e6b80b6d2281262f85c6aa3938c090 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 997b2b2111205898e64c27426c6b3cac + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3cd732cb4a7bf33e91b4819dcf21e702 + 265 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 734748000 + + HMH + + + 37212595735b2d8251e35a8f4ffd9f98 + n + 4530/100 + 4530/100 + 60845136829c50ec4a09675a08c2da24 + + + adbb4271ff307222874e3ccd2eaf6ffe + n + -4530/100 + -4530/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ca3ebd5bb83ecd464073d569770766b9 + 266 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 738338000 + + Pacific Bell + + + c947a78e5aca982d5cc010e9f7d82739 + n + 4691/100 + 4691/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 46a9d67bb9dd0b1d0cab06841de6d9ac + n + -4691/100 + -4691/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 338b36ee0a5b2a1cbc7a3e1a223b1d3b + 267 + + 1997-04-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 741918000 + + City + + + 7cd754a77660fccd622771f6bc3367ba + n + 2200/100 + 2200/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 73f93616a798114e77d141fc708d3969 + n + -2200/100 + -2200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d7cf017ed3b30e0b6ca03523cf7042ec + + 1997-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 756517000 + + Power Co. + + + 5e35b38bcea75e790ed3e912cebf279c + n + 1987/100 + 1987/100 + 92b05cc5070282b02b05e60f161a5882 + + + 9cec2e4f568eecc78a71d8d08d9452e7 + n + -1987/100 + -1987/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9b37ec252f99f1dd19d51900726ac6b1 + + 1997-04-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 760170000 + + School + + + fc375e8dfebdcc24af94943b4d02e65d + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 21e040595fb25e07c36febf6304d6210 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a884f8e5735fa714d63f9c43275f88c3 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 763725000 + + U.S. Treasure + + + f077213808a9b0dcf3fa471fc40d1dd6 + n + -17881/100 + -17881/100 + 15a7de112614d62d993dfcc43ff70142 + + + bc1add7959726c38d6e1b226fabf5600 + n + 17881/100 + 17881/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c63439722c2df5b7c0fff748fdcfa8cc + 268 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 768828000 + + C Master Card + + + 20b7158a55ea608ee8419b7842d860ee + n + 62734/100 + 62734/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 6841b326115d1d25ff6c6826b23b748a + n + -62734/100 + -62734/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ede777e9b012725c09d68cb7eda91f27 + 269 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 772557000 + + Pacific Bell + + + 72623bae9b029ddd25f6b049a032ee59 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 623290551347f6c3575cd80edb32f975 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5bc7e6069181ba2d61fc7a721c8e53ef + 270 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 777173000 + + PC + + + 5901539c3bd871ac5df892d20f4c0650 + n + 2131/100 + 2131/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d7137ca202dc10a4db7e64fc6127ff6f + n + -2131/100 + -2131/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 24e4a033871209b811d0e58a091b5878 + 271 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 781147000 + + NB + + + e7adc36f61eae8daf1d5d1b01f0f1bb1 + n + 82709/100 + 82709/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cd001fe4252a3ba3277520a3595056bd + n + -82709/100 + -82709/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5119345ed2553f2914671003c08be51e + 272 + + 1997-04-21 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 788261000 + + AN + + + de06fe5fb322c587deb9dfc2559d81cf + n + 3600/100 + 3600/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 00e33482d86208da4f70746d32a3f73f + n + -3600/100 + -3600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b59255575e261e6b8c170e9378573fa2 + 273 + + 1997-04-25 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 791897000 + + Time + + + 9f9dbb6d75c01077417b83c223781a01 + n + 6032/100 + 6032/100 + f981711ab9d0c5ca6b75d0b5a8ee261b + + + 659e1c4eaa022164d7aa05e26631aeeb + n + -6032/100 + -6032/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 90beabe2d85e83f4993b2bace4624017 + 275 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 802258000 + + DWV + + + 94a77513c21c26d1d06b93eb1d42fb9b + n + 23600/100 + 23600/100 + 74446cb1e9d9fb729f0d002aea325430 + + + 54ffe4fef8a63ff49efb446f6bbc1650 + n + -23600/100 + -23600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + cd2c3c85b514820836717d12ef118527 + 276 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 807296000 + + Landlord + + + 820abd3f59513d18f0aafeabb702efd5 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + a08de56b45e502e40e8558b16f9eca0b + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d5019bbaf588479582720127553fb662 + 277 + + 1997-05-01 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 811931000 + + WJ + + + 994c5d2f22cb6d15f63a1b360a8a7b6a + n + 7026/100 + 7026/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 1e1e679fcbeff5a29a49398c74b80811 + n + -7026/100 + -7026/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5c3c21ac72e9987e525a1a51bfbb2648 + + 1997-05-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 818111000 + + Boss1 + + + b52c889b4725bf103114786bf272b1e9 + n + -500000/100 + -500000/100 + 4da6e3f697287c126a6827efd63a0b43 + + + b0506760368c7f0c44700b9654e45da1 + n + 500000/100 + 500000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f31bb257cc534a99b28cdeeb61b7d7e1 + + 1997-05-07 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 821754000 + + Power Co. + + + e7083ca2706194fabaf14b1b2080eac8 + n + 1879/100 + 1879/100 + 92b05cc5070282b02b05e60f161a5882 + + + f970c39abe00ab00b1e91420e10cb8cc + n + -1879/100 + -1879/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9f38637634c9ca8177926e6d4323eccc + + 1997-05-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 827293000 + + School + + + 093f13f06a2777f8ed82c28d8b6590c4 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 2b0765c638e48309646f9cde2faaec2a + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e76bb9b743b6d287a11dcbe0b0869e83 + 278 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 831052000 + + C + + + f10d84333eca0612c84e88b72592652e + n + 14700/100 + 14700/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 4d5533b370f4fac3be475337d5044d5c + n + -14700/100 + -14700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9384c499de53be49bd488728ac2d0d72 + 279 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 878146000 + + NB + + + 215eca347c1a672a45568fd7a39b33bd + n + 62979/100 + 62979/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + fc1048ce4dd3e691df4b4a061325bda8 + n + -62979/100 + -62979/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 80005cb3f573a01ca784b81c5cb0622b + 280 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 882010000 + + Pacific Bell + + + 8f8a652f18ceff552982a85c6a7a069b + n + 6009/100 + 6009/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 22888f59b1e7b9edaa02562976606c89 + n + -6009/100 + -6009/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d1d647017fea0b84df6775f10efd864f + 281 + + 1997-05-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 886369000 + + LDPC + + + c7b2809afca1ff24d3dcf75aeddadd54 + n + 5318/100 + 5318/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 05c9ceb2aea157d5f4bf4f302d43359a + n + -5318/100 + -5318/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0a337e0f3dca16ffced22be15281a0d7 + 283 + + 1997-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 890152000 + + MA + + + b852f1af0133f6b88d6e83d793b90795 + n + 5844/100 + 5844/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 39f2f3aa7d6c7ed9edf0cbc446588e81 + n + -5844/100 + -5844/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f4121e9ee5950e9b3f7256e66459625f + 284 + + 1997-05-20 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 902096000 + + Boss1 + + + 45a91af09ecabe0b631b4e399d72b606 + n + 7200/100 + 7200/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 4abb279f582d0f6496ce605a6b2ef928 + n + -7200/100 + -7200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a0537ab37f187113f8159296eb35b230 + 282 + + 1997-05-29 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 910229000 + + Landlord + + + 7db3cc65f8c984fdaf5fed128d629101 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 9a9ab1a120889414bce6bd3b4c92fb7e + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ce7165530584bee35a5dd7978a044932 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 915272000 + + LDPC Co. + + + a291289c090f68da1f9db04019b436fa + n + -10000/100 + -10000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + ae73f7bbc613e8310e4e1ffc9d90b712 + n + 10000/100 + 10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 945f95941db96567f0758ed55be7ef13 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 919308000 + + AN + + + c2d05d847f205b590e6714b4ccfe3706 + n + -1657/100 + -1657/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2c80561c8d595ca6e8825b95e14aa53e + n + 1657/100 + 1657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6d59952c3fd084f3975f0b03a3754762 + 285 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 923215000 + + LDPC + + + 0ae9bb7d6f819ec29f2e9054a52611ab + n + 557/100 + 557/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + c356713b1cc44e278292ff19fe78a88d + n + -557/100 + -557/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5814d7d7dbf20973ede0b9a5f858478f + 286 + + 1997-06-02 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 929466000 + + PC + + + 459ef59f94bf5dec6a78d95b3f2347e3 + n + 4462/100 + 4462/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 5d1a2eb53c7cb96990b9a8ca771c21e7 + n + -4462/100 + -4462/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + a0c7b2f3a8bd21cc20a956f3e1f1e213 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 933294000 + + Boss1 + + + 08f51b4a7661553dd748f0749366354c + n + -79580/100 + -79580/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + 6fa26a9227791f5584d451291d310aa9 + n + 79580/100 + 79580/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e767808c76ef6beedaece0dfd14d01f8 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 938773000 + + Boss1 + + + dfbeac03e9486bb62ae8bd9fb7247582 + n + -199603/100 + -199603/100 + 4da6e3f697287c126a6827efd63a0b43 + + + a8b45da8569d554a36b2a7044de6be32 + n + 199603/100 + 199603/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 022e64fdb68b4103020fd69957ce7767 + + 1997-06-05 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 942684000 + + Boss1 + + + 65b8017061e290f22c2fbc5c2f710b6a + n + -40000/100 + -40000/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + b7cb2138962a722aa0fb843a907faf6d + n + 40000/100 + 40000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 651a5e321a645022b055de7ff25e6db4 + + 1997-06-09 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 956025000 + + Power Co. + + + 65a3ba67425fe2fdaed4ea3e9986f4e1 + n + 1898/100 + 1898/100 + 92b05cc5070282b02b05e60f161a5882 + + + 6f869a9af38bf5e1f2c4dcd427cb45ab + n + -1898/100 + -1898/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fc085b8b12c6d0e2bcfc4926c487bf38 + + 1997-06-10 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 959771000 + + School + + + 186266d6fc91f0a99588c26c3a6c5fbf + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 519addd050903148b123c0b9a90445f3 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ad0b49172f5f3cfdc36d8e77f9300d22 + + 1997-06-11 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 963589000 + + PC + + + acab4e7ebe17d3f569fbe74929a6707d + n + 5897/100 + 5897/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 61302c167f8d3bfa17c7d2c84d57fd80 + n + -5897/100 + -5897/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 897cfd2f277906a23aa23abb860427e4 + 287 + + 1997-06-13 00:00:00 -0400 + + + 2001-03-26 15:43:52 -0500 + 983797000 + + Insurance + + + 3f6b3abc82a6a74ecae20466263e6e48 + n + 50100/100 + 50100/100 + cc640e911a739a6f58675333704ce9de + + + 0ab0b745807a3268d877d90de7f861f1 + n + -50100/100 + -50100/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + de6de8178ac4fb1dea5aa72a40c04409 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 11908000 + + Cash + + + 3aa9b07b1460ca1b5f1b7996220c71af + n + 200000/100 + 200000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + b9f24970b66bb96731b86404314e093b + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4a2b7825cd82365d3e948ac1ca36fa69 + 288 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 17571000 + + NB + + + 05a69453f66b4c7dbdb7bad032de8f9c + n + 160040/100 + 160040/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + d1597bc93fcb85b3bd0643423095eabf + n + -160040/100 + -160040/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e40a87e2b15b271ea3e0c61c5eed9136 + 289 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 21529000 + + Pacific Bell + + + 0fe2b2046e845c2d434c6013907f3ce3 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3b52b1c474ca249aa8b97ff581516cf2 + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4fdca16d29e90da560796d93b26ada6f + 290 + + 1997-06-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 27169000 + + C Master Card + + + aa8c51f36d3dc503fa958b394c66307e + n + 19707/100 + 19707/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + bd256365fb15957e5ae0966075c3d3a6 + n + -19707/100 + -19707/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ebeed163269757bc5399be61e889e321 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 31076000 + + School + + + 152d2f8773303341d0209109c93a05e0 + n + -7650/100 + -7650/100 + 60a59d2467d55241a1f13d5c0c43fa1b + + + bb4eae87754d159bb3c6cd479365ec5b + n + 7650/100 + 7650/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d3b8043b3196da237eea9a143e26431e + 291 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 39088000 + + MC + + + e9e6466cdd13c2337df13895267db192 + n + 24257/100 + 24257/100 + baaf4f690ee338fe4b0cf67dd6c2bf8a + + + abeded579dda59f0f8e62776107714e6 + n + -24257/100 + -24257/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4302b0d7a1e8e7f94ebfb7556e306686 + 292 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 42937000 + + PC + + + 44ed1fba7f70c1f3e653ac60baf09d1b + n + 4203/100 + 4203/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 2e222aacc4577c8c102c7d60a0dc2a92 + n + -4203/100 + -4203/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 897dad8df9174b77150e38e36cbabc35 + 293 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 52741000 + + HMH + + + 924e05194f60bca43f2239b3a45511ed + n + 3020/100 + 3020/100 + 60845136829c50ec4a09675a08c2da24 + + + 617993e05ef9f4d27c075bf6d746692a + n + -3020/100 + -3020/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d8cedee0d2458f504a0f9a1621faa569 + 294 + + 1997-06-24 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 67385000 + + Landlord + + + b116072250be8208f80e994fe121efb6 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 10206b5ae941175845308c0a398dff93 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 99ca076f81649296fa7e71194b2bb618 + + 1997-07-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 71163000 + + Power Co. + + + f3ae02db04d51fe05598a0f3d67aa2ac + n + 2369/100 + 2369/100 + 92b05cc5070282b02b05e60f161a5882 + + + 0a223bdc3842aaf89031056028db7495 + n + -2369/100 + -2369/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 4468644fe09284cf64d29da418f03805 + 295 + + 1997-07-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 75908000 + + LDPC + + + 1506207b9579dc4f1aa13017e2c88b40 + n + 1824/100 + 1824/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 13e3521cebf660d1aa288cf1c48578de + n + -1824/100 + -1824/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5833a5d89a377c1b7ed78afb17210d70 + 296 + + 1997-07-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 79830000 + + Pacific Bell + + + e42a0df7ca6fcd7e29dca382dca8f180 + n + 6403/100 + 6403/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a4ad94d75253eafc99b421abf49e3afa + n + -6403/100 + -6403/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 40b948feefb4f7282083d330da4f3bb8 + + 1997-07-10 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 86821000 + + School + + + 8cda3ca9ccfed1c2d84920789471731e + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 6711ed19549b67d69c221d05b4880024 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3c43cb682217599720d97883e05d17b2 + 297 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 91686000 + + NB + + + aa3c0ee7b1e440b03d4ca31921571300 + n + 43343/100 + 43343/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + abad7638636568d073b8c58900cc929f + n + -43343/100 + -43343/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 394ee7a0ab7014566da7a11a81c48e10 + 298 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 98862000 + + C Master Card + + + a4635cf13fb19baeb76838f6f6840cdd + n + 78050/100 + 78050/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + ec5787436adc2bc8d3f6646c95668fa3 + n + -78050/100 + -78050/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1d0a0c09a591bcb2d1b71563d52fd0a9 + 299 + + 1997-07-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 102930000 + + Pacific Bell + + + a6dc948f17564a60f5d1ebaa4c4c1bfe + n + 1657/100 + 1657/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 09c63542fe2f793f9e84ce5c62548a56 + n + -1657/100 + -1657/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ce4bb57aeb6ff0f331fe775bf554cf59 + 300 + + 1997-07-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 113775000 + + SL + + + 5bf77b7b17e567d7f20c9b52007b99be + n + 75000/100 + 75000/100 + 96d92c6744c5df991da54c700630fe72 + + + fa56bf17b8d61e956da18139a01728ca + n + -75000/100 + -75000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c88269043c5fa6f7269d91c6b3569cf6 + 301 + + 1997-07-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 119797000 + + Landlord + + + 9970e1cf2905d15049d63b79df308af3 + n + 52500/100 + 52500/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 2f29ecc303f67d052aa6c1a61ae41361 + n + -52500/100 + -52500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ada1f7d5db1d5940e00e2f8704f2a417 + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 123707000 + + Power Co. + + + 7aced176458b42ca438e42fa189560d4 + n + 1901/100 + 1901/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 48d5629a0fd79ac54f7635d1db0bbf32 + n + -1901/100 + -1901/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 46c3e7c59c0f1b7ef700f33eac7e00dc + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 130494000 + + LDPC + + + 5c8712bc5d87c3ae55fc5fc1fe5e216a + n + -10000/100 + -10000/100 + e9b94c2baee4d4f9489a856f4a8a06e0 + + + 6786edde55236622b04e73518e2144de + n + 10000/100 + 10000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8657a748ebcf8db88b39877178e0bf28 + 302 + + 1997-07-31 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 136270000 + + LDPC + + + e46ae9653f9bca90745156e890416cf1 + n + 324/100 + 324/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 024c824a4c8e804e2dfb1b08e7920811 + n + -324/100 + -324/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 18036f6797801ef311d8f6c82b0980a0 + + 1997-08-02 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 437157000 + + Gov + + + 1dc73cd2cbc8fe231663b599a46e5cb6 + n + 8500/100 + 8500/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 669f8b681f06bb2ebffc7b5544b1bdb6 + n + -8500/100 + -8500/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fa45b682d2d763a8c06f04852ad31e0c + 303 + + 1997-08-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 441318000 + + Pacific Bell + + + d29736bd0e5486fb5b842a091a6d6813 + n + 32575/100 + 32575/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + f495e1fcdbe3b3d28b74111fcfe743e0 + n + -32575/100 + -32575/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + c619cdd99573dd31d4443ba4b7580734 + 304 + + 1997-08-04 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 447733000 + + Pacific Bell + + + 4a5006552a46776ae5aa1f54bd05bf14 + n + 1645/100 + 1645/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + ede912527d09b6dd4748ffcf80d0c55c + n + -1645/100 + -1645/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9812d1ee0a6c2a6b07c00fe542edcc87 + 305 + + 1997-08-04 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 451762000 + + Community Hospital + + + f2db08e473f15fc9226056911c1bce3b + n + 3530/100 + 3530/100 + 60845136829c50ec4a09675a08c2da24 + + + 76ec26162e8199cd74114d213dbe0885 + n + -3530/100 + -3530/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 37274e49468f77d6cb5c7a4ac27f7b94 + + 1997-08-10 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 465571000 + + School + + + 36529a24509ed8ec995f111545f17c86 + n + -131873/100 + -131873/100 + 4da6e3f697287c126a6827efd63a0b43 + + + da4bea0fba94cf2f54b4f9b64a3fe040 + n + 131873/100 + 131873/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5a5073b643394f9132d92e055f2b9ddf + + 1997-08-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 469555000 + + College + + + c0dda888c4bb5febf0a3991524ab0edc + n + -4700/100 + -4700/100 + c1c71598e096d9ab5565f096db36ed59 + + + 8c7d9c30eabb2778841276e4e865e149 + n + 4700/100 + 4700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b6103380b09fa52b8d9ce3dc7022458e + 306 + + 1997-08-14 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 473567000 + + C + + + 3777e5827f6a6209338e6d9acb874301 + n + 113191/100 + 113191/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 1bfd96fc1318c77160030d6894c83b84 + n + -113191/100 + -113191/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 98af80106192829119277b2ec70c505f + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 480303000 + + Power Co. + + + 69fc6f978b47d605fe40595eca7b40e1 + n + 1776/100 + 1776/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 81f342f62b79fa10938029f8c34fd4a9 + n + -1776/100 + -1776/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + e58d04ea5ab0a405244b3df03bf165a7 + 307 + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 485219000 + + School + + + 83c4b6627646d08575ab5f3de188d581 + n + 58642/100 + 58642/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 7e8ecf29165860fe0a33ae24fc1bb12d + n + -58642/100 + -58642/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b583ae684477765c7639c9210e2a9103 + 309 + + 1997-08-15 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 489474000 + + School + + + e522a5b59f8d0fe04a5bc253c28f2922 + n + 10483/100 + 10483/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 38cea2908bb235848cfb4ff545a58b73 + n + -10483/100 + -10483/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 17b839c0dae6b48d512225312bd085e6 + 310 + + 1997-09-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 493645000 + + Robo + + + e7e8414d043369c18fda4b6ba46aa242 + n + 5728/100 + 5728/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a954f5435dda86b27740f587125448b4 + n + -5728/100 + -5728/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + ba794353f51709430af700a69e1ec8ac + + 1997-09-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 500369000 + + Boss2 + + + 43f9792616b2e18c1a0ce1a178377ea9 + n + -242653/100 + -242653/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ef775b23e44bc0fef2be091b0d6e8db6 + n + 242653/100 + 242653/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2e3b3fb5572d1a89117cf7d425e81c12 + 311 + + 1997-09-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 507537000 + + Landlord + + + fe10fe62872341bc0e0bf8cbcd50b188 + Deposit + 1st, last months' ren + n + 200000/100 + 200000/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + d98f1bc7bc8d4f8cf69944944ec90d0b + Deposit + 1st, last months' ren + n + -200000/100 + -200000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 3c5df0fc4b2353c26b749a562ff45da0 + 312 + + 1997-09-08 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 512414000 + + Travel + + + b0871ffd76d7a78053cfa8a3e144a78b + airfare + n + 38000/100 + 38000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 3b3c584dca23f23914c35fadd63a8aea + airfare + n + -38000/100 + -38000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0f11a5061061f6a059832bcbdee6c9f1 + 314 + + 1997-09-25 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 518612000 + + Landlord + + + f7fbc52fded04834e27efd501c61862b + Oct. + n + 36747/100 + 36747/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + e021b4e03cb5906d40e394ca9002eea7 + Oct. + n + -36747/100 + -36747/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6041c068d720a761474c534018da0713 + 313 + + 1997-09-28 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 522918000 + + C + + + a719c38c3700ff6117c374337bdc2c4a + n + 28648/100 + 28648/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + cd0020e3d51b6072f17ad6851cf978fb + n + -28648/100 + -28648/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f97e362e0dfdc735422be36d7b9d7b80 + + 1997-10-03 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 527472000 + + Boss2 + + + a21fe67963e462b661eea725790f4358 + n + -92689/100 + -92689/100 + 4da6e3f697287c126a6827efd63a0b43 + + + bc46fc199164249dee7b8aaf3abd3815 + n + 92689/100 + 92689/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 5c64c9ddf9891a5e755dcfca9296d121 + 315 + + 1997-10-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 531555000 + + Power Co. + + + ac217272a15847f7672bc1a63e9dda93 + n + 2247/100 + 2247/100 + 92b05cc5070282b02b05e60f161a5882 + + + 8bdbdca3540791a6bbe1798b3200b4cc + n + -2247/100 + -2247/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f52ea1261340b682e6451bec65a87e78 + 316 + + 1997-10-06 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 538809000 + + City of + + + f3e66f46590f21fd1d7bd55bc3376479 + Parking + n + 2000/100 + 2000/100 + ee3d0e82c9b191091e61d4d1bc8da9f3 + + + 404ae482236ee576a13fc7d2704580f6 + Parking + n + -2000/100 + -2000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 1e1be3d06dd61a7c14a2e73af8bd3a6c + + 1997-10-17 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 542802000 + + Boss2 + + + 509b51caa99fcc7dc819dcc23aa1d484 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + ed4d99af4e28874dce4fb4b122353361 + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 02cd8b554862aa8af1d4594b6b01b026 + 317 + + 1997-10-17 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 548608000 + + C + + + 5e880cfa5a71fd8a7b72e14e8a74959e + n + 122723/100 + 122723/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 7334a9bd2e1f43683abf4dd3e3fcb5e5 + n + -122723/100 + -122723/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 8dbb15e8d691297e6841ba2d2876e5ac + 318 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 552892000 + + Pacific Bell + + + e520d308634b5dea9492b09a30846358 + n + 7730/100 + 7730/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 00371dbe56093972affedc9cec009c29 + n + -7730/100 + -7730/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 60d4d5e2f751685ed5724d5727f5a91e + 319 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 565974000 + + CO + + + 8d77b8ff136a4545ba248e0092ff9062 + n + 11700/100 + 11700/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + abd01fc5453475dbefbcb6434cc1791a + n + -11700/100 + -11700/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 9ca3e3f01216b2b94a7799c38fb3a02e + 320 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 570461000 + + Insurance Co. + + + 5763774ccefd5fff2719f74e8b26e025 + 25% + n + 7150/100 + 7150/100 + 73f01092a778ac5f25d1f95c1f34a6eb + + + 71052afe4f4cd8910e1c39262f0b278e + 25% + n + -7150/100 + -7150/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2c446631de5c84d03c1df0a840516758 + 321 + + 1997-10-26 00:00:00 -0400 + + + 2001-03-26 15:43:53 -0500 + 577093000 + + Landlord + + + 5d1c4bc1a11f7130efd76f71096ef4c8 + n + 100000/100 + 100000/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + 5e0e808e3d229d9ce9d49cbd3d4e63da + n + -100000/100 + -100000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 0b32b6d2a14a76cb172cea6771c081db + + 1997-10-31 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 581233000 + + Boss2 + + + a3cf2af5940cca7a7c23dce67d67133e + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + f12ae1807326c9256821c185cdb812ef + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 228d18949e04c7d8820e022b60afd638 + 322 + + 1997-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 586006000 + + AUC + + + 76eba388cfd642295c56834898acde6f + n + 159/100 + 159/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 2dcb882d3d6013b5a084d457052794eb + n + -159/100 + -159/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bcc55c52b9a3c36558b6c1ec8427c373 + 323 + + 1997-11-01 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 590257000 + + Power Co. + + + 89cec80f045ca971ca32da47398cf991 + n + 4524/100 + 4524/100 + 92b05cc5070282b02b05e60f161a5882 + + + f4a77f39d221ce4f3d76341bce66ab21 + n + -4524/100 + -4524/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 2e2566816e30bf361b4a3cb151234882 + 324 + + 1997-11-05 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 597900000 + + Robo + + + 4c5ce317a7640bd664a4af7d96e5e29a + n + 9023/100 + 9023/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + a93bb03a28013bc647f6125aad181005 + n + -9023/100 + -9023/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f49d9f78393641206738d2009a602dd7 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 602860000 + + Boss2 + + + 17244e00aa18082766409004e8cc13b2 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 51d932e9c4bfaf4b17662c6efedfed24 + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + f28b7923a79d20db9c983c8cb5777c63 + 326 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 608886000 + + C + + + 27191c314877b98b85093b501e1f29c6 + n + 170733/100 + 170733/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3e1ed49cb0f18791c7ce77ecfb95ce53 + n + -170733/100 + -170733/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 69dfd956e9799ef1ffceb28152b58d6b + 327 + + 1997-11-14 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 613282000 + + APSR + + + 874717c1496ffa8f1cf160991eb13531 + n + 5000/100 + 5000/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6cbc1e994b4b860f1dda727fc3b4a3db + n + -5000/100 + -5000/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d30aba4cfda217f78d90e800fb9c158f + 325 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 619988000 + + CO + + + 85f3a0aede095cf737a8ae417d46485d + n + 11600/100 + 11600/100 + 5fc1c6a2a79889318f644120ac82c8ee + + + 3dc64482623c97ead17257baa9a38d6d + n + -11600/100 + -11600/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 573e1fa279f8cd5b922103290dc8f00b + 328 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 629870000 + + Pacific Bell + + + ae3f61d441584e38b2de42b4e5191551 + n + 22798/100 + 22798/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 9d30ac4e1a12b31eb67af07c583f2c3f + n + -22798/100 + -22798/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + fa7ee38cc9df47a4140fd81164198149 + 329 + + 1997-11-25 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 636357000 + + Landlord + + + 5d718e1b3a3d3a3edb45b7dbcdb0a31d + Dec. + n + 71612/100 + 71612/100 + 329b2c5196efdaf54e1321e05b9f0875 + + + fa28aae14d88434c73bca0b747f4457f + Dec. + n + -71612/100 + -71612/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 6872d489f35eeadc610500711cee3fe8 + + 1997-11-26 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 640787000 + + Boss2 + + + 1b853eb5535448f95164026e0bdd5df8 + n + -92689/100 + -92689/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 6bf8ab13a9d56a262bbbe0d522bd756e + n + 92689/100 + 92689/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + bbb8f3eaf2cf94336ceb081c70723eba + 330 + + 1997-11-26 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 645435000 + + Travel + + + c7a56ac15188ac28a9ec791902316365 + n + 20200/100 + 20200/100 + 9defb6c42135fa2f4036762c8926c8ca + + + 6540770c085f0187308121c78ea8a300 + n + -20200/100 + -20200/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + b9ac8690528e41fbb7576df639a9a86e + + 1997-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 649666000 + + C + + + 90cd445c80e9ba7357dac5dc2051025b + n + -11205/100 + -11205/100 + fd1d2d2d58ceefc149f572a1e6936cec + + + 38d1297fddff33666e00dadae504c0fa + n + 11205/100 + 11205/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 841ded9d33426c92ffc9feb57fab49f4 + + 1997-11-27 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 653723000 + + Insurance + + + 734505c5ef26be30613f0994f0db187c + n + -8940/100 + -8940/100 + c1c71598e096d9ab5565f096db36ed59 + + + a766404f0ba54d9f2a38fa0461856f4a + n + 8940/100 + 8940/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + 75b0b4d236d5ed90421f81362f729f40 + + 1997-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 668608000 + + Power Co. + + + 2cbe654e960839d11f7aef72ecf58024 + n + 3647/100 + 3647/100 + 92b05cc5070282b02b05e60f161a5882 + + + b9c1d5913ee35de931a0e6b1bc930747 + n + -3647/100 + -3647/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + d8dcacdbae5ceda6e986716a8127e946 + 331 + + 1997-12-11 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 679027000 + + Robo + + + de580c914d042b14ad9086ada2eaf05f + n + 30476/100 + 30476/100 + 8d9a8e4928257f0b0aaee042057d8012 + + + 3e63f35f3cac812b94781a890385f80d + n + -30476/100 + -30476/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + dd0036886d2de3f89b0a1c5105f15b88 + + 1997-12-12 00:00:00 -0500 + + + 2001-03-26 15:43:53 -0500 + 683306000 + + Boss2 + + + 8c768f341ac8a19bfd74e68348a509c8 + n + -92690/100 + -92690/100 + 4da6e3f697287c126a6827efd63a0b43 + + + 64b19552beeb1d512a26abd53574702f + n + 92690/100 + 92690/100 + ab52d1a8fbd5883a788d51bd29c77e84 + + + + + + + + diff --git a/src/backend/file/test/test-files/xml2/pricedb1.gml2 b/src/backend/file/test/test-files/xml2/pricedb1.gml2 new file mode 100644 index 0000000000..cc81c60292 --- /dev/null +++ b/src/backend/file/test/test-files/xml2/pricedb1.gml2 @@ -0,0 +1,5336 @@ + + +12 + + AMEX + stk + Stock + 100 + + + NASDAQ + ANDN + Andover.net Inc + 034318-10-5 + 32 + + + NASDAQ + CORL + Corel Corp + 32 + + + NASDAQ + EGRP + E*Trade Group Inc + 32 + + + NASDAQ + GNSS + Genesis Microchip Inc + 371933-10-2 + 32 + + + NASDAQ + LNX + VA Linux + 100 + + + NASDAQ + RHAT + Red Hat Inc + 32 + + + NYSE + AMD + Advanced Micro Devices Inc + 007903-10-7 + 32 + + + NYSE + DIS + Walt Disney Company + 254687-10-6 + 32 + + + NYSE + MAT + Mattel Incorporated + 577081-10-2 + 32 + + + NYSE + SGI + Silicon Graphics NEW9/86 + 827056-10-2 + 32 + + + NYSE + T + AT&T Corp + 32 + + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 237500000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + CORL + + + ISO4217 + USD + + + 2001-03-26 15:57:00 -0500 + + Finance::Quote + last + 234375000/100000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + GNSS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 120625000/10000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NASDAQ + RHAT + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 609000000/100000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 286900000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 287000000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + AMD + + + ISO4217 + USD + + + 2001-03-23 16:01:00 -0500 + + Finance::Quote + last + 287400000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 279100000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + DIS + + + ISO4217 + USD + + + 2001-03-21 16:04:00 -0500 + + Finance::Quote + last + 279200000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 180000000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 179900000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + MAT + + + ISO4217 + USD + + + 2001-03-21 16:02:00 -0500 + + Finance::Quote + last + 180700000/10000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 16:00:00 -0500 + + Finance::Quote + last + 405000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 404000000/100000000 + + + + NYSE + SGI + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 403000000/100000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 15:59:00 -0500 + + Finance::Quote + last + 224000000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-26 15:58:00 -0500 + + Finance::Quote + last + 223400000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + NYSE + T + + + ISO4217 + USD + + + 2001-03-23 16:02:00 -0500 + + Finance::Quote + last + 225200000/10000000 + + + + + + + diff --git a/src/backend/file/test/test-kvp-frames.c b/src/backend/file/test/test-kvp-frames.c new file mode 100644 index 0000000000..2ee81cafd4 --- /dev/null +++ b/src/backend/file/test/test-kvp-frames.c @@ -0,0 +1,214 @@ +#include "config.h" + +#include + +#include "gnc-test-stuff.h" + +#include "kvp_frame.h" + +#include "sixtp-dom-generators.h" +#include "sixtp-dom-parsers.h" + + +static void +test_kvp_get_slot(int run, + kvp_frame *test_frame1, const kvp_value *test_val1, + const gchar *test_key) +{ + const kvp_value *test_val2; + test_val2 = kvp_frame_get_slot(test_frame1, test_key); + if(kvp_value_compare(test_val1, test_val2) == 0) + { + success_args("kvp_frame_get_slot", __FILE__, __LINE__, "run=%d", run); + } + else + { + gchar *tmp; + failure_args("kvp_frame_get_slot", __FILE__, __LINE__, "run=%d", run); + tmp = kvp_value_to_string(test_val2); + printf(" Value is %s\n", tmp); + g_free(tmp); + } +} + +static void +test_kvp_copy_compare(int run, + kvp_frame *test_frame1, const kvp_value *test_val1, + const gchar *test_key) +{ + kvp_frame *test_frame2; + + test_frame2 = kvp_frame_copy(test_frame1); + + do_test_args(test_frame2 != NULL, "kvp_frame_copy", __FILE__, __LINE__, "run=%d", run); + + if(kvp_frame_compare(test_frame1, test_frame2) == 0) + { + success_args("kvp_frame_copy->kvp_frame_compare", __FILE__, __LINE__, "run=%d",run); + } + else + { + gchar *tmp; + failure_args("kvp_frame_copy->kvp_frame_compare", __FILE__, __LINE__, "run=%d", run); + tmp = kvp_frame_to_string(test_frame1); + printf("Frame1 is %s\n", tmp); + g_free(tmp); + tmp = kvp_frame_to_string(test_frame2); + printf("Frame2 is %s\n", tmp); + g_free(tmp); + } + + kvp_frame_delete(test_frame2); +} + +static void +test_kvp_copy_get_slot(int run, + kvp_frame *test_frame1, const kvp_value *test_val1, + const gchar *test_key) +{ + kvp_frame *test_frame2; + const kvp_value *test_val2; + + test_frame2 = kvp_frame_copy(test_frame1); + test_val2 = kvp_frame_get_slot(test_frame2, test_key); + if(kvp_value_compare(test_val1, test_val2) == 0) + { + success_args("kvp_frame_copy->kvp_frame_get_slot", __FILE__, __LINE__, "run=%d", run); + } + else + { + gchar *tmp; + failure_args("kvp_frame_copy->kvp_frame_get_slot", __FILE__, __LINE__, "run=%d", run); + tmp = kvp_frame_to_string(test_frame1); + printf("Frame1 is %s\n", tmp); + g_free(tmp); + tmp = kvp_frame_to_string(test_frame2); + printf("Frame2 is %s\n", tmp); + g_free(tmp); + } + kvp_frame_delete(test_frame2); +} + +static void +test_kvp_create_delete(void) +{ + kvp_frame *test_frame; + + test_frame = kvp_frame_new(); + + if(test_frame != NULL) + { + kvp_frame_delete(test_frame); + test_frame = NULL; + success("kvp_frame_new"); + } + else + { + failure("kvp_frame_new"); + } +} + +static void +test_kvp_frames1(void) +{ + int i; + + for(i = 0; i < 20; i++) + { + kvp_frame *test_frame1; + gchar *test_key; + kvp_value *test_val1; + + test_val1 = get_random_kvp_value(i % KVP_TYPE_FRAME); + + test_frame1 = kvp_frame_new(); + test_key = get_random_string(); + + kvp_frame_set_slot(test_frame1, test_key, test_val1); + + test_kvp_get_slot(i, test_frame1, test_val1, test_key); + test_kvp_copy_compare(i, test_frame1, test_val1, test_key); + test_kvp_copy_get_slot(i, test_frame1, test_val1, test_key); + + kvp_value_delete(test_val1); + g_free(test_key); + kvp_frame_delete(test_frame1); + } +} + +static void +test_kvp_printing(void) +{ + int i; + for(i = 0; i < 20; i++) + { + kvp_frame *ran_frame; + gchar *char_rep; + + ran_frame = get_random_kvp_frame(); + char_rep = kvp_frame_to_string(ran_frame); + + /* if we don't crash it's good :) */ + /* puts(char_rep); */ + + g_free(char_rep); + kvp_frame_delete(ran_frame); + } +} + +static void +test_kvp_xml_stuff(void) +{ + int i; + for(i = 0; i < 20; i++) + { + kvp_frame *test_frame1; + kvp_frame *test_frame2; + xmlNodePtr test_node; + + test_frame1 = get_random_kvp_frame(); + + test_node = kvp_frame_to_dom_tree("test-kvp", test_frame1); + + if(!test_node) + { + failure_args("xml stuff",__FILE__, __LINE__, + "kvp_frame_to_dom_tree produced NULL"); + } + else + { + test_frame2 = dom_tree_to_kvp_frame(test_node); + + if(kvp_frame_compare(test_frame1, test_frame2) == 0) + { + success("xml stuff"); + } + else + { + gchar *tmp; + failure("xml stuff"); + printf(" with xml:\n"); + xmlElemDump(stdout, NULL, test_node); + printf("\n"); + tmp = kvp_frame_to_string(test_frame2); + printf(" and kvp_frame:\n%s\n", tmp); + g_free(tmp); + } + kvp_frame_delete(test_frame2); + xmlFreeNode(test_node); + } + + kvp_frame_delete(test_frame1); + } +} + +int +main(int argc, char** argv) +{ + test_kvp_create_delete(); + test_kvp_printing(); + test_kvp_frames1(); + test_kvp_xml_stuff(); + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-load-example-account.c b/src/backend/file/test/test-load-example-account.c new file mode 100644 index 0000000000..7ca1ba6954 --- /dev/null +++ b/src/backend/file/test/test-load-example-account.c @@ -0,0 +1,94 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gnc-engine-util.h" +#include "io-gncxml-v2.h" +#include "gnc-engine.h" +#include "gnc-book.h" + +#include "io-example-account.h" + +#include "gnc-test-stuff.h" + +static const gchar *da_ending = ".gnucash-xea"; + +static void +test_load_file(const char *filename) +{ + GncExampleAccount *gea; + + gea = gnc_read_example_account(filename); + + if(gea != NULL) + { + success("example account load"); + gnc_destroy_example_account(gea); + } + else + { + failure_args("example account load", __FILE__, __LINE__, "for file %s", + filename); + } +} + +int +main(int argc, char **argv) +{ + const char *location = "../../../../accounts/C"; + DIR *ea_dir; + GSList *list; + + list = NULL; + + gnc_engine_init(argc, argv); + + if((ea_dir = opendir(location)) == NULL) + { + failure("unable to open ea directory"); + } + else + { + struct dirent *entry; + + while((entry = readdir(ea_dir)) != NULL) + { + struct stat file_info; + if(strstr(entry->d_name, da_ending) != NULL) + { + char *to_open = g_strdup_printf("%s/%s", location, + entry->d_name); + if(stat(to_open, &file_info) != 0) + { + failure("unable to stat file"); + } + else + { + if(!S_ISDIR(file_info.st_mode)) + { + test_load_file(to_open); + } + } + g_free(to_open); + } + } + } + closedir(ea_dir); + + { + list = gnc_load_example_account_list(location); + + do_test(list != NULL, "gnc_load_example_account_list"); + + gnc_free_example_account_list(list); + } + + + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-load-module b/src/backend/file/test/test-load-module new file mode 100755 index 0000000000..b3d965e60d --- /dev/null +++ b/src/backend/file/test/test-load-module @@ -0,0 +1,18 @@ +#! /bin/sh +exec guile -s "$0" +!# + +(display " testing file backend load ... ") +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(if (gnc:module-load "gnucash/backend/file" 0) + (begin + (display "ok\n") + (exit 0)) + (begin + (display "failed\n") + (exit -1))) + + + diff --git a/src/backend/file/test/test-load-xml2.c b/src/backend/file/test/test-load-xml2.c new file mode 100644 index 0000000000..25497b03b1 --- /dev/null +++ b/src/backend/file/test/test-load-xml2.c @@ -0,0 +1,107 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "io-gncxml-v2.h" +#include "gnc-engine.h" +#include "gnc-book.h" + +#include "gnc-book.h" +#include "Backend.h" +#include "TransLog.h" + +#include "gnc-test-stuff.h" + +static void +remove_files_pattern(const char *begining, const char *ending) +{ +} + +static void +remove_locks(const char *filename) +{ + struct stat buf; + char *to_remove; + + { + to_remove = g_strdup_printf("%s.LCK", filename); + if(stat(to_remove, &buf) != -1) + { + unlink(to_remove); + } + g_free(to_remove); + } + + remove_files_pattern(filename, ".LCK"); +} + +static void +test_load_file(const char *filename) +{ + GNCBook *book; + + book = gnc_book_new(); + + remove_locks(filename); + + gnc_book_begin(book, filename, FALSE, FALSE); + + gnc_book_load_from_xml_file_v2(book, NULL); + + do_test_args( + gnc_book_get_error(book) == ERR_BACKEND_NO_ERR, + "book load xml2", __FILE__, __LINE__, "%d for file %s", + gnc_book_get_error(book), filename); + + gnc_book_destroy(book); +} + +int +main(int argc, char **argv) +{ + const char *location = "test-files/xml2"; + DIR *xml2_dir; + + gnc_engine_init(argc, argv); + xaccLogDisable(); + + if((xml2_dir = opendir(location)) == NULL) + { + failure("unable to open xml2 directory"); + } + else + { + struct dirent *entry; + + while((entry = readdir(xml2_dir)) != NULL) + { + if(strstr(entry->d_name, ".gml2") != NULL) + { + struct stat file_info; + char *to_open = g_strdup_printf("%s/%s", location, + entry->d_name); + if(stat(to_open, &file_info) != 0) + { + failure("unable to stat file"); + } + else + { + if(!S_ISDIR(file_info.st_mode)) + { + test_load_file(to_open); + } + } + g_free(to_open); + } + } + } + closedir(xml2_dir); + + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-real-data.sh b/src/backend/file/test/test-real-data.sh new file mode 100755 index 0000000000..6768cae04c --- /dev/null +++ b/src/backend/file/test/test-real-data.sh @@ -0,0 +1,29 @@ +#!/bin/sh + +#set -e + +EXIT_VALUE=0 + +for i in test-files/xml2/*.gml2 ; do + + if [ ! -d $i ] ; then + for j in account commodity transaction ; do + + rm -rf $j + + mkdir $j + FILES=`perl grab-types.pl "gnc:$j" $i "$j/dataXXX.xml"` + if [ ! -z "$FILES" ] ; then + echo "Testing file $i, section $j" + + eval "./test-xml-$j $FILES" + if [ $? != 0 ] ; then + EXIT_VALUE=1 + fi + fi + rm -rf $j + done + fi +done + +exit $EXIT_VALUE diff --git a/src/backend/file/test/test-save-in-lang.c b/src/backend/file/test/test-save-in-lang.c new file mode 100644 index 0000000000..95ee1f7bf2 --- /dev/null +++ b/src/backend/file/test/test-save-in-lang.c @@ -0,0 +1,185 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#include "gnc-test-stuff.h" +#include "test-stuff.h" +#include "gnc-book.h" +#include "gnc-engine.h" +#include "TransLog.h" + +#include "io-gncxml-v2.h" + +const char *possible_envs[] = { + "C", "af", "ar", "az", "be", "bg", "bg_BG.cp1251", "br", "ca", "cs", + "cy", "cz", "da", "de", "de_AT", "el", "en", "en_AU", "en_CA", "en_GB", + "eo", "es", "es_DO", "es_ES", "es_GT", "es_HN", "es_MX", "es_PA", + "es_PE", "es_SV", "et", "et_EE", "eu", "fi", "fi_FI", "fr", "ga", + "gd", "gl", "gr", "gv", "he", "hr", "hu", "id", "is", "it", "ja", + "ja_JP", "ja_JP.SJIS", "ko", "ko_KR", "ko_KR.eucKR", "kw", "l10n", + "locale.alias", "lt", "nl", "nn", "no", "no@nynorsk", "no_NO", "no_NY", + "pl", "pl_PL", "pt", "pt_BR", "pt_PT", "ro", "ru", "ru_RU", "rudos", + "rukoi8", "ruwin", "sk", "sl", "sl_SI", "sp", "sr", "sr_YU", "sv", "ta", + "tr", "uk", "vi", "vi_VN.VISCII", "wa", "zh", "zh_CN", "zh_CN.EUC", + "zh_CN.GB2312", "zh_TW", "zh_TW.Big5", + NULL +}; + +const char *possible_vars[] = { + "LANG", "LC_CTYPE", "LC_COLLATE", "LC_TIME", "LC_NUMERIC", + "LC_MONETARY", "LC_MESSAGES", + NULL +}; + +const char *diff_command = "cmp %s %s"; +const char *test_dir = "test-files/xml2"; +const char *base_env = "C"; + +static char* +gen_new_file_name(const char *filename, const char *env) +{ + char *ret; + + ret = g_new(char, strlen(filename) + strlen(env) + 2); + strcpy(ret, filename); + strcat(ret, "-"); + strcat(ret, env); + + return ret; +} + +static int +run_command_get_return(const char *command) +{ + return system(command); +} + +static char * +test_file(const char *filename) +{ + int i; + + for(i = 0; possible_envs[i] != NULL; i++) + { + GNCBook *book; + char *cmd; + char *new_file = gen_new_file_name(filename, possible_envs[i]); + char *putenv_str; + GNCBook *new_book; + + book = gnc_book_new(); + + if(!gnc_book_begin(book, filename, TRUE, FALSE)) + { + gnc_book_destroy(book); + return g_strdup("gnc_book_begin"); + } + + if(!gnc_book_load(book)) + { + int error = gnc_book_get_error(book); + gnc_book_destroy(book); + return g_strdup_printf("gnc_book_load errorid %d", error); + } + + putenv_str = g_strdup_printf ("%s=%s", "LANG", possible_envs[i]); + putenv (putenv_str); + g_free (putenv_str); + + new_book = gnc_book_new(); + + if(!gnc_book_begin(new_book, new_file, FALSE, FALSE)) + { + g_free(new_file); + gnc_book_destroy(book); + gnc_book_destroy(new_book); + return g_strdup_printf("gnc_book_begin 2 with LANG=%s", + possible_envs[i]); + } + + gnc_book_save(new_book); + + cmd = g_strdup_printf(diff_command, filename, new_file); + + if(run_command_get_return(cmd) != 0) + { + g_free(cmd); + g_free(new_file); + gnc_book_destroy(book); + gnc_book_destroy(new_book); + return g_strdup_printf("run_command_get_return with LANG=%s", + possible_envs[i]); + } + + g_free(new_file); + g_free(cmd); + gnc_book_destroy(book); + gnc_book_destroy(new_book); + } + + return NULL; +} + +int +main(int argc, char **argv) +{ + DIR *adir; + + gnc_engine_init(argc, argv); + xaccLogDisable(); + + if((adir = opendir(test_dir)) == NULL) + { + failure_args("opendir", __FILE__, __LINE__, + "couldn't open dir %s", test_dir); + } + else + { + struct dirent *next_file; + + while((next_file = readdir(adir)) != NULL) + { + struct stat file_info; + char* filename; + char* putenv_str; + + filename = g_strdup_printf("%s/%s", test_dir, next_file->d_name); + + if(stat(filename, &file_info) != 0) + { + failure_args("stat", __FILE__, __LINE__, + "couldn't stat file %s: %s", filename, + strerror(errno)); + g_free(filename); + break; + } + + putenv_str = g_strdup_printf ("%s=%s", "LANG", base_env); + putenv (putenv_str); + g_free (putenv_str); + + if(!S_ISDIR(file_info.st_mode)) + { + char *msg = test_file(filename); + + if(msg != NULL) + { + failure_args("test_file", __FILE__, __LINE__, + "failure testing file %s with msg %s", + filename, msg); + } + g_free(msg); + } + + g_free(filename); + } + } + + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-string-converters.c b/src/backend/file/test/test-string-converters.c new file mode 100644 index 0000000000..f2ed458e1e --- /dev/null +++ b/src/backend/file/test/test-string-converters.c @@ -0,0 +1,113 @@ +#include "config.h" + +#include + +#include "sixtp-dom-parsers.h" +#include "sixtp-dom-generators.h" + +#include "gnc-engine-util.h" + +#include "gnc-test-stuff.h" + +#include "guid.h" +#include "date.h" +#include "gnc-numeric.h" + +static void +test_binary() +{ + int i; + for(i = 0; i < 20; i++) + { + bin_data *test_data1; + void *test_data2; + guint64 test_data2_len; + gchar *converted; + + test_data1 = get_random_binary_data(); + + converted = binary_to_string(test_data1->data, test_data1->len); + + if(!converted) + { + failure_args("binary_data", __FILE__, __LINE__, "binary_to_string returned NULL"); + continue; + } + + if(!string_to_binary(converted, &test_data2, &test_data2_len)) + { + failure_args("binary_data", __FILE__, __LINE__, + "string_to_binary returned FALSE with data:\n%s\n", + converted); + continue; + } + + if(test_data2_len != test_data1->len) + { + failure_args("binary_data", __FILE__, __LINE__, + "lengths don't match: %lld vs %d", + (long long int) test_data2_len, test_data1->len); + continue; + } + + { + int j; + guchar *d1 = test_data1->data; + guchar *d2 = (guchar*)test_data2; + + for(j = 0; j < test_data2_len; j++) + { + if(d1[j] != d2[j]) + { + failure_args("binary_data", __FILE__, __LINE__, + "data doesn't match at point %d.\n%d vs %d", + i, d1[j], d2[j]); + continue; + } + } + } + + success("binary_data"); + } +} + + +static char *test_strings[] = { + "FooBar", + "", + "Something with a & in it", + "Ugly(*!&@#$NTHOEAUTF\"ntaheu09.h,. \n\t", + "\n\t\n\t", + NULL +}; + +static void +test_string_converters(void) +{ + char *mark; + int i; + + for(i = 0, mark = test_strings[i]; mark; i++, mark = test_strings[i]) + { + xmlNodePtr test_node; + gchar *backout; + test_node = text_to_dom_tree("test-string", mark); + + backout = dom_tree_to_text(test_node); + + do_test_args( + safe_strcmp(backout, mark) == 0, + "string converting", __FILE__, __LINE__, "with string %s", mark); + } +} + +int +main(int argc, char **argv) +{ + test_binary(); + fflush(stdout); + test_string_converters(); + fflush(stdout); + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-stuff.c b/src/backend/file/test/test-stuff.c new file mode 100644 index 0000000000..a31c1f9d61 --- /dev/null +++ b/src/backend/file/test/test-stuff.c @@ -0,0 +1,190 @@ +/* + * Created 20010320 by bstanley to hold only those + * testing functions which are independent of the rest of + * the GNUCash system. + * + * This allows me to compile simple test programs standalone... + * + */ + + +#include "config.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include "test-stuff.h" + +void vsuccess_args( + const char *test_title, + const char *file, + int line, + const char *format, + va_list ap); + +void vfailure_args( + const char *test_title, + const char *file, + int line, + const char *format, + va_list ap); + +static guint successes; +static guint failures; +static gboolean success_should_print = FALSE; + +void +success_call( + const char *test_title, + const char* file, + int line ) +{ + success_args( test_title, file, line, "" ); +} + +void +success_args( + const char *test_title, + const char *file, + int line, + const char *format, + ... ) +{ + va_list ap; + va_start(ap,format); + vsuccess_args( test_title, file, line, format, ap ); + va_end(ap); +} + +void +vsuccess_args( + const char *test_title, + const char *file, + int line, + const char *format, + va_list ap) +{ + if( success_should_print ) { + printf("SUCCESS: %s, %s:%d ", test_title, file, line ); + vprintf(format, ap); + printf("\n"); + fflush(stdout); + } + ++successes; +} + +void +failure_call( + const char *test_title, + const char *file, + int line) +{ + failure_args( test_title, file, line, "" ); +} + + +void +failure_args( + const char *test_title, + const char *file, + int line, + const char *format, + ... ) +{ + va_list ap; + va_start(ap,format); + vfailure_args( test_title, file, line, format, ap ); + va_end(ap); +} +void +vfailure_args( + const char *test_title, + const char* file, + int line, + const char *format, + va_list ap) +{ + printf("FAILURE %s %s:%d ", test_title, file, line ); + vprintf(format, ap); + printf("\n"); + fflush(stdout); + + ++failures; +} + +int +get_rv(void) +{ + if( failures ) { + return 1; + } + return 0; +} + +void +do_test_call( + gboolean result, + const char* test_title, + const char* filename, + int line ) +{ + if( result ) { + success_args( test_title, filename, line, "" ); + } else { + failure_args( test_title, filename, line, "" ); + } +} + +void +do_test_args( + gboolean result, + const char* test_title, + const char* filename, + int line, + const char* format, + ... ) +{ + va_list ap; + va_start(ap, format); + + if( result ) { + vsuccess_args( test_title, filename, line, format, ap ); + } else { + vfailure_args( test_title, filename, line, format, ap ); + } + va_end(ap); +} + +void +print_test_results(void) +{ + guint total = successes+failures; + if( total == 1 ) { + printf( "Executed 1 test." ); + } else { + printf("Executed %d tests.", successes+failures ); + } + if( failures ) { + if( failures == 1 ) { + printf(" There was 1 failure." ); + } else { + printf(" There were %d failures.", failures ); + } + } else { + printf(" All tests passed."); + } + printf("\n"); + fflush(stdout); +} + +void +set_success_print( gboolean in_should_print ) +{ + success_should_print = in_should_print; +} + diff --git a/src/backend/file/test/test-stuff.h b/src/backend/file/test/test-stuff.h new file mode 100644 index 0000000000..ac5dc1946c --- /dev/null +++ b/src/backend/file/test/test-stuff.h @@ -0,0 +1,121 @@ +/* Modified by bstanley 20010320 + * Added do_test macro, do_test_call and do_test_call_args, + * print_test_results, set_success_print. + * + * Modified by bstanley 20010323 + * removed testing functionality which depends on the rest of gnucash - + * sepearated into gnc-test-stuff.h + * + */ + +/* Outline of a test program using the new testing functions: +#include "test-stuff.h" +int main( int argc, char* argv[] ) +{ + int a, b; + g_log_set_always_fatal( G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_WARNING ); + a = b = 1; + do_test( a == b, 'integer equality" ); + do_test( a != b, 'integer inequality? (should fail)" ); + + do_test_args( a == b, "fancy info", __FILE__, __LINE__, "a = %d, b = %b", a, b ); + + print_test_results(); + return get_rv(); +} +*/ +/* If you want to see test passes, use +set_success_print(TRUE); +before you execute the tests. +Otherwise, only failures are printed out. +*/ + + +#ifndef TEST_STUFF_H +#define TEST_STUFF_H + +#include "config.h" + +#include +#include + +/** + * Use this to indicate the result of a test. + * The result is TRUE for success, FALSE for failure. + * title describes the test + * Tests are automatically identified by their source file and line. + */ +#define do_test( result, title ) do_test_call( result, title, __FILE__, __LINE__ ); +#define success( title ) success_call( title, __FILE__, __LINE__ ); +#define failure( title ) failure_call( title, __FILE__, __LINE__ ); + +/** This one doesn't work because macros can't take a variable number of arguments. + * well, apparently gcc can, but it's non-standard. + * Apparently C99 can, too, but it's not exactly standard either. +#define do_test_args( result, title, format ) do_test_call( result, title, __FILE__, __LINE__, format, ... ); +*/ + +/* Privately used to indicate a test result. You may use these if you + * wish, but it's easier to use the do_test macro above. + */ +void do_test_call( + gboolean result, + const char* test_title, + const char* filename, + int line ); +void do_test_args( + gboolean result, + const char* test_title, + const char* filename, + int line, + const char* format, ... ); + + +/** + * Prints out the number of tests passed and failed. + */ +void print_test_results(void); + +/** + * Use this to set whether successful tests + * should print a message. + * Default is false. + * Successful test messages are useful while initally constructing the + * test suite, but when it's completed, no news is good news. + * A successful test run will be indicated by the message + * from print_test_results(). + */ +void set_success_print( gboolean in_should_print ); + +/* Value to return from main. Set to 1 if there were any fails, 0 otherwise. */ +int get_rv(void); + +/** Testing primitives. + * Sometimes you just have to put the results of + * a test into different forks of the code. + */ +void success_call( + const char *test_title, + const char *file, + int line ); + +void success_args( + const char *test_title, + const char *file, + int line, + const char *format, + ... ); + +void failure_call( + const char *test_title, + const char *file, + int line); + +void failure_args( + const char *test_title, + const char *file, + int line, + const char *format, + ... ); + +#endif /* TEST_STUFF_H */ diff --git a/src/backend/file/test/test-xml-account.c b/src/backend/file/test/test-xml-account.c new file mode 100644 index 0000000000..6fb5cf17bf --- /dev/null +++ b/src/backend/file/test/test-xml-account.c @@ -0,0 +1,351 @@ +#include "config.h" + +#include +#include +#include +#include + +#include "gnc-xml-helper.h" +#include "gnc-xml.h" +#include "gnc-engine-util.h" +#include "gnc-engine.h" + +#include "sixtp-parsers.h" +#include "sixtp-dom-parsers.h" + +#include "gnc-test-stuff.h" + +#include "Account.h" +#include "GNCIdP.h" +#include "Group.h" +#include "Scrub.h" +#include "gnc-book.h" + +static gchar* +node_and_account_equal(xmlNodePtr node, Account *act) +{ + xmlNodePtr mark; + + if(!check_dom_tree_version(node, "2.0.0")) + { + return g_strdup("version wrong. Not 2.0.0 or not there"); + } + + if(!node->name || safe_strcmp(node->name, "gnc:account")) + { + return g_strdup("Name of toplevel node is bad"); + } + + for(mark = node->xmlChildrenNode; mark; mark = mark->next) + { + if(safe_strcmp(mark->name, "act:name") == 0) + { + if(!equals_node_val_vs_string(mark, xaccAccountGetName(act))) + { + return g_strdup("names differ"); + } + } + else if(safe_strcmp(mark->name, "act:id") == 0) + { + if(!equals_node_val_vs_guid(mark, xaccAccountGetGUID(act))) + { + return g_strdup("ids differ"); + } + } + else if(safe_strcmp(mark->name, "act:type") == 0) + { + gchar *txt; + int type; + + txt = dom_tree_to_text(mark); + + if(!txt) + { + return g_strdup("couldn't get type string"); + } + else if(!xaccAccountStringToType(txt, &type)) + { + g_free(txt); + return g_strdup("couldn't convert type string to int"); + } + else if(type != xaccAccountGetType(act)) + { + g_free(txt); + return g_strdup("types differ"); + } + else + { + g_free(txt); + } + } + else if(safe_strcmp(mark->name, "act:commodity") == 0) + { + if(!equals_node_val_vs_commodity( + mark, xaccAccountGetCommodity(act))) + { + return g_strdup("commodities differ"); + } + } + else if(safe_strcmp(mark->name, "act:currency") == 0) + { + if(!equals_node_val_vs_commodity( + mark, DxaccAccountGetCurrency(act))) + { + return g_strdup("currencies differ"); + } + } + else if(safe_strcmp(mark->name, "act:code") == 0) + { + if(!equals_node_val_vs_string(mark, xaccAccountGetCode(act))) + { + return g_strdup("codes differ"); + } + } + else if(safe_strcmp(mark->name, "act:description") == 0) + { + if(!equals_node_val_vs_string( + mark, xaccAccountGetDescription(act))) + { + return g_strdup("descriptions differ"); + } + } + else if(safe_strcmp(mark->name, "act:security") == 0) + { + if(!equals_node_val_vs_commodity( + mark, DxaccAccountGetSecurity(act))) + { + return g_strdup("securities differ"); + } + } + else if(safe_strcmp(mark->name, "act:slots") == 0) + { + xaccAccountDeleteOldData (act); + + if(!equals_node_val_vs_kvp_frame(mark, xaccAccountGetSlots(act))) + { + return g_strdup("slots differ"); + } + } + else if(safe_strcmp(mark->name, "act:parent") == 0) + { + if(!equals_node_val_vs_guid( + mark, xaccAccountGetGUID(xaccGroupGetParentAccount( + xaccAccountGetParent(act))))) + { + return g_strdup("parent ids differ"); + } + } + else if(safe_strcmp(mark->name, "act:commodity-scu") == 0) + { + if(!equals_node_val_vs_int(mark, xaccAccountGetCommoditySCU(act))) + { + return g_strdup("commodity scus differ"); + } + } + else if(safe_strcmp(mark->name, "act:currency-scu") == 0) + { + if(!equals_node_val_vs_int(mark, DxaccAccountGetCurrencySCU(act))) + { + return g_strdup("currency scus differ"); + } + } + else if(safe_strcmp(mark->name, "act:security-scu") == 0) + { + if(!equals_node_val_vs_int(mark, xaccAccountGetCommoditySCU(act))) + { + return g_strdup("commodity scus differ"); + } + } + else + { + return g_strdup_printf("unknown node in dom tree: %s", mark->name); + } + } + + return NULL; +} + +static void +delete_random_account(Account *act) +{ + gnc_commodity_destroy(xaccAccountGetCommodity(act)); + + xaccAccountBeginEdit(act); + xaccAccountDestroy(act); +} + +struct act_data_struct +{ + Account *act; + int value; +}; +typedef struct act_data_struct act_data; + +static gboolean +test_add_account(const char *tag, gpointer globaldata, gpointer data) +{ + act_data *gdata = (act_data*)globaldata; + + do_test_args(xaccAccountEqual((Account*)data, (Account*)(gdata->act), + TRUE), + "gnc_account_sixtp_parser_create", + __FILE__, __LINE__, "%d", gdata->value ); + + return TRUE; +} + +static void +test_account(int i, Account *test_act) +{ + xmlNodePtr test_node; + gchar *filename1; + gchar *compare_msg; + FILE *cmp_file; + int fd; + + test_node = gnc_account_dom_tree_create(test_act); + + if(!test_node) + { + failure_args("account_xml", __FILE__, __LINE__, + "gnc_account_dom_tree_create returned NULL"); + return; + } + + if((compare_msg = node_and_account_equal(test_node, test_act)) != NULL) + { + failure_args("account_xml", __FILE__, __LINE__, + "node and account were not equal: %s", compare_msg); + xmlElemDump(stdout, NULL, test_node); + fprintf(stdout, "\n"); + xmlFreeNode(test_node); + g_free(compare_msg); + return; + } + else + { + success("account_xml"); + } + + filename1 = g_strdup_printf("test_file_XXXXXX"); + + fd = mkstemp(filename1); + + write_dom_node_to_file(test_node, fd); + + close(fd); + + { + sixtp *parser; + act_data data; + + data.act = test_act; + data.value = i; + + parser = gnc_account_sixtp_parser_create(); + + if(!gnc_xml_parse_file(parser, filename1, test_add_account, + (gpointer)&data)) + { + failure_args("gnc_xml_parse_file returned FALSE", + __FILE__, __LINE__, "%d", i); + } + + /* no handling of circular data structures. We'll do that later */ + /* sixtp_destroy(parser); */ + } + + + unlink(filename1); + g_free(filename1); + xmlFreeNode(test_node); +} + +static void +test_generation(void) +{ + int i; + for(i = 0; i < 20; i++) + { + Account *ran_act; + + ran_act = get_random_account(); + + test_account(i, ran_act); + + delete_random_account(ran_act); + } + + { + /* empty some things. */ + Account *act; + + act = get_random_account(); + + xaccAccountSetCode(act, ""); + xaccAccountSetDescription(act, ""); + xaccAccountSetCommodity(act, NULL); + + test_account(-1, act); + + delete_random_account(act); + } + +/* { */ +/* Account *act1; */ +/* Account *act2; */ + +/* act1 = get_random_account(); */ +/* act2 = get_random_account(); */ + +/* xaccAccountInsertSubAccount(act1, act2); */ + +/* test_account(-1, act2); */ +/* test_account(-1, act1); */ + +/* delete_random_account(act2); */ +/* delete_random_account(act1); */ +/* } */ + +} + +GNCBook *bk; + +static gboolean +test_real_account(const char *tag, gpointer global_data, gpointer data) +{ + char *msg; + Account *act = (Account*)data; + + if(!xaccAccountGetParent(act)) + { + xaccGroupInsertAccount(gnc_book_get_group(bk), act); + } + msg = node_and_account_equal((xmlNodePtr)global_data, act); + do_test_args(msg == NULL, "test_real_account", + __FILE__, __LINE__, msg); + g_free(msg); + return TRUE; +} + +int +main(int argc, char **argv) +{ + gnc_engine_init(argc, argv); + xaccGUIDInit(); + + if(argc > 1) + { + bk = gnc_book_new(); + test_files_in_dir(argc, argv, test_real_account, + gnc_account_sixtp_parser_create(), + "gnc:account"); + } + else + { + test_generation(); + } + + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-xml-commodity.c b/src/backend/file/test/test-xml-commodity.c new file mode 100644 index 0000000000..1b3f1fe64c --- /dev/null +++ b/src/backend/file/test/test-xml-commodity.c @@ -0,0 +1,230 @@ +#include "config.h" + +#include +#include +#include +#include + +#include "gnc-xml-helper.h" +#include "gnc-xml.h" +#include "gnc-engine-util.h" + +#include "sixtp-parsers.h" +#include "sixtp-utils.h" + +#include "sixtp-dom-parsers.h" + +#include "io-gncxml-gen.h" + +#include "gnc-test-stuff.h" + +#include "Account.h" + + +static gchar* +node_and_commodity_equal(xmlNodePtr node, const gnc_commodity *com) +{ + xmlNodePtr mark; + + if(!check_dom_tree_version(node, "2.0.0")) + { + return "version wrong. Not 2.0.0 or not there"; + } + + if(!node->name || safe_strcmp(node->name, "gnc:commodity")) + { + return "Name of toplevel node is bad"; + } + + for(mark = node->xmlChildrenNode; mark; mark = mark->next) + { + if(safe_strcmp(mark->name, "cmdty:space") == 0) + { + if(!equals_node_val_vs_string( + mark, gnc_commodity_get_namespace(com))) + { + return "namespaces differ"; + } + } + else if(safe_strcmp(mark->name, "cmdty:id") == 0) + { + if(!equals_node_val_vs_string( + mark, gnc_commodity_get_mnemonic(com))) + { + return "mnemonic differ"; + } + } + else if(safe_strcmp(mark->name, "cmdty:name") == 0) + { + if(!equals_node_val_vs_string( + mark, gnc_commodity_get_fullname(com))) + { + return "names differ"; + } + } + else if(safe_strcmp(mark->name, "cmdty:xcode") == 0) + { + if(!equals_node_val_vs_string( + mark, gnc_commodity_get_exchange_code(com))) + { + return "exchange codes differ"; + } + } + else if(safe_strcmp(mark->name, "cmdty:fraction") == 0) + { + gchar *txt; + gint64 type; + + txt = dom_tree_to_text(mark); + + if(!txt) + { + return "couldn't get fraction string"; + } + + else if(!string_to_gint64(txt, &type)) + { + g_free(txt); + return "couldn't convert fraction string to int"; + } + else if(type != gnc_commodity_get_fraction(com)) + { + g_free(txt); + return "fractions differ"; + } + else + { + g_free(txt); + } + } + else + { + return "unknown node"; + } + } + + return NULL; +} + +struct com_data_struct +{ + gnc_commodity *com; + int value; +}; +typedef struct com_data_struct com_data; + +static gboolean +test_add_commodity(const char *tag, gpointer globaldata, gpointer data) +{ + com_data *gdata = (com_data*)globaldata; + + do_test_args(gnc_commodity_equiv((gnc_commodity*)data, gdata->com), + "gnc_commodity_sixtp_parser_create", + __FILE__, __LINE__, "%d", gdata->value ); + gnc_commodity_destroy((gnc_commodity*)data); + + return TRUE; + +} + +static void +test_generation(void) +{ + int i; + for(i = 0; i < 20; i++) + { + gnc_commodity *ran_com; + xmlNodePtr test_node; + gchar *filename1; + FILE *cmp_file; + int fd; + gchar *compare_msg; + + ran_com = get_random_commodity(); + + test_node = gnc_commodity_dom_tree_create(ran_com); + if(!test_node) + { + failure_args("commodity_xml", __FILE__, __LINE__, + "gnc_commodity_dom_tree_create returned NULL"); + gnc_commodity_destroy(ran_com); + continue; + } + + if((compare_msg = node_and_commodity_equal(test_node, ran_com)) != + NULL) + { + failure_args("commodity_xml", __FILE__, __LINE__, + "node and commodity were not equal: %s", compare_msg); + xmlElemDump(stdout, NULL, test_node); + xmlFreeNode(test_node); + gnc_commodity_destroy(ran_com); + continue; + } + else + { + success_args("commodity_xml", __FILE__, __LINE__, "%d", i); + } + + filename1 = g_strdup_printf("test_file_XXXXXX"); + + fd = mkstemp(filename1); + + write_dom_node_to_file(test_node, fd); + + close(fd); + + { + sixtp *parser; + com_data data; + + data.com = ran_com; + data.value = i; + + parser = gnc_commodity_sixtp_parser_create(); + + if(!gnc_xml_parse_file(parser, filename1, test_add_commodity, + (gpointer)&data)) + { + failure_args("gnc_xml_parse_file returned FALSE", + __FILE__, __LINE__, "%d", i); + } + + /* no handling of circular data structures. We'll do that later */ + /* sixtp_destroy(parser); */ + } + + unlink(filename1); + g_free(filename1); + gnc_commodity_destroy(ran_com); + xmlFreeNode(test_node); + } +} + +static gboolean +test_real_commodity(const char *tag, gpointer globaldata, gpointer data) +{ + const char *msg = node_and_commodity_equal((xmlNodePtr)globaldata, + (gnc_commodity*)data); + do_test_args(msg == NULL, "test_real_commodity", + __FILE__, __LINE__, msg); + gnc_commodity_destroy((gnc_commodity*)data); + return TRUE; +} + +int +main(int argc, char **argv) +{ + if(argc > 1) + { + test_files_in_dir(argc, argv, test_real_commodity, + gnc_commodity_sixtp_parser_create(), + "gnc:commodity"); + } + else + { + test_generation(); + } + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-xml-transaction.c b/src/backend/file/test/test-xml-transaction.c new file mode 100644 index 0000000000..a919fac246 --- /dev/null +++ b/src/backend/file/test/test-xml-transaction.c @@ -0,0 +1,407 @@ +#include "config.h" + +#include +#include +#include +#include + +#include +#include +#include + +#include "gnc-xml-helper.h" +#include "gnc-xml.h" +#include "gnc-engine-util.h" + +#include "sixtp-parsers.h" + +#include "sixtp-dom-parsers.h" +#include "TransLog.h" +#include "io-gncxml-gen.h" + +#include "gnc-test-stuff.h" + +#include "Transaction.h" +#include "GNCIdP.h" + + +static xmlNodePtr +find_appropriate_node(xmlNodePtr node, Split *spl) +{ + xmlNodePtr mark; + + for(mark = node->xmlChildrenNode; mark; mark = mark->next) + { + gboolean account_guid_good = FALSE; + gboolean amount_good = FALSE; + xmlNodePtr mark2; + + for(mark2 = mark->xmlChildrenNode; mark2; mark2 = mark2->next) + { + if(safe_strcmp(mark2->name, "split:value") == 0) + { + gnc_numeric *num = dom_tree_to_gnc_numeric(mark2); + + if(gnc_numeric_equal(*num, xaccSplitGetValue(spl))) + { + amount_good = TRUE; + } + + g_free(num); + } + else if(safe_strcmp(mark2->name, "split:account") == 0) + { + GUID *accid = dom_tree_to_guid(mark2); + + if(guid_equal(accid, xaccSplitGetAccountGUID(spl))) + { + account_guid_good = TRUE; + } + g_free(accid); + } + + if(account_guid_good && amount_good) + { + return mark; + } + } + } + + return NULL; +} + +static gboolean +equals_node_val_vs_split_internal(xmlNodePtr node, Split* spl) +{ + xmlNodePtr mark; + + for(mark = node->childs; mark != NULL; mark = mark->next) + { + if(safe_strcmp(mark->name, "split:id") == 0) + { + GUID *id = dom_tree_to_guid(mark); + + if(!guid_equal(id, xaccSplitGetGUID(spl))) + { + printf("ids differ\n"); + g_free(id); + return FALSE; + } + g_free(id); + } + else if(safe_strcmp(mark->name, "split:memo") == 0) + { + char *memo = dom_tree_to_text(mark); + + if(safe_strcmp(memo, xaccSplitGetMemo(spl)) != 0) + { + printf("memos differ\n"); + g_free(memo); + return FALSE; + } + g_free(memo); + } + else if(safe_strcmp(mark->name, "split:reconciled-state") == 0) + { + char *rs = dom_tree_to_text(mark); + + if(rs[0] != xaccSplitGetReconcile(spl)) + { + printf("states differ\n"); + g_free(rs); + return FALSE; + } + g_free(rs); + } + else if(safe_strcmp(mark->name, "split:value") == 0) + { + gnc_numeric *num = dom_tree_to_gnc_numeric(mark); + + if(!gnc_numeric_equal(*num, xaccSplitGetValue(spl))) + { + printf("values differ\n"); + g_free(num); + return FALSE; + } + g_free(num); + } + else if(safe_strcmp(mark->name, "split:quantity") == 0) + { + gnc_numeric *num = dom_tree_to_gnc_numeric(mark); + + if(!gnc_numeric_equal(*num, xaccSplitGetAmount(spl))) + { + printf("quantities differ\n"); + g_free(num); + return FALSE; + } + g_free(num); + } + else if(safe_strcmp(mark->name, "split:account") == 0) + { + GUID *id = dom_tree_to_guid(mark); + + if(!guid_equal(id, xaccSplitGetAccountGUID(spl))) + { + printf("accounts differ\n"); + g_free(id); + return FALSE; + } + g_free(id); + } + } + return TRUE; +} + +static gboolean +equals_node_val_vs_splits(xmlNodePtr node, const Transaction *trn) +{ + xmlNodePtr spl_node; + Split *spl_mark; + int i; + + g_return_val_if_fail(node, FALSE); + g_return_val_if_fail(node->xmlChildrenNode, FALSE); + + for(i = 0, spl_mark = xaccTransGetSplit((Transaction*)trn, i); + spl_mark; + i++, spl_mark = xaccTransGetSplit((Transaction*)trn, i)) + { + spl_node = find_appropriate_node(node, spl_mark); + + if(!spl_node) + { + return FALSE; + } + + if(!equals_node_val_vs_split_internal(spl_node, spl_mark)) + { + return FALSE; + } + } + + return TRUE; +} + +static gchar* +node_and_transaction_equal(xmlNodePtr node, Transaction *trn) +{ + xmlNodePtr mark; + + if(!check_dom_tree_version(node, "2.0.0")) + { + return "version wrong. Not 2.0.0 or not there"; + } + + if(!node->name || safe_strcmp(node->name, "gnc:transaction")) + { + return "Name of toplevel node is bad"; + } + + for(mark = node->xmlChildrenNode; mark; mark = mark->next) + { + if(safe_strcmp(mark->name, "trn:id") == 0) + { + if(!equals_node_val_vs_guid(mark, xaccTransGetGUID(trn))) + { + return "ids differ"; + } + } + else if(safe_strcmp(mark->name, "trn:currency") == 0) + { + if(!equals_node_val_vs_commodity( + mark, xaccTransGetCurrency(trn))) + { + return g_strdup("currencies differ"); + } + } + else if(safe_strcmp(mark->name, "trn:num") == 0) + { + if(!equals_node_val_vs_string(mark, xaccTransGetNum(trn))) + { + return "nums differ"; + } + } + else if(safe_strcmp(mark->name, "trn:date-posted") == 0) + { + if(!equals_node_val_vs_date(mark, xaccTransRetDatePostedTS(trn))) + { + return "posted dates differ"; + } + } + else if(safe_strcmp(mark->name, "trn:date-entered") == 0) + { + if(!equals_node_val_vs_date(mark, xaccTransRetDateEnteredTS(trn))) + { + return "entered dates differ"; + } + } + else if(safe_strcmp(mark->name, "trn:description") == 0) + { + if(!equals_node_val_vs_string(mark, xaccTransGetDescription(trn))) + { + return "descriptions differ"; + } + } + else if(safe_strcmp(mark->name, "trn:slots") == 0) + { + if(!equals_node_val_vs_kvp_frame(mark, xaccTransGetSlots(trn))) + { + return "slots differ"; + } + } + else if(safe_strcmp(mark->name, "trn:splits") == 0) + { + if(!equals_node_val_vs_splits(mark, trn)) + { + return "splits differ"; + } + } + else + { + return "unknown node"; + } + } + + return NULL; +} + +static void +really_get_rid_of_transaction(Transaction *trn) +{ + xaccTransBeginEdit(trn); + xaccTransDestroy(trn); + xaccTransCommitEdit(trn); +} + +struct tran_data_struct +{ + Transaction *trn; + int value; +}; +typedef struct tran_data_struct tran_data; + +static gboolean +test_add_transaction(const char *tag, gpointer globaldata, gpointer data) +{ + tran_data *gdata = (tran_data*)globaldata; + + do_test_args( + xaccTransEqual((Transaction*)data, gdata->trn, TRUE, TRUE), + "gnc_transaction_sixtp_parser_create", + __FILE__, __LINE__, + "%d", gdata->value); + really_get_rid_of_transaction((Transaction*)data); + return TRUE; +} + +static void +test_transaction(void) +{ + int i; + for(i = 0; i < 20; i++) + { + Transaction *ran_trn; + xmlNodePtr test_node; + gchar *filename1; + FILE *cmp_file; + int fd; + gchar *compare_msg; + + ran_trn = get_random_transaction(); + + test_node = gnc_transaction_dom_tree_create(ran_trn); + if(!test_node) + { + failure_args("transaction_xml", __FILE__, __LINE__, + "gnc_transaction_dom_tree_create returned NULL"); + really_get_rid_of_transaction(ran_trn); + continue; + } + + if((compare_msg = node_and_transaction_equal(test_node, ran_trn)) != + NULL) + { + failure_args("transaction_xml", __FILE__, __LINE__, + "node and transaction were not equal: %s", + compare_msg); + xmlElemDump(stdout, NULL, test_node); + printf("\n"); + fflush(stdout); + xmlFreeNode(test_node); + really_get_rid_of_transaction(ran_trn); + continue; + } + else + { + success_args("transaction_xml", __FILE__, __LINE__, "%d", i ); + } + + filename1 = g_strdup_printf("test_file_XXXXXX"); + + fd = mkstemp(filename1); + + write_dom_node_to_file(test_node, fd); + + close(fd); + + { + sixtp *parser; + tran_data data; + + data.trn = ran_trn; + data.value = i; + + parser = gnc_transaction_sixtp_parser_create(); + + if(!gnc_xml_parse_file(parser, filename1, test_add_transaction, + (gpointer)&data)) + { + failure_args("gnc_xml_parse_file returned FALSE", + __FILE__, __LINE__, "%d", i); + } + + /* no handling of circular data structures. We'll do that later */ + /* sixtp_destroy(parser); */ + } + + unlink(filename1); + g_free(filename1); + really_get_rid_of_transaction(ran_trn); + xmlFreeNode(test_node); + } +} + +static gboolean +test_real_transaction(const char *tag, gpointer global_data, gpointer data) +{ + const char *msg; + + msg = node_and_transaction_equal((xmlNodePtr)global_data, + (Transaction*)data); + do_test_args(msg == NULL, "test_real_transaction", + __FILE__, __LINE__, msg); + really_get_rid_of_transaction((Transaction*)data); + return TRUE; +} + +int +main(int argc, char **argv) +{ + xaccGUIDInit(); + xaccLogDisable(); + + if(argc > 1) + { + test_files_in_dir(argc, argv, test_real_transaction, + gnc_transaction_sixtp_parser_create(), + "gnc:transaction"); + } + else + { + test_transaction(); + } + + print_test_results(); + exit(get_rv()); +} diff --git a/src/backend/file/test/test-xml2-is-file.c b/src/backend/file/test/test-xml2-is-file.c new file mode 100644 index 0000000000..f629747c38 --- /dev/null +++ b/src/backend/file/test/test-xml2-is-file.c @@ -0,0 +1,15 @@ +#include + +#include "io-gncxml-v2.h" +#include "gnc-test-stuff.h" + +int +main(int argc, char **argv) +{ + do_test( + gnc_is_xml_data_file_v2("test-files/xml2/Money95bank_fr.gml2"), + "gnc_is_xml_data_file_v2" ); + + print_test_results(); + exit(get_rv()); +} diff --git a/src/engine/sql/.cvsignore b/src/backend/postgres/.cvsignore similarity index 100% rename from src/engine/sql/.cvsignore rename to src/backend/postgres/.cvsignore diff --git a/src/engine/sql/Makefile.am b/src/backend/postgres/Makefile.am similarity index 88% rename from src/engine/sql/Makefile.am rename to src/backend/postgres/Makefile.am index b273f8ae30..5516c70c95 100644 --- a/src/engine/sql/Makefile.am +++ b/src/backend/postgres/Makefile.am @@ -1,11 +1,9 @@ +SUBDIRS=test -# Build the postgres backend as its own loadable shared object. +lib_LTLIBRARIES = libgncmod-backend-postgres.la +libgncmod_backend_postgres_la_LDFLAGS =-module -lpq -L../../engine -lgncengine ${GLIB_LIBS} -lib_LTLIBRARIES = libgnc_postgres.la -libgnc_postgres_la_LDFLAGS = -version-info 7:0:7 - - -libgnc_postgres_la_SOURCES = \ +libgncmod_backend_postgres_la_SOURCES = \ PostgresBackend.c \ account.c \ builder.c \ @@ -13,6 +11,7 @@ libgnc_postgres_la_SOURCES = \ escape.c \ events.c \ gncquery.c \ + gncmod-backend-postgres.c \ kvp-sql.c \ price.c \ txn.c \ @@ -48,14 +47,9 @@ EXTRA_DIST = \ table-drop.sql \ demo.c -INCLUDES = -I.. -I/usr/lib/glib/include - -LDFLAGS= -lpq - +INCLUDES = -I../.. -I../../engine -I../../gnc-module CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} -LDADD = ${GLIB_LIBS} - # Some of the required C files are built with the m4 pre-processor # As a result, we need to manually specify dependencies, clean targets. diff --git a/src/engine/sql/PostgresBackend.c b/src/backend/postgres/PostgresBackend.c similarity index 100% rename from src/engine/sql/PostgresBackend.c rename to src/backend/postgres/PostgresBackend.c diff --git a/src/engine/sql/PostgresBackend.h b/src/backend/postgres/PostgresBackend.h similarity index 100% rename from src/engine/sql/PostgresBackend.h rename to src/backend/postgres/PostgresBackend.h diff --git a/src/engine/sql/README b/src/backend/postgres/README similarity index 100% rename from src/engine/sql/README rename to src/backend/postgres/README diff --git a/src/engine/sql/account.c b/src/backend/postgres/account.c similarity index 100% rename from src/engine/sql/account.c rename to src/backend/postgres/account.c diff --git a/src/engine/sql/account.h b/src/backend/postgres/account.h similarity index 100% rename from src/engine/sql/account.h rename to src/backend/postgres/account.h diff --git a/src/engine/sql/base-objects.m4 b/src/backend/postgres/base-objects.m4 similarity index 100% rename from src/engine/sql/base-objects.m4 rename to src/backend/postgres/base-objects.m4 diff --git a/src/engine/sql/builder.c b/src/backend/postgres/builder.c similarity index 100% rename from src/engine/sql/builder.c rename to src/backend/postgres/builder.c diff --git a/src/engine/sql/builder.h b/src/backend/postgres/builder.h similarity index 100% rename from src/engine/sql/builder.h rename to src/backend/postgres/builder.h diff --git a/src/engine/sql/check-objects.m4 b/src/backend/postgres/check-objects.m4 similarity index 100% rename from src/engine/sql/check-objects.m4 rename to src/backend/postgres/check-objects.m4 diff --git a/src/engine/sql/checkpoint.c b/src/backend/postgres/checkpoint.c similarity index 100% rename from src/engine/sql/checkpoint.c rename to src/backend/postgres/checkpoint.c diff --git a/src/engine/sql/checkpoint.h b/src/backend/postgres/checkpoint.h similarity index 100% rename from src/engine/sql/checkpoint.h rename to src/backend/postgres/checkpoint.h diff --git a/src/engine/sql/demo.c b/src/backend/postgres/demo.c similarity index 100% rename from src/engine/sql/demo.c rename to src/backend/postgres/demo.c diff --git a/src/engine/sql/design.txt b/src/backend/postgres/design.txt similarity index 100% rename from src/engine/sql/design.txt rename to src/backend/postgres/design.txt diff --git a/src/engine/sql/escape.c b/src/backend/postgres/escape.c similarity index 100% rename from src/engine/sql/escape.c rename to src/backend/postgres/escape.c diff --git a/src/engine/sql/escape.h b/src/backend/postgres/escape.h similarity index 100% rename from src/engine/sql/escape.h rename to src/backend/postgres/escape.h diff --git a/src/engine/sql/events.c b/src/backend/postgres/events.c similarity index 100% rename from src/engine/sql/events.c rename to src/backend/postgres/events.c diff --git a/src/engine/sql/events.h b/src/backend/postgres/events.h similarity index 100% rename from src/engine/sql/events.h rename to src/backend/postgres/events.h diff --git a/src/engine/sql/functions.sql b/src/backend/postgres/functions.sql similarity index 100% rename from src/engine/sql/functions.sql rename to src/backend/postgres/functions.sql diff --git a/src/backend/postgres/gncmod-backend-postgres.c b/src/backend/postgres/gncmod-backend-postgres.c new file mode 100644 index 0000000000..754c4a70f7 --- /dev/null +++ b/src/backend/postgres/gncmod-backend-postgres.c @@ -0,0 +1,73 @@ +/********************************************************************* + * gncmod-file-postgres.c + * module definition/initialization for the postgres backend module + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include + +#include "Backend.h" +#include "PostgresBackend.h" + +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 8; +int gnc_module_revision = 0; +int gnc_module_age = 1; + +GNCModule engine; + +char * +gnc_module_path(void) +{ + return g_strdup("gnucash/backend/postgres"); +} + +char * +gnc_module_description(void) +{ + return g_strdup("The Postgres backend for Gnucash"); +} + +int +gnc_module_init(int refcount) +{ + if(refcount == 0) { + engine = gnc_module_load("gnucash/engine", 0); + + if(!engine) return FALSE; + } + return TRUE; +} + +int +gnc_module_end(int refcount) +{ + if((refcount == 0) && engine) + { + int unload = gnc_module_unload(engine); + engine = NULL; + return unload; + } + return TRUE; +} + + +/**************************************************************** + * gnc_backend_new + * this is the init function that must be defined by every dynamically + * loadable backend. the postgres backend doesn't follow backend + * loader naming conventions yet so we wrap its initializer function + * temporarily + ****************************************************************/ + +Backend * +gnc_backend_new(void) { + return pgendNew(); +} diff --git a/src/engine/sql/gncquery.c b/src/backend/postgres/gncquery.c similarity index 100% rename from src/engine/sql/gncquery.c rename to src/backend/postgres/gncquery.c diff --git a/src/engine/sql/gncquery.h b/src/backend/postgres/gncquery.h similarity index 100% rename from src/engine/sql/gncquery.h rename to src/backend/postgres/gncquery.h diff --git a/src/engine/sql/kvp-objects.m4 b/src/backend/postgres/kvp-objects.m4 similarity index 100% rename from src/engine/sql/kvp-objects.m4 rename to src/backend/postgres/kvp-objects.m4 diff --git a/src/engine/sql/kvp-sql.c b/src/backend/postgres/kvp-sql.c similarity index 100% rename from src/engine/sql/kvp-sql.c rename to src/backend/postgres/kvp-sql.c diff --git a/src/engine/sql/kvp-sql.h b/src/backend/postgres/kvp-sql.h similarity index 100% rename from src/engine/sql/kvp-sql.h rename to src/backend/postgres/kvp-sql.h diff --git a/src/engine/sql/price.c b/src/backend/postgres/price.c similarity index 100% rename from src/engine/sql/price.c rename to src/backend/postgres/price.c diff --git a/src/engine/sql/price.h b/src/backend/postgres/price.h similarity index 100% rename from src/engine/sql/price.h rename to src/backend/postgres/price.h diff --git a/src/engine/sql/putil.h b/src/backend/postgres/putil.h similarity index 100% rename from src/engine/sql/putil.h rename to src/backend/postgres/putil.h diff --git a/src/engine/sql/table-audit.sql b/src/backend/postgres/table-audit.sql similarity index 100% rename from src/engine/sql/table-audit.sql rename to src/backend/postgres/table-audit.sql diff --git a/src/engine/sql/table-create.sql b/src/backend/postgres/table-create.sql similarity index 100% rename from src/engine/sql/table-create.sql rename to src/backend/postgres/table-create.sql diff --git a/src/engine/sql/table-drop.sql b/src/backend/postgres/table-drop.sql similarity index 100% rename from src/engine/sql/table-drop.sql rename to src/backend/postgres/table-drop.sql diff --git a/src/engine/sql/table.m4 b/src/backend/postgres/table.m4 similarity index 100% rename from src/engine/sql/table.m4 rename to src/backend/postgres/table.m4 diff --git a/src/backend/postgres/test/Makefile.am b/src/backend/postgres/test/Makefile.am new file mode 100644 index 0000000000..06fc42d002 --- /dev/null +++ b/src/backend/postgres/test/Makefile.am @@ -0,0 +1,9 @@ +TESTS=test-load-module + +TESTS_ENVIRONMENT=\ + GNC_MODULE_PATH=${top_srcdir}/src/engine:${top_srcdir}/src/backend/postgres \ + GUILE_LOAD_PATH=${G_WRAP_MODULE_DIR}:..:${top_srcdir}/src/gnc-module \ + LTDL_LIBRARY_PATH=${top_srcdir}/src/gnc-module + + + diff --git a/src/backend/postgres/test/test-load-module b/src/backend/postgres/test/test-load-module new file mode 100755 index 0000000000..9837377a00 --- /dev/null +++ b/src/backend/postgres/test/test-load-module @@ -0,0 +1,18 @@ +#! /bin/sh +exec guile -s "$0" +!# + +(display " testing postgres backend load ... ") +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(if (gnc:module-load "gnucash/backend/postgres" 8) + (begin + (display "ok\n") + (exit 0)) + (begin + (display "failed\n") + (exit -1))) + + + diff --git a/src/engine/sql/txn.c b/src/backend/postgres/txn.c similarity index 100% rename from src/engine/sql/txn.c rename to src/backend/postgres/txn.c diff --git a/src/engine/sql/txn.h b/src/backend/postgres/txn.h similarity index 100% rename from src/engine/sql/txn.h rename to src/backend/postgres/txn.h diff --git a/src/engine/sql/txnmass.c b/src/backend/postgres/txnmass.c similarity index 100% rename from src/engine/sql/txnmass.c rename to src/backend/postgres/txnmass.c diff --git a/src/engine/sql/txnmass.h b/src/backend/postgres/txnmass.h similarity index 100% rename from src/engine/sql/txnmass.h rename to src/backend/postgres/txnmass.h diff --git a/src/engine/sql/upgrade.c b/src/backend/postgres/upgrade.c similarity index 100% rename from src/engine/sql/upgrade.c rename to src/backend/postgres/upgrade.c diff --git a/src/engine/sql/upgrade.h b/src/backend/postgres/upgrade.h similarity index 100% rename from src/engine/sql/upgrade.h rename to src/backend/postgres/upgrade.h diff --git a/src/engine/rpc/.cvsignore b/src/backend/rpc/.cvsignore similarity index 100% rename from src/engine/rpc/.cvsignore rename to src/backend/rpc/.cvsignore diff --git a/src/engine/rpc/Makefile.am b/src/backend/rpc/Makefile.am similarity index 77% rename from src/engine/rpc/Makefile.am rename to src/backend/rpc/Makefile.am index 88e94263bb..c27a0b5bf6 100644 --- a/src/engine/rpc/Makefile.am +++ b/src/backend/rpc/Makefile.am @@ -2,9 +2,10 @@ # Created By: Derek Atkins # The GNC RPC Backend -lib_LTLIBRARIES = libgnc_rpc.la +lib_LTLIBRARIES = libgncmod-backend-rpc.la -libgnc_rpc_la_SOURCES = \ +libgncmod_backend_rpc_la_SOURCES = \ + gncmod-backend-rpc.c \ RpcBackend.c \ RpcServer.c \ RpcSock.c \ @@ -17,7 +18,7 @@ libgnc_rpc_la_SOURCES = \ svc_thrd.c \ xprt_thrd.c -libgnc_rpc_la_LDFLAGS = -version-info 0:0:0 +libgncmod_backend_rpc_la_LDFLAGS = -version-info 0:0:0 noinst_HEADERS = \ RpcBackend.h \ @@ -41,13 +42,13 @@ EXTRA_DIST = \ README \ $(RPCGEN_SRCS) -INCLUDES = -I.. +INCLUDES = -I../../engine -I../../gnc-module LDADD = -lpthread -CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} +CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} -DGNCACCT_COMMODITY #RPCGEN=rpcgen -M -RPCGEN=rpcgen +RPCGEN=rpcgen -DGNCACCT_COMMODITY RPCGEN_SRCS = gncAccount.x gncCommodity.x gncKVP.x gncGUID.x \ gncPrice.x gncQuery.x gncRpc.x gncSplit.x gncTxn.x @@ -74,4 +75,4 @@ gncRpc_xdr.c: $(RPCGEN_SRCS) rpcgen: $(RPCGEN_FILES) # Make sure the system knows to run rpcgen first -$(libgnc_rpc_la_SOURCES): gncRpc.h +$(libgncmod_backend_rpc_la_SOURCES): gncRpc.h diff --git a/src/engine/rpc/README b/src/backend/rpc/README similarity index 90% rename from src/engine/rpc/README rename to src/backend/rpc/README index 5003eebef6..ddcd9a3117 100644 --- a/src/engine/rpc/README +++ b/src/backend/rpc/README @@ -1,3 +1,11 @@ +NOTE: the RPC backend doesn't build at the moment. It's pretty close +but needs a bit of sprucing up to make it work with the +currency-in-transaction changes. + +Bill Gribble (2001-08-01) + +----------------------------------------------------------------------- + This directory contains code for RPC support. The RPC Backend is a part of the client and connects to an RPC Server sitting elsewhere. diff --git a/src/engine/rpc/RpcBackend.c b/src/backend/rpc/RpcBackend.c similarity index 99% rename from src/engine/rpc/RpcBackend.c rename to src/backend/rpc/RpcBackend.c index 10d28d609a..0ff133df17 100644 --- a/src/engine/rpc/RpcBackend.c +++ b/src/backend/rpc/RpcBackend.c @@ -14,7 +14,6 @@ #include "config.h" -#include #include #include @@ -41,6 +40,7 @@ #include "RpcBackend.h" #include "RpcSock.h" #include "RpcUtils.h" +#include "xprt_thrd.h" #define RPCEND_MAGIC 0x49c3a61c #define VERIFY_BE(be,ret) { \ diff --git a/src/engine/rpc/RpcBackend.h b/src/backend/rpc/RpcBackend.h similarity index 100% rename from src/engine/rpc/RpcBackend.h rename to src/backend/rpc/RpcBackend.h diff --git a/src/engine/rpc/RpcServer.c b/src/backend/rpc/RpcServer.c similarity index 98% rename from src/engine/rpc/RpcServer.c rename to src/backend/rpc/RpcServer.c index 81c57fbabe..bb37476596 100644 --- a/src/engine/rpc/RpcServer.c +++ b/src/backend/rpc/RpcServer.c @@ -14,14 +14,13 @@ #include "config.h" -#include - #include "gnc-engine-util.h" #include "RpcServer.h" #include "RpcServerP.h" #include "RpcSock.h" #include "gncRpc.h" +#include "xprt_thrd.h" extern void gncrpc_prog_1(struct svc_req *, register SVCXPRT *); diff --git a/src/engine/rpc/RpcServer.h b/src/backend/rpc/RpcServer.h similarity index 100% rename from src/engine/rpc/RpcServer.h rename to src/backend/rpc/RpcServer.h diff --git a/src/engine/rpc/RpcServerP.h b/src/backend/rpc/RpcServerP.h similarity index 95% rename from src/engine/rpc/RpcServerP.h rename to src/backend/rpc/RpcServerP.h index c53e86e4cd..7642211124 100644 --- a/src/engine/rpc/RpcServerP.h +++ b/src/backend/rpc/RpcServerP.h @@ -13,7 +13,7 @@ #ifndef __RPC_SERVERP_H #define __RPC_SERVERP_H -#include +#include "xprt_thrd.h" #include "RpcServer.h" #include "RpcSock.h" diff --git a/src/engine/rpc/RpcSock.c b/src/backend/rpc/RpcSock.c similarity index 99% rename from src/engine/rpc/RpcSock.c rename to src/backend/rpc/RpcSock.c index 770f7a0c86..c3195cb1e4 100644 --- a/src/engine/rpc/RpcSock.c +++ b/src/backend/rpc/RpcSock.c @@ -12,9 +12,9 @@ #include #include -#include #include +#include "xprt_thrd.h" #include "RpcBackend.h" #include "RpcSock.h" diff --git a/src/engine/rpc/RpcSock.h b/src/backend/rpc/RpcSock.h similarity index 96% rename from src/engine/rpc/RpcSock.h rename to src/backend/rpc/RpcSock.h index 0ee26af4dd..51facdc02d 100644 --- a/src/engine/rpc/RpcSock.h +++ b/src/backend/rpc/RpcSock.h @@ -13,7 +13,7 @@ #ifndef __RPC_SOCK_H #define __RPC_SOCK_H -#include +#include "xprt_thrd.h" #include "RpcBackend.h" #define RPCEND_PORT 11207 diff --git a/src/engine/rpc/RpcUtils.c b/src/backend/rpc/RpcUtils.c similarity index 100% rename from src/engine/rpc/RpcUtils.c rename to src/backend/rpc/RpcUtils.c diff --git a/src/engine/rpc/RpcUtils.h b/src/backend/rpc/RpcUtils.h similarity index 100% rename from src/engine/rpc/RpcUtils.h rename to src/backend/rpc/RpcUtils.h diff --git a/src/engine/rpc/clnt_thrd.c b/src/backend/rpc/clnt_thrd.c similarity index 100% rename from src/engine/rpc/clnt_thrd.c rename to src/backend/rpc/clnt_thrd.c diff --git a/src/engine/rpc/clnt_thrd.h b/src/backend/rpc/clnt_thrd.h similarity index 100% rename from src/engine/rpc/clnt_thrd.h rename to src/backend/rpc/clnt_thrd.h diff --git a/src/engine/rpc/gncAccount.x b/src/backend/rpc/gncAccount.x similarity index 100% rename from src/engine/rpc/gncAccount.x rename to src/backend/rpc/gncAccount.x diff --git a/src/engine/rpc/gncCommodity.x b/src/backend/rpc/gncCommodity.x similarity index 100% rename from src/engine/rpc/gncCommodity.x rename to src/backend/rpc/gncCommodity.x diff --git a/src/engine/rpc/gncGUID.x b/src/backend/rpc/gncGUID.x similarity index 100% rename from src/engine/rpc/gncGUID.x rename to src/backend/rpc/gncGUID.x diff --git a/src/engine/rpc/gncKVP.x b/src/backend/rpc/gncKVP.x similarity index 100% rename from src/engine/rpc/gncKVP.x rename to src/backend/rpc/gncKVP.x diff --git a/src/engine/rpc/gncPrice.x b/src/backend/rpc/gncPrice.x similarity index 100% rename from src/engine/rpc/gncPrice.x rename to src/backend/rpc/gncPrice.x diff --git a/src/engine/rpc/gncQuery.corba b/src/backend/rpc/gncQuery.corba similarity index 100% rename from src/engine/rpc/gncQuery.corba rename to src/backend/rpc/gncQuery.corba diff --git a/src/engine/rpc/gncQuery.x b/src/backend/rpc/gncQuery.x similarity index 100% rename from src/engine/rpc/gncQuery.x rename to src/backend/rpc/gncQuery.x diff --git a/src/engine/rpc/gncRpc.h b/src/backend/rpc/gncRpc.h similarity index 99% rename from src/engine/rpc/gncRpc.h rename to src/backend/rpc/gncRpc.h index 82a683bd68..498e59b832 100644 --- a/src/engine/rpc/gncRpc.h +++ b/src/backend/rpc/gncRpc.h @@ -311,8 +311,12 @@ typedef struct gncrpc_backend_txn gncrpc_backend_txn; struct gncrpc_commit_acct_args { gncrpc_ptr backend; gncAccount acct; +#ifdef GNCACCT_COMMODITY + gncCommodity *commodity; +#else gncCommodity *currency; gncCommodity *security; +#endif }; typedef struct gncrpc_commit_acct_args gncrpc_commit_acct_args; diff --git a/src/engine/rpc/gncRpc.x b/src/backend/rpc/gncRpc.x similarity index 100% rename from src/engine/rpc/gncRpc.x rename to src/backend/rpc/gncRpc.x diff --git a/src/engine/rpc/gncRpc_clnt.c b/src/backend/rpc/gncRpc_clnt.c similarity index 100% rename from src/engine/rpc/gncRpc_clnt.c rename to src/backend/rpc/gncRpc_clnt.c diff --git a/src/engine/rpc/gncRpc_server.c b/src/backend/rpc/gncRpc_server.c similarity index 100% rename from src/engine/rpc/gncRpc_server.c rename to src/backend/rpc/gncRpc_server.c diff --git a/src/engine/rpc/gncRpc_server_stubs.c b/src/backend/rpc/gncRpc_server_stubs.c similarity index 100% rename from src/engine/rpc/gncRpc_server_stubs.c rename to src/backend/rpc/gncRpc_server_stubs.c diff --git a/src/engine/rpc/gncRpc_svc.c b/src/backend/rpc/gncRpc_svc.c similarity index 100% rename from src/engine/rpc/gncRpc_svc.c rename to src/backend/rpc/gncRpc_svc.c diff --git a/src/engine/rpc/gncSplit.x b/src/backend/rpc/gncSplit.x similarity index 100% rename from src/engine/rpc/gncSplit.x rename to src/backend/rpc/gncSplit.x diff --git a/src/engine/rpc/gncTxn.x b/src/backend/rpc/gncTxn.x similarity index 100% rename from src/engine/rpc/gncTxn.x rename to src/backend/rpc/gncTxn.x diff --git a/src/backend/rpc/gncmod-backend-rpc.c b/src/backend/rpc/gncmod-backend-rpc.c new file mode 100644 index 0000000000..2ac46e0435 --- /dev/null +++ b/src/backend/rpc/gncmod-backend-rpc.c @@ -0,0 +1,73 @@ +/********************************************************************* + * gncmod-backend-rpc.c + * module definition/initialization for the rpc backend module + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include + +#include "Backend.h" +#include "RpcBackend.h" + +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 8; +int gnc_module_revision = 0; +int gnc_module_age = 1; + +GNCModule engine; + +char * +gnc_module_path(void) +{ + return g_strdup("gnucash/backend/postgres"); +} + +char * +gnc_module_description(void) +{ + return g_strdup("The Postgres backend for Gnucash"); +} + +int +gnc_module_init(int refcount) +{ + if(refcount == 0) { + engine = gnc_module_load("gnucash/engine", 0); + + if(!engine) return FALSE; + } + return TRUE; +} + +int +gnc_module_end(int refcount) +{ + if((refcount == 0) && engine) + { + int unload = gnc_module_unload(engine); + engine = NULL; + return unload; + } + return TRUE; +} + + +/**************************************************************** + * gnc_backend_new + * this is the init function that must be defined by every dynamically + * loadable backend. the rpc backend doesn't follow backend + * loader naming conventions yet so we wrap its initializer function + * temporarily + ****************************************************************/ + +Backend * +gnc_backend_new(void) { + return rpcendNew(); +} diff --git a/src/engine/rpc/svc_thrd.c b/src/backend/rpc/svc_thrd.c similarity index 100% rename from src/engine/rpc/svc_thrd.c rename to src/backend/rpc/svc_thrd.c diff --git a/src/engine/rpc/svc_thrd.h b/src/backend/rpc/svc_thrd.h similarity index 100% rename from src/engine/rpc/svc_thrd.h rename to src/backend/rpc/svc_thrd.h diff --git a/src/engine/rpc/xprt_thrd.c b/src/backend/rpc/xprt_thrd.c similarity index 100% rename from src/engine/rpc/xprt_thrd.c rename to src/backend/rpc/xprt_thrd.c diff --git a/src/engine/rpc/xprt_thrd.h b/src/backend/rpc/xprt_thrd.h similarity index 100% rename from src/engine/rpc/xprt_thrd.h rename to src/backend/rpc/xprt_thrd.h diff --git a/src/engine/Account.c b/src/engine/Account.c deleted file mode 100644 index 97b96176f0..0000000000 --- a/src/engine/Account.c +++ /dev/null @@ -1,2163 +0,0 @@ -/********************************************************************\ - * Account.c -- Account data structure implementation * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include - -#include "Account.h" -#include "AccountP.h" -#include "BackendP.h" -#include "GNCIdP.h" -#include "Group.h" -#include "GroupP.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "date.h" -#include "gnc-commodity.h" -#include "gnc-engine.h" -#include "gnc-engine-util.h" -#include "gnc-event-p.h" -#include "kvp_frame.h" -#include "messages.h" - -static short module = MOD_ENGINE; - - -/********************************************************************\ - * Because I can't use C++ for this project, doesn't mean that I * - * can't pretend to! These functions perform actions on the * - * account data structure, in order to encapsulate the knowledge * - * of the internals of the Account in one file. * -\********************************************************************/ - -static void xaccAccountBringUpToDate(Account *acc); - -/********************************************************************\ -\********************************************************************/ - -G_INLINE_FUNC void mark_account (Account *account); -G_INLINE_FUNC void -mark_account (Account *account) -{ - if (account->parent) - account->parent->saved = FALSE; - - gnc_engine_generate_event (&account->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -static void -xaccInitAccount (Account * acc) -{ - acc->parent = NULL; - acc->children = NULL; - - acc->balance = gnc_numeric_zero(); - acc->cleared_balance = gnc_numeric_zero(); - acc->reconciled_balance = gnc_numeric_zero(); - - acc->starting_balance = gnc_numeric_zero(); - acc->starting_cleared_balance = gnc_numeric_zero(); - acc->starting_reconciled_balance = gnc_numeric_zero(); - - acc->type = NO_TYPE; - - acc->accountName = g_strdup(""); - acc->accountCode = g_strdup(""); - acc->description = g_strdup(""); - - acc->kvp_data = kvp_frame_new(); - acc->idata = 0; - - acc->commodity = NULL; - acc->commodity_scu = 100000; - - acc->splits = NULL; - - acc->version = 0; - acc->version_check = 0; - acc->editlevel = 0; - acc->balance_dirty = FALSE; - acc->sort_dirty = FALSE; - acc->core_dirty = FALSE; - acc->do_free = FALSE; - - xaccGUIDNew(&acc->guid); - xaccStoreEntity(acc, &acc->guid, GNC_ID_ACCOUNT); - LEAVE ("account=%p\n", acc); -} - -/********************************************************************\ -\********************************************************************/ - -Account * -xaccMallocAccount (void) -{ - Account *acc = g_new (Account, 1); - - xaccInitAccount (acc); - - gnc_engine_generate_event (&acc->guid, GNC_EVENT_CREATE); - - return acc; -} - -Account * -xaccCloneAccountSimple(const Account *from) -{ - Account *ret; - - ret = xaccMallocAccount(); - - ret->type = from->type; - - ret->accountName = g_strdup(from->accountName); - ret->accountCode = g_strdup(from->accountCode); - ret->description = g_strdup(from->description); - - ret->kvp_data = kvp_frame_copy(from->kvp_data); - - xaccAccountSetCommodity (ret, from->commodity); - - return ret; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccFreeAccount (Account *acc) -{ - Transaction *t; - GList *lp; - - if (NULL == acc) return; - - gnc_engine_generate_event (&acc->guid, GNC_EVENT_DESTROY); - - xaccRemoveEntity(&acc->guid); - - if (acc->children) - { - PERR (" xinstead of calling xaccFreeAccount(), please call \n" - " xaccAccountBeginEdit(); xaccAccountDestroy(); \n"); - - /* First, recursively free children */ - xaccFreeAccountGroup (acc->children); - acc->children = NULL; - } - - /* Next, clean up the splits */ - /* NB there shouldn't be any splits by now ... they should - * have been all been freed by CommitEdit(). We can remove this - * check once we know the warning isn't occurring any more. */ - if (acc->splits) - { - PERR (" instead of calling xaccFreeAccount(), please call \n" - " xaccAccountBeginEdit(); xaccAccountDestroy(); \n"); - - /* any split pointing at this account needs to be unmarked */ - for(lp = acc->splits; lp; lp = lp->next) - { - xaccSplitSetAccount((Split *) lp->data, NULL); - } - - acc->editlevel = 0; - - for(lp = acc->splits; lp; lp = lp->next) { - Split *s = (Split *) lp->data; - t = s->parent; - xaccTransBeginEdit (t); - xaccSplitDestroy (s); - xaccTransCommitEdit (t); - } - - /* free up array of split pointers */ - g_list_free(acc->splits); - acc->splits = NULL; - } - - if (acc->accountName) g_free (acc->accountName); - acc->accountName = NULL; - if (acc->accountCode) g_free (acc->accountCode); - acc->accountCode = NULL; - if (acc->description) g_free (acc->description); - acc->description = NULL; - - kvp_frame_delete (acc->kvp_data); - acc->kvp_data = NULL; - - /* zero out values, just in case stray - * pointers are pointing here. */ - - acc->commodity = NULL; - - acc->parent = NULL; - acc->children = NULL; - - acc->balance = gnc_numeric_zero(); - acc->cleared_balance = gnc_numeric_zero(); - acc->reconciled_balance = gnc_numeric_zero(); - - acc->type = NO_TYPE; - - acc->accountName = NULL; - acc->description = NULL; - acc->commodity = NULL; - - acc->version = 0; - acc->editlevel = 0; - acc->balance_dirty = FALSE; - acc->sort_dirty = FALSE; - acc->core_dirty = FALSE; - - g_free(acc); -} - -/********************************************************************\ - * transactional routines -\********************************************************************/ - -void -xaccAccountBeginEdit (Account *acc) -{ - Backend * be; - if (!acc) return; - - acc->editlevel++; - if (1 < acc->editlevel) return; - - if (0 >= acc->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", acc->editlevel); - acc->editlevel = 1; - } - - acc->core_dirty = FALSE; - - /* See if there's a backend. If there is, invoke it. */ - be = xaccAccountGetBackend (acc); - if (be && be->account_begin_edit) { - (be->account_begin_edit) (be, acc); - } -} - -void -xaccAccountCommitEdit (Account *acc) -{ - Backend * be; - - if (!acc) return; - - acc->editlevel--; - if (0 < acc->editlevel) return; - - if (0 > acc->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", acc->editlevel); - acc->editlevel = 0; - } - - /* If marked for deletion, get rid of subaccounts first, - * and then the splits ... */ - if (acc->do_free) - { - GList *lp; - - /* First, recursively free children */ - xaccFreeAccountGroup (acc->children); - acc->children = NULL; - - PINFO ("freeing splits for account %p (%s)\n", - acc, acc->accountName ? acc->accountName : "(null)"); - - /* any split pointing at this account needs to be unmarked */ - for(lp = acc->splits; lp; lp = lp->next) - { - xaccSplitSetAccount((Split *) lp->data, NULL); - } - - for(lp = acc->splits; lp; lp = lp->next) - { - Split *s = (Split *) lp->data; - Transaction *t = s->parent; - xaccTransBeginEdit (t); - xaccSplitDestroy (s); - xaccTransCommitEdit (t); - } - - /* free up array of split pointers */ - g_list_free(acc->splits); - acc->splits = NULL; - - acc->core_dirty = TRUE; - } - else - { - xaccAccountBringUpToDate(acc); - } - - /* See if there's a backend. If there is, invoke it. */ - be = xaccAccountGetBackend (acc); - if (be && be->account_commit_edit) - { - GNCBackendError errcode; - - /* clear errors */ - do { - errcode = xaccBackendGetError (be); - } while (ERR_BACKEND_NO_ERR != errcode); - - (be->account_commit_edit) (be, acc); - errcode = xaccBackendGetError (be); - - if (ERR_BACKEND_NO_ERR != errcode) - { - /* destroys must be rolled back as well ... ??? */ - acc->do_free = FALSE; - /* XXX hack alert FIXME implement account rollback */ - PERR (" backend asked engine to rollback, but this isn't" - " handled yet. Return code=%d", errcode); - /* push error back onto the stack */ - xaccBackendSetError (be, errcode); - } - } - acc->core_dirty = FALSE; - - /* final stages of freeing the account */ - if (acc->do_free) - { - xaccGroupRemoveAccount(acc->parent, acc); - xaccFreeAccount(acc); - } -} - -void -xaccAccountDestroy (Account *acc) -{ - if (!acc) return; - acc->do_free = TRUE; - - xaccAccountCommitEdit (acc); -} - - -void -xaccAccountSetVersion (Account *acc, gint32 vers) -{ - if (!acc) return; - acc->version = vers; -} - -gint32 -xaccAccountGetVersion (Account *acc) -{ - if (!acc) return 0; - return (acc->version); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountEqual(Account *aa, Account *ab, gboolean check_guids) { - if(!aa && !ab) return TRUE; - if(!aa) return FALSE; - if(!ab) return FALSE; - - if(aa->type != ab->type) return FALSE; - - if(safe_strcmp(aa->accountName, ab->accountName) != 0) return FALSE; - if(safe_strcmp(aa->accountCode, ab->accountCode) != 0) return FALSE; - if(safe_strcmp(aa->description, ab->description) != 0) return FALSE; - if(!gnc_commodity_equiv(aa->commodity, ab->commodity)) return FALSE; - - if(check_guids) { - if(!guid_equal(&aa->guid, &ab->guid)) return FALSE; - } - - if(kvp_frame_compare(aa->kvp_data, ab->kvp_data) != 0) return FALSE; - - /* no parent; always compare downwards. */ - - { - GList *la = aa->splits; - GList *lb = ab->splits; - - if( la && !lb) return FALSE; - if(!la && lb) return FALSE; - if(la && lb) { - /* presume that the splits are in the same order */ - while(la && lb) { - Split *sa = (Split *) la->data; - Split *sb = (Split *) lb->data; - if(!xaccSplitEqual(sa, sb, check_guids, FALSE)) return(FALSE); - la = la->next; - lb = lb->next; - } - if((la != NULL) || (lb != NULL)) return(FALSE); - } - } - - if(!xaccGroupEqual(aa->children, ab->children, check_guids)) return FALSE; - - return(TRUE); -} - -/********************************************************************\ -\********************************************************************/ - -static gint -split_sort_func(gconstpointer a, gconstpointer b) { - /* don't coerce xaccSplitDateOrder so we'll catch changes */ - Split *sa = (Split *) a; - Split *sb = (Split *) b; - return(xaccSplitDateOrder(sa, sb)); -} - -static void -xaccAccountSortSplits (Account *acc) -{ - if(!acc) return; - - if(!acc->sort_dirty) return; - if(acc->editlevel > 0) return; - acc->splits = g_list_sort(acc->splits, split_sort_func); - acc->sort_dirty = FALSE; -} - -static void -xaccAccountBringUpToDate(Account *acc) -{ - if(!acc) return; - - /* if a re-sort happens here, then everything will update, so the - cost basis and balance calls are no-ops */ - xaccAccountSortSplits(acc); - xaccAccountRecomputeBalance(acc); -} - - -/******************************************************************** - * xaccAccountGetSlots - ********************************************************************/ - -kvp_frame * -xaccAccountGetSlots(Account * account) { - if (!account) return NULL; - return(account->kvp_data); -} - -void -xaccAccountSetSlots_nc(Account *account, kvp_frame *frame) -{ - if (!account) return; - if (frame == account->kvp_data) return; - - xaccAccountBeginEdit (account); - if(account->kvp_data) - { - kvp_frame_delete (account->kvp_data); - } - account->kvp_data = frame; - xaccAccountCommitEdit (account); -} - - -/********************************************************************\ -\********************************************************************/ - -const GUID * -xaccAccountGetGUID (Account *account) -{ - if (!account) - return xaccGUIDNULL(); - - return &account->guid; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetGUID (Account *account, const GUID *guid) -{ - if (!account || !guid) return; - - PINFO("acct=%p", account); - xaccAccountBeginEdit (account); - xaccRemoveEntity(&account->guid); - - account->guid = *guid; - - xaccStoreEntity(account, &account->guid, GNC_ID_ACCOUNT); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -Account * -xaccAccountLookup (const GUID *guid) -{ - if (!guid) return NULL; - return xaccLookupEntity(guid, GNC_ID_ACCOUNT); -} - -/********************************************************************\ -\********************************************************************/ - -short -xaccAccountGetMark (Account *acc) -{ - if (!acc) return 0; - return acc->mark; -} - -void -xaccAccountSetMark (Account *acc, short m) -{ - if (!acc) return; - acc->mark = m; -} - -void -xaccClearMark (Account *acc, short val) -{ - AccountGroup *topgrp; - - if (!acc) return; - topgrp = xaccGetAccountRoot (acc); - - if (topgrp) - { - GList *list; - GList *node; - - list = xaccGroupGetAccountList (topgrp); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccClearMarkDown (account, val); - } - } - else - xaccClearMarkDown (acc, val); -} - -void -xaccClearMarkDown (Account *acc, short val) -{ - AccountGroup *children; - - if (!acc) return; - acc->mark = val; - - children = acc->children; - if (children) - { - GList *list; - GList *node; - - list = xaccGroupGetAccountList (children); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccClearMarkDown (account, val); - } - } -} - -void -xaccClearMarkDownGr (AccountGroup *grp, short val) -{ - GList *list; - GList *node; - - if (!grp) return; - - list = xaccGroupGetAccountList (grp); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccClearMarkDown (account, val); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountInsertSplit (Account *acc, Split *split) -{ - if (!acc) return; - if (!split) return; - - xaccAccountBeginEdit(acc); - - acc->balance_dirty = TRUE; - acc->sort_dirty = TRUE; - - /* convert the split to the new account's denominator */ - /* if the denominator can't be exactly converted, it's an error */ - /* FIXME : need to enforce ordering of insertion/value */ - split->amount = gnc_numeric_convert(split->amount, - xaccAccountGetCommoditySCU(acc), - GNC_RND_ROUND); - - /* if this split belongs to another account, remove it from there - * first. We don't want to ever leave the system in an inconsistent - * state. Note that it might belong to the current account if we're - * just using this call to re-order. */ - if (xaccSplitGetAccount(split) && - xaccSplitGetAccount(split) != acc) - xaccAccountRemoveSplit (xaccSplitGetAccount(split), split); - xaccSplitSetAccount(split, acc); - - if(g_list_index(acc->splits, split) == -1) - { - if (acc->editlevel == 1) - { - acc->splits = g_list_insert_sorted(acc->splits, split, - split_sort_func); - acc->sort_dirty = FALSE; - } - else - acc->splits = g_list_prepend(acc->splits, split); - - mark_account (acc); - if (split->parent) - gnc_engine_generate_event (&split->parent->guid, GNC_EVENT_MODIFY); - } - - xaccAccountCommitEdit(acc); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountRemoveSplit (Account *acc, Split *split) -{ - if (!acc) return; - if (!split) return; - - xaccAccountBeginEdit(acc); - { - GList *node; - - node = g_list_find (acc->splits, split); - if (!node) - { - PERR ("split not in account"); - } - else - { - acc->splits = g_list_remove_link (acc->splits, node); - g_list_free_1 (node); - - acc->balance_dirty = TRUE; - xaccSplitSetAccount(split, NULL); - - mark_account (acc); - if (split->parent) - gnc_engine_generate_event (&split->parent->guid, GNC_EVENT_MODIFY); - } - } - xaccAccountCommitEdit(acc); -} - - -/********************************************************************\ - * xaccAccountRecomputeBalance * - * recomputes the partial balances and the current balance for * - * this account. * - * * - * The way the computation is done depends on whether the partial * - * balances are for a monetary account (bank, cash, etc.) or a * - * certificate account (stock portfolio, mutual fund). For bank * - * accounts, the invariant amount is the dollar amount. For share * - * accounts, the invariant amount is the number of shares. For * - * share accounts, the share price fluctuates, and the current * - * value of such an account is the number of shares times the * - * current share price. * - * * - * Part of the complexity of this computation stems from the fact * - * xacc uses a double-entry system, meaning that one transaction * - * appears in two accounts: one account is debited, and the other * - * is credited. When the transaction represents a sale of shares, * - * or a purchase of shares, some care must be taken to compute * - * balances correctly. For a sale of shares, the stock account must* - * be debited in shares, but the bank account must be credited * - * in dollars. Thus, two different mechanisms must be used to * - * compute balances, depending on account type. * - * * - * Args: account -- the account for which to recompute balances * - * Return: void * -\********************************************************************/ - -void -xaccAccountRecomputeBalance (Account * acc) -{ - gnc_numeric balance; - gnc_numeric cleared_balance; - gnc_numeric reconciled_balance; - Split *last_split = NULL; - GList *lp; - - if (NULL == acc) return; - if (acc->editlevel > 0) return; - if (!acc->balance_dirty) return; - if (acc->do_free) return; - - balance = acc->starting_balance; - cleared_balance = acc->starting_cleared_balance; - reconciled_balance = acc->starting_reconciled_balance; - - for(lp = acc->splits; lp; lp = lp->next) { - Split *split = (Split *) lp->data; - - balance = gnc_numeric_add_fixed(balance, split->amount); - - if (NREC != split->reconciled) - cleared_balance = gnc_numeric_add_fixed(cleared_balance, split->amount); - - if (YREC == split->reconciled || - FREC == split->reconciled) { - reconciled_balance = - gnc_numeric_add_fixed(reconciled_balance, split->amount); - } - - split->balance = balance; - split->cleared_balance = cleared_balance; - split->reconciled_balance = reconciled_balance; - - last_split = split; - } - - acc->balance = balance; - acc->cleared_balance = cleared_balance; - acc->reconciled_balance = reconciled_balance; - - acc->balance_dirty = FALSE; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetStartingBalance(Account *acc, - const gnc_numeric start_baln, - const gnc_numeric start_cleared_baln, - const gnc_numeric start_reconciled_baln) -{ - if (!acc) return; - - acc->starting_balance = start_baln; - acc->starting_cleared_balance = start_cleared_baln; - acc->starting_reconciled_balance = start_reconciled_baln; - - acc->balance_dirty = TRUE; -} - -/********************************************************************\ - * xaccAccountFixSplitDateOrder * - * check this split to see if the date is in correct order * - * If it is not, reorder the transactions ... * - * * - * Args: acc -- the account to check * - * split -- the split to check * - * * - * Return: int -- non-zero if out of order * -\********************************************************************/ - -void -xaccAccountFixSplitDateOrder (Account * acc, Split *split) -{ - if (NULL == acc) return; - if (NULL == split) return; - - if (acc->do_free) return; - - acc->sort_dirty = TRUE; - acc->balance_dirty = TRUE; - - if (acc->editlevel > 0) return; - - xaccAccountBringUpToDate (acc); -} - -/********************************************************************\ - * xaccCheckTransDateOrder * - * check this transaction to see if the date is in correct order * - * If it is not, reorder the transactions. * - * This routine perfroms the check for both of the double-entry * - * transaction entries. * - * * - * Args: trans -- the transaction to check * - * Return: int -- non-zero if out of order * -\********************************************************************/ - -void -xaccTransFixSplitDateOrder (Transaction *trans) -{ - GList *node; - - if (trans == NULL) return; - - for (node = trans->splits; node; node = node->next) - { - Split *s = node->data; - xaccAccountFixSplitDateOrder (xaccSplitGetAccount(s), s); - } -} - -/********************************************************************\ -\********************************************************************/ - -/* The sort order is used to implicitly define an - * order for report generation */ - -static int typeorder[NUM_ACCOUNT_TYPES] = { - BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET, - CREDIT, LIABILITY, INCOME, EXPENSE, EQUITY }; - -static int revorder[NUM_ACCOUNT_TYPES] = { - -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 }; - - -int -xaccAccountOrder (Account **aa, Account **ab) { - char *da, *db; - char *endptr = NULL; - int ta, tb; - long la, lb; - - if ( (*aa) && !(*ab) ) return -1; - if ( !(*aa) && (*ab) ) return +1; - if ( !(*aa) && !(*ab) ) return 0; - - /* sort on accountCode strings */ - da = (*aa)->accountCode; - db = (*ab)->accountCode; - - /* If accountCodes are both base 36 integers do an integer sort */ - la = strtoul (da, &endptr, 36); - if((*da != '\0') && (*endptr == '\0')) { - lb = strtoul (db, &endptr, 36); - if((*db != '\0') && (*endptr == '\0')) { - if (la < lb) return -1; - if (la > lb) return +1; - } - } - - /* Otherwise do a string sort */ - SAFE_STRCMP (da, db); - - /* if acccount-type-order array not initialized, initialize it */ - /* this will happen at most once during program invocation */ - if (-1 == revorder[0]) { - int i; - for (i=0; itype; - tb = (*ab)->type; - ta = revorder[ta]; - tb = revorder[tb]; - if (ta < tb) return -1; - if (ta > tb) return +1; - - /* otherwise, sort on accountName strings */ - da = (*aa)->accountName; - db = (*ab)->accountName; - SAFE_STRCMP (da, db); - - return 0; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetType (Account *acc, int tip) { - - if (!acc) return; - - xaccAccountBeginEdit(acc); - { - /* refuse invalid account types, and don't bother if not new type. */ - if((NUM_ACCOUNT_TYPES > tip) && (acc->type != tip)) { - acc->type = tip; - acc->balance_dirty = TRUE; /* new type may affect balance computation */ - } - - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -void -xaccAccountSetName (Account *acc, const char *str) { - char * tmp; - - if ((!acc) || (!str)) return; - - xaccAccountBeginEdit(acc); - { - /* make strdup before freeing (just in case str==accountName !!) */ - tmp = g_strdup (str); - g_free (acc->accountName); - acc->accountName = tmp; - - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -void -xaccAccountSetCode (Account *acc, const char *str) { - char * tmp; - if ((!acc) || (!str)) return; - - xaccAccountBeginEdit(acc); - { - /* make strdup before freeing */ - tmp = g_strdup (str); - g_free (acc->accountCode); - acc->accountCode = tmp; - - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -void -xaccAccountSetDescription (Account *acc, const char *str) { - char * tmp; - if ((!acc) || (!str)) return; - - xaccAccountBeginEdit(acc); - { - /* make strdup before freeing (just in case str==description !!) */ - tmp = g_strdup (str); - g_free (acc->description); - acc->description = tmp; - - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -void -xaccAccountSetNotes (Account *acc, const char *str) -{ - if ((!acc) || (!str)) return; - - xaccAccountBeginEdit(acc); - kvp_frame_set_slot_nc(acc->kvp_data, "notes", - kvp_value_new_string(str)); - mark_account (acc); - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -/* FIXME : is this the right way to do this? */ -static void -update_split_commodity(Account * acc) -{ - GList *lp; - - if(!acc) return; - - xaccAccountBeginEdit(acc); - /* iterate over splits */ - for(lp = acc->splits; lp; lp = lp->next) { - Split *s = (Split *) lp->data; - s->amount = gnc_numeric_convert(s->amount, - xaccAccountGetCommoditySCU(acc), - GNC_RND_ROUND); - } - xaccAccountCommitEdit(acc); -} - -/********************************************************************\ -\********************************************************************/ -/* This is an experimental implementation of set commodity. In the - * long haul, it will need to set the one and only commodity field. - * But in the interim phase, we try to guess right ... - */ - -void -xaccAccountSetCommodity (Account * acc, gnc_commodity * com) -{ - if ((!acc) || (!com)) return; - - xaccAccountBeginEdit(acc); - { - acc->commodity = com; - acc->commodity_scu = gnc_commodity_get_fraction(com); - update_split_commodity(acc); - - acc->sort_dirty = TRUE; - acc->balance_dirty = TRUE; - - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -void -xaccAccountSetCommoditySCU (Account *acc, int scu) -{ - if (!acc) return; - - xaccAccountBeginEdit(acc); - { - acc->commodity_scu = scu; - mark_account (acc); - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -int -xaccAccountGetCommoditySCU (Account * acc) { - if (!acc) return 0; - - return acc->commodity_scu; -} - -/********************************************************************\ -\********************************************************************/ -/* below follow the old, deprecated currency/security routines. */ - -void -DxaccAccountSetCurrency (Account * acc, gnc_commodity * currency) { - const char *string; - gnc_commodity *commodity; - - if ((!acc) || (!currency)) return; - - xaccAccountBeginEdit(acc); - string = gnc_commodity_get_unique_name (currency); - kvp_frame_set_slot_nc(acc->kvp_data, "old-currency", - kvp_value_new_string(string)); - mark_account (acc); - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); - - commodity = DxaccAccountGetCurrency (acc); - if (!commodity) - gnc_commodity_table_insert (gnc_engine_commodities (), currency); -} - -void -DxaccAccountSetSecurity (Account *acc, gnc_commodity * security) { - const char *string; - gnc_commodity *commodity; - - if ((!acc) || (!security)) return; - - xaccAccountBeginEdit(acc); - string = gnc_commodity_get_unique_name (security); - kvp_frame_set_slot_nc(acc->kvp_data, "old-security", - kvp_value_new_string(string)); - mark_account (acc); - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); - - commodity = DxaccAccountGetSecurity (acc); - if (!commodity) - gnc_commodity_table_insert (gnc_engine_commodities (), security); -} - -void -DxaccAccountSetCurrencySCU (Account * acc, int scu) { - - if (!acc) return; - - xaccAccountBeginEdit(acc); - kvp_frame_set_slot_nc(acc->kvp_data, "old-currency-scu", - kvp_value_new_gint64(scu)); - mark_account (acc); - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -int -DxaccAccountGetCurrencySCU (Account * acc) { - kvp_value *v; - - if (!acc) return 0; - - v = kvp_frame_get_slot(acc->kvp_data, "old-currency-scu"); - if (v) return kvp_value_get_gint64 (v); - - return 0; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountDeleteOldData (Account *account) -{ - if (!account) return; - - kvp_frame_set_slot_nc (account->kvp_data, "old-currency", NULL); - kvp_frame_set_slot_nc (account->kvp_data, "old-security", NULL); - kvp_frame_set_slot_nc (account->kvp_data, "old-currency-scu", NULL); - kvp_frame_set_slot_nc (account->kvp_data, "old-security-scu", NULL); -} - -/********************************************************************\ -\********************************************************************/ - -AccountGroup * -xaccAccountGetChildren (Account *acc) -{ - if (!acc) return NULL; - if (acc->children == NULL) - xaccAccountInsertSubAccount (acc, NULL); - return (acc->children); -} - -AccountGroup * -xaccAccountGetParent (Account *acc) -{ - if (!acc) return NULL; - return (acc->parent); -} - -Account * -xaccAccountGetParentAccount (Account * acc) -{ - if (!acc) return NULL; - return xaccGroupGetParentAccount(acc->parent); -} - -GNCAccountType -xaccAccountGetType (Account *acc) -{ - if (!acc) return NO_TYPE; - return (acc->type); -} - -const char * -xaccAccountGetName (Account *acc) -{ - if (!acc) return NULL; - return (acc->accountName); -} - -char * -xaccAccountGetFullName(Account *account, const char separator) -{ - Account *a; - char *fullname; - const char *name; - char *p; - int length; - - if (account == NULL) - return g_strdup(""); - - /* Figure out how much space is needed */ - length = 0; - a = account; - while (a != NULL) - { - name = xaccAccountGetName(a); - - length += strlen(name) + 1; /* plus one for the separator */ - - a = xaccAccountGetParentAccount(a); - } - - /* length has one extra separator in it, that's ok, because it will - * hold the null character at the end. */ - - /* allocate the memory */ - fullname = g_new(char, length); - - /* go to end of string */ - p = fullname + length - 1; - - /* put in the null character and move to the previous char */ - *p-- = 0; - - a = account; - while (a != NULL) - { - name = xaccAccountGetName(a); - length = strlen(name); - - /* copy the characters going backwards */ - while (length > 0) - *p-- = name[--length]; - - a = xaccAccountGetParentAccount(a); - - /* if we're not at the root, add another separator */ - if (a != NULL) - *p-- = separator; - } - - return fullname; -} - -const char * -xaccAccountGetCode (Account *acc) -{ - if (!acc) return NULL; - return (acc->accountCode); -} - -const char * -xaccAccountGetDescription (Account *acc) -{ - if (!acc) return NULL; - return (acc->description); -} - -const char * -xaccAccountGetNotes (Account *acc) -{ - kvp_value *v; - - if (!acc) return NULL; - v = kvp_frame_get_slot(acc->kvp_data, "notes"); - if(v) return(kvp_value_get_string(v)); - return(NULL); -} - -gnc_commodity * -DxaccAccountGetCurrency (Account *acc) -{ - kvp_value *v; - const char *s; - - if (!acc) return NULL; - - v = kvp_frame_get_slot(acc->kvp_data, "old-currency"); - if (!v) return NULL; - - s = kvp_value_get_string (v); - if (!s) return NULL; - - return gnc_commodity_table_lookup_unique (gnc_engine_commodities (), s); -} - -gnc_commodity * -xaccAccountGetCommodity (Account *acc) -{ - if (!acc) return NULL; - - return (acc->commodity); -} - -gnc_commodity * -DxaccAccountGetSecurity (Account *acc) -{ - kvp_value *v; - const char *s; - - if (!acc) return NULL; - - v = kvp_frame_get_slot(acc->kvp_data, "old-security"); - if (!v) return NULL; - - s = kvp_value_get_string (v); - if (!s) return NULL; - - return gnc_commodity_table_lookup_unique (gnc_engine_commodities (), s); -} - -gnc_numeric -xaccAccountGetBalance (Account *acc) { - if (!acc) return gnc_numeric_zero(); - return acc->balance; -} - -gnc_numeric -xaccAccountGetClearedBalance (Account *acc) -{ - if (!acc) return gnc_numeric_zero(); - return acc->cleared_balance; -} - -gnc_numeric -xaccAccountGetReconciledBalance (Account *acc) -{ - if (!acc) return gnc_numeric_zero(); - return acc->reconciled_balance; -} - -/********************************************************************\ -\********************************************************************/ - -gnc_numeric -xaccAccountGetBalanceAsOfDate (Account *acc, time_t date) -{ - /* Ideally this could use xaccAccountForEachSplit, but - * it doesn't exist yet and I'm uncertain of exactly how - * it would work at this time, since it differs from - * xaccAccountForEachTransaction by using gpointer return - * values rather than gbooleans. - */ - GList *lp; - Timespec ts, trans_ts; - gboolean found = FALSE; - gnc_numeric balance; - - balance = xaccAccountGetBalance( acc ); - - xaccAccountSortSplits( acc ); /* just in case, normally a nop */ - - /* Since transaction post times are stored as a Timespec, - * convert date into a Timespec as well rather than converting - * each transaction's Timespec into a time_t. - */ - - ts.tv_sec = date; - ts.tv_nsec = 0; - - /* Do checks from xaccAccountRecomputeBalance. balance_dirty isn't - * checked because it shouldn't be necessary. - */ - - if( NULL == acc || - acc->editlevel > 0 || - acc->do_free ) - { - return ( balance ); - } - - lp = xaccAccountGetSplitList( acc ); - while( lp && !found ) - { - xaccTransGetDatePostedTS( xaccSplitGetParent( (Split *)lp->data ), - &trans_ts ); - if( timespec_cmp( &trans_ts, &ts ) > 0 ) - found = TRUE; - else - lp = lp->next; - } - - if( lp && lp->prev ) - { - /* Since lp is now pointing to a split which was past the reconcile - * date, get the running balance of the previous split. - */ - balance = xaccSplitGetBalance( (Split *)lp->prev->data ); - } - - /* Otherwise there were no splits posted after the given date, - * so the latest account balance should be good enough. - */ - - return( balance ); -} - -/********************************************************************\ -\********************************************************************/ - -GList * -xaccAccountGetSplitList (Account *acc) { - if (!acc) return NULL; - return (acc->splits); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountGetTaxRelated (Account *account) -{ - kvp_value *kvp; - - if (!account) - return FALSE; - - kvp = kvp_frame_get_slot (account->kvp_data, "tax-related"); - if (!kvp) - return FALSE; - - return kvp_value_get_gint64 (kvp); -} - -void -xaccAccountSetTaxRelated (Account *account, gboolean tax_related) -{ - kvp_value *new_value; - - if (!account) - return; - - if (tax_related) - new_value = kvp_value_new_gint64 (tax_related); - else - new_value = NULL; - - xaccAccountBeginEdit (account); - kvp_frame_set_slot_nc(account->kvp_data, "tax-related", new_value); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -const char * -xaccAccountGetTaxUSCode (Account *account) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot_path (account->kvp_data, "tax-US", "code", NULL); - if (!value) - return NULL; - - return kvp_value_get_string (value); -} - -void -xaccAccountSetTaxUSCode (Account *account, const char *code) -{ - kvp_frame *frame; - - if (!account) - return; - - xaccAccountBeginEdit (account); - - frame = kvp_frame_get_frame (account->kvp_data, "tax-US", NULL); - - kvp_frame_set_slot_nc (frame, "code", - code ? kvp_value_new_string (code) : NULL); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -const char * -xaccAccountGetTaxUSPayerNameSource (Account *account) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot_path (account->kvp_data, - "tax-US", "payer-name-source", NULL); - if (!value) - return NULL; - - return kvp_value_get_string (value); -} - -void -xaccAccountSetTaxUSPayerNameSource (Account *account, const char *source) -{ - kvp_frame *frame; - - if (!account) - return; - - xaccAccountBeginEdit (account); - - frame = kvp_frame_get_frame (account->kvp_data, "tax-US", NULL); - - kvp_frame_set_slot_nc (frame, "payer-name-source", - source ? kvp_value_new_string (source) : NULL); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountHasAncestor (Account *account, Account * ancestor) -{ - Account *parent; - - if ((account == NULL) || (ancestor == NULL)) - return FALSE; - - parent = xaccAccountGetParentAccount(account); - while (parent != NULL) - { - if (parent == ancestor) - return TRUE; - - parent = xaccAccountGetParentAccount(parent); - } - - return FALSE; -} - -/********************************************************************\ -\********************************************************************/ - -/* You must edit the functions in this block in tandem. KEEP THEM IN - SYNC! */ - -#define GNC_RETURN_ENUM_AS_STRING(x) case (x): return #x; - -char * -xaccAccountTypeEnumAsString(GNCAccountType type) { - switch(type) { - GNC_RETURN_ENUM_AS_STRING(NO_TYPE); - GNC_RETURN_ENUM_AS_STRING(BANK); - GNC_RETURN_ENUM_AS_STRING(CASH); - GNC_RETURN_ENUM_AS_STRING(CREDIT); - GNC_RETURN_ENUM_AS_STRING(ASSET); - GNC_RETURN_ENUM_AS_STRING(LIABILITY); - GNC_RETURN_ENUM_AS_STRING(STOCK); - GNC_RETURN_ENUM_AS_STRING(MUTUAL); - GNC_RETURN_ENUM_AS_STRING(CURRENCY); - GNC_RETURN_ENUM_AS_STRING(INCOME); - GNC_RETURN_ENUM_AS_STRING(EXPENSE); - GNC_RETURN_ENUM_AS_STRING(EQUITY); - GNC_RETURN_ENUM_AS_STRING(CHECKING); - GNC_RETURN_ENUM_AS_STRING(SAVINGS); - GNC_RETURN_ENUM_AS_STRING(MONEYMRKT); - GNC_RETURN_ENUM_AS_STRING(CREDITLINE); - default: - PERR ("asked to translate unknown account type %d.\n", type); - break; - } - return(NULL); -} - -#undef GNC_RETURN_ENUM_AS_STRING - -#define GNC_RETURN_ON_MATCH(x) \ - if(safe_strcmp(#x, (str)) == 0) { *type = x; return(TRUE); } - -gboolean -xaccAccountStringToType(const char* str, GNCAccountType *type) { - - GNC_RETURN_ON_MATCH(NO_TYPE); - GNC_RETURN_ON_MATCH(BANK); - GNC_RETURN_ON_MATCH(CASH); - GNC_RETURN_ON_MATCH(CREDIT); - GNC_RETURN_ON_MATCH(ASSET); - GNC_RETURN_ON_MATCH(LIABILITY); - GNC_RETURN_ON_MATCH(STOCK); - GNC_RETURN_ON_MATCH(MUTUAL); - GNC_RETURN_ON_MATCH(CURRENCY); - GNC_RETURN_ON_MATCH(INCOME); - GNC_RETURN_ON_MATCH(EXPENSE); - GNC_RETURN_ON_MATCH(EQUITY); - GNC_RETURN_ON_MATCH(CHECKING); - GNC_RETURN_ON_MATCH(SAVINGS); - GNC_RETURN_ON_MATCH(MONEYMRKT); - GNC_RETURN_ON_MATCH(CREDITLINE); - - PERR("asked to translate unknown account type string %s.\n", - str ? str : "(null)"); - - return(FALSE); -} - -#undef GNC_RETURN_ON_MATCH - -/* impedance mismatch is a source of loss */ -GNCAccountType -xaccAccountStringToEnum(const char* str) -{ - GNCAccountType type; - gboolean rc; - rc = xaccAccountStringToType(str, &type); - if (FALSE == rc) return BAD_TYPE; - return type; -} - -/********************************************************************\ -\********************************************************************/ - -static char * -account_type_name[NUM_ACCOUNT_TYPES] = { - N_("Bank"), - N_("Cash"), - N_("Asset"), - N_("Credit Card"), - N_("Liability"), - N_("Stock"), - N_("Mutual Fund"), - N_("Currency"), - N_("Income"), - N_("Expense"), - N_("Equity") - /* - N_("Checking"), - N_("Savings"), - N_("Money Market"), - N_("Credit Line") - */ -}; - -const char * -xaccAccountGetTypeStr(GNCAccountType type) { - if (0 > type) return ""; - if (NUM_ACCOUNT_TYPES <= type) return ""; - return _(account_type_name [type]); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountTypesCompatible (GNCAccountType parent_type, - GNCAccountType child_type) -{ - gboolean compatible = FALSE; - - switch(parent_type) - { - case BANK: - case CASH: - case ASSET: - case STOCK: - case MUTUAL: - case CURRENCY: - case CREDIT: - case LIABILITY: - compatible = ((child_type == BANK) || - (child_type == CASH) || - (child_type == ASSET) || - (child_type == STOCK) || - (child_type == MUTUAL) || - (child_type == CURRENCY) || - (child_type == CREDIT) || - (child_type == LIABILITY)); - break; - case INCOME: - case EXPENSE: - compatible = ((child_type == INCOME) || - (child_type == EXPENSE)); - break; - case EQUITY: - compatible = (child_type == EQUITY); - break; - default: - PERR("bad account type: %d", parent_type); - break; - } - - return compatible; -} - -/********************************************************************\ -\********************************************************************/ -gboolean -xaccAccountGetReconcileLastDate (Account *account, time_t *last_date) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot_path (account->kvp_data, - "reconcile-info", "last-date", NULL); - if (!value) - return FALSE; - - if (kvp_value_get_type (value) == KVP_TYPE_GINT64) - { - if (last_date) - *last_date = kvp_value_get_gint64 (value); - - return TRUE; - } - - return FALSE; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetReconcileLastDate (Account *account, time_t last_date) -{ - kvp_frame *frame; - if (!account) - return; - - xaccAccountBeginEdit (account); - frame = kvp_frame_get_frame (account->kvp_data, "reconcile-info", NULL); - kvp_frame_set_slot_nc (frame, "last-date", - kvp_value_new_gint64 (last_date)); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountGetReconcilePostponeDate (Account *account, - time_t *postpone_date) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot_path (account->kvp_data, - "reconcile-info", "postpone", "date", NULL); - if (!value) - return FALSE; - - if (kvp_value_get_type (value) == KVP_TYPE_GINT64) - { - if (postpone_date) - *postpone_date = kvp_value_get_gint64 (value); - - return TRUE; - } - - return FALSE; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetReconcilePostponeDate (Account *account, - time_t postpone_date) -{ - kvp_frame *frame; - if (!account) - return; - - xaccAccountBeginEdit (account); - frame = kvp_frame_get_frame (account->kvp_data, - "reconcile-info", "postpone", NULL); - - kvp_frame_set_slot_nc (frame, "date", - kvp_value_new_gint64 (postpone_date)); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountGetReconcilePostponeBalance (Account *account, - gnc_numeric *balance) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot_path (account->kvp_data, - "reconcile-info", "postpone", "balance", - NULL); - if (!value) - return FALSE; - - if (kvp_value_get_type (value) == KVP_TYPE_NUMERIC) - { - if (balance) - *balance = kvp_value_get_numeric (value); - - return TRUE; - } - - return FALSE; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetReconcilePostponeBalance (Account *account, - gnc_numeric balance) -{ - kvp_frame *frame; - if (!account) - return; - - xaccAccountBeginEdit (account); - frame = kvp_frame_get_frame (account->kvp_data, - "reconcile-info", "postpone", NULL); - - kvp_frame_set_slot_nc (frame, "balance", - kvp_value_new_gnc_numeric (balance)); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ - -\********************************************************************/ - -void -xaccAccountClearReconcilePostpone (Account *account) -{ - if (!account) - return; - - xaccAccountBeginEdit (account); - { - kvp_frame_set_slot_path (account->kvp_data, NULL, - "reconcile-info", "postpone", NULL); - - mark_account (account); - } - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -/* xaccAccountGetAutoInterestXfer: determine whether the auto interest - * xfer option is enabled for this account, and return that value. - * If it is not defined for the account, return the default value. - */ -gboolean -xaccAccountGetAutoInterestXfer (Account *account, gboolean default_value) -{ - kvp_value *value = NULL; - char *setting = NULL; - gboolean result = default_value; - - if ( ( account ) && - ( value = kvp_frame_get_slot_path (account->kvp_data, - "reconcile-info", - "auto-interest-transfer", - NULL) ) && - ( kvp_value_get_type (value) == KVP_TYPE_STRING ) && - ( setting = kvp_value_get_string(value) ) ) - { - if( !strcmp( setting, "true" ) ) - result = TRUE; - else if( !strcmp( setting, "false" ) ) - result = FALSE; - } - - return (result); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetAutoInterestXfer (Account *account, gboolean option) -{ - kvp_frame *frame; - if (!account) - return; - - xaccAccountBeginEdit (account); - frame = kvp_frame_get_frame (account->kvp_data, - "reconcile-info", NULL); - - /* FIXME: need KVP_TYPE_BOOLEAN for this someday */ - - kvp_frame_set_slot_nc (frame, "auto-interest-transfer", - kvp_value_new_string (option ? "true" : "false")); - - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -const char * -xaccAccountGetLastNum (Account *account) -{ - kvp_value *value; - - if (!account) - return FALSE; - - value = kvp_frame_get_slot (account->kvp_data, "last-num"); - if (!value) - return FALSE; - - return kvp_value_get_string (value); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetLastNum (Account *account, const char *num) -{ - if (!account) - return; - - xaccAccountBeginEdit (account); - kvp_frame_set_slot_nc (account->kvp_data, "last-num", - kvp_value_new_string (num)); - mark_account (account); - account->core_dirty = TRUE; - xaccAccountCommitEdit (account); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetPriceSrc(Account *acc, const char *src) -{ - if(!acc) return; - - xaccAccountBeginEdit(acc); - { - GNCAccountType t = xaccAccountGetType(acc); - - if((t == STOCK) || (t == MUTUAL) || (t == CURRENCY)) { - kvp_frame_set_slot_nc(acc->kvp_data, - "old-price-source", - src ? kvp_value_new_string(src) : NULL); - mark_account (acc); - } - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -/********************************************************************\ -\********************************************************************/ - -const char* -xaccAccountGetPriceSrc(Account *acc) -{ - GNCAccountType t; - if(!acc) return NULL; - - t = xaccAccountGetType(acc); - if((t == STOCK) || (t == MUTUAL) || (t == CURRENCY)) - { - kvp_value *value = kvp_frame_get_slot(acc->kvp_data, "old-price-source"); - if(value) return (kvp_value_get_string(value)); - } - return NULL; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountSetQuoteTZ(Account *acc, const char *tz) -{ - if(!acc) return; - if(!tz) return; - - xaccAccountBeginEdit(acc); - { - GNCAccountType t = xaccAccountGetType(acc); - - if((t == STOCK) || (t == MUTUAL) || (t == CURRENCY)) { - kvp_frame_set_slot_nc(acc->kvp_data, - "old-quote-tz", - kvp_value_new_string(tz)); - mark_account (acc); - } - } - acc->core_dirty = TRUE; - xaccAccountCommitEdit(acc); -} - -/********************************************************************\ -\********************************************************************/ - -const char* -xaccAccountGetQuoteTZ(Account *acc) -{ - GNCAccountType t; - if(!acc) return NULL; - - t = xaccAccountGetType(acc); - if((t == STOCK) || (t == MUTUAL) || (t == CURRENCY)) - { - kvp_value *value = kvp_frame_get_slot(acc->kvp_data, "old-quote-tz"); - if(value) return (kvp_value_get_string(value)); - } - return NULL; -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccAccountVisitUnvisitedTransactions(Account *acc, - gboolean (*proc)(Transaction *t, - void *data), - void *data, - GHashTable *visited_txns) { - gboolean keep_going = TRUE; - GList *lp; - - if(!acc) return(FALSE); - if(!proc) return(FALSE); - if(!visited_txns) return(FALSE); - - for(lp = xaccAccountGetSplitList(acc); lp && keep_going; lp = lp->next) { - Split *s = (Split *) lp->data; - Transaction *t = xaccSplitGetParent(s); - - if(t) { - const GUID *guid = xaccTransGetGUID(t); - gpointer been_here = g_hash_table_lookup(visited_txns, guid); - - if(!GPOINTER_TO_INT(been_here)) { - g_hash_table_insert(visited_txns, (gpointer) guid, - GINT_TO_POINTER(TRUE)); - if(!proc(t, data)) { - keep_going = FALSE; - } - } - } - } - return(keep_going); -} - -gboolean -xaccAccountForEachTransaction(Account *acc, - gboolean (*proc)(Transaction *t, void *data), - void *data) { - GHashTable *visited_txns = NULL; - gboolean result = FALSE; - - if(!acc) return(FALSE); - if(!proc) return(FALSE); - - visited_txns = guid_hash_table_new(); - if(visited_txns) { - result = - xaccAccountVisitUnvisitedTransactions(acc, proc, data, visited_txns); - } - - /* cleanup */ - if(visited_txns) g_hash_table_destroy(visited_txns); - return(result); -} - -/********************************************************************\ -\********************************************************************/ - -/* The caller of this function can get back one or both of the - * matching split and transaction pointers, depending on whether - * a valid pointer to the location to store those pointers is - * passed. - */ -static void -finder_help_function(Account *account, - const char *description, - Split **split, - Transaction **trans ) -{ - GList *slp; - - if (account == NULL) return; - - for (slp = g_list_last (xaccAccountGetSplitList (account)); - slp; - slp = slp->prev) - { - Split *lsplit = slp->data; - Transaction *ltrans = xaccSplitGetParent(lsplit); - - if (safe_strcmp (description, xaccTransGetDescription (ltrans)) == 0) - { - if( split ) *split = lsplit; - if( trans ) *trans = ltrans; - return; - } - } - - if( split ) *split = NULL; - if( trans ) *trans = NULL; -} - -Split * -xaccAccountFindSplitByDesc(Account *account, const char *description) -{ - Split *split; - - /* Get the split which has a transaction matching the description. */ - finder_help_function(account, description, &split, NULL ); - - return( split ); -} - -/* This routine is for finding a matching transaction in an account by - * matching on the description field. This routine is used for auto-filling - * in registers with a default leading account. The dest_trans is a - * transaction used for currency checking. */ -Transaction * -xaccAccountFindTransByDesc(Account *account, const char *description) -{ - Transaction *trans; - - /* Get the transation matching the description. */ - finder_help_function(account, description, NULL, &trans ); - - return( trans ); -} - -/********************************************************************\ -\********************************************************************/ diff --git a/src/engine/Account.h b/src/engine/Account.h deleted file mode 100644 index 382c468b0c..0000000000 --- a/src/engine/Account.h +++ /dev/null @@ -1,375 +0,0 @@ -/********************************************************************\ - * Account.h -- Account handling public routines * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997-2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_ACCOUNT_H -#define XACC_ACCOUNT_H - -#include "config.h" - -#include "GNCId.h" -#include "Transaction.h" -#include "kvp_frame.h" - - -/** PROTOTYPES ******************************************************/ - -/* - * The account types are used to determine how the transaction data - * in the account is displayed. These values can be safely changed - * from one release to the next. Note that if values are added, - * the file IO translation routines need to be updated. Note - * also that GUI code depends on these numbers. - * - * ***IMPORTANT***: If you do change the enumeration names (not the - * numbers), you need to update xaccAccountTypeEnumAsString --- used - * for text file exports */ - -typedef enum -{ - BAD_TYPE = -1, - NO_TYPE = -1, - /* Not a type */ - - BANK = 0, - /* The bank account type denotes a savings or checking account - * held at a bank. Often interest bearing. - */ - - CASH = 1, - /* The cash account type is used to denote a shoe-box or pillowcase - * stuffed with cash. - */ - - CREDIT = 3, - /* The Credit card account is used to denote credit (e.g. amex) and - * debit (e.g. visa, mastercard) card accounts - */ - - ASSET = 2, - LIABILITY = 4, - /* asset and liability accounts indicate generic, generalized accounts - * that are none of the above. - */ - - STOCK = 5, - MUTUAL= 6, - /* Stock and Mutual Fund accounts will typically be shown in registers - * which show three columns: price, number of shares, and value. - */ - - CURRENCY = 7, - /* The currency account type indicates that the account is a - * currency trading account. In many ways, a currency trading - * account is like a stock trading account, where both values - * and share quantities are set. - */ - - INCOME = 8, - EXPENSE = 9, - /* Income and expense accounts are used to denote income and expenses. */ - - EQUITY = 10, - /* Equity account is used to balance the balance sheet. */ - - NUM_ACCOUNT_TYPES = 11, - /* stop here; the following types just aren't ready for prime time */ - - /* bank account types */ - CHECKING = 11, - SAVINGS = 12, - MONEYMRKT = 13, - CREDITLINE = 14, /* line of credit */ -} GNCAccountType; - -const char * xaccAccountGetTypeStr (GNCAccountType type); /* GUI names */ - -/* Conversion routines for the account types to/from strings. - * Critical for the text communication mechanisms. i.e. INCOME -> - * "INCOME". */ -char * xaccAccountTypeEnumAsString (GNCAccountType type); -gboolean xaccAccountStringToType (const char* str, GNCAccountType *type); -GNCAccountType xaccAccountStringToEnum (const char* str); - -/* Return TRUE if accounts of type parent_type can have accounts - * of type child_type as children. */ -gboolean xaccAccountTypesCompatible (GNCAccountType parent_type, - GNCAccountType child_type); - -/* Compare two accounts for equality - this is a deep compare. */ -gboolean xaccAccountEqual(Account *a, Account* b, gboolean check_guids); - -/* - * The xaccAccountBeginEdit() and xaccAccountCommitEdit() subroutines - * provide a two-phase-commit wrapper for account updates. - * They are incompletely implemented. - * - * The xaccAccountDestroy() routine can be used to get rid of an - * account. The account should have been opened for editing - * (by calling xaccAccountBeginEdit()) before calling this routine. - */ -Account * xaccMallocAccount (void); -Account * xaccCloneAccountSimple(const Account *from); -void xaccAccountBeginEdit (Account *account); -void xaccAccountCommitEdit (Account *account); -void xaccAccountDestroy (Account *account); - -kvp_frame * xaccAccountGetSlots (Account *account); -void xaccAccountSetSlots_nc(Account *account, kvp_frame *frame); - -/* - * The xaccAccountGetGUID() subroutine will return the - * globally unique id associated with that account. - * - * The xaccAccountLookup() subroutine will return the - * account associated with the given id, or NULL - * if there is no such account. - */ -const GUID * xaccAccountGetGUID (Account *account); -Account * xaccAccountLookup (const GUID *guid); - -/* - * The xaccAccountInsertSplit() method will insert the indicated - * split into the indicated account. If the split already - * belongs to another account, it will be removed from that - * account first. - */ -void xaccAccountInsertSplit (Account *account, Split *split); - -/* The xaccAccountFixSplitDateOrder() subroutine checks to see if - * a split is in proper sorted date order with respect - * to the other splits in this account. - * - * The xaccTransFixSplitDateOrder() checks to see if - * all of the splits in this transaction are in - * proper date order. - */ -void xaccAccountFixSplitDateOrder (Account *account, Split *split); -void xaccTransFixSplitDateOrder (Transaction *trans); - -/* The xaccAccountOrder() subroutine defines a sorting order - * on accounts. It takes pointers to two accounts, and - * returns -1 if the first account is "less than" the second, - * returns +1 if the first is "greater than" the second, and - * 0 if they are equal. To determine the sort order, first - * the account codes are compared, and if these are equal, then - * account types, and, if these are equal, the account names. - */ -int xaccAccountOrder (Account **account_1, Account **account_2); - -void xaccAccountSetType (Account *account, int); -void xaccAccountSetName (Account *account, const char *name); -void xaccAccountSetCode (Account *account, const char *code); -void xaccAccountSetDescription (Account *account, const char *desc); -void xaccAccountSetNotes (Account *account, const char *notes); - -GNCAccountType xaccAccountGetType (Account *account); -const char * xaccAccountGetName (Account *account); -const char * xaccAccountGetCode (Account *account); -const char * xaccAccountGetDescription (Account *account); -const char * xaccAccountGetNotes (Account *account); - -/* New commodity access routines. - * - * The account structure no longer stores two commodities ('currency' - * and 'security'). Instead it stores only one commodity, that is the - * one formerly known as 'security'. Use xaccAccountSetCommodity() - * and xaccAccountGetCommodity() to set and fetch it. - * - * Basically, the engine eliminates the 'currency' field of the - * Account structure. Instead, the common currency is stored with the - * transaction. The 'value' of a split is a translation of the - * Split's 'amount' (which is the amount of the Account's commodity - * involved) into the Transaction's balancing currency. */ -void xaccAccountSetCommodity (Account *account, gnc_commodity *comm); -gnc_commodity * xaccAccountGetCommodity (Account *account); -int xaccAccountGetCommoditySCU (Account *account); -void xaccAccountSetCommoditySCU (Account *account, int frac); - -/* Deprecated currency/security access routines. - * The current API associates only one thing with an account: - * the 'commodity'. Use xaccAccountGetCommodity() to fetch it. - */ -/* these two funcs take control of their gnc_commodity args. Don't free */ -void DxaccAccountSetCurrency (Account *account, gnc_commodity *currency); -void DxaccAccountSetSecurity (Account *account, gnc_commodity *security); -gnc_commodity * DxaccAccountGetCurrency (Account *account); -gnc_commodity * DxaccAccountGetSecurity (Account *account); -void DxaccAccountSetCurrencySCU (Account *account, int frac); -int DxaccAccountGetCurrencySCU (Account *account); - -/* Delete any old data in the account's kvp data. - * This includes the old currency and security fields. */ -void xaccAccountDeleteOldData (Account *account); - -AccountGroup * xaccAccountGetChildren (Account *account); -AccountGroup * xaccAccountGetParent (Account *account); -Account * xaccAccountGetParentAccount (Account *account); - -gnc_numeric xaccAccountGetBalance (Account *account); -gnc_numeric xaccAccountGetClearedBalance (Account *account); -gnc_numeric xaccAccountGetReconciledBalance (Account *account); - -gnc_numeric xaccAccountGetBalanceAsOfDate (Account *account, time_t date); - -GList* xaccAccountGetSplitList (Account *account); - -gboolean xaccAccountGetTaxRelated (Account *account); -void xaccAccountSetTaxRelated (Account *account, - gboolean tax_related); - -const char * xaccAccountGetTaxUSCode (Account *account); -void xaccAccountSetTaxUSCode (Account *account, const char *code); -const char * xaccAccountGetTaxUSPayerNameSource (Account *account); -void xaccAccountSetTaxUSPayerNameSource (Account *account, - const char *source); - -/* The xaccAccountGetFullName routine returns the fully qualified name - * of the account using the given separator char. The name must be freed - * after use. The fully qualified name of an account is the concatenation - * of the names of the account and all its ancestor accounts starting with - * the topmost account and ending with the given account. Each name is - * separated by the given character. - * - * WAKE UP! - * Unlike all other gets, the string returned by xaccAccountGetFullName() - * must be freed by you the user !!! - * hack alert -- since it breaks the rule of string allocation, maybe this - * routine should not be in this library, but some utility library? - */ -char * xaccAccountGetFullName (Account *account, const char separator); - -/* Returns true if the account has 'ancestor' as an ancestor. - * Returns false if either is NULL. */ -gboolean xaccAccountHasAncestor (Account *account, Account *ancestor); - -/* Get and Set a mark on the account. The meaning of this mark is - * completely undefined. Its presented here as a utility for the - * programmer, to use as desired. Handy for performing customer traversals - * over the account tree. The mark is *not* stored in the database/file - * format. When accounts are newly created, the mark is set to zero. - * - * The xaccClearMark will find the topmost group, and clear the mark in - * the entire group tree. - * The xaccClearMarkDown will clear the mark only in this and in - * sub-accounts. - */ -short xaccAccountGetMark (Account *account); -void xaccAccountSetMark (Account *account, short mark); -void xaccClearMark (Account *account, short val); -void xaccClearMarkDown (Account *account, short val); -void xaccClearMarkDownGr (AccountGroup *group, short val); - -/* The following functions get and set reconciliation information */ -gboolean xaccAccountGetReconcileLastDate (Account *account, - time_t *last_date); -void xaccAccountSetReconcileLastDate (Account *account, - time_t last_date); - -gboolean xaccAccountGetReconcilePostponeDate (Account *account, - time_t *postpone_date); -void xaccAccountSetReconcilePostponeDate (Account *account, - time_t postpone_date); - -gboolean xaccAccountGetReconcilePostponeBalance (Account *account, - gnc_numeric *balance); -void xaccAccountSetReconcilePostponeBalance (Account *account, - gnc_numeric balance); - -void xaccAccountClearReconcilePostpone (Account *account); - -gboolean xaccAccountGetAutoInterestXfer (Account *account, gboolean default_value); -void xaccAccountSetAutoInterestXfer (Account *account, gboolean option); - -/* Get and set the last num field of an Account */ -const char * xaccAccountGetLastNum (Account *account); -void xaccAccountSetLastNum (Account *account, const char *num); - -/* The xaccAccountSetPriceSrc() and xaccAccountGetPriceSrc() routines - are used to get and set a string that identifies the Finance::Quote - backend that should be used to retrieve online prices. See - price-quotes.scm for more information. - - xaccAccountGetQuoteTZ() and xaccAccountSetQuoteTZ() set the - timezone to be used when interpreting the results from a given - Finance::Quote backend. Unfortunately, the upstream sources don't - label their output, so the user has to specify this bit. - - Since prices are not going to be stored in the accounts in the - future, and since the whole commodities infrastructure is changing - radically as we speak, this interface is not long for this - world. */ - -void xaccAccountSetPriceSrc (Account *account, const char *src); -const char * xaccAccountGetPriceSrc (Account *account); - -void xaccAccountSetQuoteTZ (Account *account, const char *tz); -const char * xaccAccountGetQuoteTZ (Account *account); - - -typedef gpointer (*SplitCallback)(Split *s, gpointer data); -gpointer xaccAccountForEachSplit(Account *account, - SplitCallback, - gpointer data); - -/* Traverse all of the transactions in the given account. Continue - processing IFF proc does not return FALSE. This function does not - descend recursively to traverse transactions in child accounts. - - Proc will be called exactly once for each transaction that is - pointed to by at least one split in the given account. - - Note too, that if you call this function on two separate accounts - and those accounts share transactions, proc will be called once per - account for the shared transactions. - - The result of this function will not be FALSE IFF every relevant - transaction was traversed exactly once. */ -typedef gboolean (*TransactionCallback)(Transaction *t, void *data); -gboolean -xaccAccountForEachTransaction(Account *account, - TransactionCallback, - void *data); - -/* Visit every transaction in the account that hasn't already been - visited exactly once. visited_txns must be a hash table created - via guid_hash_table_new() and is the authority about which - transactions have already been visited. Further, when this - procedure returns visited_txns will have been modified to reflect - all the newly visited transactions. - - The result of this function will not be FALSE IFF every relevant - transaction was traversed exactly once. */ -gboolean -xaccAccountVisitUnvisitedTransactions(Account *account, - TransactionCallback, - void *data, - GHashTable *visited_txns); - -/* Returns a pointer to the transaction, not a copy. */ -Transaction * -xaccAccountFindTransByDesc(Account *account, const char *description); -Split * -xaccAccountFindSplitByDesc(Account *account, const char *description); - -#endif /* XACC_ACCOUNT_H */ diff --git a/src/engine/AccountP.h b/src/engine/AccountP.h deleted file mode 100644 index 66d0501460..0000000000 --- a/src/engine/AccountP.h +++ /dev/null @@ -1,207 +0,0 @@ -/********************************************************************\ - * AccountP.h -- Account engine-private data structure * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997-2000, Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * AccountP.h - * - * FUNCTION: - * This is the *private* header for the account structure. - * No one outside of the engine should ever include this file. - * - * This header includes prototypes for "dangerous" functions. - * Invoking any of these functions potentially leave the account - * in an inconsistent state. If they are not used in the proper - * setting, they can leave the account structures in an inconsistent - * state. Thus, these methods should never be used outside of - * the engine, which is why they are "hidden" here. - * - */ - -#ifndef XACC_ACCOUNT_P_H -#define XACC_ACCOUNT_P_H - -#include "config.h" - -#include "Account.h" -#include "GNCId.h" -#include "Transaction.h" -#include "gnc-commodity.h" -#include "gnc-numeric.h" -#include "kvp_frame.h" - - -/** STRUCTS *********************************************************/ -struct _account { - /* public data, describes account */ - GUID guid; /* globally unique account id */ - - /* The accountName is an arbitrary string assigned by the user. - * It is intended to a short, 5 to 30 character long string that - * is displayed by the GUI as the account mnemonic. - */ - char *accountName; - - /* The accountCode is an arbitrary string assigned by the user. - * It is intended to be reporting code that is a synonym for the - * accountName. Typically, it will be a numeric value that follows - * the numbering assignments commonly used by accountants, such - * as 100, 200 or 600 for top-level * accounts, and 101, 102.. etc. - * for detail accounts. - */ - char *accountCode; - - /* The description is an arbitrary string assigned by the user. - * It is intended to be a longer, 1-5 sentence description of what - * this account is all about. - */ - char *description; - - /* kvp_data is a key-value pair database for storing simple "extra" - * information in splits, transactions, and accounts. it's NULL - * until accessed. See ??? for a list and description of the - * important keys. */ - kvp_frame * kvp_data; - - /* The type field is the account type, picked from the enumerated - * list that includes BANK, STOCK, CREDIT, INCOME, etc. Its - * intended use is to be a hint to the GUI as to how to display - * and format the transaction data. - */ - GNCAccountType type; - - /* Old semantics: The currency field denotes the default currency in - * which all splits in this account are denominated. Currency - * trading accounts allow splits between accounts when the currency - * string matches the security string. - * - * The gnc_commodity type represents the namespace, full name, and - * symbol for the currency. - * - * New semantics: The account structure will no longer store a - * 'currency' and a 'security'. Instead it will store only one - * commodity (i.e. currency), that is the one formerly known as - * 'security'. The 'amount' of each split represents the - * transferred amount in the account's commodity (formerly known as - * security). - */ - gnc_commodity * commodity; - int commodity_scu; - - /* The parent and children pointers are used to implement an account - * hierarchy, of accounts that have sub-accounts ("detail accounts"). - */ - AccountGroup *parent; /* back-pointer to parent */ - AccountGroup *children; /* pointer to sub-accounts */ - - /* protected data, cached parameters */ - gnc_numeric starting_balance; - gnc_numeric starting_cleared_balance; - gnc_numeric starting_reconciled_balance; - - gnc_numeric balance; - gnc_numeric cleared_balance; - gnc_numeric reconciled_balance; - - /* version number, used for tracking multiuser updates */ - gint32 version; - guint32 version_check; /* data aging timestamp */ - - GList *splits; /* list of split pointers */ - - /* keep track of nesting level of begin/end edit calls */ - gint32 editlevel; - - gboolean balance_dirty; /* balances in splits incorrect */ - gboolean sort_dirty; /* sort order of splits is bad */ - gboolean core_dirty; /* fields in this struct have changed */ - gboolean do_free; /* in process of being destroyed */ - - /* The "mark" flag can be used by the user to mark this account - * in any way desired. Handy for specialty traversals of the - * account tree. */ - short mark; - - /* -------------------------------------------------------------- */ - /* Backend private expansion data */ - guint32 idata; /* used by the sql backend for kvp management */ -}; - - -/* The xaccAccountRemoveSplit() routine will remove the indicated split - * from the indicated account. Note that this will leave the split - * "dangling", i.e. unassigned to any account, and therefore will put - * the engine into an inconsistent state. After removing a split, - * it should be immediately destroyed, or it should be inserted into - * an account. - */ -void xaccAccountRemoveSplit (Account *, Split *); - -/* the following recompute the partial balances (stored with the - * transaction) and the total balance, for this account */ -void xaccAccountRecomputeBalance (Account *); - -/* Set the account's GUID. This should only be done when reading - * an account from a datafile, or some other external source. Never - * call this on an existing account! */ -void xaccAccountSetGUID (Account *account, const GUID *guid); - -/* The xaccAccountSetStartingBalance() routine will set the starting - * commodity balance for this account. This routine is intended for - * use with backends that do not return the complete list of splits - * for an account, but rather return a partial list. In such a case, - * the backend will typically return all of the splits after some - * certain date, and the 'starting balance' will represent the summation - * of the splits up to that date. - * - * Design Note: this routine assumes that there is only one commodity - * associated with this account, and that the reporting currency will - * no longer be stored with the account. - * - * This routine is in the private .h file because only backends are - * allowed to set the starting balance. This is *not* a user interface - * function. - */ -void xaccAccountSetStartingBalance(Account *account, - const gnc_numeric start_baln, - const gnc_numeric start_cleared_baln, - const gnc_numeric start_reconciled_baln); - -/* The xaccFreeAccount() routine releases memory associated with the - * account. It should never be called directly from user code; - * instead, the xaccAccountDestroy() routine should be used - * (because xaccAccountDestroy() has the correct commit semantics). - */ - -void xaccFreeAccount (Account *account); - -/* The xaccAccountSet/GetVersion() routines set & get the version - * numbers on this account. The version number is used to manage - * multi-user updates. These routines are private because we don't - * want anyone except the backend to mess with them. - */ -void xaccAccountSetVersion (Account*, gint32); -gint32 xaccAccountGetVersion (Account*); - -#endif /* XACC_ACCOUNT_P_H */ diff --git a/src/engine/Backend.c b/src/engine/Backend.c deleted file mode 100644 index 3e5e45a212..0000000000 --- a/src/engine/Backend.c +++ /dev/null @@ -1,207 +0,0 @@ -/********************************************************************\ - * Backend.c -- utility routines for dealing with the data backend * - * Copyright (C) 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include - -#include "Account.h" -#include "AccountP.h" -#include "BackendP.h" -#include "Group.h" -#include "GroupP.h" -#include "gnc-engine-util.h" -#include "gnc-pricedb.h" -#include "gnc-pricedb-p.h" -#include "TransactionP.h" - -/* static short module = MOD_ENGINE; */ - -/********************************************************************\ - * error handling * -\********************************************************************/ - -void -xaccBackendSetError (Backend *be, GNCBackendError err) -{ - if (!be) return; - - /* use stack-push semantics. Only the earliest error counts */ - if (ERR_BACKEND_NO_ERR != be->last_err) return; - be->last_err = err; -} - -GNCBackendError -xaccBackendGetError (Backend *be) -{ - GNCBackendError err; - if (!be) return ERR_BACKEND_NO_BACKEND; - - /* use 'stack-pop' semantics */ - err = be->last_err; - be->last_err = ERR_BACKEND_NO_ERR; - return err; -} - - -/********************************************************************\ - * Fetch the backend * -\********************************************************************/ - -Backend * -xaccAccountGetBackend (Account * acc) -{ - Account *parent_acc; - AccountGroup * grp; - - if (!acc) return NULL; - - /* find the first account group that has a backend */ - grp = acc->parent; - while (grp) { - if (grp->backend) return (grp->backend); - parent_acc = grp -> parent; - grp = NULL; - if (parent_acc) { - grp = parent_acc->parent; - } - } - return NULL; -} - -/********************************************************************\ - * Fetch the backend * -\********************************************************************/ - -Backend * -xaccTransactionGetBackend (Transaction *trans) -{ - GList *snode, *node; - Split *s=NULL; - - if (!trans) return NULL; - - /* find an account */ - snode = xaccTransGetSplitList(trans); - for (node = snode; node; node=node->next) - { - s = node->data; - if (xaccSplitGetAccount(s)) break; - s = NULL; - } - - /* if transaction is being deleted, it won't have any splits - * so lets take a look at the 'original' transaction */ - if (!s) - { - snode = xaccTransGetSplitList(trans->orig); - for (node = snode; node; node=node->next) - { - s = node->data; - if (xaccSplitGetAccount(s)) break; - s = NULL; - } - } - if (!s) return NULL; - - /* I suppose it would be more 'technically correct' to make sure that - * all splits share the same backend, and flag an error if they - * don't. However, at this point, it seems quite unlikely, so we'll - * just use the first backend we find. - */ - return xaccAccountGetBackend (xaccSplitGetAccount(s)); -} - -/********************************************************************\ - * Set the backend * -\********************************************************************/ - -void -xaccGroupSetBackend (AccountGroup *grp, Backend *be) -{ - if (!grp) return; - grp->backend = be; -} - -Backend * -xaccGroupGetBackend (AccountGroup *grp) -{ - while (grp) - { - Account *parent; - if (grp->backend) return (grp->backend); - parent = grp->parent; - if (!parent) return NULL; - grp = parent->parent; - } - return NULL; -} - -/********************************************************************\ - * Set the backend * -\********************************************************************/ - -void -xaccPriceDBSetBackend (GNCPriceDB *prdb, Backend *be) -{ - if (!prdb) return; - prdb->backend = be; -} - -Backend * -xaccPriceDBGetBackend (GNCPriceDB *prdb) -{ - if (!prdb) return NULL; - return prdb->backend; -} - -/***********************************************************************/ -/* Get a clean backend */ -void -xaccInitBackend(Backend *be) -{ - be->book_begin = NULL; - be->book_load = NULL; - be->price_load = NULL; - be->book_end = NULL; - be->destroy_backend = NULL; - - be->account_begin_edit = NULL; - be->account_commit_edit = NULL; - be->trans_begin_edit = NULL; - be->trans_commit_edit = NULL; - be->trans_rollback_edit = NULL; - be->price_begin_edit = NULL; - be->price_commit_edit = NULL; - - be->run_query = NULL; - be->price_lookup = NULL; - be->all_sync = NULL; - be->sync = NULL; - be->sync_price = NULL; - - be->events_pending = NULL; - be->process_events = NULL; - - be->last_err = ERR_BACKEND_NO_ERR; -} - -/************************* END OF FILE ********************************/ diff --git a/src/engine/Backend.h b/src/engine/Backend.h deleted file mode 100644 index 88f95a80be..0000000000 --- a/src/engine/Backend.h +++ /dev/null @@ -1,96 +0,0 @@ -/********************************************************************\ - * Backend.h -- api for engine Backend * - * * - * Copyright (c) 2000, 2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * Backend.h - * - * FUNCTION: - * The 'backend' is a pseudo-object providing an interface between the - * engine and a persistant data store (e.g. a server, a database, or - * a file). There are no backend functions that are 'public' to - * users of the engine. The backend can, however, report errors to - * the GUI & other front-end users. This file defines these errors. - */ - -#ifndef XACC_BACKEND_H -#define XACC_BACKEND_H - -#include "config.h" - -/* NOTE: if you modify GNCBackendError, please update src/scm/gnc.gwp */ -typedef enum { - ERR_BACKEND_NO_ERR = 0, - ERR_BACKEND_NO_BACKEND, /* Backend * pointer was null the err routine */ - /* or no backend handler (ENOSYS) */ - ERR_BACKEND_BAD_URL, /* Can't parse url */ - ERR_BACKEND_NO_SUCH_DB, /* the named database doesn't exist */ - ERR_BACKEND_CANT_CONNECT, /* bad dbname/login/passwd or network failure */ - ERR_BACKEND_CONN_LOST, /* Lost connection to server */ - ERR_BACKEND_LOCKED, /* in use by another user (ETXTBSY) */ - ERR_BACKEND_TOO_NEW, /* file/db version newer than what we can read */ - ERR_BACKEND_DATA_CORRUPT, /* data in db is corrupt */ - ERR_BACKEND_SERVER_ERR, /* error in response from server */ - ERR_BACKEND_ALLOC, /* internal memory allocation failure */ - ERR_BACKEND_PERM, /* user login successful, but no permissions - * to access the desired object */ - ERR_BACKEND_MODIFIED, /* commit of object update failed because - * another user has modified the object */ - ERR_BACKEND_MOD_DESTROY, /* commit of object update failed because - * another user has deleted the object */ - ERR_BACKEND_MISC, /* undetermined error */ - - /* fileio errors */ - ERR_FILEIO_FILE_BAD_READ = 1000, /* read failed or file prematurely truncated */ - ERR_FILEIO_FILE_EMPTY, /* file exists, is readable, but is empty */ - ERR_FILEIO_FILE_LOCKERR, /* mangled locks (unspecified error) */ - ERR_FILEIO_FILE_NOT_FOUND, /* not found / no such file */ - ERR_FILEIO_FILE_TOO_OLD, /* file version so old we can't read it */ - ERR_FILEIO_UNKNOWN_FILE_TYPE, - - /* network errors */ - ERR_NETIO_SHORT_READ = 2000, /* not enough bytes received */ - ERR_NETIO_WRONG_CONTENT_TYPE, /* wrong kind of server, wrong data served */ - ERR_NETIO_NOT_GNCXML, /* whatever it is, we can't parse it. */ - - /* database errors */ - ERR_SQL_MISSING_DATA = 3000, /* database doesn't contain expected data */ - ERR_SQL_DB_TOO_OLD, /* database is old and needs upgrading */ - ERR_SQL_DB_BUSY, /* database is busy, cannot upgrade version */ - - /* RPC errors */ - ERR_RPC_HOST_UNK = 4000, /* Host unknown */ - ERR_RPC_CANT_BIND, /* can't bind to address */ - ERR_RPC_CANT_ACCEPT, /* can't accept connection */ - ERR_RPC_NO_CONNECTION, /* no connection to server */ - ERR_RPC_BAD_VERSION, /* RPC Version Mismatch */ - ERR_RPC_FAILED, /* Operation failed */ - ERR_RPC_NOT_ADDED, /* object not added */ - -} GNCBackendError; -/* NOTE: if you modify GNCBackendError, please update src/scm/gnc.gwp */ - -typedef struct _backend Backend; - -#endif /* XACC_BACKEND_H */ diff --git a/src/engine/BackendP.h b/src/engine/BackendP.h deleted file mode 100644 index 6669cd190b..0000000000 --- a/src/engine/BackendP.h +++ /dev/null @@ -1,230 +0,0 @@ -/********************************************************************\ - * Backend.h -- private api for engine Backend * - * * - * Copyright (c) 2000, 2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * BackendP.h - * - * FUNCTION: - * Pseudo-object defining how the engine can interact with different - * back-ends (which may be SQL databases, or network interfaces to - * remote GnuCash servers. In theory, file-io should be a type of - * backend). - * - * The callbacks will be called at the appropriate times during - * a book session to allow the backend to store the data as needed. - * - */ - -#ifndef XACC_BACKEND_P_H -#define XACC_BACKEND_P_H - -#include "config.h" - -#include "Account.h" -#include "Backend.h" -#include "Group.h" -#include "Query.h" -#include "Transaction.h" -#include "gnc-book.h" -#include "gnc-pricedb.h" - -/* - * The book_begin() routine gives the backend a second initialization - * opportunity. It is suggested that the backend check that - * the URL is syntactically correct, and that it is actually - * reachable. This is probably(?) a good time to initialize - * the actual network connection. - * - * The 'ignore_lock' argument indicates whether the single-user - * lock on the backend should be cleared. The typical GUI sequence - * leading to this is: (1) GUI attempts to open the backend - * by calling this routine with FALSE==ignore_lock. (2) If backend - * error'ed BACKEND_LOCK, then GUI asks user what to do. (3) if user - * answers 'break & enter' then this routine is called again with - * TRUE==ignore_lock. - * - * The 'create_if_nonexistent' argument indicates whether this - * routine should create a new 'database', if it doesn't already - * exist. For example, for a file-backend, this would create the - * file, if it didn't already exist. For an SQL backend, this - * would create the database (the schema) if it didn't already - * exist. This flag is used to implement the 'SaveAs' GUI, where - * the user requests to save data to a new backend. - * - * The book_load() routine should return at least an account tree, - * and all currencies. It does not have to return any transactions - * whatsoever, as these are obtained at a later stage when a user - * opens a register, resulting in a query being sent to the backend. - * - * (Its OK to send over transactions at this point, but one should - * be careful of the network load; also, its possible that whatever - * is sent is not what the user wanted anyway, which is why its - * better to wait for the query). - * - * The trans_commit_edit() routine takes two transaction arguments: - * the first is the proposed new transaction; the second is the - * 'original' transaction. The second argument is here for - * convenience; it had better be substantially equivalent to - * the argument for the trans_begin_edit() callback. (It doesn't - * have to be identical, it can be a clone). - * - * The trans_rollback_edit() routine is invoked in one of two different - * ways. In one case, the user may hit 'undo' in the GUI, resulting - * in xaccTransRollback() being called, which in turn calls this - * routine. In this manner, xaccTransRollback() implements a - * single-level undo convenience routine for the GUI. The other - * way in which this routine gets invoked involves conflicting - * edits by two users to the same transaction. The second user - * to make an edit will typically fail in trans_commit_edit(), - * with trans_commit_edit() returning an error code. This - * causes xaccTransCommitEdit() to call xaccTransRollback() - * which in turn calls this routine. Thus, this routine - * gives the backend a chance to clean up failed commits. - * - * If the second user tries to modify a transaction that - * the first user deleted, then the backend should set the error - * to ERR_BACKEND_MOD_DESTROY from this routine, so that the - * engine can properly clean up. - * - * The run_query() callback takes a GnuCash query object. - * For an SQL backend, the contents of the query object need to - * be turned into a corresponding SQL query statement, and sent - * to the database for evaluation. The database will return a - * set of splits and transactions, and this callback needs - * to poke these into the account-group hierarchy held by the - * query object. - * - * For a network-communications backend, essentially the same is - * done, except that this routine would convert the query to wire - * protocol, get an answer from the remote server, and push that - * into the account-group object. - * - * Note a peculiar design decision we've used here. The query - * callback has returned a list of splits; these could be returned - * directly to the caller. They are not. By poking them into the - * existing account hierarchy, we are essentially building a local - * cache of the split data. This will allow the GnuCash client to - * continue functioning even when disconnected from the server: - * this is because it will have its local cache of data to work from. - * - * The sync() routine synchronizes the engine contents to the backend. - * This is done by using version numbers (hack alert -- the engine - * does not currently contain version numbers). - * If the engine contents are newer than what's in the backend, the - * data is stored to the backend. If the engine contents are older, - * then the engine contents are updated. - * - * Note that this sync operation is only meant to apply to the - * current contents of the engine. This routine is not intended - * to be used to fetch account/transaction data from the backend. - * (It might pull new splits from the backend, if this is what is - * needed to update an existing transaction. It might pull new - * currencies (??)) - * - * The events_pending() routines should return true if there are - * external events which need to be processed to bring the - * engine up to date with the backend. - * - * The process_events() routine should process any events indicated - * by the events_pending() routine. It should return TRUE if - * the engine was changed while engine events were suspended. - * - * The last_err member indicates the last error that occurred. - * It should probably be implemented as an array (actually, - * a stack) of all the errors that have occurred. - */ - -struct _backend -{ - void (*book_begin) (Backend *be, GNCBook *book, const char *book_id, - gboolean ignore_lock, gboolean create_if_nonexistent); - AccountGroup * (*book_load) (Backend *); - GNCPriceDB * (*price_load) (Backend *); - void (*book_end) (Backend *); - void (*destroy_backend) (Backend *); - - void (*account_begin_edit) (Backend *, Account *); - void (*account_commit_edit) (Backend *, Account *); - void (*trans_begin_edit) (Backend *, Transaction *); - void (*trans_commit_edit) (Backend *, Transaction *new, Transaction *orig); - void (*trans_rollback_edit) (Backend *, Transaction *); - - void (*price_begin_edit) (Backend *, GNCPrice *); - void (*price_commit_edit) (Backend *, GNCPrice *); - - void (*run_query) (Backend *, Query *); - void (*price_lookup) (Backend *, GNCPriceLookup *); - void (*all_sync) (Backend *, AccountGroup *, GNCPriceDB *); - void (*sync) (Backend *, AccountGroup *); - void (*sync_price) (Backend *, GNCPriceDB *); - - gboolean (*events_pending) (Backend *be); - gboolean (*process_events) (Backend *be); - - GNCBackendError last_err; -}; - -/* - * The xaccBackendSetError() routine pushes an error code onto the error - * stack. (FIXME: the stack is 1 deep in current implementation). - * - * The xaccBackendGetError() routine pops an error code off the error - * stack. - */ - -void xaccBackendSetError (Backend *be, GNCBackendError err); -GNCBackendError xaccBackendGetError (Backend *be); - -/* - * The xaccGetAccountBackend() subroutine will find the - * persistent-data storage backend associated with this account. - * This routine traverses up the account hierarchy until it - * finds and account-group node that has a backend associated with - * it. The assumption is that all accounts in that account-group - * share a common back-end. - * - * The xaccGetTransactionBackend() subroutine does the same, for a given - * transaction. - */ - -Backend * xaccAccountGetBackend (Account *account); -Backend * xaccTransactionGetBackend (Transaction *trans); - -/* - * The xaccGroupSetBackend() associates a backend to a group - */ -void xaccGroupSetBackend (AccountGroup *group, Backend *be); -Backend * xaccGroupGetBackend (AccountGroup *group); -Backend * xaccGNCBookGetBackend (GNCBook *book); - -/* - * Put a link to the backend that handles this pricedb - */ -void xaccPriceDBSetBackend (GNCPriceDB *prdb, Backend *be); -Backend * xaccPriceDBGetBackend (GNCPriceDB *prdb); - -void xaccInitBackend(Backend *be); - -#endif /* XACC_BACKEND_P_H */ diff --git a/src/engine/DateUtils.c b/src/engine/DateUtils.c deleted file mode 100644 index 99f3a4c16b..0000000000 --- a/src/engine/DateUtils.c +++ /dev/null @@ -1,71 +0,0 @@ -/********************************************************************\ - * DateUtils.c -- Date Handling Utilities * - * Copyright (C) 1998 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "DateUtils.h" - -#define BUFFSIZE 100 - - -/* ======================================================== */ -char * -xaccDateUtilGetStamp (time_t thyme) -{ - struct tm *stm; - char buf[BUFFSIZE]; - char * retval; - - stm = localtime (&thyme); - - sprintf (buf, "%04d%02d%02d%02d%02d%02d", - (stm->tm_year + 1900), - (stm->tm_mon +1), - stm->tm_mday, - stm->tm_hour, - stm->tm_min, - stm->tm_sec - ); - - retval = g_strdup (buf); - return retval; -} - -/* ======================================================== */ - -char * -xaccDateUtilGetStampNow (void) -{ - time_t now; - time (&now); - return xaccDateUtilGetStamp (now); -} - -/************************ END OF ************************************\ -\************************* FILE *************************************/ diff --git a/src/engine/FreqSpec.c b/src/engine/FreqSpec.c deleted file mode 100644 index 14af38b494..0000000000 --- a/src/engine/FreqSpec.c +++ /dev/null @@ -1,878 +0,0 @@ -/********************************************************************\ - * FreqSpec.c -- Frequency specifier implementation. * - * Copyright (C) 2001 Joshua Sled * - * Copyright (C) 2001 Ben Stanley * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/********************************************************************\ - Current status - All kinds of repeats work, including composites. This is tested - - although composites need some more test cases to be put into the test - suite - ../test/test-freq-spec.c - FreqSpec objects are currently 'set' to give them the information - they need. Separate methods for modifying currently existing FreqSpec - objects are not provided. In the case of composites, you may add FreqSpec - objects to a composite, and you may access a list of the FreqSpec objects - which form the composite. This interface allows you to do damage... - - TODO list - Ben Stanley 2001-04-02 - * Write xaccFreqSpecGetFreqStr (I wonder how this will be - internationalised... I suspect that this code will need to be - re-written for each language, because the code will have to - generate grammar... It's more than just translating strings.) - However, the first priority is to write one that works for - English. - * Write a function to allow you to query whether a given - date forms part of the recurrence. - * Write a method to get the previous recurrence - * provide XML Load/Save functionality for this object. - * Figure out xaccFreqSpecIsValidDate - I suspect that this is the - 'query whether a given date forms part of the recurrence' - above. - * FIGURE OUT WHAT'S GOING ON WITH xaccFreqSpecGetUIType AND - xaccFreqSpecSetUIType. - * Try to reduce the size of the data structure. There are quite a few - 32 bit fields which could be stored in about 8 bits. - * Add public methods to allow for recurrences with an interval - of 1 to be set without reference to an initial 'date' - monthly - things in particular. Try to reduce the dependence on an initial - date for the input to set up the recurrence. - - Questions: - Is it best that the public interface stay as GDate, or should it - really be a timespec? I have no problem with converting GDates to - timespecs for load/save if that makes life easier. - - However, I chose to use GDate internally because I have used a *lot* - of the date calculating ability of GDate in the internal implementation. - GDate has simplified this work enormously compared to using struct tm - and time_t. The engine's timespec object doesn't appear to have the - required functionality either, so I would need to write the required - functions for timespec (perhaps by implementing in terms of GDate?). - - Hopefully it's not too painful to leave GDate in the public interface - and change other code to use it. -\********************************************************************/ - -#include "config.h" - -/* #include // should be config'd */ - -#include -#include - -#include "FreqSpecP.h" -#include "GNCIdP.h" -/*#include "Transaction.h"*/ -/*#include "TransactionP.h"*/ -#include "date.h" -#include "gnc-engine-util.h" -#include "gnc-event-p.h" -#include "messages.h" - -/* I have done this to prevent compiler warnings... - * This is used to convert a const GDate* to a GDate* for passing - * to the glib g_date_xxx functions which don't use const... - * Strangely, most of the rest of glib does use const, so - * perhaps this will change? When it does, just define this macro to - * nothing and the compiler will check the constness of each pointer.... - */ -#define CONST_HACK (GDate*) - -static short module = MOD_SX; - -/** PROTOTYPES ******************************************************/ - -/** - * Destroys all sub-FreqSpecs in a composite FreqSpec. - * Assertion error if it's not a COMPOSITE FreqSpec. - **/ -void xaccFreqSpecCompositesClear( FreqSpec *fs ); - -void subSpecsListMapDelete( gpointer data, gpointer user_data ); - -/** Local data defs *****/ - -/** - * The number of days in each month. - **/ -struct monthDesc { - char *dshort; - char *dlong; - gint numDays; -}; - -/* This stuff is going to need i18n. - * wouldn't it be simpler to use the system - * date conversion functions? - * glib already knows about this. - * *libc* already knows about this - * and the month names below. Both - * of these should go away! */ -static char *weekDayNames[] = { - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday" -}; - -/* hmmm... glib already knows all about this. */ -struct monthDesc monthInfo[] = { -#define M_JAN 0 - { "Jan", "January", 31 }, -#define M_FEB 1 - { "Feb", "February", 28 }, -#define M_MAR 2 - { "Mar", "March", 31 }, -#define M_APR 3 - { "Apr", "April", 30 }, -#define M_MAY 4 - { "May", "May", 31 }, -#define M_JUN 5 - { "Jun", "June", 30 }, -#define M_JUL 6 - { "Jul", "July", 31 }, -#define M_AUG 7 - { "Aug", "August", 31 }, -#define M_SEP 8 - { "Sep", "September", 30 }, -#define M_OCT 9 - { "Oct", "October", 31 }, -#define M_NOV 10 - { "Nov", "November", 30 }, -#define M_DEC 11 - { "Dec", "December", 31 } -}; - -/** Local Prototypes *****/ -static void xaccFreqSpecInit( FreqSpec *fs ); - -/** - * Initializes a FreqSpec by setting it's to type INVALID. - * Use this to initialise a stack object. - * FreqSpec objects must be initalised before being used by - * any other method. - **/ - -static void -xaccFreqSpecInit( FreqSpec *fs ) -{ - g_return_if_fail( fs ); - xaccGUIDNew( &fs->guid ); - xaccStoreEntity( fs, &fs->guid, GNC_ID_FREQSPEC ); - fs->type = INVALID; - fs->uift = UIFREQ_ONCE; - memset( &(fs->s), 0, sizeof(fs->s) ); -} - -FreqSpec* -xaccFreqSpecMalloc(void) -{ - FreqSpec *fs = g_new0(FreqSpec, 1); - xaccFreqSpecInit( fs ); - /* FIXME:event */ - gnc_engine_generate_event( &fs->guid, GNC_EVENT_CREATE ); - return fs; -} - - -void -xaccFreqSpecCleanUp( FreqSpec *fs ) -{ - g_return_if_fail( fs ); - switch ( fs->type ) { - case INVALID: - case ONCE: - case DAILY: - case WEEKLY: - case MONTHLY: - case MONTH_RELATIVE: - break; - case COMPOSITE: - xaccFreqSpecCompositesClear( fs ); - g_list_free( fs->s.composites.subSpecs ); - break; - default: - g_return_if_fail(FALSE); - } - fs->type = INVALID; -} - -void -xaccFreqSpecFree( FreqSpec *fs ) -{ - if ( fs == NULL ) return; - gnc_engine_generate_event( &fs->guid, GNC_EVENT_DESTROY ); - xaccRemoveEntity( &fs->guid ); - - xaccFreqSpecCleanUp( fs ); - - g_free( fs ); -} - -FreqType -xaccFreqSpecGetType( FreqSpec *fs ) -{ - g_return_val_if_fail( fs, INVALID ); - /* Is this really a fail? */ - g_return_val_if_fail( fs->type != INVALID, INVALID ); - return fs->type; -} - - -UIFreqType -xaccFreqSpecGetUIType( FreqSpec *fs ) -{ - g_return_val_if_fail( fs, INVALID ); - return fs->uift; -} - -void -xaccFreqSpecSetUIType( FreqSpec *fs, UIFreqType newUIFreqType ) -{ - g_return_if_fail( fs ); - fs->uift = newUIFreqType; -} - -/* -void -xaccFreqSpecSetTypes( FreqSpec *fs, FreqType newFT, UIFreqType newUIFT ) -{ - g_return_if_fail( fs ); - xaccFreqSpecSetType( fs, newFT ); - xaccFreqSpecSetUIType( fs, newUIFT ); -} -*/ - -static inline guint32 min( guint32 a, guint32 b ) -{ - return a > b ? b : a; -} - -void -xaccFreqSpecGetNextInstance( - FreqSpec *fs, - const GDate* in_date, - GDate* out_date ) -{ - GList *list, *blist; - int mon; - - g_return_if_fail( fs ); - switch( fs->type ) { - case INVALID: - g_return_if_fail(FALSE); - - case ONCE: - if ( g_date_compare( &(fs->s.once.date), CONST_HACK in_date ) > 0 ) { - *out_date = fs->s.once.date; - } else { - /* Date is past due. Return an invalid date. */ - g_date_clear( out_date, 1 ); - } - break; - - case DAILY: { - guint32 julian_in_date, julian_next_repeat, complete_intervals; - - julian_in_date = g_date_julian( CONST_HACK in_date ); - complete_intervals = - (julian_in_date - fs->s.daily.offset_from_epoch) / - fs->s.daily.interval_days; - julian_next_repeat = - fs->s.daily.offset_from_epoch + - (complete_intervals + 1) * fs->s.daily.interval_days; - g_date_set_julian( out_date, julian_next_repeat ); - } break; - - case WEEKLY: { - /* This implementation stores the offset from epoch as the number - * of days, not week epoch offset and day in week offset. - * It is very similar to the daily repeat representation. */ - guint32 julian_in_date, julian_next_repeat, complete_intervals; - - julian_in_date = g_date_julian( CONST_HACK in_date ); - complete_intervals = - (julian_in_date - fs->s.weekly.offset_from_epoch) / - (fs->s.weekly.interval_weeks * 7); - julian_next_repeat = - fs->s.weekly.offset_from_epoch + - (complete_intervals + 1) * fs->s.weekly.interval_weeks * 7; - g_date_set_julian( out_date, julian_next_repeat ); - - /* This code passes the test, but it seems large and complicated... - * it uses a separate week offset from epoch and day in week offset. */ -/* guint32 julian_in_date, julian_next_repeat, complete_intervals, - in_weeks_from_epoch, after_repeat_in_week_interval; - julian_in_date = g_date_julian( CONST_HACK in_date ); - in_weeks_from_epoch = (julian_in_date-1) / 7; - complete_intervals = - (in_weeks_from_epoch - - fs->s.weekly.offset_from_epoch) / - fs->s.weekly.interval_weeks; - after_repeat_in_week_interval = - ((julian_in_date-1) % 7 >= fs->s.weekly.day_of_week || - (in_weeks_from_epoch - fs->s.weekly.offset_from_epoch) % - fs->s.weekly.interval_weeks > 0 ) ? 1 : 0; - julian_next_repeat = - (fs->s.weekly.offset_from_epoch + - (complete_intervals + after_repeat_in_week_interval) * - fs->s.weekly.interval_weeks) * 7 + - fs->s.weekly.day_of_week + 1; - g_date_set_julian( out_date, julian_next_repeat ); -*/ - } break; - - case MONTHLY: { - guint32 in_months_from_epoch, after_repeat_in_month_interval, - complete_intervals, next_repeat_months_from_epoch, month, year; - - in_months_from_epoch = (g_date_year( CONST_HACK in_date )-1) * 12 + - g_date_month( CONST_HACK in_date ) - 1; - complete_intervals = - (in_months_from_epoch - fs->s.monthly.offset_from_epoch) / - fs->s.monthly.interval_months; - after_repeat_in_month_interval = - (g_date_day( CONST_HACK in_date ) >= fs->s.monthly.day_of_month || - (in_months_from_epoch - fs->s.monthly.offset_from_epoch) % - fs->s.monthly.interval_months > 0 || - g_date_day( CONST_HACK in_date ) >= - g_date_days_in_month( g_date_month( CONST_HACK in_date ), - g_date_year( CONST_HACK in_date ) ) ) ? 1 : 0; - next_repeat_months_from_epoch = - fs->s.monthly.offset_from_epoch + - (complete_intervals + after_repeat_in_month_interval) * - fs->s.monthly.interval_months; - /* Hmmm... what happens if the day of the month is greater than the - * number of days in this month? - * Here I have constrained the day of the month by the number - * of days in the month. This is compensated for above by checking if - * the input day is the last day of that month, in which case it will - * move to the next month interval. - */ - month = next_repeat_months_from_epoch % 12 + 1; - year = next_repeat_months_from_epoch / 12 + 1; - g_date_set_dmy( out_date, - min( fs->s.monthly.day_of_month, - g_date_days_in_month( month, year ) ), - month, - year ); - } break; - - case MONTH_RELATIVE: { - guint32 in_months_from_epoch, after_repeat_in_month_interval, - complete_intervals, next_repeat_months_from_epoch, month, year, - wday_of_1st, day_of_repeat; - - GDate date1; - in_months_from_epoch = (g_date_year( CONST_HACK in_date )-1) * 12 + - g_date_month( CONST_HACK in_date ) - 1; - complete_intervals = - (in_months_from_epoch - fs->s.month_relative.offset_from_epoch) / - fs->s.month_relative.interval_months; - month = g_date_month( CONST_HACK in_date ); - year = g_date_year( CONST_HACK in_date ); - g_date_set_dmy( &date1, 1, month, year ); - wday_of_1st = g_date_weekday( &date1 ); - day_of_repeat = (fs->s.month_relative.occurrence-1)*7 + - ((fs->s.month_relative.weekday + 7 - wday_of_1st)%7 + 1); - after_repeat_in_month_interval = - (g_date_day( CONST_HACK in_date ) >= day_of_repeat || - day_of_repeat > g_date_days_in_month( month, year ) || - (in_months_from_epoch - fs->s.month_relative.offset_from_epoch) % - fs->s.month_relative.interval_months > 0 ) ? 1 : 0; - next_repeat_months_from_epoch = - fs->s.month_relative.offset_from_epoch + - (complete_intervals + after_repeat_in_month_interval) * - fs->s.month_relative.interval_months; - month = next_repeat_months_from_epoch % 12 + 1; - year = next_repeat_months_from_epoch / 12 + 1; - g_date_set_dmy( &date1, 1, month, year ); - wday_of_1st = g_date_weekday( &date1 ); - /* This calculates the day of the month in the month which forms - * the next month in the cycle after the given input date. - * However, this day may be larger than the number of days in that month... */ - day_of_repeat = (fs->s.month_relative.occurrence-1)*7 + - ((fs->s.month_relative.weekday + 7 - wday_of_1st)%7 + 1); - while( day_of_repeat > g_date_days_in_month( month, year ) ) { - /* If the repeat occurs after the end of the month, then - * find the next month containing a day which satisfies the request. - * Each candiate month separated by interval_months is considered - * by this loop.*/ - ++complete_intervals; - next_repeat_months_from_epoch = - fs->s.month_relative.offset_from_epoch + - complete_intervals * fs->s.month_relative.interval_months; - month = next_repeat_months_from_epoch % 12 + 1; - year = next_repeat_months_from_epoch / 12 + 1; - g_date_set_dmy( &date1, 1, month, year ); - wday_of_1st = g_date_weekday( &date1 ); - day_of_repeat = (fs->s.month_relative.occurrence-1)*7 + - ((fs->s.month_relative.weekday + 7 - wday_of_1st)%7 + 1); - /* Hmmm... It would be nice to know that this loop is - * guaranteed to terminate... CHECK ME! */ - } - g_date_set_dmy( out_date, day_of_repeat, month, year ); - } break; - - case COMPOSITE: - list = fs->s.composites.subSpecs; - if ( !list ) { - /* sets date to be invalid */ - g_date_clear( out_date, 1 ); - break; - } - { - /* This implements || composites. */ - guint32 min_julian = 0xFFFFFFFF; /* the biggest unsigned 32 bit number */ - guint32 this_julian; - do { - GDate next_repeat; - xaccFreqSpecGetNextInstance( - (FreqSpec*) list->data, - in_date, - &next_repeat ); - this_julian = g_date_julian( &next_repeat ); - - min_julian = min( min_julian, this_julian ); - - } while ( (list = g_list_next(list)) ); - g_date_set_julian( out_date, min_julian ); - } - break; - - default: - g_date_clear( out_date, 1 ); - g_return_if_fail(FALSE); - } -} - -/* -char* -xaccFreqSpecIsValidDateRelaxed( FreqSpec *fs, time_t query ) -{ - return "FIXME: not implemented yet!"; -} -*/ - -void -xaccFreqSpecSetOnceDate( FreqSpec *fs, const GDate* when ) -{ - g_return_if_fail( fs ); - g_return_if_fail( when ); - xaccFreqSpecCleanUp( fs ); - fs->type = ONCE; - fs->s.once.date = *when; -} - -void -xaccFreqSpecSetDaily( FreqSpec *fs, - const GDate* initial_date, - guint interval_days ) -{ - guint32 julian_days_since_epoch; - - g_return_if_fail( fs ); - g_return_if_fail( interval_days > 0 ); - xaccFreqSpecCleanUp( fs ); - fs->type = DAILY; - fs->s.daily.interval_days = interval_days; - - julian_days_since_epoch = g_date_julian( CONST_HACK initial_date ); - fs->s.daily.offset_from_epoch = julian_days_since_epoch % interval_days; -} - -void -xaccFreqSpecSetWeekly( FreqSpec *fs, - const GDate* initial_date, - guint interval_weeks ) -{ -/* pick one... make sure that the code in next matches this, - * and that the fields in the - * weekly struct match too. - */ -#if 0 -/* * - * This implements weekly by using the fact that 1 week = 7 days. - * Weeks start at epoch in this representation, not necesarily Monday, - * so there is not really any difference... - * The weekly tests pass. - */ - guint32 julian_days_since_epoch; - - g_return_if_fail( fs ); - g_return_if_fail( interval_weeks > 0 ); - xaccFreqSpecCleanUp( fs ); - - fs->type = DAILY; - fs->s.daily.interval_days = 7 * interval_weeks; - - julian_days_since_epoch = g_date_julian( CONST_HACK initial_date ); - fs->s.daily.offset_from_epoch = julian_days_since_epoch % (7*interval_weeks); -#endif -#if 1 - /* simplest solution */ - guint32 julian_days_since_epoch; - - g_return_if_fail( fs ); - g_return_if_fail( interval_weeks > 0 ); - xaccFreqSpecCleanUp( fs ); - - fs->type = WEEKLY; - fs->s.weekly.interval_weeks = interval_weeks; - - julian_days_since_epoch = g_date_julian( CONST_HACK initial_date ); - fs->s.weekly.offset_from_epoch = julian_days_since_epoch % (7*interval_weeks); -#endif -#if 0 -/** - * Use the weekly implementation, which seems to be more complicated... - * uses separate weekly and day in week offsets. - * works. - */ - guint32 julian_day_initial, weeks_since_epoch; - - g_return_if_fail( fs ); - g_return_if_fail( interval_weeks > 0 ); - xaccFreqSpecCleanUp( fs ); - - fs->type = WEEKLY; - fs->s.weekly.interval_weeks = interval_weeks; - - julian_day_initial = g_date_julian( CONST_HACK initial_date ); - weeks_since_epoch = (julian_day_initial-1) / 7; - fs->s.weekly.day_of_week = (julian_day_initial-1) % 7; - fs->s.weekly.offset_from_epoch = weeks_since_epoch % interval_weeks; - - g_return_if_fail( 0 <= fs->s.weekly.day_of_week ); - g_return_if_fail( fs->s.weekly.day_of_week < 7 ); - g_return_if_fail( fs->s.weekly.offset_from_epoch < interval_weeks ); - g_return_if_fail( 0 <= fs->s.weekly.offset_from_epoch ); -#endif -} - -void -xaccFreqSpecSetMonthly( FreqSpec *fs, - const GDate* initial_date, - guint interval_months ) -{ - guint months_since_epoch; - g_return_if_fail( fs ); - g_return_if_fail( interval_months > 0 ); - xaccFreqSpecCleanUp( fs ); - fs->type = MONTHLY; - fs->s.monthly.interval_months = interval_months; - - months_since_epoch = (g_date_year( CONST_HACK initial_date )-1) * 12 + - g_date_month( CONST_HACK initial_date ) - 1; - fs->s.monthly.offset_from_epoch = months_since_epoch % interval_months; - fs->s.monthly.day_of_month = g_date_day( CONST_HACK initial_date ); - - g_return_if_fail( fs->s.monthly.offset_from_epoch < - fs->s.monthly.interval_months ); -} - -void -xaccFreqSpecSetMonthRelative( FreqSpec *fs, - const GDate* initial_date, - guint interval_months ) -{ - guint months_since_epoch; - g_return_if_fail( fs ); - g_return_if_fail( interval_months > 0 ); - xaccFreqSpecCleanUp( fs ); - fs->type = MONTH_RELATIVE; - fs->s.month_relative.interval_months = interval_months; - - months_since_epoch = (g_date_year( CONST_HACK initial_date )-1) * 12 + - g_date_month( CONST_HACK initial_date ) - 1; - fs->s.month_relative.offset_from_epoch = months_since_epoch % interval_months; - - fs->s.month_relative.weekday = g_date_weekday( CONST_HACK initial_date ); - fs->s.month_relative.occurrence = (g_date_day( CONST_HACK initial_date )-1) / 7 + 1; - - g_return_if_fail( fs->s.month_relative.weekday > 0 ); - g_return_if_fail( fs->s.month_relative.weekday <= 7 ); - g_return_if_fail( fs->s.month_relative.occurrence > 0 ); - g_return_if_fail( fs->s.month_relative.occurrence <= 5 ); - g_return_if_fail( fs->s.month_relative.offset_from_epoch < - fs->s.month_relative.interval_months ); -} - -void -xaccFreqSpecSetComposite( FreqSpec *fs ) -{ - g_return_if_fail( fs ); - xaccFreqSpecCleanUp( fs ); - fs->type = COMPOSITE; - fs->s.composites.subSpecs = NULL; -} - -int -xaccFreqSpecGetOnce( FreqSpec *fs, GDate *outGD ) -{ - if ( fs->type != ONCE ) - return -1; - *outGD = fs->s.once.date; - return 0; -} - -int -xaccFreqSpecGetDaily( FreqSpec *fs, int *outRepeat ) -{ - if ( fs->type != DAILY ) - return -1; - *outRepeat = fs->s.daily.interval_days; - return 0; -} - -int -xaccFreqSpecGetWeekly( FreqSpec *fs, int *outRepeat, int *outDayOfWeek ) -{ - if ( fs->type != WEEKLY ) - return -1; - *outRepeat = fs->s.weekly.interval_weeks; - *outDayOfWeek = fs->s.weekly.offset_from_epoch; - return 0; -} - -int -xaccFreqSpecGetMonthly( FreqSpec *fs, int *outRepeat, int *outDayOfMonth, int *outMonthOffset ) -{ - if ( fs->type != MONTHLY ) - return -1; - *outRepeat = fs->s.monthly.interval_months; - *outDayOfMonth = fs->s.monthly.day_of_month; - *outMonthOffset = fs->s.monthly.offset_from_epoch; - return 0; -} - -// FIXME: add month-relative getter - -GList* -xaccFreqSpecCompositeGet( FreqSpec *fs ) -{ - g_return_val_if_fail( fs, NULL ); - g_return_val_if_fail( fs->type == COMPOSITE, NULL ); - return fs->s.composites.subSpecs; -} - -void -xaccFreqSpecCompositeAdd( FreqSpec *fs, FreqSpec *fsToAdd ) -{ - g_return_if_fail( fs ); - g_return_if_fail( fs->type == COMPOSITE ); - fs->s.composites.subSpecs = - g_list_append( fs->s.composites.subSpecs, fsToAdd ); -} - -void -subSpecsListMapDelete( gpointer data, gpointer user_data ) -{ - xaccFreqSpecFree( (FreqSpec*)data ); -} - -void -xaccFreqSpecCompositesClear( FreqSpec *fs ) -{ - g_return_if_fail( fs->type == COMPOSITE ); - g_list_foreach( fs->s.composites.subSpecs, - subSpecsListMapDelete, NULL ); -} - -void -xaccFreqSpecGetFreqStr( FreqSpec *fs, GString *str ) -{ - GList *list; - FreqSpec *tmpFS; - int tmpInt; - char *tmpStr; - int i; - - /* FIXME: fill in. */ - switch( xaccFreqSpecGetUIType( fs ) ) { - case UIFREQ_ONCE: - tmpStr = g_new0( char, 25 ); - /* this is now a GDate. */ - g_date_strftime( tmpStr, 25, - "%a, %b %e, %Y", - &fs->s.once.date ); - g_string_sprintf( str, "Once: %s", tmpStr ); - g_free( tmpStr ); - break; - - case UIFREQ_DAILY: - g_string_sprintf( str, "Daily" ); - if ( fs->s.daily.interval_days > 1 ) { - g_string_sprintfa( str, " (x%u)", - fs->s.daily.interval_days ); - } - break; - - case UIFREQ_DAILY_MF: - { - FreqSpec *subFS; - if ( g_list_length( fs->s.composites.subSpecs ) != 5 ) { - PERR( "Invalid Daily[M-F] structure." ); - g_string_sprintf( str, "Daily[M-F]: error" ); - return; - } - /* We assume that all of the weekly FreqSpecs that make up - the Daily[M-F] FreqSpec have the same interval. */ - subFS = (FreqSpec*)fs->s.composites.subSpecs->data; - g_string_sprintf( str, "Daily [M-F]" ); - if ( subFS->s.weekly.interval_weeks > 1 ) { - g_string_sprintfa( str, " (x%u)", - subFS->s.weekly.interval_weeks ); - } - } - break; - - case UIFREQ_WEEKLY: - g_string_sprintf( str, "Weekly" ); - tmpInt = -1; - tmpStr = g_new0( char, 8 ); - for ( i=0; i<7; i++ ) { - tmpStr[i] = '-'; - } - - list = xaccFreqSpecCompositeGet( fs ); - do { - int dowIdx; - - tmpFS = (FreqSpec*)list->data; - if ( xaccFreqSpecGetType(tmpFS) != WEEKLY ) { - g_string_sprintf( str, - "error: UIFREQ_WEEKLY doesn't contain weekly children" ); - return; - } - if ( tmpInt == -1 ) { - tmpInt = tmpFS->s.weekly.interval_weeks; - } - /* put the first letter of the weekday name in - the appropriate position. */ - dowIdx = tmpFS->s.weekly.offset_from_epoch; - tmpStr[dowIdx] = weekDayNames[dowIdx][0]; - } while ( (list = g_list_next(list)) ); - - if ( tmpInt > 1 ) { - g_string_sprintfa( str, " (x%d)", tmpInt ); - } - g_string_sprintfa( str, ": %s", tmpStr ); - g_free( tmpStr ); - break; - - case UIFREQ_BI_WEEKLY: - g_string_sprintf( str, "Bi-Weekly, %ss", weekDayNames[fs->s.weekly.offset_from_epoch % 7] ); - break; - - case UIFREQ_SEMI_MONTHLY: - g_string_sprintf( str, "Semi-Monthly" ); - list = xaccFreqSpecCompositeGet( fs ); - tmpFS = (FreqSpec*)(g_list_nth( list, 0 )->data); - if ( tmpFS->s.monthly.interval_months > 1 ) { - g_string_sprintfa( str, " (x%u)", tmpFS->s.monthly.interval_months ); - } - g_string_sprintfa( str, ": " ); - if ( tmpFS->s.monthly.day_of_month > 31 ) { - g_string_sprintfa( str, "%s", "last day" ); - } else { - g_string_sprintfa( str, "%u", tmpFS->s.monthly.day_of_month ); - } - g_string_sprintfa( str, ", " ); - tmpFS = (FreqSpec*)(g_list_nth( list, 1 )->data); - if ( tmpFS->s.monthly.day_of_month > 31 ) { - g_string_sprintfa( str, "%s", "last day" ); - } else { - g_string_sprintfa( str, "%u", tmpFS->s.monthly.day_of_month ); - } - break; - - case UIFREQ_MONTHLY: - g_string_sprintf( str, "Monthly" ); - if ( fs->s.monthly.interval_months > 1 ) { - g_string_sprintfa( str, " (x%u)", - fs->s.monthly.interval_months ); - } - g_string_sprintfa( str, ": %u", - fs->s.monthly.day_of_month ); - break; - - case UIFREQ_QUARTERLY: - g_string_sprintf( str, "Quarterly" ); - if ( fs->s.monthly.interval_months != 3 ) { - g_string_sprintfa( str, " (x%u)", - fs->s.monthly.interval_months/3 ); - } - g_string_sprintfa( str, ": %u", - fs->s.monthly.day_of_month ); - break; - - case UIFREQ_TRI_ANUALLY: - g_string_sprintf( str, "Tri-Anually" ); - if ( fs->s.monthly.interval_months != 4 ) { - g_string_sprintfa( str, " (x%u)", - fs->s.monthly.interval_months/4 ); - } - g_string_sprintfa( str, ": %u", - fs->s.monthly.day_of_month ); - break; - - case UIFREQ_SEMI_YEARLY: - g_string_sprintf( str, "Semi-Yearly" ); - if ( fs->s.monthly.interval_months != 6 ) { - if ( (fs->s.monthly.interval_months % 6) != 0 ) { - PERR( "ERROR: FreqSpec Semi-Yearly month-interval " - "is not a multiple of 6 [%d]", - fs->s.monthly.interval_months ); - } - g_string_sprintfa( str, " (x%u)", - fs->s.monthly.interval_months/6 ); - } - g_string_sprintfa( str, ": %u", - fs->s.monthly.day_of_month ); - break; - - case UIFREQ_YEARLY: - g_string_sprintf( str, "Yearly" ); - if ( fs->s.monthly.interval_months != 12 ) { - if ( (fs->s.monthly.interval_months % 12) != 0 ) { - PERR( "ERROR: \"Yearly\" FreqSpec month-interval " - "is not a multiple of 12 [%d]", - fs->s.monthly.interval_months ); - } - g_string_sprintfa( str, " (x%u)", - fs->s.monthly.interval_months/12 ); - } - g_string_sprintfa( str, ": %s/%u", - monthInfo[fs->s.monthly.offset_from_epoch].dshort, - fs->s.monthly.day_of_month ); - break; - - default: - g_string_sprintf( str, "Unknown" ); - break; - } -} diff --git a/src/engine/FreqSpec.h b/src/engine/FreqSpec.h deleted file mode 100644 index ba5fe9de94..0000000000 --- a/src/engine/FreqSpec.h +++ /dev/null @@ -1,240 +0,0 @@ -/********************************************************************\ - * FreqSpec.h -- Frequency Specification * - * Copyright (C) 2001 Joshua Sled * - * Copyright (C) 2001 Ben Stanley * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_FREQSPEC_H -#define XACC_FREQSPEC_H - -#include "config.h" - -#include - -#include "GNCId.h" - -/** - * Frequency specification. - * - **/ -typedef enum gncp_FreqType { - INVALID, - ONCE, - DAILY, - WEEKLY, /* Hmmm... This is sort of DAILY[7]... */ - /* BI_WEEKLY: weekly[2] */ - /* SEMI_MONTHLY: use composite */ - MONTHLY, - MONTH_RELATIVE, - /* YEARLY: monthly[12] */ - COMPOSITE, -} FreqType; - -/** - * The user's conception of the frequency. It is expected that this - * list will grow, while the former [FreqType] will not. - * - * Ideally this is not here, but what can you do? - **/ -typedef enum gncp_UIFreqType { - UIFREQ_NONE, - UIFREQ_ONCE, - UIFREQ_DAILY, - UIFREQ_DAILY_MF, - UIFREQ_WEEKLY, - UIFREQ_BI_WEEKLY, - UIFREQ_SEMI_MONTHLY, - UIFREQ_MONTHLY, - UIFREQ_QUARTERLY, - UIFREQ_TRI_ANUALLY, - UIFREQ_SEMI_YEARLY, - UIFREQ_YEARLY, - UIFREQ_NUM_UI_FREQSPECS -} UIFreqType; - -/** - * Forward declaration of FreqSpec type for storing - * date repetition information. This is an opaque type. - */ - -struct gncp_freq_spec; -typedef struct gncp_freq_spec FreqSpec; - - -/** PROTOTYPES ******************************************************/ - -/** - * Allocates memory for a FreqSpec and initializes it. - **/ -FreqSpec* xaccFreqSpecMalloc(void); - -/** - * destroys any private data belonging to the FreqSpec. - * Use this for a stack object. - */ -void xaccFreqSpecCleanUp( FreqSpec *fs ); - -/** - * Frees a heap allocated FreqSpec. - * This is the opposite of xaccFreqSpecMalloc(). - **/ -void xaccFreqSpecFree( FreqSpec *fs ); - -/** - * Gets the type of a FreqSpec. - **/ -FreqType xaccFreqSpecGetType( FreqSpec *fs ); - -/** - * Sets the type of a FreqSpec. - * Setting the type re-initializes any spec-data; this means - * destroying any sub-types in the case of COMPOSITE. - * THESE FUNCTIONS HAVE NOT BEEN MAINTAINED THROUGH BEN'S CHANGES. - * They need to be checked. - **/ -/* void xaccFreqSpecSetType( FreqSpec *fs, FreqType newType ); */ - -UIFreqType xaccFreqSpecGetUIType( FreqSpec *fs ); -void xaccFreqSpecSetUIType( FreqSpec *fs, UIFreqType newUIFreqType ); - -/* Convenience function; calls the two above. */ -/* void xaccFreqSpecSetTypes( FreqSpec *fs, FreqType newType, UIFreqType newUIType ); */ - -/** - * Sets the type to once-off, and initialises the - * date it occurs on. - * Disposes of any previous data. - */ -void xaccFreqSpecSetOnceDate( FreqSpec *fs, - const GDate* when ); - -/** - * Sets the type to DAILY. Disposes of any previous data. - * Uses the start date to figure - * out how many days after epoch (1/1/1900) this repeat would - * have first occurred on if it had been running back then. - * This is used later to figure out absolute repeat dates. - */ -void xaccFreqSpecSetDaily( FreqSpec *fs, - const GDate* initial_date, - guint interval_days ); - -/** - * Sets the type to WEEKLY. Disposes of any previous data. - * Uses the inital date to figure out the day of the week to use. - */ -void xaccFreqSpecSetWeekly( FreqSpec *fs, - const GDate* inital_date, - guint interval_weeks ); - -/** - * Sets the type to MONTHLY. Disposes of any previous data. - * Uses the inital date to figure out the day of the month to use. - */ -void xaccFreqSpecSetMonthly( FreqSpec *fs, - const GDate* inital_date, - guint interval_months ); - -/** - * Sets the type to MONTH_RELATIVE. Disposes of any previous data. - * Uses the inital date to figure out the day of the month to use. - */ -void xaccFreqSpecSetMonthRelative( FreqSpec *fs, - const GDate* inital_date, - guint interval_months ); - -/** - * Sets the type to COMPOSITE. Disposes of any previous data. - * You must Add some repeats to the composite before using - * it for repeating. - */ -void xaccFreqSpecSetComposite( FreqSpec *fs ); - -/** - * Returns a human-readable string of the Frequency. This uses - * UIFreqType to unroll the internal structure. It is an assertion - * failure if the FreqSpec data doesn't match the UIFreqType. - * Caller allocates the GString [natch]. - **/ -void xaccFreqSpecGetFreqStr( FreqSpec *fs, GString *str ); - -int xaccFreqSpecGetOnce( FreqSpec *fs, GDate *outGD ); -int xaccFreqSpecGetDaily( FreqSpec *fs, int *outRepeat ); -int xaccFreqSpecGetWeekly( FreqSpec *fs, int *outRepeat, int *outDayOfWeek ); -int xaccFreqSpecGetMonthly( FreqSpec *fs, int *outRepeat, - int *outDayOfMonth, int *outMonthOffset ); -// FIXME: add month-relative - -/** - * Returns the list of FreqSpecs in a COMPOSITE FreqSpec. - * It is an error to use this if the type is not COMPOSITE. - * The caller should not modify this list; - * only add/remove composites and use this fn to get - * the perhaps-changed list head. - **/ -GList* xaccFreqSpecCompositeGet( FreqSpec *fs ); - -/** - * Adds a FreqSpec to the list in a COMPOSITE FreqSpec; if the - * FreqSpec is not COMPOSITE, this is an assertion failure. - **/ -void xaccFreqSpecCompositeAdd( FreqSpec *fs, FreqSpec *fsToAdd ); - -/** - * Returns the next date which the FreqSpec specifies given the - * previous occurance. Like the relaxed validity check, this doesn't - * take multipliers into account; it just returns the next possible - * occurance after the given day. - * bstanley I think this should be private. - **/ -/* -time_t xaccFreqSpecGetInstanceAfter( FreqSpec *fs, time_t after ); -*/ - -/** - * Returns the next instance of the FreqSpec after a given input date. - * Note that if the given date happens to be a repeat date, - * then the next repeat date will be returned. - **/ -void xaccFreqSpecGetNextInstance( FreqSpec *fs, - const GDate* in_date, - GDate* out_date ); - -/** - * Returns either NULL [valid] or a descriptive string [reason not - * valid] for the given query date. This is "relaxed", in that it - * doesn't care about the frequency multiplier [e.g., For - * WEEKLY[2]:Wed, all Wednesdays are valid; for MONTHLY[12]:16, the - * 16th day of every month is valid. - **/ -/* -char* xaccFreqSpecIsValidDateRelaxed( FreqSpec *fs, time_t query ); -*/ - -/** - * A strict validity check. Given a previous and query date, returns - * NULL if the query date is valid, or a text reason if not. - **/ -/* -char* xaccFreqSpecIsValidDate( FreqSpec *fs, time_t previous, time_t query ); -*/ - -#endif /* XACC_FREQSPEC_H */ diff --git a/src/engine/FreqSpecP.h b/src/engine/FreqSpecP.h deleted file mode 100644 index 6b1c871d12..0000000000 --- a/src/engine/FreqSpecP.h +++ /dev/null @@ -1,112 +0,0 @@ -/********************************************************************\ - * FreqSpec.h -- Frequency Specification * - * Copyright (C) 2001 Joshua Sled * - * Copyright (C) 2001 Ben Stanley * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/********************************************************************\ -This file contains private definitions and should not be used by -other parts of the engine. This is private data and is subject to -change. -Currently the only files which include this file are: - FreqSpec.c - gnc-freqspec-xml-v2.c -\********************************************************************/ -#ifndef XACC_FREQSPECP_H -#define XACC_FREQSPECP_H - -#include "FreqSpec.h" - -/** - * Scheduled transactions have a frequency defined by a frequency - * specifier. This specifier, given a start date, end date [present - * in the scheduled transaction] and last occurance date [possibly not - * present] can be used to determine that a s.transaction should be - * instantiated on a given date [the given query date]. - * - * There is a split between the UIFreqType and the 'internal' FreqType - * to reduce the complexity of some of the code involved. - * - * Hmmm... having this in the private header file actually prevents - * client code from allocating this 'class' on the stack. - * Is that a problem? - * - * This still needs to deal with: - * . exceptions - * . yearly 360/365? - * . re-based frequencies [based around a non-standard [read: - * not-Jan-1-based/fiscal] year] - * . "business days" -- m-f sans holidays [per-user list thereof] - **/ -struct gncp_freq_spec { - FreqType type; - UIFreqType uift; - union u { - struct { - /** The date on which the single event occurs. */ - GDate date; - } once; - struct { - /** number of days from one repeat to the next. */ - guint interval_days; - /** epoch is defined by glib to be 1/1/1. Offset - measured in days. 0 <= offset < interval */ - guint offset_from_epoch; - } daily; - struct { - /* A week here is measured as 7 days. The first week starts at epoch. - * 1/1/1 was a ?. */ - - /** number of weeks from one repeat to the next. */ - guint interval_weeks; - /* offset measured in days. This combines the week - * offset and the day of the week offset. */ - guint offset_from_epoch; -/* guint offset_from_epoch;*/ /* offset measured in weeks, 0 <= offset < interval */ -/* guint day_of_week;*/ /* I'm not sure what days each value represents, but it's not important. */ - } weekly; - struct { - /** number of months from one repeat to the next. */ - guint interval_months; - /* offset measured in months */ - guint offset_from_epoch; - /* Which day of the month it occurs on. */ - guint day_of_month; - } monthly; - struct { - /** Number of months from one repeat to the next. */ - guint interval_months; - /* offset measured in months */ - guint offset_from_epoch; - /* stores a value equivalent to a GDateWeekday. */ - guint weekday; - /* the 1st occurrence to the 5th occurrence. */ - guint occurrence; - } month_relative; - struct { - /** A list of specs for a composite freq. */ - GList *subSpecs; - } composites; - } s; - GUID guid; -}; - -#endif /* XACC_FREQSPECP_H */ diff --git a/src/engine/GNCId.c b/src/engine/GNCId.c deleted file mode 100644 index 64c5484536..0000000000 --- a/src/engine/GNCId.c +++ /dev/null @@ -1,326 +0,0 @@ -/********************************************************************\ - * GNCId.c -- Gnucash entity identifier implementation * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include - -#include "GNCIdP.h" -#include "gnc-engine-util.h" - - -/** #defines ********************************************************/ -#define GNCID_DEBUG 0 - - -/** Type definitions ************************************************/ -typedef struct entity_node -{ - GNCIdType entity_type; - gpointer entity; -} EntityNode; - - -/** Static global variables *****************************************/ -static GHashTable * entity_table = NULL; -static GMemChunk *guid_memchunk = NULL; -static short module = MOD_ENGINE; - - -/** Function implementations ****************************************/ - -void -xaccGUIDInit (void) -{ - if (!guid_memchunk) - guid_memchunk = g_mem_chunk_create (GUID, 512, G_ALLOC_AND_FREE); -} - -void -xaccGUIDShutdown (void) -{ - if (guid_memchunk) - { - g_mem_chunk_destroy (guid_memchunk); - guid_memchunk = NULL; - } -} - -GUID * -xaccGUIDMalloc (void) -{ - return g_chunk_new (GUID, guid_memchunk); -} - -void -xaccGUIDFree (GUID *guid) -{ - if (!guid) - return; - - g_chunk_free (guid, guid_memchunk); -} - -static gboolean -entity_node_destroy(gpointer key, gpointer value, gpointer not_used) -{ - GUID *guid = key; - EntityNode *e_node = value; - - e_node->entity_type = GNC_ID_NONE; - e_node->entity = NULL; - - xaccGUIDFree(guid); - g_free(e_node); - - return TRUE; -} - -static void -entity_table_destroy (void) -{ - if (entity_table == NULL) - return; - - g_hash_table_foreach_remove(entity_table, entity_node_destroy, NULL); - g_hash_table_destroy(entity_table); - - entity_table = NULL; -} - -static guint -id_hash (gconstpointer key) -{ - const GUID *guid = key; - - if (key == NULL) - return 0; - - if (sizeof(guint) <= 16) - return *((guint *) guid->data); - else - { - guint hash = 0; - int i, j; - - for (i = 0, j = 0; i < sizeof(guint); i++, j++) - { - if (j == 16) - j = 0; - - hash <<= 4; - hash |= guid->data[j]; - } - - return hash; - } -} - -static gboolean -id_compare(gconstpointer key_1, gconstpointer key_2) -{ - return guid_equal (key_1, key_2); -} - -#if GNCID_DEBUG -static void -print_node(gpointer key, gpointer value, gpointer not_used) -{ - GUID *guid = key; - EntityNode *node = value; - - fprintf(stderr, "%s %d %p\n", - guid_to_string(guid), node->entity_type, node->entity); -} - -static void -summarize_table(void) -{ - if (entity_table == NULL) - return; - - g_hash_table_foreach(entity_table, print_node, NULL); -} -#endif - -static void -entity_table_init(void) -{ - if (entity_table != NULL) - entity_table_destroy(); - - entity_table = g_hash_table_new(id_hash, id_compare); - - xaccStoreEntity(NULL, xaccGUIDNULL(), GNC_ID_NULL); - -#if GNCID_DEBUG - atexit(summarize_table); -#endif -} - -GNCIdType -xaccGUIDType(const GUID * guid) -{ - EntityNode *e_node; - GNCIdType entity_type; - - if (guid == NULL) - return GNC_ID_NONE; - - if (entity_table == NULL) - entity_table_init(); - - e_node = g_hash_table_lookup(entity_table, guid->data); - if (e_node == NULL) - return GNC_ID_NONE; - - entity_type = e_node->entity_type; - if ((entity_type <= GNC_ID_NONE) || (entity_type > LAST_GNC_ID)) - return GNC_ID_NONE; - - return entity_type; -} - -void -xaccGUIDNew(GUID *guid) -{ - if (guid == NULL) - return; - - do - { - guid_new(guid); - - if (xaccGUIDType(guid) == GNC_ID_NONE) - break; - - PWARN("duplicate id created, trying again"); - } while(1); -} - -const GUID * -xaccGUIDNULL(void) -{ - static int null_inited = (0 == 1); - static GUID null_guid; - - if (!null_inited) - { - int i; - - for (i = 0; i < 16; i++) - null_guid.data[i] = 0; - - null_inited = (0 == 0); - } - - return &null_guid; -} - -void * -xaccLookupEntity(const GUID * guid, GNCIdType entity_type) -{ - EntityNode *e_node; - - if (guid == NULL) - return NULL; - - if (entity_table == NULL) - entity_table_init(); - - e_node = g_hash_table_lookup(entity_table, guid->data); - if (e_node == NULL) - return NULL; - - if (e_node->entity_type != entity_type) - return NULL; - - return e_node->entity; -} - -void -xaccStoreEntity(void * entity, const GUID * guid, GNCIdType entity_type) -{ - EntityNode *e_node; - GUID *new_guid; - - if (guid == NULL) - return; - - if ((entity_type <= GNC_ID_NONE) || (entity_type > LAST_GNC_ID)) - return; - - if (guid_equal(guid, xaccGUIDNULL())) return; - - xaccRemoveEntity(guid); - - e_node = g_new(EntityNode, 1); - e_node->entity_type = entity_type; - e_node->entity = entity; - - new_guid = xaccGUIDMalloc(); - - if(!new_guid) return; - - *new_guid = *guid; - - g_hash_table_insert(entity_table, new_guid, e_node); -} - -void -xaccRemoveEntity(const GUID * guid) -{ - EntityNode *e_node; - gpointer old_guid; - gpointer node; - - if (guid == NULL) - return; - - if (entity_table == NULL) - entity_table_init(); - - if (g_hash_table_lookup_extended(entity_table, guid, &old_guid, &node)) - { - e_node = node; - if (e_node->entity_type == GNC_ID_NULL) - return; - - g_hash_table_remove(entity_table, old_guid); - entity_node_destroy(old_guid, node, NULL); - } -} - -GHashTable * -xaccGetAndResetEntityTable(void) { - GHashTable *result = entity_table; - entity_table = NULL; - return(result); -} - -void -xaccSetEntityTable(GHashTable *et) { - if(entity_table) entity_table_destroy(); - entity_table = et; -} diff --git a/src/engine/GNCId.h b/src/engine/GNCId.h deleted file mode 100644 index c4192e7bff..0000000000 --- a/src/engine/GNCId.h +++ /dev/null @@ -1,72 +0,0 @@ -/********************************************************************\ - * GNCId.h -- Gnucash entity identifier API * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef GNC_ID_H -#define GNC_ID_H 1 - -/* This file defines an API for using gnucash entity identifiers. - * - * Identifiers can be used to reference Accounts, Transactions, and - * Splits. These four Gnucash types are referred to as Gnucash - * entities. Identifiers are globally-unique and permanent, i.e., once - * an entity has been assigned an identifier, it retains that same - * identifier for its lifetime. - * - * Identifiers can be encoded as hex strings. */ - -#include "guid.h" - - -/* Identifiers are 'typed' with integers. The ids used in gnucash are - * defined below. An id with type GNC_ID_NONE does not refer to any - * entity, although that may change as new ids are created. An id with - * type GNC_ID_NULL does not refer to any entity, and will never refer - * to any entity. An identifier with any other type may refer to an - * actual entity, but that is not guaranteed. If an id does refer to - * an entity, the type of the entity will match the type of the - * identifier. */ -typedef enum -{ - GNC_ID_NONE = 0, - GNC_ID_NULL, - GNC_ID_ACCOUNT, - GNC_ID_TRANS, - GNC_ID_SPLIT, - GNC_ID_PRICE, - GNC_ID_SCHEDXACTION, - GNC_ID_FREQSPEC, - LAST_GNC_ID = GNC_ID_FREQSPEC -} GNCIdType; - - -/* Return the type of an identifier. */ -GNCIdType xaccGUIDType (const GUID * guid); - -/* Returns a GUID which is guaranteed to never reference any entity. */ -const GUID * xaccGUIDNULL (void); - -/* Efficiently allocate & free memory for GUIDs */ -GUID * xaccGUIDMalloc (void); -void xaccGUIDFree (GUID *guid); - -#endif diff --git a/src/engine/GNCIdP.h b/src/engine/GNCIdP.h deleted file mode 100644 index 2d1dafb22b..0000000000 --- a/src/engine/GNCIdP.h +++ /dev/null @@ -1,57 +0,0 @@ -/********************************************************************\ - * GNCIdP.h -- Gnucash entity identifier engine-only API * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef GNC_ID_P_H -#define GNC_ID_P_H 1 - -#include "GNCId.h" - -/* This file defines an engine-only API for using gnucash entity - * identifiers. */ - -/* Generate a new id. This function is guaranteed to return an id that - * is unique within the scope of all GnuCash entities being managed by - * the current invocation of GnuCash. GnuCash routines should always - * use this function and not guid_new! */ -void xaccGUIDNew (GUID *guid); - -/* Lookup an entity given an id and a type. If there is no entity - * associated with the id, or if it has a different type, NULL - * is returned. */ -void * xaccLookupEntity (const GUID * guid, GNCIdType entity_type); - -/* Store the given entity under the given id with the given type. */ -void xaccStoreEntity (void * entity, const GUID * guid, GNCIdType entity_type); - -/* Remove any existing association between an entity and the given - * id. The entity is not changed in any way. */ -void xaccRemoveEntity (const GUID * guid); - -GHashTable *xaccGetAndResetEntityTable (void); -void xaccSetEntityTable (GHashTable *et); - -/* Initialize and shutdown the GNC Id system. */ -void xaccGUIDInit (void); -void xaccGUIDShutdown (void); - -#endif diff --git a/src/engine/Group.c b/src/engine/Group.c deleted file mode 100644 index 289ec2e457..0000000000 --- a/src/engine/Group.c +++ /dev/null @@ -1,1111 +0,0 @@ -/********************************************************************\ - * Group.c -- chart of accounts (hierarchical tree of accounts) * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997-2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include - -#include "Account.h" -#include "AccountP.h" -#include "BackendP.h" -#include "GNCIdP.h" -#include "Group.h" -#include "GroupP.h" -#include "TransactionP.h" -#include "gnc-common.h" -#include "gnc-engine-util.h" -#include "gnc-event-p.h" -#include "gnc-numeric.h" - -static short module = MOD_ENGINE; - -/********************************************************************\ - * Because I can't use C++ for this project, doesn't mean that I * - * can't pretend to! These functions perform actions on the * - * AccountGroup data structure, in order to encapsulate the * - * knowledge of the internals of the AccountGroup in one file. * -\********************************************************************/ - -/********************************************************************\ -\********************************************************************/ - -static void -xaccInitializeAccountGroup (AccountGroup *grp) -{ - grp->saved = 1; - - grp->parent = NULL; - grp->accounts = NULL; - - grp->backend = NULL; -} - -/********************************************************************\ -\********************************************************************/ - -AccountGroup * -xaccMallocAccountGroup (void) -{ - AccountGroup *grp = g_new (AccountGroup, 1); - - xaccInitializeAccountGroup (grp); - - return grp; -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccGroupEqual(AccountGroup *ga, - AccountGroup *gb, - gboolean check_guids) -{ - GList *na; - GList *nb; - - if (!ga && !gb) return(TRUE); - if (!ga) return(FALSE); - if (!gb) return(FALSE); - - na = ga->accounts; - nb = gb->accounts; - - if (!na && nb) return(FALSE); - if (na && !nb) return(FALSE); - - while (na && nb) - { - Account *aa = na->data; - Account *ab = nb->data; - - if (!xaccAccountEqual(aa, ab, check_guids)) return(FALSE); - - na = na->next; - nb = nb->next; - } - - if (na) return(FALSE); - if (nb) return(FALSE); - - return(TRUE); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountGroupBeginEdit (AccountGroup *grp) -{ - GList *node; - - if (!grp) return; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - xaccAccountBeginEdit (account); - xaccAccountGroupBeginEdit (account->children); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountGroupCommitEdit (AccountGroup *grp) -{ - GList *node; - - if (!grp) return; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - xaccAccountGroupCommitEdit (account->children); - xaccAccountCommitEdit (account); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupMarkDoFree (AccountGroup *grp) -{ - GList *node; - - if (!grp) return; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - account->do_free = TRUE; - - xaccGroupMarkDoFree (account->children); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccFreeAccountGroup (AccountGroup *grp) -{ - gboolean root_grp; - - if (!grp) return; - - root_grp = grp->parent == NULL; - - if (grp->accounts) - { - Account *account; - /* This is a weird iterator & needs some explanation. - * xaccAccountDestroy() will rip the account out of the list, thus - * iterating while grp->accounts is non-null is enough to iterate - * the loop. But when it deletes the last account, then it will - * also delete the group, unless it's the root group, making the - * grp pointer invalid. So we have to be careful with the last - * deletion: in particular, g_free(grp) would be freeing that - * memory a second time, so don't do it. */ - while (grp->accounts->next) - { - account = grp->accounts->next->data; - xaccAccountBeginEdit (account); - xaccAccountDestroy (account); - } - account = grp->accounts->data; - xaccAccountBeginEdit (account); - xaccAccountDestroy (account); - - if (!root_grp) return; - } - - if (grp->parent) grp->parent->children = NULL; - - grp->parent = NULL; - - g_free (grp); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupMarkSaved (AccountGroup *grp) -{ - GList *node; - - if (!grp) return; - - grp->saved = 1; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - xaccGroupMarkSaved (account->children); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupMarkNotSaved (AccountGroup *grp) -{ - if (!grp) return; - - grp->saved = 0; -} - -/********************************************************************\ -\********************************************************************/ - -gboolean -xaccGroupNotSaved (AccountGroup *grp) -{ - GList *node; - - if (!grp) return FALSE; - - if (grp->saved == 0) return TRUE; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - if (xaccGroupNotSaved (account->children)) - return TRUE; - } - - return FALSE; -} - -/********************************************************************\ - * Get the number of accounts, including subaccounts * -\********************************************************************/ - -int -xaccGroupGetNumSubAccounts (AccountGroup *grp) -{ - GList *node; - int num_acc; - - if (!grp) return 0; - - num_acc = g_list_length (grp->accounts); - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - num_acc += xaccGroupGetNumSubAccounts (account->children); - } - - return num_acc; -} - -/********************************************************************\ - * Get all of the accounts, including subaccounts * -\********************************************************************/ - -static void -xaccPrependAccounts (AccountGroup *grp, GList **accounts_p) -{ - GList *node; - - if (!grp || !accounts_p) return; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - *accounts_p = g_list_prepend (*accounts_p, account); - - xaccPrependAccounts (account->children, accounts_p); - } -} - -GList * -xaccGroupGetSubAccounts (AccountGroup *grp) -{ - GList *accounts = NULL; - - if (!grp) return NULL; - - xaccPrependAccounts (grp, &accounts); - - return g_list_reverse (accounts); -} - -GList * -xaccGroupGetAccountList (AccountGroup *grp) -{ - if (!grp) return NULL; - - return grp->accounts; -} - -/********************************************************************\ - * Fetch the root of the tree * -\********************************************************************/ - -AccountGroup * -xaccGetAccountRoot (Account * acc) -{ - AccountGroup * grp; - AccountGroup * root = NULL; - - if (!acc) return NULL; - - /* find the root of the account group structure */ - grp = acc->parent; - - while (grp) - { - Account *parent_acc; - - root = grp; - parent_acc = grp->parent; - - if (parent_acc) - grp = parent_acc->parent; - else - grp = NULL; - } - - return root; -} - -/********************************************************************\ - * Fetch an account, given its name * -\********************************************************************/ - -Account * -xaccGetAccountFromName (AccountGroup *grp, const char * name) -{ - GList *node; - - if (!grp) return NULL; - if (!name) return NULL; - - /* first, look for accounts hanging off the root */ - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - if (safe_strcmp(xaccAccountGetName (account), name) == 0) - return account; - } - - /* if we are still here, then we haven't found the account yet. - * Recursively search the subgroups next */ - /* first, look for accounts hanging off the root */ - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - Account *acc; - - acc = xaccGetAccountFromName (account->children, name); - if (acc) - return acc; - } - - return NULL; -} - -/********************************************************************\ - * Fetch an account, given its full name * -\********************************************************************/ - -Account * -xaccGetAccountFromFullName (AccountGroup *grp, - const char *name, - const char separator) -{ - GList *node; - Account *found; - char *p; - - if (!grp) return NULL; - if (!name) return NULL; - - p = (char *) name; - found = NULL; - - while (1) - { - /* Look for the first separator. */ - p = strchr(p, separator); - - /* If found, switch it to the null char. */ - if (p != NULL) - *p = 0; - - /* Now look for that name in the children. */ - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - if (safe_strcmp(xaccAccountGetName (account), name) == 0) - { - /* We found an account. - * If p == NULL, there is nothing left - * in the name, so just return the account. - * We don't need to put back the separator, - * because it was never erased (p == NULL). */ - if (p == NULL) - return account; - - /* There's stuff left to search for. - * Search recursively after the separator. */ - found = xaccGetAccountFromFullName(account->children, - p + 1, separator); - - /* If we found the account, break out. */ - if (found != NULL) - break; - } - } - - /* If found != NULL, an account was found. */ - /* If p == NULL, there are no more separators left. */ - - /* Put back the separator. */ - if (p != NULL) - *p = separator; - - /* If we found the account, return it. */ - if (found != NULL) - return found; - - /* We didn't find the account. If there - * are no more separators, return NULL. */ - if (p == NULL) - return NULL; - - /* If we are here, we didn't find anything and there - * must be more separators. So, continue looking with - * a longer name, in case there is a name with the - * separator character in it. */ - p++; - } -} - -/********************************************************************\ - * Fetch an account, given its name * -\********************************************************************/ - -Account * -xaccGetPeerAccountFromName (Account *acc, const char * name) -{ - AccountGroup * root; - Account *peer_acc; - - if (!acc) return NULL; - if (!name) return NULL; - - /* first, find the root of the account group structure */ - root = xaccGetAccountRoot (acc); - - /* now search all accounts hanging off the root */ - peer_acc = xaccGetAccountFromName (root, name); - - return peer_acc; -} - -/********************************************************************\ - * Fetch an account, given its full name * -\********************************************************************/ - -Account * -xaccGetPeerAccountFromFullName (Account *acc, const char * name, - const char separator) -{ - AccountGroup * root; - Account *peer_acc; - - if (!acc) return NULL; - if (!name) return NULL; - - /* first, find the root of the account group structure */ - root = xaccGetAccountRoot (acc); - - /* now search all acounts hanging off the root */ - peer_acc = xaccGetAccountFromFullName (root, name, separator); - - return peer_acc; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountRemoveGroup (Account *acc) -{ - AccountGroup *grp; - - /* if this group has no parent, it must be the topgroup */ - if (!acc) return; - - grp = acc->children; - - if (grp) grp->parent = NULL; - acc->children = NULL; - - /* make sure that the parent of the group is marked - * as having been modified. */ - grp = acc->parent; - if (!grp) return; - - grp->saved = 0; - - gnc_engine_generate_event (&acc->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupRemoveAccount (AccountGroup *grp, Account *acc) -{ - if (!acc) return; - /* this routine might be called on accounts which - * are not yet parented. */ - if (!grp) return; - - if (acc->parent != grp) - { - PERR ("account not in group"); - return; - } - - acc->parent = NULL; - - grp->accounts = g_list_remove (grp->accounts, acc); - - grp->saved = 0; - - /* if this was the last account in a group, delete - * the group as well (unless its a root group) */ - if ((grp->accounts == NULL) && (grp->parent)) - { - xaccAccountRemoveGroup (grp->parent); - xaccFreeAccountGroup (grp); - } - - gnc_engine_generate_event (&acc->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccAccountInsertSubAccount (Account *adult, Account *child) -{ - if (!adult) return; - - /* if a container for the children doesn't yet exist, add it */ - if (adult->children == NULL) - adult->children = xaccMallocAccountGroup (); - - /* set back-pointer to parent */ - adult->children->parent = adult; - - /* allow side-effect of creating a child-less account group */ - if (!child) return; - - xaccGroupInsertAccount (adult->children, child); - - gnc_engine_generate_event (&adult->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -static int -group_sort_helper (gconstpointer a, gconstpointer b) -{ - Account *aa = (Account *) a; - Account *bb = (Account *) b; - - /* return > 1 if aa should come after bb */ - return xaccAccountOrder (&aa, &bb); -} - -void -xaccGroupInsertAccount (AccountGroup *grp, Account *acc) -{ - if (!grp) return; - if (!acc) return; - - /* If the account is currently in another group, remove it there - * first. Basically, we can't have accounts being in two places at - * once. If old and new parents are the same, reinsertion causes - * the sort order to be checked. */ - if (acc->parent == grp) - { - grp->accounts = g_list_sort (grp->accounts, group_sort_helper); - } - else - { - if (acc->parent) - xaccGroupRemoveAccount (acc->parent, acc); - - /* set back-pointer to the account's parent */ - acc->parent = grp; - - grp->accounts = g_list_insert_sorted (grp->accounts, acc, - group_sort_helper); - } - - grp->saved = 0; - - gnc_engine_generate_event (&acc->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupConcatGroup (AccountGroup *togrp, AccountGroup *fromgrp) -{ - if (!togrp) return; - if (!fromgrp) return; - - /* The act of inserting the account into togrp also causes it to - * automatically be deleted from fromgrp. Be careful! */ - - while (TRUE) - { - Account *account; - GList *accounts; - GList *next; - - accounts = fromgrp->accounts; - if (!accounts) - return; - - next = accounts->next; - - account = accounts->data; - - xaccGroupInsertAccount (togrp, account); - - if (!next) - return; - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccGroupMergeAccounts (AccountGroup *grp) -{ - GList *node_a; - GList *node_b; - - if (!grp) return; - - for (node_a = grp->accounts; node_a; node_a = node_a->next) - { - Account *acc_a = node_a->data; - - for (node_b = node_a->next; node_b; node_b = node_b->next) - { - Account *acc_b = node_b->data; - - if ((0 == safe_strcmp(xaccAccountGetName(acc_a), - xaccAccountGetName(acc_b))) && - (0 == safe_strcmp(xaccAccountGetCode(acc_a), - xaccAccountGetCode(acc_b))) && - (0 == safe_strcmp(xaccAccountGetDescription(acc_a), - xaccAccountGetDescription(acc_b))) && - (gnc_commodity_equiv(xaccAccountGetCommodity(acc_a), - xaccAccountGetCommodity(acc_b))) && - (0 == safe_strcmp(xaccAccountGetNotes(acc_a), - xaccAccountGetNotes(acc_b))) && - (xaccAccountGetType(acc_a) == xaccAccountGetType(acc_b))) - { - AccountGroup *ga, *gb; - GList *lp; - - /* consolidate children */ - ga = (AccountGroup *) acc_a->children; - gb = (AccountGroup *) acc_b->children; - - if (gb) - { - if (!ga) - { - acc_a->children = gb; - gb->parent = acc_a; - acc_b->children = NULL; - - gnc_engine_generate_event (&acc_a->guid, GNC_EVENT_MODIFY); - gnc_engine_generate_event (&acc_b->guid, GNC_EVENT_MODIFY); - } - else - { - xaccGroupConcatGroup (ga, gb); - acc_b->children = NULL; - gnc_engine_generate_event (&acc_b->guid, GNC_EVENT_MODIFY); - } - } - - /* recurse to do the children's children */ - xaccGroupMergeAccounts (ga); - - /* consolidate transactions */ - lp = acc_b->splits; - - for (lp = acc_b->splits; lp; lp = lp->next) - { - Split *split = lp->data; - - gnc_engine_generate_event (&xaccSplitGetAccount(split)->guid, - GNC_EVENT_MODIFY); - xaccSplitSetAccount(split, NULL); - xaccAccountInsertSplit (acc_a, split); - } - - g_list_free(acc_b->splits); - acc_b->splits = NULL; - - /* move back one before removal */ - node_b = node_b->prev; - - /* remove from list -- node_a is ok, it's before node_b */ - grp->accounts = g_list_remove (grp->accounts, acc_b); - - xaccAccountBeginEdit (acc_b); - xaccAccountDestroy (acc_b); - break; - } - } - } -} - -/********************************************************************\ -\********************************************************************/ - -int -xaccGroupGetNumAccounts (AccountGroup *grp) -{ - if (!grp) return 0; - - return g_list_length (grp->accounts); -} - -Account * -xaccGroupGetAccount (AccountGroup *grp, int i) -{ - if (!grp) return NULL; - - return g_list_nth_data (grp->accounts, i); -} - -Account * -xaccGroupGetParentAccount (AccountGroup * grp) -{ - if (!grp) return NULL; - - return grp->parent; -} - -/********************************************************************\ -\********************************************************************/ - -int -xaccGroupGetDepth (AccountGroup *grp) -{ - GList *node; - int depth = 0; - int maxdepth = 0; - - if (!grp) return 0; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - - depth = xaccGroupGetDepth (account->children); - - if (depth > maxdepth) - maxdepth = depth; - } - - maxdepth++; - - return maxdepth; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccSplitsBeginStagedTransactionTraversals (GList *splits) -{ - GList *lp; - - for (lp = splits; lp; lp = lp->next) - { - Split *s = lp->data; - Transaction *trans = s->parent; - - if (trans) - trans->marker = 0; - } -} - -void -xaccAccountBeginStagedTransactionTraversals (Account *account) -{ - if (account == NULL) return; - xaccSplitsBeginStagedTransactionTraversals (account->splits); -} - -gboolean -xaccTransactionTraverse (Transaction *trans, int stage) -{ - if (trans == NULL) return FALSE; - - if (trans->marker < stage) - { - trans->marker = stage; - return TRUE; - } - - return FALSE; -} - -gboolean -xaccSplitTransactionTraverse (Split *split, int stage) -{ - if (split == NULL) return FALSE; - - return xaccTransactionTraverse (split->parent, stage); -} - -void -xaccGroupBeginStagedTransactionTraversals (AccountGroup *grp) -{ - GList *node; - - if (!grp) return; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - GList *lp; - - /* recursively do sub-accounts */ - xaccGroupBeginStagedTransactionTraversals (account->children); - - for (lp = account->splits; lp; lp = lp->next) - { - Split *s = lp->data; - Transaction *trans = s->parent; - trans->marker = 0; - } - } -} - -int -xaccAccountStagedTransactionTraversal (Account *acc, - unsigned int stage, - int (*callback)(Transaction *t, - void *cb_data), - void *cb_data) -{ - if (!acc) return 0; - - if (callback) - { - GList *lp; - for(lp = acc->splits; lp; lp = lp->next) - { - Split *s = (Split *) lp->data; - Transaction *trans = s->parent; - if (trans && (trans->marker < stage)) - { - int retval; - trans->marker = stage; - retval = callback(trans, cb_data); - if (retval) return retval; - } - } - } - else - { - GList *lp; - for(lp = acc->splits; lp; lp = lp->next) - { - Split *s = (Split *) lp->data; - Transaction *trans = s->parent; - if (trans && (trans->marker < stage)) - trans->marker = stage; - } - } - - return 0; -} - -int -xaccGroupStagedTransactionTraversal (AccountGroup *grp, - unsigned int stage, - int (*callback)(Transaction *t, - void *cb_data), - void *cb_data) -{ - GList *node; - - if (!grp) return 0; - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - int retval; - - /* recursively do sub-accounts */ - retval = xaccGroupStagedTransactionTraversal (account->children, stage, - callback, cb_data); - if (retval) return retval; - - retval = xaccAccountStagedTransactionTraversal (account, stage, - callback, cb_data); - if (retval) return retval; - } - - return 0; -} - -/********************************************************************\ -\********************************************************************/ - -struct group_visit_data -{ - gboolean (*proc)(Transaction *t, void *data); - void *up_data; - GHashTable *visit_table; -}; - -static gboolean -xaccGroupVisitUnvisitedTransactions_thunk(Transaction *trn, - void *data) -{ - gpointer test_trn; - struct group_visit_data *grdata = (struct group_visit_data*)data; - - test_trn = g_hash_table_lookup(grdata->visit_table, trn); - - if(!test_trn) - { - g_hash_table_insert(grdata->visit_table, trn, ""); - - grdata->proc(trn, grdata->up_data); - } - - return TRUE; -} - -gboolean -xaccGroupVisitUnvisitedTransactions (AccountGroup *g, - gboolean (*proc)(Transaction *t, - void *data), - void *data, - GHashTable *visited_txns) -{ - gboolean keep_going = TRUE; - GList *list; - GList *node; - struct group_visit_data grdata; - - if (!g) return(FALSE); - if (!proc) return(FALSE); - if (!visited_txns) return(FALSE); - - list = xaccGroupGetSubAccounts (g); - - grdata.proc = proc; - grdata.up_data = data; - grdata.visit_table = visited_txns; - - for (node = list; node && keep_going; node = node->next) - { - Account *account = node->data; - - keep_going = xaccAccountForEachTransaction( - account, xaccGroupVisitUnvisitedTransactions_thunk, (void*)&grdata); - } - - g_list_free (list); - - return(keep_going); -} - -gboolean -xaccGroupForEachTransaction (AccountGroup *g, - gboolean (*proc)(Transaction *t, void *data), - void *data) -{ - GHashTable *visited_txns = NULL; - gboolean result = FALSE; - - if (!g) return(FALSE); - if (!proc) return(FALSE); - - visited_txns = guid_hash_table_new(); - if (visited_txns) - result = xaccGroupVisitUnvisitedTransactions(g, proc, data, visited_txns); - - /* cleanup */ - if (visited_txns) - g_hash_table_destroy(visited_txns); - - return(result); -} - -/********************************************************************\ -\********************************************************************/ - -GSList * -xaccGroupMapAccounts (AccountGroup *grp, - gpointer (*thunk)(Account *a, gpointer data), - gpointer data) -{ - GSList *result = NULL; - GList *node; - - if (!grp) return(NULL); - if (!thunk) return(NULL); - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - gpointer thunk_result = thunk (account, data); - - if (thunk_result) - result = g_slist_prepend (result, thunk_result); - } - - return(g_slist_reverse (result)); -} - -gpointer -xaccGroupForEachAccount (AccountGroup *grp, - gpointer (*thunk)(Account *a, gpointer data), - gpointer data, - gboolean deeply) -{ - GList *node; - - if (!grp) return(NULL); - if (!thunk) return(NULL); - - for (node = grp->accounts; node; node = node->next) - { - Account *account = node->data; - gpointer result = thunk (account, data); - - if (result) - return(result); - - if(deeply) - result = xaccGroupForEachAccount (account->children, - thunk, data, TRUE); - - if (result) - return(result); - } - - return(NULL); -} diff --git a/src/engine/Group.h b/src/engine/Group.h deleted file mode 100644 index 22af9cfa90..0000000000 --- a/src/engine/Group.h +++ /dev/null @@ -1,327 +0,0 @@ -/********************************************************************\ - * Group.h -- chart of accounts (hierarchical tree of accounts) * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_ACCOUNT_GROUP_H -#define XACC_ACCOUNT_GROUP_H - -#include "config.h" - -#include - -#include "Account.h" -#include "GNCId.h" -#include "gnc-common.h" - - -/** PROTOTYPES ******************************************************/ -AccountGroup *xaccMallocAccountGroup (void); -void xaccFreeAccountGroup (AccountGroup *account_group); -void xaccAccountGroupBeginEdit (AccountGroup *grp); -void xaccAccountGroupCommitEdit (AccountGroup *grp); - -/* - * The xaccGroupConcatGroup() subroutine will move all accounts - * from the "from" group to the "to" group - * - * The xaccGroupMergeAccounts() subroutine will go through a group, - * merging all accounts that have the same name and description. - * This function is useful when importing Quicken(TM) files. - */ - -void xaccGroupConcatGroup (AccountGroup *to, AccountGroup *from); -void xaccGroupMergeAccounts (AccountGroup *grp); - -/* - * The xaccGroupNotSaved() subroutine will return TRUE - * if any account in the group or in any subgroup - * hasn't been saved. - * - * The xaccGroupMarkSaved() subroutine will mark - * the entire group as having been saved, including - * all of the child accounts. - * - * The xaccGroupMarkNotSaved() subroutine will mark - * the given group as not having been saved. - * - * The xaccGroupMarkDoFree() subroutine will mark - * all accounts in the group as being destroyed. - */ - -gboolean xaccGroupNotSaved (AccountGroup *grp); -void xaccGroupMarkSaved (AccountGroup *grp); -void xaccGroupMarkNotSaved (AccountGroup *grp); - -void xaccGroupMarkDoFree (AccountGroup *grp); - -/* - * The xaccGroupRemoveAccount() subroutine will remove the indicated - * account from its parent account group. It will NOT free the - * associated memory or otherwise alter the account: the account - * can now be reparented to a new location. - * Note, however, that it will mark the old parents as having - * been modified. - * - * The xaccAccountRemoveGroup() subroutine will remove the indicated - * account group from its parent account. It will NOT free the - * associated memory or otherwise alter the account group: the - * account group can now be reparented to a new location. - * Note, however, that it will mark the old parents as having - * been modified. - */ - -void xaccGroupRemoveAccount (AccountGroup *grp, Account *account); -void xaccAccountRemoveGroup (Account *acc); -void xaccGroupInsertAccount (AccountGroup *grp, Account *acc); -void xaccAccountInsertSubAccount (Account *parent, Account *child); - -/* - * The xaccGroupGetNumSubAccounts() subroutine returns the number - * of accounts, including subaccounts, in the account group - * - * The xaccGroupGetNumAccounts() subroutine returns the number - * of accounts in the indicated group only (children not counted). - * - * The xaccGroupGetDepth() subroutine returns the length of the - * longest tree branch. Each link between an account and its - * (non-null) children counts as one unit of length. - */ - -int xaccGroupGetNumSubAccounts (AccountGroup *grp); -int xaccGroupGetNumAccounts (AccountGroup *grp); -int xaccGroupGetDepth (AccountGroup *grp); -Account * xaccGroupGetAccount (AccountGroup *group, int index); - -/* - * The xaccGroupGetSubAccounts() subroutine returns an list of the accounts, - * including subaccounts, in the account group. The returned list - * should be freed with g_list_free when no longer needed. - * - * The xaccGroupGetAccountList() subroutines returns only the immediate - * children of the account group. The returned list should *not* - * be freed by the caller. - */ - -GList * xaccGroupGetSubAccounts (AccountGroup *grp); -GList * xaccGroupGetAccountList (AccountGroup *grp); - -/* - * The xaccGetAccountFromName() subroutine fetches the - * account by name from the collection of accounts - * in the indicated AccountGroup group. It returns NULL if the - * account was not found. - * - * The xaccGetAccountFromFullName() subroutine works like - * xaccGetAccountFromName, but uses fully-qualified names - * using the given separator. - * - * The xaccGetPeerAccountFromName() subroutine fetches the - * account by name from the collection of accounts - * in the same AccountGroup anchor group. It returns NULL if the - * account was not found. - * - * The xaccGetPeerAccountFromFullName() subroutine works like - * xaccGetPeerAccountFromName, but uses fully-qualified - * names using the given separator. - */ - -Account *xaccGetAccountFromName (AccountGroup *group, const char *name); -Account *xaccGetAccountFromFullName (AccountGroup *group, - const char *name, - const char separator); -Account *xaccGetPeerAccountFromName (Account *account, const char *name); -Account *xaccGetPeerAccountFromFullName (Account *acc, - const char * name, - const char separator); - -/* - * The xaccGetAccountRoot () subroutine will find the topmost - * (root) group to which this account belongs. - */ -AccountGroup * xaccGetAccountRoot (Account *account); - -/* The xaccGroupGetParentAccount() subroutine returns the parent - * account of the group, or NULL. - */ -Account * xaccGroupGetParentAccount (AccountGroup *group); - -/* if the function returns null for a given item, it won't show up in - the result list */ -typedef gpointer (*AccountCallback)(Account *a, gpointer data); -GSList *xaccGroupMapAccounts(AccountGroup *grp, - AccountCallback, - gpointer data); - -/* The xaccGroupForEachAccount() method will traverse the AccountGroup - * tree, calling 'func' on each account. Traversal will stop when - * func returns a non-null value, and the routine wil return with that - * value. If 'deeply' is FALSE, then only the immediate children of - * the account will be traversed. If TRUE, then the whole tree will - * be traversed. - */ - -gpointer xaccGroupForEachAccount (AccountGroup *grp, - AccountCallback, - gpointer data, - gboolean deeply); - -gboolean xaccGroupEqual(AccountGroup *a, AccountGroup *b, - gboolean check_guids); - -/* - * The following functions provide support for "staged traversals" - * over all of the transactions in an account or group. The idea - * is to be able to perform a sequence of traversals ("stages"), - * and perform an operation on each transaction exactly once - * for that stage. - * - * Only transactions whose current "stage" is less than the - * stage of the current traversal will be affected, and they will - * be "brought up" to the current stage when they are processed. - * - * For example, you could perform a stage 1 traversal of all the - * transactions in an account, and then perform a stage 1 traversal of - * the transactions in a second account. Presuming the traversal of - * the first account didn't abort prematurely, any transactions shared - * by both accounts would be ignored during the traversal of the - * second account since they had been processed while traversing the - * first account. - * - * However, if you had traversed the second account using a stage - * of 2, then all the transactions in the second account would have - * been processed. - * - * Traversal can be aborted by having the callback function return - * a non-zero value. The traversal is aborted immediately, and the - * non-zero value is returned. Note that an aborted traversal can - * be restarted; no information is lost due to an abort. - * - * The initial impetus for this particular approach came from - * generalizing a mark/sweep practice that was already being - * used in FileIO.c. - * - * Note that currently, there is a hard limit of 256 stages, which - * can be changed by enlarging "marker" in the transaction struct. - * */ - -/* xaccGroupBeginStagedTransactionTraversals() resets the traversal - * marker inside each of all the transactions in the group so that - * a new sequence of staged traversals can begin. - * - * xaccSplitsBeginStagedTransactionTraversals() resets the traversal - * marker for each transaction which is a parent of one of the - * splits in the list. - * - * xaccAccountBeginStagedTransactionTraversals() resets the traversal - * marker for each transaction which is a parent of one of the - * splits in the account. - * - */ - -void xaccGroupBeginStagedTransactionTraversals(AccountGroup *grp); -void xaccSplitsBeginStagedTransactionTraversals(GList *splits); -void xaccAccountBeginStagedTransactionTraversals(Account *account); - -/* xaccTransactionTraverse() checks the stage of the given transaction. - * If the transaction hasn't reached the given stage, the transaction - * is updated to that stage and the function returns TRUE. Otherwise - * no change is made and the function returns FALSE. - * - * xaccSplitTransactionTraverse() behaves as above using the parent of - * the given split. - */ - -gboolean xaccTransactionTraverse(Transaction *trans, int stage); -gboolean xaccSplitTransactionTraverse(Split *split, int stage); - -/* xaccGroupStagedTransactionTraversal() calls thunk on each - * transaction in the group whose current marker is less than the - * given `stage' and updates each transaction's marker to be `stage'. - * The traversal will stop if thunk() returns a non-zero value. - * xaccGroupStagedTransactionTraversal() function will return zero - * or the non-zero value returned by thunk(). This - * API does not handle handle recursive traversals. - * - * Currently the result of adding or removing transactions during - * a traversal is undefined, so don't do that. - */ - -typedef int (*TransactionCallbackInt)(Transaction *t, void *data); -int xaccGroupStagedTransactionTraversal(AccountGroup *grp, - unsigned int stage, - TransactionCallbackInt, - void *data); - -/* xaccAccountStagedTransactionTraversal() calls thunk on each - * transaction in the account whose current marker is less than the - * given `stage' and updates each transaction's marker to be `stage'. - * The traversal will stop if thunk() returns a non-zero value. - * xaccAccountStagedTransactionTraversal() function will return zero - * or the non-zero value returned by thunk(). - * This API does not handle handle recursive traversals. - * - * Currently the result of adding or removing transactions during - * a traversal is undefined, so don't do that. - */ - -int xaccAccountStagedTransactionTraversal(Account *a, - unsigned int stage, - TransactionCallbackInt, - void *data); - -/* Traverse all of the transactions in the given account group. - Continue processing IFF proc does not return FALSE. This function - will descend recursively to traverse transactions in the - children of the accounts in the group. - - Proc will be called exactly once for each transaction that is - pointed to by at least one split in any account in the hierarchy - topped by AccountGroup g. - - Note too, that if you call this function on two separate account - groups and those accounts groups share transactions, proc will be - called once per account on the shared transactions. - - The result of this function will not be FALSE IFF every relevant - transaction was traversed exactly once. */ -gboolean -xaccGroupForEachTransaction(AccountGroup *g, - TransactionCallback, - void *data); - -/* Visit every transaction in the account that hasn't already been - visited exactly once. visited_txns must be a hash table created - via guid_hash_table_new() and is the authority about which - transactions have already been visited. Further, when this - procedure returns, visited_txns will have been modified to reflect - all the newly visited transactions. - - The result of this function will not be FALSE IFF every relevant - transaction was traversed exactly once. */ -gboolean -xaccGroupVisitUnvisitedTransactions(AccountGroup *g, - TransactionCallback, - void *data, - GHashTable *visited_txns); - -#endif /* XACC_ACCOUNT_GROUP_H */ diff --git a/src/engine/GroupP.h b/src/engine/GroupP.h deleted file mode 100644 index 18f3455493..0000000000 --- a/src/engine/GroupP.h +++ /dev/null @@ -1,60 +0,0 @@ -/********************************************************************\ - * GroupP.h -- private header file for chart of accounts * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * GroupP.h - * - * FUNCTION: - * This is the *private* account group structure. - * This header should *not* be included by any code outside of the - * engine. - * - */ - -#ifndef XACC_ACCOUNT_GROUP_P_H -#define XACC_ACCOUNT_GROUP_P_H - -#include "config.h" - -#include "BackendP.h" -#include "GNCId.h" -#include "Transaction.h" -#include "gnc-numeric.h" - - -/** STRUCTS *********************************************************/ -struct _account_group -{ - /* The flags: */ - unsigned int saved : 1; - - Account *parent; /* back-pointer to parent */ - - GList *accounts; /* list of account pointers */ - - Backend *backend; /* persistant storage backend */ -}; - -#endif /* XACC_ACCOUNT_GROUP_P_H */ diff --git a/src/engine/Makefile.am b/src/engine/Makefile.am index 0b48ac988c..513010a2e0 100644 --- a/src/engine/Makefile.am +++ b/src/engine/Makefile.am @@ -1,59 +1,33 @@ -# Engine Makefile.am file. +SUBDIRS = . test -# don't build sql or RPC subdirs by default, unless you want hurt -SUBDIRS = ${SQL_DIR} ${RPC_DIR} +lib_LTLIBRARIES = libgncengine.la libgncmod-engine.la -# but put them in the dist -DIST_SUBDIRS = sql rpc - -# Build a libtool library, libhello.la for installation in libdir. -lib_LTLIBRARIES = libgncengine.la - -# Build hell from main.c and libhello.la libgncengine_la_SOURCES = \ Account.c \ Backend.c \ DateUtils.c \ + FreqSpec.c \ GNCId.c \ Group.c \ - NetIO.c \ Query.c \ + SchedXaction.c \ Scrub.c \ TransLog.c \ Transaction.c \ date.c \ - gnc-account-xml-v2.c \ gnc-associate-account.c \ gnc-book.c \ - gnc-book-file.c \ - gnc-commodity-xml-v2.c \ gnc-commodity.c \ gnc-engine-util.c \ gnc-engine.c \ gnc-event.c \ gnc-numeric.c \ - gnc-pricedb-xml-v1.c \ gnc-pricedb.c \ - gnc-transaction-xml-v2.c \ guid.c \ - io-example-account.c \ - io-gncbin-r.c \ - io-gncxml-gen.c \ - io-gncxml-v1.c \ - io-gncxml-v2.c \ - io-utils.c \ kvp_frame.c \ - md5.c \ - sixtp-dom-generators.c \ - sixtp-dom-parsers.c \ - sixtp-stack.c \ - sixtp-to-dom-parser.c \ - sixtp-utils.c \ - sixtp.c \ - FreqSpec.c \ - SchedXaction.c \ - gnc-freqspec-xml-v2.c \ - gnc-schedxaction-xml-v2.c + md5.c + +# NetIO.c libgncengine_la_LDFLAGS = -version-info 2:3:1 @@ -67,7 +41,6 @@ noinst_HEADERS = \ GNCIdP.h \ Group.h \ GroupP.h \ - NetIO.h \ Query.h \ Scrub.h \ TransLog.h \ @@ -86,26 +59,14 @@ noinst_HEADERS = \ gnc-numeric.h \ gnc-pricedb-p.h \ gnc-pricedb.h \ - gnc-xml-helper.h \ - gnc-xml.h \ guid.h \ - io-example-account.h \ - io-gncbin.h \ - io-gncxml-gen.h \ - io-gncxml-v2.h \ - io-gncxml.h \ - io-utils.h \ kvp_frame.h \ md5.h \ - sixtp-dom-generators.h \ - sixtp-dom-parsers.h \ - sixtp-parsers.h \ - sixtp-stack.h \ - sixtp-utils.h \ - sixtp.h \ FreqSpec.h \ SchedXaction.h +# NetIO.h + EXTRA_DIST = \ .cvsignore \ README.query-api \ @@ -113,8 +74,56 @@ EXTRA_DIST = \ extensions.txt \ kvp_doc.txt -CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} ${GNOME_XML_CFLAGS} ${GHTTP_CFLAGS} +libgncengine_la_CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} ${GHTTP_CFLAGS} +libgncengine_la_LIBADD = ${GLIB_LIBS} -LDADD = ${GNOME_XML_LIB} ${GLIB_LIBS} +CFLAGS = @CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} -INCLUDES = -I.. +INCLUDES = -I${top_srcdir}/src/gnc-module ${GUILE_INCS} -I../ + +libgncmod_engine_la_SOURCES=gncmod-engine.c +libgncmod_engine_la_LDFLAGS=-module -L. -L.libs -L${top_srcdir}/src/gnc-module/.libs +libgncmod_engine_la_LIBADD = \ + -lgncengine \ + -lgncmodule \ + ${GUILE_LIBS} + + +libgw_glib_la_SOURCES=gw-glib.c glib-helpers.c +libgw_glib_la_LDFLAGS=-module + +libgw_engine_la_SOURCES=gw-engine.c engine-helpers.c +libgw_engine_la_LDFLAGS=-module + +gncmoddir=${GNC_SHAREDIR}/guile-modules/gnucash +gncmod_DATA=engine.scm + +gncscmdir=${GNC_SHAREDIR}/scm +gncscm_DATA=commodity-table.scm engine-init.scm engine-interface.scm \ +engine-utilities.scm gnc-numeric.scm iso-4217-currencies.scm + +gwmoddir=${GNC_SHAREDIR}/guile-modules/g-wrapped +gwmod_LTLIBRARIES=libgw-glib.la libgw-engine.la +gwmod_DATA=gw-engine-spec.scm gw-glib-spec.scm + +.scm-links: + rm -f gnucash g-wrapped + ln -sf . gnucash + ln -sf . g-wrapped + touch .scm-links + +gw-engine.c gw-engine.h: .scm-links gw-engine-spec.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (set! %load-path (cons \"${PWD}\" %load-path)) \ + (primitive-load \"./gw-engine-spec.scm\") \ + (gw:generate-module \"gw-engine\")" + +gw-glib.c gw-glib.h: .scm-links gw-glib-spec.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (primitive-load \"./gw-glib-spec.scm\") \ + (gw:generate-module \"gw-glib\")" + +BUILT_SOURCES += gw-engine.c gw-engine.h gw-glib.c gw-glib.h +CLEANFILES += gw-engine.c gw-engine.h gw-engine.html gw-glib.c gw-glib.h gw-glib.html gnucash g-wrapped .scm-links diff --git a/src/engine/NetIO.c b/src/engine/NetIO.c deleted file mode 100644 index 24688f9d35..0000000000 --- a/src/engine/NetIO.c +++ /dev/null @@ -1,326 +0,0 @@ -/********************************************************************\ - * NetIO.c -- read and write network IO * - * Copyright (C) 2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * Rudimentary implmentation right now; good enough for a demo, - * but that's all. - * - * HACK ALERT -- this should be moved into its own subdirectory - * Mostly so that the engine build doesn't require libghttp - * as a dependency. In general, backends should be dynamically - * loaded ... - */ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "BackendP.h" -#include "NetIO.h" -#include "gnc-book.h" -#include "gnc-engine-util.h" -#include "io-gncxml.h" - -static short module = MOD_BACKEND; - -typedef struct _xmlend XMLBackend; - -struct _xmlend { - Backend be; - - ghttp_request *request; - char * query_url; - char * auth_cookie; -}; - -Backend *xmlendNew (void); - - -#if 0 - -/* ==================================================================== */ -/* Perform various validty checks on the reply: - * -- was the content type text/gnc-xml ? - * -- was there a reply body, of positive length? - * -- did the body appear to contain gnc xml data? - * - * Also, if the reply contained a set-cookie command, process that. - */ - -static int -check_response (XMLBackend *be) -{ - ghttp_request *request; - const char *bufp; - int len; - - request = be->request; - - /* get the content type out of the header */ - bufp = ghttp_get_header(request, "Content-Type"); - PINFO ("Content-Type: %s", bufp ? bufp : "(null)"); - - /* in principle, we should reject content that isn't - * labelled as text/gnc-xml. But for now, we'll be soft ... - */ - if (strncmp (bufp, "text/gnc-xml", 12)) - { - PWARN ("content type is incorrectly labelled as %s", bufp); - be->be.last_err = ERR_NETIO_WRONG_CONTENT_TYPE; - // return 0; - } - - len = ghttp_get_body_len(request); - PINFO ("reply length=%d\n", len); - - /* body length must be postive */ - if (0 >= len) - { - const char * errstr = ghttp_get_error (request); - const char * reason = ghttp_reason_phrase (request); - PERR ("connection failed: %s %s\n", - errstr ? errstr : "", - reason ? reason : ""); - - be->be.last_err = ERR_NETIO_SHORT_READ; - return len; - } - - bufp = ghttp_get_body(request); - g_return_val_if_fail (bufp, 0); - DEBUG ("%s\n", bufp); - - /* skip paste whitespace */ - bufp += strspn (bufp, " \t\f\n\r\v\b"); - - /* see if this really appears to be gnc-xml content ... */ - if (strncmp (bufp, "be.last_err = ERR_NETIO_NOT_GNCXML; - return 0; - } - - /* if we got to here, the response looks good. - * if there is a cookie in the header, obey it - */ - bufp = ghttp_get_header(request, "Set-Cookie"); - if (bufp) - { - if (be->auth_cookie) g_free (be->auth_cookie); - be->auth_cookie = g_strdup (bufp); - } - - /* must be good */ - return len; -} - -/* ==================================================================== */ - -static void -setup_request (XMLBackend *be) -{ - ghttp_request *request = be->request; - - /* clean is needed to clear out old request bodies, headers, etc. */ - ghttp_clean (request); - ghttp_set_header (be->request, http_hdr_Connection, "close"); - ghttp_set_header (be->request, http_hdr_User_Agent, - PACKAGE "/" VERSION - " (Financial Browser for Linux; http://gnucash.org)"); - ghttp_set_sync (be->request, ghttp_sync); - - if (be->auth_cookie) { - ghttp_set_header (request, "Cookie", be->auth_cookie); - } -} - -/* ==================================================================== */ -/* Initialize the connection ... ?? */ -/* validate the URL for syntactic correctness ?? */ -/* maybe check to see if the server is reachable? */ - -static void -xmlbeBookBegin (GNCBook *book, const char *url) -{ - XMLBackend *be; - - if (!book || !url) return; - - ENTER ("url is %s", url); - - be = (XMLBackend *) xaccGNCBookGetBackend (book); - - /* hack alert -- we store this first url as the url for inital - * contact & * for sending queries to - * this should be made customizable, I suppose ???? */ - be->query_url = g_strdup (url); - - LEAVE(" "); -} - -/* ==================================================================== */ -/* Load a set of accounts and currencies from the indicated URL. */ - -static AccountGroup * -xmlbeBookLoad (Backend *bend) -{ - XMLBackend *be = (XMLBackend *) bend; - AccountGroup *grp; - ghttp_request *request; - const char *bufp; - int len; - - if (!be) return NULL; - - /* build up a request for the URL */ - setup_request (be); - request = be->request; - ghttp_set_uri (request, be->query_url); - ghttp_set_type (request, ghttp_type_get); - ghttp_prepare (request); - ghttp_process (request); - - /* perform various error and validity checking on the response */ - len = check_response (be); - if (0 >= len) return NULL; - - bufp = ghttp_get_body(request); - - grp = gnc_book_load_from_buf ((char *)bufp, len); - - LEAVE(" "); - return grp; -} - -/* ==================================================================== */ - -static void -xmlbeRunQuery (Backend *b, Query *q) -{ - XMLBackend *be = (XMLBackend *) b; - AccountGroup *grp, *reply_grp; - ghttp_request *request; - char *bufp; - int len; - - if (!be || !q) return; - ENTER ("be=%p q=%p", b, q); - - /* set up a new http request, of type POST */ - setup_request (be); - request = be->request; - ghttp_set_uri (request, be->query_url); - ghttp_set_type (request, ghttp_type_post); - - /* convert the query to XML */ - gncxml_write_query_to_buf (q, &bufp, &len); - - /* put the XML into the request body */ - ghttp_set_body (request, bufp, len); - - /* send it off the the webserver, wait for the reply */ - ghttp_prepare (request); - ghttp_process (request); - - /* free the query xml */ - free (bufp); - - /* perform various error and validity checking on the response */ - len = check_response (be); - if (0 >= len) return; - - /* we get back a list of splits */ - bufp = ghttp_get_body(request); - reply_grp = gncxml_read_from_buf (bufp, len); - - /* merge the splits into our local cache */ - grp = xaccQueryGetGroup (q); - xaccGroupConcatGroup (grp, reply_grp); - xaccGroupMergeAccounts (grp); - xaccFreeAccountGroup (reply_grp); - - LEAVE(" "); - return; -} - -/* ==================================================================== */ - -static void -xmlbeBookEnd (Backend *b) -{ - XMLBackend *be = (XMLBackend *) b; - - ghttp_request_destroy (be->request); - g_free (be->query_url); -} - -/* ==================================================================== */ - -#endif - -Backend * -xmlendNew (void) -{ -#if 0 - XMLBackend *be; - - be = (XMLBackend *) malloc (sizeof (XMLBackend)); - - /* generic backend handlers */ - be->be.book_begin = NULL; - be->be.book_load = xmlbeBookLoad; - be->be.price_load = NULL; - be->be.book_end = xmlbeBookEnd; - - be->be.account_begin_edit = NULL; - be->be.account_commit_edit = NULL; - be->be.trans_begin_edit = NULL; - be->be.trans_commit_edit = NULL; - be->be.trans_rollback_edit = NULL; - be->be.price_begin_edit = NULL; - be->be.price_commit_edit = NULL; - be->be.run_query = xmlbeRunQuery; - be->be.price_lookup = NULL; - be->be.sync = NULL; - be->be.sync_price = NULL; - be->be.events_pending = NULL; - be->be.process_events = NULL; - - be->be.last_err = ERR_BACKEND_NO_ERR; - - be->request = ghttp_request_new(); - be->auth_cookie = NULL; - - be->query_url = NULL; - - return (Backend *) be; -#endif - return NULL; -} - -/* ============================== END OF FILE ======================== */ diff --git a/src/engine/NetIO.h b/src/engine/NetIO.h deleted file mode 100644 index 85fd08b2dc..0000000000 --- a/src/engine/NetIO.h +++ /dev/null @@ -1,32 +0,0 @@ -/********************************************************************\ - * NetIO.h -- read and write network IO * - * Copyright (C) 2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - - -#ifndef XACC_NET_IO_H -#define XACC_NET_IO_H - -#include "BackendP.h" - -Backend * xmlendNew (void); - -#endif /* XACC_NET_IO_H */ diff --git a/src/engine/Query.c b/src/engine/Query.c deleted file mode 100644 index 0d7e420dc1..0000000000 --- a/src/engine/Query.c +++ /dev/null @@ -1,2794 +0,0 @@ -/********************************************************************\ - * Query.c : api for finding transactions * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#include -#include -#include -#include -#include - -#include -#include -#include - -#include - -#include "gnc-common.h" -#include "gnc-engine-util.h" -#include "gnc-numeric.h" -#include "Account.h" -#include "BackendP.h" -#include "GNCId.h" -#include "Group.h" -#include "Query.h" -#include "Transaction.h" -#include "TransactionP.h" - -static short module = MOD_QUERY; - -/* the Query makes a subset of all splits based on 3 things: - * - an AND-OR tree of predicates which combine to make a - * split filter - * - a sorting order for the matched splits - * - a chop limit which gives the maximum number of sorted - * splits to return. */ - -struct _querystruct { - /* terms is a list of the OR-terms in a sum-of-products - * logical expression. */ - GList * terms; - - /* sorting and chopping is independent of the search filter */ - sort_type_t primary_sort; - sort_type_t secondary_sort; - sort_type_t tertiary_sort; - gboolean primary_increasing; - gboolean secondary_increasing; - gboolean tertiary_increasing; - int max_splits; - - /* cache the results so we don't have to run the whole search - * again until it's really necessary */ - int changed; - query_run_t last_run_type; - AccountGroup * acct_group; - - GList * split_list; - GList * xtn_list; -}; - -/******************************************************************* - * predicates for standard match types - *******************************************************************/ - -static int xaccAccountMatchPredicate(Split * s, PredicateData * pd); -static int xaccActionMatchPredicate(Split * s, PredicateData * pd); -static int xaccAmountMatchPredicate(Split * s, PredicateData * pd); -static int xaccBalanceMatchPredicate(Split * s, PredicateData * pd); -static int xaccClearedMatchPredicate(Split * s, PredicateData * pd); -static int xaccDateMatchPredicate(Split * s, PredicateData * pd); -static int xaccDescriptionMatchPredicate(Split * s, PredicateData * pd); -static int xaccGUIDMatchPredicate(Split * s, PredicateData * pd); -static int xaccMemoMatchPredicate(Split * s, PredicateData * pd); -static int xaccNumberMatchPredicate(Split * s, PredicateData * pd); -static int xaccSharePriceMatchPredicate(Split * s, PredicateData * pd); -static int xaccSharesMatchPredicate(Split * s, PredicateData * pd); - -/******************************************************************** - ********************************************************************/ - - -void -xaccQueryPrint(Query * q) -{ - GList * aterms; - GList * i, * j; - QueryTerm * qt; - - if (!q) - { - printf("Query: null\n"); - return; - } - - printf("Query: max splits = %d\n", q->max_splits); - - /* print and & or terms */ - for(i=q->terms; i; i=i->next) { - aterms = i->data; - printf("("); - for(j=aterms; j; j=j->next) { - qt = (QueryTerm *)j->data; - if(!qt->data.base.sense) printf("~"); - printf("%d ", qt->data.type); - } - printf(")"); - if(i->next) { - printf(" | "); - } - } - printf("\n"); - - /* print the node contents */ - for(i=q->terms; i; i=i->next) { - aterms = i->data; - printf("aterm=%p\n", aterms); - for(j=aterms; j; j=j->next) { - qt = (QueryTerm *)j->data; - switch (qt->data.base.term_type) - { - case PR_ACCOUNT: { - GList *p; - char buff[40]; - printf ("account sense=%d how=%d\n", - qt->data.base.sense, - qt->data.acct.how); - for (p=qt->data.acct.account_guids; p; p=p->next) { - guid_to_string_buff (p->data, buff); - printf ("\tguid=%s\n", buff); - } - for (p=qt->data.acct.accounts; p; p=p->next) { - printf ("\tacct ptr=%p\n", p->data); - } - break; - } - case PR_ACTION: - printf ("action sense=%d case sensitive=%d\n", qt->data.str.sense, qt->data.str.case_sens); - printf ("\tmatch string=%s \n", qt->data.str.matchstring); - break; - case PR_AMOUNT: - printf ("amount sense=%d how=%d\n", qt->data.amount.sense, qt->data.amount.how); - printf ("\tsign=%d amount=%f\n", qt->data.amount.amt_sgn, qt->data.amount.amount); - break; - case PR_BALANCE: - printf ("balance sense=%d how=%d\n", qt->data.balance.sense, qt->data.balance.how); - break; - case PR_CLEARED: - printf ("cleared sense=%d how=%d\n", qt->data.cleared.sense, qt->data.cleared.how); - break; - case PR_DATE: { - char buff[40]; - printf ("date sense=%d use_start=%d use_end=%d\n", - qt->data.base.sense, - qt->data.date.use_start, - qt->data.date.use_end - ); - if (qt->data.date.use_start) { - gnc_timespec_to_iso8601_buff (qt->data.date.start, buff); - printf ("\tstart date=%s\n", buff); - } - if (qt->data.date.use_end) { - gnc_timespec_to_iso8601_buff (qt->data.date.end, buff); - printf ("\tend date=%s\n", buff); - } - break; - } - case PR_DESC: - printf ("desc sense=%d case sensitive=%d\n", qt->data.str.sense, qt->data.str.case_sens); - printf ("\tmatch string=%s \n", qt->data.str.matchstring); - break; - - case PR_GUID: { - char buff[40]; - printf ("guid sense=%d\n", qt->data.guid.sense); - guid_to_string_buff (&qt->data.guid.guid, buff); - printf ("\tguid %s\n", buff); - break; - } - case PR_MEMO: - printf ("memo sense=%d case sensitive=%d\n", qt->data.str.sense, qt->data.str.case_sens); - printf ("\tmatch string=%s \n", qt->data.str.matchstring); - break; - case PR_MISC: - printf ("misc\n"); - break; - case PR_NUM: - printf ("num sense=%d case sensitive=%d\n", qt->data.str.sense, qt->data.str.case_sens); - printf ("\tmatch string=%s \n", qt->data.str.matchstring); - break; - case PR_PRICE: - printf ("price sense=%d how=%d\n", qt->data.amount.sense, qt->data.amount.how); - printf ("\tsign=%d amount=%f\n", qt->data.amount.amt_sgn, qt->data.amount.amount); - break; - case PR_SHRS: - printf ("shrs sense=%d how=%d\n", qt->data.amount.sense, qt->data.amount.how); - printf ("\tsign=%d amount=%f\n", qt->data.amount.amt_sgn, qt->data.amount.amount); - break; - - default: - printf ("unkown term type=%d \n", qt->data.base.term_type); - } - } - printf("\n"); - if(i->next) { - printf("\n"); - } - } -} - - -/******************************************************************** - * xaccInitQuery - ********************************************************************/ - -/* initial_term has hand-over semantics! Thus, initial_term must point - * to newly allocated memory or be NULL. */ -static void -xaccInitQuery(Query * q, QueryTerm * initial_term) { - GList * or = NULL; - GList * and = NULL; - - if(initial_term) { - or = g_list_alloc(); - and = g_list_alloc(); - and->data = initial_term; - or->data = and; - } - - if(q->terms) - xaccQueryClear(q); - - q->terms = or; - q->split_list = NULL; - q->changed = 1; - - q->max_splits = -1; - - q->primary_sort = BY_STANDARD; - q->secondary_sort = BY_NONE; - q->tertiary_sort = BY_NONE; - - q->primary_increasing = TRUE; - q->secondary_increasing = TRUE; - q->tertiary_increasing = TRUE; -} - - -/******************************************************************** - * xaccMallocQuery - ********************************************************************/ - -Query * -xaccMallocQuery(void) { - Query * qp = g_new0(Query, 1); - xaccInitQuery(qp, NULL); - return qp; -} - - -/******************************************************************** - * xaccQuerySwapTerms - * swaps the terms fields of two queries, mostly to - * allow quick pass-off of results. - ********************************************************************/ - -static void -xaccQuerySwapTerms(Query * q1, Query * q2) { - GList * g; - - if (!q1 || !q2) - return; - - g = q1->terms; - q1->terms = q2->terms; - q2->terms = g; - - q1->changed = 1; - q2->changed = 1; -} - - -/******************************************************************** - * xaccQueryHasTerms - * returns the number of 'OR' terms in the query, which is generally - * used as a truth test. - ********************************************************************/ - -int -xaccQueryHasTerms(Query * q) -{ - if (!q) - return 0; - - return g_list_length(q->terms); -} - -int -xaccQueryNumTerms(Query * q) -{ - GList *o; - int n=0; - if (!q) - return 0; - - for(o=q->terms; o; o=o->next) { - n += g_list_length(o->data); - } - return n; -} - -GList * -xaccQueryGetTerms (Query *q) -{ - if (!q) return NULL; - return q->terms; -} - - -/******************************************************************** - * xaccQueryHasTermType - * returns TRUE if the query has any terms of the given type - ********************************************************************/ -gboolean -xaccQueryHasTermType(Query * q, pd_type_t type) { - GList *or; - GList *and; - - if (!q) - return FALSE; - - for(or = q->terms; or; or = or->next) { - for(and = or->data; and; and = and->next) { - QueryTerm *qt = and->data; - if(qt->data.type == type) - return TRUE; - } - } - - return FALSE; -} - -static void -free_query_term(QueryTerm *qt) -{ - GList *node; - - if (qt == NULL) - return; - - switch (qt->data.type) - { - case PD_ACCOUNT: - g_list_free (qt->data.acct.accounts); - qt->data.acct.accounts = NULL; - - for (node = qt->data.acct.account_guids; node; node = node->next) - xaccGUIDFree (node->data); - - g_list_free (qt->data.acct.account_guids); - qt->data.acct.account_guids = NULL; - break; - - case PD_STRING: - g_free(qt->data.str.matchstring); - qt->data.str.matchstring = NULL; - break; - - default: - break; - } - - g_free(qt); -} - -static QueryTerm * -copy_query_term(QueryTerm * qt) { - QueryTerm * nqt; - GList *node; - - if (qt == NULL) - return NULL; - - nqt = g_new0(QueryTerm, 1); - - memcpy(nqt, qt, sizeof(QueryTerm)); - - switch (nqt->data.type) - { - case PD_ACCOUNT: - nqt->data.acct.accounts = g_list_copy (nqt->data.acct.accounts); - nqt->data.acct.account_guids = - g_list_copy (nqt->data.acct.account_guids); - for (node = nqt->data.acct.account_guids; node; node = node->next) - { - GUID *old = node->data; - GUID *new = xaccGUIDMalloc (); - - *new = *old; - node->data = new; - } - break; - - case PD_STRING: - nqt->data.str.matchstring = g_strdup(nqt->data.str.matchstring); - break; - - default: - break; - } - - return nqt; -} - -static GList * -copy_and_terms(GList *and_terms) { - GList *and = NULL; - GList *cur_and; - - for(cur_and = and_terms; cur_and; cur_and = cur_and->next) - and = g_list_prepend(and, copy_query_term (cur_and->data)); - - return g_list_reverse(and); -} - -static GList * -copy_or_terms(GList * or_terms) { - GList * or = NULL; - GList * cur_or; - - for(cur_or = or_terms; cur_or; cur_or = cur_or->next) - or = g_list_prepend(or, copy_and_terms(cur_or->data)); - - return g_list_reverse(or); -} - - -/******************************************************************** - * xaccFreeQuery - * note that the terms list is freed, so you must have newly - * allocated it - ********************************************************************/ - -static void -xaccFreeQueryMembers(Query *q) { - GList * cur_or; - - if (q == NULL) - return; - - for(cur_or = q->terms; cur_or; cur_or = cur_or->next) { - GList * cur_and; - - for(cur_and = cur_or->data; cur_and; cur_and = cur_and->next) { - free_query_term(cur_and->data); - cur_and->data = NULL; - } - - g_list_free(cur_or->data); - cur_or->data = NULL; - } - - g_list_free(q->terms); - q->terms = NULL; - - g_list_free(q->split_list); - q->split_list = NULL; -} - -void -xaccFreeQuery(Query * q) { - if (q == NULL) - return; - - xaccFreeQueryMembers (q); - - g_free(q); -} - -Query * -xaccQueryCopy(Query *q) { - Query *copy; - - if (q == NULL) - return NULL; - - copy = xaccMallocQuery (); - xaccFreeQueryMembers (copy); - - copy->terms = copy_or_terms (q->terms); - - copy->primary_sort = q->primary_sort; - copy->secondary_sort = q->secondary_sort; - copy->tertiary_sort = q->tertiary_sort; - - copy->primary_increasing = q->primary_increasing; - copy->secondary_increasing = q->secondary_increasing; - copy->tertiary_increasing = q->tertiary_increasing; - copy->max_splits = q->max_splits; - - copy->changed = q->changed; - copy->acct_group = q->acct_group; - copy->split_list = g_list_copy (q->split_list); - - return copy; -} - -/******************************************************************** - * xaccQueryInvert - * return a newly-allocated Query object which is the - * logical inverse of the original. - ********************************************************************/ - -Query * -xaccQueryInvert(Query * q) { - Query * retval; - Query * right, * left, * iright, * ileft; - QueryTerm * qt; - GList * aterms; - GList * cur; - GList * new_oterm; - int num_or_terms; - - num_or_terms = g_list_length(q->terms); - - switch(num_or_terms) { - case 0: - retval = xaccMallocQuery(); - retval->max_splits = q->max_splits; - retval->acct_group = q->acct_group; - break; - - /* this is demorgan expansion for a single AND expression. */ - /* !(abc) = !a + !b + !c */ - case 1: - retval = xaccMallocQuery(); - retval->max_splits = q->max_splits; - retval->acct_group = q->acct_group; - - aterms = g_list_nth_data(q->terms, 0); - new_oterm = NULL; - for(cur=aterms; cur; cur=cur->next) { - qt = copy_query_term(cur->data); - qt->data.base.sense = !(qt->data.base.sense); - new_oterm = g_list_append(NULL, qt); - retval->terms = g_list_append(retval->terms, new_oterm); - } - break; - - /* if there are multiple OR-terms, we just recurse by - * breaking it down to !(a + b + c) = - * !a * !(b + c) = !a * !b * !c. */ - default: - right = xaccMallocQuery(); - right->terms = copy_or_terms(g_list_nth(q->terms, 1)); - - left = xaccMallocQuery(); - left->terms = g_list_append(NULL, - copy_and_terms(g_list_nth_data(q->terms, 0))); - - iright = xaccQueryInvert(right); - ileft = xaccQueryInvert(left); - - retval = xaccQueryMerge(iright, ileft, QUERY_AND); - retval->max_splits = q->max_splits; - retval->acct_group = q->acct_group; - retval->changed = 1; - - xaccFreeQuery(iright); - xaccFreeQuery(ileft); - xaccFreeQuery(right); - xaccFreeQuery(left); - break; - } - - return retval; -} - - -/******************************************************************** - * xaccQueryMerge - * combine 2 Query objects by the logical operation in "op". - ********************************************************************/ - -Query * -xaccQueryMerge(Query * q1, Query * q2, QueryOp op) { - - Query * retval = NULL; - Query * i1, * i2; - Query * t1, * t2; - GList * i, * j; - - if(!q1 || !q2 || !(q1->acct_group == q2->acct_group)) { - return NULL; - } - - switch(op) { - case QUERY_OR: - retval = xaccMallocQuery(); - retval->terms = - g_list_concat(copy_or_terms(q1->terms), copy_or_terms(q2->terms)); - retval->max_splits = q1->max_splits; - retval->split_list = NULL; /* fixme */ - retval->changed = 1; - retval->acct_group = q1->acct_group; - break; - - case QUERY_AND: - retval = xaccMallocQuery(); - retval->max_splits = q1->max_splits; - retval->split_list = NULL; /* fixme */ - retval->changed = 1; - retval->acct_group = q1->acct_group; - - for(i=q1->terms; i; i=i->next) { - for(j=q2->terms; j; j=j->next) { - retval->terms = - g_list_append(retval->terms, - g_list_concat - (copy_and_terms(i->data), - copy_and_terms(j->data))); - } - } - break; - - case QUERY_NAND: - /* !(a*b) = (!a + !b) */ - i1 = xaccQueryInvert(q1); - i2 = xaccQueryInvert(q2); - retval = xaccQueryMerge(i1, i2, QUERY_OR); - xaccFreeQuery(i1); - xaccFreeQuery(i2); - break; - - case QUERY_NOR: - /* !(a+b) = (!a*!b) */ - i1 = xaccQueryInvert(q1); - i2 = xaccQueryInvert(q2); - retval = xaccQueryMerge(i1, i2, QUERY_AND); - xaccFreeQuery(i1); - xaccFreeQuery(i2); - break; - - case QUERY_XOR: - /* a xor b = (a * !b) + (!a * b) */ - i1 = xaccQueryInvert(q1); - i2 = xaccQueryInvert(q2); - t1 = xaccQueryMerge(q1, i2, QUERY_AND); - t2 = xaccQueryMerge(i1, q2, QUERY_AND); - retval = xaccQueryMerge(t1, t2, QUERY_OR); - - xaccFreeQuery(i1); - xaccFreeQuery(i2); - xaccFreeQuery(t1); - xaccFreeQuery(t2); - break; - } - - return retval; -} - - -/* this sort function just puts account queries at the top of the - * list. this lets us skip accounts that have no chance. */ -static gint -query_sort_func(gconstpointer pa, gconstpointer pb) { - const QueryTerm * a = pa; - const QueryTerm * b = pb; - if(a->data.type == PD_ACCOUNT) { - return -1; - } - else if(b->data.type == PD_ACCOUNT) { - return 1; - } - else if(a->data.type == PD_AMOUNT) { - return -1; - } - else if(b->data.type == PD_AMOUNT) { - return 1; - } - else { - return 0; - } -} - -static int -acct_query_matches(QueryTerm * qt, Account * acct) { - GList *node; - gboolean account_in_set = FALSE; - gboolean first_account = TRUE; - - assert(qt && acct); - assert(qt->data.type == PD_ACCOUNT); - - for(node = qt->data.acct.accounts; node ; node = node->next) { - if(acct == node->data) { - account_in_set = TRUE; - break; - } - first_account = FALSE; - } - - /* if we need the query to match "ALL" accounts, we only return - * true for the first acct in the set. */ - switch(qt->data.acct.how) { - case ACCT_MATCH_ALL: - return (account_in_set && first_account); - break; - - case ACCT_MATCH_ANY: - return account_in_set; - break; - - case ACCT_MATCH_NONE: - return !account_in_set; - break; - } - - return FALSE; -} - -static Query * split_sort_query = NULL; - -static int -date_cmp_func(Timespec *t1, Timespec *t2) { - /* check seconds */ - if (t1->tv_sec < t2->tv_sec) { - return -1; - } - else if (t1->tv_sec > t2->tv_sec) { - return +1; - } - - /* else, seconds match. check nanoseconds */ - if (t1->tv_nsec < t2->tv_nsec) { - return -1; - } - else if (t1->tv_nsec > t2->tv_nsec) { - return +1; - } - - return 0; -} - -/* compared by dates but return 0 if on same day */ - -static int -date_rounded_cmp_func(Timespec *t1, Timespec *t2) -{ - Timespec canon_t1, canon_t2; - canon_t1 = timespecCanonicalDayTime(*t1); - canon_t2 = timespecCanonicalDayTime(*t2); - return date_cmp_func(&canon_t1, &canon_t2); -} - - -static int -split_cmp_func(sort_type_t how, gconstpointer ga, gconstpointer gb) -{ - Split * sa = (Split *)ga; - Split * sb = (Split *)gb; - Transaction * ta; - Transaction * tb; - unsigned long n1; - unsigned long n2; - const char *da, *db; - gnc_numeric fa, fb; - - if (sa && !sb) return -1; - if (!sa && sb) return 1; - if (!sa && !sb) return 0; - - ta = sa->parent; - tb = sb->parent; - - if (ta->orig) ta = ta->orig; - if (tb->orig) tb = tb->orig; - - if ( (ta) && !(tb) ) return -1; - if ( !(ta) && (tb) ) return +1; - if ( !(ta) && !(tb) ) return 0; - - - switch(how) { - case BY_STANDARD: - return xaccSplitDateOrder(sa, sb); - break; - - case BY_DATE: - return date_cmp_func(&(ta->date_posted), &(tb->date_posted)); - - break; - - case BY_DATE_ROUNDED: - return date_rounded_cmp_func(&(ta->date_posted), &(tb->date_posted)); - - break; - - - case BY_DATE_ENTERED: - return date_cmp_func(&(ta->date_entered), &(tb->date_entered)); - - break; - - case BY_DATE_ENTERED_ROUNDED: - return date_rounded_cmp_func(&(ta->date_entered), &(tb->date_entered)); - - break; - - case BY_DATE_RECONCILED: - return date_cmp_func(&(sa->date_reconciled), &(sb->date_reconciled)); - - break; - - case BY_DATE_RECONCILED_ROUNDED: - return date_rounded_cmp_func(&(sa->date_reconciled), &(sb->date_reconciled)); - - break; - - case BY_NUM: - /* sort on transaction number */ - da = ta->num; - db = tb->num; - if (gnc_strisnum(da)) { - if (!gnc_strisnum(db)) { - return -1; - } - sscanf(da, "%lu", &n1); - sscanf(db, "%lu", &n2); - if (n1 < n2) { - return -1; - } - if (n1 == n2) { - return 0; - } - return +1; - } - if (gnc_strisnum(db)) { - return +1; - } - return safe_strcmp (da, db); - break; - - case BY_MEMO: - /* sort on memo strings */ - return safe_strcmp (sa->memo, sb->memo); - break; - - case BY_DESC: - /* sort on transaction strings */ - return safe_strcmp (ta->description, tb->description); - break; - - case BY_AMOUNT: - fa = sa->value; - fb = sb->value; - return gnc_numeric_compare(fa, fb); - break; - - case BY_RECONCILE: - /* Reconcile flags are sorted as: FREC = YREC < CREC = NREC */ - switch (sa->reconciled) { - case YREC: - case FREC: - if (sb->reconciled == YREC) - return 0; - if (sb->reconciled == FREC) - return 0; - return -1; - break; - - case CREC: - case NREC: - if (sb->reconciled == CREC) - return 0; - if (sb->reconciled == NREC) - return 0; - return 1; - break; - } - break; - - case BY_ACCOUNT_FULL_NAME: - return xaccSplitCompareAccountFullNames(sa, sb); - - case BY_ACCOUNT_CODE: - return xaccSplitCompareAccountCodes(sa, sb); - break; - - case BY_CORR_ACCOUNT_FULL_NAME: - return xaccSplitCompareOtherAccountFullNames(sa, sb); - - case BY_CORR_ACCOUNT_CODE: - return xaccSplitCompareOtherAccountCodes(sa, sb); - - case BY_NONE: - return 0; - break; - } - - return 0; -} - -static int -split_sort_func(gconstpointer a, gconstpointer b) { - int retval; - - - assert(split_sort_query); - - retval = split_cmp_func(split_sort_query->primary_sort, a, b); - if((retval == 0) && - (split_sort_query->secondary_sort != BY_NONE)) { - retval = split_cmp_func(split_sort_query->secondary_sort, a, b); - if((retval == 0) && - (split_sort_query->tertiary_sort != BY_NONE)) { - retval = split_cmp_func(split_sort_query->tertiary_sort, a, b); - return split_sort_query->tertiary_increasing ? retval : - retval; - } - else { - return split_sort_query->secondary_increasing ? retval : - retval; - } - } - else { - return split_sort_query->primary_increasing ? retval : - retval; - } -} - - -/******************************************************************** - * xaccQueryCheckSplit - * check a single split against the query. This is a short-circuited - * and-or check, so sorting it with best criteria first is a win. - ********************************************************************/ - -static int -xaccQueryCheckSplit(Query * q, Split * s) { - GList * and_ptr; - GList * or_ptr; - QueryTerm * qt; - int and_terms_ok=1; - - for(or_ptr = q->terms; or_ptr; or_ptr = or_ptr->next) { - and_terms_ok = 1; - for(and_ptr = or_ptr->data; and_ptr; and_ptr = and_ptr->next) { - qt = (QueryTerm *)(and_ptr->data); - if(((qt->p)(s, &(qt->data))) != qt->data.base.sense) { - and_terms_ok = 0; - break; - } - } - if(and_terms_ok) { - return 1; - } - } - return 0; -} - -static GList * -account_list_to_guid_list (GList *accounts) -{ - GList *guids = NULL; - GList *node; - - for (node = accounts; node; node = node->next) - { - Account *account = node->data; - GUID *guid; - - if (!account) - continue; - - guid = xaccGUIDMalloc (); - *guid = *xaccAccountGetGUID (account); - - guids = g_list_prepend (guids, guid); - } - - return g_list_reverse (guids); -} - -static GList * -copy_guid_list (GList *guids) -{ - GList *new_guids = NULL; - GList *node; - - for (node = guids; node; node = node->next) - { - GUID *guid = node->data; - GUID *new_guid; - - if (!guid) - continue; - - new_guid = xaccGUIDMalloc (); - *new_guid = *guid; - - new_guids = g_list_prepend (new_guids, new_guid); - } - - return g_list_reverse (new_guids); -} - -static GList * -guid_list_to_account_list (GList *guids) -{ - GList *accounts = NULL; - GList *node; - - for (node = guids; node; node = node->next) - { - GUID *guid = node->data; - Account *account; - - if (!guid) - continue; - - account = xaccAccountLookup (guid); - if (!account) - continue; - - accounts = g_list_prepend (accounts, account); - } - - return g_list_reverse (accounts); -} - -/******************************************************************** - * xaccQueryCompileTerms - * Prepare terms for processing by xaccQueryGetSplits - ********************************************************************/ -static void -xaccQueryCompileTerms (Query *q) -{ - GList * or_ptr, * and_ptr; - - for(or_ptr = q->terms; or_ptr ; or_ptr = or_ptr->next) { - for(and_ptr = or_ptr->data; and_ptr; and_ptr = and_ptr->next) { - QueryTerm *qt = and_ptr->data; - switch (qt->data.type) - { - case PD_ACCOUNT: - g_list_free (qt->data.acct.accounts); - qt->data.acct.accounts = - guid_list_to_account_list (qt->data.acct.account_guids); - break; - - default: - break; - } - } - } -} - -/******************************************************************** - * xaccQueryGetSplits - * Run the search. - ********************************************************************/ - -GList * -xaccQueryGetSplits(Query * q) { - GList * matching_splits=NULL; - GList * or_ptr, * and_ptr, * mptr; - GList * all_accts, * node; - Account * current; - QueryTerm * qt; - Backend * be; - - int total_splits_checked = 0; - int split_count = 0; - int acct_ok; - - if (!q) return NULL; - ENTER("query=%p", q); - - /* tmp hack alert */ - q->changed = 1; - - if(q->changed == 0) { - return q->split_list; - } - - /* prioritize the query terms for a faster search. This - * will put account queries at the top of the AND chains. */ - - /* FIXME : sort for securities queries and eliminate non- - * security accounts */ - for(or_ptr = q->terms; or_ptr ; or_ptr = or_ptr->next) { - and_ptr = or_ptr->data; - or_ptr->data = g_list_sort(and_ptr, query_sort_func); - } - - /* prepare the terms for processing */ - xaccQueryCompileTerms (q); - - /* if there is a backend, query the backend, let it fetch the data */ - be = xaccGroupGetBackend (q->acct_group); - if (be && be->run_query) { - (be->run_query) (be, q); - } - - /* iterate over accounts */ - all_accts = xaccGroupGetSubAccounts (q->acct_group); - - for (node = all_accts; node; node = node->next) { - current = node->data; - - if (!current) - continue; - - /* first, check this account to see if we need to look at it at - * all. If the query is "ANY" matching or "NONE" matching, you - * get what you expect; if it's "ALL" matching, only the first - * account in the query matches. This could be optimized to only - * look at the smallest account. */ - acct_ok = 0; - for(or_ptr = q->terms; or_ptr ; or_ptr = or_ptr->next) { - and_ptr = or_ptr->data; - qt = and_ptr->data; - - if(qt->data.type == PD_ACCOUNT) { - if(acct_query_matches(qt, current)) { - acct_ok = 1; - break; - } - } - else { - /* if the first query term isn't an account, then we have to - * look at every split in every account. */ - - /* FIXME : security accounts can be ruled out */ - acct_ok = 1; - break; - } - } - - if(acct_ok) { - GList *lp; - - /* iterate over splits */ - for(lp = xaccAccountGetSplitList(current); lp; lp = lp->next) { - Split *s = (Split *) lp->data; - if(xaccQueryCheckSplit(q, s)) { - matching_splits = g_list_prepend(matching_splits, s); - split_count++; - } - total_splits_checked++; - } - } - } - - g_list_free (all_accts); - - /* There is no absolute need to reverse this list, since it's - * being sorted below. However, in the common case, we will be - * searching in a single account and returning in the account - * order, thus reversing will put us in the correct order we - * want and make the sorting go much faster. */ - matching_splits = g_list_reverse(matching_splits); - - /* now sort the matching splits based on the search criteria - * split_sort_query is an unforgivable use of static global data... - * I just can't figure out how else to do this sanely. */ - split_sort_query = q; - matching_splits = g_list_sort(matching_splits, split_sort_func); - - /* crop the list to limit the number of splits */ - if((split_count > q->max_splits) && (q->max_splits > -1)) { - if(q->max_splits > 0) { - /* mptr is set to the first node of what will be the new list */ - mptr = g_list_nth(matching_splits, split_count - q->max_splits); - /* mptr should not be NULL, but let's be safe */ - if (mptr != NULL) { - if (mptr->prev != NULL) - mptr->prev->next = NULL; - mptr->prev = NULL; - } - g_list_free(matching_splits); - matching_splits = mptr; - } - else { /* q->max_splits == 0 */ - g_list_free(matching_splits); - matching_splits = NULL; - } - split_count = q->max_splits; - } - - q->changed = 0; - - g_list_free(q->split_list); - q->split_list = matching_splits; - - return matching_splits; -} - -/******************************************************************** - * xaccQueryGetSplitsUniqueTrans - * Get splits but no more than one from a given transaction. - ********************************************************************/ - -GList * -xaccQueryGetSplitsUniqueTrans(Query *q) -{ - GList * splits = xaccQueryGetSplits(q); - GList * current; - GList * result = NULL; - GHashTable * trans_hash = g_hash_table_new(g_direct_hash, g_direct_equal); - - for (current = splits; current; current = current->next) - { - Split *split = current->data; - Transaction *trans = xaccSplitGetParent (split); - - if (!g_hash_table_lookup (trans_hash, trans)) - { - g_hash_table_insert (trans_hash, trans, trans); - result = g_list_prepend (result, split); - } - } - - g_hash_table_destroy (trans_hash); - - return g_list_reverse (result); -} - -/******************************************************************** - * xaccQueryGetTransactions - * Get transactions matching the query terms, specifying whether - * we require some or all splits to match - ********************************************************************/ - -static void -query_match_all_filter_func(gpointer key, gpointer value, gpointer user_data) { - Transaction * t = key; - int num_matches = GPOINTER_TO_INT(value); - GList ** matches = user_data; - - if(num_matches == xaccTransCountSplits(t)) { - *matches = g_list_prepend(*matches, t); - } -} - -static void -query_match_any_filter_func(gpointer key, gpointer value, gpointer user_data) { - Transaction * t = key; - GList ** matches = user_data; - *matches = g_list_prepend(*matches, t); -} - -GList * -xaccQueryGetTransactions (Query * q, query_run_t runtype) { - GList * splits = xaccQueryGetSplits(q); - GList * current = NULL; - GList * retval = NULL; - GHashTable * trans_hash = g_hash_table_new(g_direct_hash, g_direct_equal); - Transaction * trans = NULL; - gpointer val = NULL; - int count = 0; - - /* iterate over matching splits, incrementing a match-count in - * the hash table */ - for(current = splits; current; current=current->next) { - trans = xaccSplitGetParent((Split *)(current->data)); - - /* don't waste time looking up unless we need the count - * information */ - if(runtype == QUERY_MATCH_ALL) { - val = g_hash_table_lookup(trans_hash, trans); - count = GPOINTER_TO_INT(val); - } - g_hash_table_insert(trans_hash, trans, GINT_TO_POINTER(count + 1)); - } - - /* now pick out the transactions that match */ - if(runtype == QUERY_MATCH_ALL) { - g_hash_table_foreach(trans_hash, query_match_all_filter_func, - &retval); - } - else { - g_hash_table_foreach(trans_hash, query_match_any_filter_func, - &retval); - } - - /* ATM we rerun the xtn filter every time. Need to add checks and - * updates for using cached results. */ - q->last_run_type = runtype; - q->xtn_list = retval; - - g_hash_table_destroy(trans_hash); - - return retval; -} - -/******************************************************************** - * xaccQueryEqual - * Compare two queries for equality - ********************************************************************/ - -static gboolean -xaccQueryTermEqual (QueryTerm *qt1, QueryTerm *qt2) -{ - GList *l1, *l2; - - if (qt1 == qt2) return TRUE; - if (!qt1 || !qt2) return FALSE; - - if (qt1->p != qt2->p) return FALSE; - if (qt1->data.type != qt2->data.type) return FALSE; - if (qt1->data.base.term_type != qt2->data.base.term_type) return FALSE; - if (qt1->data.base.sense != qt2->data.base.sense) return FALSE; - - switch (qt1->data.type) - { - case PD_DATE: - if (qt1->data.date.use_start != qt2->data.date.use_start) return FALSE; - if (qt1->data.date.use_end != qt2->data.date.use_end) return FALSE; - if (!timespec_equal (&qt1->data.date.start, &qt2->data.date.start)) - return FALSE; - if (!timespec_equal (&qt1->data.date.end, &qt2->data.date.end)) - return FALSE; - break; - - case PD_AMOUNT: - if (qt1->data.amount.how != qt2->data.amount.how) return FALSE; - if (qt1->data.amount.amt_sgn != qt2->data.amount.amt_sgn) return FALSE; - if (qt1->data.amount.amount != qt2->data.amount.amount) - return FALSE; - break; - - case PD_ACCOUNT: - if (qt1->data.acct.how != qt2->data.acct.how) return FALSE; - l1 = qt1->data.acct.account_guids; - l2 = qt2->data.acct.account_guids; - if (g_list_length (l1) != g_list_length (l2)) return FALSE; - for ( ; l1; l1 = l1->next, l2 = l2->next) - if (!guid_equal (l1->data, l2->data)) - return FALSE; - break; - - case PD_STRING: - if (qt1->data.str.case_sens != qt2->data.str.case_sens) - return FALSE; - if (qt1->data.str.use_regexp != qt2->data.str.use_regexp) - return FALSE; - if (strcmp (qt1->data.str.matchstring, qt2->data.str.matchstring) != 0) - return FALSE; - break; - - case PD_CLEARED: - if (qt1->data.cleared.how != qt2->data.cleared.how) return FALSE; - break; - - case PD_BALANCE: - if (qt1->data.balance.how != qt2->data.balance.how) return FALSE; - break; - - case PD_GUID: - if (!guid_equal (&qt1->data.guid.guid, &qt2->data.guid.guid)) - return FALSE; - break; - - case PD_MISC: - if (qt1->data.misc.how != qt2->data.misc.how) return FALSE; - if (qt1->data.misc.data != qt2->data.misc.data) return FALSE; - break; - - default: - PERR ("bad query term type"); - return FALSE; - } - - return TRUE; -} - -gboolean -xaccQueryEqual (Query *q1, Query *q2) -{ - GList *or1, *or2; - - if (q1 == q2) return TRUE; - if (!q1 || !q2) return FALSE; - - if (g_list_length (q1->terms) != g_list_length (q2->terms)) return FALSE; - - for (or1 = q1->terms, or2 = q2->terms; or1; - or1 = or1->next, or2 = or2->next) - { - GList *and1, *and2; - - and1 = or1->data; - and2 = or2->data; - - if (g_list_length (and1) != g_list_length (and2)) return FALSE; - - for ( ; and1; and1 = and1->next, and2 = and2->next) - if (!xaccQueryTermEqual (and1->data, and2->data)) - return FALSE; - } - - if (q1->primary_sort != q2->primary_sort) return FALSE; - if (q1->secondary_sort != q2->secondary_sort) return FALSE; - if (q1->tertiary_sort != q2->tertiary_sort) return FALSE; - - if (q1->primary_increasing != q2->primary_increasing) return FALSE; - if (q1->secondary_increasing != q2->secondary_increasing) return FALSE; - if (q1->tertiary_increasing != q2->tertiary_increasing) return FALSE; - - if (q1->max_splits != q2->max_splits) return FALSE; - - return TRUE; -} - -Predicate -xaccQueryGetPredicate (pr_type_t term_type) -{ - Predicate p = NULL; - - /* the predicates are only known in the local - * address space, which is why we have to set them - * from the abstract type here. - */ - switch (term_type) - { - case PR_ACCOUNT: - p = & xaccAccountMatchPredicate; - break; - case PR_ACTION: - p = & xaccActionMatchPredicate; - break; - case PR_AMOUNT: - p = & xaccAmountMatchPredicate; - break; - case PR_BALANCE: - p = & xaccBalanceMatchPredicate; - break; - case PR_CLEARED: - p = & xaccClearedMatchPredicate; - break; - case PR_DATE: - p = & xaccDateMatchPredicate; - break; - case PR_DESC: - p = & xaccDescriptionMatchPredicate; - break; - case PR_GUID: - p = & xaccGUIDMatchPredicate; - break; - case PR_MEMO: - p = & xaccMemoMatchPredicate; - break; - case PR_NUM: - p = & xaccNumberMatchPredicate; - break; - case PR_PRICE: - p = & xaccSharePriceMatchPredicate; - break; - case PR_SHRS: - p = & xaccSharesMatchPredicate; - break; - case PR_MISC: - PERR ("misc term must not appear"); - break; - } - return p; -} - -/******************************************************************** - * xaccQueryAddPredicate - * Add a predicate an existing query. - ********************************************************************/ - -void -xaccQueryAddPredicate (Query * q, - PredicateData *pred, - QueryOp op) -{ - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->data = *pred; - qt->p = xaccQueryGetPredicate (qt->data.base.term_type); - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddAccountMatch - * Add an account filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddAccountMatch(Query * q, GList * accounts, acct_match_t how, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccAccountMatchPredicate; - qt->data.type = PD_ACCOUNT; - qt->data.base.term_type = PR_ACCOUNT; - qt->data.base.sense = 1; - qt->data.acct.how = how; - qt->data.acct.accounts = NULL; - qt->data.acct.account_guids = account_list_to_guid_list (accounts); - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddAccountGUIDMatch - * Add an account filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddAccountGUIDMatch(Query * q, GList * account_guids, - acct_match_t how, QueryOp op) -{ - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccAccountMatchPredicate; - qt->data.type = PD_ACCOUNT; - qt->data.base.term_type = PR_ACCOUNT; - qt->data.base.sense = 1; - qt->data.acct.how = how; - qt->data.acct.accounts = NULL; - qt->data.acct.account_guids = copy_guid_list (account_guids); - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddSingleAccountMatch - * Add an account filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddSingleAccountMatch(Query * q, Account * acct, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccAccountMatchPredicate; - qt->data.type = PD_ACCOUNT; - qt->data.base.term_type = PR_ACCOUNT; - qt->data.base.sense = 1; - qt->data.acct.how = ACCT_MATCH_ANY; - qt->data.acct.accounts = g_list_prepend(NULL, acct); - qt->data.acct.account_guids - = account_list_to_guid_list (qt->data.acct.accounts); - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * xaccQueryAddDescriptionMatch - * Add a description filter to an existing query - ********************************************************************/ - -void -xaccQueryAddDescriptionMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - int flags = REG_EXTENDED; - - qt->p = & xaccDescriptionMatchPredicate; - qt->data.type = PD_STRING; - qt->data.base.term_type = PR_DESC; - qt->data.base.sense = 1; - qt->data.str.case_sens = case_sens; - qt->data.str.use_regexp = use_regexp; - qt->data.str.matchstring = g_strdup(matchstring); - - if(!case_sens) { - flags |= REG_ICASE; - } - - if(use_regexp) { - regcomp(&qt->data.str.compiled, matchstring, flags); - } - else if(!case_sens) { - char *s; - - for(s = qt->data.str.matchstring; *s; s++) { - *s = tolower(*s); - } - } - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * xaccQueryAddMemoMatch - * Add a memo conparison to an existing query - ********************************************************************/ - -void -xaccQueryAddMemoMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - int flags = REG_EXTENDED; - - qt->p = & xaccMemoMatchPredicate; - qt->data.type = PD_STRING; - qt->data.base.term_type = PR_MEMO; - qt->data.base.sense = 1; - qt->data.str.case_sens = case_sens; - qt->data.str.use_regexp = use_regexp; - qt->data.str.matchstring = g_strdup(matchstring); - - if(!case_sens) { - flags |= REG_ICASE; - } - - if(use_regexp) { - regcomp(&qt->data.str.compiled, matchstring, flags); - } - else if(!case_sens) { - char *s; - - for(s = qt->data.str.matchstring; *s; s++) { - *s = tolower(*s); - } - } - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * xaccQueryAddDateMatchTS - * Add a date filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddDateMatchTS(Query * q, - int use_start, - Timespec sts, - int use_end, - Timespec ets, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccDateMatchPredicate; - qt->data.type = PD_DATE; - qt->data.base.term_type = PR_DATE; - qt->data.base.sense = 1; - qt->data.date.use_start = use_start; - qt->data.date.use_end = use_end; - qt->data.date.start = sts; - qt->data.date.end = ets; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddDateMatch - * Add a date filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddDateMatch(Query * q, - int use_start, int sday, int smonth, int syear, - int use_end, int eday, int emonth, int eyear, - QueryOp op) -{ - /* gcc -O3 will auto-inline this function, avoiding a call overhead */ - xaccQueryAddDateMatchTS (q, use_start, - gnc_dmy2timespec(sday, smonth, syear), - use_end, - gnc_dmy2timespec_end(eday, emonth, eyear), - op); -} - -/******************************************************************** - * xaccQueryAddDateMatchTT - * Add a date filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddDateMatchTT(Query * q, - int use_start, - time_t stt, - int use_end, - time_t ett, - QueryOp op) -{ - Timespec sts; - Timespec ets; - - sts.tv_sec = (long long)stt; - sts.tv_nsec = 0; - - ets.tv_sec = (long long)ett; - ets.tv_nsec = 0; - - /* gcc -O3 will auto-inline this function, avoiding a call overhead */ - xaccQueryAddDateMatchTS (q, use_start, sts, - use_end, ets, op); - -} - -/******************************************************************** - * xaccQueryAddNumberMatch - * Add a number-field filter - ********************************************************************/ -void -xaccQueryAddNumberMatch(Query * q, const char * matchstring, int case_sens, - int use_regexp, QueryOp op) { - - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - int flags = REG_EXTENDED; - - qt->p = & xaccNumberMatchPredicate; - qt->data.type = PD_STRING; - qt->data.base.term_type = PR_NUM; - qt->data.base.sense = 1; - qt->data.str.case_sens = case_sens; - qt->data.str.use_regexp = use_regexp; - qt->data.str.matchstring = g_strdup(matchstring); - - if(!case_sens) { - flags |= REG_ICASE; - } - - if(use_regexp) { - regcomp(&qt->data.str.compiled, matchstring, flags); - } - else if(!case_sens) { - char *s; - - for(s = qt->data.str.matchstring; *s; s++) { - *s = tolower(*s); - } - } - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * xaccQueryAddActionMatch - * Add a action-field filter - ********************************************************************/ -void -xaccQueryAddActionMatch(Query * q, const char * matchstring, int case_sens, - int use_regexp, QueryOp op) { - - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - int flags = REG_EXTENDED; - - qt->p = & xaccActionMatchPredicate; - qt->data.type = PD_STRING; - qt->data.base.term_type = PR_ACTION; - qt->data.base.sense = 1; - qt->data.str.case_sens = case_sens; - qt->data.str.use_regexp = use_regexp; - qt->data.str.matchstring = g_strdup(matchstring); - - if(!case_sens) { - flags |= REG_ICASE; - } - - if(use_regexp) { - regcomp(&qt->data.str.compiled, matchstring, flags); - } - else if(!case_sens) { - char *s; - - for(s = qt->data.str.matchstring; *s; s++) { - *s = tolower(*s); - } - } - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * DxaccQueryAddAmountMatch - * Add a value filter to an existing query. - * FIXME ?? fix what ?? - ********************************************************************/ - -void -DxaccQueryAddAmountMatch(Query * q, double amt, - amt_match_sgn_t amt_sgn, - amt_match_t how, - QueryOp op) { - - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccAmountMatchPredicate; - qt->data.type = PD_AMOUNT; - qt->data.base.term_type = PR_AMOUNT; - qt->data.base.sense = 1; - qt->data.amount.how = how; - qt->data.amount.amt_sgn = amt_sgn; - qt->data.amount.amount = amt; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * DxaccQueryAddSharePriceMatch - * Add a share-price filter to an existing query. - * FIXME ?? fix what ?? - ********************************************************************/ - -void -DxaccQueryAddSharePriceMatch(Query * q, double amt, - amt_match_t how, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccSharePriceMatchPredicate; - qt->data.type = PD_AMOUNT; - qt->data.base.term_type = PR_PRICE; - qt->data.base.sense = 1; - qt->data.amount.how = how; - qt->data.amount.amt_sgn = AMT_SGN_MATCH_EITHER; - qt->data.amount.amount = amt; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * DxaccQueryAddSharesMatch - * Add a quantity filter to an existing query. - * FIXME ?? fix what ?? - ********************************************************************/ - -void -DxaccQueryAddSharesMatch(Query * q, double amt, - amt_match_t how, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccSharesMatchPredicate; - qt->data.type = PD_AMOUNT; - qt->data.base.term_type = PR_SHRS; - qt->data.base.sense = 1; - qt->data.amount.how = how; - qt->data.amount.amt_sgn = AMT_SGN_MATCH_EITHER; - qt->data.amount.amount = amt; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - - -/******************************************************************** - * xaccQueryAddMiscMatch - * Add an arbitrary predicate to a query. You really shouldn't - * do this. - ********************************************************************/ - -void -xaccQueryAddMiscMatch(Query * q, Predicate p, int how, int data, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = p; - qt->data.type = PD_MISC; - qt->data.base.term_type = PR_MISC; - qt->data.base.sense = 1; - qt->data.misc.how = how; - qt->data.misc.data = data; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddClearedMatch - * Add a 'cleared' filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddClearedMatch(Query * q, cleared_match_t how, - QueryOp op) { - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccClearedMatchPredicate; - qt->data.type = PD_CLEARED; - qt->data.base.term_type = PR_CLEARED; - qt->data.base.sense = 1; - qt->data.cleared.how = how; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddBalanceMatch - * Add a 'balance' filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddBalanceMatch(Query * q, balance_match_t how, QueryOp op) -{ - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccBalanceMatchPredicate; - qt->data.type = PD_BALANCE; - qt->data.base.term_type = PR_BALANCE; - qt->data.base.sense = 1; - qt->data.balance.how = how; - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************** - * xaccQueryAddGUIDMatch - * Add a 'guid' filter to an existing query. - ********************************************************************/ - -void -xaccQueryAddGUIDMatch(Query * q, const GUID *guid, QueryOp op) -{ - Query * qs = xaccMallocQuery(); - QueryTerm * qt = g_new0(QueryTerm, 1); - Query * qr; - - qt->p = & xaccGUIDMatchPredicate; - qt->data.type = PD_GUID; - qt->data.base.term_type = PR_GUID; - qt->data.base.sense = 1; - qt->data.guid.guid = guid ? *guid : *xaccGUIDNULL (); - - xaccInitQuery(qs, qt); - xaccQuerySetGroup(qs, q->acct_group); - - if(xaccQueryHasTerms(q)) { - qr = xaccQueryMerge(q, qs, op); - } - else { - qr = xaccQueryMerge(q, qs, QUERY_OR); - } - xaccQuerySwapTerms(q, qr); - xaccFreeQuery(qs); - xaccFreeQuery(qr); -} - -/******************************************************************* - * xaccQueryPurgeTerms - * delete any terms of a particular type - *******************************************************************/ - -void -xaccQueryPurgeTerms(Query * q, pd_type_t type) { - QueryTerm * qt; - GList * or; - GList * and; - - if (!q) - return; - - for(or = q->terms; or; or = or->next) { - for(and = or->data; and; and = and->next) { - qt = and->data; - if(qt->data.type == type) { - if(g_list_length(or->data) == 1) { - q->terms = g_list_remove_link(q->terms, or); - g_list_free_1(or); - or = q->terms; - break; - } - else { - or->data = g_list_remove_link(or->data, and); - g_list_free_1(and); - and = or->data; - if(!and) break; - } - q->changed = 1; - free_query_term(qt); - } - } - if(!or) break; - } -} - - -/******************************************************************* - * xaccQueryClear - * remove all terms from a query. - *******************************************************************/ - -void -xaccQueryClear(Query * q) -{ - Query * q2 = xaccMallocQuery(); - xaccQuerySwapTerms(q, q2); - q->changed = 1; - xaccFreeQuery(q2); -} - - -/******************************************************************* - * string_match_predicate - * internal subroutine for description and memo matching - *******************************************************************/ - -static int -string_match_predicate(const char * s, PredicateData * pd) -{ - regmatch_t match; - - assert(s && pd && (pd->type == PD_STRING)); - - if(!pd->str.matchstring) return 0; - - if(pd->str.use_regexp) { - if(!regexec(&pd->str.compiled, s, 1, &match, 0)) { - return 1; - } - else { - return 0; - } - } - else if(pd->str.case_sens) { - if(strstr(s, pd->str.matchstring)) return 1; - else return 0; - } - else { - /* use case-insensitive compare */ - if(strcasestr(s, pd->str.matchstring)) return 1; - else return 0; - } - -} - - -/******************************************************************* - * value_match_predicate - *******************************************************************/ -static int -value_match_predicate(double splitamt, PredicateData * pd) { - switch(pd->amount.how) { - case AMT_MATCH_ATLEAST: - return fabs(splitamt) >= pd->amount.amount; - break; - case AMT_MATCH_ATMOST: - return fabs(splitamt) <= pd->amount.amount; - break; - case AMT_MATCH_EXACTLY: - return fabs(fabs(splitamt) - fabs(pd->amount.amount)) < .0001; - break; - } - - return 0; -} - - -/******************************************************************* - * xaccAccountMatchPredicate - *******************************************************************/ -static int -xaccAccountMatchPredicate(Split * s, PredicateData * pd) { - Transaction * parent; - Split * split; - Account * split_acct; - GList * acct_node; - int i; - int numsplits; - - assert(s && pd); - assert(pd->type == PD_ACCOUNT); - - - switch(pd->acct.how) { - case ACCT_MATCH_ALL: - /* there must be a split in parent that matches each of the - * accounts listed in pd. */ - parent = xaccSplitGetParent(s); - assert(parent); - numsplits = xaccTransCountSplits(parent); - for(acct_node=pd->acct.accounts; acct_node; acct_node=acct_node->next) { - for(i=0; i < numsplits; i++) { - split = xaccTransGetSplit(parent, i); - if(acct_node->data == xaccSplitGetAccount(split)) { - /* break here means we found a match before running out - * of splits (success) */ - break; - } - } - if(i == numsplits) { - /* break here means we ran out of splits before finding - * an account (failure) */ - break; - } - } - if(acct_node) return 0; - else return 1; - - break; - - case ACCT_MATCH_ANY: - /* s must match an account in pd */ - split_acct = xaccSplitGetAccount(s); - return (g_list_find(pd->acct.accounts, split_acct) != NULL); - break; - - case ACCT_MATCH_NONE: - /* s must match no account in pd */ - split_acct = xaccSplitGetAccount(s); - return (g_list_find(pd->acct.accounts, split_acct) == NULL); - break; - } - - return 0; -} - - -/******************************************************************* - * xaccDescriptionMatchPredicate - *******************************************************************/ -static int -xaccDescriptionMatchPredicate(Split * s, PredicateData * pd) { - Transaction * parent; - const char * descript; - - assert(s && pd); - assert(pd->type == PD_STRING); - - parent = xaccSplitGetParent(s); - assert(parent); - - descript = xaccTransGetDescription(parent); - return string_match_predicate(descript, pd); -} - -/******************************************************************* - * xaccGUIDMatchPredicate - *******************************************************************/ -static int -xaccGUIDMatchPredicate(Split * s, PredicateData * pd) -{ - GUIDPredicateData *gpd; - GUID *guid; - - assert(s && pd); - assert(pd->type == PD_GUID); - - guid = &pd->guid.guid; - - switch (xaccGUIDType (guid)) - { - case GNC_ID_NONE: - case GNC_ID_NULL: - default: - return 0; - - case GNC_ID_ACCOUNT: - return xaccSplitGetAccount (s) == xaccAccountLookup (guid); - - case GNC_ID_TRANS: - return xaccSplitGetParent (s) == xaccTransLookup (guid); - - case GNC_ID_SPLIT: - return s == xaccSplitLookup (guid); - } -} - -/******************************************************************* - * xaccNumberMatchPredicate - *******************************************************************/ -static int -xaccNumberMatchPredicate(Split * s, PredicateData * pd) { - Transaction * parent; - const char * number; - - assert(s && pd); - assert(pd->type == PD_STRING); - - parent = xaccSplitGetParent(s); - assert(parent); - - number = xaccTransGetNum(parent); - return string_match_predicate(number, pd); -} - - -/******************************************************************* - * xaccActionMatchPredicate - *******************************************************************/ -static int -xaccActionMatchPredicate(Split * s, PredicateData * pd) { - const char * action; - - assert(s && pd); - assert(pd->type == PD_STRING); - - action = xaccSplitGetAction(s); - return string_match_predicate(action, pd); -} - - -/******************************************************************* - * xaccMemoMatchPredicate - *******************************************************************/ -static int -xaccMemoMatchPredicate(Split * s, PredicateData * pd) { - const char * memo; - - assert(s && pd); - memo = xaccSplitGetMemo(s); - - return string_match_predicate(memo, pd); -} - - -/******************************************************************* - * xaccAmountMatchPredicate - *******************************************************************/ -static int -xaccAmountMatchPredicate(Split * s, PredicateData * pd) { - double splitamt; - - assert(s && pd); - assert(pd->type == PD_AMOUNT); - - splitamt = DxaccSplitGetValue(s); - - switch(pd->amount.amt_sgn) { - case AMT_SGN_MATCH_CREDIT: - if(splitamt > 0.0) return 0; - break; - case AMT_SGN_MATCH_DEBIT: - if(splitamt < 0.0) return 0; - break; - default: - break; - } - - return value_match_predicate(splitamt, pd); -} - -/******************************************************************* - * xaccSharePriceMatchPredicate - *******************************************************************/ -static int -xaccSharePriceMatchPredicate(Split * s, PredicateData * pd) { - double splitamt; - Account * acct; - int type; - - assert(s && pd); - assert(pd->type == PD_AMOUNT); - - acct = xaccSplitGetAccount(s); - type = xaccAccountGetType(acct); - - if((type != STOCK) && (type != MUTUAL)) { - return 0; - } - splitamt = DxaccSplitGetSharePrice(s); - - return value_match_predicate(splitamt, pd); -} - - -/******************************************************************* - * xaccSharesMatchPredicate - *******************************************************************/ -static int -xaccSharesMatchPredicate(Split * s, PredicateData * pd) { - double splitamt; - Account * acct; - int type; - - assert(s && pd); - assert(pd->type == PD_AMOUNT); - - acct = xaccSplitGetAccount(s); - type = xaccAccountGetType(acct); - - if((type != STOCK) && (type != MUTUAL)) { - return 0; - } - - splitamt = DxaccSplitGetShareAmount(s); - - return value_match_predicate(splitamt, pd); -} - - -/******************************************************************* - * xaccDateMatchPredicate - *******************************************************************/ -static int -xaccDateMatchPredicate(Split * s, PredicateData * pd) { - Timespec transtime; - - assert(s && pd); - assert(pd->type == PD_DATE); - - xaccTransGetDatePostedTS(xaccSplitGetParent(s), &transtime); - - if(pd->date.use_start && pd->date.use_end) { - return ((transtime.tv_sec >= pd->date.start.tv_sec) && - (transtime.tv_sec <= pd->date.end.tv_sec)); - } - else if(pd->date.use_start) { - return ((transtime.tv_sec >= pd->date.start.tv_sec)); - } - else if(pd->date.use_end) { - return ((transtime.tv_sec <= pd->date.end.tv_sec)); - } - else { - return 1; - } -} - -/******************************************************************* - * xaccClearedMatchPredicate - *******************************************************************/ -static int -xaccClearedMatchPredicate(Split * s, PredicateData * pd) { - int cstate; - - assert(s && pd); - assert(pd->type == PD_CLEARED); - - cstate = xaccSplitGetReconcile(s); - switch(cstate) { - case CREC: - return ((pd->cleared.how & CLEARED_CLEARED) ? 1 : 0); - break; - case YREC: - return ((pd->cleared.how & CLEARED_RECONCILED) ? 1 : 0); - break; - case FREC: - return ((pd->cleared.how & CLEARED_FROZEN) ? 1 : 0); - break; - case NREC: - return ((pd->cleared.how & CLEARED_NO) ? 1 : 0); - break; - } - - return 0; -} - -/******************************************************************* - * xaccBalanceMatchPredicate - *******************************************************************/ -static int -xaccBalanceMatchPredicate(Split * s, PredicateData * pd) { - gboolean balanced; - - assert(s && pd); - assert(pd->type == PD_BALANCE); - - if ((pd->balance.how & BALANCE_BALANCED) && - (pd->balance.how & BALANCE_UNBALANCED)) - return 1; - - balanced = - gnc_numeric_zero_p (xaccTransGetImbalance (xaccSplitGetParent (s))); - - if (balanced && (pd->balance.how & BALANCE_BALANCED)) - return 1; - - if (!balanced && (pd->balance.how & BALANCE_UNBALANCED)) - return 1; - - return 0; -} - - -/******************************************************************* - * xaccQuerySetSortOrder - *******************************************************************/ -void -xaccQuerySetSortOrder(Query * q, sort_type_t primary, - sort_type_t secondary, sort_type_t tertiary) { - if (!q) return; - q->primary_sort = primary; - q->secondary_sort = secondary; - q->tertiary_sort = tertiary; - - q->changed = 1; -} - -/******************************************************************* - * xaccQueryGetPrimarySortOrder - *******************************************************************/ -sort_type_t -xaccQueryGetPrimarySortOrder(Query * q) -{ - if (!q) return BY_NONE; - return q->primary_sort; -} - -/******************************************************************* - * xaccQueryGetSecondarySortOrder - *******************************************************************/ -sort_type_t -xaccQueryGetSecondarySortOrder(Query * q) -{ - if (!q) return BY_NONE; - return q->secondary_sort; -} - -/******************************************************************* - * xaccQueryGetTertiarySortOrder - *******************************************************************/ -sort_type_t -xaccQueryGetTertiarySortOrder(Query * q) -{ - if (!q) return BY_NONE; - return q->tertiary_sort; -} - -/******************************************************************* - * xaccQuerySetSortIncreasing - *******************************************************************/ -void -xaccQuerySetSortIncreasing(Query * q, gboolean prim_increasing, - gboolean sec_increasing, - gboolean tert_increasing) -{ - if (!q) return; - q->primary_increasing = prim_increasing; - q->secondary_increasing = sec_increasing; - q->tertiary_increasing = tert_increasing; - return; -} - -/******************************************************************* - * xaccQueryGetSortPrimaryIncreasing - *******************************************************************/ -gboolean -xaccQueryGetSortPrimaryIncreasing (Query *q) -{ - if (!q) return TRUE; - return q->primary_increasing; -} - -/******************************************************************* - * xaccQueryGetSortSecondaryIncreasing - *******************************************************************/ -gboolean -xaccQueryGetSortSecondaryIncreasing (Query *q) -{ - if (!q) return TRUE; - return q->secondary_increasing; -} - -/******************************************************************* - * xaccQueryGetSortTertiaryIncreasing - *******************************************************************/ -gboolean -xaccQueryGetSortTertiaryIncreasing (Query *q) -{ - if (!q) return TRUE; - return q->tertiary_increasing; -} - -/******************************************************************* - * xaccQuerySetMaxSplits - *******************************************************************/ -void -xaccQuerySetMaxSplits(Query * q, int n) { - if (!q) return; - q->max_splits = n; -} - -int -xaccQueryGetMaxSplits(Query * q) { - if (!q) return 0; - return q->max_splits; -} - - -/******************************************************************* - * xaccQuerySetGroup - *******************************************************************/ -void -xaccQuerySetGroup(Query * q, AccountGroup * g) { - if (!q) return; - q->acct_group = g; -} - - -/******************************************************************* - * xaccQueryGetGroup - *******************************************************************/ -AccountGroup * -xaccQueryGetGroup(Query * q) { - if (!q) return NULL; - return (q->acct_group); -} - - -/******************************************************************* - * xaccQueryGetEarliestDateFound - *******************************************************************/ -time_t -xaccQueryGetEarliestDateFound(Query * q) { - GList * spl; - Split * sp; - time_t earliest = LONG_MAX; - - if (!q) return 0; - if (!q->split_list) return 0; - - for(spl = q->split_list; spl; spl=spl->next) { - sp = spl->data; - if(sp->parent->date_posted.tv_sec < earliest) { - earliest = (time_t) sp->parent->date_posted.tv_sec; - } - } - return earliest; -} - -/******************************************************************* - * xaccQueryGetEarliestDateFound - *******************************************************************/ -time_t -xaccQueryGetLatestDateFound(Query * q) { - Split * sp; - GList * spl; - time_t latest = 0; - - if(!q) return 0; - if(!q->split_list) return 0; - - for(spl = q->split_list; spl; spl=spl->next) { - sp = spl->data; - if(sp->parent->date_posted.tv_sec > latest) { - latest = (time_t) sp->parent->date_posted.tv_sec; - } - } - return latest; -} - -#if 0 -int -main(int argc, char ** argv) { - Query * q = xaccMallocQuery(); - Query * q2 = xaccMallocQuery(); - Query * r; - - printf("testing queries...\n"); - - xaccQueryAddMiscMatch(q, NULL, 1); - xaccQueryAddMiscMatch(q, NULL, 2); - xaccQueryAddMiscMatch(q, NULL, 3); - print_query(q); - - xaccQueryAddMiscMatch(q2, NULL, 4); - xaccQueryAddMiscMatch(q2, NULL, 5); - xaccQueryAddMiscMatch(q2, NULL, 6); - print_query(q2); - - printf("AND of two simple queries:\n"); - - r = xaccQueryMerge(q, q2, QUERY_AND); - print_query(r); - - printf("OR of two simple queries:\n"); - - r = xaccQueryMerge(q, q2, QUERY_OR); - print_query(r); - - printf("NAND of two simple queries:\n"); - r = xaccQueryMerge(q, q2, QUERY_NAND); - print_query(r); - - printf("XOR of two simple queries:\n"); - r = xaccQueryMerge(q, q2, QUERY_XOR); - print_query(r); - -} -#endif diff --git a/src/engine/Query.h b/src/engine/Query.h deleted file mode 100644 index f5ee1b811c..0000000000 --- a/src/engine/Query.h +++ /dev/null @@ -1,348 +0,0 @@ -/********************************************************************\ - * Query.h : api for finding transactions * - * Copyright 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#ifndef GNUCASH_QUERY_H -#define GNUCASH_QUERY_H - -#include -#include -#include -#include - -#include "gnc-common.h" -#include "Account.h" -#include "Transaction.h" - -typedef enum { - QUERY_AND=1, - QUERY_OR, - QUERY_NAND, - QUERY_NOR, - QUERY_XOR -} QueryOp; - -typedef enum { - BY_STANDARD=1, - BY_DATE, - BY_DATE_ROUNDED, - BY_DATE_ENTERED, - BY_DATE_ENTERED_ROUNDED, - BY_DATE_RECONCILED, - BY_DATE_RECONCILED_ROUNDED, - BY_NUM, - BY_AMOUNT, - BY_MEMO, - BY_DESC, - BY_RECONCILE, - BY_ACCOUNT_FULL_NAME, - BY_ACCOUNT_CODE, - BY_CORR_ACCOUNT_FULL_NAME, - BY_CORR_ACCOUNT_CODE, - BY_NONE -} sort_type_t; - -typedef enum { - PD_DATE=1, - PD_AMOUNT, - PD_ACCOUNT, - PD_STRING, - PD_CLEARED, - PD_BALANCE, - PD_GUID, - PD_MISC -} pd_type_t; - -typedef enum { - PR_ACCOUNT=1, - PR_ACTION, - PR_AMOUNT, /* FIXME: misnamed, should be PR_VALUE */ - PR_BALANCE, - PR_CLEARED, - PR_DATE, - PR_DESC, - PR_GUID, - PR_MEMO, - PR_MISC, - PR_NUM, - PR_PRICE, - PR_SHRS /* FIXME: misnamed, should be PR_AMT */ -} pr_type_t; - -typedef enum { - ACCT_MATCH_ALL=1, - ACCT_MATCH_ANY, - ACCT_MATCH_NONE -} acct_match_t; - -typedef enum -{ - AMT_MATCH_ATLEAST=1, - AMT_MATCH_ATMOST, - AMT_MATCH_EXACTLY -} amt_match_t; - -typedef enum { - AMT_SGN_MATCH_EITHER=1, - AMT_SGN_MATCH_CREDIT, - AMT_SGN_MATCH_DEBIT -} amt_match_sgn_t; - -typedef enum { - CLEARED_NO = 1 << 0, - CLEARED_CLEARED = 1 << 1, - CLEARED_RECONCILED = 1 << 2, - CLEARED_FROZEN = 1 << 3 -} cleared_match_t; - -enum { - STRING_MATCH_CASE = 1 << 0, - STRING_MATCH_REGEXP = 1 << 1 -}; - -typedef enum { - BALANCE_BALANCED = 1 << 0, - BALANCE_UNBALANCED = 1 << 1 -} balance_match_t; - -/* query_run_t describes whether to require all splits or - * any to match for a transaction to be returned by - * xaccQueryGetTransactions */ - -typedef enum { - QUERY_MATCH_ALL=1, - QUERY_MATCH_ANY=2 -} query_run_t; - -typedef struct _querystruct Query; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; -} BasePredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - int use_start; - Timespec start; - int use_end; - Timespec end; -} DatePredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - amt_match_t how; - amt_match_sgn_t amt_sgn; - double amount; -} AmountPredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - acct_match_t how; - GList *accounts; - GList *account_guids; -} AccountPredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - int case_sens; - int use_regexp; - char *matchstring; - regex_t compiled; -} StringPredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - cleared_match_t how; -} ClearedPredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - balance_match_t how; -} BalancePredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - GUID guid; -} GUIDPredicateData; - -typedef struct { - pd_type_t type; - pr_type_t term_type; - int sense; - int how; - int data; -} MiscPredicateData; - -typedef union { - pd_type_t type; - BasePredicateData base; - DatePredicateData date; - AmountPredicateData amount; - AccountPredicateData acct; - StringPredicateData str; - ClearedPredicateData cleared; - BalancePredicateData balance; - GUIDPredicateData guid; - MiscPredicateData misc; -} PredicateData; - -typedef int (* Predicate)(Split * to_test, PredicateData * test_data); - -typedef struct { - PredicateData data; - Predicate p; -} QueryTerm; - - -/******************************************************************* - * basic Query API - *******************************************************************/ - -Query * xaccMallocQuery(void); -void xaccFreeQuery(Query *); -Query * xaccQueryCopy(Query *q); -void xaccQuerySetGroup(Query * q, AccountGroup * group); -AccountGroup *xaccQueryGetGroup(Query * q); - -Query * xaccQueryInvert(Query * q1); -Query * xaccQueryMerge(Query * q1, Query * q2, QueryOp op); -void xaccQueryClear(Query * q); - -/* The xaccQueryHasTerms() routine returns the number of 'OR' terms in the query. - * The xaccQueryNumTerms() routine returns the total number of terms in the query. - */ - -void xaccQueryPurgeTerms(Query * q, pd_type_t type); -int xaccQueryHasTerms(Query * q); -gboolean xaccQueryHasTermType(Query * q, pd_type_t type); -GList * xaccQueryGetTerms(Query * q); -int xaccQueryNumTerms(Query * q); - - -/* after the query has been set up, call this to run the query */ -GList * xaccQueryGetSplits(Query * q); -GList * xaccQueryGetSplitsUniqueTrans(Query *q); -GList * xaccQueryGetTransactions(Query * q, query_run_t type); - -/* compare two queries for equality. this is a simplistic - * implementation -- logical equivalences between different - * and/or trees are ignored. */ -gboolean xaccQueryEqual(Query *q1, Query *q2); - -/* handy for debugging */ -void xaccQueryPrint(Query *q); - -/******************************************************************* - * match-adding API - *******************************************************************/ - -void xaccQueryAddAccountMatch(Query * q, GList * accounts, - acct_match_t how, QueryOp op); -void xaccQueryAddAccountGUIDMatch(Query * q, GList * account_guids, - acct_match_t how, QueryOp op); -void xaccQueryAddSingleAccountMatch(Query * q, Account * acct, - QueryOp op); - -void xaccQueryAddDescriptionMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, QueryOp op); -void xaccQueryAddNumberMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, QueryOp op); -void xaccQueryAddActionMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, QueryOp op); -void DxaccQueryAddAmountMatch(Query * q, double amount, - amt_match_sgn_t amt_sgn, - amt_match_t how, QueryOp op); -void DxaccQueryAddSharePriceMatch(Query * q, double amount, - amt_match_t how, QueryOp op); -void DxaccQueryAddSharesMatch(Query * q, double amount, - amt_match_t how, QueryOp op); -void xaccQueryAddDateMatch(Query * q, - int use_start, int sday, int smonth, int syear, - int use_end, int eday, int emonth, int eyear, - QueryOp op); -void xaccQueryAddDateMatchTS(Query * q, - int use_start, Timespec sts, - int use_end, Timespec ets, - QueryOp op); -void xaccQueryAddDateMatchTT(Query * q, - int use_start, time_t stt, - int use_end, time_t ett, - QueryOp op); -void xaccQueryAddMemoMatch(Query * q, const char * matchstring, - int case_sens, int use_regexp, QueryOp op); -void xaccQueryAddClearedMatch(Query * q, cleared_match_t how, QueryOp op); -void xaccQueryAddBalanceMatch(Query * q, balance_match_t how, QueryOp op); -void xaccQueryAddGUIDMatch(Query * q, const GUID *guid, QueryOp op); -void xaccQueryAddMiscMatch(Query * q, Predicate p, int how, int data, - QueryOp op); - -void xaccQueryAddPredicate (Query * q, PredicateData *pred, QueryOp op); - - -/******************************************************************* - * sort-related functions - *******************************************************************/ - -void xaccQuerySetSortOrder(Query * q, sort_type_t primary, - sort_type_t secondary, sort_type_t tertiary); -sort_type_t xaccQueryGetPrimarySortOrder(Query * q); -sort_type_t xaccQueryGetSecondarySortOrder(Query * q); -sort_type_t xaccQueryGetTertiarySortOrder(Query * q); - -void xaccQuerySetSortIncreasing(Query * q, - gboolean prim_increasing, - gboolean sec_increasing, - gboolean tert_increasing); -gboolean xaccQueryGetSortPrimaryIncreasing (Query *q); -gboolean xaccQueryGetSortSecondaryIncreasing (Query *q); -gboolean xaccQueryGetSortTertiaryIncreasing (Query *q); - -void xaccQuerySetMaxSplits(Query * q, int n); -int xaccQueryGetMaxSplits(Query * q); - - -/******************************************************************* - * compatibility interface with old Query API - *******************************************************************/ -time_t xaccQueryGetEarliestDateFound(Query * q); -time_t xaccQueryGetLatestDateFound(Query * q); - - -/* This is useful for network systems */ -Predicate xaccQueryGetPredicate (pr_type_t term_type); - -#endif diff --git a/src/engine/Queue.c b/src/engine/Queue.c deleted file mode 100644 index a61fc3ad28..0000000000 --- a/src/engine/Queue.c +++ /dev/null @@ -1,402 +0,0 @@ -/********************************************************************\ - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -/* - * FILE: - * Queue.c - * - * DESCRIPTION: - * Provide simple FIFO/LIFO cost-basis accounting support. - * - * RESTRICTIONS: - * -- Does not support use with mixed currencies. - * -- Does not check for or warn mixed currency use. - * -- Does not allow pushhead after a pophead has occured. - * - * HISTORY: - * created by Linas Vepstas January 1999 - * Copyright (c) 1999, 2000 Linas Vepstas - */ - -#include -#include -#include -#include - -#include "config.h" - -#include "Queue.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "util.h" - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - -/* ================================================== */ - -struct _Queue { - Split **split_list; - - int head_split; - int tail_split; - int list_len; - - double head_amount; - double head_price; - Timespec head_date; - - double tail_amount; - double tail_price; - Timespec tail_date; - -}; - -/* ================================================== */ - -Queue * -xaccMallocQueue (void) -{ - Queue * ret; - ret = g_new(Queue, 1); - xaccInitQueue (ret); - return ret; -} - -/* ================================================== */ -#define INITIAL_LENGTH 100 - -void -xaccInitQueue (Queue *q) -{ - if (!q) return; - - q->split_list = (Split **) g_malloc (INITIAL_LENGTH * sizeof (Split *)); - q->list_len = INITIAL_LENGTH; - q->head_split = -1; - q->tail_split = 0; - q->head_amount = 0.0; - q->tail_amount = 0.0; - q->head_price = 0.0; - q->tail_price = 0.0; - - q->head_date.tv_sec = 0; - q->head_date.tv_nsec = 0; - q->tail_date.tv_sec = 0; - q->tail_date.tv_nsec = 0; -} - -/* ================================================== */ - -void -xaccFreeQueue (Queue *q) -{ - if (!q) return; - - if (q->split_list) g_free (q->split_list); - q->split_list = 0x0; - q->list_len = -1; - q->head_split = -1; - q->tail_split = 0; - q->head_amount = 0.0; - q->tail_amount = 0.0; - q->head_price = 0.0; - q->tail_price = 0.0; - - g_free (q); -} - -/* ================================================== */ -/* get more memory, if needed */ - -static void -ExtendHead (Queue * q) -{ - Split **list, **newlist; - int i, len, tail; - - /* if there's room to push one more item on the list, its a no-op */ - if (1+(q->head_split) < q->list_len) return; - - /* see if there's room at the bottom to slide the whole list down. */ - /* as a rule of thumb, we'll shoot for a half-full queue */ - if (2*(q->tail_split) > q->list_len) - { - len = q->head_split - q->tail_split + 1; - list = q->split_list; - tail = q->tail_split; - for (i=0; itail_split = 0; - q->head_split = len-1; - return; - } - - /* if we got to here, we need to malloc more memory. */ - newlist = (Split **) g_malloc (2*(q->list_len)*sizeof (Split *)); - q->list_len *= 2; - - len = q->head_split - q->tail_split + 1; - list = q->split_list; - tail = q->tail_split; - for (i=0; itail_split = 0; - q->head_split = len-1; - - q->split_list = newlist; - free(list); -} - -/* ================================================== */ - -void -xaccQueuePushHead (Queue *q, Split *s) -{ - if (!q || !s) return; - - /* I'm too lazy to code up a more complex feature that no one will use ... */ - /* If you are reading this, you are invited to do so yourself :-) */ - if ( !DEQ (q->head_amount, 0.0)) { - PERR ("The current implementation does not\n" - "\tsupport pushing onto a queue that has been popped \n"); - return; - } - - /* don't queue a split that has no value */ - if (DEQ (s->damount, 0.0)) return; - - /* make room, if need be */ - ExtendHead (q); - - q->head_split ++; - q->split_list [ q->head_split ] = s; -} - -/* ================================================== */ - -double -xaccQueuePopTailShares (Queue *q, double shrs) -{ - int tp, hp; - Split **list; - double rshrs = 0.0; - - if (!q) return 0.0; - if (0.0 >= shrs) return 0.0; - - /* the tail holds enough to do it in one go. */ - if (q->tail_amount > shrs) { - q->tail_amount -= shrs; - return shrs; - } - - /* use up the tail shares first ... */ - shrs -= q->tail_amount; - rshrs += q->tail_amount; - q->tail_amount = 0.0; - q->tail_price = 0.0; - q->tail_date.tv_sec = 0; - q->tail_date.tv_nsec = 0; - - /* start poping */ - tp = q->tail_split; - hp = q->head_split; - list = q->split_list; - while (tp <= hp) - { - /* the tail holds enough to do it in one go. */ - if ((list[tp]->damount) > shrs) { - q->tail_amount = list[tp]->damount - shrs; - q->tail_price = list[tp]->share_price; - assert (list[tp]->parent); - q->tail_date = list[tp]->parent->date_posted; - rshrs += shrs; - tp++; - q->tail_split = tp; - return rshrs; - } - - /* well, well need use up this entire split ... */ - shrs -= (list[tp]->damount); - rshrs += (list[tp]->damount); - tp++; - } - - /* oops, if we got to here, we've used up all of the splits. - * give em whatever we've got on the head, and then we're outta here. - */ - q->tail_split = 0; - q->head_split = -1; - - /* the head holds enough to do it in one go. */ - if (q->head_amount > shrs) { - q->head_amount -= shrs; - rshrs += shrs; - return shrs; - } - - /* use up whats left of the head shares */ - shrs -= q->head_amount; - rshrs += q->head_amount; - q->head_amount = 0.0; - q->head_price = 0.0; - q->head_date.tv_sec = 0; - q->head_date.tv_nsec = 0; - - return rshrs; -} - -/* ================================================== */ - -double -xaccQueuePopTailValue (Queue *q, double val) -{ - int tp, hp; - Split **list; - double rval = 0.0; - - if (!q) return 0.0; - if (0.0 >= val) return 0.0; - - /* the tail holds enough to do it in one go. */ - if (q->tail_amount * q->tail_price > val) { - q->tail_amount -= val / q->tail_price; - return val; - } - - /* use up the tail shares first ... */ - val -= q->tail_amount * q->tail_price; - rval += q->tail_amount * q->tail_price; - q->tail_amount = 0.0; - q->tail_price = 0.0; - q->tail_date.tv_sec = 0; - q->tail_date.tv_nsec = 0; - - /* start poping */ - tp = q->tail_split; - hp = q->head_split; - list = q->split_list; - while (tp <= hp) - { - /* the tail holds enough to do it in one go. */ - if ((list[tp]->damount)*(list[tp]->share_price) > val) { - q->tail_amount = list[tp]->damount - (val/(list[tp]->share_price)); - q->tail_price = list[tp]->share_price; - assert (list[tp]->parent); - q->tail_date = list[tp]->parent->date_posted; - rval += val; - tp++; - q->tail_split = tp; - return rval; - } - - /* well, well need use up this entire split ... */ - val -= (list[tp]->damount) * (list[tp]->share_price); - rval += (list[tp]->damount) * (list[tp]->share_price); - tp++; - } - - /* oops, if we got to here, we've used up all of the splits. - * give em whatever we've got on the head, and then we're outta here. - */ - q->tail_split = 0; - q->head_split = -1; - - /* the head holds enough to do it in one go. */ - if (q->head_amount * q->head_price > val) { - q->head_amount -= val / (q->head_price); - rval += val; - return val; - } - - /* use up whats left of the head shares */ - val -= q->head_amount * q->head_price; - rval += q->head_amount * q->head_price; - q->head_amount = 0.0; - q->head_price = 0.0; - q->head_date.tv_sec = 0; - q->head_date.tv_nsec = 0; - - return rval; -} - -/* ================================================== */ -/* these routines are same as above, but everything is reversed... */ - -double -xaccQueuePopHeadValue (Queue *q, double val) -{ - PERR("not implemented\n"); - return 0.0; -} - -double -xaccQueuePopHeadShares (Queue *q, double val) -{ - PERR("not implemented\n"); - return 0.0; -} - -/* ================================================== */ - -double -xaccQueueGetShares (Queue *q) -{ - Split **list; - double shrs = 0.0; - int i; - - if (!q) return 0.0; - - shrs += q->head_amount; - shrs += q->tail_amount; - - list = q->split_list; - - for (i = q->tail_split; i <= q->head_split; i++) - shrs += list[i]->damount; - - return shrs; -} - -double -xaccQueueGetValue (Queue *q) -{ - Split **list; - double val = 0.0; - int i; - - if (!q) return 0.0; - - val += q->head_amount * q->head_price; - val += q->tail_amount * q->tail_price; - - list = q->split_list; - - for (i = q->tail_split; i <= q->head_split; i++) - val += list[i]->damount * list[i]->share_price; - - return val; -} - -/* ================ END OF FILE ==================== */ diff --git a/src/engine/Queue.h b/src/engine/Queue.h deleted file mode 100644 index a1b20b0793..0000000000 --- a/src/engine/Queue.h +++ /dev/null @@ -1,110 +0,0 @@ -/********************************************************************\ - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -/* - * FILE: - * Queue.h - * - * DESCRIPTION: - * Provides simple FIFO/LIFO cost-basis accounting support. - * - * The routines in this class implement a simple FIFO that - * holds a series of splits. Splits can be pushed onto the head - * of the fifo. The number of shares contained in the fifo is - * then simply the sum of all of the shares in the splits. - * The "value" of the fifo is the cost-basis value of all of - * the splits, i.e. the total of number of shares times prices. - * - * When shares are sold, they are dequed from the queue. If the - * oldest shares are sold first, they are dequed or "popped" from - * the tail, and the queue acts as a FIFO. If the newest shares - * are sold first, then the queue acts as a LIFO, and shares are - * poped off the head. - * - * Either shares or a monetary value can be dequeued. The amount - * dequeued does not have to exactly equal the amount/value of - * any given split; fractional amounts can be dequeued. This queue - * automatically tracks fractional amounts on both the head (LIFO) - * and tail (FIFO). Indeed, there are *no* routines to explicitly - * dequeue a split; *only* amounts and values can be dequed. - * Conversely, *only* splits can be pushed on, as this queue does - * not provide any internal or hidden elements. - * - * In addition to the queue value, and the number of shares queued, - * the average age of the shares can also be computed, as well as - * other statistics involving a date and price. The queue automatically - * tracks the posted date of fractional splits at the head and tail. - * - * RESTRICTIONS: - * -- Does not support use with mixed currencies. - * -- Does not check for or warn mixed currency use. - * -- Does not allow push-head after a pop-head has occured. - * -- Push-tail not implemented - * - * HISTORY: - * created by Linas Vepstas January 1999 - * Copyright (c) 1999, 2000 Linas Vepstas - */ - -#ifndef XACC_QUEUE_H -#define XACC_QUEUE_H - -#include "Transaction.h" - -typedef struct _Queue Queue; - -/* - * The xaccQueuePushHead() routine pushes a split onto the head - * of the queue. - * - * The xaccQueuePopTailShares() routine removes the indicated - * number of shares from the bottom of the queue. If the queue - * does not contain that many shares, it dequeues all of the - * shares. This routine returns the actual number of shares dequeued. - * Use this routine for FIFO accounting. - * - * The xaccQueuePopTailValue() routine removes the indicated - * value from the bottom of the queue. If the value of the queue is less - * than this amount, the value of the queue is set to zero, and the - * actual value poped is returned. - * Use this routine for FIFO accounting. - * - * The xaccQueuePopHeadShares() and xaccQueuePopHeadValue() routines - * behave in the same way as the *Tail* versions, except that they act - * on the head of the queue. Use these routines for LIFO accounting. - * - * The xaccQueueGetValue() routine returns the value of the queue. - * The xaccQueueGetShares() routine returns the number of shares in the queue. - */ - -Queue * xaccMallocQueue (void); -void xaccInitQueue (Queue *q); -void xaccFreeQueue (Queue *q); - -void xaccQueuePushHead (Queue *q, Split *s); - -double xaccQueuePopHeadShares (Queue *, double); -double xaccQueuePopHeadValue (Queue *, double); -double xaccQueuePopTailShares (Queue *, double); -double xaccQueuePopTailValue (Queue *, double); - -double xaccQueueGetValue (Queue *); -double xaccQueueGetShares (Queue *); - -#endif /* XACC_QUEUE_H */ diff --git a/src/engine/README b/src/engine/README deleted file mode 100644 index b3aaf6b636..0000000000 --- a/src/engine/README +++ /dev/null @@ -1,14 +0,0 @@ - -This directory contains code for the accounting engine. -Its fairly clean but far from perfect, and it certainly -lacks advanced features. - -There should be no GUI code in this subdirectory, and, -ideally, it should build cleanly and independently of -any GUI elements or assumptions. - -For design documentation, please see the file "design.txt", -and also, look at the header files carefully. The documentation -for each routine is in the header files for that routine. - -September 1998 diff --git a/src/engine/README.query-api b/src/engine/README.query-api deleted file mode 100644 index b2a7e898aa..0000000000 --- a/src/engine/README.query-api +++ /dev/null @@ -1,205 +0,0 @@ -Gnucash Query API - - -BASIC QUERY API: With this API you can create arbitrary logical -queries to find sets of splits in an account group. To make simple -queries (1 term, such as an account query), create the appropriate -QueryTerm structure and stick it in a Query object using -xaccInitQuery. The QueryTerm should be malloced but the Query object -will handle freeing it. To make compound queries, make multiple -simple queries and combine them using xaccMergeQuery and the logical -operations of your choice. - ------------------------------------------------------------------ -Query * xaccMallocQuery() - -Allocates and initializes a Query structure which must be freed by the -user with xaccFreeQuery. A newly-allocated Query object matches -nothing (xaccQueryGetSplits will return NULL). - ------------------------------------------------------------------ -void xaccInitQuery(Query * q, QueryTerm * qt) - -Initializes an allocated Query object with initial term qt (possibly -NULL). Any previous query terms are freed. - ------------------------------------------------------------------ -void xaccFreeQuery(Query * q) - -Frees the resources associate with a Query object. - ------------------------------------------------------------------ -void xaccQuerySetGroup(Query * q, AccountGroup * group) - -Set the Gnucash account group that the query applies to. -xaccQuerySetGroup must be called before a Query object created with -xaccMallocQuery can be used. Queries created with xaccQueryInvert and -xaccQueryMerge inherit the account group of the arguments to those -functions. - ------------------------------------------------------------------ -Query * xaccQueryInvert(Query * q) - -Logically invert the query. xaccInvertQuery returns a newly allocated -Query object such that the union of the splits matched by query q and -query (p = xaccQueryInvert(q)) is the entire account group that q -applies to. - ------------------------------------------------------------------ -Query * xaccQueryMerge(Query * q1, Query * q2, QueryOp how) - -Combine queries q1 and q2 using logical operator 'how'. 'how' must be -one of QUERY_AND, QUERY_OR, QUERY_NAND, QUERY_NOR, QUERY_XOR. The -account groups of q1 and q2 must be the same. xaccQueryMerge returns -a newly-allocated Query object or NULL on error. - ------------------------------------------------------------------ -void xaccQueryClear(Query * q) - -Remove all query terms from q. q matches nothing after xaccQueryClear. - ------------------------------------------------------------------ -void xaccQueryPurgeTerms(Query * q, pd_type_t type); - -Remove query terms of a particular type from q. The "type" of a term -is determined by the type of data that gets passed to the predicate -function. The currently-supported values of 'type' are PD_DATE, -PD_AMOUNT, PD_ACCOUNT, PD_STRING, PD_CLEARED, PD_MISC. This function -is really only used in one place: in window-register.c, to modify -in-place a query to remove any date tests prior to adding new ones. -This should probably be removed from the API in favor of an extra -argument to xaccQueryMerge specifying what to do with existing terms -of that type. - - ------------------------------------------------------------------ -int xaccQueryHasTerms(Query * q) - -Returns the number of terms in the canonical form of the query. Can -be used as a predicate to see if the query has been initialized -(return value > 0) or is "blank" (return value == 0). - - ------------------------------------------------------------------ - -CONVENIENCE API: The remainder of the API (in particular, any function -called xaccQueryAdd***Match) is a set of convenience functions for -creating and modifying specific types of queries. All of these -functions can be duplicated using the Basic API specified above, -directly manipulating QueryTerm objects and creating and merging -queries as needed. One slight advantage of the convenience API is -that it uses a standard set of predicates that are more-or-less -opaque. This may be important later. - -It's probably more useful to describe the various types of -PredicateData than the convenience functions, which are pretty -self-explanatory once you understand what the underlying process is. -For example, AddMemoMatch and AddDescriptionMatch are essentially the -same function because they both use PD_STRING predicate data; they -just use a different predicate (one compares data.string.matchstring -with the split's Memo, one compares with the parent transaction's -Description). - -Each function in the convenience API takes a Query *, some arguments -which fill in the fields of the appropriate PredicateData type, and a -QueryOp. The Query object is modified in place, using the logical -operation specified by the QueryOp to combine a single new QueryTerm -with the existing Query. This works by making a new Query of one term -and combining with the existing Query using xaccQueryMerge and the -specified QueryOp. If you have an existing Query (a + b + c) and -combine using QueryOp QUERY_AND in a convenience function representing -predicate d, you will get (ad + bd + cd). - - -STRUCTURE OF A QUERY: A Query is a logical function of any number of -QueryTerms. A QueryTerm consists of a C function pointer (the -Predicate) and a PredicateData structure containing data passed to the -predicate funtion. The PredicateData structure is a constant -associated with the Term and is identical for every Split that is -tested. - -The terms of the Query may represent any logical function and are -stored in canonical form, i.e. the function is expressed as a logical -sum of logical products. So if you have QueryTerms a, b, c, d, e and -you have the logical function a(b+c) + !(c(d+e)), it gets stored as -ab + ac + !c + !c!e +!d!c + !d!e. This may not be optimal for evaluation -of some functions but it's easy to store, easy to manipulate, and it -doesn't require a complete algebra system to deal with. - -The representation is of a GList of GLists of QueryTerms. The -"backbone" GList q->terms represents the OR-chain, and every item on -the backbone is a GList of QueryTerms representing an AND-chain -corresponding to a single product-term in the canonical -representation. QueryTerms are duplicated when necessary to fill out -the canonical form, and the same predicate may be evaluated multiple -times per split for complex queries. This is a place where we could -probably optimize. - -Evaluation of a Query (see xaccQueryGetSplits) is optimized as much as -possible by short-circuited evaluation. The predicates in each -AND-chain are sorted by predicate type, with Account queries sorted -first to allow the evaluator to completely eliminate accounts from the -search if there's no chance of them having splits that match. - - -PREDICATE DATA TYPES: All the predicate data types are rolled up into -the union type PredicateData. The "type" field specifies which type -the union is. The values of type are: - ------------------------------------------------------------------ -PD_DATE : match a date range. Specify a start date and an end date. - -Used in: xaccQueryAddDateMatch - xaccQueryAddDateMatchTS - xaccQueryAddDateMatchTT - ------------------------------------------------------------------ -PD_AMOUNT : match a numeric amount. Specify an amount (always -positive), a funds-flow direction (credit, debit, or either), and -"how", specifying the type of amount comparison to be used : - - AMT_MATCH_ATLEAST : split >= pd amount - AMT_MATCH_ATMOST : split >= pd amount - AMT_MATCH_EXACTLY : split == pd amount - -Used in: xaccQueryAddAmountMatch - xaccQueryAddSharePriceMatch - xaccQueryAddSharesMatch - ------------------------------------------------------------------ -PD_ACCOUNT : match an account or set of accounts. Specify a set -of accounts and "how": - - ACCT_MATCH_ALL : a transaction must have at least one split - affecting each account in pd.acct.accounts. - ACCT_MATCH_ANY : a transaction must have at least one split - affecting any account in the set - ACCT_MATCH_NONE : a transaction may not affect any account in - the set. - -Used in: xaccQueryAddAccountMatch - xaccQueryAddSingleAccountMatch - ------------------------------------------------------------------ -PD_STRING : match a string. Specify a string, bool signifying -case sensitivity, bool signifying regexp or simple string. - -Used in: xaccQueryAddDescriptionMatch - xaccQueryAddNumberMatch - xaccQueryAddActionMatch - xaccQueryAddMemoMatch - ------------------------------------------------------------------ -PD_CLEARED : match the Cleared state of the transaction. Specify -a bit-mask that is an OR combination of one or more of the -following: - CLEARED_NO (state == 'n') - CLEARED_CLEARED (state == 'c') - CLEARED_RECONCILED (state == 'y') - -Used in: xaccQueryAddClearedMatch - ------------------------------------------------------------------ -PD_MISC : match some "other" user predicate. Not used at the moment. - ------------------------------------------------------------------ diff --git a/src/engine/SchedXaction.c b/src/engine/SchedXaction.c deleted file mode 100644 index 3b80aca3fd..0000000000 --- a/src/engine/SchedXaction.c +++ /dev/null @@ -1,486 +0,0 @@ -/********************************************************************\ - * SchedXaction.c -- Scheduled Transaction implementation. * - * Copyright (C) 2001 Joshua Sled * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include - -#include "SchedXaction.h" -#include "FreqSpec.h" -#include "GNCIdP.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "date.h" -#include "gnc-engine-util.h" -#include "gnc-event-p.h" -#include "messages.h" -#include "Account.h" -#include "Group.h" -#include "guid.h" -#include "gnc-book.h" -#include "FileDialog.h" - -static short module = MOD_SX; - -/** Local data defs *****/ -void sxprivtransactionListMapDelete( gpointer data, gpointer user_data ); - -/** Local Prototypes *****/ - - -static void -xaccSchedXactionInit( SchedXaction *sx, GNCBook *book) -{ - AccountGroup *ag; - char *name; - sx->freq = xaccFreqSpecMalloc(); - - xaccGUIDNew( &sx->guid ); - xaccStoreEntity( sx, &sx->guid, GNC_ID_SCHEDXACTION ); - g_date_clear( &sx->last_date, 1 ); - g_date_clear( &sx->start_date, 1 ); - g_date_clear( &sx->end_date, 1 ); - - sx->num_occurances_total = -1; - sx->kvp_data = kvp_frame_new(); - sx->autoCreateOption = FALSE; - sx->autoCreateNotify = FALSE; - sx->advanceCreateDays = 0; - sx->advanceRemindDays = 0; - sx->dirty = TRUE; - - /* create a new template account for our splits */ - sx->template_acct = xaccMallocAccount(); - name = guid_to_string( &sx->guid ); - xaccAccountSetName( sx->template_acct, name ); - xaccAccountSetCommodity( sx->template_acct, - gnc_commodity_new( "template", "template", - "template", "template", 1 ) ); - g_free( name ); - xaccAccountSetType( sx->template_acct, BANK ); - ag = gnc_book_get_template_group( book ); - xaccGroupInsertAccount( ag, sx->template_acct ); -} - -SchedXaction* -xaccSchedXactionMalloc( GNCBook *book ) -{ - SchedXaction *sx; - sx = g_new0( SchedXaction, 1 ); - xaccSchedXactionInit( sx, book ); - gnc_engine_generate_event( &sx->guid, GNC_EVENT_CREATE ); - return sx; -} - -void -sxprivtransactionListMapDelete( gpointer data, gpointer user_data ) -{ - Transaction *t = (Transaction*)data; - xaccTransBeginEdit( t ); - xaccTransDestroy( t ); - xaccTransCommitEdit( t ); - return; -} - -void -sxprivsplitListMapDelete( gpointer data, gpointer user_data ) -{ - Split *s = (Split *) data; - Transaction *t = xaccSplitGetParent(s); - xaccTransBeginEdit( t ); - xaccTransDestroy( t ); - xaccTransCommitEdit( t ); -} - -void -xaccSchedXactionFree( SchedXaction *sx ) -{ - AccountGroup *group; - GList *templ_acct_splits; - if ( sx == NULL ) return; - - xaccFreqSpecFree( sx->freq ); - gnc_engine_generate_event( &sx->guid, GNC_EVENT_DESTROY ); - xaccRemoveEntity( &sx->guid ); - - if ( sx->name ) - g_free( sx->name ); - - - - /* - * we have to delete the transactions in the - * template account ourselves - */ - - templ_acct_splits - = xaccAccountGetSplitList(sx->template_acct); - - g_list_foreach(templ_acct_splits, - sxprivsplitListMapDelete, - NULL); - - /* - * xaccAccountDestroy removes the account from - * its group for us AFAICT - */ - - xaccAccountBeginEdit(sx->template_acct); - xaccAccountDestroy(sx->template_acct); - - g_free( sx ); - - return; -} - - - - - -FreqSpec * -xaccSchedXactionGetFreqSpec( SchedXaction *sx ) -{ - return sx->freq; -} - -void -xaccSchedXactionSetFreqSpec( SchedXaction *sx, FreqSpec *fs ) -{ - g_return_if_fail( fs ); - - xaccFreqSpecFree( sx->freq ); - sx->freq = fs; - sx->dirty = TRUE; -} - -gchar * -xaccSchedXactionGetName( SchedXaction *sx ) -{ - return sx->name; -} - -void -xaccSchedXactionSetName( SchedXaction *sx, const gchar *newName ) -{ - g_return_if_fail( newName != NULL ); - if ( sx->name != NULL ) { - g_free( sx->name ); - sx->name = NULL; - } - sx->dirty = TRUE; - sx->name = g_strdup( newName ); -} - -GDate* -xaccSchedXactionGetStartDate( SchedXaction *sx ) -{ - return &sx->start_date; -} - -void -xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart ) -{ - sx->start_date = *newStart; - sx->dirty = TRUE; -} - -gboolean -xaccSchedXactionHasEndDate( SchedXaction *sx ) -{ - return g_date_valid( &sx->end_date ); -} - -GDate* -xaccSchedXactionGetEndDate( SchedXaction *sx ) -{ - return &sx->end_date; -} - -void -xaccSchedXactionSetEndDate( SchedXaction *sx, GDate *newEnd ) -{ - if ( g_date_valid( newEnd ) ) { - if ( g_date_compare( newEnd, &sx->start_date ) < 0 ) { - /* XXX: I reject the bad data - is this the right - * thing to do . - * This warning is only human readable - the caller - * doesn't know the call failed. This is bad - */ - PWARN( "New end date before start date" ); - } - else - { - sx->end_date = *newEnd; - sx->dirty = TRUE; - } - - } - else - { - PWARN("New end date invalid"); - } - return; -} - -GDate* -xaccSchedXactionGetLastOccurDate( SchedXaction *sx ) -{ - return &sx->last_date; -} - -void -xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur ) -{ - sx->last_date = *newLastOccur; - sx->dirty = TRUE; - return; -} - -gboolean -xaccSchedXactionHasOccurDef( SchedXaction *sx ) -{ - return ( xaccSchedXactionGetNumOccur( sx ) != 0 ); -} - -gint -xaccSchedXactionGetNumOccur( SchedXaction *sx ) -{ - return sx->num_occurances_total; -} - -void -xaccSchedXactionSetNumOccur( SchedXaction *sx, gint newNum ) -{ - sx->num_occurances_remain = sx->num_occurances_total = newNum; - sx->dirty = TRUE; - -} - -gint -xaccSchedXactionGetRemOccur( SchedXaction *sx ) -{ - return sx->num_occurances_remain; -} - -void -xaccSchedXactionSetRemOccur( SchedXaction *sx, - gint numRemain ) -{ - /* FIXME This condition can be tightened up */ - if ( numRemain > sx->num_occurances_total ) { - PWARN("The number remaining is greater than the \ -total occurrences"); - - } - else - { - sx->num_occurances_remain = numRemain; - sx->dirty = TRUE; - } - return; -} - - -kvp_value * -xaccSchedXactionGetSlot( SchedXaction *sx, const char *slot ) -{ - if (!sx) - { - return NULL; - } - - return kvp_frame_get_slot(sx->kvp_data, slot); -} - -void -xaccSchedXactionSetSlot( SchedXaction *sx, - const char *slot, - const kvp_value *value ) -{ - if (!sx) - { - return; - } - - kvp_frame_set_slot( sx->kvp_data, slot, value ); - sx->dirty = TRUE; - return; -} - -kvp_frame* -xaccSchedXactionGetSlots( SchedXaction *sx ) -{ - return sx->kvp_data; -} - -void -xaccSchedXactionSetSlots( SchedXaction *sx, kvp_frame *frm ) -{ - sx->kvp_data = frm; - sx->dirty = TRUE; -} - -const GUID* -xaccSchedXactionGetGUID( SchedXaction *sx ) -{ - return &sx->guid; -} - -void -xaccSchedXactionSetGUID( SchedXaction *sx, GUID g ) -{ - sx->guid = g; - sx->dirty = TRUE; -} - -void -xaccSchedXactionGetAutoCreate( SchedXaction *sx, - gboolean *outAutoCreate, - gboolean *outNotify ) -{ - *outAutoCreate = sx->autoCreateOption; - *outNotify = sx->autoCreateNotify; - return; -} - -void -xaccSchedXactionSetAutoCreate( SchedXaction *sx, - gboolean newAutoCreate, - gboolean newNotify ) -{ - - sx->autoCreateOption = newAutoCreate; - sx->autoCreateNotify = newNotify; - sx->dirty = TRUE; - return; -} - -gint -xaccSchedXactionGetAdvanceCreation( SchedXaction *sx ) -{ - return sx->advanceCreateDays; -} - -void -xaccSchedXactionSetAdvanceCreation( SchedXaction *sx, gint createDays ) -{ - sx->advanceCreateDays = createDays; - sx->dirty = TRUE; -} - -gint -xaccSchedXactionGetAdvanceReminder( SchedXaction *sx ) -{ - return sx->advanceRemindDays; -} - -void -xaccSchedXactionSetAdvanceReminder( SchedXaction *sx, gint reminderDays ) -{ - sx->dirty = TRUE; - sx->advanceRemindDays = reminderDays; -} - -GDate -xaccSchedXactionGetNextInstance( SchedXaction *sx ) -{ - GDate last_occur, next_occur, tmpDate; - - g_date_clear( &last_occur, 1 ); - g_date_clear( &next_occur, 1 ); - g_date_clear( &tmpDate, 1 ); - - if ( g_date_valid( &sx->last_date ) ) { - last_occur = sx->last_date; - } - - if ( g_date_valid( &sx->start_date ) ) { - if ( g_date_valid(&last_occur) ) { - last_occur = - ( g_date_compare( &last_occur, - &sx->start_date ) > 0 ? - last_occur : sx->start_date ); - } else { - last_occur = sx->start_date; - } - } - -#if 0 - if ( g_date_valid( &last_occur ) ) { - g_date_set_time( &tmpDate, time(NULL) ); - last_occur = - ( g_date_compare( &last_occur, - &tmpDate ) > 0 ? - last_occur : tmpDate ); - } else { - g_date_set_time( &last_occur, time(NULL) ); - } -#endif /* 0 */ - - if ( g_date_valid( &sx->start_date ) - && ! g_date_valid( &sx->last_date ) ) { - /* Think about this for a second, and you realize - * that if the start date is _today_, we need a - * last-occur date such that the 'next instance' is - * after that date... one day should be good. - * - * This only holds for the first instance [read: if the - * last[-occur]_date is invalid. */ - g_date_subtract_days( &last_occur, 1 ); - } - - xaccFreqSpecGetNextInstance( sx->freq, &last_occur, &next_occur ); - return next_occur; -} - -GDate xaccSchedXactionGetInstanceAfter( SchedXaction *sx, GDate *date ) -{ - GDate next_occur; - xaccFreqSpecGetNextInstance( sx->freq, date, &next_occur ); - return next_occur; -} - -/* - * XXX: This does what you want, I think - */ - -GList * -xaccSchedXactionGetSplits( SchedXaction *sx ) -{ - g_return_val_if_fail( sx, NULL ); - return xaccAccountGetSplitList(sx->template_acct); -} - -void -xaccSchedXactionSetDirtyness( SchedXaction *sx, gboolean dirty_p) -{ - sx->dirty = dirty_p; - return; -} - -gboolean -xaccSchedXactionIsDirty(SchedXaction *sx) -{ - return sx->dirty; -} diff --git a/src/engine/SchedXaction.h b/src/engine/SchedXaction.h deleted file mode 100644 index c4845521fb..0000000000 --- a/src/engine/SchedXaction.h +++ /dev/null @@ -1,214 +0,0 @@ -/********************************************************************\ - * SchedXaction.h -- Scheduled Transaction * - * Copyright (C) 2001 Joshua Sled * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_SCHEDXACTION_H -#define XACC_SCHEDXACTION_H - -#include "config.h" - -#include -#include -#include "GNCId.h" -#include "FreqSpec.h" -#include "date.h" -#include "kvp_frame.h" -#include "gnc-book.h" - -/** - * A single scheduled transaction. - * - * Scheduled transactions have a list of transactions, and a frequency - * [and associated date anchors] with which they are scheduled. - * - * Things that make sense to have in a template transaction: - * [not] Date [though eventually some/multiple template transactions - * might have relative dates]. - * Memo - * Account - * Funds In/Out... or an expr involving 'amt' [A, x, y, a?] for - * variable expenses. - * - * Template transactions are instantiated by: - * . copying the fields of the template - * . setting the date to the calculated "due" date. - * - * We should be able to use the GeneralLedger [or, yet-another-subtype - * of the internal ledger] for this editing. - **/ -typedef struct gncp_SchedXaction { - gchar *name; - - FreqSpec *freq; - - GDate last_date; - - GDate start_date; - /* if end_date is invalid, then no end. */ - GDate end_date; - - /* if num_occurances_total == 0, then no limit */ - gint num_occurances_total; - /* reminaing occurances are as-of the 'last_date'. */ - gint num_occurances_remain; - - gboolean autoCreateOption; - gboolean autoCreateNotify; - gint advanceCreateDays; - gint advanceRemindDays; - - Account *template_acct; - GUID guid; - - /* Changed since last save? */ - gboolean dirty; - - kvp_frame *kvp_data; - - -} SchedXaction; - -/** - * Creates and initializes a scheduled transaction. - **/ -SchedXaction *xaccSchedXactionMalloc( GNCBook *book); - -/* - * returns true if the scheduled transaction is dirty and needs to - * be saved - */ - -gboolean xaccSchedXactionIsDirty(SchedXaction *sx); - -/* - * Set dirtyness state. Only save/load code should modify this outside - * SX engine CODE . . . - * (set it to FALSE after backend completes reading in data - * - * FIXME: put this into a private header . . . . - */ - -void xaccSchedXactionSetDirtyness(SchedXaction *sx, gboolean dirty_p); -/* - * Cleans up and frees a SchedXaction and it's associated data. - **/ -void xaccSchedXactionFree( SchedXaction *sx ); - -FreqSpec *xaccSchedXactionGetFreqSpec( SchedXaction *sx ); -/** - * The FreqSpec is given to the SchedXaction for mem mgmt; it should - * not be freed by the external code. - **/ -void xaccSchedXactionSetFreqSpec( SchedXaction *sx, FreqSpec *fs ); - -gchar *xaccSchedXactionGetName( SchedXaction *sx ); -/** - * A copy of the name is made. - **/ -void xaccSchedXactionSetName( SchedXaction *sx, const gchar *newName ); - -GDate* xaccSchedXactionGetStartDate( SchedXaction *sx ); -void xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart ); - -int xaccSchedXactionHasEndDate( SchedXaction *sx ); -/** - * Returns invalid date when there is no end-date specified. - **/ -GDate* xaccSchedXactionGetEndDate( SchedXaction *sx ); -void xaccSchedXactionSetEndDate( SchedXaction *sx, GDate* newEnd ); - -GDate* xaccSchedXactionGetLastOccurDate( SchedXaction *sx ); -void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur ); - -/** - * Returns true if the scheduled transaction has a defined number of - * occurances, false if not. - **/ -gboolean xaccSchedXactionHasOccurDef( SchedXaction *sx ); -gint xaccSchedXactionGetNumOccur( SchedXaction *sx ); -void xaccSchedXactionSetNumOccur( SchedXaction *sx, gint numNum ); -gint xaccSchedXactionGetRemOccur( SchedXaction *sx ); -void xaccSchedXactionSetRemOccur( SchedXaction *sx, gint numRemain ); - -GList *xaccSchedXactionGetSplits( SchedXaction *sx ); -void xaccSchedXactionSetSplits( SchedXaction *sx, GList *newSplits ); - -void xaccSchedXactionGetAutoCreate( SchedXaction *sx, gboolean *outAutoCreate, gboolean *outNotify ); -void xaccSchedXactionSetAutoCreate( SchedXaction *sx, gboolean newAutoCreate, gboolean newNotify ); - -gint xaccSchedXactionGetAdvanceCreation( SchedXaction *sx ); -void xaccSchedXactionSetAdvanceCreation( SchedXaction *sx, gint createDays ); - -gint xaccSchedXactionGetAdvanceReminder( SchedXaction *sx ); -void xaccSchedXactionSetAdvanceReminder( SchedXaction *sx, gint reminderDays ); - -#if 0 -#error vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv -GList *xaccSchedXactionGetXactions( SchedXaction *sx ); -void xaccSchedXactionClearXactions( SchedXaction *sx ); -void xaccSchedXactionAddXaction( SchedXaction *sx, - Transaction *t ); -#error ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -#endif /* 0 */ - - -/* - * The following function is slightly risky. If you change - * the retrieved kvp_frame you must mark the SchedXaction - * dirty with xaccSchedXactionSetDirtyness - */ -kvp_frame *xaccSchedXactionGetSlots( SchedXaction *sx ); -/** - * Sets the SX kvp data to the given kvp_frame. - * NOTE: This is not copied, but set directly. - **/ -void xaccSchedXactionSetSlots( SchedXaction *sx, - kvp_frame *frm ); - - -/** - * Use the following two functions in preference to - * the above two . . . - */ -kvp_value *xaccSchedXactionGetSlot( SchedXaction *sx, - const char *slot ); - -/* - * This function copies value, so you don't have to - */ - -void xaccSchedXactionSetSlot( SchedXaction *sx, - const char *slot, - const kvp_value *value ); - -const GUID *xaccSchedXactionGetGUID( SchedXaction *sx ); -void xaccSchedXactionSetGUID( SchedXaction *sx, GUID g ); - -/** - * Returns the next occurance of a scheduled transaction. If the - * transaction hasn't occured, then it's based off the start date. - * Otherwise, it's based off the last-occurance date. - **/ -GDate xaccSchedXactionGetNextInstance( SchedXaction *sx ); -GDate xaccSchedXactionGetInstanceAfter( SchedXaction *sx, GDate *date ); - -#endif /* XACC_SCHEDXACTION_H */ diff --git a/src/engine/Scrub.c b/src/engine/Scrub.c deleted file mode 100644 index a30f70aa89..0000000000 --- a/src/engine/Scrub.c +++ /dev/null @@ -1,506 +0,0 @@ -/********************************************************************\ - * Scrub.c -- convert single-entry accounts into clean double-entry * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * Scrub.c - * - * FUNCTION: - * Provides a set of functions and utilities for scrubbing clean - * single-entry accounts so that they can be promoted into - * self-consistent, clean double-entry accounts. - * - * HISTORY: - * Created by Linas Vepstas December 1998 - * Copyright (c) 1998, 1999, 2000 Linas Vepstas - */ - -#include "config.h" - -#include -#include -#include - -#include "Account.h" -#include "Group.h" -#include "GroupP.h" -#include "Scrub.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "gnc-engine-util.h" -#include "messages.h" - -static short module = MOD_SCRUB; -static Account * GetOrMakeAccount (AccountGroup *root, Transaction *trans, - const char *name_root); - -/* ================================================================ */ - -void -xaccGroupScrubOrphans (AccountGroup *grp) -{ - GList *list; - GList *node; - - if (!grp) - return; - - list = xaccGroupGetAccountList (grp); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccAccountTreeScrubOrphans (account); - } -} - -void -xaccAccountTreeScrubOrphans (Account *acc) -{ - if (!acc) - return; - - xaccGroupScrubOrphans (xaccAccountGetChildren(acc)); - xaccAccountScrubOrphans (acc); -} - -void -xaccAccountScrubOrphans (Account *acc) -{ - GList *node; - const char *str; - - if (!acc) - return; - - str = xaccAccountGetName (acc); - str = str ? str : "(null)"; - PINFO ("Looking for orphans in account %s \n", str); - - for (node = xaccAccountGetSplitList(acc); node; node = node->next) - { - Split *split = node->data; - - xaccTransScrubOrphans (xaccSplitGetParent (split), - xaccGetAccountRoot (acc)); - } -} - -void -xaccTransScrubOrphans (Transaction *trans, AccountGroup *root) -{ - GList *node; - - if (!trans) - return; - - for (node = xaccTransGetSplitList (trans); node; node = node->next) - { - Split *split = node->data; - Account *account; - Account *orph; - - account = xaccSplitGetAccount (split); - if (account) - continue; - - DEBUG ("Found an orphan \n"); - - orph = GetOrMakeAccount (root, trans, _("Orphan")); - - xaccAccountBeginEdit (orph); - xaccAccountInsertSplit (orph, split); - xaccAccountCommitEdit (orph); - } -} - -/* ================================================================ */ - -void -xaccGroupScrubSplits (AccountGroup *group) -{ - GList *list; - GList *node; - - if (!group) return; - - list = xaccGroupGetAccountList (group); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccAccountTreeScrubSplits (account); - } -} - -void -xaccAccountTreeScrubSplits (Account *account) -{ - xaccGroupScrubSplits (xaccAccountGetChildren(account)); - xaccAccountScrubSplits (account); -} - -void -xaccAccountScrubSplits (Account *account) -{ - GList *node; - - for (node = xaccAccountGetSplitList (account); node; node = node->next) - xaccSplitScrub (node->data); -} - -void -xaccTransScrubSplits (Transaction *trans) -{ - GList *node; - - if (!trans) - return; - - for (node = trans->splits; node; node = node->next) - xaccSplitScrub (node->data); -} - -void -xaccSplitScrub (Split *split) -{ - Account *account; - Transaction *trans; - gnc_numeric value; - gboolean trans_was_open; - gnc_commodity *commodity; - gnc_commodity *currency; - int scu; - - if (!split) - return; - - trans = xaccSplitGetParent (split); - if (!trans) - return; - - account = xaccSplitGetAccount (split); - if (!account) - { - value = xaccSplitGetValue (split); - - if (gnc_numeric_same (xaccSplitGetAmount (split), - xaccSplitGetValue (split), - value.denom, GNC_RND_ROUND)) - return; - - xaccSplitSetAmount (split, value); - - return; - } - - commodity = xaccAccountGetCommodity (account); - currency = xaccTransGetCurrency (trans); - - if (!commodity || !gnc_commodity_equiv (commodity, currency)) - return; - - scu = MIN (xaccAccountGetCommoditySCU (account), - gnc_commodity_get_fraction (currency)); - - value = xaccSplitGetValue (split); - - if (gnc_numeric_same (xaccSplitGetAmount (split), - value, scu, GNC_RND_ROUND)) - return; - - PINFO ("split with mismatched values"); - - trans_was_open = xaccTransIsOpen (trans); - - if (!trans_was_open) - xaccTransBeginEdit (trans); - - xaccSplitSetAmount (split, value); - - if (!trans_was_open) - xaccTransCommitEdit (trans); -} - -/* ================================================================ */ - -void -xaccGroupScrubImbalance (AccountGroup *grp) -{ - GList *list; - GList *node; - - if (!grp) return; - - list = xaccGroupGetAccountList (grp); - - for (node = list; node; node = node->next) - { - Account *account = node->data; - - xaccAccountTreeScrubImbalance (account); - } -} - -void -xaccAccountTreeScrubImbalance (Account *acc) -{ - xaccGroupScrubImbalance (xaccAccountGetChildren(acc)); - xaccAccountScrubImbalance (acc); -} - -void -xaccAccountScrubImbalance (Account *acc) -{ - GList *node; - const char *str; - - str = xaccAccountGetName(acc); - str = str ? str : "(null)"; - PINFO ("Looking for imbalance in account %s \n", str); - - for(node = xaccAccountGetSplitList(acc); node; node = node->next) - { - Split *split = node->data; - Transaction *trans = xaccSplitGetParent(split); - - xaccTransScrubImbalance (trans, xaccGetAccountRoot (acc), NULL); - } -} - -void -xaccTransScrubImbalance (Transaction *trans, AccountGroup *root, - Account *parent) -{ - Split *balance_split = NULL; - gnc_numeric imbalance; - - if (!trans) - return; - - xaccTransScrubSplits (trans); - - { - Account *account; - GList *node; - - imbalance = xaccTransGetImbalance (trans); - if (gnc_numeric_zero_p (imbalance)) - return; - - if (!parent) - account = GetOrMakeAccount (root, trans, _("Imbalance")); - else - account = parent; - - for (node = xaccTransGetSplitList (trans); node; node = node->next) - { - Split *split = node->data; - - if (xaccSplitGetAccount (split) == account) - { - balance_split = split; - break; - } - } - - /* put split into account before setting split value */ - if (!balance_split) - { - balance_split = xaccMallocSplit (); - - xaccAccountBeginEdit (account); - xaccAccountInsertSplit (account, balance_split); - xaccAccountCommitEdit (account); - } - } - - PINFO ("unbalanced transaction"); - - { - const gnc_commodity *currency; - const gnc_commodity *commodity; - gboolean trans_was_open; - gnc_numeric new_value; - Account *account; - - trans_was_open = xaccTransIsOpen (trans); - - if (!trans_was_open) - xaccTransBeginEdit (trans); - - currency = xaccTransGetCurrency (trans); - account = xaccSplitGetAccount (balance_split); - - new_value = xaccSplitGetValue (balance_split); - - new_value = gnc_numeric_sub (new_value, imbalance, - new_value.denom, GNC_RND_ROUND); - - xaccSplitSetValue (balance_split, new_value); - - commodity = xaccAccountGetCommodity (account); - if (gnc_commodity_equiv (currency, commodity)) - xaccSplitSetAmount (balance_split, new_value); - - if (!parent && gnc_numeric_zero_p (new_value)) - { - xaccSplitDestroy (balance_split); - balance_split = NULL; - } - - if (balance_split) - xaccTransAppendSplit (trans, balance_split); - - xaccSplitScrub (balance_split); - - if (!trans_was_open) - xaccTransCommitEdit (trans); - } -} - -/* ================================================================ */ - -void -xaccTransScrubCurrency (Transaction *trans) -{ - gnc_commodity *currency; - - if (!trans) return; - - currency = xaccTransGetCurrency (trans); - if (currency) return; - - currency = xaccTransFindOldCommonCurrency (trans); - if (currency) - { - xaccTransBeginEdit (trans); - xaccTransSetCurrency (trans, currency); - xaccTransCommitEdit (trans); - } - else - { - PWARN ("no common transaction currency found"); - } -} - -/* ================================================================ */ - -void -xaccAccountScrubCommodity (Account *account) -{ - gnc_commodity *commodity; - - if (!account) return; - - commodity = xaccAccountGetCommodity (account); - if (commodity) return; - - commodity = DxaccAccountGetSecurity (account); - if (commodity) - { - xaccAccountSetCommodity (account, commodity); - return; - } - - commodity = DxaccAccountGetCurrency (account); - if (commodity) - { - xaccAccountSetCommodity (account, commodity); - return; - } - - PERR ("account with no commodity"); -} - -/* ================================================================ */ - -static gboolean -scrub_trans_currency_helper (Transaction *t, void *unused) -{ - xaccTransScrubCurrency (t); - return TRUE; -} - -static gpointer -scrub_account_commodity_helper (Account *account, gpointer unused) -{ - xaccAccountScrubCommodity (account); - xaccAccountDeleteOldData (account); - return NULL; -} - -void -xaccGroupScrubCommodities (AccountGroup *group) -{ - if (!group) return; - - xaccAccountGroupBeginEdit (group); - - xaccGroupForEachTransaction (group, scrub_trans_currency_helper, NULL); - - xaccGroupForEachAccount (group, scrub_account_commodity_helper, NULL, TRUE); - - xaccAccountGroupCommitEdit (group); -} - -/* ================================================================ */ - -static Account * -GetOrMakeAccount (AccountGroup *root, Transaction *trans, - const char *name_root) -{ - gnc_commodity * currency; - char * accname; - Account * acc; - - /* build the account name */ - currency = xaccTransGetCurrency (trans); - - accname = g_strconcat (name_root, "-", - gnc_commodity_get_mnemonic (currency), NULL); - - /* see if we've got one of these going already ... */ - acc = xaccGetAccountFromName (root, accname); - - if (acc == NULL) - { - /* guess not. We'll have to build one */ - acc = xaccMallocAccount (); - xaccAccountBeginEdit (acc); - xaccAccountSetName (acc, accname); - xaccAccountSetCommodity (acc, currency); - xaccAccountSetType (acc, BANK); - - /* hang the account off the root */ - xaccGroupInsertAccount (root, acc); - xaccAccountCommitEdit (acc); - } - - g_free (accname); - - return acc; -} - -/* ==================== END OF FILE ==================== */ diff --git a/src/engine/Scrub.h b/src/engine/Scrub.h deleted file mode 100644 index 3ca5b811a6..0000000000 --- a/src/engine/Scrub.h +++ /dev/null @@ -1,99 +0,0 @@ -/********************************************************************\ - * Scrub.h -- convert single-entry accounts to clean double-entry * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * Scrub.h - * - * FUNCTION: - * Provides a set of functions and utilities for scrubbing clean - * single-entry accounts so that they can be promoted into - * self-consistent, clean double-entry accounts. - * - * HISTORY: - * Created by Linas Vepstas December 1998 - * Copyright (c) 1998, 1999, 2000 Linas Vepstas - */ - -#ifndef XACC_SCRUB_H -#define XACC_SCRUB_H - -#include "Account.h" -#include "Group.h" - -/* The ScrubOrphans() methods search for transacations that contain - * splits that do not have a parent account. These "orphaned splits" - * are placed into an "orphan account" which the user will have to - * go into and clean up. Kind of like the unix "Lost+Found" directory - * for orphaned inodes. - * - * The xaccTransScrubOrphans() method scrubs only the splits in the - * given transaction. A root account group must be provided. - * - * The xaccAccountScrubOrphans() method performs this scrub only for the - * indicated account, and not for any of its children. - * - * The xaccAccountTreeScrubOrphans() method performs this scrub for the - * indicated account and its children. - * - * The xaccGroupScrubOrphans() method performs this scrub for the - * child accounts of this group. - */ -void xaccTransScrubOrphans (Transaction *trans, AccountGroup *root); -void xaccAccountScrubOrphans (Account *acc); -void xaccAccountTreeScrubOrphans (Account *acc); -void xaccGroupScrubOrphans (AccountGroup *grp); - -/* The ScrubSplit methods ensure that splits with the same commodity - * and command currency have the same amount and value. - */ -void xaccSplitScrub (Split *split); -void xaccTransScrubSplits (Transaction *trans); -void xaccAccountScrubSplits (Account *account); -void xaccAccountTreeScrubSplits (Account *account); -void xaccGroupScrubSplits (AccountGroup *group); - -/* The xaccScrubImbalance() method searches for transactions that do - * not balance to zero. If any such transactions are found, a split - * is created to offset this amount and is added to an "imbalance" - * account. - */ -void xaccTransScrubImbalance (Transaction *trans, AccountGroup *root, - Account *parent); -void xaccAccountScrubImbalance (Account *acc); -void xaccAccountTreeScrubImbalance (Account *acc); -void xaccGroupScrubImbalance (AccountGroup *grp); - -/* The xaccTransScrubCurrency method fixes transactions without a - * common_currency by using the old account currency and security - * fields of the parent accounts of the transaction's splits. */ -void xaccTransScrubCurrency (Transaction *trans); - -/* The xaccAccountScrubCommodity method fixed accounts without - * a commodity by using the old account currency and security. */ -void xaccAccountScrubCommodity (Account *account); - -/* The xaccGroupScrubCommodities will scrub the currency/commodity - * of all accounts & transactions in the group. */ -void xaccGroupScrubCommodities (AccountGroup *group); - -#endif /* XACC_SCRUB_H */ diff --git a/src/engine/TransLog.c b/src/engine/TransLog.c deleted file mode 100644 index b789330707..0000000000 --- a/src/engine/TransLog.c +++ /dev/null @@ -1,363 +0,0 @@ -/********************************************************************\ - * TransLog.c -- the transaction logger * - * Copyright (C) 1998 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#define _GNU_SOURCE -#include "config.h" - -#include -#include -#include - -#include - -#include "Account.h" -#include "AccountP.h" -#include "DateUtils.h" -#include "date.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "TransLog.h" -#include "gnc-engine-util.h" - -/* - * The logfiles are useful for tracing, journalling, error recovery. - * Note that the current support for journalling is at best - * embryonic, at worst, is dangerous by setting the wrong expectations. - */ - -/* - * Some design philosphy that I think would be good to keep in mind: - * (0) Simplicity and foolproofness are the over-riding design points. - * This is supposed to be a fail-safe safety net. We don't want - * our safety net to fail because of some whiz-bang shenanigans. - * - * (1) Try to keep the code simple. Want to make it simple and obvious - * that we are recording everything that we need to record. - * - * (2) Keep the printed format human readable, for the same reasons. - * (2.a) Keep the format, simple, flat, more or less unstructured, - * record oriented. This will help parsing by perl scripts. - * No, using a perl script to analyze a file that's supposed to - * be human readable is not a contradication in terms -- that's - * exactly the point. - * (2.b) Use tabs as a human freindly field separator; its also a - * character that does not (should not) appear naturally anywhere - * in the data, as it serves no formatting purpose in the current - * GUI design. (hack alert -- this is not currently tested for - * or enforced, so this is a very unsafe assumption. Maybe - * urlencoding should be used.) - * (2.c) Don't print redundant information in a single record. This - * would just confuse any potential user of this file. - * (2.d) Saving space, being compact is not a priority, I don't think. - * - * (3) There are no compatibility requirements from release to release. - * Sounds OK to me to change the format of the output when needed. - * - * (-) print transaction start and end delimiters - * (-) print a unique transaction id as a handy label for anyone - * who actually examines these logs. - * The C address pointer to the transaction struct should be fine, - * as it is simple and unique until the transaction is deleted ... - * and we log deletions, so that's OK. Just note that the id - * for a deleted transaction might be recycled. - * (-) print the current timestamp, so that if it is known that a bug - * occurred at a certain time, it can be located. - * (-) hack alert -- something better than just the account name - * is needed for identifying the account. - */ -/* ------------------------------------------------------------------ */ -/* - * The engine currently uses the log mechanism with flag char set as - * follows: - * - * 'B' for 'begin edit' (followed by the transaction as it looks - * before any changes, i.e. the 'old value') - * 'D' for delete (i.e. delete the previous B; echoes the data in the - * 'old B') - * 'C' for commit (i.e. accept a previous B; data that follows is the - * 'new value') - * 'R' for rollback (i.e. revert to previous B; data that follows should - * be identical to old B) - */ - - -static int gen_logs = 1; -static FILE * trans_log = NULL; -static char * log_base_name = NULL; - -/********************************************************************\ -\********************************************************************/ - -void xaccLogDisable (void) { gen_logs = 0; } -void xaccLogEnable (void) { gen_logs = 1; } - -/********************************************************************\ -\********************************************************************/ - -void -xaccLogSetBaseName (const char *basepath) -{ - if (!basepath) return; - - g_free (log_base_name); - log_base_name = g_strdup (basepath); - - if (trans_log) { - xaccCloseLog(); - xaccOpenLog(); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccOpenLog (void) -{ - char * filename; - char * timestamp; - - if (!gen_logs) return; - if (trans_log) return; - - if (!log_base_name) log_base_name = g_strdup ("translog"); - - /* tag each filename with a timestamp */ - timestamp = xaccDateUtilGetStampNow (); - - filename = g_strconcat (log_base_name, ".", timestamp, ".log", NULL); - - trans_log = fopen (filename, "a"); - if (!trans_log) { - int norr = errno; - printf ("Error: xaccOpenLog(): cannot open journal \n" - "\t %d %s\n", norr, strerror (norr)); - - g_free (filename); - g_free (timestamp); - return; - } - - g_free (filename); - g_free (timestamp); - - /* use tab-separated fields */ - fprintf (trans_log, "mod id time_now " \ - "date_entered date_posted " \ - "account num description " \ - "memo action reconciled " \ - "amount price date_reconciled\n"); - fprintf (trans_log, "-----------------\n"); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccCloseLog (void) -{ - if (!trans_log) return; - fflush (trans_log); - fclose (trans_log); - trans_log = NULL; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransWriteLog (Transaction *trans, char flag) -{ - GList *node; - char *dnow, *dent, *dpost, *drecn; - - if (!gen_logs) return; - if (!trans_log) return; - - dnow = xaccDateUtilGetStampNow (); - dent = xaccDateUtilGetStamp (trans->date_entered.tv_sec); - dpost = xaccDateUtilGetStamp (trans->date_posted.tv_sec); - - fprintf (trans_log, "===== START\n"); - - for (node = trans->splits; node; node = node->next) { - Split *split = node->data; - const char * accname = ""; - - if (xaccSplitGetAccount(split)) - accname = xaccAccountGetName (xaccSplitGetAccount(split)); - - drecn = xaccDateUtilGetStamp (split->date_reconciled.tv_sec); - - /* use tab-separated fields */ - fprintf (trans_log, - "%c\t%p/%p\t%s\t%s\t%s\t%s\t%s\t" - "%s\t%s\t%s\t%c\t%lld/%lld\t%lld/%lld\t%s\n", - flag, - trans, split, /* trans+split make up unique id */ - dnow ? dnow : "", - dent ? dent : "", - dpost ? dpost : "", - accname ? accname : "", - trans->num ? trans->num : "", - trans->description ? trans->description : "", - split->memo ? split->memo : "", - split->action ? split->action : "", - split->reconciled, - (long long int) gnc_numeric_num(split->amount), - (long long int) gnc_numeric_denom(split->amount), - (long long int) gnc_numeric_num(split->value), - (long long int) gnc_numeric_denom(split->value), - drecn ? drecn : ""); - - g_free (drecn); - } - - fprintf (trans_log, "===== END\n"); - - g_free (dnow); - g_free (dent); - g_free (dpost); - - /* get data out to the disk */ - fflush (trans_log); -} - -/********************************************************************\ -\********************************************************************/ - -#if 0 -/* open_memstream seems to give various distros fits - * this has resulted in warfare on the mailing list. - * I think the truce called required changing this to asprintf - * this code is not currently used ... so its ifdef out - */ - -char * -xaccSplitAsString(Split *split, const char prefix[]) { - char *result = NULL; - size_t result_size; - FILE *stream = open_memstream(&result, &result_size); - const char *split_memo = xaccSplitGetMemo(split); - const double split_value = DxaccSplitGetValue(split); - Account *split_dest = xaccSplitGetAccount(split); - const char *dest_name = - split_dest ? xaccAccountGetName(split_dest) : NULL; - - assert(stream); - - fputc('\n', stream); - fputs(prefix, stream); - fprintf(stream, " %10.2f | %15s | %s", - split_value, - dest_name ? dest_name : "", - split_memo ? split_memo : ""); - fclose(stream); - return(result); -} - -static char * -xaccTransGetDateStr (Transaction *trans) -{ - char buf [MAX_DATE_LENGTH]; - struct tm *date; - time_t secs; - - secs = xaccTransGetDate (trans); - - date = localtime (&secs); - - printDate(buf, date->tm_mday, date->tm_mon+1, date->tm_year +1900); - - return g_strdup (buf); -} - -char * -xaccTransAsString(Transaction *txn, const char prefix[]) { - char *result = NULL; - size_t result_size; - FILE *stream = open_memstream(&result, &result_size); - time_t date = xaccTransGetDate(txn); - const char *num = xaccTransGetNum(txn); - const char *desc = xaccTransGetDescription(txn); - const char *memo = xaccSplitGetMemo(xaccTransGetSplit(txn, 0)); - const double total = DxaccSplitGetValue(xaccTransGetSplit(txn, 0)); - - assert(stream); - - fputs(prefix, stream); - if(date) { - char *datestr = xaccTransGetDateStr(txn); - fprintf(stream, "%s", datestr); - free(datestr); - } else { - fprintf(stream, ""); - } - fputc(' ', stream); - if(num) { - fputs(num, stream); - } else { - fprintf(stream, ""); - } - - fputc('\n', stream); - fputs(prefix, stream); - if(desc) { - fputs(" ", stream); - fputs(desc, stream); - } else { - fprintf(stream, ""); - } - - fputc('\n', stream); - fputs(prefix, stream); - if(memo) { - fputs(" ", stream); - fputs(memo, stream); - } else { - fprintf(stream, ""); - } - - { - int split_count = xaccTransCountSplits(txn); - int i; - for(i = 1; i < split_count; i++) { - Split *split = xaccTransGetSplit(txn, i); - char *split_text = xaccSplitAsString(split, prefix); - fputs(split_text, stream); - free(split_text); - } - } - fputc('\n', stream); - - fputs(prefix, stream); - fprintf(stream, " %10.2f -- Transaction total\n", total); - fclose(stream); - - return(result); -} - -#endif - -/************************ END OF ************************************\ -\************************* FILE *************************************/ diff --git a/src/engine/TransLog.h b/src/engine/TransLog.h deleted file mode 100644 index 583c001b3a..0000000000 --- a/src/engine/TransLog.h +++ /dev/null @@ -1,46 +0,0 @@ -/********************************************************************\ - * TransLog.h -- the transaction logger * - * Copyright (C) 1998 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_TRANS_LOG_H -#define XACC_TRANS_LOG_H - -#include "config.h" - -#include "Account.h" -#include "Transaction.h" - -void xaccOpenLog (void); -void xaccCloseLog (void); -void xaccTransWriteLog (Transaction *, char); -void xaccLogEnable (void); -void xaccLogDisable (void); - -/* The xaccLogSetBaseName() method sets the base filepath and the - * root part of the journal file name. If the journal file is - * already open, it will close it and reopen it with the new - * base name. - */ -void xaccLogSetBaseName (const char *); - -#endif /* XACC_TRANS_LOG_H */ - diff --git a/src/engine/Transaction.c b/src/engine/Transaction.c deleted file mode 100644 index f28937573a..0000000000 --- a/src/engine/Transaction.c +++ /dev/null @@ -1,2538 +0,0 @@ -/********************************************************************\ - * Transaction.c -- transaction & split implementation * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997-2000 Linas Vepstas * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include -#include -#include - -#include "Account.h" -#include "AccountP.h" -#include "BackendP.h" -#include "GNCIdP.h" -#include "Group.h" -#include "Scrub.h" -#include "Transaction.h" -#include "TransactionP.h" -#include "TransLog.h" -#include "date.h" -#include "gnc-commodity.h" -#include "gnc-engine-util.h" -#include "gnc-engine.h" -#include "gnc-event-p.h" -#include "messages.h" - - -/* - * The "force_double_entry" flag determines how - * the splits in a transaction will be balanced. - * - * The following values have significance: - * 0 -- anything goes - * 1 -- The sum of all splits in a transaction will be - * forced to be zero, even if this requires the - * creation of additional splits. Note that a split - * whose value is zero (e.g. a stock price) can exist - * by itself. Otherwise, all splits must come in at - * least pairs. - * 2 -- splits without parents will be forced into a - * lost & found account. (Not implemented) - */ -int force_double_entry = 0; - -#define PRICE_SIGFIGS 6 - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - - -G_INLINE_FUNC void check_open (Transaction *trans); -G_INLINE_FUNC void -check_open (Transaction *trans) -{ - if (trans && 0 >= trans->editlevel) - { - PERR ("transaction %p not open for editing\n", trans); - // assert (trans->editlevel); - PERR ("\t%s:%d \n", __FILE__, __LINE__); - } -} - -/********************************************************************\ - * xaccInitSplit - * Initialize a Split structure -\********************************************************************/ - -static void -xaccInitSplit(Split * split) -{ - /* fill in some sane defaults */ - xaccSplitSetAccount(split, NULL); - split->parent = NULL; - - split->action = g_cache_insert(gnc_engine_get_string_cache(), ""); - split->memo = g_cache_insert(gnc_engine_get_string_cache(), ""); - split->reconciled = NREC; - split->amount = gnc_numeric_zero(); - split->value = gnc_numeric_zero(); - - split->date_reconciled.tv_sec = 0; - split->date_reconciled.tv_nsec = 0; - - split->balance = gnc_numeric_zero(); - split->cleared_balance = gnc_numeric_zero(); - split->reconciled_balance = gnc_numeric_zero(); - - split->kvp_data = kvp_frame_new(); - split->idata = 0; - - xaccGUIDNew(&split->guid); - xaccStoreEntity(split, &split->guid, GNC_ID_SPLIT); -} - -/********************************************************************\ -\********************************************************************/ - -Split * -xaccMallocSplit(void) -{ - Split *split = g_new(Split, 1); - xaccInitSplit (split); - return split; -} - -/********************************************************************\ -\********************************************************************/ -/* This routine is not exposed externally, since it does weird things, - * like not really setting up the parent account correctly, and ditto - * the parent transaction. This routine is prone to programmer error - * if not used correctly. It is used only by the edit-rollback code. - */ - -static Split * -xaccCloneSplit (Split *s) -{ - Split *split = g_new0 (Split, 1); - - /* copy(!) the guid. The cloned split is *not* unique, - * is a sick twisted clone that holds 'undo' information. */ - split->guid = s->guid; - - xaccSplitSetAccountGUID(split, s->acc_guid); - split->parent = s->parent; - - split->memo = g_cache_insert (gnc_engine_get_string_cache(), s->memo); - split->action = g_cache_insert (gnc_engine_get_string_cache(), s->action); - - split->kvp_data = kvp_frame_copy (s->kvp_data); - - split->reconciled = s->reconciled; - split->date_reconciled = s->date_reconciled; - - split->value = s->value; - split->amount = s->amount; - - /* no need to futz with the balances; these get wiped each time ... - * split->balance = s->balance; - * split->cleared_balance = s->cleared_balance; - * split->reconciled_balance = s->reconciled_balance; - */ - - return split; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccFreeSplit (Split *split) -{ - if (!split) return; - - kvp_frame_delete (split->kvp_data); - - g_cache_remove(gnc_engine_get_string_cache(), split->memo); - g_cache_remove(gnc_engine_get_string_cache(), split->action); - - /* just in case someone looks up freed memory ... */ - split->memo = NULL; - split->action = NULL; - split->kvp_data = NULL; - split->reconciled = NREC; - split->amount = gnc_numeric_zero(); - split->value = gnc_numeric_zero(); - split->parent = NULL; - xaccSplitSetAccount(split, NULL); - - split->date_reconciled.tv_sec = 0; - split->date_reconciled.tv_nsec = 0; - - g_free(split); -} - -/******************************************************************** - * xaccSplitEqual - ********************************************************************/ -gboolean -xaccSplitEqual(const Split *sa, const Split *sb, - gboolean check_guids, - gboolean check_txn_splits) { - - if(!sa && !sb) return TRUE; - if(!sa) return FALSE; - if(!sb) return FALSE; - - if(check_guids) { - if(!guid_equal(&(sa->guid), &(sb->guid))) return FALSE; - } - - /* Since these strings are cached we can just use pointer equality */ - if(sa->memo != sb->memo) return FALSE; - if(sa->action != sb->action) return FALSE; - - if(kvp_frame_compare(sa->kvp_data, sb->kvp_data) != 0) return FALSE; - - if(sa->reconciled != sb->reconciled) return FALSE; - if(timespec_cmp(&(sa->date_reconciled), - &(sb->date_reconciled))) return FALSE; - - if(!gnc_numeric_eq(sa->amount, sb->amount)) return FALSE; - if(!gnc_numeric_eq(sa->value, sb->value)) return FALSE; - - if(!xaccTransEqual(sa->parent, sb->parent, - check_guids, - check_txn_splits)) { - return FALSE; - } - - return(TRUE); -} - -/******************************************************************** - * xaccSplitGetSlots - ********************************************************************/ - -kvp_frame * -xaccSplitGetSlots(Split * s) { - if(!s) return NULL; - return(s->kvp_data); -} - -void -xaccSplitSetSlots_nc(Split *s, kvp_frame *frm) -{ - g_return_if_fail(s); - g_return_if_fail(frm); - - if(s->kvp_data) - { - kvp_frame_delete(s->kvp_data); - } - - s->kvp_data = frm; -} - -/******************************************************************** - * Account funcs - ********************************************************************/ - -static void -xaccSplitSetAccount_Internal(Split *s, Account *act) -{ - if(!act) - { - return; - } - s->acc = act; -} - -Account* -xaccSplitGetAccount(Split *s) -{ - if(!s) return NULL; - - if(!s->acc) - { - xaccSplitSetAccount_Internal(s, xaccAccountLookup(&s->acc_guid)); - } - - return s->acc; -} - -const GUID * -xaccSplitGetAccountGUID(Split *split) -{ - return (const GUID*) &split->acc_guid; -} - -void -xaccSplitSetAccount(Split *s, Account *act) -{ - if(!act) - { - s->acc_guid = *xaccGUIDNULL(); - } - else - { - const GUID *id = xaccAccountGetGUID(act); - s->acc_guid = *id; - } - - s->acc = act; -} - -void -xaccSplitSetAccountGUID(Split *s, GUID id) -{ - s->acc_guid = id; - s->acc = NULL; -} - - -/********************************************************************\ -\********************************************************************/ - -const GUID * -xaccSplitGetGUID (Split *split) -{ - if (!split) return xaccGUIDNULL(); - return &split->guid; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccSplitSetGUID (Split *split, const GUID *guid) -{ - if (!split || !guid) return; - check_open (split->parent); - xaccRemoveEntity(&split->guid); - split->guid = *guid; - xaccStoreEntity(split, &split->guid, GNC_ID_SPLIT); -} - -/********************************************************************\ -\********************************************************************/ - -Split * -xaccSplitLookup (const GUID *guid) -{ - if (!guid) return NULL; - return xaccLookupEntity(guid, GNC_ID_SPLIT); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccConfigSetForceDoubleEntry (int force) -{ - force_double_entry = force; -} - -int -xaccConfigGetForceDoubleEntry (void) -{ - return (force_double_entry); -} - -/********************************************************************\ -\********************************************************************/ - -G_INLINE_FUNC void mark_split_internal (Split *split, - gboolean generate_events); -G_INLINE_FUNC void -mark_split_internal (Split *split, gboolean generate_events) -{ - Account *account = xaccSplitGetAccount(split); - Transaction *trans; - - if (account) - { - account->balance_dirty = TRUE; - account->sort_dirty = TRUE; - - xaccGroupMarkNotSaved (account->parent); - - if (generate_events) - gnc_engine_generate_event (&account->guid, GNC_EVENT_MODIFY); - } - - trans = split->parent; - if (trans && generate_events) - gnc_engine_generate_event (&trans->guid, GNC_EVENT_MODIFY); -} - -G_INLINE_FUNC void mark_split (Split *split); -G_INLINE_FUNC void -mark_split (Split *split) -{ - mark_split_internal (split, TRUE); -} - -G_INLINE_FUNC void mark_trans (Transaction *trans); -G_INLINE_FUNC void -mark_trans (Transaction *trans) -{ - GList *node; - - for (node = trans->splits; node; node = node->next) - mark_split_internal (node->data, FALSE); - - gnc_engine_generate_event (&trans->guid, GNC_EVENT_MODIFY); -} - -/********************************************************************\ -\********************************************************************/ - -static int -get_currency_denom(Split * s) -{ - if(!s) - { - return 0; - } - else if(!s->parent || !s->parent->common_currency) - { - return 100000; - } - else - { - return gnc_commodity_get_fraction (s->parent->common_currency); - } -} - -static int -get_commodity_denom(Split * s) -{ - if(!s) - { - return 0; - } - else if(!xaccSplitGetAccount(s)) - { - return 100000; - } - else - { - return xaccAccountGetCommoditySCU(xaccSplitGetAccount(s)); - } -} - -/********************************************************************\ -\********************************************************************/ - -void -DxaccSplitSetSharePriceAndAmount (Split *s, double price, double amt) -{ - if (!s) return; - check_open (s->parent); - - s->amount = double_to_gnc_numeric(amt, get_commodity_denom(s), - GNC_RND_ROUND); - s->value = double_to_gnc_numeric(price * amt, get_currency_denom(s), - GNC_RND_ROUND); - - mark_split (s); -} - -void -xaccSplitSetSharePriceAndAmount (Split *s, gnc_numeric price, - gnc_numeric amt) -{ - if (!s) return; - check_open (s->parent); - - s->amount = gnc_numeric_convert(amt, get_commodity_denom(s), GNC_RND_ROUND); - s->value = gnc_numeric_mul(s->amount, price, - get_currency_denom(s), GNC_RND_ROUND); - - mark_split (s); -} - -void -DxaccSplitSetSharePrice (Split *s, double amt) -{ - xaccSplitSetSharePrice - (s, double_to_gnc_numeric(amt, GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(PRICE_SIGFIGS) | - GNC_RND_ROUND)); -} - -void -xaccSplitSetSharePrice (Split *s, gnc_numeric price) -{ - if (!s) return; - check_open (s->parent); - - s->value = gnc_numeric_mul(s->amount, price, get_currency_denom(s), - GNC_RND_ROUND); - - mark_split (s); -} - -void -DxaccSplitSetShareAmount (Split *s, double damt) -{ - gnc_numeric old_price; - gnc_numeric amt = double_to_gnc_numeric(damt, get_commodity_denom(s), - GNC_RND_ROUND); - if (!s) return; - check_open (s->parent); - - if(!gnc_numeric_zero_p(s->amount)) { - old_price = gnc_numeric_div(s->value, s->amount, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - } - else { - old_price = gnc_numeric_create(1, 1); - } - - s->amount = gnc_numeric_convert(amt, get_commodity_denom(s), - GNC_RND_NEVER); - s->value = gnc_numeric_mul(s->amount, old_price, - get_currency_denom(s), GNC_RND_ROUND); - - mark_split (s); -} - -void -xaccSplitSetAmount (Split *s, gnc_numeric amt) -{ - if(!s) return; - check_open (s->parent); - - s->amount = gnc_numeric_convert(amt, get_commodity_denom(s), GNC_RND_ROUND); - - mark_split (s); -} - -void -DxaccSplitSetValue (Split *s, double damt) -{ - gnc_numeric amt = double_to_gnc_numeric(damt, - get_currency_denom(s), - GNC_RND_ROUND); - gnc_numeric old_price; - if (!s) return; - check_open (s->parent); - - if(!gnc_numeric_zero_p(s->amount)) { - old_price = gnc_numeric_div(s->value, s->amount, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - } - else { - old_price = gnc_numeric_create(1, 1); - } - - s->value = gnc_numeric_convert(amt, get_currency_denom(s), - GNC_RND_NEVER); - - if(!gnc_numeric_zero_p(old_price)) { - s->amount = gnc_numeric_div(s->value, old_price, get_currency_denom(s), - GNC_RND_ROUND); - } - - mark_split (s); -} - -void -xaccSplitSetValue (Split *s, gnc_numeric amt) -{ - if(!s) return; - check_open (s->parent); - - s->value = gnc_numeric_convert(amt, get_currency_denom(s), GNC_RND_ROUND); - - mark_split (s); -} - -/********************************************************************\ -\********************************************************************/ - -gnc_numeric -xaccSplitGetBalance (Split *s) { - if (!s) return gnc_numeric_zero(); - return s->balance; -} - -gnc_numeric -xaccSplitGetClearedBalance (Split *s) { - if (!s) return gnc_numeric_zero(); - return s->cleared_balance; -} - -gnc_numeric -xaccSplitGetReconciledBalance (Split *s) { - if (!s) return gnc_numeric_zero(); - return s->reconciled_balance; -} - -/********************************************************************\ - * xaccInitTransaction - * Initialize a transaction structure -\********************************************************************/ - -static void -xaccInitTransaction (Transaction * trans) -{ - /* Fill in some sane defaults */ - trans->num = g_cache_insert(gnc_engine_get_string_cache(), ""); - trans->description = g_cache_insert(gnc_engine_get_string_cache(), ""); - - trans->common_currency = NULL; - trans->splits = NULL; - - trans->date_entered.tv_sec = 0; - trans->date_entered.tv_nsec = 0; - - trans->date_posted.tv_sec = 0; - trans->date_posted.tv_nsec = 0; - - trans->version = 0; - trans->version_check = 0; - trans->marker = 0; - trans->editlevel = 0; - trans->do_free = FALSE; - trans->orig = NULL; - - trans->kvp_data = kvp_frame_new(); - trans->idata = 0; - - xaccGUIDNew(&trans->guid); - xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS); -} - -/********************************************************************\ -\********************************************************************/ - -Transaction * -xaccMallocTransaction (void) -{ - Transaction *trans = g_new(Transaction, 1); - - xaccInitTransaction (trans); - - gnc_engine_generate_event (&trans->guid, GNC_EVENT_CREATE); - - return trans; -} - -/********************************************************************\ -\********************************************************************/ -/* This routine is not exposed externally, since it does weird things, - * like not really owning the splits correctly, and other weirdnesses. - * This routine is prone to programmer snafu if not used correctly. - * It is used only by the edit-rollback code. - */ - -static Transaction * -xaccCloneTransaction (Transaction *t) -{ - Transaction *trans; - GList *node; - - trans = g_new0 (Transaction, 1); - - trans->num = g_cache_insert (gnc_engine_get_string_cache(), t->num); - trans->description = g_cache_insert (gnc_engine_get_string_cache(), t->description); - - trans->kvp_data = kvp_frame_copy (t->kvp_data); - - trans->splits = g_list_copy (t->splits); - for (node = trans->splits; node; node = node->next) - node->data = xaccCloneSplit (node->data); - - trans->date_entered.tv_sec = t->date_entered.tv_sec; - trans->date_entered.tv_nsec = t->date_entered.tv_nsec; - - trans->date_posted.tv_sec = t->date_posted.tv_sec; - trans->date_posted.tv_nsec = t->date_posted.tv_nsec; - - trans->version = t->version; - trans->editlevel = 0; - trans->do_free = FALSE; - trans->orig = NULL; - - /* copy(!) the guid. The cloned transaction is *not* unique, - * is a sick twisted clone that holds 'undo' information. */ - trans->guid = t->guid; - - return trans; -} - - -/********************************************************************\ -\********************************************************************/ - -static void -xaccFreeTransaction (Transaction *trans) -{ - GList *node; - - if (!trans) return; - - ENTER ("addr=%p\n", trans); - - /* free up the destination splits */ - for (node = trans->splits; node; node = node->next) - xaccFreeSplit (node->data); - g_list_free (trans->splits); - trans->splits = NULL; - - /* free up transaction strings */ - g_cache_remove(gnc_engine_get_string_cache(), trans->num); - g_cache_remove(gnc_engine_get_string_cache(), trans->description); - - kvp_frame_delete (trans->kvp_data); - - /* just in case someone looks up freed memory ... */ - trans->num = NULL; - trans->description = NULL; - trans->kvp_data = NULL; - - trans->date_entered.tv_sec = 0; - trans->date_entered.tv_nsec = 0; - - trans->date_posted.tv_sec = 0; - trans->date_posted.tv_nsec = 0; - - trans->version = 0; - trans->editlevel = 0; - trans->do_free = FALSE; - - if (trans->orig) - { - xaccFreeTransaction (trans->orig); - trans->orig = NULL; - } - - g_free(trans); - - LEAVE ("addr=%p\n", trans); -} - -/******************************************************************** - xaccTransEqual - - Compare two transactions for equality. We don't pay any attention to - rollback issues here, and we only care about equality of "permanent - fields", basically the things that would survive a file save/load - cycle. - - ********************************************************************/ - -gboolean -xaccTransEqual(const Transaction *ta, const Transaction *tb, - gboolean check_guids, - gboolean check_splits) { - - if(!ta && !tb) return TRUE; - if(!ta) return FALSE; - if(!tb) return FALSE; - - if(check_guids) { - if(!guid_equal(&(ta->guid), &(tb->guid))) return FALSE; - } - - if(!gnc_commodity_equiv(ta->common_currency, tb->common_currency)) - return FALSE; - - if(timespec_cmp(&(ta->date_entered), &(tb->date_entered))) return FALSE; - if(timespec_cmp(&(ta->date_posted), &(tb->date_posted))) return FALSE; - /* Since we use cached strings, we can just compare pointer - * equality for num and description - */ - if(ta->num != tb->num) return FALSE; - if(ta->description != tb->description) return FALSE; - - if(kvp_frame_compare(ta->kvp_data, tb->kvp_data) != 0) return FALSE; - - if(check_splits) { - GList *sa = ta->splits; - GList *sb = tb->splits; - - if(!sa && sb) return FALSE; - if(!sb && sa) return FALSE; - - if(sa && sb) { - /* presume that the splits are in the same order */ - while(sa && sb) { - if(!xaccSplitEqual(sa->data, sb->data, check_guids, FALSE)) - return(FALSE); - sa = sa->next; - sb = sb->next; - } - if(sa != NULL) return(FALSE); - if(sb != NULL) return(FALSE); - } - } - - return(TRUE); -} - -/******************************************************************** - * xaccTransGetSlots - ********************************************************************/ - -kvp_frame * -xaccTransGetSlots(Transaction *t) { - if(!t) return NULL; - return(t->kvp_data); -} - -void -xaccTransSetSlots_nc(Transaction *t, kvp_frame *frm) -{ - g_return_if_fail(t); - g_return_if_fail(frm); - - if(t->kvp_data) - { - kvp_frame_delete(t->kvp_data); - } - - t->kvp_data = frm; -} - -/********************************************************************\ -\********************************************************************/ - -const GUID * -xaccTransGetGUID (Transaction *trans) -{ - if (!trans) return xaccGUIDNULL(); - return &trans->guid; -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransSetGUID (Transaction *trans, const GUID *guid) -{ - if (!trans || !guid) return; - xaccRemoveEntity(&trans->guid); - trans->guid = *guid; - xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS); -} - - -/********************************************************************\ -\********************************************************************/ - -Transaction * -xaccTransLookup (const GUID *guid) -{ - if (!guid) return NULL; - return xaccLookupEntity(guid, GNC_ID_TRANS); -} - -/********************************************************************\ -\********************************************************************/ - -void -DxaccSplitSetBaseValue (Split *s, double value, - const gnc_commodity * base_currency) -{ - xaccSplitSetBaseValue(s, - double_to_gnc_numeric(value, get_currency_denom(s), - GNC_RND_ROUND), - base_currency); -} - -void -xaccSplitSetBaseValue (Split *s, gnc_numeric value, - const gnc_commodity * base_currency) -{ - const gnc_commodity *currency; - const gnc_commodity *commodity; - - if (!s) return; - check_open (s->parent); - - /* Novice/casual users may not want or use the double entry - * features of this engine. So, in particular, there may be the - * occasional split without a parent account. Well, that's ok, - * we'll just go with the flow. */ - if (!xaccSplitGetAccount(s)) { - if (force_double_entry) { - PERR ("split must have a parent\n"); - assert (xaccSplitGetAccount(s)); - } - else { - /* this is a change in semantics. previously, calling - * setbasevalue on the same split twice would set the - * amount the first time and the value the second. - * that's bogus. -- bg */ - s->value = value; - s->amount = value; - } - mark_split (s); - return; - } - - currency = xaccTransGetCurrency (xaccSplitGetParent(s)); - commodity = xaccAccountGetCommodity (xaccSplitGetAccount(s)); - - /* if the base_currency is the account currency, set the - * value. If it's the account commodity, set the damount. - * If both, set both. */ - if (gnc_commodity_equiv(currency, base_currency)) { - if(gnc_commodity_equiv(commodity, base_currency)) { - s->amount = gnc_numeric_convert(value, - get_commodity_denom(s), - GNC_RND_NEVER); - } - s->value = gnc_numeric_convert(value, - get_currency_denom(s), - GNC_RND_NEVER); - } - else if (gnc_commodity_equiv(commodity, base_currency)) { - s->amount = gnc_numeric_convert(value, get_commodity_denom(s), - GNC_RND_NEVER); - } - else if ((NULL==base_currency) && (0 == force_double_entry)) { - s->value = gnc_numeric_convert(value, get_currency_denom(s), - GNC_RND_NEVER); - } - else { - PERR ("inappropriate base currency %s " - "given split currency=%s and commodity=%s\n", - gnc_commodity_get_printname(base_currency), - gnc_commodity_get_printname(currency), - gnc_commodity_get_printname(commodity)); - return; - } - - mark_split (s); -} - -gnc_numeric -xaccSplitGetBaseValue (Split *s, const gnc_commodity * base_currency) -{ - const gnc_commodity *currency; - const gnc_commodity *commodity; - gnc_numeric value; - - if (!s) return gnc_numeric_zero(); - - /* ahh -- users may not want or use the double entry - * features of this engine. So, in particular, there - * may be the occasional split without a parent account. - * Well, that's ok, we'll just go with the flow. - */ - if (!xaccSplitGetAccount(s)) { - if (force_double_entry) { - assert (xaccSplitGetAccount(s)); - } - else { - return s->value; - } - } - - currency = xaccTransGetCurrency (xaccSplitGetParent(s)); - commodity = xaccAccountGetCommodity (xaccSplitGetAccount(s)); - - /* be more precise -- the value depends on the currency we want it - * expressed in. */ - if (gnc_commodity_equiv(currency, base_currency)) { - value = s->value; - } - else if (gnc_commodity_equiv(commodity, base_currency)) { - value = s->amount; - } - else if ((NULL == base_currency) && (0 == force_double_entry)) { - value = s->value; - } - else { - PERR ("inappropriate base currency %s " - "given split currency=%s and commodity=%s\n", - gnc_commodity_get_printname(base_currency), - gnc_commodity_get_printname(currency), - gnc_commodity_get_printname(commodity)); - return gnc_numeric_zero(); - } - - return value; -} - -/********************************************************************\ -\********************************************************************/ - -gnc_numeric -xaccSplitsComputeValue (GList *splits, Split * skip_me, - const gnc_commodity * base_currency) -{ - GList *node; - gnc_numeric value; - - value = gnc_numeric_zero(); - - for (node = splits; node; node = node->next) - { - Split *s = node->data; - - if (s == skip_me) - continue; - - /* ahh -- users may not want or use the double entry features of - * this engine. So, in particular, there may be the occasional - * split without a parent account. Well, that's ok, we'll just - * go with the flow. */ - if (!xaccSplitGetAccount(s)) { - if (force_double_entry) { - assert (xaccSplitGetAccount(s)); - } - else { - value = gnc_numeric_add(value, s->value, - GNC_DENOM_AUTO, GNC_DENOM_LCD); - } - } - else if ((NULL == base_currency) && (0 == force_double_entry)) { - value = gnc_numeric_add(value, s->value, - GNC_DENOM_AUTO, GNC_DENOM_LCD); - } - else { - const gnc_commodity *currency; - const gnc_commodity *commodity; - - currency = xaccTransGetCurrency (xaccSplitGetParent(s)); - commodity = xaccAccountGetCommodity (xaccSplitGetAccount(s)); - - /* OK, we've got a parent account, we've got currency, lets - * behave like professionals now, instead of the shenanigans - * above. Note that just because the currencies are equivalent - * doesn't mean the denominators are the same! */ - if (base_currency && - gnc_commodity_equiv(currency, base_currency)) { - value = gnc_numeric_add(value, s->value, - GNC_DENOM_AUTO, GNC_DENOM_LCD); - } - else if (base_currency && - gnc_commodity_equiv(commodity, base_currency)) { - value = gnc_numeric_add(value, s->amount, - GNC_DENOM_AUTO, GNC_DENOM_LCD); - } - else { - PERR ("inconsistent currencies\n" - "\tbase = '%s', curr='%s', sec='%s'\n", - gnc_commodity_get_printname(base_currency), - gnc_commodity_get_printname(currency), - gnc_commodity_get_printname(commodity)); - assert (0); - } - } - } - - if (base_currency) - return gnc_numeric_convert (value, - gnc_commodity_get_fraction (base_currency), - GNC_RND_ROUND); - else - return gnc_numeric_convert (value, GNC_DENOM_AUTO, GNC_DENOM_REDUCE); -} - -gnc_numeric -xaccTransGetImbalance (Transaction * trans) -{ - const gnc_commodity * currency; - - if (!trans) - return gnc_numeric_zero (); - - currency = xaccTransGetCurrency (trans); - return xaccSplitsComputeValue (trans->splits, NULL, currency); -} - -/********************************************************************\ -\********************************************************************/ - -static gnc_commodity * -FindCommonExclSCurrency (GList *splits, - gnc_commodity * ra, gnc_commodity * rb, - Split *excl_split) -{ - GList *node; - - if (!splits) return NULL; - - for (node = splits; node; node = node->next) - { - Split *s = node->data; - gnc_commodity * sa, * sb; - - if (s == excl_split) - continue; - - /* Novice/casual users may not want or use the double entry - * features of this engine. Because of this, there - * may be the occasional split without a parent account. - * Well, that's ok, we'll just go with the flow. - */ - if (force_double_entry) - assert (xaccSplitGetAccount(s)); - else if (xaccSplitGetAccount(s) == NULL) - continue; - - sa = DxaccAccountGetCurrency (xaccSplitGetAccount(s)); - sb = DxaccAccountGetSecurity (xaccSplitGetAccount(s)); - - if (ra && rb) { - int aa = !gnc_commodity_equiv(ra,sa); - int ab = !gnc_commodity_equiv(ra,sb); - int ba = !gnc_commodity_equiv(rb,sa); - int bb = !gnc_commodity_equiv(rb,sb); - - if ( (!aa) && bb) rb = NULL; - else - if ( (!ab) && ba) rb = NULL; - else - if ( (!ba) && ab) ra = NULL; - else - if ( (!bb) && aa) ra = NULL; - else - if ( aa && bb && ab && ba ) { ra = NULL; rb = NULL; } - - if (!ra) { ra = rb; rb = NULL; } - } - else - if (ra && !rb) { - int aa = !gnc_commodity_equiv(ra,sa); - int ab = !gnc_commodity_equiv(ra,sb); - if ( aa && ab ) ra = NULL; - } - - if ((!ra) && (!rb)) return NULL; - } - - return (ra); -} - -/* This is the wrapper for those calls (i.e. the older ones) which - * don't exclude one split from the splitlist when looking for a - * common currency. - */ -static gnc_commodity * -FindCommonCurrency (GList *splits, gnc_commodity * ra, gnc_commodity * rb) -{ - return FindCommonExclSCurrency(splits, ra, rb, NULL); -} - -gnc_commodity * -xaccTransFindOldCommonCurrency (Transaction *trans) -{ - gnc_commodity *ra, *rb, *retval; - Split *split; - - if (!trans) return NULL; - - if (trans->splits == NULL) return NULL; - - split = trans->splits->data; - - if (xaccSplitGetAccount(split) == NULL) return NULL; - - ra = DxaccAccountGetCurrency (xaccSplitGetAccount(split)); - rb = DxaccAccountGetSecurity (xaccSplitGetAccount(split)); - - retval = FindCommonCurrency (trans->splits, ra, rb); - - /* compare this value to what we think should be the 'right' value */ - if (!trans->common_currency) - { - trans->common_currency = retval; - } - else if (!gnc_commodity_equiv (retval,trans->common_currency)) - { - PWARN ("expected common currency %s but found %s\n", - gnc_commodity_get_unique_name (trans->common_currency), - gnc_commodity_get_unique_name (retval)); - } - - if (NULL == retval) - { - /* in every situation I can think of, this routine should return - * common currency. So make note of this ... */ - PWARN ("unable to find a common currency, and that is strange."); - } - - return retval; -} - -/********************************************************************\ -\********************************************************************/ -/* The new routine for setting the common currency */ - -gnc_commodity * -xaccTransGetCurrency (Transaction *trans) -{ - if (!trans) return NULL; - return trans->common_currency; -} - -void -xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr) -{ - GList *splits; - gint fraction; - - if (!trans || !curr) return; - check_open (trans); - - trans->common_currency = curr; - fraction = gnc_commodity_get_fraction (curr); - - for (splits = trans->splits; splits; splits = splits->next) - { - Split *s = splits->data; - s->value = gnc_numeric_convert(s->value, fraction, GNC_RND_ROUND); - } - - mark_trans (trans); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransBeginEdit (Transaction *trans) -{ - Backend *be; - if (!trans) return; - - trans->editlevel ++; - if (1 < trans->editlevel) return; - - if (0 >= trans->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", trans->editlevel); - trans->editlevel = 1; - } - - /* See if there's a backend. If there is, invoke it. */ - be = xaccTransactionGetBackend (trans); - if (be && be->trans_begin_edit) - (be->trans_begin_edit) (be, trans); - - xaccOpenLog (); - xaccTransWriteLog (trans, 'B'); - - /* make a clone of the transaction; we will use this - * in case we need to roll-back the edit. - */ - trans->orig = xaccCloneTransaction (trans); -} - -void -xaccTransCommitEdit (Transaction *trans) -{ - Split *split; - Backend *be; - const char *str; - - if (!trans) return; - ENTER ("trans addr=%p", trans); - - trans->editlevel--; - if (0 < trans->editlevel) return; - - if (0 > trans->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", trans->editlevel); - trans->editlevel = 0; - } - - /* At this point, we check to see if we have a valid transaction. - * There are two possiblities: - * 1) Its more or less OK, and needs a little cleanup - * 2) It has zero splits, i.e. is meant to be destroyed. - * We handle 1) immediately, and we call the backend before - * we go through with 2). - */ - if (trans->splits && !(trans->do_free)) - { - split = trans->splits->data; - - /* Try to get the sorting order lined up according to - * when the user typed things in. */ - if (0 == trans->date_entered.tv_sec) { - struct timeval tv; - gettimeofday (&tv, NULL); - trans->date_entered.tv_sec = tv.tv_sec; - trans->date_entered.tv_nsec = 1000 * tv.tv_usec; - } - - /* Alternately the transaction may have only one split in - * it, in which case that's OK if and only if the split has no - * value (i.e. is only recording a price). Otherwise, a single - * split with a value can't possibly balance, thus violating the - * rules of double-entry, and that's way bogus. So create - * a matching opposite and place it either here (if force==1), - * or in some dummy account (if force==2). - */ - if ((1 == force_double_entry) && - (NULL == g_list_nth(trans->splits, 1)) && - (!gnc_numeric_zero_p(split->amount))) { - Split * s = xaccMallocSplit(); - xaccTransAppendSplit (trans, s); - xaccAccountInsertSplit (xaccSplitGetAccount(s), s); - xaccSplitSetMemo (s, split->memo); - xaccSplitSetAction (s, split->action); - xaccSplitSetAmount(s, gnc_numeric_neg(split->amount)); - xaccSplitSetValue(s, gnc_numeric_neg(split->value)); - } - } - - /* ------------------------------------------------- */ - /* OK, at this point, we are done making sure that - * we've got a validly constructed transaction. - * Next, we send it off to the back-end, to see if the - * back-end will accept it. - */ - - /* See if there's a backend. If there is, invoke it. */ - str = xaccTransGetDescription(trans); - str = str ? str : "(null)"; - PINFO ("descr is %s", str); - - be = xaccTransactionGetBackend (trans); - if (be && be->trans_commit_edit) - { - GNCBackendError errcode; - - /* clear errors */ - do { - errcode = xaccBackendGetError (be); - } while (ERR_BACKEND_NO_ERR != errcode); - - (be->trans_commit_edit) (be, trans, trans->orig); - - errcode = xaccBackendGetError (be); - if (ERR_BACKEND_NO_ERR != errcode) - { - /* if the backend puked, then we must roll-back - * at this point, and let the user know that we failed. - */ - /* XXX hack alert -- turn this into a gui dialog */ - if (ERR_BACKEND_MODIFIED == errcode) - { - PWARN("Another user has modified this transaction\n" - "\tjust a moment ago. Please look at thier changes,\n" - "\t and try again, if needed.\n" - "\t(This dialog should be a gui dialog and \n" - "\tshould check for errors)\n"); - } - - /* push error back onto the stack */ - xaccBackendSetError (be, errcode); - - trans->editlevel++; - xaccTransRollbackEdit (trans); - return; - } - } - - /* ------------------------------------------------- */ - if (!trans->splits || trans->do_free) - { - PINFO ("delete trans at addr=%p", trans); - /* Make a log in the journal before destruction. */ - xaccTransWriteLog (trans, 'D'); - xaccRemoveEntity(&trans->guid); - xaccFreeTransaction (trans); - return; - } - - /* ------------------------------------------------- */ - /* Make sure all associated splits are in proper order - * in their accounts with the correct balances. */ - xaccTransFixSplitDateOrder (trans); - - trans->do_free = FALSE; - xaccTransWriteLog (trans, 'C'); - - /* Get rid of the copy we made. We won't be rolling back, - * so we don't need it any more. */ - xaccFreeTransaction (trans->orig); - trans->orig = NULL; - - LEAVE ("trans addr=%p\n", trans); -} - -void -xaccTransRollbackEdit (Transaction *trans) -{ - Backend *be; - Transaction *orig; - int force_it=0, mismatch=0; - int i; - ENTER ("trans addr=%p\n", trans); - - if (!trans) return; - trans->editlevel--; - if (0 < trans->editlevel) return; - - if (0 > trans->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", trans->editlevel); - trans->editlevel = 0; - } - - /* copy the original values back in. */ - orig = trans->orig; - - /* If the transaction had been deleted before the rollback, - * the guid would have been unlisted. Restore that */ - xaccStoreEntity(trans, &trans->guid, GNC_ID_TRANS); - - g_cache_remove (gnc_engine_get_string_cache(), trans->num); - trans->num = orig->num; - orig->num = g_cache_insert(gnc_engine_get_string_cache(), ""); - - g_cache_remove (gnc_engine_get_string_cache(), trans->description); - trans->description = orig->description; - orig->description = g_cache_insert(gnc_engine_get_string_cache(), ""); - - kvp_frame_delete (trans->kvp_data); - trans->kvp_data = orig->kvp_data; - if (!trans->kvp_data) - trans->kvp_data = kvp_frame_new (); - orig->kvp_data = kvp_frame_new (); - - trans->date_entered.tv_sec = orig->date_entered.tv_sec; - trans->date_entered.tv_nsec = orig->date_entered.tv_nsec; - - trans->date_posted.tv_sec = orig->date_posted.tv_sec; - trans->date_posted.tv_nsec = orig->date_posted.tv_nsec; - - /* OK, we also have to restore the state of the splits. Of course, - * we could brute-force our way through this, and just clobber all of the - * old splits, and insert all of the new splits, but this kind of brute - * forcing will suck memory cycles. So instead we'll try the gentle - * approach first. Note that even in the gentle approach, the - * CheckDateOrder routine could be cpu-cyle brutal, so it maybe - * it could use some tuning. - */ - if (trans->do_free) - { - force_it = 1; - mismatch = 0; - } - else - { - GList *node; - GList *node_orig; - Split *s, *so; - - s = so = NULL; - - for (i = 0, node = trans->splits, node_orig = orig->splits ; - node && node_orig ; - i++, node = node->next, node_orig = node_orig->next) - { - s = node->data; - so = node_orig->data; - - if (xaccSplitGetAccount(so) != xaccSplitGetAccount(s)) - { - force_it = 1; - mismatch = i; - break; - } - - g_cache_remove (gnc_engine_get_string_cache(), s->action); - s->action = so->action; - so->action = g_cache_insert(gnc_engine_get_string_cache(), ""); - - g_cache_remove (gnc_engine_get_string_cache(), s->memo); - s->memo = so->memo; - so->memo = g_cache_insert(gnc_engine_get_string_cache(), ""); - - kvp_frame_delete (s->kvp_data); - s->kvp_data = so->kvp_data; - if (!s->kvp_data) - s->kvp_data = kvp_frame_new (); - so->kvp_data = kvp_frame_new (); - - s->reconciled = so->reconciled; - s->amount = so->amount; - s->value = so->value; - - s->date_reconciled.tv_sec = so->date_reconciled.tv_sec; - s->date_reconciled.tv_nsec = so->date_reconciled.tv_nsec; - - /* do NOT check date order until all of the other fields - * have been properly restored */ - xaccAccountFixSplitDateOrder (xaccSplitGetAccount(s), s); - xaccAccountRecomputeBalance (xaccSplitGetAccount(s)); - mark_split (s); - } - - if (so != s) - { - force_it = 1; - mismatch = i; - } - } - - /* OK, if force_it got set, we'll have to tough it out and brute-force - * the rest of the way. Clobber all the edited splits, add all new splits. - * Unfortunately, this can suck up CPU cycles in the Remove/Insert routines. - */ - if (force_it) - { - GList *node; - - for (i = 0, node = trans->splits ; - node && i < mismatch ; - i++, node = node->next) - { - Split *s = node->data; - GList *node_orig; - - node_orig = g_list_nth (orig->splits, i); - xaccFreeSplit (node_orig->data); - node_orig->data = s; - } - - for (node = g_list_nth (trans->splits, mismatch) ; - node ; node = node->next) - { - Split *s = node->data; - - mark_split (s); - xaccAccountRemoveSplit (xaccSplitGetAccount(s), s); - xaccAccountRecomputeBalance (xaccSplitGetAccount(s)); - xaccRemoveEntity(&s->guid); - xaccFreeSplit (s); - } - - g_list_free (trans->splits); - - trans->splits = orig->splits; - orig->splits = NULL; - - for (node = g_list_nth (trans->splits, mismatch) ; - node ; node = node->next) - { - Split *s = node->data; - Account *account = xaccSplitGetAccount(s); - - xaccSplitSetAccount(s, NULL); - xaccStoreEntity(s, &s->guid, GNC_ID_SPLIT); - xaccAccountInsertSplit (account, s); - xaccAccountRecomputeBalance (account); - mark_split (s); - } - } - - be = xaccTransactionGetBackend (trans); - if (be && be->trans_rollback_edit) - { - GNCBackendError errcode; - - /* clear errors */ - do { - errcode = xaccBackendGetError (be); - } while (ERR_BACKEND_NO_ERR != errcode); - - (be->trans_rollback_edit) (be, trans); - - errcode = xaccBackendGetError (be); - if (ERR_BACKEND_MOD_DESTROY == errcode) - { - /* The backend is asking us to delete this transaction. - * This typically happens because another (remote) user - * has deleted this transaction, and we haven't found - * out about it until this user tried to edit it. - */ - trans->editlevel++; - xaccTransDestroy (trans); - xaccFreeTransaction (trans); - - /* push error back onto the stack */ - xaccBackendSetError (be, errcode); - LEAVE ("deleted trans addr=%p\n", trans); - return; - } - if (ERR_BACKEND_NO_ERR != errcode) - { - PERR ("Rollback Failed. Ouch!"); - /* push error back onto the stack */ - xaccBackendSetError (be, errcode); - } - } - - xaccTransWriteLog (trans, 'R'); - - xaccFreeTransaction (trans->orig); - - trans->orig = NULL; - trans->do_free = FALSE; - - LEAVE ("trans addr=%p\n", trans); -} - -gboolean -xaccTransIsOpen (Transaction *trans) -{ - if (!trans) return FALSE; - return (0 < trans->editlevel); -} - -void -xaccTransSetVersion (Transaction *trans, gint32 vers) -{ - if (!trans) return; - trans->version = vers; -} - -gint32 -xaccTransGetVersion (Transaction *trans) -{ - if (!trans) return 0; - return (trans->version); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransDestroy (Transaction *trans) -{ - GList *node; - - if (!trans) return; - check_open (trans); - trans->do_free = TRUE; - xaccTransWriteLog (trans, 'D'); - - gnc_engine_generate_event (&trans->guid, GNC_EVENT_DESTROY); - - for (node = trans->splits; node; node = node->next) - { - Split *split = node->data; - - mark_split (split); - - xaccAccountRemoveSplit (xaccSplitGetAccount(split), split); - xaccAccountRecomputeBalance (xaccSplitGetAccount(split)); - xaccRemoveEntity(&split->guid); - xaccFreeSplit (split); - - node->data = NULL; - } - - g_list_free (trans->splits); - trans->splits = NULL; - - xaccRemoveEntity(&trans->guid); - - /* the actual free is done with the commit call, else its rolled back */ - /* xaccFreeTransaction (trans); don't do this here ... */ -} - -/********************************************************************\ - * TransRemoveSplit is an engine private function and does not/should - * not cause any rebalancing to occur. -\********************************************************************/ - -static void -xaccTransRemoveSplit (Transaction *trans, Split *split) -{ - if (trans == NULL) - return; - - trans->splits = g_list_remove (trans->splits, split); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccSplitDestroy (Split *split) -{ - Transaction *trans; - - if (!split) return; - - trans = split->parent; - check_open (trans); - - mark_split (split); - xaccRemoveEntity (&split->guid); - - if (trans) - { - gboolean ismember = (g_list_find (trans->splits, split) != NULL); - assert (ismember); - xaccTransRemoveSplit (trans, split); - } - - xaccAccountRemoveSplit (xaccSplitGetAccount(split), split); - xaccAccountRecomputeBalance (xaccSplitGetAccount(split)); - - xaccFreeSplit (split); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransAppendSplit (Transaction *trans, Split *split) -{ - Transaction *oldtrans; - - if (!trans || !split) return; - check_open (trans); - - /* first, make sure that the split isn't already inserted - * elsewhere. If so, then remove it. */ - oldtrans = split->parent; - if (oldtrans) - xaccTransRemoveSplit (oldtrans, split); - - /* now, insert the split into the array */ - split->parent = trans; - trans->splits = g_list_append (trans->splits, split); - - /* convert the split to the new transaction's commodity denominator */ - /* if the denominator can't be exactly converted, it's an error */ - if (trans->common_currency) - { - int fraction = gnc_commodity_get_fraction (trans->common_currency); - gnc_numeric new_value; - - new_value = gnc_numeric_convert(split->value, fraction, GNC_RND_ROUND); - if (gnc_numeric_check (new_value) == GNC_ERROR_OK) - split->value = new_value; - } -} - -/********************************************************************\ - * sorting comparison function - * - * returns a negative value if transaction a is dated earlier than b, - * returns a positive value if transaction a is dated later than b, - * - * This function tries very hard to uniquely order all transactions. - * If two transactions occur on the same date, then their "num" fields - * are compared. If the num fields are identical, then the description - * fields are compared. If these are identical, then the memo fields - * are compared. Hopefully, there will not be any transactions that - * occur on the same day that have all three of these values identical. - * - * Note that being able to establish this kind of absolute order is - * important for some of the ledger display functions. - * - * Yes, this kind of code dependency is ugly, but the alternatives seem - * ugly too. - * -\********************************************************************/ - - -#define DATE_CMP(aaa,bbb,field) { \ - /* if dates differ, return */ \ - if ( (aaa->field.tv_sec) < \ - (bbb->field.tv_sec)) { \ - return -1; \ - } else \ - if ( (aaa->field.tv_sec) > \ - (bbb->field.tv_sec)) { \ - return +1; \ - } \ - \ - /* else, seconds match. check nanoseconds */ \ - if ( (aaa->field.tv_nsec) < \ - (bbb->field.tv_nsec)) { \ - return -1; \ - } else \ - if ( (aaa->field.tv_nsec) > \ - (bbb->field.tv_nsec)) { \ - return +1; \ - } \ -} - - - -int -xaccSplitDateOrder (Split *sa, Split *sb) -{ - int retval; - int comp; - char *da, *db; - - if(sa == sb) return 0; - /* nothing is always less than something */ - if(!sa && sb) return -1; - if(sa && !sb) return +1; - - retval = xaccTransOrder (sa->parent, sb->parent); - if (0 != retval) return retval; - - /* otherwise, sort on memo strings */ - da = sa->memo; - db = sb->memo; - SAFE_STRCMP (da, db); - - /* otherwise, sort on action strings */ - da = sa->action; - db = sb->action; - SAFE_STRCMP (da, db); - - /* the reconciled flag ... */ - if ((sa->reconciled) < (sb->reconciled)) return -1; - if ((sa->reconciled) > (sb->reconciled)) return +1; - - /* compare amounts */ - comp = gnc_numeric_compare(sa->amount, sb->amount); - if(comp < 0) return -1; - if(comp > 0) return +1; - - comp = gnc_numeric_compare(sa->value, sb->value); - if(comp < 0) return -1; - if(comp > 0) return +1; - - /* if dates differ, return */ - DATE_CMP(sa,sb,date_reconciled); - -#if 0 - /* sort on txn guid. */ - if(sa->parent && !sb->parent) return -1; - if(!sa->parent && sb->parent) return 1; - if(sa->parent && sb->parent) { - retval = guid_compare(&(sa->guid), &(sb->guid)); - if(retval != 0) return retval; - } -#endif - - /* else, sort on guid - keeps sort stable. */ - retval = guid_compare(&(sa->guid), &(sb->guid)); - if(retval != 0) return retval; - - return 0; -} - -int -xaccTransOrder (Transaction *ta, Transaction *tb) -{ - char *da, *db; - int retval; - - if ( ta && !tb ) return -1; - if ( !ta && tb ) return +1; - if ( !ta && !tb ) return 0; - - /* if dates differ, return */ - DATE_CMP(ta,tb,date_posted); - - /* otherwise, sort on number string */ - da = ta->num; - db = tb->num; - SAFE_STRCMP (da, db); - - /* if dates differ, return */ - DATE_CMP(ta,tb,date_entered); - - /* otherwise, sort on description string */ - da = ta->description; - db = tb->description; - SAFE_STRCMP (da, db); - - /* else, sort on guid - keeps sort stable. */ - retval = guid_compare(&(ta->guid), &(tb->guid)); - if(retval != 0) return retval; - - return 0; -} -static gboolean -get_corr_account_split(Split *sa, Split **retval) -{ - - Split *current_split; - GList *split_list; - Transaction * ta; - gnc_numeric sa_value, current_value; - gboolean sa_value_positive, current_value_positive, seen_different = FALSE; - - *retval = NULL; - g_return_val_if_fail(sa, TRUE); - ta = xaccSplitGetParent(sa); - - sa_value = xaccSplitGetValue(sa); - sa_value_positive = gnc_numeric_positive_p(sa_value); - - for(split_list = xaccTransGetSplitList(ta);split_list; split_list = split_list->next) - { - current_split = split_list->data; - if(current_split != sa) - { - current_value = xaccSplitGetValue(current_split); - current_value_positive = gnc_numeric_positive_p(current_value); - if((sa_value_positive && !current_value_positive) || - (!sa_value_positive && current_value_positive)) - { - if(seen_different) - { - *retval = NULL; - return TRUE; - } - else - { - seen_different = TRUE; - *retval = current_split; - } - } - } - } - return FALSE; -} - -const char * -xaccSplitGetCorrAccountName(Split *sa) -{ - static const char *split_const = NULL; - Split *other_split; - Account *other_split_acc; - - if(get_corr_account_split(sa, &other_split)) - { - if (!split_const) - split_const = _("-- Split Transaction --"); - - return split_const; - } - else - { - other_split_acc = xaccSplitGetAccount(other_split); - return xaccAccountGetName(other_split_acc); - } -} - -char * -xaccSplitGetCorrAccountFullName(Split *sa, char separator) -{ - static const char *split_const = NULL; - Split *other_split; - Account *other_split_acc; - - if(get_corr_account_split(sa, &other_split)) - { - if (!split_const) - split_const = _("-- Split Transaction --"); - - return g_strdup(split_const); - } - else - { - other_split_acc = xaccSplitGetAccount(other_split); - return xaccAccountGetFullName(other_split_acc, separator); - } -} - -const char * -xaccSplitGetCorrAccountCode(Split *sa) -{ - static const char *split_const = NULL; - Split *other_split; - Account *other_split_acc; - - if(get_corr_account_split(sa, &other_split)) - { - if (!split_const) - split_const = _("Split"); - - return split_const; - } - else - { - other_split_acc = xaccSplitGetAccount(other_split); - return xaccAccountGetName(other_split_acc); - } -} - -int -xaccSplitCompareAccountFullNames(Split *sa, Split *sb) -{ - Account *aa, *ab; - char *full_a, *full_b; - int retval; - if (!sa && !sb) return 0; - if (!sa) return -1; - if (!sb) return 1; - - aa = xaccSplitGetAccount(sa); - ab = xaccSplitGetAccount(sb); - full_a = xaccAccountGetFullName(aa, ':'); - full_b = xaccAccountGetFullName(ab, ':'); - /* for comparison purposes it doesn't matter what we use as a separator */ - retval = safe_strcmp(full_a, full_b); - g_free(full_a); - g_free(full_b); - return retval; - -} - - -int -xaccSplitCompareAccountCodes(Split *sa, Split *sb) -{ - Account *aa, *ab; - if (!sa && !sb) return 0; - if (!sa) return -1; - if (!sb) return 1; - - aa = xaccSplitGetAccount(sa); - ab = xaccSplitGetAccount(sb); - - return safe_strcmp(xaccAccountGetName(aa), xaccAccountGetName(ab)); -} - -int -xaccSplitCompareOtherAccountFullNames(Split *sa, Split *sb) -{ - char *ca, *cb; - int retval; - if (!sa && !sb) return 0; - if (!sa) return -1; - if (!sb) return 1; - - /* doesn't matter what separator we use - * as long as they are the same - */ - - ca = xaccSplitGetCorrAccountFullName(sa, ':'); - cb = xaccSplitGetCorrAccountFullName(sb, ':'); - retval = safe_strcmp(ca, cb); - g_free(ca); - g_free(cb); - return retval; -} - -int -xaccSplitCompareOtherAccountCodes(Split *sa, Split *sb) -{ - const char *ca, *cb; - if (!sa && !sb) return 0; - if (!sa) return -1; - if (!sb) return 1; - - ca = xaccSplitGetCorrAccountCode(sa); - cb = xaccSplitGetCorrAccountCode(sb); - return safe_strcmp(ca, cb); -} -/********************************************************************\ -\********************************************************************/ - -enum { TDATE_POSTED, TDATE_ENTERED }; - -static void -xaccTransSetDateInternal(Transaction *trans, int which, time_t secs, - long int nsecs) -{ - Timespec *dadate = 0; - if(!trans) return; - check_open(trans); - - PINFO ("addr=%p set %d date to %lu %li %s \n", - trans, which, secs, nsecs, ctime (&secs)); - - dadate = ((which == TDATE_POSTED) - ? &trans->date_posted - : &trans->date_entered); - dadate->tv_sec = secs; - dadate->tv_nsec = nsecs; - - mark_trans(trans); - /* Because the date has changed, we need to make sure that each of - * the splits is properly ordered in each of their accounts. We - * could do that here, simply by reinserting each split into its - * account. However, in some ways this is bad behaviour, and it - * seems much better/nicer to defer that until the commit phase, - * i.e. until the user has called the xaccTransCommitEdit() - * routine. So, for now, we are done. */ -} - -void -xaccTransSetDateSecs (Transaction *trans, time_t secs) -{ - xaccTransSetDateInternal(trans, TDATE_POSTED, secs, 0); -} - -void -xaccTransSetDateEnteredSecs (Transaction *trans, time_t secs) -{ - xaccTransSetDateInternal(trans, TDATE_ENTERED, secs, 0); -} - -void -xaccTransSetDatePostedTS (Transaction *trans, const Timespec *ts) -{ - if (!ts) return; - xaccTransSetDateInternal(trans, TDATE_POSTED, ts->tv_sec, ts->tv_nsec); -} - -void -xaccTransSetDateEnteredTS (Transaction *trans, const Timespec *ts) -{ - if (!ts) return; - xaccTransSetDateInternal(trans, TDATE_ENTERED, ts->tv_sec, ts->tv_nsec); -} - -void -xaccTransSetDate (Transaction *trans, int day, int mon, int year) -{ - Timespec ts = gnc_dmy2timespec(day, mon, year); - xaccTransSetDateInternal(trans, TDATE_POSTED, ts.tv_sec, ts.tv_nsec); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccTransSetNum (Transaction *trans, const char *xnum) -{ - char * tmp; - if (!trans || !xnum) return; - check_open (trans); - - tmp = g_cache_insert(gnc_engine_get_string_cache(), (gpointer) xnum); - g_cache_remove(gnc_engine_get_string_cache(), trans->num); - trans->num = tmp; - mark_trans (trans); -} - -void -xaccTransSetDescription (Transaction *trans, const char *desc) -{ - char * tmp; - if (!trans || !desc) return; - check_open (trans); - - tmp = g_cache_insert(gnc_engine_get_string_cache(), (gpointer) desc); - g_cache_remove(gnc_engine_get_string_cache(), trans->description); - trans->description = tmp; - mark_trans (trans); -} - -void -xaccTransSetNotes (Transaction *trans, const char *notes) -{ - if (!trans || !notes) return; - check_open (trans); - - kvp_frame_set_slot_nc (trans->kvp_data, "notes", - kvp_value_new_string (notes)); - mark_trans (trans); -} - -/********************************************************************\ -\********************************************************************/ - -Split * -xaccTransGetSplit (Transaction *trans, int i) -{ - if (!trans) return NULL; - if (i < 0) return NULL; - - return g_list_nth_data (trans->splits, i); -} - -GList * -xaccTransGetSplitList (Transaction *trans) -{ - if (!trans) return NULL; - - return trans->splits; -} - -const char * -xaccTransGetNum (Transaction *trans) -{ - if (!trans) return NULL; - return (trans->num); -} - -const char * -xaccTransGetDescription (Transaction *trans) -{ - if (!trans) return NULL; - return (trans->description); -} - -const char * -xaccTransGetNotes (Transaction *trans) -{ - kvp_value *v; - - if (!trans) return NULL; - - v = kvp_frame_get_slot (xaccTransGetSlots (trans), "notes"); - if (!v) - return NULL; - - return kvp_value_get_string (v); -} - -time_t -xaccTransGetDate (Transaction *trans) -{ - if (!trans) return 0; - return (trans->date_posted.tv_sec); -} - -void -xaccTransGetDatePostedTS (Transaction *trans, Timespec *ts) -{ - if (!trans || !ts) return; - *ts = (trans->date_posted); -} - -void -xaccTransGetDateEnteredTS (Transaction *trans, Timespec *ts) -{ - if (!trans || !ts) return; - *ts = (trans->date_entered); -} - -Timespec -xaccTransRetDatePostedTS (Transaction *trans) -{ - Timespec ts; - ts.tv_sec = 0; ts.tv_nsec = 0; - if (!trans) return ts; - return (trans->date_posted); -} - -Timespec -xaccTransRetDateEnteredTS (Transaction *trans) -{ - Timespec ts; - ts.tv_sec = 0; ts.tv_nsec = 0; - if (!trans) return ts; - return (trans->date_entered); -} - -int -xaccTransCountSplits (Transaction *trans) -{ - if (!trans) return 0; - return g_list_length (trans->splits); -} - -/********************************************************************\ -\********************************************************************/ - -void -xaccSplitSetMemo (Split *split, const char *memo) -{ - char * tmp; - if (!split || !memo) return; - check_open (split->parent); - - tmp = g_cache_insert(gnc_engine_get_string_cache(), (gpointer) memo); - g_cache_remove(gnc_engine_get_string_cache(), split->memo); - split->memo = tmp; - mark_split (split); -} - -void -xaccSplitSetAction (Split *split, const char *actn) -{ - char * tmp; - if (!split || !actn) return; - check_open (split->parent); - - tmp = g_cache_insert(gnc_engine_get_string_cache(), (gpointer) actn); - g_cache_remove(gnc_engine_get_string_cache(), split->action); - split->action = tmp; - mark_split (split); -} - -void -xaccSplitSetReconcile (Split *split, char recn) -{ - if (!split) return; - check_open (split->parent); - - switch (recn) - { - case NREC: - case CREC: - case YREC: - case FREC: - break; - default: - PERR("Bad reconciled flag"); - return; - } - - split->reconciled = recn; - - xaccAccountRecomputeBalance (xaccSplitGetAccount(split)); - mark_split (split); -} - -void -xaccSplitSetDateReconciledSecs (Split *split, time_t secs) -{ - if (!split) return; - check_open (split->parent); - - split->date_reconciled.tv_sec = secs; - split->date_reconciled.tv_nsec = 0; - mark_split (split); -} - -void -xaccSplitSetDateReconciledTS (Split *split, Timespec *ts) -{ - if (!split || !ts) return; - check_open (split->parent); - - split->date_reconciled = *ts; - mark_split (split); -} - -void -xaccSplitGetDateReconciledTS (Split * split, Timespec *ts) -{ - if (!split || !ts) return; - *ts = (split->date_reconciled); -} - -Timespec -xaccSplitRetDateReconciledTS (Split * split) -{ - Timespec ts; ts.tv_sec=0; ts.tv_nsec=0; - if (!split) return ts; - return (split->date_reconciled); -} - -/********************************************************************\ -\********************************************************************/ - -/* return the parent transaction of the split */ -Transaction * -xaccSplitGetParent (Split *split) -{ - if (!split) return NULL; - return (split->parent); -} - -const char * -xaccSplitGetMemo (Split *split) -{ - if (!split) return NULL; - return (split->memo); -} - -const char * -xaccSplitGetAction (Split *split) -{ - if (!split) return NULL; - return (split->action); -} - -char -xaccSplitGetReconcile (Split *split) { - if (!split) return ' '; - return (split->reconciled); -} - -double -DxaccSplitGetShareAmount (Split * split) { - return gnc_numeric_to_double(xaccSplitGetAmount(split)); -} - -double -DxaccSplitGetValue (Split * split) { - return gnc_numeric_to_double(xaccSplitGetValue(split)); -} - -double -DxaccSplitGetSharePrice (Split * split) -{ - return gnc_numeric_to_double(xaccSplitGetSharePrice(split)); -} - -gnc_numeric -xaccSplitGetAmount (Split * split) -{ - if (!split) return gnc_numeric_zero(); - return split->amount; -} - -gnc_numeric -xaccSplitGetValue (Split * split) { - if (!split) return gnc_numeric_zero(); - return split->value; -} - -gnc_numeric -xaccSplitGetSharePrice (Split * split) { - if(!split || gnc_numeric_zero_p(split->amount)) { - return gnc_numeric_create(1, 1); - } - return gnc_numeric_div(split->value, - split->amount, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(PRICE_SIGFIGS) | - GNC_RND_ROUND); -} - -/********************************************************************\ -\********************************************************************/ - -const char * -xaccSplitGetType(const Split *s) -{ - kvp_frame *frame; - kvp_value *split_type; - - if(!s) return NULL; - frame = xaccSplitGetSlots((Split *) s); - if(!frame) return NULL; - split_type = kvp_frame_get_slot(frame, "split-type"); - if(!split_type) return "normal"; - if(kvp_value_get_type(split_type) != KVP_TYPE_STRING) return NULL; - return(kvp_value_get_string(split_type)); -} - -/* reconfigure a split to be a stock split - after this, you shouldn't - mess with the value, just the amount. */ -void -xaccSplitMakeStockSplit(Split *s) -{ - check_open (s->parent); - - xaccSplitSetValue(s, gnc_numeric_zero()); - kvp_frame_set_slot_nc(s->kvp_data, - "split-type", - kvp_value_new_string("stock-split")); - mark_split(s); -} - - -/********************************************************************\ -\********************************************************************/ - -Account * -xaccGetAccountByName (Transaction *trans, const char * name) -{ - Account *acc = NULL; - GList *node; - - if (!trans) return NULL; - if (!name) return NULL; - - /* walk through the splits, looking for one, any one, that has a - * parent account */ - for (node = trans->splits; node; node = node->next) - { - Split *s = node->data; - - acc = xaccSplitGetAccount(s); - if (acc) break; - } - - if (!acc) return NULL; - - return xaccGetPeerAccountFromName (acc, name); -} - -/********************************************************************\ -\********************************************************************/ - -Account * -xaccGetAccountByFullName (Transaction *trans, const char * name, - const char separator) -{ - Account *acc = NULL; - GList *node; - - if (!trans) return NULL; - if (!name) return NULL; - - /* walk through the splits, looking for one, any one, that has a - * parent account */ - for (node = trans->splits; node; node = node->next) - { - Split *s = node->data; - - acc = xaccSplitGetAccount(s); - if (acc) break; - } - - if (!acc) return NULL; - - return xaccGetPeerAccountFromFullName (acc, name, separator); -} - -/********************************************************************\ -\********************************************************************/ - -Split * -xaccSplitGetOtherSplit (Split *split) -{ - Split *s1, *s2; - Transaction *trans; - - if (!split) return NULL; - trans = split->parent; - - if (g_list_length (trans->splits) != 2) - return NULL; - - s1 = g_list_nth_data (trans->splits, 0); - s2 = g_list_nth_data (trans->splits, 1); - - if (s1 == split) - return s2; - - return s1; -} - -/********************************************************************\ -\********************************************************************/ - -int -xaccIsPeerSplit (Split *sa, Split *sb) -{ - Transaction *ta, *tb; - if (!sa || !sb) return 0; - ta = sa->parent; - tb = sb->parent; - if (ta == tb) return 1; - return 0; -} - -/************************ END OF ************************************\ -\************************* FILE *************************************/ diff --git a/src/engine/Transaction.h b/src/engine/Transaction.h deleted file mode 100644 index af49772de8..0000000000 --- a/src/engine/Transaction.h +++ /dev/null @@ -1,476 +0,0 @@ -/********************************************************************\ - * Transaction.h -- api for transactions & splits (journal entries) * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef XACC_TRANSACTION_H -#define XACC_TRANSACTION_H - -#include "config.h" - -#include - -#include "gnc-common.h" -#include "gnc-commodity.h" -#include "gnc-numeric.h" -#include "kvp_frame.h" -#include "GNCId.h" -#include "date.h" - - -/* Values for the reconciled field in Splits */ -#define CREC 'c' /* The Split has been cleared */ -#define YREC 'y' /* The Split has been reconciled */ -#define FREC 'f' /* frozen into accounting period */ -#define NREC 'n' /* not reconciled or cleared */ - -/** STRUCTS *********************************************************/ - -typedef struct _account Account; -typedef struct _account_group AccountGroup; -typedef struct _split Split; -typedef struct _transaction Transaction; - - -/** PROTOTYPES ******************************************************/ - -/* - * The xaccConfigSetForceDoubleEntry() and xaccConfigGetForceDoubleEntry() - * set and get the "force_double_entry" flag. This flag determines how - * the splits in a transaction will be balanced. - * - * The following values have significance: - * 0 -- anything goes - * 1 -- The sum of all splits in a transaction will be - * forced to be zero, even if this requires the - * creation of additional splits. Note that a split - * whose value is zero (e.g. a stock price) can exist - * by itself. Otherwise, all splits must come in at - * least pairs. - * 2 -- splits without parents will be forced into a - * lost & found account. (Not implemented) - */ - -void xaccConfigSetForceDoubleEntry (int force); -int xaccConfigGetForceDoubleEntry (void); - -/* - * The xaccMallocTransaction() will malloc memory and initialize it. - * Once created, it is usually unsafe to merely "free" this memory; - * the xaccTransDestroy() method should be called. - */ -Transaction * xaccMallocTransaction (void); - -gboolean xaccTransEqual(const Transaction *ta, const Transaction *tb, - gboolean check_guids, - gboolean check_splits); - - -/* The xaccTransDestroy() method will remove all - * of the splits from each of their accounts, free the memory - * associated with them. This routine must be followed by either - * an xaccTransCommitEdit(), in which case the transaction - * memory will be freed, or by xaccTransRollbackEdit(), in which - * case nothing at all is freed, and everything is put back into - * original order. - */ -void xaccTransDestroy (Transaction *trans); - -/* The xaccTransBeginEdit() method must be called before any changes - * are made to a transaction or any of its component splits. If - * this is not done, errors will result. - * - * The xaccTransCommitEdit() method indicates that the changes to the - * transaction and its splits are complete and should be made - * permanent. Note this routine may result in the deletion of the - * transaction, if the transaction is "empty" (has no splits), or - * of xaccTransDestroy() was called on the transaction. - * - * The xaccTransRollbackEdit() routine rejects all edits made, and - * sets the transaction back to where it was before the editing - * started. This includes restoring any deleted splits, removing - * any added splits, and undoing the effects of xaccTransDestroy, - * as well as restoring share quantities, memos, descriptions, etc. - * - * The xaccTransIsOpen() method returns TRUE if the transaction - * is open for editing. Otherwise, it returns false. */ -void xaccTransBeginEdit (Transaction *trans); -void xaccTransCommitEdit (Transaction *trans); -void xaccTransRollbackEdit (Transaction *trans); - -gboolean xaccTransIsOpen (Transaction *trans); - -/* - * The xaccTransGetGUID() subroutine will return the - * globally unique id associated with that transaction. - * - * The xaccTransLookup() subroutine will return the - * transaction associated with the given id, or NULL - * if there is no such transaction. - */ -const GUID * xaccTransGetGUID (Transaction *trans); -Transaction * xaccTransLookup (const GUID *guid); - - -/* Transaction slots are used to store arbitrary strings, numbers, and - * structures which aren't members of the transaction struct. */ - -kvp_frame *xaccTransGetSlots(Transaction *trans); -void xaccTransSetSlots_nc(Transaction *t, kvp_frame *frm); - -/* The xaccTransSetDateSecs() method will modify the posted date - * of the transaction. (Footnote: this shouldn't matter to a user, - * but anyone modifying the engine should understand that when - * xaccTransCommitEdit() is called, the date order of each of the - * component splits will be checked, and will be restored in - * ascending date order.) - * - * The xaccTransSetDate() method does the same thing as - * xaccTransSetDateSecs(), but takes a convenient day-month-year format. - * - * The xaccTransSetDatePostedTS() method does the same thing as - * xaccTransSetDateSecs(), but takes a struct timespec64. - * - */ -void xaccTransSetDate (Transaction *trans, - int day, int mon, int year); -void xaccTransSetDateSecs (Transaction *trans, time_t time); -void xaccTransSetDatePostedTS (Transaction *trans, - const Timespec *ts); - -void xaccTransSetDateEnteredSecs (Transaction *trans, time_t time); -void xaccTransSetDateEnteredTS (Transaction *trans, - const Timespec *ts); - -/* set the Num, Description, and Notes fields */ -void xaccTransSetNum (Transaction *trans, const char *num); -void xaccTransSetDescription (Transaction *trans, const char *desc); -void xaccTransSetNotes (Transaction *trans, const char *notes); - -/* The xaccTransAppendSplit() method will append the indicated - * split to the collection of splits in this transaction. - * If the split is already a part of another transaction, - * it will be removed from that transaction first. - */ -void xaccTransAppendSplit (Transaction *trans, Split *split); - -/* The xaccSplitDestroy() method will update its parent account and - * transaction in a consistent manner, resulting in the complete - * unlinking of the split, and the freeing of its associated memory. - * The goal of this routine is to perform the removal and destruction - * of the split in an atomic fashion, with no chance of accidentally - * leaving the accounting structure out-of-balance or otherwise - * inconsistent. - * - * If the deletion of the split leaves the transaction with no - * splits, then the transaction will be marked for deletion. (It - * will not be deleted until the xaccTransCommitEdit() routine is - * called.) - */ -void xaccSplitDestroy (Split *split); - -/* ------------- gets --------------- */ -/* The xaccTransGetSplit() method returns a pointer to each of the - * splits in this transaction. Valid values for i are zero to - * (number_of__splits-1). An invalid value of i will cause NULL to - * be returned. A convenient way of cycling through all splits is - * to start at zero, and keep incrementing until a null value is returned. - */ -Split * xaccTransGetSplit (Transaction *trans, int i); - -/* The xaccTransGetSplitList() method returns a GList of the splits - * in a transaction. This list must not be modified. Do *NOT* free - * this list when you are done with it. */ -GList * xaccTransGetSplitList (Transaction *trans); - -/* These routines return the Num (or ID field), the description, - * the notes, and the date field. - */ -const char * xaccTransGetNum (Transaction *trans); -const char * xaccTransGetDescription (Transaction *trans); -const char * xaccTransGetNotes (Transaction *trans); -time_t xaccTransGetDate (Transaction *trans); - -void xaccTransGetDatePostedTS (Transaction *trans, Timespec *ts); - -void xaccTransGetDateEnteredTS (Transaction *trans, Timespec *ts); - -Timespec xaccTransRetDateEnteredTS (Transaction *trans); -Timespec xaccTransRetDatePostedTS (Transaction *trans); - -/* The xaccTransCountSplits() method returns the number of splits - * in a transaction. - */ -int xaccTransCountSplits (Transaction *trans); - -/* --------------------------------------------------------------- */ -/* Commmodity routines. Each transaction's 'currency' is by definition - * the balancing common currency for the splits in that transaction. - * */ -gnc_commodity * xaccTransGetCurrency (Transaction *trans); -void xaccTransSetCurrency (Transaction *trans, gnc_commodity *curr); - -/* The xaccTransGetImbalance() method returns the total value of the - * transaction. In a pure double-entry system, this imbalance - * should be exactly zero, and if it is not, something is broken. - * However, when double-entry semantics are not enforced, unbalanced - * transactions can sneak in, and this routine can be used to find - * out how much things are off by. The value returned is denominated - * in the currency that is returned by the xaccTransFindCommonCurrency() - * method. - */ -gnc_numeric xaccTransGetImbalance (Transaction * trans); - -/* ------------- splits --------------- */ -Split * xaccMallocSplit (void); - -gboolean xaccSplitEqual(const Split *sa, const Split *sb, - gboolean check_guids, - gboolean check_txn_splits); - -/* Split slots are used to store arbitrary strings, numbers, and - * structures which aren't members of the transaction struct. - * - * See kvp_doc.txt for reserved slot names. - */ -kvp_frame *xaccSplitGetSlots(Split *split); -void xaccSplitSetSlots_nc(Split *s, kvp_frame *frm); - -/* The xaccSplitGetGUID() subroutine will return the - * globally unique id associated with that split. - * - * The xaccSplitLookup() subroutine will return the - * split associated with the given id, or NULL - * if there is no such split. - */ -const GUID * xaccSplitGetGUID (Split *split); -Split * xaccSplitLookup (const GUID *guid); - -/* The memo is an arbitrary string associated with a split. - * Users typically type in free form text from the GUI. - */ -void xaccSplitSetMemo (Split *split, const char *memo); - -/* The Action is essentially an arbitrary string, but is - * meant to be conveniently limited to a menu of selections - * such as "Buy", "Sell", "Interest", etc. However, - * as far as the engine is concerned, its an arbitrary string. - */ -void xaccSplitSetAction (Split *split, const char *action); - -/* The Reconcile is a single byte, whose values are typically - * are "N", "C" and "R" - */ -void xaccSplitSetReconcile (Split *split, char reconciled_flag); -void xaccSplitSetDateReconciledSecs (Split *split, time_t time); -void xaccSplitSetDateReconciledTS (Split *split, Timespec *ts); -void xaccSplitGetDateReconciledTS (Split *split, Timespec *ts); -Timespec xaccSplitRetDateReconciledTS (Split *split); - -/* - * The following four functions set the prices and amounts. - * All of the routines always maintain balance: that is, - * invoking any of them will cause other splits in the transaction - * to be modified so that the net value of the transaction is zero. - * - * IMPORTANT: The split should be parented by an account before - * any of these routines are invoked! This is because the actual - * setting of amounts/values requires SCU settings from the account. - * If these are not available, then amounts/values will be set to - * -1/0, which is an invalid value. I beleive this order dependency - * is a bug, but I'm too lazy to find, fix & test at the moment ... - * - * The xaccSplitSetAmount() (formerly xaccSplitSetShareAmount) method - * sets the amount in the account's commodity that the split - * should have. - * - * The xaccSplitSetSharePrice() method sets the price of the - * split. DEPRECATED - set the value and amount instead. - * - * The xaccSplitSetValue() method adjusts the number of shares in - * the split so that the number of shares times the share price - * equals the value passed in. - * - * The xaccSplitSetSharePriceAndAmount() method will simultaneously - * update the share price and the number of shares. This - * is a utility routine that is equivalent to a xaccSplitSetSharePrice() - * followed by and xaccSplitSetAmount(), except that it incurs the - * processing overhead of balancing only once, instead of twice. */ - -void DxaccSplitSetSharePriceAndAmount (Split *split, double price, - double amount); -void DxaccSplitSetShareAmount (Split *split, double amount); -void DxaccSplitSetSharePrice (Split *split, double price); -void DxaccSplitSetValue (Split *split, double value); -void DxaccSplitSetBaseValue (Split *split, double value, - const gnc_commodity * base_currency); - -void xaccSplitSetSharePriceAndAmount (Split *split, gnc_numeric price, - gnc_numeric amount); -void xaccSplitSetAmount (Split *split, gnc_numeric amount); -void xaccSplitSetSharePrice (Split *split, gnc_numeric price); -void xaccSplitSetValue (Split *split, gnc_numeric value); -void xaccSplitSetBaseValue (Split *split, gnc_numeric value, - const gnc_commodity * base_currency); - -/* The following four subroutines return the running balance up - * to & including the indicated split. - * - * The balance is the currency-denominated balance. For accounts - * with non-unit share prices, it is correctly adjusted for - * share prices. - * - * The share-balance is the number of shares. - * Price fluctuations do not change the share balance. - * - * The cleared-balance is the currency-denominated balance - * of all transactions that have been marked as cleared or reconciled. - * It is correctly adjusted for price fluctuations. - * - * The reconciled-balance is the currency-denominated balance - * of all transactions that have been marked as reconciled. - */ - -gnc_numeric xaccSplitGetBalance (Split *split); -gnc_numeric xaccSplitGetClearedBalance (Split *split); -gnc_numeric xaccSplitGetReconciledBalance (Split *split); -gnc_numeric xaccSplitGetBaseValue (Split *split, - const gnc_commodity * base_currency); - -/* return the parent transaction of the split */ -Transaction * xaccSplitGetParent (Split *split); - -/* return the memo, action strings */ -const char * xaccSplitGetMemo (Split *split); -const char * xaccSplitGetAction (Split *split); - -/* return the value of the reconcile flag */ -char xaccSplitGetReconcile (Split *split); -double DxaccSplitGetShareAmount (Split * split); -double DxaccSplitGetSharePrice (Split * split); -double DxaccSplitGetValue (Split * split); - -gnc_numeric xaccSplitGetAmount (Split * split); -gnc_numeric xaccSplitGetSharePrice (Split * split); -gnc_numeric xaccSplitGetValue (Split * split); - -Account * xaccSplitGetAccount (Split *split); -const GUID * xaccSplitGetAccountGUID(Split *split); -void xaccSplitSetAccount(Split *s, Account *act); -void xaccSplitSetAccountGUID(Split *s, GUID id); - -/* split types: normal stock-split */ -const char *xaccSplitGetType(const Split *s); - -/* reconfgure a split to be a stock split - after this, you shouldn't - mess with the value, just the damount. */ -void xaccSplitMakeStockSplit(Split *s); - -/********************************************************************\ - * sorting comparison function - * - * The xaccTransOrder(ta,tb) method is useful for sorting. - * return a negative value if transaction ta is dated earlier than tb, - * return a positive value if transaction ta is dated later than tb, - * then compares num and description values, using the strcmp() - * c-library routine, returning what strcmp would return. - * Finally, it returns zero if all of the above match. - * Note that it does *NOT* compare its member splits. - * - * The xaccSplitDateOrder(sa,sb) method is useful for sorting. - * if sa and sb have different transactions, return their xaccTransOrder - * return a negative value if split sa has a smaller currency-value than sb, - * return a positive value if split sa has a larger currency-value than sb, - * return a negative value if split sa has a smaller share-price than sb, - * return a positive value if split sa has a larger share-price than sb, - * then compares memo and action using the strcmp() - * c-library routine, returning what strcmp would return. - * Then it compares the reconciled flags, then the reconciled dates, - * Finally, it returns zero if all of the above match. - * - */ - -int xaccTransOrder (Transaction *ta, Transaction *tb); -int xaccSplitDateOrder (Split *sa, Split *sb); - -/********************************************************************\ - * Miscellaneous utility routines. -\********************************************************************/ - -/* - * These functions compare two splits by different criteria. The *Other* - * functions attempt to find the split on the other side of a transaction - * and compare on it. They return similar to strcmp. - * - * These functions were added because converting strings to guile - * for comparisons in the transaction report is terribly inefficient. - * More may be added here in future if it turns out that other types - * of comparisons also induces guile slowdowns. - */ - -int xaccSplitCompareAccountFullNames(Split *sa, Split *sb); -int xaccSplitCompareAccountCodes(Split *sa, Split *sb); -int xaccSplitCompareOtherAccountFullNames(Split *sa, Split *sb); -int xaccSplitCompareOtherAccountCodes(Split *sa, Split *sb); - - -/* - * These functions take a split, get the corresponding split on the - * "other side" of the transaction, and extract either the name or code - * of that split, reverting to returning a constant "Split" if the - * transaction has more than one split on the "other side". These - * were added for the transaction report, and is in C because the code - * was already written in C for the above functions and duplication - * is silly. - */ - -char * xaccSplitGetCorrAccountFullName(Split *sa, char seperator); -const char * xaccSplitGetCorrAccountName(Split *sa); -const char * xaccSplitGetCorrAccountCode(Split *sa); - -/* - * The xaccGetAccountByName() is a convenience routine that - * is essentially identical to xaccGetPeerAccountFromName(), - * except that it accepts the handy transaction as root. - * - * The xaccGetAccountByFullName routine is similar, but uses - * full names using the given separator. - */ -Account * xaccGetAccountByName (Transaction *trans, const char *name); -Account * xaccGetAccountByFullName (Transaction *trans, - const char *name, - const char separator); - -/* - * The xaccSplitGetOtherSplit() is a convenience routine that returns - * the other of a pair of splits. If there are more than two - * splits, it returns NULL. - */ -Split * xaccSplitGetOtherSplit (Split *split); - -/* The xaccIsPeerSplit() is a convenience routine that returns - * a non-zero value if the two splits share a common - * parent transaction, else it returns zero. - */ -int xaccIsPeerSplit (Split *split_1, Split *split_2); - -#endif /* XACC_TRANSACTION_H */ diff --git a/src/engine/TransactionP.h b/src/engine/TransactionP.h deleted file mode 100644 index 7a6c544b5a..0000000000 --- a/src/engine/TransactionP.h +++ /dev/null @@ -1,236 +0,0 @@ -/********************************************************************\ - * TransactionP.h -- private header for transaction & splits * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997, 1998, 1999, 2000 Linas Vepstas * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * TransactionP.h - * - * FUNCTION: - * The is the *private* transaction header file. Code outside of - * engine should *not* include this file. This is because code - * outside of the engine should *never* access any of the structure - * members directly. - * - * Note that this header file also defines prototypes for various - * routines that perform sub-atomic updates of the accounting - * structures. If these routines are not used properly, they - * can result in inconsistent, unbalanced accounting structures. - * In other words, their use is dangerous, and their use outside - * of the scope of the engine is forbidden. - * - */ - -#ifndef XACC_TRANSACTION_P_H -#define XACC_TRANSACTION_P_H - -#include -#include - -#include "config.h" -#include "kvp_frame.h" -#include "gnc-numeric.h" -#include "Transaction.h" /* for typedefs */ -#include "GNCId.h" - - -/** STRUCTS *********************************************************/ -/* - * Double-entry is forced by having at least two splits in every - * transaction. By convention, (and only by convention, not by - * any innate requirement), the first split is considered to be - * the source split or the crediting split, and the others are - * the destination, or debiting splits. The grand total of all - * of the splits must always be kept zero. - */ - -/* A split transaction is one which shows up as a credit (or debit) in - * one account, and pieces of it show up as debits (or credits) in other - * accounts. Thus, a single credit-card transaction might be split - * between "dining", "tips" and "taxes" categories. - * - * A "split" is more commonly refered to as a "entry" in a "transaction". - */ - - -struct _split -{ - GUID guid; /* globally unique id */ - - GUID acc_guid; /* the guid of the associated account */ - Account *acc; /* back-pointer to debited/credited account */ - - Transaction *parent; /* parent of split */ - - /* The memo field is an arbitrary user-assiged value. - * It is intended to hold a short (zero to forty character) string - * that is displayed by the GUI along with this split. - */ - char * memo; - - /* The action field is an arbitrary user-assigned value. - * It is meant to be a very short (one to ten cahracter) string that - * signifies the "type" of this split, such as e.g. Buy, Sell, Div, - * Withdraw, Deposit, ATM, Check, etc. The idea is that this field - * can be used to create custom reports or graphs of data. - */ - char * action; /* Buy, Sell, Div, etc. */ - - /* kvp_data is a key-value pair database for storing simple - * "extra" information in splits, transactions, and accounts. - * it's NULL until accessed. */ - kvp_frame * kvp_data; - - char reconciled; /* The reconciled field */ - Timespec date_reconciled; /* date split was reconciled */ - - /* 'value' is the amount of the transaction balancing commodity - * (i.e. currency) involved, 'amount' is the amount of the account's - * commodity (formerly known as 'security') involved. */ - gnc_numeric value; - gnc_numeric amount; - - /* -------------------------------------------------------------- */ - /* Below follow some 'temporary' fields */ - - /* The various "balances" are the sum of all of the values of - * all the splits in the account, up to and including this split. - * These balances apply to a sorting order by date posted - * (not by date entered). */ - gnc_numeric balance; - gnc_numeric cleared_balance; - gnc_numeric reconciled_balance; - - /* -------------------------------------------------------------- */ - /* Backend private expansion data */ - guint32 idata; /* used by the sql backend for kvp management */ -}; - - -struct _transaction -{ - /* guid is a globally unique identifier which can be used to - * reference the transaction. - */ - GUID guid; - - Timespec date_entered; /* date register entry was made */ - Timespec date_posted; /* date transaction was posted at bank */ - - /* The num field is a arbitrary user-assigned field. - * It is intended to store a short id number, typically the check number, - * deposit number, invoice number or other tracking number. - */ - char * num; - - /* The description field is an arbitrary user-assigned value. - * It is meant to be a short descriptive phrase. - */ - char * description; - - /* kvp_data is a key-value pair database for storing simple - * "extra" information in splits, transactions, and accounts. - * it's NULL until accessed. */ - kvp_frame * kvp_data; - - - /* The common_currency field is the balancing common currency for - * all the splits in the transaction. - * - * This field is going to replace the currency field in the account - * structures. However, right now we are in a transition period: we - * store it here an in the account, and test its value dynamically - * for correctness. If we can run for a few months without errors, - * then we'll make the conversion permanent. - * - * Alternate, better(?) name: "valuation currency": it is the - * currency in which all of the splits can be valued. */ - gnc_commodity *common_currency; - - /* version number, used for tracking multiuser updates */ - gint32 version; - guint32 version_check; /* data aging timestamp */ - - GList * splits; /* list of splits */ - - /* marker is used to track the progress of transaction traversals. - * 0 is never a legitimate marker value, so we can tell is we hit - * a new transaction in the middle of a traversal. All each new - * traversal cares about is whether or not the marker stored in - * a transaction is the same as or different than the one - * corresponding to the current traversal. */ - unsigned char marker; - - gint32 editlevel; /* nestcount of begin/end edit calls */ - gboolean do_free; /* transaction in process of being destroyed */ - - /* the orig pointer points at a copy of the original transaction, - * before editing was started. This orig copy is used to rollback - * any changes made if/when the edit is abandoned. - */ - Transaction *orig; - - /* -------------------------------------------------------------- */ - /* Backend private expansion data */ - guint32 idata; /* used by the sql backend for kvp management */ -}; - -/* Set the transaction's GUID. This should only be done when reading - * a transaction from a datafile, or some other external source. Never - * call this on an existing transaction! */ -void xaccTransSetGUID (Transaction *trans, const GUID *guid); - -/* Set the split's GUID. This should only be done when reading - * a split from a datafile, or some other external source. Never - * call this on an existing split! */ -void xaccSplitSetGUID (Split *split, const GUID *guid); - -/* The xaccFreeSplit() method simply frees all memory associated - * with the split. It does not verify that the split isn't - * referenced in some account. If the split is referenced by an - * account, then calling this method will leave the system in an - * inconsistent state. - */ -void xaccFreeSplit (Split *split); /* frees memory */ - -/* compute the value of a list of splits in the given currency, - * excluding the skip_me split. */ -gnc_numeric xaccSplitsComputeValue (GList *splits, Split * skip_me, - const gnc_commodity * base_currency); - -/* The xaccTransSet/GetVersion() routines set & get the version - * numbers on this transaction. The version number is used to manage - * multi-user updates. These routines are private because we don't - * want anyone except the backend to mess with them. - */ -void xaccTransSetVersion (Transaction*, gint32); -gint32 xaccTransGetVersion (Transaction*); - -/* The xaccTransFindCommonCurrency () method returns a gnc_commodity - * indicating a currency denomination that all of the splits in this - * transaction have in common, using the old currency/security fields - * of the split accounts. */ -gnc_commodity * xaccTransFindOldCommonCurrency (Transaction *trans); - -#endif /* XACC_TRANSACTION_P_H */ diff --git a/src/engine/commodity-table.scm b/src/engine/commodity-table.scm new file mode 100644 index 0000000000..ba8ef9b221 --- /dev/null +++ b/src/engine/commodity-table.scm @@ -0,0 +1,80 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; commodity-table.scm +;;; load and save commodity tables +;;; +;;; Bill Gribble 3 Aug 2000 +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;(define gnc:*iso-4217-currency-file* +;; (gnc:make-config-var +;; "Database of ISO-4217 currency definitions" +;; (lambda (var value) (if (string? value) (list value) #f)) +;; string=? +;; "iso-4217-currencies.scm")) + +(define gnc:*iso-4217-currency-file* "iso-4217-currencies.scm") + +(define GNC_COMMODITY_NS_ISO "ISO4217") +(define GNC_COMMODITY_NS_NASDAQ "NASDAQ") +(define GNC_COMMODITY_NS_NYSE "NYSE") +(define GNC_COMMODITY_NS_AMEX "AMEX") +(define GNC_COMMODITY_NS_EUREX "EUREX") +(define GNC_COMMODITY_NS_MUTUAL "FUND") + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (gnc:setup-default-namespaces) +;; make sure there are some reasonable commodity namespaces +;; in the engine +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (gnc:setup-default-namespaces) + (let ((table (gnc:engine-commodities))) + (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_AMEX) + (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_NYSE) + (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_NASDAQ) + (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_EUREX) + (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_MUTUAL))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (gnc:load-iso-4217-currencies) +;; load the default table of ISO-4217 currency information. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (gnc:load-iso-4217-currencies) + (let ((table (gnc:engine-commodities)) + (curr-path (%search-load-path gnc:*iso-4217-currency-file*))) + (if curr-path + (with-input-from-file curr-path + (lambda () + (let loop ((form (read))) + (if (not (eof-object? form)) + (begin + (if (and (list? form) + (eq? 8 (length form))) + (let ((fullname (list-ref form 0)) + (unitname (list-ref form 1)) + (partname (list-ref form 2)) + (namespace (list-ref form 3)) + (mnemonic (list-ref form 4)) + (exchange-code (list-ref form 5)) + (parts-per-unit (list-ref form 6)) + (smallest-fraction (list-ref form 7))) + (if (and (string? fullname) + (string? unitname) + (string? partname) + (string? namespace) + (string? mnemonic) + (string? exchange-code) + (number? parts-per-unit) + (number? smallest-fraction)) + (let ((comm + (gnc:commodity-create + fullname namespace + mnemonic exchange-code + smallest-fraction))) + (gnc:commodity-table-insert table comm))))) + (loop (read))))))) + (display "Unable to load iso-4217 currency definitions\n")))) diff --git a/src/engine/date.c b/src/engine/date.c deleted file mode 100644 index db08ff0f85..0000000000 --- a/src/engine/date.c +++ /dev/null @@ -1,701 +0,0 @@ -/********************************************************************\ - * date.c -- utility functions to handle the date (adjusting, get * - * current date, etc.) for xacc (X-Accountant) * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - * Author: Rob Clark rclark@cs.hmc.edu * - * * -\********************************************************************/ - -#define _GNU_SOURCE -#define __EXTENSIONS__ - -#include "config.h" - -#include - -#ifdef HAVE_LANGINFO_D_FMT -#include -#endif - -#include -#include -#include -#include - -#include - -#include "date.h" -#include "gnc-engine-util.h" - -#define NANOS_PER_SECOND 1000000000 - -#ifdef HAVE_LANGINFO_D_FMT -# define GNC_D_FMT (nl_langinfo (D_FMT)) -#else -# define GNC_D_FMT "%Y-%m-%d" -#endif - -/* This is now user configured through the gnome options system() */ -static DateFormat dateFormat = DATE_FORMAT_US; - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - - -/********************************************************************\ -\********************************************************************/ - -static void -timespec_normalize(Timespec *t) -{ - if(t->tv_nsec > NANOS_PER_SECOND) - { - t->tv_sec+= (t->tv_nsec / NANOS_PER_SECOND); - t->tv_nsec= t->tv_nsec % NANOS_PER_SECOND; - } - - if(t->tv_nsec < - NANOS_PER_SECOND) - { - t->tv_sec+= - (-t->tv_nsec / NANOS_PER_SECOND); - t->tv_nsec = - (-t->tv_nsec % NANOS_PER_SECOND); - } - - if (t->tv_sec > 0 && t->tv_nsec < 0) - { - t->tv_sec--; - t->tv_nsec = NANOS_PER_SECOND + t->tv_nsec; - } - - if (t->tv_sec < 0 && t->tv_nsec > 0) - { - t->tv_sec++; - t->tv_nsec = - NANOS_PER_SECOND + t->tv_nsec; - } - return; -} - - -gboolean -timespec_equal (const Timespec *ta, const Timespec *tb) -{ - if(ta == tb) return TRUE; - if(ta->tv_sec != tb->tv_sec) return FALSE; - if(ta->tv_nsec != tb->tv_nsec) return FALSE; - return TRUE; -} - -gint -timespec_cmp(const Timespec *ta, const Timespec *tb) -{ - if(ta == tb) return 0; - if(ta->tv_sec < tb->tv_sec) return -1; - if(ta->tv_sec > tb->tv_sec) return 1; - if(ta->tv_nsec < tb->tv_nsec) return -1; - if(ta->tv_nsec > tb->tv_nsec) return 1; - return 0; -} - -Timespec -timespec_diff(const Timespec *ta, const Timespec *tb) -{ - Timespec retval; - retval.tv_sec = ta->tv_sec - tb->tv_sec; - retval.tv_nsec = ta->tv_nsec - tb->tv_nsec; - timespec_normalize(&retval); - return retval; -} - -Timespec -timespec_abs(const Timespec *t) -{ - Timespec retval = *t; - - timespec_normalize(&retval); - if (retval.tv_sec < 0) - { - retval.tv_sec = - retval.tv_sec; - retval.tv_nsec = - retval.tv_nsec; - } - - return retval; -} - -/** - * timespecCanonicalDayTime - * given a timepair contains any time on a certain day (local time) - * converts it to be midday that day. - */ - -Timespec -timespecCanonicalDayTime(Timespec t) -{ - struct tm tm, *result; - Timespec retval; - time_t t_secs = t.tv_sec + (t.tv_nsec / NANOS_PER_SECOND); - result = localtime(&t_secs); - tm = *result; - tm.tm_sec = 0; - tm.tm_min = 0; - tm.tm_hour = 12; - tm.tm_isdst = -1; - retval.tv_sec = mktime(&tm); - retval.tv_nsec = 0; - return retval; -} - -/** - * setDateFormat - * set date format to one of US, UK, CE, OR ISO - * checks to make sure it's a legal value - * Args: DateFormat: enumeration indicating preferred format - * returns: nothing - * - * Globals: dateFormat - **/ - -void setDateFormat(DateFormat df) -{ - if(df >= DATE_FORMAT_FIRST && df <= DATE_FORMAT_LAST) - { - dateFormat = df; - } - else - { /* hack alert - is this what we should be doing here? */ - PERR("non-existent date format set"); - } - - return; -} - -/** - * printDate - * Convert a date as day / month / year integers into a localized string - * representation - * - * Args: buff - pointer to previously allocated character array; its size - * must be at lease MAX_DATE_LENTH bytes. - * day - day of the month as 1 ... 31 - * month - month of the year as 1 ... 12 - * year - year (4-digit) - * - * Return: nothing - * - * Globals: global dateFormat value - */ -void -printDate (char * buff, int day, int month, int year) -{ - if (!buff) return; - - /* Note that when printing year, we use %-4d in format string; - * this causes a one, two or three-digit year to be left-adjusted - * when printed (i.e. padded with blanks on the right). This is - * important while the user is editing the year, since erasing a - * digit can temporarily cause a three-digit year, and having the - * blank on the left is a real pain for the user. So pad on the - * right. - */ - switch(dateFormat) - { - case DATE_FORMAT_UK: - sprintf (buff, "%2d/%2d/%-4d", day, month, year); - break; - case DATE_FORMAT_CE: - sprintf (buff, "%2d.%2d.%-4d", day, month, year); - break; - case DATE_FORMAT_ISO: - sprintf (buff, "%04d-%02d-%02d", year, month, day); - break; - case DATE_FORMAT_LOCALE: - { - struct tm tm_str; - - tm_str.tm_mday = day; - tm_str.tm_mon = month - 1; /* tm_mon = 0 through 11 */ - tm_str.tm_year = year - 1900; /* this is what the standard - * says, it's not a Y2K thing */ - tm_str.tm_hour = 0; - tm_str.tm_min = 0; - tm_str.tm_sec = 0; - tm_str.tm_isdst = -1; - - strftime (buff, MAX_DATE_LENGTH, GNC_D_FMT, &tm_str); - } - break; - - case DATE_FORMAT_US: - default: - sprintf (buff, "%2d/%2d/%-4d", month, day, year); - break; - } -} - -void -printDateSecs (char * buff, time_t t) -{ - struct tm *theTime; - - if (!buff) return; - - theTime = localtime (&t); - - printDate (buff, theTime->tm_mday, - theTime->tm_mon + 1, - theTime->tm_year + 1900); -} - -char * -xaccPrintDateSecs (time_t t) -{ - char buff[100]; - printDateSecs (buff, t); - return g_strdup (buff); -} - -const char * -gnc_print_date (Timespec ts) -{ - static char buff[MAX_DATE_LENGTH]; - time_t t; - - t = ts.tv_sec + (ts.tv_nsec / 1000000000.0); - - printDateSecs (buff, t); - - return buff; -} - -/** - * scanDate - * Convert a string into day / month / year integers according to - * the current dateFormat value. - * - * Args: buff - pointer to date string - * day - will store day of the month as 1 ... 31 - * month - will store month of the year as 1 ... 12 - * year - will store the year (4-digit) - * - * Return: nothing - * - * Globals: global dateFormat value - */ -void -scanDate (const char *buff, int *day, int *month, int *year) -{ - char *dupe, *tmp, *first_field, *second_field, *third_field; - int iday, imonth, iyear; - struct tm *now; - time_t secs; - - if (!buff) return; - - dupe = g_strdup (buff); - - tmp = dupe; - first_field = NULL; - second_field = NULL; - third_field = NULL; - - /* use strtok to find delimiters */ - if (tmp) { - first_field = strtok (tmp, ".,-+/\\()"); - if (first_field) { - second_field = strtok (NULL, ".,-+/\\()"); - if (second_field) { - third_field = strtok (NULL, ".,-+/\\()"); - } - } - } - - /* if any fields appear blank, use today's date */ - time (&secs); - now = localtime (&secs); - iday = now->tm_mday; - imonth = now->tm_mon+1; - iyear = now->tm_year+1900; - - /* get numeric values */ - switch (dateFormat) - { - case DATE_FORMAT_LOCALE: - if (buff[0] != '\0') - { - struct tm thetime; - - strptime (buff, GNC_D_FMT, &thetime); - - iday = thetime.tm_mday; - imonth = thetime.tm_mon + 1; - iyear = thetime.tm_year + 1900; - } - break; - case DATE_FORMAT_UK: - case DATE_FORMAT_CE: - if (first_field) iday = atoi (first_field); - if (second_field) imonth = atoi (second_field); - if (third_field) iyear = atoi (third_field); - break; - case DATE_FORMAT_ISO: - if (first_field) iyear = atoi (first_field); - if (second_field) imonth = atoi (second_field); - if (third_field) iday = atoi (third_field); - break; - case DATE_FORMAT_US: - default: - if (first_field) imonth = atoi (first_field); - if (second_field) iday = atoi (second_field); - if (third_field) iyear = atoi (third_field); - break; - } - - g_free (dupe); - - /* if the year entered is smaller than 100, assume we mean the current - century (and are not revising some roman emperor's books) */ - if (iyear < 100) - iyear += ((int) ((now->tm_year+1950-iyear)/100)) * 100; - - if (year) *year=iyear; - if (month) *month=imonth; - if (day) *day=iday; -} - -/** - * dateSeparator - * Return the field separator for the current date format - * - * Args: none - * - * Return: date character - * - * Globals: global dateFormat value - */ -char dateSeparator () -{ - static char locale_separator = '\0'; - - switch (dateFormat) - { - case DATE_FORMAT_CE: - return '.'; - case DATE_FORMAT_ISO: - return '-'; - case DATE_FORMAT_US: - case DATE_FORMAT_UK: - default: - return '/'; - case DATE_FORMAT_LOCALE: - if (locale_separator != '\0') - return locale_separator; - else - { /* Make a guess */ - char string[256]; - struct tm *tm; - time_t secs; - char *s; - - secs = time(NULL); - tm = localtime(&secs); - strftime(string, sizeof(string), GNC_D_FMT, tm); - - for (s = string; s != '\0'; s++) - if (!isdigit(*s)) - return (locale_separator = *s); - } - } - - return '\0'; -} - -/********************************************************************\ - * iso 8601 datetimes should look like 1998-07-02 11:00:00.68-05 -\********************************************************************/ -/* hack alert -- this routine returns incorrect values for - * dates before 1970 */ - -static Timespec -gnc_iso8601_to_timespec(const char *str, int do_localtime) -{ - char buf[4]; - Timespec ts; - struct tm stm; - long int nsec =0; - - ts.tv_sec=0; - ts.tv_nsec=0; - if (!str) return ts; - - stm.tm_year = atoi(str) - 1900; - str = strchr (str, '-'); if (str) { str++; } else { return ts; } - stm.tm_mon = atoi(str) - 1; - str = strchr (str, '-'); if (str) { str++; } else { return ts; } - stm.tm_mday = atoi(str); - - str = strchr (str, ' '); if (str) { str++; } else { return ts; } - stm.tm_hour = atoi(str); - str = strchr (str, ':'); if (str) { str++; } else { return ts; } - stm.tm_min = atoi(str); - str = strchr (str, ':'); if (str) { str++; } else { return ts; } - stm.tm_sec = atoi (str); - - /* the decimal point, optionally present ... */ - /* hack alert -- this algo breaks if more than 9 decimal places present */ - if (strchr (str, '.')) - { - int decimals, i, multiplier=1000000000; - str = strchr (str, '.') +1; - decimals = strcspn (str, "+- "); - for (i=0; itz_min) { tz_min +=60; tz_hour --; } - if (60<=tz_min) { tz_min -=60; tz_hour ++; } - - /* we also have to print the sign by hand, to work around a bug - * in the glibc 2.1.3 printf (where %+02d fails to zero-pad) - */ - cyn = '-'; - if (0>tz_hour) { cyn = '+'; tz_hour = -tz_hour; } - - len = sprintf (buff, "%4d-%02d-%02d %02d:%02d:%02d.%06ld %c%02d%02d", - parsed.tm_year + 1900, - parsed.tm_mon + 1, - parsed.tm_mday, - parsed.tm_hour, - parsed.tm_min, - parsed.tm_sec, - ts.tv_nsec / 1000, - cyn, - tz_hour, - tz_min); - - /* return pointer to end of string */ - buff += len; - return buff; -} - - -/********************************************************************\ -\********************************************************************/ -/* hack alert -- this routine returns incorrect values for - * dates before 1970 */ - -time_t -xaccDMYToSec (int day, int month, int year) -{ - struct tm stm; - time_t secs; - - stm.tm_year = year - 1900; - stm.tm_mon = month - 1; - stm.tm_mday = day; - stm.tm_hour = 0; - stm.tm_min = 0; - stm.tm_sec = 0; - stm.tm_isdst = -1; - - /* compute number of seconds */ - secs = mktime (&stm); - - return secs; -} - -time_t -xaccScanDateS (const char *str) -{ - int month, day, year; - - scanDate (str, &day, &month, &year); - - return xaccDMYToSec (day,month,year); -} - -#define THIRTY_TWO_YEARS 0x3c30fc00LL - -static Timespec -gnc_dmy2timespec_internal (int day, int month, int year, gboolean start_of_day) -{ - Timespec result; - struct tm date; - long long secs = 0; - long long era = 0; - - year -= 1900; - - /* make a crude attempt to deal with dates outside the range of Dec - * 1901 to Jan 2038. Note we screw up centennial leap years here so - * hack alert */ - if ((2 > year) || (136 < year)) - { - era = year / 32; - year %= 32; - if (0 > year) { year += 32; era -= 1; } - } - - date.tm_year = year; - date.tm_mon = month - 1; - date.tm_mday = day; - - if (start_of_day) - { - date.tm_hour = 0; - date.tm_min = 0; - date.tm_sec = 0; - } - else - { - date.tm_hour = 23; - date.tm_min = 59; - date.tm_sec = 59; - } - - date.tm_isdst = -1; - - /* compute number of seconds */ - secs = mktime (&date); - - secs += era * THIRTY_TWO_YEARS; - - result.tv_sec = secs; - result.tv_nsec = 0; - - return result; -} - -Timespec -gnc_dmy2timespec (int day, int month, int year) -{ - return gnc_dmy2timespec_internal (day, month, year, TRUE); -} - -Timespec -gnc_dmy2timespec_end (int day, int month, int year) -{ - return gnc_dmy2timespec_internal (day, month, year, FALSE); -} - -/********************************************************************\ -\********************************************************************/ - -long int -gnc_timezone (struct tm *tm) -{ - g_return_val_if_fail (tm != NULL, 0); - -#ifdef HAVE_STRUCT_TM_GMTOFF - /* tm_gmtoff is seconds *east* of UTC and is - * already adjusted for daylight savings time. */ - return -(tm->tm_gmtoff); -#else - /* timezone is seconds *west* of UTC and is - * not adjusted for daylight savings time. - * In Spring, we spring forward, wheee! */ - return timezone - (tm->tm_isdst > 0 ? 60 * 60 : 0); -#endif -} - - -void -timespecFromTime_t( Timespec *ts, time_t t ) -{ - ts->tv_sec = t; - ts->tv_nsec = 0; -} - -/********************** END OF FILE *********************************\ -\********************************************************************/ diff --git a/src/engine/date.h b/src/engine/date.h deleted file mode 100644 index ce4cf6833a..0000000000 --- a/src/engine/date.h +++ /dev/null @@ -1,206 +0,0 @@ -/********************************************************************\ - * date.h -- utility functions to handle the date (adjusting, get * - * current date, etc.) for GnuCash * - * Copyright (C) 1997 Robin D. Clark (rclark@cs.hmc.edu) * - * Copyright (C) 1998, 1999, 2000 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -/* hack alert -- the scan and print routines should probably be moved - * to somewhere else. The engine really isn't involved with things - * like printing formats. This is needed mostly by the GUI and so on. - * If a file-io thing needs date handling, it should do it itself, - * instead of depending on the routines here. */ - -#ifndef XACC_DATE_H -#define XACC_DATE_H - -#include - - -/** Constants *******************************************************/ - -typedef enum -{ - DATE_FORMAT_US, /* United states: mm/dd/yyyy */ - DATE_FORMAT_UK, /* Britain: dd/mm/yyyy */ - DATE_FORMAT_CE, /* Continental Europe: dd.mm.yyyy */ - DATE_FORMAT_ISO, /* ISO: yyyy-mm-dd */ - DATE_FORMAT_LOCALE /* Take from locale information */ -} DateFormat; - -#define DATE_FORMAT_FIRST DATE_FORMAT_US -#define DATE_FORMAT_LAST DATE_FORMAT_LOCALE - -/* the maximum length of a string created by the date printers */ -#define MAX_DATE_LENGTH 11 - - -/** Datatypes *******************************************************/ - -/* struct timespec64 is just like timespec except that we use a 64-bit - * signed int to store the seconds. This should adequately cover - * dates in the distant future as well as the distant past, as long as - * they're not more than a couple dozen times the age of the universe. - * Note that both gcc and the IBM Toronto xlC compiler (aka CSet, - * VisualAge, etc) correctly handle long long as a 64 bit quantity, - * even on the 32-bit Intel x86 and PowerPC architectures. I'm - * assuming that all the other modern compilers are clean on this - * issue too. */ - -#ifndef SWIG /* swig 1.1p5 can't hack the long long type */ -struct timespec64 -{ - long long int tv_sec; - long int tv_nsec; -}; -#endif /* SWIG */ - -typedef struct timespec64 Timespec; - - -/** Prototypes ******************************************************/ - -/* strict equality */ -gboolean timespec_equal(const Timespec *ta, const Timespec *tb); -/* comparison: if (ta < tb) -1; else if (ta > tb) 1; else 0; */ -int timespec_cmp(const Timespec *ta, const Timespec *tb); - -/* difference between ta and tb, results are normalised - * ie tv_sec and tv_nsec of the result have the same size - * abs(result.tv_nsec) <= 1000000000 - */ - -Timespec timespec_diff(const Timespec *ta, const Timespec *tb); - -/* - * absolute value, also normalised - */ -Timespec timespec_abs(const Timespec *t); - -/* - * convert a timepair on a certain day (localtime) to - * the timepair representing midday on that day - */ - -Timespec timespecCanonicalDayTime(Timespec t); - -void setDateFormat(DateFormat df); - -/** - * printDate - * Convert a date as day / month / year integers into a localized string - * representation - * - * Args: buff - pointer to previously allocated character array; its size - * must be at lease MAX_DATE_LENTH bytes. - * day - day of the month as 1 ... 31 - * month - month of the year as 1 ... 12 - * year - year (4-digit) - * - * Return: nothing - * - * Globals: global dateFormat value - */ -void printDate (char * buff, int day, int month, int year); -void printDateSecs (char * buff, time_t secs); - -char * xaccPrintDateSecs (time_t secs); -const char * gnc_print_date(Timespec ts); - -/** - * Turns a time_t into a Timespec - **/ -void timespecFromTime_t( Timespec *ts, time_t t ); - -/** - * scanDate - * Convert a string into day / month / year integers according to - * the current dateFormat value. - * - * Args: buff - pointer to date string - * day - will store day of the month as 1 ... 31 - * month - will store month of the year as 1 ... 12 - * year - will store the year (4-digit) - * - * Return: nothing - * - * Globals: global dateFormat value - */ -void scanDate (const char *buff, int *day, int *month, int *year); - -/** - * dateSeparator - * Return the field separator for the current date format - * - * Args: none - * - * Return: date character - * - * Globals: global dateFormat value - */ -char dateSeparator(void); - -/* - * hack alert XXX FIXME -- these date routines return incorrect - * values for dates before 1970. Most of them are good only up - * till 2038. This needs fixing ... - */ - -time_t xaccDMYToSec (int day, int month, int year); -time_t xaccScanDateS (const char *buff); - -/* Convert a day, month, and year to a Timespec */ -Timespec gnc_dmy2timespec (int day, int month, int year); - -/* Same as gnc_dmy2timespec, but last second of the day */ -Timespec gnc_dmy2timespec_end (int day, int month, int year); - -/* The gnc_iso8601_to_timespec_xxx() routines converts an ISO-8601 style - * date/time string to Timespec. - * For example: 1998-07-17 11:00:00.68-05 - * is 680 milliseconds after 11 o'clock, central daylight time - * The _gmt() routine returns the time in gmt. The _local() routine - * returns the local time. - * - * The gnc_timespec_to_iso8601_buff() routine prints a Timespec - * as an ISO-8601 style string. The buffer must be long enough - * to contain the string. The string is null-terminated. This - * routine returns a pointer to the null terminator (and can - * thus be used in the 'stpcpy' metaphor of string concatenation). - */ -Timespec gnc_iso8601_to_timespec_local(const char *); -Timespec gnc_iso8601_to_timespec_gmt(const char *); -char * gnc_timespec_to_iso8601_buff (Timespec ts, char * buff); - -/* The gnc_timezone function returns the number of seconds *west* - * of UTC represented by the tm argument, adjusted for daylight - * savings time. - * - * This function requires a tm argument returned by localtime or set - * by mktime. This is a strange function! It requires that localtime - * or mktime be called before use. Subsequent calls to localtime or - * mktime *may* invalidate the result! The actual contents of tm *may* - * be used for both timezone offset and daylight savings time, or only - * daylight savings time! Timezone stuff under unix is not - * standardized and is a big mess. - */ -long int gnc_timezone (struct tm *tm); - -#endif /* XACC_DATE_H */ diff --git a/src/engine/design.txt b/src/engine/design.txt deleted file mode 100644 index 41ce549ad7..0000000000 --- a/src/engine/design.txt +++ /dev/null @@ -1,397 +0,0 @@ -This document is becoming obsolete. Please refer to the design -documentation in src/doc/design for a complete description of the -Engine architecture. - -Accounting Engine ------------------ -This document reviews the operation of, and various design points -pertinent to the GnuCash accounting engine. The latest version -of this document can be found in the engine source-code directory. - -Stocks, non-Currency-Denominated Assets ---------------------------------------- -The engine includes support for non-currency-denominated assets, -such as stocks, bonds, mutual funds, inventory. This is done with -two values in the Split structure: - - double share_price; - double damount; - -"damount" is the number of shares/items. It is an "immutable" quantity, -in that it cannot change except by transfer (sale/purchase). It is the -quantity that is used when computing balances. - -"share_price" is the price of the item in question. The share-price is -of course subject to fluctuation. - -The net-value of a split is the product of "damount" and "share_price". -The currency balance of an account is the sum of all "damounts" times -the latest, newest share-price. - -Currency accounts should use a share price of 1.0 for all splits. - -To maintain the double-entry consistency, one must have the following -hold true: - - 0.0 == sum of all split values. - -If all splits are in the same currency, then this becomes: - - 0.0 == sum of all ((split->damount) * (split->share_price)) - -Thus, for example, the purchase of shares can be represented as: - - source: - debit ABC Bank for $1045 (1045 dollars * dollar "price" of 1.00) - - destination: - credit PQR Stock for $1000 (100 shares at $10 per share) - credit StockBroker category $45 in fees - -If the splits are in mixed currencies and securities, then there must -be at least one common currency/security between all of them. Thus, -for example: - - source: - debit ABC Bank for $1045 (1045 dollars * dollar "price" of 1.00) - - destination: - credit VolkTrader for 2000 DM (1000 dollars at 2.0 mark per dollar) - credit Fees category $45 in fees - -If the "currency" field is set to "DM" for the VolksTrader account, -and the "security" field is set to "USD", while the currency for ABC bank is -"USD", then the balancing equation becomes: - -0.0 = 1045 * $1.00 - $1000 - 45 * $1.00 - -Note that we ignored the price when adding the second split. - -Recoding a Stock Price ----------------------- -A stock price may be recorded in a brokerage account with a single -split that has zero value: -(share price) * (zero shares) == (zero dollars) -This transaction does not violate the rules that all transactions must -have zero value. This transaction is ideal for recording prices. Its -the only transaction type that may have a single split; everything else -requires at least two splits to balance. (at least when double-entry -is enabled). - -Recording a Stock Split ------------------------ -Stock splits (i.e. when a company issues x shares of new stock for every -share already owned) may be recorded with a pair of journal entries as -follows: - -(-old num shrs) * (old price) + (new num shrs) * (new price) == 0.0 -where each journal entry credits/debits the same account. -Of course (new num shrs) == (1+x) * (old num shrs) -and the price goes inversely. - -Stock Options -------------- -Stock options are not currently supported. To support them, the -following needs to be added: - -A stock option is an option to purchase stock at a specified price. -Options have an expiration date. When you purchase an option it is -pretty much like buying stock. However, some extra information needs -to be recorded. To fully record an option purchase, you need to record -the underlying stock that the option is on, the strike price (i.e. the -price that the underlying stock can be purchases for), an expiration date, -and whether the option is a put or a call. A put option is the option -to sell stock at the strike price, and a call option is the option to -purchase stock at the strike price. Once an option is bought, it can -have one of three dispositions: it can be sold, in which case, it is -pretty much just like a stock transaction. It can expire, in which -case the option is worthless, and (IIRC) can be/is treated as a sale -at a zero price. Thirdly, it can be exercised, which is a single -transaction whereby stock is purchased at the strike price, and -the option becomes worthless. - -Another point: with standardized options one option contract represents -the ability to purchase (with a call option) or sell (with a put option) -100 shares of the underlying stock. - - -Error Reporting ---------------- -The error reporting architecture (partially implemented), uses a globally -visible subroutine to return an error. In the naivest possible implementation, -the error reporting mechanism would look like this: - - int error_num; /* global error number */ - - int xaccGetError (void) { return error_num; } - - void xaccSomeFunction (Args *various_args) { - if (bad_thing_happened) error_num = 42; - } - -Many programmers are used to a different interface, e.g. - - int xaccSomeFunction (Args *various_args) { - if (bad_thing_happened) return (42); - } - -Because of this, it is important to explain why the former design was -choosen over the latter. Let us begin by listing how the choosen design -is as good as, and in many ways can be better to the later design. - - (1) Allows programmer to check for errors asynchronously, e.g. outside - of a performance critical loop, or far away, after the return of - several subroutines. - (2) (with the right implementation) Allows reporting of multiple, complex - errors. For example, it can be used to implement a trace mechanism. - (3) (with the right implementation) Can be thread safe. - (4) Allows errors that occurred deep in the implementation to be reported - up to much higher levels without requiring baggage in the middle. - -The right implementation for (2) is to implement not a single -variable, but a stack or a ring (circular queue) on which error codes -are placed, and from which error codes can be retreived. The right -implementation for (3) is the use pthread_getspecific() to define a -per-thread global and/or ring/queue. - - -Engine Isolation ----------------- -Goals of engine isolation: - o Hide the engine behind an API so that multiple, pluggable engines - could be created, e.g. SQL or CORBA. - o Engine users are blocked from being able to put engine internal - structures in an inconsistent state. Updates are "atomic". - -Some half-finished thoughts about the engine API: - --- The engine structures should not be accessible to any code outside - of the engine. Thus, the engine structures have been moved to - AccountP.h, TransactionP.h, etc. - The *P.h files should not be included by code outside of the engine. - --- The down-side of hiding is that it can hurt performance. Even trivial data - accesses require a subroutine call. Maybe a smarter idea would be to leave - the structures exposed, allow direct manipulation, and then "copy-in" and - "copy-out" the structures into parallel structures when a hidden back end - needs to be invoked. - --- the upside of hiding behind an API is that the engine can be - instrumented with extension language (perl, scheme, tcl, python) hooks - for pre/post processing of the data. To further enable such hooks, we - should probably surround all operations on structures with "begin-edit" - and "end-edit" calls. - --- begin/end braces could potentially be useful for two-phase commit schemes. - where "end-edit" is replaced by "commit-edit" or "reject-edit". - - -Reconciliation --------------- -The 'reconcile' state of a transaction can have one of the following values: - -/* Values for the reconciled field in Transaction: */ -#define NREC 'n' /* not reconciled or cleared */ -#define CREC 'c' /* The transaction has been cleared */ -#define YREC 'y' /* The transaction has been reconciled */ -#define FREC 'f' /* frozen into accounting period */ - -(Note that FREC is not yet used/implemented ...) - -The process of reconciliation works as follows: -1) User enters new transaction. All splits are marked 'n' for 'new' - or 'no, not yet reconciled'. -2) User beleives that the transaction has cleared the bank, - e.g. that a cheque written out has been deposited/cashed. - User clicks in the 'R' column in the register gui, - marking the split 'c' for 'cleared'. User can freely - toggle this flag from the GUI with essentially no penalty, - no complaints. This is a 'safe' operation. Note that the - register shows the 'cleared' subtotal, which is, essentially, - a guess of the banks view of the account balance. -3) When user gets the bank statement, user launches the - reconcile dialogue. This dialogue is used to match transactions - on the bank statement with which is recorded locally. - Reconciled transactions are marked with a 'y'. - Note that once a transaction has been marked 'y', and the - user has 'finished' with the reconcile dialogue, then it - should be 'hard' to change the reconcile state from - the ordinary register dialogue. It should be sort-of - 'set in stone'. (The engine does NOT enforce this, - only the gui enforces this.) -4) When the books are closed, all splits should be marked - 'frozen', and become truly un-editable. The engine should - enforce 'frozen', and just plain not allow editing of closed - books, period. The only wat to change this would have been - to re-open the book. (and the reopening of a book would - change all 'f' to 'y'.) - -About storing dates associated with reconcile: -> I think that there should be a date stamp attached to the reconciliation -> field so that as well as knowing that it has been reconciled, you also -> know *when* it was reconciled. -> -> This isn't so important for personal finances for the periodic user; I -> have in the past wanted to know when a particular transaction was -> reconciled. This is useful if you want to trace back from the -> electronic record to determine when the item actually cleared through -> the bank. -> -> This means that I can look at Cheque #428, written Jan 1/97, cashed in May -> 1997 (it sat in someone's desk for a while) in the computer system and say -> "Ah. It was marked as reconciled on June 12th/97. That was when I did the -> reconciliation of the May bank statements. Ergo, the cheque cleared in May, -> and that's the statement to go to to find a copy of the cheque..." -> -> It's not terribly important for cheques that get cashed right away; it *is* -> for things that hang around uncashed for a while. - -If the above is implemented, what date should be stored if the user -toggles the recn flag a few time? The date of the last toggle? -The very first date that it was recn'ed? - - -Automatic Backup ----------------- -The following has been implemented: - -Have (by default) xacc create a backup file -filename-timestamp.xac on every save. This will eat up some disk -space until you go back and kill the older versions, but it's -better than not realizing that the data's subtly corrupt a week -later. - -A lot of small-office/home systems do this. primarily useful as a -historical record, in case you accidentally wipe out something, and -don't spot it until later. Limited usefulness, but very nice in case -you accidentally delete an entire account. - -To a limited degree, it provides atomicity/consistency/etc at the -course-grained account-group level. - - -Transaction Processing ----------------------- -There is a rudimentary level of "TP" build in, via the routines -xaccTransBeginEdit(), xaccTransRollbackEdit(), and xaccTransCommitEdit(), -which allow changes to be made to a transaction, and then commited, -or rejected at the end. Handy for the GUI, if the user makes a bunch -of changes which they don't want to keep; also handy for an SQL back end, -where the Commit() routine triggers the actual update of the SQL database. - -Note: 'Commit' is sometimes called 'post' in other systems: The -act of 'commiting' a transaction is the same as 'posting' the -transaction to the general ledger. - -Some important implementation details to understand: the GUI currently -uses begin/end as a convenience, and thus, may hold a transaction in -the 'edit' state for a portentially long time (minutes or hours). -Thus, begin/end should not map naively to a table-lock/unlock. -Instead, an optimistic-locking scheme, as below, is prefered. - -The SQL back-end should implement posting entirely in the -'Commit()' routine. The pseudo-algorithms should look as follows: - - BeginEdit () { - // save a copy of what it was before we start editing - old_transaction = this; - } - - SetValue (float amount) { - // some example editing done here - this->value = amount; - } - - Commit () { - LockTable(); - current = QueryTransaction(); - // check ton make sure that what the sql db stores - // is identical to what we have on record as the - // 'original' tansaction. If its not, then someone - // got in there and modified it while we weren't - // looking; so we better report this back toi user. - if (current != old_transaction) Error(); Unlock(); return err; - - // otherwise, all is OK, we have successfully obtained - // the lock and validated the data, so now just update things. - StoreTransaction (new_transaction); - UnlockTable(); - old_transaction = NULL; - } - - Rollback () { - // throw away the edits - this = old_transaction; - old_transaction = NULL; - } - -The GUI should check to make sure that the Commit() routine didn't fail. -If it did fail, then the GUI should pop up a notice to the user stating -that the fundamental underlying data has changed, and that the user -should try doing the edit again. (It might be nice to indicate which -other human user might have changed the data so that they could -coordinate as needed.) - - - -Journal Logs ------------- -The following has been implemented; see TransLog.c for details. - -Transaction logs. The idea was that every time a transaction -was called that would cause a data update, the information that -was updated would be dumped out into an "append only" log file. - -This somewhat parallels what better database systems do to ensure -integrity; Oracle, for instance, has what is called an "archive log." -You have a copy of the database "synced up" as at some point in time, -and can apply "archive logs" to bring that old copy of the database -up to date should something go wrong to trash today's copy. - -In effect, you'd have things like - -=== 97/01/01 04:32:00 === Add Transaction ==== [whatever was added] ==== -=== 97/01/01 04:32:02 === Delete Transaction ==== [whatever was deleted] ==== - -It also is a useful debugging tool, as if you make sure that the -"log_transaction()" call starts by opening the log file, writes, and -then closes and syncs, you know what is going on with the data even if -horrible things happen to the "master" database file. - -Session Mgmt ------------- -To allow the user of the engine some guarantee of atomic updates, -serialized file I/O, related miscellany, the concept of a session -is supported. No file IO can be performed until a session has -been created, and file updates are not guaranteed atomic unless -performed within a SessionBegin/SessionEnd pair. - -Note that (in the current implementation) data can be manipulated -outside of the session; its just that it cannot be saved/made persistent. - -The goal of session management is to ensure that e.g. two users don't end -up editing the same file at the same time, or, e.g. that an automatic -stock-quote update daemon running under a different pid doesn't trash -data being currently edited by the user. - - -Remaining Work Items --------------------- -To find other remaining work items in the code, grep for the string -"hack alert". - - -Ideas for engine enhancements: ------------------------------ - 1) Have (by default) gnucash immediately re-read a file after every - write, and compare the two resulting AccountGroups for equality. - - During development, this is a good idea, as it will help uncover - thinko's more quickly, instead of letting them hide for weeks or months - (as the last one did). Its not a bad self-consistency check when - monkeying with the internals, damn the performance. - - It can be removed/disabled for product versions. - - -This document is dated May 2000 diff --git a/src/engine/engine-helpers.c b/src/engine/engine-helpers.c new file mode 100644 index 0000000000..e63c203c8c --- /dev/null +++ b/src/engine/engine-helpers.c @@ -0,0 +1,1555 @@ +/********************************************************************\ + * engine-helpers.c -- gnucash g-wrap helper functions * + * Copyright (C) 2000 Linas Vepstas * + * Copyright (C) 2001 Linux Developers Group, Inc. * + * * + * 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 2 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#include "config.h" +#include "gnc-engine-util.h" +#include "gnc-engine.h" +#include "gnc-numeric.h" +#include "gnc-book.h" +#include "Backend.h" +#include "Query.h" +#include "date.h" +#include "engine-helpers.h" +#include "glib-helpers.h" +#include "messages.h" + +#include +#include + +#include + +int +gnc_guid_type(GUID guid) +{ + return xaccGUIDType(&guid); +} + +GUID +gnc_account_get_guid(Account *account) { + return *xaccAccountGetGUID(account); +} + +Account * +gnc_account_lookup(GUID guid) { + return xaccAccountLookup(&guid); +} + +GUID +gnc_trans_get_guid(Transaction *trans) { + return *xaccTransGetGUID(trans); +} + +Transaction * +gnc_trans_lookup(GUID guid) { + return xaccTransLookup(&guid); +} + +GUID +gnc_split_get_guid(Split *split) { + return *xaccSplitGetGUID(split); +} + +Split * +gnc_split_lookup(GUID guid) { + return xaccSplitLookup(&guid); +} + +Timespec +gnc_transaction_get_date_posted(Transaction *t) { + Timespec result; + xaccTransGetDatePostedTS(t, &result); + return(result); +} + +Timespec +gnc_transaction_get_date_entered(Transaction *t) { + Timespec result; + xaccTransGetDateEnteredTS(t, &result); + return(result); +} + +Timespec +gnc_split_get_date_reconciled(Split *s) { + Timespec result; + xaccSplitGetDateReconciledTS(s, &result); + return(result); +} + +void +gnc_transaction_set_date_posted(Transaction *t, const Timespec d) { + xaccTransSetDatePostedTS(t, &d); +} + +void +gnc_transaction_set_date_entered(Transaction *t, const Timespec d) { + xaccTransSetDateEnteredTS(t, &d); +} + +void +gnc_transaction_set_date(Transaction *t, Timespec ts) +{ + xaccTransSetDatePostedTS(t, &ts); +} + +char * +gnc_gettext_helper(const char *string) +{ + return strdup(_(string)); +} + +SCM +gnc_timespec2timepair(Timespec t) +{ + SCM secs; + SCM nsecs; + + secs = gnc_gint64_to_scm(t.tv_sec); + nsecs = gh_long2scm(t.tv_nsec); + return(gh_cons(secs, nsecs)); +} + +Timespec +gnc_timepair2timespec(SCM x) +{ + Timespec result = {0,0}; + if (gnc_timepair_p (x)) + { + result.tv_sec = gnc_scm_to_gint64(gh_car(x)); + result.tv_nsec = gh_scm2long(gh_cdr(x)); + } + return(result); +} + +int +gnc_timepair_p(SCM x) +{ + return(gh_pair_p(x) && + gnc_gh_gint64_p(gh_car(x)) && + gnc_gh_gint64_p(gh_cdr(x))); +} + +SCM +gnc_guid2scm(GUID guid) +{ + char string[GUID_ENCODING_LENGTH + 1]; + + if (!guid_to_string_buff(&guid, string)) + return SCM_UNDEFINED; + + return gh_str02scm(string); +} + +GUID +gnc_scm2guid(SCM guid_scm) { + char string[GUID_ENCODING_LENGTH + 1]; + GUID guid; + + gh_get_substr(guid_scm, string, 0, GUID_ENCODING_LENGTH); + string[GUID_ENCODING_LENGTH] = '\0'; + + string_to_guid(string, &guid); + + return guid; +} + +int +gnc_guid_p(SCM guid_scm) { + char string[GUID_ENCODING_LENGTH + 1]; + GUID guid; + + if (!gh_string_p(guid_scm)) + return (0 == 1); + + gh_get_substr(guid_scm, string, 0, GUID_ENCODING_LENGTH); + string[GUID_ENCODING_LENGTH] = '\0'; + + return string_to_guid(string, &guid); +} + + + +/******************************************************************** + * type converters for query API + ********************************************************************/ + +/* The query scm representation is a list of pairs, where the + * car of each pair is one of the following symbols: + * + * Symbol cdr + * 'terms list of OR terms + * 'primary-sort scm rep of sort_type_t + * 'secondary-sort scm rep of sort_type_t + * 'tertiary-sort scm rep of sort_type_t + * 'primary-increasing boolean + * 'secondary-increasing boolean + * 'tertiary-increasing boolean + * 'max-splits integer + * + * Each OR term is a list of AND terms. + * Each AND term is a list of one of the following forms: + * + * ('pd-date pr-type sense-bool use-start-bool start-timepair + * use-end-bool use-end-timepair) + * ('pd-amount pr-type sense-bool amt-match-how amt-match-sign amount) + * ('pd-account pr-type sense-bool acct-match-how list-of-account-guids) + * ('pd-string pr-type sense-bool case-sense-bool use-regexp-bool string) + * ('pd-cleared pr-type sense-bool cleared-field) + * ('pd-balance pr-type sense-bool balance-field) + */ + +static SCM +gnc_gw_enum_val2scm (const char *typestr, int value) +{ + char *func_name; + SCM func; + SCM scm; + + func_name = g_strdup_printf ("gw:enum-%s-val->sym", typestr); + + func = gh_eval_str (func_name); + if (gh_procedure_p (func)) + scm = gh_call2 (func, gh_int2scm (value), gh_bool2scm (FALSE)); + else + scm = SCM_BOOL_F; + + g_free (func_name); + + return scm; +} + +static int +gnc_gw_enum_scm2val (const char *typestr, SCM enum_scm) +{ + char *func_name; + SCM func; + SCM scm; + + func_name = g_strdup_printf ("gw:enum-%s-val->int", typestr); + + func = gh_eval_str (func_name); + if (gh_procedure_p (func)) + scm = gh_call1 (func, enum_scm); + else + scm = gh_int2scm (0); + + g_free (func_name); + + return gh_scm2int (scm); +} + +static SCM +gnc_query_term_type2scm (pd_type_t pd_type) +{ + return gnc_gw_enum_val2scm ("", pd_type); +} + +static pd_type_t +gnc_query_scm2term_type (SCM pd_type_scm) +{ + return gnc_gw_enum_scm2val ("", pd_type_scm); +} + +static SCM +gnc_query_pred_type2scm (pr_type_t pr_type) +{ + return gnc_gw_enum_val2scm ("", pr_type); +} + +static pr_type_t +gnc_query_scm2pred_type (SCM pr_type_scm) +{ + return gnc_gw_enum_scm2val ("", pr_type_scm); +} + +static SCM +gnc_acct_match_how2scm (acct_match_t how) +{ + return gnc_gw_enum_val2scm ("", how); +} + +static acct_match_t +gnc_scm2acct_match_how (SCM how_scm) +{ + return gnc_gw_enum_scm2val ("", how_scm); +} + +static SCM +gnc_amt_match_how2scm (amt_match_t how) +{ + return gnc_gw_enum_val2scm ("", how); +} + +static amt_match_t +gnc_scm2amt_match_how (SCM how_scm) +{ + return gnc_gw_enum_scm2val ("", how_scm); +} + +static SCM +gnc_amt_match_sign2scm (amt_match_sgn_t how) +{ + return gnc_gw_enum_val2scm ("", how); +} + +static amt_match_sgn_t +gnc_scm2amt_match_sign (SCM how_scm) +{ + return gnc_gw_enum_scm2val ("", how_scm); +} + +static SCM +gnc_sort_type2scm (sort_type_t sort_type) +{ + return gnc_gw_enum_val2scm ("", sort_type); +} + +static sort_type_t +gnc_scm2sort_type (SCM sort_type_scm) +{ + return gnc_gw_enum_scm2val ("", sort_type_scm); +} + +static SCM +gnc_bitfield2scm (const char *typestr, int value) +{ + SCM field = SCM_EOL; + int bit = 1; + + while (value) + { + if (value & bit) + { + SCM scm; + + scm = gnc_gw_enum_val2scm (typestr, bit); + if (gh_symbol_p (scm)) + field = gh_cons (scm, field); + } + + value &= ~bit; + bit <<= 1; + } + + return gh_reverse (field); +} + +static int +gnc_scm2bitfield (const char *typestr, SCM field_scm) +{ + int field = 0; + + if (!gh_list_p (field_scm)) + return 0; + + while (!gh_null_p (field_scm)) + { + SCM scm; + int bit; + + scm = gh_car (field_scm); + field_scm = gh_cdr (field_scm); + + bit = gnc_gw_enum_scm2val (typestr, scm); + field |= bit; + } + + return field; +} + +static SCM +gnc_cleared_match_how2scm (cleared_match_t how) +{ + return gnc_bitfield2scm ("", how); +} + +static cleared_match_t +gnc_scm2cleared_match_how (SCM how_scm) +{ + return gnc_scm2bitfield ("", how_scm); +} + +static SCM +gnc_balance_match_how2scm (balance_match_t how) +{ + return gnc_bitfield2scm ("", how); +} + +static balance_match_t +gnc_scm2balance_match_how (SCM how_scm) +{ + return gnc_scm2bitfield ("", how_scm); +} + +static SCM +gnc_acct_guid_glist2scm (GList *account_guids) +{ + SCM guids = SCM_EOL; + GList *node; + + for (node = account_guids; node; node = node->next) + { + GUID *guid = node->data; + + if (guid) + guids = gh_cons (gnc_guid2scm (*guid), guids); + } + + return gh_reverse (guids); +} + +static GList * +gnc_scm2acct_guid_glist (SCM guids_scm) +{ + GList *guids = NULL; + + if (!gh_list_p (guids_scm)) + return NULL; + + while (!gh_null_p (guids_scm)) + { + SCM guid_scm = gh_car (guids_scm); + GUID *guid; + + guid = xaccGUIDMalloc (); + *guid = gnc_scm2guid (guid_scm); + + guids = g_list_prepend (guids, guid); + + guids_scm = gh_cdr (guids_scm); + } + + return g_list_reverse (guids); +} + +static void +acct_guid_glist_free (GList *guids) +{ + GList *node; + + for (node = guids; node; node = node->next) + xaccGUIDFree (node->data); + + g_list_free (guids); +} + +static SCM +gnc_queryterm2scm (QueryTerm *qt) +{ + SCM qt_scm = SCM_EOL; + + qt_scm = gh_cons (gnc_query_term_type2scm (qt->data.type), qt_scm); + qt_scm = gh_cons (gnc_query_pred_type2scm (qt->data.base.term_type), qt_scm); + qt_scm = gh_cons (gh_bool2scm (qt->data.base.sense), qt_scm); + + switch (qt->data.type) + { + case PD_DATE: + qt_scm = gh_cons (gh_bool2scm (qt->data.date.use_start), qt_scm); + qt_scm = gh_cons (gnc_timespec2timepair (qt->data.date.start), qt_scm); + qt_scm = gh_cons (gh_bool2scm (qt->data.date.use_end), qt_scm); + qt_scm = gh_cons (gnc_timespec2timepair (qt->data.date.end), qt_scm); + break; + + case PD_AMOUNT: + qt_scm = gh_cons (gnc_amt_match_how2scm (qt->data.amount.how), qt_scm); + qt_scm = gh_cons (gnc_amt_match_sign2scm (qt->data.amount.amt_sgn), + qt_scm); + qt_scm = gh_cons (gh_double2scm (qt->data.amount.amount), qt_scm); + break; + + case PD_ACCOUNT: + qt_scm = gh_cons (gnc_acct_match_how2scm (qt->data.acct.how), qt_scm); + qt_scm = gh_cons (gnc_acct_guid_glist2scm (qt->data.acct.account_guids), + qt_scm); + break; + + case PD_STRING: + qt_scm = gh_cons (gh_bool2scm (qt->data.str.case_sens), qt_scm); + qt_scm = gh_cons (gh_bool2scm (qt->data.str.use_regexp), qt_scm); + qt_scm = gh_cons (gh_str02scm (qt->data.str.matchstring), qt_scm); + break; + + case PD_CLEARED: + qt_scm = gh_cons (gnc_cleared_match_how2scm (qt->data.cleared.how), + qt_scm); + break; + + case PD_BALANCE: + qt_scm = gh_cons (gnc_balance_match_how2scm (qt->data.balance.how), + qt_scm); + break; + + case PD_GUID: + qt_scm = gh_cons (gnc_guid2scm (qt->data.guid.guid), qt_scm); + break; + + default: + g_warning ("query type %d not supported", qt->data.type); + return SCM_BOOL_F; + } + + return gh_reverse (qt_scm); +} + +static Query * +gnc_scm2query_term_query (SCM query_term_scm) +{ + gboolean ok = FALSE; + pd_type_t pd_type; + pr_type_t pr_type; + gboolean sense; + Query *q; + SCM scm; + + if (!gh_list_p (query_term_scm) || + gh_null_p (query_term_scm)) + return NULL; + + /* pd_type */ + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + pd_type = gnc_query_scm2term_type (scm); + + /* pr_type */ + if (gh_null_p (query_term_scm)) + return NULL; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + pr_type = gnc_query_scm2pred_type (scm); + + /* sense */ + if (gh_null_p (query_term_scm)) + return NULL; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + sense = gh_scm2bool (scm); + + q = xaccMallocQuery (); + + switch (pd_type) + { + case PD_DATE: + { + gboolean use_start; + gboolean use_end; + Timespec start; + Timespec end; + + /* use_start */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + use_start = gh_scm2bool (scm); + + /* start */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + start = gnc_timepair2timespec (scm); + + /* use_end */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + use_end = gh_scm2bool (scm); + + /* end */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + end = gnc_timepair2timespec (scm); + + xaccQueryAddDateMatchTS (q, use_start, start, use_end, end, QUERY_OR); + } + + ok = TRUE; + break; + + case PD_AMOUNT: + { + amt_match_t how; + amt_match_sgn_t amt_sgn; + double amount; + + /* how */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + how = gnc_scm2amt_match_how (scm); + + /* amt_sgn */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + amt_sgn = gnc_scm2amt_match_sign (scm); + + /* amount */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + amount = gh_scm2double (scm); + + switch (pr_type) + { + case PR_AMOUNT: + DxaccQueryAddAmountMatch (q, amount, amt_sgn, how, QUERY_OR); + ok = TRUE; + break; + + case PR_PRICE: + DxaccQueryAddSharePriceMatch (q, amount, how, QUERY_OR); + ok = TRUE; + break; + + case PR_SHRS: + DxaccQueryAddSharesMatch (q, amount, how, QUERY_OR); + ok = TRUE; + break; + + default: + ok = FALSE; + break; + } + } + + break; + + case PD_ACCOUNT: + { + acct_match_t how; + GList *account_guids; + + /* how */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + how = gnc_scm2acct_match_how (scm); + + /* account guids */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + account_guids = gnc_scm2acct_guid_glist (scm); + + xaccQueryAddAccountGUIDMatch (q, account_guids, how, QUERY_OR); + + acct_guid_glist_free (account_guids); + } + + ok = TRUE; + break; + + case PD_STRING: + { + gboolean case_sens; + gboolean use_regexp; + char *matchstring; + + /* case_sens */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + case_sens = gh_scm2bool (scm); + + /* use_regexp */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + use_regexp = gh_scm2bool (scm); + + /* matchstring */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + matchstring = gh_scm2newstr (scm, NULL); + + switch (pr_type) + { + case PR_ACTION: + xaccQueryAddActionMatch (q, matchstring, case_sens, use_regexp, + QUERY_OR); + ok = TRUE; + break; + + case PR_DESC: + xaccQueryAddDescriptionMatch (q, matchstring, case_sens, + use_regexp, QUERY_OR); + ok = TRUE; + break; + + case PR_MEMO: + xaccQueryAddMemoMatch (q, matchstring, case_sens, use_regexp, + QUERY_OR); + ok = TRUE; + break; + + case PR_NUM: + xaccQueryAddNumberMatch (q, matchstring, case_sens, use_regexp, + QUERY_OR); + ok = TRUE; + break; + + default: + ok = FALSE; + break; + } + } + + break; + + case PD_CLEARED: + { + cleared_match_t how; + + /* how */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + how = gnc_scm2cleared_match_how (scm); + + xaccQueryAddClearedMatch (q, how, QUERY_OR); + } + + ok = TRUE; + break; + + case PD_BALANCE: + { + balance_match_t how; + + /* how */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + how = gnc_scm2balance_match_how (scm); + + xaccQueryAddBalanceMatch (q, how, QUERY_OR); + } + + ok = TRUE; + break; + + case PD_GUID: + { + GUID guid; + + /* guid */ + if (gh_null_p (query_term_scm)) + break; + + scm = gh_car (query_term_scm); + query_term_scm = gh_cdr (query_term_scm); + + guid = gnc_scm2guid (scm); + + xaccQueryAddGUIDMatch (q, &guid, QUERY_OR); + } + + ok = TRUE; + break; + + default: + break; + } + + if (ok) + { + Query *out_q; + + if (sense) + out_q = q; + else + { + out_q = xaccQueryInvert (q); + xaccFreeQuery (q); + } + + return out_q; + } + + xaccFreeQuery (q); + return NULL; +} + +static SCM +gnc_query_terms2scm (GList *terms) +{ + SCM or_terms = SCM_EOL; + GList *or_node; + + for (or_node = terms; or_node; or_node = or_node->next) + { + SCM and_terms = SCM_EOL; + GList *and_node; + + for (and_node = or_node->data; and_node; and_node = and_node->next) + { + QueryTerm *qt = and_node->data; + SCM qt_scm; + + qt_scm = gnc_queryterm2scm (qt); + + and_terms = gh_cons (qt_scm, and_terms); + } + + and_terms = gh_reverse (and_terms); + + or_terms = gh_cons (and_terms, or_terms); + } + + return gh_reverse (or_terms); +} + +static Query * +gnc_scm2query_and_terms (SCM and_terms) +{ + Query *q = NULL; + + if (!gh_list_p (and_terms)) + return NULL; + + while (!gh_null_p (and_terms)) + { + SCM term; + + term = gh_car (and_terms); + and_terms = gh_cdr (and_terms); + + if (!q) + q = gnc_scm2query_term_query (term); + else + { + Query *q_and; + Query *q_new; + + q_and = gnc_scm2query_term_query (term); + + if (q_and) + { + q_new = xaccQueryMerge (q, q_and, QUERY_AND); + + if (q_new) + { + xaccFreeQuery (q); + q = q_new; + } + } + } + } + + return q; +} + +static Query * +gnc_scm2query_or_terms (SCM or_terms) +{ + Query *q = NULL; + + if (!gh_list_p (or_terms)) + return NULL; + + q = xaccMallocQuery (); + + while (!gh_null_p (or_terms)) + { + SCM and_terms; + + and_terms = gh_car (or_terms); + or_terms = gh_cdr (or_terms); + + if (!q) + q = gnc_scm2query_and_terms (and_terms); + else + { + Query *q_or; + Query *q_new; + + q_or = gnc_scm2query_and_terms (and_terms); + + if (q_or) + { + q_new = xaccQueryMerge (q, q_or, QUERY_OR); + + if (q_new) + { + xaccFreeQuery (q); + q = q_new; + } + } + } + } + + return q; +} + +SCM +gnc_query2scm (Query *q) +{ + SCM query_scm = SCM_EOL; + SCM pair; + + if (!q) return SCM_BOOL_F; + + /* terms */ + pair = gh_cons (gnc_query_terms2scm (xaccQueryGetTerms (q)), SCM_EOL); + pair = gh_cons (gh_symbol2scm ("terms"), pair); + query_scm = gh_cons (pair, query_scm); + + /* primary sort type */ + pair = gh_cons (gnc_sort_type2scm (xaccQueryGetPrimarySortOrder (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("primary-sort"), pair); + query_scm = gh_cons (pair, query_scm); + + /* secondary sort type */ + pair = gh_cons (gnc_sort_type2scm (xaccQueryGetSecondarySortOrder (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("secondary-sort"), pair); + query_scm = gh_cons (pair, query_scm); + + /* tertiary sort type */ + pair = gh_cons (gnc_sort_type2scm (xaccQueryGetTertiarySortOrder (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("tertiary-sort"), pair); + query_scm = gh_cons (pair, query_scm); + + /* primary sort increasing */ + pair = gh_cons (gh_bool2scm (xaccQueryGetSortPrimaryIncreasing (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("primary-increasing"), pair); + query_scm = gh_cons (pair, query_scm); + + /* secondary sort increasing */ + pair = gh_cons (gh_bool2scm (xaccQueryGetSortSecondaryIncreasing (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("secondary-increasing"), pair); + query_scm = gh_cons (pair, query_scm); + + /* tertiary sort increasing */ + pair = gh_cons (gh_bool2scm (xaccQueryGetSortTertiaryIncreasing (q)), + SCM_EOL); + pair = gh_cons (gh_symbol2scm ("tertiary-increasing"), pair); + query_scm = gh_cons (pair, query_scm); + + /* max splits */ + pair = gh_cons (gh_int2scm (xaccQueryGetMaxSplits (q)), SCM_EOL); + pair = gh_cons (gh_symbol2scm ("max-splits"), pair); + query_scm = gh_cons (pair, query_scm); + + return gh_reverse (query_scm); +} + +Query * +gnc_scm2query (SCM query_scm) +{ + Query *q = NULL; + gboolean ok = TRUE; + sort_type_t primary_sort = BY_STANDARD; + sort_type_t secondary_sort = BY_NONE; + sort_type_t tertiary_sort = BY_NONE; + gboolean primary_increasing = TRUE; + gboolean secondary_increasing = TRUE; + gboolean tertiary_increasing = TRUE; + int max_splits = -1; + + if (!gh_list_p (query_scm)) + return NULL; + + while (!gh_null_p (query_scm)) + { + char *symbol; + SCM sym_scm; + SCM value; + SCM pair; + + pair = gh_car (query_scm); + query_scm = gh_cdr (query_scm); + + if (!gh_pair_p (pair)) + { + ok = FALSE; + break; + } + + sym_scm = gh_car (pair); + value = gh_cadr (pair); + + if (!gh_symbol_p (sym_scm)) + { + ok = FALSE; + break; + } + + symbol = gh_symbol2newstr (sym_scm, NULL); + if (!symbol) + { + ok = FALSE; + break; + } + + if (safe_strcmp ("terms", symbol) == 0) + { + if (q) + xaccFreeQuery (q); + + q = gnc_scm2query_or_terms (value); + if (!q) + { + ok = FALSE; + free (symbol); + break; + } + } + else if (safe_strcmp ("primary-sort", symbol) == 0) + { + if (!gh_symbol_p (value)) + { + ok = FALSE; + free (symbol); + break; + } + + primary_sort = gnc_scm2sort_type (value); + } + else if (safe_strcmp ("secondary-sort", symbol) == 0) + { + if (!gh_symbol_p (value)) + { + ok = FALSE; + free (symbol); + break; + } + + secondary_sort = gnc_scm2sort_type (value); + } + else if (safe_strcmp ("tertiary-sort", symbol) == 0) + { + if (!gh_symbol_p (value)) + { + ok = FALSE; + free (symbol); + break; + } + + tertiary_sort = gnc_scm2sort_type (value); + } + else if (safe_strcmp ("primary-increasing", symbol) == 0) + { + primary_increasing = gh_scm2bool (value); + } + else if (safe_strcmp ("secondary-increasing", symbol) == 0) + { + secondary_increasing = gh_scm2bool (value); + } + else if (safe_strcmp ("tertiary-increasing", symbol) == 0) + { + tertiary_increasing = gh_scm2bool (value); + } + else if (safe_strcmp ("max-splits", symbol) == 0) + { + if (!gh_number_p (value)) + { + ok = FALSE; + free (symbol); + break; + } + + max_splits = gh_scm2int (value); + } + else + { + ok = FALSE; + free (symbol); + break; + } + + free (symbol); + } + + if (ok) + { + xaccQuerySetSortOrder (q, primary_sort, secondary_sort, tertiary_sort); + xaccQuerySetSortIncreasing (q, primary_increasing, secondary_increasing, + tertiary_increasing); + xaccQuerySetMaxSplits (q, max_splits); + + return q; + } + + xaccFreeQuery (q); + return NULL; +} + + + +static int +gnc_scm_traversal_adapter(Transaction *t, void *data) +{ + static SCM trans_type = SCM_BOOL_F; + SCM result; + SCM scm_trans; + SCM thunk = *((SCM *) data); + + if(trans_type == SCM_BOOL_F) { + trans_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(trans_type != SCM_BOOL_F) scm_protect_object(trans_type); + } + + scm_trans = gw_wcp_assimilate_ptr(t, trans_type); + result = gh_call1(thunk, scm_trans); + + return (result != SCM_BOOL_F); +} + +gboolean +gnc_scmGroupStagedTransactionTraversal(AccountGroup *grp, + unsigned int new_marker, + SCM thunk) +{ + return xaccGroupStagedTransactionTraversal(grp, new_marker, + gnc_scm_traversal_adapter, + &thunk); +} + +gboolean +gnc_scmAccountStagedTransactionTraversal(Account *a, + unsigned int new_marker, + SCM thunk) +{ + return xaccAccountStagedTransactionTraversal(a, new_marker, + gnc_scm_traversal_adapter, + &thunk); +} + +SCM +gnc_gint64_to_scm(const gint64 x) +{ +#if GUILE_LONG_LONG_OK + return scm_long_long2num(x); +#else + const gchar negative_p = (x < 0); + const guint64 magnitude = negative_p ? -x : x; + const guint32 lower_half = (guint32) (magnitude & 0xFFFFFFFF); + const guint32 upper_half = (guint32) (magnitude >> 32); + SCM result; + + result = scm_sum(scm_ash(gh_ulong2scm(upper_half), SCM_MAKINUM(32)), + gh_ulong2scm(lower_half)); + + if(negative_p) { + return scm_difference(SCM_INUM0, result); + } else { + return result; + } +#endif +} + +gint64 +gnc_scm_to_gint64(SCM num) +{ +#if GUILE_LONG_LONG_OK + return scm_num2long_long(num, (char *) SCM_ARG1, "gnc_scm_to_gint64"); +#else + static SCM bits00to15_mask = SCM_BOOL_F; + SCM magnitude = scm_abs(num); + SCM bits; + unsigned long c_bits; + long long c_result = 0; + int i; + + /* This doesn't work -- atm (bit-extract 4000 0 32) proves it */ + /* + SCM lower = scm_bit_extract(magnitude, SCM_MAKINUM(0), SCM_MAKINUM(32)); + */ + + if (bits00to15_mask == SCM_BOOL_F) { + bits00to15_mask = gh_ulong2scm(0xFFFF); + scm_protect_object (bits00to15_mask); + } + + /* + * This isn't very complicated (IMHO). We work from the "top" of + * the number downwards. We assume this is no more than a 64-bit + * number, otherwise it will fail right away. Anyways, we keep + * taking the top 16 bits of the number and move it to c_result. + * Then we 'remove' those bits from the original number and continue + * with the next 16 bits down, and so on. -- warlord@mit.edu + * 2001/02/13 + */ + for (i = 48; i >=0; i-= 16) { + bits = scm_ash(magnitude, SCM_MAKINUM(-i)); + c_bits = gh_scm2ulong(scm_logand(bits, bits00to15_mask)); + c_result += ((long long)c_bits << i); + magnitude = scm_difference(magnitude, scm_ash(bits, SCM_MAKINUM(i))); + } + + if(scm_negative_p(num) != SCM_BOOL_F) { + return(- c_result); + } + else { + return(c_result); + } +#endif +} + +int +gnc_gh_gint64_p(SCM num) +{ + static int initialized = 0; + static SCM maxval; + static SCM minval; + + if(!initialized) { + /* to be super safe, we have to build these manually because + though we know that we have gint64's here, we *don't* know how + to portably specify a 64bit constant to the compiler (i.e. like + 0x7FFFFFFFFFFFFFFF). */ + gint64 tmp; + + tmp = 0x7FFFFFFF; + tmp <<= 32; + tmp |= 0xFFFFFFFF; + maxval = gnc_gint64_to_scm(tmp); + + tmp = 0x80000000; + tmp <<= 32; + minval = gnc_gint64_to_scm(tmp); + + scm_protect_object(maxval); + scm_protect_object(minval); + initialized = 1; + } + return((scm_geq_p(num, minval) != SCM_BOOL_F) && + (scm_leq_p(num, maxval) != SCM_BOOL_F)); +} + +gnc_numeric +gnc_scm_to_numeric(SCM gncnum) +{ + static SCM get_num = SCM_BOOL_F; + static SCM get_denom = SCM_BOOL_F; + + if(get_num == SCM_BOOL_F) { + get_num = gh_eval_str("gnc:gnc-numeric-num"); + } + if(get_denom == SCM_BOOL_F) { + get_denom = gh_eval_str("gnc:gnc-numeric-denom"); + } + + return gnc_numeric_create(gnc_scm_to_gint64(gh_call1(get_num, gncnum)), + gnc_scm_to_gint64(gh_call1(get_denom, gncnum))); +} + +SCM +gnc_numeric_to_scm(gnc_numeric arg) +{ + static SCM maker = SCM_BOOL_F; + + if(maker == SCM_BOOL_F) { + maker = gh_eval_str("gnc:make-gnc-numeric"); + } + + return gh_call2(maker, gnc_gint64_to_scm(gnc_numeric_num(arg)), + gnc_gint64_to_scm(gnc_numeric_denom(arg))); +} + +int +gnc_numeric_p(SCM arg) +{ + static SCM type_p = SCM_BOOL_F; + SCM ret = SCM_BOOL_F; + + if(type_p == SCM_BOOL_F) { + type_p = gh_eval_str("gnc:gnc-numeric?"); + } + ret = gh_call1(type_p, arg); + + if(ret == SCM_BOOL_F) { + return FALSE; + } + else { + return TRUE; + } +} +static SCM +gnc_glist_account_ptr_to_scm_internal (GList *account_list, gboolean free_list) +{ + static SCM acct_type = SCM_UNDEFINED; + SCM result; + + if (acct_type == SCM_UNDEFINED) + { + acct_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(acct_type != SCM_UNDEFINED) scm_protect_object(acct_type); + } + + result = gnc_glist_to_scm_list(account_list, acct_type); + + if (free_list) + g_list_free (account_list); + + return result; +} + +/********************************************************************\ + * gnc_account_list_to_scm * + * Turn a list of accounts into an SCM. * + * The list is freed. * + * * + * Args: account_list - list of accounts to SCMify * + * Return: SCM list of accounts * +\********************************************************************/ +SCM +gnc_glist_account_ptr_to_scm (GList *account_list) +{ + return gnc_glist_account_ptr_to_scm_internal (account_list, TRUE); +} + +/********************************************************************\ + * gnc_account_list_to_scm_no_free * + * Turn a list of accounts into an SCM. * + * The list is not freed. * + * * + * Args: account_list - list of accounts to SCMify * + * Return: SCM list of accounts * +\********************************************************************/ +SCM +gnc_glist_account_ptr_to_scm_no_free (GList *account_list) +{ + return gnc_glist_account_ptr_to_scm_internal (account_list, FALSE); +} + +/********************************************************************\ + * gnc_scm_to_account_list * + * Turn an SCM into a g_malloc's account list * + * * + * Args: scm_list - SCM list of accounts * + * Return: GList of accounts * +\********************************************************************/ +GList * +gnc_scm_to_glist_account_ptr(SCM scm_list) +{ + return gnc_scm_list_to_glist(scm_list); +} + +/******************************************************************** + * gnc_glist_account_ptr_p + ********************************************************************/ + +int +gnc_glist_account_ptr_p(SCM list) +{ + return gh_list_p(list); +} + +/******************************************************************** + * gnc_scm_to_commodity + ********************************************************************/ +gnc_commodity * +gnc_scm_to_commodity(SCM scm) +{ + static SCM commodity_type = SCM_UNDEFINED; + + if(commodity_type == SCM_UNDEFINED) { + commodity_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(commodity_type != SCM_UNDEFINED) scm_protect_object(commodity_type); + } + + if(!gw_wcp_is_of_type_p(commodity_type, scm)) { + return NULL; + } + + return gw_wcp_get_ptr(scm); +} + + +/******************************************************************** + * gnc_commodity_to_scm + ********************************************************************/ +SCM +gnc_commodity_to_scm (const gnc_commodity *commodity) +{ + static SCM commodity_type = SCM_UNDEFINED; + + if(commodity == NULL) return SCM_BOOL_F; + + if(commodity_type == SCM_UNDEFINED) { + commodity_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(commodity_type != SCM_UNDEFINED) scm_protect_object(commodity_type); + } + + return gw_wcp_assimilate_ptr((void *) commodity, commodity_type); +} + +/******************************************************************** + * gnc_book_to_scm + ********************************************************************/ +SCM +gnc_book_to_scm (GNCBook *book) +{ + static SCM book_type = SCM_UNDEFINED; + + if (!book) + return SCM_BOOL_F; + + if (book_type == SCM_UNDEFINED) + { + book_type = gh_eval_str (""); + + /* don't really need this - types are bound globally anyway. */ + if (book_type != SCM_UNDEFINED) + scm_protect_object (book_type); + } + + return gw_wcp_assimilate_ptr ((void *) book, book_type); +} + +/******************************************************************** + * gnc_glist_commodity_ptr_to_scm + ********************************************************************/ +SCM +gnc_glist_commodity_ptr_to_scm(GList * l) +{ + static SCM commodity_type = SCM_UNDEFINED; + SCM result_list; + + if(commodity_type == SCM_UNDEFINED) { + commodity_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(commodity_type != SCM_UNDEFINED) scm_protect_object(commodity_type); + } + result_list = gnc_glist_to_scm_list(l, commodity_type); + g_list_free(l); + return result_list; +} + +/******************************************************************** + * gnc_scm_to_glist_commodity_ptr + ********************************************************************/ + +GList * +gnc_scm_to_glist_commodity_ptr(SCM scm_list) +{ + return gnc_scm_list_to_glist(scm_list); +} + +/******************************************************************** + * gnc_glist_commodity_ptr_p + ********************************************************************/ + +int +gnc_glist_commodity_ptr_p(SCM list) +{ + return gh_list_p(list); +} + +/******************************************************************** + * gnc_glist_price_ptr_to_scm + ********************************************************************/ +SCM +gnc_glist_price_ptr_to_scm(GList * l) +{ + static SCM price_type = SCM_UNDEFINED; + SCM result_list; + + if(price_type == SCM_UNDEFINED) { + price_type = gh_eval_str(""); + /* don't really need this - types are bound globally anyway. */ + if(price_type != SCM_UNDEFINED) scm_protect_object(price_type); + } + result_list = gnc_glist_to_scm_list(l, price_type); + g_list_free(l); + return result_list; +} + +/******************************************************************** + * gnc_scm_to_glist_price_ptr + ********************************************************************/ + +GList * +gnc_scm_to_glist_price_ptr(SCM scm_list) +{ + return gnc_scm_list_to_glist(scm_list); +} + +/******************************************************************** + * gnc_glist_price_ptr_p + ********************************************************************/ + +int +gnc_glist_price_ptr_p(SCM list) +{ + return gh_list_p(list); +} diff --git a/src/engine/engine-helpers.h b/src/engine/engine-helpers.h new file mode 100644 index 0000000000..0431cff37b --- /dev/null +++ b/src/engine/engine-helpers.h @@ -0,0 +1,113 @@ +/********************************************************************\ + * engine-helpers.h -- gnucash g-wrap helper functions * + * Copyright (C) 2000 Linus Vepstas * + * Copyright (C) 2001 Linux Developers Group, Inc. * + * * + * 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 2 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#ifndef ENGINE_HELPERS_H +#define ENGINE_HELPERS_H + +#include +#include +#include +#include +#include +#include +#include +#include + +int gnc_guid_type(GUID guid); +GUID gnc_account_get_guid(Account *account); +Account * gnc_account_lookup(GUID guid); + +GUID gnc_trans_get_guid(Transaction *trans); +Transaction * gnc_trans_lookup(GUID guid); + +GUID gnc_split_get_guid(Split *split); +Split * gnc_split_lookup(GUID guid); + +Timespec gnc_transaction_get_date_posted(Transaction *t); +Timespec gnc_transaction_get_date_entered(Transaction *t); + +Timespec gnc_split_get_date_reconciled(Split *s); + +void gnc_transaction_set_date_posted(Transaction *t, const Timespec d); +void gnc_transaction_set_date_entered(Transaction *t, const Timespec d); + +void gnc_transaction_set_date(Transaction *t, Timespec ts); + +char * gnc_gettext_helper(const char *string); + + +/* Helpers for various types */ + +SCM gnc_timespec2timepair(Timespec t); +Timespec gnc_timepair2timespec(SCM x); +int gnc_timepair_p(SCM x); + +SCM gnc_guid2scm(GUID guid); +GUID gnc_scm2guid(SCM guid_scm); +int gnc_guid_p(SCM guid_scm); + +/* These two functions convert a query object into a scheme + * representation of the query and vice-versa. They do not + * simply convert a query pointer to a g-wrapped query pointer! */ +SCM gnc_query2scm (Query * q); +Query * gnc_scm2query (SCM query_scm); + +/* See Group.h for info about traversals. */ + +gboolean gnc_scmGroupStagedTransactionTraversal(AccountGroup *grp, + unsigned int stage, + SCM thunk); + +gboolean gnc_scmAccountStagedTransactionTraversal(Account *a, + unsigned int stage, + SCM thunk); +SCM gnc_gint64_to_scm(const gint64 x); +gint64 gnc_scm_to_gint64(SCM num); +int gnc_gh_gint64_p(SCM num); + +SCM gnc_numeric_to_scm(gnc_numeric arg); +gnc_numeric gnc_scm_to_numeric(SCM arg); +int gnc_numeric_p(SCM arg); +gnc_commodity * gnc_scm_to_commodity(SCM scm); +SCM gnc_commodity_to_scm (const gnc_commodity *commodity); +SCM gnc_book_to_scm (GNCBook *book); + +/* The GList is freed */ +SCM gnc_glist_account_ptr_to_scm(GList *account_list); +/* The GList is not freed */ +SCM gnc_glist_account_ptr_to_scm_no_free (GList *account_list); +GList * gnc_scm_to_glist_account_ptr(SCM scm_list); +int gnc_glist_account_ptr_p(SCM scm_list); + +/* The GList is freed */ +SCM gnc_glist_commodity_ptr_to_scm(GList * list); +GList * gnc_scm_to_glist_commodity_ptr(SCM list); +int gnc_glist_commodity_ptr_p(SCM list); + +/* The GList is freed */ +SCM gnc_glist_price_ptr_to_scm(GList * list); +GList * gnc_scm_to_glist_price_ptr(SCM list); +int gnc_glist_price_ptr_p(SCM list); + +#endif diff --git a/src/scm/engine-init.scm b/src/engine/engine-init.scm similarity index 100% rename from src/scm/engine-init.scm rename to src/engine/engine-init.scm diff --git a/src/scm/engine-interface.scm b/src/engine/engine-interface.scm similarity index 100% rename from src/scm/engine-interface.scm rename to src/engine/engine-interface.scm diff --git a/src/scm/engine-utilities.scm b/src/engine/engine-utilities.scm similarity index 98% rename from src/scm/engine-utilities.scm rename to src/engine/engine-utilities.scm index f1fce95449..ed40a7fb0a 100644 --- a/src/scm/engine-utilities.scm +++ b/src/engine/engine-utilities.scm @@ -21,8 +21,6 @@ ;; Copyright 2000 Rob Browning -(gnc:support "engine-utilities.scm") - (define (gnc:url->loaded-book url ignore-lock? create-if-needed?) ;; Return a representing the data stored at the given ;; url or #f on failure -- this should later be changed to returning diff --git a/src/engine/engine.scm b/src/engine/engine.scm new file mode 100644 index 0000000000..00a0f6727f --- /dev/null +++ b/src/engine/engine.scm @@ -0,0 +1,100 @@ +(define-module (gnucash engine)) +(use-modules (g-wrapped gw-engine)) + +(load-from-path "gnc-numeric.scm") +(load-from-path "commodity-table.scm") +(load-from-path "engine-interface.scm") +(load-from-path "engine-utilities.scm") + +(export GNC-RND-FLOOR) +(export GNC-RND-CEIL) +(export GNC-RND-TRUNC) +(export GNC-RND-PROMOTE) +(export GNC-RND-ROUND-HALF-DOWN) +(export GNC-RND-ROUND-HALF-UP) +(export GNC-RND-ROUND) +(export GNC-RND-NEVER) +(export GNC-DENOM-AUTO) +(export GNC-DENOM-REDUCE) +(export GNC-DENOM-FIXED) +(export GNC-DENOM-LCD) +(export GNC-DENOM-SIGFIG) +(export GNC-DENOM-SIGFIGS) +(export GNC-ERROR-OK) +(export GNC-ERROR-ARG) +(export GNC-ERROR-OVERFLOW) +(export GNC-ERROR-DENOM-DIFF) +(export GNC-ERROR-REMAINDER) +(export ) +(export gnc:gnc-numeric?) +(export gnc:make-gnc-numeric) +(export gnc:gnc-numeric-denom) +(export gnc:gnc-numeric-num) +(export gnc:gnc-numeric-denom-reciprocal) +(export ) +(export gnc:gnc-monetary?) +(export gnc:make-gnc-monetary) +(export gnc:gnc-monetary-commodity) +(export gnc:gnc-monetary-amount) +(export gnc:monetary-neg) + +(export GNC_COMMODITY_NS_ISO) +(export GNC_COMMODITY_NS_NASDAQ) +(export GNC_COMMODITY_NS_NYSE) +(export GNC_COMMODITY_NS_AMEX) +(export GNC_COMMODITY_NS_EUREX) +(export GNC_COMMODITY_NS_MUTUAL) + + +(export gnc:setup-default-namespaces) +(export gnc:load-iso-4217-currencies) + +(export gnc:split-structure) +(export gnc:make-split-scm) +(export gnc:split-scm?) +(export gnc:split-scm-get-split-guid) +(export gnc:split-scm-get-account-guid) +(export gnc:split-scm-get-transaction-guid) +(export gnc:split-scm-get-memo) +(export gnc:split-scm-get-action) +(export gnc:split-scm-get-reconcile-state) +(export gnc:split-scm-get-reconciled-date) +(export gnc:split-scm-get-amount) +(export gnc:split-scm-get-value) +(export gnc:split-scm-set-split-guid) +(export gnc:split-scm-set-account-guid) +(export gnc:split-scm-set-transaction-guid) +(export gnc:split-scm-set-memo) +(export gnc:split-scm-set-action) +(export gnc:split-scm-set-reconcile-state) +(export gnc:split-scm-set-reconciled-date) +(export gnc:split-scm-set-amount) +(export gnc:split-scm-set-value) +(export gnc:split->split-scm) +(export gnc:split-scm-onto-split) +(export gnc:transaction-structure) +(export gnc:make-transaction-scm) +(export gnc:transaction-scm?) +(export gnc:transaction-scm-get-transaction-guid) +(export gnc:transaction-scm-get-currency) +(export gnc:transaction-scm-get-date-entered) +(export gnc:transaction-scm-get-date-posted) +(export gnc:transaction-scm-get-num) +(export gnc:transaction-scm-get-description) +(export gnc:transaction-scm-get-notes) +(export gnc:transaction-scm-get-split-scms) +(export gnc:transaction-scm-get-split-scm) +(export gnc:transaction-scm-get-other-split-scm) +(export gnc:transaction-scm-set-transaction-guid) +(export gnc:transaction-scm-set-currency) +(export gnc:transaction-scm-set-date-entered) +(export gnc:transaction-scm-set-date-posted) +(export gnc:transaction-scm-set-num) +(export gnc:transaction-scm-set-description) +(export gnc:transaction-scm-set-notes) +(export gnc:transaction-scm-set-split-scms) +(export gnc:transaction-scm-append-split-scm) +(export gnc:transaction->transaction-scm) +(export trans-splits) +(export gnc:transaction-scm-onto-transaction) + diff --git a/src/engine/.cvsignore b/src/engine/engine/.cvsignore similarity index 100% rename from src/engine/.cvsignore rename to src/engine/engine/.cvsignore diff --git a/src/engine/extensions.txt b/src/engine/extensions.txt deleted file mode 100644 index 652bab01b9..0000000000 --- a/src/engine/extensions.txt +++ /dev/null @@ -1,76 +0,0 @@ - -Proposed Extensions -------------------- -The following are proposals for various, as-yet-unimplemented -enhancements. The goal of this document is to understand some -of the changes that will come soon to the interfaces. - -Accounting Periods ------------------- -Acconting periods are implemented by creating an object that -describes the accounting period, and then assigning every -transaction to at least one period. - -typedef struct _accountingPeriod { - GUID guid; // id - char *name; // user-selectable name - int kind; // enum {none, week, month, quarter, year } - Timespec * start_date; // - Timespec * end_date; - AccountGroup *topgrp; // chart of accounts for this period. -} AccountingPeriod; - -The Transaction struct has to be extended with a period guid. -Every transaction can belong to at most one accounting period. - -In addition, each chart of accounts needs to be extended with -an accounting period as well. This allows 'old' accounts to be deleted -from 'open books', without having to delete that same account from old -closed books. Basically, a new chart of accounts needs to be written -out/read from the engine for each new accounting period. - - -The xaccPeriodClose() subroutine performs the following: --- crawl over all transactions and mark them as being part of this - accounting period (actually, new transactions should by default be - getting put into the currently open period...) --- find the equity account (what if there is more than one equity account - ?? what if equity has sub-accounts ?? ) --- transfer all income/expense to equity (shouldn't the equity account - match the income/expense heirarchy?) --- return a new account group with new opening balances ... - - - -Changes to Transaction Structure --------------------------------- -Add an accounting period guid (see above). - -Changes to Journal Entry (Split) Structure ------------------------------------------- -Voucher Reference ------------------ -Add a char * voucher; This is a generic id string that somehow -identifies the piece of paper/electronic document(s) that indicate -where/how to find the paper trial for this entry. This list of id's -should probably be a list of key-value pairs, where the keys & values -can be completely configured by the user, and hold the needed data -that the user wants to store. For the SQL backend, this is a key -to a user-definable table. - -==================================================================== - -Additional Banking Info - -BankId -- routing & transit number (US) or Bankleitzan (DE) or Banque (FR) -BranchID -- Agence (FR), blank for other countries - -AcctKey -- Cle (FR), blank in others - - -Account type enumerants: -bank account types: - checking, savings, moneymarket, creditline, cma (cash amangement account) - - - diff --git a/src/engine/glib-helpers.c b/src/engine/glib-helpers.c new file mode 100644 index 0000000000..31ea47e59d --- /dev/null +++ b/src/engine/glib-helpers.c @@ -0,0 +1,165 @@ +/********************************************************************\ + * gnc-helpers.c -- gnucash g-wrap helper functions * + * Copyright (C) 2000 Linas Vepstas * + * * + * 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 2 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +#include "config.h" +#include "messages.h" + +#include +#include +#include + +#include + +#include "glib-helpers.h" + + +/* These will eventually go into (g-wrapped glib). */ + +static SCM +glist_to_scm_list_helper(GList *glist, SCM wct) +{ + SCM list = SCM_EOL; + GList *node; + + for (node = glist; node; node = node->next) + list = gh_cons (gw_wcp_assimilate_ptr(node->data, wct), list); + + return gh_reverse (list); +} + +SCM +gnc_glist_to_scm_list(GList *glist, SCM wct) +{ + SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_to_scm_list"); + return(glist_to_scm_list_helper(glist, wct)); +} + +GList* +gnc_scm_list_to_glist(SCM rest) +{ + GList *result = NULL; + SCM scm_item; + + SCM_ASSERT(gh_list_p(rest), rest, SCM_ARG1, "gnc_scm_list_to_glist"); + + while(!gh_null_p(rest)) + { + void *item; + + scm_item = gh_car(rest); + rest = gh_cdr(rest); + + /* fixes a bug in g-wrap */ + if (scm_item == SCM_BOOL_F) + { + result = g_list_prepend(result, NULL); + continue; + } + + if (!gw_wcp_p(scm_item)) + scm_misc_error("gnc_scm_list_to_glist", + "Item in list not a gw:wcp.", scm_item); + + item = gw_wcp_get_ptr(scm_item); + result = g_list_prepend(result, item); + } + + return g_list_reverse(result); +} + +static SCM +glist_map_helper(GList *glist, SCM wct, SCM thunk) +{ + SCM list = SCM_EOL; + GList *node; + + for (node = glist; node; node = node->next) + list = gh_cons (gh_call1(thunk, gw_wcp_assimilate_ptr(node->data, wct)), + list); + + return gh_reverse (list); +} + +SCM +gnc_glist_scm_map(SCM wct, SCM thunk, GList* glist) +{ + SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map"); + SCM_ASSERT(gh_procedure_p(thunk), thunk, SCM_ARG2, "gnc_glist_scm_map"); + return(glist_map_helper(glist, wct, thunk)); +} + +void +gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist) +{ + GList *lp; + SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map"); + SCM_ASSERT(gh_procedure_p(thunk), thunk, SCM_ARG2, "gnc_glist_scm_for_each"); + for(lp = glist; lp; lp = lp->next) { + gh_call1(thunk, gw_wcp_assimilate_ptr(lp->data, wct)); + } +} + +/******************************************************************** + * gnc_glist_string_to_scm + ********************************************************************/ +SCM +gnc_glist_string_to_scm(GList *glist) +{ + SCM list = SCM_EOL; + GList *node; + + for (node = glist; node; node = node->next) + list = gh_cons (gh_str02scm(node->data), list); + + return gh_reverse (list); +} + + + + +/******************************************************************** + * gnc_scm_to_glist_string + ********************************************************************/ + +GList * +gnc_scm_to_glist_string(SCM list) +{ + GList *glist = NULL; + + while (!gh_null_p (list)) + { + glist = g_list_prepend (glist, gh_scm2newstr(gh_car(list), NULL)); + list = gh_cdr (list); + } + + return g_list_reverse (glist); +} + +/******************************************************************** + * gnc_glist_string_p + ********************************************************************/ + +int +gnc_glist_string_p(SCM list) { + return gh_list_p(list); +} diff --git a/src/engine/gnc-common.h b/src/engine/glib-helpers.h similarity index 72% rename from src/engine/gnc-common.h rename to src/engine/glib-helpers.h index d4469eaf45..610b73f2b7 100644 --- a/src/engine/gnc-common.h +++ b/src/engine/glib-helpers.h @@ -1,7 +1,6 @@ /********************************************************************\ - * gnc-common.h -- define platform independent items * - * * - * Copyright (C) 1999, 2000 Rob Browning * + * glib-helpers.h -- gnucash g-wrap helper functions * + * Copyright (C) 2000 Linas Vepstas * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -22,10 +21,22 @@ * * \********************************************************************/ -#ifndef GNC_COMMON_H -#define GNC_COMMON_H +#ifndef GLIB_HELPERS_H +#define GLIB_HELPERS_H -#include "config.h" +#include #include +SCM gnc_glist_to_scm_list(GList *glist, SCM wct); +GList* gnc_scm_list_to_glist(SCM wcp_list); + +SCM gnc_glist_scm_map(SCM wct, SCM thunk, GList *glist); +void gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist); + +SCM gnc_glist_string_to_scm(GList * list); +GList * gnc_scm_to_glist_string(SCM list); +int gnc_glist_string_p(SCM list); + + + #endif diff --git a/src/engine/gnc-associate-account.c b/src/engine/gnc-associate-account.c deleted file mode 100644 index d091e2eef3..0000000000 --- a/src/engine/gnc-associate-account.c +++ /dev/null @@ -1,491 +0,0 @@ -/********************************************************************\ - * gnc-associate-account.h : api for associating income and * - * expense accounts with stock/mutual fund accounts, for tracking * - * dividends, brokerage, and other stock-related expenses and * - * income so that they can be reported * - * Copyright 2000 Gnumatic Incorporated * - * Written by Robert Merkel * - * * - * WARNING WARNING WARNING: THIS STUFF IS TOTALLY UNTESTED AND * - * IS ONLY IN CVS FOR SAFEKEEPING * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#include "config.h" - -#include "gnc-associate-account.h" -#include "gnc-engine-util.h" - -static short module = MOD_ENGINE; - -/* Maps GNCTrackingIncomeCategory to string keys. If this enum - changes, update */ - -static char * income_to_key[] = {"income-miscellaneous", - "income-interest", - "income-dividend" - "income-long-term-capital-gain", - "income-short-term-capital-gain"}; - -/* Maps GNCTrackingExpenseCategory to string keys. If this enum - changes, update */ - -static char * expense_to_key[] = {"expense-miscellaneous", - "expense-commission"}; - -static kvp_frame * -get_assoc_acc_frame(kvp_frame *account_frame) -{ - kvp_frame *assoc_acc_frame; - kvp_value *assoc_acc_frame_kvpvalue = - kvp_frame_get_slot(account_frame, "associated-accounts"); - - assoc_acc_frame = kvp_value_get_frame(assoc_acc_frame_kvpvalue); - if(!assoc_acc_frame) - { - assoc_acc_frame = kvp_frame_new(); - assoc_acc_frame_kvpvalue = kvp_value_new_frame(assoc_acc_frame); - kvp_frame_set_slot(account_frame, "associated-accounts", - assoc_acc_frame_kvpvalue); - } - - return assoc_acc_frame; -} - -static void -back_associate_expense_accounts(Account *stock_account, - GList *accounts, - GNCTrackingExpenseCategory category) -{ - kvp_frame *acc_frame; - kvp_value *val, *stock_acc_guid_kvpval, *stock_acc_category_kvpval; - const GUID *stock_acc_guid; - const GUID *existing_acc_guid; - - stock_acc_guid = xaccAccountGetGUID(stock_account); - stock_acc_guid_kvpval = kvp_value_new_guid(stock_acc_guid); - - stock_acc_category_kvpval = kvp_value_new_string(expense_to_key[category]); - - for(; accounts; accounts = g_list_next(accounts)) - { - acc_frame = xaccAccountGetSlots(accounts->data); - g_return_if_fail(val = kvp_frame_get_slot(acc_frame, - "associated-stock-account")); - g_return_if_fail(kvp_value_get_type(val) == KVP_TYPE_GUID); - existing_acc_guid = kvp_value_get_guid(val); - - g_return_if_fail(xaccGUIDType(existing_acc_guid) == GNC_ID_NONE); - - kvp_frame_set_slot_nc(acc_frame, "associated-stock-account", - stock_acc_guid_kvpval); - - kvp_frame_set_slot_nc(acc_frame, "associated-stock-account-category", - stock_acc_category_kvpval); - } - - return; -} - -static void -back_associate_income_accounts(Account *stock_account, - GList *accounts, - GNCTrackingIncomeCategory category) -{ - kvp_frame *acc_frame; - kvp_value *val, *stock_acc_guid_kvpval, *stock_acc_category_kvpval; - const GUID *stock_acc_guid; - const GUID *existing_acc_guid; - - stock_acc_guid = xaccAccountGetGUID(stock_account); - stock_acc_guid_kvpval = kvp_value_new_guid(stock_acc_guid); - - stock_acc_category_kvpval = kvp_value_new_string(income_to_key[category]); - - for(; accounts; accounts = g_list_next(accounts)) - { - acc_frame = xaccAccountGetSlots(accounts->data); - g_return_if_fail(val = kvp_frame_get_slot(acc_frame, - "associated-stock-account")); - g_return_if_fail(kvp_value_get_type(val) == KVP_TYPE_GUID); - existing_acc_guid = kvp_value_get_guid(val); - - g_return_if_fail(xaccGUIDType(existing_acc_guid) == GNC_ID_NONE); - - kvp_frame_set_slot_nc(acc_frame, "associated-stock-account", - stock_acc_guid_kvpval); - kvp_frame_set_slot_nc(acc_frame, "associated-stock-account-category", - stock_acc_category_kvpval); - } - - return; -} - -static kvp_value * -make_kvpd_on_list(GList *account_list) -{ - GList *iter; - kvp_value *retval; - kvp_value *guid_kvp; - GList *kvp_acc_list = NULL; - const GUID *acc_id; - - for(iter = account_list; iter; iter = g_list_next(iter)) - { - GNCAccountType type; - Account *current_account; - - current_account = iter->data; - type = xaccAccountGetType(current_account); - g_return_val_if_fail(type == INCOME || type == EXPENSE, NULL); - - acc_id = xaccAccountGetGUID(current_account); - guid_kvp = kvp_value_new_guid(acc_id); - kvp_acc_list = g_list_prepend(kvp_acc_list, guid_kvp); - } - - kvp_acc_list = g_list_reverse(kvp_acc_list); - - retval = kvp_value_new_glist_nc(kvp_acc_list); - return retval; -} - -static GList * -de_kvp_account_list(kvp_value *kvpd_list) -{ - GList *guid_account_list = kvp_value_get_glist(kvpd_list); - if (guid_account_list) - { - GList *expense_acc_list= NULL; - for(; guid_account_list; guid_account_list=g_list_next(guid_account_list)) - { - g_list_prepend(expense_acc_list, - xaccAccountLookup(guid_account_list->data)); - } - - expense_acc_list = g_list_reverse(expense_acc_list); - return expense_acc_list; - } - else - { - return NULL; - } -} - -/*********************************************************************\ - * gnc_tracking_associate_income_accounts * - * associate a list of income accounts with a stock account * - * * - * NOTE: Please disassociate all the accounts in account_list * - * using gnc_tracking_dissociate_accounts if necessary, BEFORE * - * calling this function * - * * - * Args: stock_account - the stock account * - * category - the type of association * - * account_list - a GList of Account *'s of the accounts * - * to associate with the stock account * - * * - * Returns : void * -\*********************************************************************/ - -void -gnc_tracking_associate_income_accounts(Account *stock_account, - GNCTrackingIncomeCategory category, - GList *account_list) -{ - kvp_frame *account_frame, *inc_account_frame; - kvp_value *kvpd_on_account_list; - GNCAccountType type; - - g_return_if_fail(stock_account); - type = xaccAccountGetType(stock_account); - g_return_if_fail(type == STOCK || type == MUTUAL); - account_frame = xaccAccountGetSlots(stock_account); - g_return_if_fail(account_frame); - g_return_if_fail(category >= 0); - g_return_if_fail(category < GNC_TR_INC_N_CATEGORIES); - - inc_account_frame = get_assoc_acc_frame(account_frame); - kvpd_on_account_list = make_kvpd_on_list(account_list); - - back_associate_income_accounts(stock_account, account_list, category); - - kvp_frame_set_slot_nc(inc_account_frame, - income_to_key[category], - kvpd_on_account_list); -} - -/*********************************************************************\ - * gnc_tracking_associate_expense_accounts * - * associate a list of expense accounts with a stock account * - * * - * NOTE: Please disassociate all the accounts in account_list * - * using gnc_tracking_dissociate_accounts if necessary, BEFORE * - * calling this function * - * * - * Args: stock_account - the stock account * - * category - the type of association * - * account_list - a GList of Account *'s of the accounts * - * to associate with the stock account * - * * - * Returns : void * -\*********************************************************************/ -void -gnc_tracking_asssociate_expense_account(Account *stock_account, - GNCTrackingExpenseCategory category, - GList *account_list) -{ - kvp_frame *account_frame, *expense_acc_frame; - kvp_value *kvpd_on_account_list; - GNCAccountType type; - - g_return_if_fail(stock_account); - type = xaccAccountGetType(stock_account); - g_return_if_fail(type == STOCK || type == MUTUAL); - account_frame = xaccAccountGetSlots(stock_account); - g_return_if_fail(account_frame); - g_return_if_fail(category >= 0); - g_return_if_fail(category < GNC_TR_EXP_N_CATEGORIES); - - expense_acc_frame = get_assoc_acc_frame(account_frame); - kvpd_on_account_list = make_kvpd_on_list(account_list); - - back_associate_expense_accounts(stock_account, account_list, category); - - kvp_frame_set_slot_nc(expense_acc_frame, - expense_to_key[category], - kvpd_on_account_list); -} - -/*********************************************************************\ - * gnc_tracking_find_expense_accounts * - * find out which accounts are associated with a particular * - * account in a particular way * - * * - * * - * Args: stock_account - the stock account * - * category - the type of association * - * * - * Returns : A GList of Account *'s listing the accounts * -\*********************************************************************/ - -GList * -gnc_tracking_find_expense_accounts(Account *stock_account, - GNCTrackingExpenseCategory category) -{ - - GNCAccountType type; - kvp_frame *account_frame, *expense_acc_frame; - kvp_value *kvpd_on_account_list; - - type = xaccAccountGetType(stock_account); - g_return_val_if_fail(category >= 0 && category < GNC_TR_EXP_N_CATEGORIES, - NULL); - g_return_val_if_fail(type == STOCK || type == MUTUAL, NULL); - - account_frame = xaccAccountGetSlots(stock_account); - g_return_val_if_fail(account_frame, NULL); - - expense_acc_frame = get_assoc_acc_frame(account_frame); - kvpd_on_account_list = kvp_frame_get_slot(account_frame, - expense_to_key[category]); - - return de_kvp_account_list(kvpd_on_account_list); -} - -/*********************************************************************\ - * gnc_tracking_find_income_accounts * - * find out which accounts are associated with a particular * - * account in a particular way * - * * - * * - * Args: stock_account - the stock account * - * category - the type of association * - * * - * Returns : A GList of Account *'s listing the accounts * -\*********************************************************************/ -GList * -gnc_tracking_find_income_accounts(Account *stock_account, - GNCTrackingIncomeCategory category) -{ - GNCAccountType type; - kvp_frame *account_frame, *income_acc_frame; - kvp_value *kvpd_on_account_list; - - type = xaccAccountGetType(stock_account); - g_return_val_if_fail(category >= 0 && category < GNC_TR_INC_N_CATEGORIES, - NULL); - g_return_val_if_fail(type == STOCK || type == MUTUAL, NULL); - - account_frame = xaccAccountGetSlots(stock_account); - g_return_val_if_fail(account_frame, NULL); - - income_acc_frame = get_assoc_acc_frame(account_frame); - kvpd_on_account_list = kvp_frame_get_slot(income_acc_frame, - income_to_key[category]); - - return de_kvp_account_list(kvpd_on_account_list); -} - -/*********************************************************************\ - * gnc_tracking_find_all_expense_accounts * - * find all expense accounts associated with a stock account * - * * - * Args: stock_account - the stock account * - * * - * Returns : A GList of Account *'s listing the accounts * -\*********************************************************************/ - -GList * -gnc_tracking_find_all_expense_accounts(Account *stock_account) -{ - GList *complete_list=NULL; - int i; - - for(i = 0; i < GNC_TR_EXP_N_CATEGORIES; i++) - { - complete_list = - g_list_concat(complete_list, - gnc_tracking_find_expense_accounts(stock_account, i)); - } - - return complete_list; -} - -/*********************************************************************\ - * gnc_tracking_find_all_income_accounts * - * find all income accounts associated with a stock account * - * * - * Args: stock_account - the stock account * - * * - * Returns : A GList of Account *'s listing the accounts * -\*********************************************************************/ - -GList * -gnc_tracking_find_all_income_accounts(Account *stock_account) -{ - GList *complete_list= NULL; - int i; - - for(i = 0; i < GNC_TR_EXP_N_CATEGORIES; i++) - { - g_list_concat(complete_list, - gnc_tracking_find_expense_accounts(stock_account, - i)); - } - return complete_list; -} - -/*********************************************************************\ - * gnc_tracking_find_stock_account * - * find the stock account associated with this expense/income * - * account. If there is no association, return NULL * - * * - * Args: inc_or_expense_acc - the expense/income account * - * * - * * - * Returns : The associated stock account * -\*********************************************************************/ - -Account * -gnc_tracking_find_stock_account(Account *inc_or_expense_acc) -{ - return NULL; -} - -/*********************************************************************\ - * gnc_tracking_dissociate_account * - * remove any association between this income/expense account * - * and any stock account it is presently associated with * - * account. * - * * - * Args: inc_or_expense_acc - the expense/income account * - * * - * * - * Returns : void * -\*********************************************************************/ - -void -gnc_tracking_dissociate_account(Account *inc_or_expense_account) -{ - GNCAccountType type; - kvp_frame *stock_account_kvpframe, *assoc_acc_kvpframe; - kvp_frame *current_account_kvpframe; - kvp_value *stock_account_kvpval, *acc_list_kvpval, *category_kvpval; - const GUID *stock_account_guid, *inc_or_expense_account_guid, *current_guid; - Account *stock_account; - char *category_name; - GList *assoc_acc_list, *assoc_acc_list_start; - - type = xaccAccountGetType(inc_or_expense_account); - - g_return_if_fail(type == INCOME || type == EXPENSE); - - current_account_kvpframe = xaccAccountGetSlots(inc_or_expense_account); - - stock_account_kvpval = kvp_frame_get_slot(current_account_kvpframe, - "associated-stock-account"); - - stock_account_guid = kvp_value_get_guid(stock_account_kvpval); - if(xaccGUIDType(stock_account_guid) == GNC_ID_NULL) - return; - - category_kvpval = kvp_frame_get_slot(current_account_kvpframe, - "associated-stock-account-category"); - category_name = kvp_value_get_string(category_kvpval); - - - inc_or_expense_account_guid = xaccAccountGetGUID(inc_or_expense_account); - stock_account = xaccAccountLookup(stock_account_guid); - - stock_account_kvpframe = xaccAccountGetSlots(stock_account); - - g_return_if_fail(stock_account_kvpval = - kvp_frame_get_slot(stock_account_kvpframe, - "associated-accounts")); - - assoc_acc_kvpframe = kvp_value_get_frame(stock_account_kvpval); - - g_return_if_fail(acc_list_kvpval = kvp_frame_get_slot(assoc_acc_kvpframe, - category_name)); - g_return_if_fail(assoc_acc_list_start = - kvp_value_get_glist(acc_list_kvpval)); - - for(assoc_acc_list = assoc_acc_list_start; - assoc_acc_list; - assoc_acc_list = g_list_next(assoc_acc_list)) - { - g_return_if_fail(current_guid = kvp_value_get_guid(assoc_acc_list->data)); - if(guid_equal(current_guid, inc_or_expense_account_guid)) - { - assoc_acc_list_start = - g_list_remove_link(assoc_acc_list_start, assoc_acc_list); - g_list_free_1(assoc_acc_list); - acc_list_kvpval = kvp_value_new_glist_nc(assoc_acc_list); - kvp_frame_set_slot_nc(assoc_acc_kvpframe, - category_name, - acc_list_kvpval); - return; - } - } - - /* should never happen */ - PERR("Income/Expense account and stock account disagree on association"); -} - -/* ========================== END OF FILE ===================== */ diff --git a/src/engine/gnc-associate-account.h b/src/engine/gnc-associate-account.h deleted file mode 100644 index 09335475dc..0000000000 --- a/src/engine/gnc-associate-account.h +++ /dev/null @@ -1,89 +0,0 @@ -/********************************************************************\ - * gnc-associate-account.h : api for associating income and * - * expense accounts with stock/mutual fund accounts, for tracking * - * dividends, brokerage, and other stock-related expenses and * - * income so that they can be reported * - * Copyright 2000 Gnumatic Incorporated * - * Written by Robert Merkel * - * - * WARNING WARNING WARNING: THIS CODE IS TOTALLY UNTESTED. * - * THE ONLY REASON IT'S IN CVS IS FOR SAFEKEEPING * - * * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -#include -#include - -/* - * account_list is a list of account *'s, all of which much be expense - * accounts - */ -typedef enum {GNC_TR_INC_MISC, - GNC_TR_INC_INTEREST, - GNC_TR_INC__DIVIDEND, - GNC_TR_INC_LT_CG, - GNC_TR_INC_ST_CG, - GNC_TR_INC_N_CATEGORIES} GNCTrackingIncomeCategory; - -typedef enum {GNC_TR_EXP_MISC, - GNC_TR_EXP_COMMISSION, - GNC_TR_EXP_N_CATEGORIES} GNCTrackingExpenseCategory; - - -/* - * account_list is a list of account *'s, all of which much be expense - * accounts. You can clear associations by setting account_list to NULL - */ - -void gnc_tracking_associate_income_accounts(Account *stock_account, - GNCTrackingIncomeCategory category, - GList *account_list); - - -void gnc_tracking_asssociate_expense_account(Account *stock_account, - GNCTrackingExpenseCategory category, - GList *account_list); - -/* - * returns a list of account *'s, - * returns null if no association specified - */ - -GList *gnc_tracking_find_expense_accounts(Account *stock_account, - GNCTrackingExpenseCategory category); - -GList *gnc_tracking_find_income_accounts(Account *stock_account, - GNCTrackingIncomeCategory category); - -/* for ROI purposes we don't care about categories, these are "grab -all" for that purpose */ - -GList *gnc_tracking_find_all_expense_accounts(Account *stock_account); - -GList *gnc_tracking_find_all_income_accounts(Account *stock_account); - - -/* - * reverse lookup - obviously returns a stock account (or NULL if none - * associated), and argument must be an income or expense account - */ -Account *gnc_tracking_find_stock_account(Account *inc_or_expense_acc); - -void gnc_tracking_dissociate_account(Account *inc_or_expense_account); diff --git a/src/engine/gnc-book-p.h b/src/engine/gnc-book-p.h deleted file mode 100644 index 1ecd9717ad..0000000000 --- a/src/engine/gnc-book-p.h +++ /dev/null @@ -1,103 +0,0 @@ -/********************************************************************\ - * gnc-book-p.h -- private functions for gnc books. * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * HISTORY: - * Created 2001 by Rob Browning - * Copyright (c) 2001 Rob Browning - */ - -#ifndef GNC_BOOK_P_H -#define GNC_BOOK_P_H - -#include "Group.h" -#include "Backend.h" -#include "BackendP.h" -#include "gnc-pricedb.h" -#include "TransLog.h" -#include "gnc-engine-util.h" -#include "gnc-pricedb-p.h" -#include "DateUtils.h" -#include "io-gncxml.h" -#include "io-gncbin.h" -#include "io-gncxml-v2.h" - -#include "gnc-engine.h" -#include "gnc-engine-util.h" -#include "gnc-book.h" -#include "gnc-pricedb.h" -#include "Group.h" - -struct gnc_book_struct -{ - AccountGroup *topgroup; - GNCPriceDB *pricedb; - GList *sched_xactions; - AccountGroup *template_group; - - /* - * should be set true if sched_xactions is changed - * before saving - */ - - gboolean sx_notsaved; - - /* the requested book id, in the form or a URI, such as - * file:/some/where, or sql:server.host.com:555 - */ - char *book_id; - - /* if any book subroutine failed, this records the failure reason - * (file not found, etc). - * This is a 'stack' that is one deep. - * FIXME: This is a hack. I'm trying to move us away from static - * global vars. This may be a temp fix if we decide to integrate - * FileIO errors into GNCBook errors. - */ - GNCBackendError last_err; - char *error_message; - - char *fullpath; - - /* ---------------------------------------------------- */ - /* This struct member applies for network, rpc and SQL i/o */ - /* It is not currently used for file i/o, but it should be. */ - Backend *backend; -}; - - -void gnc_book_set_group(GNCBook *book, AccountGroup *grp); -void gnc_book_set_pricedb(GNCBook *book, GNCPriceDB *db); - -/* - * used by backends to mark the notsaved as FALSE just after - * loading. Do not use otherwise! - */ - - -void gnc_book_mark_saved(GNCBook *book); - -void gnc_book_push_error (GNCBook *book, GNCBackendError err, char *message); - -Backend* gncBackendInit_file(const char *book_id, void *data); - -#endif /* GNC_BOOK_P_H */ diff --git a/src/engine/gnc-book.c b/src/engine/gnc-book.c deleted file mode 100644 index 49d86f5136..0000000000 --- a/src/engine/gnc-book.c +++ /dev/null @@ -1,1036 +0,0 @@ -/********************************************************************\ - * gnc-book.c -- dataset access (set of accounting books) * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * -\********************************************************************/ - -/* - * FILE: - * gnc-book.c - * - * FUNCTION: - * Encapsulate all the information about a gnucash dataset, including - * the methods used to read and write them to datastores. - * - * HISTORY: - * Created by Linas Vepstas December 1998 - * Copyright (c) 1998-2001 Linas Vepstas - * Copyright (c) 2000 Dave Peticolas - */ - -#include "config.h" - -#include -#include -#include -#include -#include -#include - -#include - -#include "Backend.h" -#include "BackendP.h" -#include "Group.h" -#include "NetIO.h" -#include "TransLog.h" -#include "gnc-engine-util.h" -#include "gnc-pricedb-p.h" -#include "DateUtils.h" -#include "io-gncxml.h" -#include "io-gncbin.h" -#include "io-gncxml-v2.h" - -#include "gnc-book.h" -#include "gnc-book-p.h" -#include "gnc-engine.h" -#include "gnc-engine-util.h" - -static short module = MOD_IO; - -/* ---------------------------------------------------------------------- */ - -static void -gnc_book_clear_error (GNCBook *book) -{ - book->last_err = ERR_BACKEND_NO_ERR; - if(book->error_message) - { - g_free(book->error_message); - book->error_message = NULL; - } -} - -void -gnc_book_push_error (GNCBook *book, GNCBackendError err, char *message) -{ - book->last_err = err; - book->error_message = message; -} - -GNCBackendError -gnc_book_get_error (GNCBook * book) -{ - if (!book) return ERR_BACKEND_NO_BACKEND; - return book->last_err; -} - -static const char * -get_default_error_message(GNCBackendError err) -{ - return ""; -} - -const char * -gnc_book_get_error_message(GNCBook *book) -{ - if(!book) return ""; - if(!book->error_message) return get_default_error_message(book->last_err); - return book->error_message; -} - -GNCBackendError -gnc_book_pop_error (GNCBook * book) -{ - GNCBackendError err; - if (!book) return ERR_BACKEND_NO_BACKEND; - err = book->last_err; - gnc_book_clear_error(book); - return err; -} - -/* ---------------------------------------------------------------------- */ - -const char *TEMPLATE_ACCOUNT_NAME = "__account for template transactions__"; - -static void -gnc_book_init (GNCBook *book) -{ - Account *template_acct; - - if(!book) return; - - book->topgroup = xaccMallocAccountGroup(); - book->pricedb = gnc_pricedb_create(); - - book->sched_xactions = NULL; - book->sx_notsaved = FALSE; - book->template_group = xaccMallocAccountGroup(); - - book->book_id = NULL; - gnc_book_clear_error (book); - book->fullpath = NULL; - book->backend = NULL; -} - -GNCBook * -gnc_book_new (void) -{ - GNCBook *book = g_new0(GNCBook, 1); - gnc_book_init(book); - return book; -} - -/* ---------------------------------------------------------------------- */ - -gnc_commodity_table* -gnc_book_get_commodity_table(GNCBook *book) -{ - return gnc_engine_commodities(); -} - -AccountGroup * -gnc_book_get_group (GNCBook *book) -{ - if (!book) return NULL; - return book->topgroup; -} - -void -gnc_book_set_group (GNCBook *book, AccountGroup *grp) -{ - if(!book) return; - - /* Do not free the old topgroup here unless you also fix - * all the other uses of gnc_book_set_group! */ - - book->topgroup = grp; -} - -/* ---------------------------------------------------------------------- */ - -static int -counter_thunk(Transaction *t, void *data) -{ - (*((guint*)data))++; - return 0; -} - -guint -gnc_book_count_transactions(GNCBook *book) -{ - guint count = 0; - xaccGroupForEachTransaction(gnc_book_get_group(book), - counter_thunk, (void*)&count); - return count; -} - -/* ---------------------------------------------------------------------- */ - -GNCPriceDB * -gnc_book_get_pricedb(GNCBook *book) -{ - if(!book) return NULL; - return book->pricedb; -} - -void -gnc_book_set_pricedb(GNCBook *book, GNCPriceDB *db) -{ - if(!book) return; - book->pricedb = db; -} - -/* ---------------------------------------------------------------------- */ - -GList * -gnc_book_get_schedxactions( GNCBook *book ) -{ - if ( book == NULL ) return NULL; - return book->sched_xactions; -} - -void -gnc_book_set_schedxactions( GNCBook *book, GList *newList ) -{ - if ( book == NULL ) return; - book->sched_xactions = newList; - book->sx_notsaved = TRUE; - return; -} - -AccountGroup * -gnc_book_get_template_group( GNCBook *book ) -{ - if ( book == NULL ) return NULL; - return book->template_group; -} - -void -gnc_book_set_template_group( GNCBook *book, AccountGroup *templateGroup ) -{ - if ( book == NULL ) return; - book->template_group = templateGroup; -} - -/* ---------------------------------------------------------------------- */ - -Backend * -xaccGNCBookGetBackend (GNCBook *book) -{ - if (!book) return NULL; - return book->backend; -} - -/* ---------------------------------------------------------------------- */ - -const char * -gnc_book_get_file_path (GNCBook *book) -{ - if (!book) return NULL; - return book->fullpath; -} - -/* ---------------------------------------------------------------------- */ - -const char * -gnc_book_get_url (GNCBook *book) -{ - if (!book) return NULL; - return book->book_id; -} - -/* ---------------------------------------------------------------------- */ - -static void -mark_sx_clean(gpointer data, gpointer user_data) -{ - SchedXaction *sx = (SchedXaction *) data; - xaccSchedXactionSetDirtyness(sx, FALSE); - return; -} - -static void -book_sxns_mark_saved(GNCBook *book) -{ - book->sx_notsaved = FALSE; - g_list_foreach(gnc_book_get_schedxactions(book), - mark_sx_clean, - NULL); - return; -} -void -gnc_book_mark_saved(GNCBook *book) -{ - /* FIXME: is this the right behaviour if book == NULL? */ - g_return_if_fail(book); - xaccGroupMarkSaved(gnc_book_get_group(book)); - gnc_pricedb_mark_clean(gnc_book_get_pricedb(book)); - - xaccGroupMarkSaved(gnc_book_get_template_group(book)); - book_sxns_mark_saved(book); - - return; -} - - -/* ---------------------------------------------------------------------- */ - -static void -gnc_book_int_backend_load_error(GNCBook *book, char *message, char *dll_err) -{ - PWARN (message, dll_err ? dll_err : ""); - g_free(book->fullpath); - book->fullpath = NULL; - g_free(book->book_id); - book->book_id = NULL; - gnc_book_push_error (book, ERR_BACKEND_NO_BACKEND, NULL); -} - -static void -gnc_book_int_load_backend(GNCBook *book, char *libname, char* funcname, - char *libloaderrmsg) -{ - - char * dll_err; - void * dll_handle; - Backend * (*be_new)(void); - - /* open and resolve all symbols now (we don't want mystery - * failure later) */ - dll_handle = dlopen (libname, RTLD_NOW); - if (! dll_handle) - { - char *errmsg; - - errmsg = g_strdup_printf(" can't load library: %%s\n%s", - libloaderrmsg); - dll_err = dlerror(); - gnc_book_int_backend_load_error(book, errmsg, dll_err); - g_free(errmsg); - return; - } - - be_new = dlsym (dll_handle, funcname); - dll_err = dlerror(); - if (dll_err) - { - gnc_book_int_backend_load_error(book, " can't find symbol: %s\n", - dll_err); - return; - } - - book->backend = (*be_new) (); -} - -gboolean -gnc_book_begin (GNCBook *book, const char * book_id, - gboolean ignore_lock, gboolean create_if_nonexistent) -{ - int rc; - - if (!book) return FALSE; - ENTER (" ignore_lock=%d, book-id=%s", ignore_lock, - book_id ? book_id : "(null)"); - - /* clear the error condition of previous errors */ - gnc_book_clear_error (book); - - /* check to see if this session is already open */ - if (gnc_book_get_url(book)) - { - gnc_book_push_error (book, ERR_BACKEND_LOCKED, NULL); - LEAVE("bad book url"); - return FALSE; - } - - /* seriously invalid */ - if (!book_id) - { - gnc_book_push_error (book, ERR_BACKEND_NO_BACKEND, NULL); - LEAVE("bad book_id"); - return FALSE; - } - /* Store the sessionid URL */ - book->book_id = g_strdup (book_id); - - book->fullpath = xaccResolveFilePath(book_id); - if (!book->fullpath) - { - gnc_book_push_error (book, ERR_FILEIO_FILE_NOT_FOUND, NULL); - LEAVE("bad fullpath"); - return FALSE; /* ouch */ - } - PINFO ("filepath=%s", book->fullpath ? book->fullpath : "(null)"); - - /* check to see if this is a type we know how to handle */ - if (!g_strncasecmp(book_id, "file:", 5) || - *book_id == '/') - { - book->backend = gncBackendInit_file(book_id, NULL); - } - /* load different backend based on URL. We should probably - * dynamically load these based on some config file ... */ - else if ((!g_strncasecmp(book_id, "http://", 7)) || - (!g_strncasecmp(book_id, "https://", 8))) - { - /* create the backend */ - book->backend = xmlendNew(); - } - else if (!g_strncasecmp(book_id, "postgres://", 11)) - { - gnc_book_int_load_backend( - book, "libgnc_postgres.so", "pgendNew", - "Maybe you don't have postgres installed?\n" - "The postgres backend can't be used until this " - "config problem is fixed"); - } - else if (!g_strncasecmp(book_id, "rpc://", 6)) - { - gnc_book_int_load_backend( book, "libgnc_rpc.so", "rpcendNew", ""); - } - - /* if there's a begin method, call that. */ - if (book->backend && book->backend->book_begin) - { - int err; - (book->backend->book_begin)(book->backend, book, - gnc_book_get_url(book), ignore_lock, - create_if_nonexistent); - PINFO("Run book_begin on backend"); - err = xaccBackendGetError(book->backend); - if (err != ERR_BACKEND_NO_ERR) - { - g_free(book->fullpath); - book->fullpath = NULL; - g_free(book->book_id); - book->book_id = NULL; - gnc_book_push_error (book, err, NULL); - LEAVE("backend error"); - return FALSE; - } - } - LEAVE(" "); - return TRUE; -} - -/* ---------------------------------------------------------------------- */ - -gboolean -gnc_book_load (GNCBook *book) -{ - GNCBackendError backend_err; - Backend *be; - - if (!book) return FALSE; - if (!gnc_book_get_url(book)) return FALSE; - - ENTER ("book_id=%s", gnc_book_get_url(book) - ? gnc_book_get_url(book) : "(null)"); - - /* At this point, we should are supposed to have a valid book - * id and a lock on the file. */ - - xaccLogDisable(); - xaccGroupMarkDoFree (book->topgroup); - xaccFreeAccountGroup (book->topgroup); - book->topgroup = NULL; - gnc_pricedb_destroy(book->pricedb); - book->pricedb = NULL; - - xaccLogSetBaseName(book->fullpath); - xaccLogEnable(); - - gnc_book_clear_error (book); - - /* This code should be sufficient to initialize *any* backend, - * whether http, postgres, or anything else that might come along. - * Basically, the idea is that by now, a backend has already been - * created & set up. At this point, we only need to get the - * top-level account group out of the backend, and that is a - * generic, backend-independent operation. - */ - be = book->backend; - - /* Starting the session should result in a bunch of accounts - * and currencies being downloaded, but probably no transactions; - * The GUI will need to do a query for that. - */ - if (be) - { - xaccLogDisable(); - if(be->book_load) - { - xaccLogSetBaseName(book->fullpath); - - book->topgroup = (be->book_load) (be); - xaccGroupSetBackend (book->topgroup, be); - gnc_book_push_error(book, xaccBackendGetError(be), NULL); - } - - if (be->price_load) - { - book->pricedb = (be->price_load) (be); - - /* we just got done loading, it can't possibly be dirty !! */ - gnc_book_mark_saved(book); - - xaccPriceDBSetBackend (book->pricedb, be); - gnc_book_push_error(book, xaccBackendGetError(be), NULL); - } - xaccLogEnable(); - } - - if (!book->topgroup) - { - LEAVE("topgroup NULL"); - return FALSE; - } - - if (!book->pricedb) - { - LEAVE("pricedb NULL"); - return FALSE; - } - - if (gnc_book_get_error(book) != ERR_BACKEND_NO_ERR) - { - LEAVE("error from backend %d", gnc_book_get_error(book)); - return FALSE; - } - - LEAVE("book_id=%s", gnc_book_get_url(book) - ? gnc_book_get_url(book) : "(null)"); - return TRUE; -} - - - -static gboolean -book_sxlist_notsaved(GNCBook *book) -{ - GList *sxlist; - SchedXaction *sx; - if(book->sx_notsaved - || - xaccGroupNotSaved(book->template_group)) return TRUE; - - for(sxlist = book->sched_xactions; - sxlist != NULL; - sxlist = g_list_next(sxlist)) - { - sx = (SchedXaction *) (sxlist->data); - if (xaccSchedXactionIsDirty( sx )) - return TRUE; - } - - return FALSE; -} - -/* ---------------------------------------------------------------------- */ - -gboolean -gnc_book_not_saved(GNCBook *book) -{ - if(!book) return FALSE; - - return(xaccGroupNotSaved(book->topgroup) - || - gnc_pricedb_dirty(book->pricedb) - || - book_sxlist_notsaved(book)); -} - -/* ---------------------------------------------------------------------- */ - -gboolean -gnc_book_save_may_clobber_data (GNCBook *book) -{ - /* FIXME: Make sure this doesn't need more sophisticated semantics - * in the face of special file, devices, pipes, symlinks, etc. */ - - struct stat statbuf; - - if (!book) return FALSE; - if (!book->fullpath) return FALSE; - if (stat(book->fullpath, &statbuf) == 0) return TRUE; - - return FALSE; -} - -/* ---------------------------------------------------------------------- */ - -static gboolean -save_error_handler(Backend *be, GNCBook *book) -{ - int err; - err = xaccBackendGetError(be); - - if (ERR_BACKEND_NO_ERR != err) - { - gnc_book_push_error (book, err, NULL); - - /* we close the backend here ... isn't this a bit harsh ??? */ - if (be->book_end) - { - (be->book_end)(be); - } - return TRUE; - } - return FALSE; -} - -void -gnc_book_save (GNCBook *book) -{ - Backend *be; - - if (!book) return; - - ENTER ("book_id=%s", gnc_book_get_url(book) - ? gnc_book_get_url(book) : "(null)"); - - /* if there is a backend, and the backend is reachablele - * (i.e. we can communicate with it), then synchronize with - * the backend. If we cannot contact the backend (e.g. - * because we've gone offline, the network has crashed, etc.) - * then give the user the option to save to disk. - */ - be = book->backend; - if (be) { - - /* if invoked as SaveAs(), then backend not yet set */ - xaccGroupSetBackend (book->topgroup, be); - xaccPriceDBSetBackend (book->pricedb, be); - - if(be->all_sync) - { - (be->all_sync)(be, book->topgroup, book->pricedb); - if(save_error_handler(be, book)) - return; - } - else - { - if (be->sync && book->topgroup) { - (be->sync)(be, book->topgroup); - if(save_error_handler(be, book)) - return; - } - - if (be->sync_price && book->pricedb) { - (be->sync_price)(be, book->pricedb); - if(save_error_handler(be, book)) - return; - } - } - return; - } - - /* if the fullpath doesn't exist, either the user failed to initialize, - * or the lockfile was never obtained. Either way, we can't write. */ - gnc_book_clear_error (book); - - if (!book->fullpath) - { - gnc_book_push_error (book, ERR_BACKEND_MISC, NULL); - return; - } - - LEAVE(" "); -} - -/* ---------------------------------------------------------------------- */ - -void -gnc_book_end (GNCBook *book) -{ - if (!book) return; - - ENTER ("book_id=%s", gnc_book_get_url(book) - ? gnc_book_get_url(book) : "(null)"); - - /* close down the backend first */ - if (book->backend && book->backend->book_end) - { - (book->backend->book_end)(book->backend); - } - - gnc_book_clear_error (book); - - LEAVE(" "); -} - -void -gnc_book_destroy (GNCBook *book) -{ - if (!book) return; - - ENTER ("book_id=%s", gnc_book_get_url(book) - ? gnc_book_get_url(book) : "(null)"); - - xaccLogDisable(); - gnc_book_end (book); - - /* destroy the backend */ - if (book->backend && book->backend->destroy_backend) - { - book->backend->destroy_backend(book->backend); - } - else - { - g_free(book->backend); - } - - xaccGroupSetBackend (book->topgroup, NULL); - xaccPriceDBSetBackend (book->pricedb, NULL); - - /* mark the accounts as being freed - * to avoid tons of balance recomputations. */ - xaccGroupMarkDoFree (book->topgroup); - - xaccFreeAccountGroup (book->topgroup); - book->topgroup = NULL; - - gnc_pricedb_destroy (book->pricedb); - book->pricedb = NULL; - - xaccLogEnable(); - - g_free (book); - LEAVE(" "); -} - -gboolean -gnc_book_events_pending (GNCBook *book) -{ - if (!book) return FALSE; - if (!book->backend) return FALSE; - if (!book->backend->events_pending) return FALSE; - - return book->backend->events_pending (book->backend); -} - -gboolean -gnc_book_process_events (GNCBook *book) -{ - if (!book) return FALSE; - if (!book->backend) return FALSE; - if (!book->backend->process_events) return FALSE; - - return book->backend->process_events (book->backend); -} - -/* ---------------------------------------------------------------------- */ -/* - * If $HOME/.gnucash/data directory doesn't exist, then create it. - */ - -static void -MakeHomeDir (void) -{ - int rc; - struct stat statbuf; - char *home; - char *path; - char *data; - - /* Punt. Can't figure out where home is. */ - home = getenv ("HOME"); - if (!home) return; - - path = g_strconcat(home, "/.gnucash", NULL); - - rc = stat (path, &statbuf); - if (rc) - { - /* assume that the stat failed only because the dir is absent, - * and not because its read-protected or other error. - * Go ahead and make it. Don't bother much with checking mkdir - * for errors; seems pointless. */ - mkdir (path, S_IRWXU); /* perms = S_IRWXU = 0700 */ - } - - data = g_strconcat (path, "/data", NULL); - rc = stat (data, &statbuf); - if (rc) - mkdir (data, S_IRWXU); - - g_free (path); - g_free (data); -} - -/* ---------------------------------------------------------------------- */ -/* XXX hack alert -- we should be yanking this out of some config file */ -static char * searchpaths[] = -{ - "/usr/share/gnucash/data/", - "/usr/local/share/gnucash/data/", - "/usr/share/gnucash/accounts/", - "/usr/local/share/gnucash/accounts/", - NULL, -}; - -typedef gboolean (*pathGenerator)(char *pathbuf, int which); - -static gboolean -xaccAddEndPath(char *pathbuf, const char *ending, int len) -{ - if(len + strlen(pathbuf) >= PATH_MAX) - return FALSE; - - strcat (pathbuf, ending); - return TRUE; -} - -static gboolean -xaccCmdPathGenerator(char *pathbuf, int which) -{ - if(which != 0) - { - return FALSE; - } - else - { - /* try to find a file by this name in the cwd ... */ - if (getcwd (pathbuf, PATH_MAX) == NULL) - return FALSE; - - strcat (pathbuf, "/"); - return TRUE; - } -} - -static gboolean -xaccDataPathGenerator(char *pathbuf, int which) -{ - char *path; - - if(which != 0) - { - return FALSE; - } - else - { - path = getenv ("HOME"); - if (!path) - return FALSE; - - if (PATH_MAX <= (strlen (path) + 20)) - return FALSE; - - strcpy (pathbuf, path); - strcat (pathbuf, "/.gnucash/data/"); - return TRUE; - } -} - -static gboolean -xaccUserPathPathGenerator(char *pathbuf, int which) -{ - char *path = NULL; - - if(searchpaths[which] == NULL) - { - return FALSE; - } - else - { - path = searchpaths[which]; - - if (PATH_MAX <= strlen(path)) - return FALSE; - - strcpy (pathbuf, path); - return TRUE; - } -} - -char * -xaccResolveFilePath (const char * filefrag_tmp) -{ - struct stat statbuf; - char pathbuf[PATH_MAX]; - char *filefrag; - pathGenerator gens[4]; - int namelen; - int i; - - /* seriously invalid */ - if (!filefrag_tmp) - { - PERR("filefrag is NULL"); - return NULL; - } - - ENTER ("filefrag=%s", filefrag_tmp); - - /* ---------------------------------------------------- */ - /* OK, now we try to find or build an absolute file path */ - - /* check for an absolute file path */ - if (*filefrag_tmp == '/') - return g_strdup (filefrag_tmp); - - if (!g_strncasecmp(filefrag_tmp, "file:", 5)) - { - char *ret = g_new(char, strlen(filefrag_tmp) - 5 + 1); - strcpy(ret, filefrag_tmp + 5); - return ret; - } - - { - char *p; - - filefrag = g_strdup (filefrag_tmp); - p = strchr (filefrag, '/'); - while (p) { - *p = ','; - p = strchr (filefrag, '/'); - } - } - - /* get conservative on the length so that sprintf(getpid()) works ... */ - /* strlen ("/.LCK") + sprintf (%x%d) */ - namelen = strlen (filefrag) + 25; - - gens[0] = xaccCmdPathGenerator; - gens[1] = xaccDataPathGenerator; - gens[2] = xaccUserPathPathGenerator; - gens[3] = NULL; - - for (i = 0; gens[i] != NULL; i++) - { - int j; - for(j = 0; gens[i](pathbuf, j) ; j++) - { - if(xaccAddEndPath(pathbuf, filefrag, namelen)) - { - int rc = stat (pathbuf, &statbuf); - if ((!rc) && (S_ISREG(statbuf.st_mode))) - { - g_free(filefrag); - return (g_strdup (pathbuf)); - } - } - } - } - /* OK, we didn't find the file. */ - - /* make sure that the gnucash home dir exists. */ - MakeHomeDir(); - - /* If the user specified a simple filename (i.e. no slashes in it) - * then create the file. But if it has slashes in it, then creating - * a bunch of directories seems like a bad idea; more likely, the user - * specified a bad filename. So return with error. */ - if (strchr (filefrag, '/')) - return NULL; - - /* Lets try creating a new file in $HOME/.gnucash/data */ - if (xaccDataPathGenerator(pathbuf, 0)) - { - if(xaccAddEndPath(pathbuf, filefrag, namelen)) - return (g_strdup (pathbuf)); - } - - /* OK, we still didn't find the file */ - /* Lets try creating a new file in the cwd */ - if (xaccCmdPathGenerator(pathbuf, 0)) - { - if(xaccAddEndPath(pathbuf, filefrag, namelen)) - return (g_strdup (pathbuf)); - } - - return NULL; -} - -/* ---------------------------------------------------------------------- */ - -char * -xaccResolveURL (const char * pathfrag) -{ - /* seriously invalid */ - if (!pathfrag) return NULL; - - /* At this stage of checking, URL's are always, by definition, - * resolved. If there's an error connecting, we'll find out later. - * - * FIXME -- we should probably use ghttp_uri_validate - * to make sure hte uri is in good form... - */ - - if (!g_strncasecmp (pathfrag, "http://", 7) || - !g_strncasecmp (pathfrag, "https://", 8) || - !g_strncasecmp (pathfrag, "postgres://", 11) || - !g_strncasecmp (pathfrag, "rpc://", 6)) - { - return g_strdup(pathfrag); - } - - if (!g_strncasecmp (pathfrag, "file:", 5)) { - return (xaccResolveFilePath (pathfrag+5)); - } - - return (xaccResolveFilePath (pathfrag)); -} - -/* ---------------------------------------------------------------------- */ - -/* this should go in a separate binary to create a rpc server */ - -void -gnc_run_rpc_server (void) -{ - char * dll_err; - void * dll_handle; - int (*rpc_run)(short); - int ret; - - /* open and resolve all symbols now (we don't want mystery - * failure later) */ - dll_handle = dlopen ("libgnc_rpc.so", RTLD_NOW); - if (! dll_handle) - { - dll_err = dlerror(); - PWARN (" can't load library: %s\n", dll_err ? dll_err : ""); - return; - } - - rpc_run = dlsym (dll_handle, "rpc_server_run"); - dll_err = dlerror(); - if (dll_err) - { - dll_err = dlerror(); - PWARN (" can't find symbol: %s\n", dll_err ? dll_err : ""); - return; - } - - ret = (*rpc_run)(0); - - /* XXX How do we force an exit? */ -} diff --git a/src/engine/gnc-book.h b/src/engine/gnc-book.h deleted file mode 100644 index 686c40ab52..0000000000 --- a/src/engine/gnc-book.h +++ /dev/null @@ -1,210 +0,0 @@ -/********************************************************************\ - * gnc-book.h -- dataset access (set of accounting books) * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -/* - * FILE: - * gnc-book.h - * - * FUNCTION: - * Encapsulate all the information about a gnucash dataset, including - * the methods used to read and write them to datastores. - * - * This class provides several important services: - * - * 1) Prevents multiple users from editing the same file at the same - * time, thus avoiding lost data due to race conditions. Thus - * an open session implies that the associated file is locked. - * - * 2) Provides a search path for the file to be edited. This should - * simplify install & maintenance problems for naive users who - * may not have a good grasp on what a file system is, or where - * they want to keep their data files. - * - * The current implementations assumes the use of files and file - * locks; however, the API was designed to be general enough to - * allow the use of generic URL's, and/or implementation on top - * of SQL or other database/persistant object technology. - * - * HISTORY: - * Created by Linas Vepstas December 1998 - * Copyright (c) 1998, 1999 Linas Vepstas - * Copyright (c) 2000 Dave Peticolas - */ - -#ifndef GNC_BOOK_H -#define GNC_BOOK_H - -#include "gnc-pricedb.h" -#include "Backend.h" -#include "Group.h" - -/** TYPES **********************************************************/ - -struct gnc_book_struct; - -typedef struct gnc_book_struct GNCBook; - -/** PROTOTYPES ******************************************************/ - -GNCBook * gnc_book_new (void); -void gnc_book_destroy (GNCBook *book); - -/* The gnc_book_begin () method begins a new book. It takes as an argument - * the book id. The book id must be a string in the form of a URI/URL. - * In the current implementation, the following URL's are supported - * -- File URI of the form - * "file:/home/somewhere/somedir/file.xac" - * The path part must be a valid path. The file-part must be - * a valid old-style-xacc or new-style-gnucash-format file. Paths - * may be relative or absolute. If the path is relative; that is, - * if the argument is "file:somefile.xac" then a sequence of - * search paths are checked for a file of this name. - * - * -- Postgres URI of the form - * "postgres://hostname.com/dbname" - * See the sql subdirectory for more info. - * - * The 'ignore_lock' argument, if set to TRUE, will cause this routine - * to ignore any file locks that it finds. If set to FALSE, then - * file locks will be tested and obeyed. - * - * If the file exists, can be opened and read, and a lock can be obtained - * then a lock will be obtained and the function returns TRUE. - * - * If the file/database doesn't exist, and the create_if_nonexistent - * flag is set to TRUE, then the database is created. - * - * Otherwise the function returns FALSE. - */ -gboolean gnc_book_begin (GNCBook *book, const char * book_id, - gboolean ignore_lock, gboolean create_if_nonexistent); - - -/* The gnc_book_load() method loads the data associated with the book. - * The function returns TRUE on success. - */ -gboolean gnc_book_load (GNCBook *book); - -/* The gnc_book_get_error() routine can be used to obtain the reason - * for any failure. Calling this routine returns the current error. - * - * The gnc_book_pop_error() routine can be used to obtain the reason - * for any failure. Calling this routine resets the error value. - * - * This routine allows an implementation of multiple error values, - * e.g. in a stack, where this routine pops the top value. The current - * implementation has a stack that is one-deep. - * - * See Backend.h for a listing of returned errors. - */ -GNCBackendError gnc_book_get_error (GNCBook *book); -const char * gnc_book_get_error_message(GNCBook *book); -GNCBackendError gnc_book_pop_error (GNCBook *book); - - -AccountGroup *gnc_book_get_group (GNCBook *book); -void gnc_book_set_group(GNCBook *book, AccountGroup *group); -GNCPriceDB *gnc_book_get_pricedb (GNCBook *book); - -guint gnc_book_count_transactions(GNCBook *book); - -/* - * gnc_book_get_commodity_table returns the commodity table associated with - * the BOOK. At the moment this just returns the global commodity table, - * but if we get everything using this we can make it a non-global table :) - */ -gnc_commodity_table* gnc_book_get_commodity_table(GNCBook *book); - -/** - * Returns the list of scheduled transactions. - **/ -GList * gnc_book_get_schedxactions( GNCBook *book ); -void gnc_book_set_schedxactions( GNCBook *book, GList *newList ); - -AccountGroup *gnc_book_get_template_group( GNCBook *book ); -void gnc_book_set_template_group( GNCBook *book, AccountGroup *templateGroup ); - -/* The gnc_book_get_file_path() routine returns the fully-qualified file - * path for the book. That is, if a relative or partial filename - * was for the book, then it had to have been fully resolved to - * open the book. This routine returns the result of this resolution. - * The path is always guarenteed to reside in the local file system, - * even if the book itself was opened as a URL. (currently, the - * filepath is derived from the url by substituting commas for - * slashes). - * - * The gnc_book_get_url() routine returns the url that was opened. - * URL's for local files take the form of - * file:/some/where/some/file.gml - */ -const char * gnc_book_get_file_path (GNCBook *book); -const char * gnc_book_get_url (GNCBook *book); - -/* - * The gnc_book_not_saved() subroutine will return TRUE - * if any data in the book hasn't been saved to long-term storage. - */ -gboolean gnc_book_not_saved(GNCBook *book); - -/* FIXME: This isn't as thorough as we might want it to be... */ -gboolean gnc_book_save_may_clobber_data (GNCBook *book); - -/* The gnc_book_save() method will commit all changes that have been - * made to the book. In the current implementation, this is nothing - * more than a write to the file of the current AccountGroup of the - * book. - * - * The gnc_book_end() method will release the session lock. It will *not* - * save the account group to a file. Thus, this method acts as an "abort" - * or "rollback" primitive. - */ -void gnc_book_save (GNCBook *book); -void gnc_book_end (GNCBook *book); - -/* The gnc_book_events_pending() method will return TRUE if the backend - * has pending events which must be processed to bring the engine - * up to date with the backend. - * - * The gnc_book_process_events() method will process any events indicated - * by the gnc_book_events_pending() method. It returns TRUE if the - * engine was modified while engine events were suspended. - */ -gboolean gnc_book_events_pending (GNCBook *book); -gboolean gnc_book_process_events (GNCBook *book); - -/* The xaccResolveFilePath() routine is a utility that will accept - * a fragmentary filename as input, and resolve it into a fully - * qualified path in the file system, i.e. a path that begins with - * a leading slash. First, the current working directory is - * searched for the file. Next, the directory $HOME/.gnucash/data, - * and finally, a list of other (configurable) paths. If the file - * is not found, then the path $HOME/.gnucash/data is used. If - * $HOME is not defined, then the current working directory is - * used. - */ -char * xaccResolveFilePath (const char * filefrag); -char * xaccResolveURL (const char * pathfrag); - -/* Run the RPC Server */ -void gnc_run_rpc_server (void); - -#endif /* GNC_BOOK_H */ diff --git a/src/engine/gnc-commodity.c b/src/engine/gnc-commodity.c deleted file mode 100644 index b3ffedd2f1..0000000000 --- a/src/engine/gnc-commodity.c +++ /dev/null @@ -1,755 +0,0 @@ -/******************************************************************** - * gnc-commodity.c -- api for tradable commodities (incl. currency) * - * Copyright (C) 2000 Bill Gribble * - * Copyright (C) 2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#define _GNU_SOURCE - -#include "config.h" - -#include -#include -#include -#include - -#include "gnc-commodity.h" -#include "gnc-engine-util.h" - - -/* parts per unit is nominal, i.e. number of 'partname' units in - * a 'unitname' unit. fraction is transactional, i.e. how many - * of the smallest-transactional-units of the currency are there - * in a 'unitname' unit. */ - -struct _gnc_commodity { - char * fullname; - char * namespace; - char * mnemonic; - char * printname; - char * exchange_code; /* CUSIP or other identifying code */ - int fraction; - char * unique_name; - gint16 mark; /* user-defined mark, handy for traversals */ -}; - -struct _gnc_commodity_namespace { - GHashTable * table; -}; - -struct _gnc_commodity_table { - GHashTable * table; -}; - -typedef struct _gnc_commodity_namespace gnc_commodity_namespace; - -/******************************************************************** - * gnc_commodity_new - ********************************************************************/ - -static void -reset_printname(gnc_commodity *com) -{ - g_free(com->printname); - com->printname = g_strdup_printf("%s (%s)", - com->mnemonic ? com->mnemonic : "", - com->fullname ? com->fullname : ""); -} - -static void -reset_unique_name(gnc_commodity *com) -{ - g_free(com->unique_name); - com->unique_name = g_strdup_printf("%s::%s", - com->namespace ? com->namespace : "", - com->mnemonic ? com->mnemonic : ""); -} - -gnc_commodity * -gnc_commodity_new(const char * fullname, - const char * namespace, const char * mnemonic, - const char * exchange_code, - int fraction) -{ - gnc_commodity * retval = g_new0(gnc_commodity, 1); - - retval->fullname = g_strdup(fullname); - retval->namespace = g_strdup(namespace); - retval->mnemonic = g_strdup(mnemonic); - retval->exchange_code = g_strdup(exchange_code); - retval->fraction = fraction; - retval->mark = 0; - - reset_printname(retval); - reset_unique_name(retval); - - return retval; -} - - -/******************************************************************** - * gnc_commodity_destroy - ********************************************************************/ - -void -gnc_commodity_destroy(gnc_commodity * cm) { - if(!cm) return; - g_free(cm->fullname); - g_free(cm->printname); - g_free(cm->namespace); - g_free(cm->exchange_code); - g_free(cm->mnemonic); - g_free(cm->unique_name); - cm->mark = 0; - g_free(cm); -} - - -/******************************************************************** - * gnc_commodity_get_mnemonic - ********************************************************************/ - -const char * -gnc_commodity_get_mnemonic(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->mnemonic; -} - -/******************************************************************** - * gnc_commodity_get_printname - ********************************************************************/ - -const char * -gnc_commodity_get_printname(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->printname; -} - - -/******************************************************************** - * gnc_commodity_get_namespace - ********************************************************************/ - -const char * -gnc_commodity_get_namespace(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->namespace; -} - - -/******************************************************************** - * gnc_commodity_get_fullname - ********************************************************************/ - -const char * -gnc_commodity_get_fullname(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->fullname; -} - - -/******************************************************************** - * gnc_commodity_get_unique_name - ********************************************************************/ - -const char * -gnc_commodity_get_unique_name(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->unique_name; -} - - -/******************************************************************** - * gnc_commodity_get_exchange_code - ********************************************************************/ - -const char * -gnc_commodity_get_exchange_code(const gnc_commodity * cm) { - if(!cm) return NULL; - return cm->exchange_code; -} - -/******************************************************************** - * gnc_commodity_get_fraction - ********************************************************************/ - -int -gnc_commodity_get_fraction(const gnc_commodity * cm) { - if(!cm) return 0; - return cm->fraction; -} - -/******************************************************************** - * gnc_commodity_get_mark - ********************************************************************/ - -gint16 -gnc_commodity_get_mark(const gnc_commodity * cm) { - if(!cm) return 0; - return cm->mark; -} - -/******************************************************************** - * gnc_commodity_set_mnemonic - ********************************************************************/ - -void -gnc_commodity_set_mnemonic(gnc_commodity * cm, const char * mnemonic) { - if(!cm) return; - if(cm->mnemonic == mnemonic) return; - - g_free(cm->mnemonic); - cm->mnemonic = g_strdup(mnemonic); - - reset_printname(cm); - reset_unique_name(cm); -} - -/******************************************************************** - * gnc_commodity_set_namespace - ********************************************************************/ - -void -gnc_commodity_set_namespace(gnc_commodity * cm, const char * namespace) { - if(!cm) return; - if(cm->namespace == namespace) return; - - g_free(cm->namespace); - cm->namespace = g_strdup(namespace); - - reset_printname(cm); - reset_unique_name(cm); -} - -/******************************************************************** - * gnc_commodity_set_fullname - ********************************************************************/ - -void -gnc_commodity_set_fullname(gnc_commodity * cm, const char * fullname) { - if(!cm) return; - if(cm->fullname == fullname) return; - - g_free(cm->fullname); - cm->fullname = g_strdup(fullname); - - reset_printname(cm); -} - -/******************************************************************** - * gnc_commodity_set_exchange_code - ********************************************************************/ - -void -gnc_commodity_set_exchange_code(gnc_commodity * cm, - const char * exchange_code) { - if(!cm) return; - if(cm->exchange_code == exchange_code) return; - - g_free(cm->exchange_code); - cm->exchange_code = g_strdup(exchange_code); -} - -/******************************************************************** - * gnc_commodity_set_fraction - ********************************************************************/ - -void -gnc_commodity_set_fraction(gnc_commodity * cm, int fraction) { - if(!cm) return; - cm->fraction = fraction; -} - -/******************************************************************** - * gnc_commodity_get_mark - ********************************************************************/ - -void -gnc_commodity_set_mark(gnc_commodity * cm, gint16 mark) { - if(!cm) return; - cm->mark = mark; -} - -/******************************************************************** - * gnc_commodity_equiv - * are two commodities the same? - ********************************************************************/ - -gboolean -gnc_commodity_equiv(const gnc_commodity * a, const gnc_commodity * b) { - if(a == b) return TRUE; - if(!a || !b) return FALSE; - if(safe_strcmp(a->namespace, b->namespace) != 0) return FALSE; - if(safe_strcmp(a->mnemonic, b->mnemonic) != 0) return FALSE; - return TRUE; -} - - -/******************************************************************** - * gnc_commodity_table_new - * make a new commodity table - ********************************************************************/ - -gnc_commodity_table * -gnc_commodity_table_new(void) { - gnc_commodity_table * retval = g_new0(gnc_commodity_table, 1); - retval->table = g_hash_table_new(&g_str_hash, &g_str_equal); - return retval; -} - -/******************************************************************** - * gnc_commodity_get_size - * get the size of the commodity table - ********************************************************************/ - -guint -gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl) -{ - g_return_val_if_fail(tbl, 0); - g_return_val_if_fail(tbl->table, 0); - return g_hash_table_size(tbl->table); -} - -static void -count_coms(gpointer key, gpointer value, gpointer user_data) -{ - GHashTable *tbl = ((gnc_commodity_namespace*)value)->table; - guint *count = (guint*)user_data; - - if(safe_strcmp((char*)key, GNC_COMMODITY_NS_ISO) == 0) - { - /* don't count default commodities */ - return; - } - - if(!value) return; - - *count += g_hash_table_size(tbl); -} - -guint -gnc_commodity_table_get_size(gnc_commodity_table* tbl) -{ - guint count = 0; - g_return_val_if_fail(tbl, 0); - g_return_val_if_fail(tbl->table, 0); - - g_hash_table_foreach(tbl->table, count_coms, (gpointer)&count); - - return count; -} - -/******************************************************************** - * gnc_commodity_table_lookup - * locate a commodity by namespace and mnemonic. - ********************************************************************/ - -gnc_commodity * -gnc_commodity_table_lookup(const gnc_commodity_table * table, - const char * namespace, const char * mnemonic) { - gnc_commodity_namespace * nsp = NULL; - - if (!table || !namespace || !mnemonic) return NULL; - - nsp = g_hash_table_lookup(table->table, (gpointer)namespace); - - if(nsp) { - return g_hash_table_lookup(nsp->table, (gpointer)mnemonic); - } - else { - return NULL; - } -} - -/******************************************************************** - * gnc_commodity_table_lookup - * locate a commodity by unique name. - ********************************************************************/ - -gnc_commodity * -gnc_commodity_table_lookup_unique(const gnc_commodity_table *table, - const char * unique_name) -{ - char *namespace; - char *mnemonic; - gnc_commodity *commodity; - - if (!table || !unique_name) return NULL; - - namespace = g_strdup (unique_name); - mnemonic = strstr (namespace, "::"); - if (!mnemonic) - { - g_free (namespace); - return NULL; - } - - *mnemonic = '\0'; - mnemonic += 2; - - commodity = gnc_commodity_table_lookup (table, namespace, mnemonic); - - g_free (namespace); - - return commodity; -} - -/******************************************************************** - * gnc_commodity_table_find_full - * locate a commodity by namespace and printable name - ********************************************************************/ - -gnc_commodity * -gnc_commodity_table_find_full(const gnc_commodity_table * table, - const char * namespace, - const char * fullname) { - gnc_commodity * retval=NULL; - GList * all; - GList * iterator; - - if (!fullname || (fullname[0] == '\0')) - return NULL; - - all = gnc_commodity_table_get_commodities(table, namespace); - - for(iterator = all; iterator; iterator=iterator->next) { - if(!strcmp(fullname, - gnc_commodity_get_printname(iterator->data))) { - retval = iterator->data; - break; - } - } - - g_list_free (all); - - return retval; -} - - -/******************************************************************** - * gnc_commodity_table_insert - * add a commodity to the table. - ********************************************************************/ - -gnc_commodity * -gnc_commodity_table_insert(gnc_commodity_table * table, - gnc_commodity * comm) { - gnc_commodity_namespace * nsp = NULL; - gnc_commodity *c; - - if (!table) return NULL; - if (!comm) return NULL; - - c = gnc_commodity_table_lookup (table, comm->namespace, comm->mnemonic); - - if (c) { - if (c == comm) - return c; - - gnc_commodity_set_fullname (c, gnc_commodity_get_fullname (comm)); - gnc_commodity_set_fraction (c, gnc_commodity_get_fraction (comm)); - gnc_commodity_set_exchange_code (c, - gnc_commodity_get_exchange_code (comm)); - - gnc_commodity_destroy (comm); - - return c; - } - - nsp = g_hash_table_lookup(table->table, (gpointer)(comm->namespace)); - - if(!nsp) { - nsp = g_new0(gnc_commodity_namespace, 1); - nsp->table = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(table->table, - g_strdup(comm->namespace), - (gpointer)nsp); - } - - g_hash_table_insert(nsp->table, - (gpointer)g_strdup(comm->mnemonic), - (gpointer)comm); - - return comm; -} - -/******************************************************************** - * gnc_commodity_table_remove - * remove a commodity from the table. - ********************************************************************/ - -void -gnc_commodity_table_remove(gnc_commodity_table * table, - gnc_commodity * comm) -{ - gnc_commodity_namespace * nsp; - gnc_commodity *c; - - if (!table) return; - if (!comm) return; - - c = gnc_commodity_table_lookup (table, comm->namespace, comm->mnemonic); - if (c != comm) return; - - nsp = g_hash_table_lookup (table->table, comm->namespace); - if (!nsp) return; - - g_hash_table_remove (nsp->table, comm->mnemonic); -} - -/******************************************************************** - * gnc_commodity_table_has_namespace - * see if any commodities in the namespace exist - ********************************************************************/ - -int -gnc_commodity_table_has_namespace(const gnc_commodity_table * table, - const char * namespace) { - gnc_commodity_namespace * nsp = NULL; - - if(!table || !namespace) { return 0; } - - nsp = g_hash_table_lookup(table->table, (gpointer)namespace); - if(nsp) { - return 1; - } - else { - return 0; - } -} - -static void -hash_keys_helper(gpointer key, gpointer value, gpointer data) { - GList ** l = data; - *l = g_list_prepend(*l, key); -} - -static GList * -g_hash_table_keys(GHashTable * table) { - GList * l = NULL; - g_hash_table_foreach(table, &hash_keys_helper, (gpointer) &l); - return l; -} - -static void -hash_values_helper(gpointer key, gpointer value, gpointer data) { - GList ** l = data; - *l = g_list_prepend(*l, value); -} - -static GList * -g_hash_table_values(GHashTable * table) { - GList * l = NULL; - g_hash_table_foreach(table, &hash_values_helper, (gpointer) &l); - return l; -} - -/******************************************************************** - * gnc_commodity_table_get_namespaces - * see if any commodities in the namespace exist - ********************************************************************/ - -GList * -gnc_commodity_table_get_namespaces(const gnc_commodity_table * table) { - if (!table) - return NULL; - - return g_hash_table_keys(table->table); -} - - -/******************************************************************** - * gnc_commodity_table_get_commodities - * list commodities in a give namespace - ********************************************************************/ - -GList * -gnc_commodity_table_get_commodities(const gnc_commodity_table * table, - const char * namespace) { - gnc_commodity_namespace * ns = NULL; - - if(table) { - ns = g_hash_table_lookup(table->table, (gpointer)namespace); - } - - if(ns) { - return g_hash_table_values(ns->table); - } - else { - return NULL; - } -} - -/******************************************************************** - * gnc_commodity_table_add_namespace - * add an empty namespace if it does not exist - ********************************************************************/ - -void -gnc_commodity_table_add_namespace(gnc_commodity_table * table, - const char * namespace) { - gnc_commodity_namespace * ns = NULL; - - if(table) { - ns = g_hash_table_lookup(table->table, (gpointer)namespace); - } - - if(!ns) { - ns = g_new0(gnc_commodity_namespace, 1); - ns->table = g_hash_table_new(g_str_hash, g_str_equal); - g_hash_table_insert(table->table, - (gpointer) g_strdup(namespace), - (gpointer) ns); - } -} - - -/******************************************************************** - * gnc_commodity_table_delete_namespace - * delete a namespace - ********************************************************************/ - -static int -ns_helper(gpointer key, gpointer value, gpointer user_data) { - gnc_commodity * c = value; - gnc_commodity_destroy(c); - g_free(key); - return TRUE; -} - -void -gnc_commodity_table_delete_namespace(gnc_commodity_table * table, - const char * namespace) { - gpointer orig_key; - gnc_commodity_namespace * value; - - if(table) { - if(g_hash_table_lookup_extended(table->table, - (gpointer) namespace, - &orig_key, - (gpointer)&value)) { - g_hash_table_remove(table->table, namespace); - - g_hash_table_foreach_remove(value->table, ns_helper, NULL); - g_hash_table_destroy(value->table); - g_free(value); - - g_free(orig_key); - } - } -} - -void -gnc_commodity_table_remove_non_iso (gnc_commodity_table *t) -{ - GList *namespaces; - GList *node; - - if (!t) return; - - namespaces = gnc_commodity_table_get_namespaces (t); - - for (node = namespaces; node; node = node->next) - { - char *ns = node->data; - - if (safe_strcmp (ns, GNC_COMMODITY_NS_ISO) == 0) - continue; - - gnc_commodity_table_delete_namespace (t, ns); - } - - g_list_free (namespaces); -} - -/******************************************************************** - * gnc_commodity_table_foreach_commodity - * call user-defined function once for every commodity in every - * namespace - ********************************************************************/ - -typedef struct { - gboolean ok; - gboolean (*func)(gnc_commodity *, gpointer); - gpointer user_data; -} IterData; - -static void -iter_commodity (gpointer key, gpointer value, gpointer user_data) -{ - IterData *iter_data = (IterData *) user_data; - gnc_commodity *cm = (gnc_commodity *) value; - - if (iter_data->ok) - { - iter_data->ok = (iter_data->func)(cm, iter_data->user_data); - } -} - -static void -iter_namespace (gpointer key, gpointer value, gpointer user_data) -{ - GHashTable *namespace_hash = ((gnc_commodity_namespace *) value)->table; - g_hash_table_foreach (namespace_hash, iter_commodity, user_data); -} - -gboolean -gnc_commodity_table_foreach_commodity (gnc_commodity_table * tbl, - gboolean (*f)(gnc_commodity *, gpointer), - gpointer user_data) -{ - IterData iter_data; - - iter_data.ok = TRUE; - iter_data.func = f; - iter_data.user_data = user_data; - - g_hash_table_foreach(tbl->table, iter_namespace, (gpointer)&iter_data); - - return iter_data.ok; -} - -/******************************************************************** - * gnc_commodity_table_destroy - * cleanup and free. - ********************************************************************/ - -static int -ct_helper(gpointer key, gpointer value, gpointer data) { - gnc_commodity_namespace * ns = value; - g_hash_table_foreach_remove(ns->table, ns_helper, NULL); - g_hash_table_destroy(ns->table); - ns->table = NULL; - g_free(ns); - g_free(key); - return TRUE; -} - -void -gnc_commodity_table_destroy(gnc_commodity_table * t) { - if (!t) return; - - g_hash_table_foreach_remove(t->table, ct_helper, t); - g_hash_table_destroy(t->table); - g_free(t); -} - -/* ========================= END OF FILE ============================== */ diff --git a/src/engine/gnc-commodity.h b/src/engine/gnc-commodity.h deleted file mode 100644 index 3bace2a44a..0000000000 --- a/src/engine/gnc-commodity.h +++ /dev/null @@ -1,116 +0,0 @@ -/******************************************************************** - * gnc-commodity.h -- api for tradable commodities (incl. currency) * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#ifndef GNC_COMMODITY_H -#define GNC_COMMODITY_H - -#include - -typedef struct _gnc_commodity gnc_commodity; -typedef struct _gnc_commodity_table gnc_commodity_table; - -#define GNC_COMMODITY_NS_LEGACY "GNC_LEGACY_CURRENCIES" -#define GNC_COMMODITY_NS_ISO "ISO4217" -#define GNC_COMMODITY_NS_NASDAQ "NASDAQ" -#define GNC_COMMODITY_NS_NYSE "NYSE" -#define GNC_COMMODITY_NS_EUREX "EUREX" -#define GNC_COMMODITY_NS_MUTUAL "FUND" -#define GNC_COMMODITY_NS_AMEX "AMEX" -#define GNC_COMMODITY_NS_ASX "ASX" - -/* gnc_commodity functions */ -gnc_commodity * gnc_commodity_new(const char * fullname, - const char * namespace, - const char * mnemonic, - const char * exchange_code, - int fraction); - -void gnc_commodity_destroy(gnc_commodity * cm); - -const char * gnc_commodity_get_mnemonic(const gnc_commodity * cm); -const char * gnc_commodity_get_namespace(const gnc_commodity * cm); -const char * gnc_commodity_get_fullname(const gnc_commodity * cm); -const char * gnc_commodity_get_printname(const gnc_commodity * cm); -const char * gnc_commodity_get_exchange_code(const gnc_commodity * cm); -const char * gnc_commodity_get_unique_name(const gnc_commodity * cm); -int gnc_commodity_get_fraction(const gnc_commodity * cm); -gint16 gnc_commodity_get_mark(const gnc_commodity * cm); - -void gnc_commodity_set_mnemonic(gnc_commodity * cm, const char * mnemonic); -void gnc_commodity_set_namespace(gnc_commodity * cm, const char * namespace); -void gnc_commodity_set_fullname(gnc_commodity * cm, const char * fullname); -void gnc_commodity_set_exchange_code(gnc_commodity * cm, - const char * exchange_code); -void gnc_commodity_set_fraction(gnc_commodity * cm, int smallest_fraction); -void gnc_commodity_set_mark(gnc_commodity * cm, gint16 mark); - -gboolean gnc_commodity_equiv(const gnc_commodity * a, const gnc_commodity * b); - - -/* gnc_commodity_table functions : operate on a database of commodity - * info */ - -gnc_commodity_table * gnc_commodity_table_new(void); -void gnc_commodity_table_destroy(gnc_commodity_table * table); -gnc_commodity * gnc_commodity_table_lookup(const gnc_commodity_table * table, - const char * namespace, - const char * mnemonic); -gnc_commodity * -gnc_commodity_table_lookup_unique(const gnc_commodity_table *table, - const char * unique_name); -gnc_commodity * gnc_commodity_table_find_full(const gnc_commodity_table * t, - const char * namespace, - const char * fullname); -gnc_commodity * gnc_commodity_table_insert(gnc_commodity_table * table, - gnc_commodity * comm); -void gnc_commodity_table_remove(gnc_commodity_table * table, - gnc_commodity * comm); - -int gnc_commodity_table_has_namespace(const gnc_commodity_table * t, - const char * namespace); - -guint gnc_commodity_table_get_size(gnc_commodity_table* tbl); -guint gnc_commodity_table_get_number_of_namespaces(gnc_commodity_table* tbl); - -/* The next two functions return newly allocated lists which should - * be freed with g_list_free. */ -GList * gnc_commodity_table_get_namespaces(const gnc_commodity_table * t); -GList * gnc_commodity_table_get_commodities(const gnc_commodity_table * t, - const char * namespace); - -void gnc_commodity_table_add_namespace(gnc_commodity_table * table, - const char * namespace); -void gnc_commodity_table_delete_namespace(gnc_commodity_table * t, - const char * namespace); - -void gnc_commodity_table_remove_non_iso (gnc_commodity_table *t); - -/* gnc_commodity_table_foreach_commodity - call f once for each commodity in - * table, until and unless f returns FALSE. - */ -gboolean gnc_commodity_table_foreach_commodity(gnc_commodity_table * table, - gboolean (*f)(gnc_commodity *cm, - gpointer user_data), - gpointer user_data); - -#endif diff --git a/src/engine/gnc-engine-util.c b/src/engine/gnc-engine-util.c deleted file mode 100644 index 0b438353a6..0000000000 --- a/src/engine/gnc-engine-util.c +++ /dev/null @@ -1,392 +0,0 @@ -/********************************************************************\ - * gnc-engine-util.c -- GnuCash engine utility functions * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1997-2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - * Author: Rob Clark (rclark@cs.hmc.edu) * - * Author: Linas Vepstas (linas@linas.org) * -\********************************************************************/ - -#include "config.h" - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "gnc-engine-util.h" -#include "gnc-common.h" -#include "gnc-engine.h" - -/** GLOBALS *********************************************************/ - -/* This static indicates the debugging module that this .o belongs to. */ -/* static short module = MOD_ENGINE; */ - -static gncLogLevel loglevel[MOD_LAST + 1] = -{ - GNC_LOG_FATAL, /* DUMMY */ - GNC_LOG_WARNING, /* ENGINE */ - GNC_LOG_WARNING, /* IO */ - GNC_LOG_WARNING, /* REGISTER */ - GNC_LOG_WARNING, /* LEDGER */ - GNC_LOG_WARNING, /* HTML */ - GNC_LOG_WARNING, /* GUI */ - GNC_LOG_WARNING, /* SCRUB */ - GNC_LOG_WARNING, /* GTK_REG */ - GNC_LOG_WARNING, /* GUILE */ - GNC_LOG_WARNING, /* BACKEND */ - GNC_LOG_WARNING, /* QUERY */ - GNC_LOG_WARNING, /* PRICE */ - GNC_LOG_WARNING, /* SQL EVENT */ - GNC_LOG_WARNING, /* SQL TXN */ - GNC_LOG_WARNING, /* KVP */ - GNC_LOG_DEBUG, /* SX */ -}; - - -/* Set the logging level of the given module. */ -void -gnc_set_log_level(gncModuleType module, gncLogLevel level) -{ - if ((module < 0) || (module > MOD_LAST)) - return; - - loglevel[module] = level; -} - -/* Set the logging level for all modules. */ -void -gnc_set_log_level_global(gncLogLevel level) -{ - gncModuleType module; - - for (module = 0; module <= MOD_LAST; module++) - loglevel[module] = level; -} - -/* prettify() cleans up subroutine names. AIX/xlC has the habit of - * printing signatures not names; clean this up. On other operating - * systems, truncate name to 30 chars. Note this routine is not thread - * safe. Note we wouldn't need this routine if AIX did something more - * reasonable. Hope thread safety doesn't poke us in eye. */ -static const char * -prettify (const char *name) -{ - static char bf[128]; - char *p; - - if (!name) - return ""; - - strncpy (bf, name, 29); bf[28] = 0; - p = strchr (bf, '('); - - if (p) - { - *(p+1) = ')'; - *(p+2) = 0x0; - } - else - strcpy (&bf[26], "...()"); - - return bf; -} - -gboolean -gnc_should_log (gncModuleType module, gncLogLevel log_level) -{ - if (module < 0 || module > MOD_LAST) - { - PERR ("Bad module: %d", module); - return FALSE; - } - - if (log_level > loglevel[module]) - return FALSE; - - return TRUE; -} - -void -gnc_log (gncModuleType module, gncLogLevel log_level, const char *prefix, - const char *function_name, const char *format, ...) -{ - va_list ap; - - if (!gnc_should_log (module, log_level)) - return; - - fprintf (stderr, "%s: %s: ", - prefix ? prefix : "(null)", - prettify (function_name)); - - va_start (ap, format); - - vfprintf (stderr, format, ap); - - va_end (ap); - - fprintf (stderr, "\n"); -} - - -/********************************************************************\ -\********************************************************************/ - -#define NUM_CLOCKS 10 - -static -struct timeval gnc_clock[NUM_CLOCKS] = { - {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, - {0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, 0}, -}; - -void -gnc_start_clock (int clockno, gncModuleType module, gncLogLevel log_level, - const char *function_name, const char *format, ...) -{ - struct timezone tz; - va_list ap; - - if ((0>clockno) || (NUM_CLOCKS <= clockno)) return; - gettimeofday (&gnc_clock[clockno], &tz); - - fprintf (stderr, "Clock %d Start: %s: ", - clockno, prettify (function_name)); - - va_start (ap, format); - - vfprintf (stderr, format, ap); - - va_end (ap); - - fprintf (stderr, "\n"); -} - -void -gnc_report_clock (int clockno, gncModuleType module, gncLogLevel log_level, - const char *function_name, const char *format, ...) -{ - struct timezone tz; - struct timeval now; - va_list ap; - - if ((0>clockno) || (NUM_CLOCKS <= clockno)) return; - gettimeofday (&now, &tz); - - /* need to borrow to make differnce */ - if (now.tv_usec < gnc_clock[clockno].tv_usec) - { - now.tv_sec --; - now.tv_usec += 1000000; - } - now.tv_sec -= gnc_clock[clockno].tv_sec; - now.tv_usec -= gnc_clock[clockno].tv_usec; - - fprintf (stderr, "Clock %d Elapsed: %ld.%06ld %s: ", - clockno, now.tv_sec, now.tv_usec, prettify (function_name)); - - va_start (ap, format); - - vfprintf (stderr, format, ap); - - va_end (ap); - - fprintf (stderr, "\n"); -} - -/********************************************************************\ -\********************************************************************/ - -/* Search for str2 in first nchar chars of str1, ignore case.. Return - * pointer to first match, or null. */ -char * -strncasestr(const char *str1, const char *str2, size_t len) -{ - while (*str1 && len--) - { - if (toupper(*str1) == toupper(*str2)) - { - if (strncasecmp(str1,str2,strlen(str2)) == 0) - { - return (char *) str1; - } - } - str1++; - } - return NULL; -} - -/* Search for str2 in str1, ignore case. Return pointer to first - * match, or null. */ -char * -strcasestr(const char *str1, const char *str2) -{ - size_t len = strlen (str1); - char * retval = strncasestr (str1, str2, len); - return retval; -} - -/********************************************************************\ -\********************************************************************/ - -int -safe_strcmp (const char * da, const char * db) -{ - SAFE_STRCMP (da, db); - return 0; -} - -int -null_strcmp (const char * da, const char * db) -{ - if (da && db) return strcmp (da, db); - if (!da && db && 0==db[0]) return 0; - if (!db && da && 0==da[0]) return 0; - if (!da && db) return -1; - if (da && !db) return +1; - return 0; -} - -/********************************************************************\ -\********************************************************************/ - -#define MAX_DIGITS 50 - -/* inverse of strtoul */ -char * -ultostr (unsigned long val, int base) -{ - char buf[MAX_DIGITS]; - unsigned long broke[MAX_DIGITS]; - int i; - unsigned long places=0, reval; - - if ((2>base) || (36=0; i--) { - reval += broke[i+1]; - reval *= base; - broke[i] -= reval; - } - - /* print */ - for (i=0; ibroke[i]) { - buf[places-1-i] = 0x30+broke[i]; /* ascii digit zero */ - } else { - buf[places-1-i] = 0x41-10+broke[i]; /* ascii capital A */ - } - } - buf[places] = 0x0; - - return g_strdup (buf); -} - -/********************************************************************\ - * returns TRUE if the string is a number, possibly with whitespace -\********************************************************************/ - -gboolean -gnc_strisnum(const char *s) -{ - if (s == NULL) return FALSE; - if (*s == 0) return FALSE; - - while (*s && isspace(*s)) - s++; - - if (*s == 0) return FALSE; - if (!isdigit(*s)) return FALSE; - - while (*s && isdigit(*s)) - s++; - - if (*s == 0) return TRUE; - - while (*s && isspace(*s)) - s++; - - if (*s == 0) return TRUE; - - return FALSE; -} - -/********************************************************************\ - * our own version of stpcpy -\********************************************************************/ - -char * -gnc_stpcpy (char *dest, const char *src) -{ - strcpy (dest, src); - return (dest + strlen (src)); -} - -/********************************************************************\ - See header for docs. -\********************************************************************/ - -static void -kv_pair_helper(gpointer key, gpointer val, gpointer user_data) -{ - GSList **result = (GSList **) user_data; - GHashTableKVPair *kvp = g_new(GHashTableKVPair, 1); - - kvp->key = key; - kvp->value = val; - *result = g_slist_prepend(*result, kvp); -} - -GSList * -g_hash_table_key_value_pairs(GHashTable *table) -{ - GSList *result_list = NULL; - g_hash_table_foreach(table, kv_pair_helper, &result_list); - return result_list; -} - -void -g_hash_table_kv_pair_free_gfunc(gpointer data, gpointer user_data) -{ - GHashTableKVPair *kvp = (GHashTableKVPair *) data; - g_free(kvp); -} - - -/************************* END OF FILE ******************************\ -\********************************************************************/ diff --git a/src/engine/gnc-engine-util.h b/src/engine/gnc-engine-util.h deleted file mode 100644 index 3efa464d8c..0000000000 --- a/src/engine/gnc-engine-util.h +++ /dev/null @@ -1,269 +0,0 @@ -/********************************************************************\ - * gnc-engine-util.h -- GnuCash engine utility functions * - * Copyright (C) 1997 Robin D. Clark * - * Copyright (C) 1998-2001 Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - * Author: Rob Clark (rclark@cs.hmc.edu) * - * Author: Linas Vepstas (linas@linas.org) * -\********************************************************************/ - -#ifndef GNC_ENGINE_UTIL_H -#define GNC_ENGINE_UTIL_H - -#ifdef HAVE_CONFIG_H -#include "config.h" -#endif - -#include -#include -#include -#include -#include -#include - -#include "gnc-common.h" -#include "gnc-commodity.h" -#include "gnc-numeric.h" - -/** DEBUGGING MACROS ************************************************/ -/* The debuging macros enable the setting of trace messages */ - -/** If you modify this, modify the loglevel table in the .c file. */ -typedef enum -{ - MOD_DUMMY = 0, - MOD_ENGINE = 1, - MOD_IO = 2, - MOD_REGISTER= 3, - MOD_LEDGER = 4, - MOD_HTML = 5, - MOD_GUI = 6, - MOD_SCRUB = 7, - MOD_GTK_REG = 8, - MOD_GUILE = 9, - MOD_BACKEND = 10, - MOD_QUERY = 11, - MOD_PRICE = 12, - MOD_EVENT = 13, - MOD_TXN = 14, - MOD_KVP = 15, - MOD_SX = 16, - MOD_LAST = 16 -} gncModuleType; - -typedef enum -{ - GNC_LOG_FATAL = 0, - GNC_LOG_ERROR = 1, - GNC_LOG_WARNING = 2, - GNC_LOG_INFO = 3, - GNC_LOG_DEBUG = 4, - GNC_LOG_DETAIL = 5, - GNC_LOG_TRACE = 6, -} gncLogLevel; - -/* FIXME: these logging functions should proably get replaced by - * the glib.h g_error(), etc functions. That way, we would have - * unified logging mechanism, instead of having some messages - * work one way, and other a different way ... - */ -gboolean gnc_should_log (gncModuleType module, gncLogLevel log_level); -void gnc_log (gncModuleType module, gncLogLevel log_level, - const char *prefix, const char *function_name, - const char *format, ...) G_GNUC_PRINTF(5,6); - -#define FATAL(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_FATAL)) \ - gnc_log (module, GNC_LOG_FATAL, "Fatal Error", \ - __FUNCTION__, format, ## args); \ -} - -#define PERR(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_ERROR)) \ - gnc_log (module, GNC_LOG_ERROR, "Error", \ - __FUNCTION__, format, ##args); \ -} - -#define PWARN(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_WARNING)) \ - gnc_log (module, GNC_LOG_WARNING, "Warning", \ - __FUNCTION__, format, ## args); \ -} - -#define PINFO(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_INFO)) \ - gnc_log (module, GNC_LOG_INFO, "Info", \ - __FUNCTION__, format, ## args); \ -} - -#define DEBUG(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_DEBUG)) \ - gnc_log (module, GNC_LOG_DEBUG, "Debug", \ - __FUNCTION__, format, ## args); \ -} - -#define ENTER(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_DEBUG)) \ - gnc_log (module, GNC_LOG_DEBUG, "Enter", \ - __FUNCTION__, format, ## args); \ -} - -#define LEAVE(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_DEBUG)) \ - gnc_log (module, GNC_LOG_DEBUG, "Leave", \ - __FUNCTION__, format, ## args); \ -} - -#define DETAIL(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_DETAIL)) \ - gnc_log (module, GNC_LOG_DETAIL, "Detail", \ - __FUNCTION__, format, ## args); \ -} - - -#define DEBUGCMD(x) { if (gnc_should_log (module, GNC_LOG_DEBUG)) { x; }} - -#define ERROR() fprintf(stderr,"%s: Line %d, error = %s\n", \ - __FILE__, __LINE__, strerror(errno)); - -#define TRACE(format, args...) { \ - if (gnc_should_log (module, GNC_LOG_TRACE)) \ - gnc_log (module, GNC_LOG_TRACE, "Trace", \ - __FUNCTION__, format, ## args); \ -} - -void gnc_start_clock (int clockno, gncModuleType module, gncLogLevel log_level, - const char *function_name, const char *format, ...); - -void gnc_report_clock (int clockno, gncModuleType module, gncLogLevel log_level, - const char *function_name, const char *format, ...); - - -#define START_CLOCK(clockno,format, args...) { \ - if (gnc_should_log (module, GNC_LOG_INFO)) \ - gnc_start_clock (clockno, module, GNC_LOG_INFO,\ - __FUNCTION__, format, ## args); \ -} - -#define REPORT_CLOCK(clockno,format, args...) { \ - if (gnc_should_log (module, GNC_LOG_INFO)) \ - gnc_report_clock (clockno, module, GNC_LOG_INFO,\ - __FUNCTION__, format, ## args); \ -} - - -/* Set the logging level of the given module. */ -void gnc_set_log_level(gncModuleType module, gncLogLevel level); - -/* Set the logging level for all modules. */ -void gnc_set_log_level_global(gncLogLevel level); - - -/** Macros *****************************************************/ -#define EPS (1.0e-6) -#define DEQEPS(x,y,eps) (((((x)+(eps))>(y)) ? 1 : 0) && ((((x)-(eps))<(y)) ? 1 : 0)) -#define DEQ(x,y) DEQEPS(x,y,EPS) - - -#define SAFE_STRCMP(da,db) { \ - if ((da) && (db)) { \ - int retval = strcmp ((da), (db)); \ - /* if strings differ, return */ \ - if (retval) return retval; \ - } else \ - if ((!(da)) && (db)) { \ - return -1; \ - } else \ - if ((da) && (!(db))) { \ - return +1; \ - } \ -} - -/* Define the long long int conversion for scanf */ -#if HAVE_SCANF_LLD -# define GNC_SCANF_LLD "%lld" -#else -# define GNC_SCANF_LLD "%qd" -#endif - - -/** Prototypes *************************************************/ - -/* The safe_strcmp compares strings a and b the same way that strcmp() - * does, except that either may be null. This routine assumes that - * a non-null string is always greater than a null string. - */ -int safe_strcmp (const char * da, const char * db); - -/* The null_strcmp compares strings a and b the same way that strcmp() - * does, except that either may be null. This routine assumes that - * a null string is equal to the empty string. - */ -int null_strcmp (const char * da, const char * db); - -/* Search for str2 in first nchar chars of str1, ignore case. Return - * pointer to first match, or null. These are just like that strnstr - * and the strstr functions, except that they ignore the case. */ -extern char *strncasestr(const char *str1, const char *str2, size_t len); -extern char *strcasestr(const char *str1, const char *str2); - -/* The ultostr() subroutine is the inverse of strtoul(). It accepts a - * number and prints it in the indicated base. The returned string - * should be g_freed when done. */ -char * ultostr (unsigned long val, int base); - -/* Returns true if string s is a number, possibly surrounded by - * whitespace. */ -gboolean gnc_strisnum(const char *s); - -/* Define a gnucash stpcpy */ -char * gnc_stpcpy (char *dest, const char *src); - -#ifndef HAVE_STPCPY -#define stpcpy gnc_stpcpy -#endif - - -/***********************************************************************\ - - g_hash_table_key_value_pairs(hash): Returns a GSList* of all the - keys and values in a given hash table. Data elements of lists are - actual hash elements, so be careful, and deallocation of the - GHashTableKVPairs in the result list are the caller's - responsibility. A typical sequence might look like this: - - GSList *kvps = g_hash_table_key_value_pairs(hash); - ... use kvps->data->key and kvps->data->val, etc. here ... - g_slist_foreach(kvps, g_hash_table_kv_pair_free_gfunc, NULL); - g_slist_free(kvps); - -*/ - -typedef struct { - gpointer key; - gpointer value; -} GHashTableKVPair; - -GSList *g_hash_table_key_value_pairs(GHashTable *table); -void g_hash_table_kv_pair_free_gfunc(gpointer data, gpointer user_data); - -/***********************************************************************/ - -#endif diff --git a/src/engine/gnc-engine.c b/src/engine/gnc-engine.c deleted file mode 100644 index f566390fbd..0000000000 --- a/src/engine/gnc-engine.c +++ /dev/null @@ -1,117 +0,0 @@ -/******************************************************************** - * gnc-engine.c -- top-level initialization for Gnucash Engine * - * Copyright 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#include "config.h" - -#include -#include - -#include "GNCIdP.h" -#include "gnc-engine.h" - -static GList * engine_init_hooks = NULL; -static gnc_commodity_table * known_commodities = NULL; -static int engine_is_initialized = 0; -GCache * gnc_string_cache = NULL; - -/******************************************************************** - * gnc_engine_init - * initialize backend, load any necessary databases, etc. - ********************************************************************/ - -void -gnc_engine_init(int argc, char ** argv) { - gnc_engine_init_hook_t hook; - GList * cur; - - if (1 == engine_is_initialized) return; - engine_is_initialized = 1; - - /* initialize the string cache */ - gnc_engine_get_string_cache(); - - xaccGUIDInit (); - - /* initialize the commodity table (it starts empty) */ - known_commodities = gnc_commodity_table_new(); - - /* call any engine hooks */ - for(cur = engine_init_hooks; cur; cur = cur->next) { - hook = (gnc_engine_init_hook_t)cur->data; - if(hook) { - (*hook)(argc, argv); - } - } -} - -GCache* -gnc_engine_get_string_cache(void) -{ - if(!gnc_string_cache) - { - gnc_string_cache = g_cache_new( - (GCacheNewFunc) g_strdup, g_free, - (GCacheDupFunc) g_strdup, g_free, g_str_hash, - g_str_hash, g_str_equal); - } - return gnc_string_cache; -} - -/******************************************************************** - * gnc_engine_shutdown - * shutdown backend, destroy any global data, etc. - ********************************************************************/ - -void -gnc_engine_shutdown (void) -{ - g_cache_destroy (gnc_string_cache); - gnc_string_cache = NULL; - - xaccGUIDShutdown (); - - gnc_commodity_table_destroy (known_commodities); - known_commodities = NULL; -} - -/******************************************************************** - * gnc_engine_add_init_hook - * add a startup hook - ********************************************************************/ - -void -gnc_engine_add_init_hook(gnc_engine_init_hook_t h) { - engine_init_hooks = g_list_append(engine_init_hooks, (gpointer)h); -} - - -/******************************************************************** - * gnc_engine_commodities() - * get the global gnc_engine commodity table - ********************************************************************/ - -gnc_commodity_table * -gnc_engine_commodities(void) { - assert(engine_is_initialized); - return known_commodities; -} diff --git a/src/engine/gnc-engine.h b/src/engine/gnc-engine.h deleted file mode 100644 index 52b8ab5a86..0000000000 --- a/src/engine/gnc-engine.h +++ /dev/null @@ -1,69 +0,0 @@ -/******************************************************************** - * gnc-engine.h -- top-level include file for Gnucash Engine * - * Copyright 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#ifndef GNC_ENGINE_H -#define GNC_ENGINE_H - -#include "gnc-commodity.h" - -typedef void (* gnc_engine_init_hook_t)(int, char **); - -/** PROTOTYPES ******************************************************/ - -/* gnc_engine_init MUST be called before gnc engine functions can - * be used. */ -void gnc_engine_init(int argc, char ** argv); - -/* called to shutdown the engine */ -void gnc_engine_shutdown (void); - -/* pass a function pointer to gnc_engine_add_init_hook and - * it will be called during the evaluation of gnc_engine_init */ -void gnc_engine_add_init_hook(gnc_engine_init_hook_t hook); - -/* this is a global table of known commodity types. */ -gnc_commodity_table * gnc_engine_commodities(void); - -/* Many strings used throughout the engine are likely to be duplicated. - * So we provide a reference counted cache system for the strings, which - * shares strings whenever possible. - * - * Use g_cache_insert to insert a string into the cache (it will return a - * pointer to the cached string). - * Basically you should use this instead of g_strdup. - * - * Use g_cache_remove (giving it a pointer to a cached string) if the string - * is unused. If this is the last reference to the string it will be - * removed from the cache, otherwise it will just decrement the - * reference count. - * Basically you should use this instead of g_free. - * - * Note that all the work is done when inserting or removing. Once - * cached the strings are just plain C strings. - */ - -/* get the gnc_string_cache. Create it if it doesn't exist already */ -GCache* gnc_engine_get_string_cache(void); - -#endif - diff --git a/src/engine/gnc-event-p.h b/src/engine/gnc-event-p.h deleted file mode 100644 index 19a1431e44..0000000000 --- a/src/engine/gnc-event-p.h +++ /dev/null @@ -1,45 +0,0 @@ -/******************************************************************** - * gnc-event-p.h -- private engine event handling interface * - * Copyright 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#ifndef GNC_EVENT_P_H -#define GNC_EVENT_P_H - -#include "gnc-event.h" - -/* gnc_engine_generate_event - * Invoke all registered event handlers using the given arguments. - * - * GNC_EVENT_CREATE events should be generated after the object - * has been created and registered in the engine entity table. - * GNC_EVENT_MODIFY events should be generated whenever any data - * member or submember (i.e., splits) is changed. - * GNC_EVENT_DESTROY events should be called before the object - * has been destroyed or removed from the entity table. - * - * entity: the GUID of the entity generating the event - * event_type: the type of event -- this should be one of the - * single-bit GNCEngineEventType values, not a combination. - */ -void gnc_engine_generate_event (GUID *entity, GNCEngineEventType event_type); - -#endif diff --git a/src/engine/gnc-event.c b/src/engine/gnc-event.c deleted file mode 100644 index bca005e2c1..0000000000 --- a/src/engine/gnc-event.c +++ /dev/null @@ -1,185 +0,0 @@ -/******************************************************************** - * gnc-event.c -- engine event handling implementation * - * Copyright 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#include "config.h" - -#include "gnc-engine-util.h" -#include "gnc-event-p.h" - - -/** Declarations ****************************************************/ - -typedef struct -{ - GNCEngineEventHandler handler; - gpointer user_data; - - gint handler_id; -} HandlerInfo; - - -/** Static Variables ************************************************/ -static guint suspend_counter = 0; -static gint next_handler_id = 0; -static GList *handlers = NULL; - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - - -/** Implementations *************************************************/ - -gint -gnc_engine_register_event_handler (GNCEngineEventHandler handler, - gpointer user_data) -{ - HandlerInfo *hi; - gint handler_id; - GList *node; - - /* sanity check */ - if (!handler) - { - PERR ("no handler specified"); - return 0; - } - - /* look for a free handler id */ - handler_id = next_handler_id; - node = handlers; - - while (node) - { - hi = node->data; - - if (hi->handler_id == handler_id) - { - handler_id++; - node = handlers; - continue; - } - - node = node->next; - } - - /* found one, add the handler */ - hi = g_new0 (HandlerInfo, 1); - - hi->handler = handler; - hi->user_data = user_data; - hi->handler_id = handler_id; - - handlers = g_list_prepend (handlers, hi); - - /* update id for next registration */ - next_handler_id = handler_id + 1; - - return handler_id; -} - -void -gnc_engine_unregister_event_handler (gint handler_id) -{ - GList *node; - - for (node = handlers; node; node = node->next) - { - HandlerInfo *hi = node->data; - - if (hi->handler_id != handler_id) - continue; - - /* found it */ - - /* take out of list */ - handlers = g_list_remove_link (handlers, node); - - /* safety */ - hi->handler = NULL; - - g_list_free_1 (node); - g_free (hi); - - return; - } - - PERR ("no such handler: %d", handler_id); -} - -void -gnc_engine_suspend_events (void) -{ - suspend_counter++; - - if (suspend_counter == 0) - { - PERR ("suspend counter overflow"); - } -} - -void -gnc_engine_resume_events (void) -{ - if (suspend_counter == 0) - { - PERR ("suspend counter underflow"); - return; - } - - suspend_counter--; -} - -void -gnc_engine_generate_event (GUID *entity, GNCEngineEventType event_type) -{ - GList *node; - - if (!entity) - return; - - if (suspend_counter) - return; - - switch (event_type) - { - case GNC_EVENT_NONE: - return; - - case GNC_EVENT_CREATE: - case GNC_EVENT_MODIFY: - case GNC_EVENT_DESTROY: - break; - - default: - PERR ("bad event type %d", event_type); - return; - } - - for (node = handlers; node; node = node->next) - { - HandlerInfo *hi = node->data; - - if (hi->handler) - hi->handler (entity, event_type, hi->user_data); - } -} diff --git a/src/engine/gnc-event.h b/src/engine/gnc-event.h deleted file mode 100644 index bdf51a3b71..0000000000 --- a/src/engine/gnc-event.h +++ /dev/null @@ -1,84 +0,0 @@ -/******************************************************************** - * gnc-event.h -- engine event handling interface * - * Copyright 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#ifndef GNC_EVENT_H -#define GNC_EVENT_H - -#include - -#include "guid.h" - - -typedef enum -{ - GNC_EVENT_NONE = 0, - GNC_EVENT_CREATE = 1 << 0, - GNC_EVENT_MODIFY = 1 << 1, - GNC_EVENT_DESTROY = 1 << 2, - GNC_EVENT_ALL = 0xff -} GNCEngineEventType; - - -/* GNCEngineEventHandler - * Handler invoked when an engine event occurs. - * - * entity: GUID of entity generating event - * event_type: one of the single-bit GNCEngineEventTypes, not a combination - * user_data: user_data supplied when handler was registered. - */ -typedef void (*GNCEngineEventHandler) (GUID *entity, - GNCEngineEventType event_type, - gpointer user_data); - -/* gnc_engine_register_event_handler - * Register a handler for engine events. - * - * handler: handler to register - * user_data: data provided when handler is invoked - * - * Returns: id identifying handler - */ -gint gnc_engine_register_event_handler (GNCEngineEventHandler handler, - gpointer user_data); - -/* gnc_engine_unregister_event_handler - * Unregister an engine event handler. - * - * handler_id: the id of the handler to unregister - */ -void gnc_engine_unregister_event_handler (gint handler_id); - -/* gnc_engine_suspend_events - * Suspend all engine events. This function may be - * called multiple times. To resume event generation, - * an equal number of calls to gnc_engine_resume_events - * must be made. - */ -void gnc_engine_suspend_events (void); - -/* gnc_engine_resume_events - * Resume engine event generation. - */ -void gnc_engine_resume_events (void); - -#endif diff --git a/src/engine/gnc-numeric.c b/src/engine/gnc-numeric.c deleted file mode 100644 index 93227d65e1..0000000000 --- a/src/engine/gnc-numeric.c +++ /dev/null @@ -1,1268 +0,0 @@ -/******************************************************************** - * gnc-numeric.c -- an exact-number library for gnucash. * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#define _GNU_SOURCE - -#include -#include -#include -#include -#include - -#include "gnc-engine-util.h" -#include "gnc-numeric.h" - -/* TODO - * - use longer intermediate values to make operations - * 64-bit-overflow-proof - */ - -/* static short module = MOD_ENGINE; */ - -static const char * _numeric_error_strings[] = -{ - "No error", - "Argument is not a valid number", - "Intermediate result overflow", - "Argument denominators differ in GNC_DENOM_FIXED operation", - "Remainder part in GNC_RND_NEVER operation" -}; - -static gint64 gnc_numeric_lcd(gnc_numeric a, gnc_numeric b); - -/******************************************************************** - * gnc_numeric_zero_p - ********************************************************************/ - -int -gnc_numeric_zero_p(gnc_numeric a) { - if(gnc_numeric_check(a)) { - return 0; - } - else { - if((a.num == 0) && (a.denom != 0)) { - return 1; - } - else { - return 0; - } - } -} - -/******************************************************************** - * gnc_numeric_negative_p - ********************************************************************/ - -int -gnc_numeric_negative_p(gnc_numeric a) { - if(gnc_numeric_check(a)) { - return 0; - } - else { - if((a.num < 0) && (a.denom != 0)) { - return 1; - } - else { - return 0; - } - } -} - -/******************************************************************** - * gnc_numeric_positive_p - ********************************************************************/ - -int -gnc_numeric_positive_p(gnc_numeric a) { - if(gnc_numeric_check(a)) { - return 0; - } - else { - if((a.num > 0) && (a.denom != 0)) { - return 1; - } - else { - return 0; - } - } -} - - -/******************************************************************** - * gnc_numeric_compare - * returns 1 if a>b, -1 if b>a, 0 if a == b - ********************************************************************/ - -int -gnc_numeric_compare(gnc_numeric a, gnc_numeric b) { - gint64 ab, ba; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return 0; - } - ab = a.num * b.denom; - ba = b.num * a.denom; - - if(ab == ba) { - return 0; - } - else if(ab > ba) { - return 1; - } - else { - return -1; - } -} - - -/******************************************************************** - * gnc_numeric_eq - ********************************************************************/ - -int -gnc_numeric_eq(gnc_numeric a, gnc_numeric b) { - return ((a.num == b.num) && (a.denom == b.denom)); -} - - -/******************************************************************** - * gnc_numeric_equal - ********************************************************************/ - -int -gnc_numeric_equal(gnc_numeric a, gnc_numeric b) { - if(((a.denom > 0) && (b.denom > 0)) || - ((a.denom < 0) && (b.denom < 0))) { - return ((a.num * b.denom) == (a.denom * b.num)); - } - else { - return 0; - } -} - - -/******************************************************************** - * gnc_numeric_same - * would a and b be equal() if they were both converted to the same - * denominator? - ********************************************************************/ - -int -gnc_numeric_same(gnc_numeric a, gnc_numeric b, gint64 denom, - gint how) { - gnc_numeric aconv, bconv; - - aconv = gnc_numeric_convert(a, denom, how); - bconv = gnc_numeric_convert(b, denom, how); - - return(gnc_numeric_equal(aconv, bconv)); -} - - - -/******************************************************************** - * gnc_numeric_add - ********************************************************************/ - -gnc_numeric -gnc_numeric_add(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how) { - gnc_numeric sum; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - if((denom == GNC_DENOM_AUTO) && - (how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_FIXED) { - if(a.denom == b.denom) { - denom = a.denom; - } - else if(b.num == 0) { - denom = a.denom; - } - else if(a.num == 0) { - denom = b.denom; - } - else { - return gnc_numeric_error(GNC_ERROR_DENOM_DIFF); - } - } - - if(a.denom < 0) { - a.num *= a.denom; - a.denom = 1; - } - - if(b.denom < 0) { - b.num *= b.denom; - b.denom = 1; - } - - /* get an exact answer.. same denominator is the common case. */ - if(a.denom == b.denom) { - sum.num = a.num + b.num; - sum.denom = a.denom; - } - else { - sum.num = a.num*b.denom + b.num*a.denom; - sum.denom = a.denom*b.denom; - } - - if((denom == GNC_DENOM_AUTO) && - ((how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_LCD)) { - denom = gnc_numeric_lcd(a, b); - how = how & GNC_NUMERIC_RND_MASK; - } - - return gnc_numeric_convert(sum, denom, how); -} - - -/******************************************************************** - * gnc_numeric_add_fixed - ********************************************************************/ - -gnc_numeric -gnc_numeric_add_fixed(gnc_numeric a, gnc_numeric b) { - return gnc_numeric_add(a, b, GNC_DENOM_AUTO, - GNC_DENOM_FIXED | GNC_RND_NEVER); -} - - -/******************************************************************** - * gnc_numeric_sub - ********************************************************************/ - -gnc_numeric -gnc_numeric_sub(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how) { - gnc_numeric diff; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - if((denom == GNC_DENOM_AUTO) && - (how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_FIXED) { - if(a.denom == b.denom) { - denom = a.denom; - } - else if(b.num == 0) { - denom = a.denom; - } - else if(a.num == 0) { - denom = b.denom; - } - else { - return gnc_numeric_error(GNC_ERROR_DENOM_DIFF); - } - } - - if(a.denom < 0) { - a.num *= a.denom; - a.denom = 1; - } - - if(b.denom < 0) { - b.num *= b.denom; - b.denom = 1; - } - - /* get an exact answer.. same denominator is the common case. */ - if(a.denom == b.denom) { - diff.num = a.num - b.num; - diff.denom = a.denom; - } - else { - diff.num = a.num*b.denom - b.num*a.denom; - diff.denom = a.denom*b.denom; - } - - if((denom == GNC_DENOM_AUTO) && - ((how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_LCD)) { - denom = gnc_numeric_lcd(a, b); - how = how & GNC_NUMERIC_RND_MASK; - } - return gnc_numeric_convert(diff, denom, how); -} - - -/******************************************************************** - * gnc_numeric_sub_fixed - ********************************************************************/ - -gnc_numeric -gnc_numeric_sub_fixed(gnc_numeric a, gnc_numeric b) { - return gnc_numeric_sub(a, b, GNC_DENOM_AUTO, - GNC_DENOM_FIXED | GNC_RND_NEVER); -} - - -/******************************************************************** - * gnc_numeric_mul - ********************************************************************/ - -gnc_numeric -gnc_numeric_mul(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how) { - gnc_numeric product; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - if((denom == GNC_DENOM_AUTO) && - (how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_FIXED) { - if(a.denom == b.denom) { - denom = a.denom; - } - else if(b.num == 0) { - denom = a.denom; - } - else if(a.num == 0) { - denom = b.denom; - } - else { - return gnc_numeric_error(GNC_ERROR_DENOM_DIFF); - } - } - - if(a.denom < 0) { - a.num *= a.denom; - a.denom = 1; - } - - if(b.denom < 0) { - b.num *= b.denom; - b.denom = 1; - } - - product.num = a.num*b.num; - product.denom = a.denom*b.denom; - - if(product.denom < 0) { - product.num = -product.num; - product.denom = -product.denom; - } - - if((denom == GNC_DENOM_AUTO) && - ((how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_LCD)) { - denom = gnc_numeric_lcd(a, b); - how = how & GNC_NUMERIC_RND_MASK; - } - - return gnc_numeric_convert(product, denom, how); -} - - -/******************************************************************** - * gnc_numeric_div - ********************************************************************/ - -gnc_numeric -gnc_numeric_div(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how) { - gnc_numeric quotient; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - if((denom == GNC_DENOM_AUTO) && - (how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_FIXED) { - if(a.denom == b.denom) { - denom = a.denom; - } - else if(a.denom == 0) { - denom = b.denom; - } - else { - return gnc_numeric_error(GNC_ERROR_DENOM_DIFF); - } - } - - - if(a.denom < 0) { - a.num *= a.denom; - a.denom = 1; - } - - if(b.denom < 0) { - b.num *= b.denom; - b.denom = 1; - } - - if(a.denom == b.denom) { - quotient.num = a.num; - quotient.denom = b.num; - } - else { - quotient.num = a.num*b.denom; - quotient.denom = a.denom*b.num; - } - - if(quotient.denom < 0) { - quotient.num = -quotient.num; - quotient.denom = -quotient.denom; - } - - if((denom == GNC_DENOM_AUTO) && - ((how & GNC_NUMERIC_DENOM_MASK) == GNC_DENOM_LCD)) { - denom = gnc_numeric_lcd(a, b); - how = how & GNC_NUMERIC_RND_MASK; - } - - return gnc_numeric_convert(quotient, denom, how); -} - -/******************************************************************** - * gnc_numeric_neg - * negate the argument - ********************************************************************/ - -gnc_numeric -gnc_numeric_neg(gnc_numeric a) { - if(gnc_numeric_check(a)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - return gnc_numeric_create(- a.num, a.denom); -} - -/******************************************************************** - * gnc_numeric_neg - * return the absolute value of the argument - ********************************************************************/ - -gnc_numeric -gnc_numeric_abs(gnc_numeric a) { - if(gnc_numeric_check(a)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - return gnc_numeric_create(ABS(a.num), a.denom); -} - -/******************************************************************** - * gnc_numeric_convert - ********************************************************************/ - -gnc_numeric -gnc_numeric_convert(gnc_numeric in, gint64 denom, gint how) { - gnc_numeric out; - gnc_numeric temp; - gint64 temp_bc; - gint64 temp_a; - gint64 remainder; - gint64 sign; - gint denom_neg=0; - double ratio, logratio; - double sigfigs; - - if(gnc_numeric_check(in)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - if(denom == GNC_DENOM_AUTO) { - switch(how & GNC_NUMERIC_DENOM_MASK) { - case GNC_DENOM_EXACT: - return in; - break; - - case GNC_DENOM_REDUCE: - /* reduce the input to a relatively-prime fraction */ - return gnc_numeric_reduce(in); - break; - - case GNC_DENOM_FIXED: - if(in.denom != denom) { - return gnc_numeric_error(GNC_ERROR_DENOM_DIFF); - } - else { - return in; - } - break; - - case GNC_DENOM_SIGFIG: - ratio = fabs(gnc_numeric_to_double(in)); - if(ratio < 10e-20) { - logratio = 0; - } - else { - logratio = log10(ratio); - logratio = ((logratio > 0.0) ? - (floor(logratio)+1.0) : (ceil(logratio))); - } - sigfigs = GNC_NUMERIC_GET_SIGFIGS(how); - - if(sigfigs-logratio >= 0) { - denom = (gint64)(pow(10, sigfigs-logratio)); - } - else { - denom = -((gint64)(pow(10, logratio-sigfigs))); - } - - how = how & ~GNC_DENOM_SIGFIG & ~GNC_NUMERIC_SIGFIGS_MASK; - break; - - case GNC_DENOM_LCD: - /* this is a no-op. */ - default: - break; - } - } - - /* make sure we need to do the work */ - if(in.denom == denom) { - return in; - } - - /* if the denominator of the input value is negative, get rid of that. */ - if(in.denom < 0) { - in.num = in.num * (- in.denom); - in.denom = 1; - } - - sign = (in.num < 0) ? -1 : 1; - - /* if the denominator is less than zero, we are to interpret it as - * the reciprocal of its magnitude. */ - if(denom < 0) { - denom = - denom; - denom_neg = 1; - temp_a = (in.num < 0) ? -in.num : in.num; - temp_bc = in.denom * denom; - remainder = in.num % temp_bc; - out.num = in.num / temp_bc; - out.denom = - denom; - } - else { - /* do all the modulo and int division on positive values to make - * things a little clearer. Reduce the fraction denom/in.denom to - * help with range errors (FIXME : need bigger intermediate rep) */ - temp.num = denom; - temp.denom = in.denom; - temp = gnc_numeric_reduce(temp); - - out.num = in.num * temp.num; - out.num = (out.num < 0) ? -out.num : out.num; - remainder = out.num % temp.denom; - out.num = out.num / temp.denom; - out.denom = denom; - } - - if(remainder > 0) { - switch(how) { - case GNC_RND_FLOOR: - if(sign < 0) { - out.num = out.num + 1; - } - break; - - case GNC_RND_CEIL: - if(sign > 0) { - out.num = out.num + 1; - } - break; - - case GNC_RND_TRUNC: - break; - - case GNC_RND_PROMOTE: - out.num = out.num + 1; - break; - - case GNC_RND_ROUND_HALF_DOWN: - if(denom_neg) { - if((2 * remainder) > in.denom*denom) { - out.num = out.num + 1; - } - } - else if((2 * remainder) > temp.denom) { - out.num = out.num + 1; - } - break; - - case GNC_RND_ROUND_HALF_UP: - if(denom_neg) { - if((2 * remainder) >= in.denom*denom) { - out.num = out.num + 1; - } - } - else if((2 * remainder ) >= temp.denom) { - out.num = out.num + 1; - } - break; - - case GNC_RND_ROUND: - if(denom_neg) { - if((2 * remainder) > in.denom*denom) { - out.num = out.num + 1; - } - else if((2 * remainder) == in.denom*denom) { - if(out.num % 2) { - out.num = out.num + 1; - } - } - } - else { - if((2 * remainder ) > temp.denom) { - out.num = out.num + 1; - } - else if((2 * remainder) == temp.denom) { - if(out.num % 2) { - out.num = out.num + 1; - } - } - } - break; - - case GNC_RND_NEVER: - return gnc_numeric_error(GNC_ERROR_REMAINDER); - break; - } - } - - out.num = (sign > 0) ? out.num : (-out.num); - - return out; -} - - -/******************************************************************** - * gnc_numeric_lcd - * Find the least common multiple of the denominators of - * a and b - ********************************************************************/ - -gint64 -gnc_numeric_lcd(gnc_numeric a, gnc_numeric b) { - gint64 current_divisor = 2; - gint64 max_square; - gint64 three_count = 0; - gint64 small_denom; - gint64 big_denom; - - if(gnc_numeric_check(a) || gnc_numeric_check(b)) { - return GNC_ERROR_ARG; - } - - if(b.denom < a.denom) { - small_denom = b.denom; - big_denom = a.denom; - } - else { - small_denom = a.denom; - big_denom = b.denom; - } - - /* special case: smaller divides smoothly into larger */ - if((big_denom % small_denom) == 0) { - return big_denom; - } - - max_square = small_denom; - - /* the LCM algorithm : take the union of the prime factors of the - * two args and multiply them together. To do this, we find the - * successive prime factors of the smaller denominator and eliminate - * them from the larger denominator, then multiply the smaller by - * the remains of the larger. */ - while(current_divisor * current_divisor <= max_square) { - if(((small_denom % current_divisor) == 0) && - ((big_denom % current_divisor) == 0)) { - big_denom = big_denom / current_divisor; - } - else { - if(current_divisor == 2) { - current_divisor++; - } - else if(three_count == 3) { - current_divisor += 4; - three_count = 1; - } - else { - current_divisor += 2; - three_count++; - } - } - - if((current_divisor > small_denom) || - (current_divisor > big_denom)) { - break; - } - } - - return small_denom * big_denom; - -} - - -/******************************************************************** - * gnc_numeric_reduce - * reduce a fraction by GCF elimination. This is NOT done as a - * part of the arithmetic API unless GNC_DENOM_REDUCE is specified - * as the output denominator. - ********************************************************************/ - -gnc_numeric -gnc_numeric_reduce(gnc_numeric in) { - - gint64 current_divisor = 2; - gint64 max_square; - gint64 num = (in.num < 0) ? (- in.num) : in.num ; - gint64 denom = in.denom; - int three_count = 0; - gnc_numeric out; - - if(gnc_numeric_check(in)) { - return gnc_numeric_error(GNC_ERROR_ARG); - } - - /* the strategy is to eliminate common factors from - * 2 up to 'max', where max is the smaller of the smaller - * part of the fraction and the sqrt of the larger part of - * the fraction. There's also the special case of the - * smaller of fraction parts being a common factor. - * - * we test for 2 and 3 first, and thereafter skip all even numbers - * and all odd multiples of 3 (that's every third odd number, - * i.e. 9, 15, 21), thus the three_count stuff. */ - - /* special case: one side divides evenly by the other */ - if (num == 0) { - denom = 1; - } - else if((num > denom) && (num % denom == 0)) { - num = num / denom; - denom = 1; - } - else if ((num <= denom) && (denom % num == 0)) { - denom = denom / num; - num = 1; - } - - max_square = (num > denom) ? denom : num; - - /* normal case: test 2, then 3, 5, 7, 11, etc. - * (skip multiples of 2 and 3) */ - while(current_divisor * current_divisor <= max_square) { - if((num % current_divisor == 0) && - (denom % current_divisor == 0)) { - num = num / current_divisor; - denom = denom / current_divisor; - } - else { - if(current_divisor == 2) { - current_divisor++; - } - else if(three_count == 3) { - current_divisor += 4; - three_count = 1; - } - else { - current_divisor += 2; - three_count++; - } - } - - if((current_divisor > num) || - (current_divisor > denom)) { - break; - } - } - - /* all calculations are done on positive num, since it's not - * well defined what % does for negative values */ - out.num = (in.num < 0) ? (- num) : num; - out.denom = denom; - return out; -} - -/******************************************************************** - * double_to_gnc_numeric - ********************************************************************/ - -gnc_numeric -double_to_gnc_numeric(double in, gint64 denom, gint how) { - gnc_numeric out; - gint64 int_part=0; - double frac_part; - gint64 frac_int=0; - double logval; - double sigfigs; - - if((denom == GNC_DENOM_AUTO) && (how & GNC_DENOM_SIGFIG)) { - if(fabs(in) < 10e-20) { - logval = 0; - } - else { - logval = log10(fabs(in)); - logval = ((logval > 0.0) ? - (floor(logval)+1.0) : (ceil(logval))); - } - sigfigs = GNC_NUMERIC_GET_SIGFIGS(how); - if(sigfigs-logval >= 0) { - denom = (gint64)(pow(10, sigfigs-logval)); - } - else { - denom = -((gint64)(pow(10, logval-sigfigs))); - } - - how = how & ~GNC_DENOM_SIGFIG & ~GNC_NUMERIC_SIGFIGS_MASK; - } - - int_part = (gint64)(floor(fabs(in))); - frac_part = in - (double)int_part; - - int_part = int_part * denom; - frac_part = frac_part * (double)denom; - - switch(how & GNC_NUMERIC_RND_MASK) { - case GNC_RND_FLOOR: - frac_int = (gint64)floor(frac_part); - break; - - case GNC_RND_CEIL: - frac_int = (gint64)ceil(frac_part); - break; - - case GNC_RND_TRUNC: - frac_int = (gint64)frac_part; - break; - - case GNC_RND_ROUND: - case GNC_RND_ROUND_HALF_UP: - frac_int = (gint64)rint(frac_part); - break; - - case GNC_RND_NEVER: - frac_int = (gint64)floor(frac_part); - if(frac_part != (double) frac_int) { - /* signal an error */ - } - break; - } - - out.num = int_part + frac_int; - out.denom = denom; - return out; -} - -/******************************************************************** - * gnc_numeric_to_double - ********************************************************************/ - -double -gnc_numeric_to_double(gnc_numeric in) { - if(in.denom >= 0) { - return (double)in.num/(double)in.denom; - } - else { - return (double)(in.num * in.denom); - } -} - - -/******************************************************************** - * gnc_numeric_create - ********************************************************************/ - -gnc_numeric -gnc_numeric_create(gint64 num, gint64 denom) { - gnc_numeric out; - out.num = num; - out.denom = denom; - return out; -} - - -/******************************************************************** - * gnc_numeric_error - ********************************************************************/ - -gnc_numeric -gnc_numeric_error(int error_code) { - if(abs(error_code) < 5) { - /* PERR("%s", _numeric_error_strings[ - error_code]); */ - } - return gnc_numeric_create(error_code, 0LL); -} - - -/******************************************************************** - * gnc_numeric_zero - ********************************************************************/ - -gnc_numeric -gnc_numeric_zero(void) { - return gnc_numeric_create(0LL, 1LL); -} - - -/******************************************************************** - * gnc_numeric_num - ********************************************************************/ - -gint64 -gnc_numeric_num(gnc_numeric a) { - return a.num; -} - - -/******************************************************************** - * gnc_numeric_denom - ********************************************************************/ - -gint64 -gnc_numeric_denom(gnc_numeric a) { - return a.denom; -} - - -/******************************************************************** - * gnc_numeric_add_with_error - ********************************************************************/ - -gnc_numeric -gnc_numeric_add_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error) { - - gnc_numeric sum = gnc_numeric_add(a, b, denom, how); - gnc_numeric exact = gnc_numeric_add(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - gnc_numeric err = gnc_numeric_sub(sum, exact, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - - if(error) { - *error = err; - } - return sum; -} - -/******************************************************************** - * gnc_numeric_sub_with_error - ********************************************************************/ - -gnc_numeric -gnc_numeric_sub_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error) { - - gnc_numeric diff = gnc_numeric_sub(a, b, denom, how); - gnc_numeric exact = gnc_numeric_sub(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - gnc_numeric err = gnc_numeric_sub(diff, exact, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - if(error) { - *error = err; - } - return diff; -} - - -/******************************************************************** - * gnc_numeric_mul_with_error - ********************************************************************/ - -gnc_numeric -gnc_numeric_mul_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error) { - - gnc_numeric prod = gnc_numeric_mul(a, b, denom, how); - gnc_numeric exact = gnc_numeric_mul(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - gnc_numeric err = gnc_numeric_sub(prod, exact, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - if(error) { - *error = err; - } - return prod; -} - - -/******************************************************************** - * gnc_numeric_div_with_error - ********************************************************************/ - -gnc_numeric -gnc_numeric_div_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error) { - - gnc_numeric quot = gnc_numeric_div(a, b, denom, how); - gnc_numeric exact = gnc_numeric_div(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE); - gnc_numeric err = gnc_numeric_sub(quot, exact, - GNC_DENOM_AUTO, GNC_DENOM_REDUCE); - if(error) { - *error = err; - } - return quot; -} - -int -gnc_numeric_check(gnc_numeric in) { - if(in.denom != 0) { - return GNC_ERROR_OK; - } - else if(in.num) { - return in.num; - } - else { - return GNC_ERROR_ARG; - } -} - -/******************************************************************** - * gnc_numeric text IO - ********************************************************************/ - -gchar * -gnc_numeric_to_string(gnc_numeric n) { - gchar *result; - long long int tmpnum = n.num; - long long int tmpdenom = n.denom; - - result = g_strdup_printf("%lld/%lld", tmpnum, tmpdenom); - - return result; -} - -const gchar * -string_to_gnc_numeric(const gchar* str, gnc_numeric *n) { - int num_read; - long long int tmpnum; - long long int tmpdenom; - - if(!str) return NULL; - - /* must use "<" here because %n's effects aren't well defined */ - if(sscanf(str, " " GNC_SCANF_LLD "/" GNC_SCANF_LLD "%n", - &tmpnum, &tmpdenom, &num_read) < 2) { - return(NULL); - } - n->num = tmpnum; - n->denom = tmpdenom; - return(str + num_read); -} - -#ifdef _GNC_NUMERIC_TEST - -static char * -gnc_numeric_print(gnc_numeric in) { - char * retval; - if(gnc_numeric_check(in)) { - retval = g_strdup_printf(" [%lld / %lld]", - (long long int) in.num, - (long long int) in.denom); - } - else { - retval = g_strdup_printf("[%lld / %lld]", - (long long int) in.num, - (long long int) in.denom); - } - return retval; -} - -int -main(int argc, char ** argv) { - gnc_numeric a = gnc_numeric_create(1, 3); - gnc_numeric b = gnc_numeric_create(1, 4); - gnc_numeric c; - gnc_numeric d = gnc_numeric_create(1, 2); - - gnc_numeric err; - int i; - - printf("add exact : %s + %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_add(a, b, - GNC_DENOM_AUTO, - GNC_DENOM_EXACT))); - - - printf("add least : %s + %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_add(a, b, - GNC_DENOM_AUTO, - GNC_DENOM_REDUCE))); - - printf("add 100ths (banker's): %s + %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_add(a, b, 100, - GNC_RND_ROUND))); - - c = gnc_numeric_add_with_error(a, b, 100, GNC_RND_ROUND, &err); - printf("add 100ths/error : %s + %s = %s + (error) %s\n\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(c), - gnc_numeric_print(err)); - - printf("sub exact : %s - %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_sub(a, b, GNC_DENOM_AUTO, - GNC_DENOM_EXACT))); - - printf("sub least : %s - %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_sub(a, b, - GNC_DENOM_AUTO, - GNC_DENOM_REDUCE))); - - printf("sub 100ths : %s - %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_sub(a, b, 100, - GNC_RND_ROUND))); - - c = gnc_numeric_sub_with_error(a, b, 100, GNC_RND_FLOOR, &err); - printf("sub 100ths/error : %s - %s = %s + (error) %s\n\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(c), - gnc_numeric_print(err)); - - printf("mul exact : %s * %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_mul(a, b, GNC_DENOM_AUTO, - GNC_DENOM_EXACT))); - - printf("mul least : %s * %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_mul(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE))); - - printf("mul 100ths : %s * %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_mul(a, b, 100, - GNC_RND_ROUND))); - - c = gnc_numeric_mul_with_error(a, b, 100, GNC_RND_ROUND, &err); - printf("mul 100ths/error : %s * %s = %s + (error) %s\n\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(c), - gnc_numeric_print(err)); - - printf("div exact : %s / %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_div(a, b, GNC_DENOM_AUTO, - GNC_DENOM_EXACT))); - - printf("div least : %s / %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_div(a, b, GNC_DENOM_AUTO, - GNC_DENOM_REDUCE))); - - printf("div 100ths : %s / %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_div(a, b, 100, - GNC_RND_ROUND))); - - c = gnc_numeric_div_with_error(a, b, 100, GNC_RND_ROUND, &err); - printf("div 100ths/error : %s / %s = %s + (error) %s\n\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(c), - gnc_numeric_print(err)); - - printf("7/16 as float: %e\n", - gnc_numeric_to_double(gnc_numeric_create(7, 16))); - - printf("7/16 as 100ths (floor): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(7, 16), - 100, GNC_RND_FLOOR))); - printf("7/16 as 100ths (ceil): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(7, 16), - 100, GNC_RND_CEIL))); - printf("7/16 as 100ths (trunc): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(7, 16), - 100, GNC_RND_TRUNC))); - printf("7/16 as 100ths (round): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(7, 16), - 100, GNC_RND_ROUND))); - - printf("1511/1000 as 1/100 (round): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(1511, 1000), - 100, GNC_RND_ROUND))); - printf("1516/1000 as 1/100 (round): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(1516, 1000), - 100, GNC_RND_ROUND))); - printf("1515/1000 as 1/100 (round): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(1515, 1000), - 100, GNC_RND_ROUND))); - printf("1525/1000 as 1/100 (round): %s\n", - gnc_numeric_print(gnc_numeric_convert(gnc_numeric_create(1525, 1000), - 100, GNC_RND_ROUND))); - - printf("100023234 / 334216654 reduced: %s\n", - gnc_numeric_print(gnc_numeric_reduce(gnc_numeric_create(10023234LL, - 334216654LL)))); - printf("2^10*3^10*17^2 / 2^8*3^12 reduced: %s\n", - gnc_numeric_print - (gnc_numeric_reduce(gnc_numeric_create(17474724864LL, - 136048896LL)))); - printf("1024 / 1024^4 reduced: %s\n", - gnc_numeric_print - (gnc_numeric_reduce(gnc_numeric_create(1024LL, - 1099511627776LL)))); - printf("reducing 100,000 times:\n\n"); - for(i = 0; i < 100000; i++) { - gnc_numeric_reduce(gnc_numeric_create(17474724864LL, - 136048896LL)); - } - - printf("add LCM: %s + %s = %s\n", - gnc_numeric_print(b), gnc_numeric_print(d), - gnc_numeric_print(gnc_numeric_add(b, d, GNC_DENOM_AUTO, - GNC_DENOM_LCD))); - - printf("float to 6 sigfigs: %s\n", - gnc_numeric_print(double_to_gnc_numeric(1.1234567890123, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(6) | - GNC_RND_ROUND))); - printf("float to 6 sigfigs: %s\n", - gnc_numeric_print(double_to_gnc_numeric(.011234567890123, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(6) | - GNC_RND_ROUND))); - printf("float to 6 sigfigs: %s\n", - gnc_numeric_print(double_to_gnc_numeric(1123.4567890123, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(6) | - GNC_RND_ROUND))); - printf("float to 6 sigfigs: %s\n", - gnc_numeric_print(double_to_gnc_numeric(1.1234567890123e-5, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(6) | - GNC_RND_ROUND))); - printf("add to 4 sigfigs: %s + %s = %s\n", - gnc_numeric_print(a), gnc_numeric_print(b), - gnc_numeric_print(gnc_numeric_add(a, b, - GNC_DENOM_AUTO, - GNC_DENOM_SIGFIGS(4) | - GNC_RND_ROUND))); - - - return 0; -} -#endif diff --git a/src/engine/gnc-numeric.h b/src/engine/gnc-numeric.h deleted file mode 100644 index 313a506aad..0000000000 --- a/src/engine/gnc-numeric.h +++ /dev/null @@ -1,167 +0,0 @@ -/******************************************************************** - * gnc-numeric.h -- an exact-number library for gnucash. * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#ifndef GNC_NUMERIC_H -#define GNC_NUMERIC_H - -#include - -struct _gnc_numeric { - gint64 num; - gint64 denom; -}; - -typedef struct _gnc_numeric gnc_numeric; - -/* bitmasks for HOW flags */ -#define GNC_NUMERIC_RND_MASK 0x0000000f -#define GNC_NUMERIC_DENOM_MASK 0x000000f0 -#define GNC_NUMERIC_SIGFIGS_MASK 0x0000ff00 - -/* rounding/truncation modes for operations */ -enum { - GNC_RND_FLOOR = 0x01, - GNC_RND_CEIL = 0x02, - GNC_RND_TRUNC = 0x03, - GNC_RND_PROMOTE = 0x04, - GNC_RND_ROUND_HALF_DOWN = 0x05, - GNC_RND_ROUND_HALF_UP = 0x06, - GNC_RND_ROUND = 0x07, - GNC_RND_NEVER = 0x08 -}; - -/* auto-denominator types */ -enum { - GNC_DENOM_EXACT = 0x10, - GNC_DENOM_REDUCE = 0x20, - GNC_DENOM_LCD = 0x30, - GNC_DENOM_FIXED = 0x40, - GNC_DENOM_SIGFIG = 0x50 -}; - -/* bits 8-15 of 'how' are reserved for the number of significant - * digits to use in the output with GNC_DENOM_SIGFIG */ - -/* errors */ -enum { - GNC_ERROR_OK = 0, - GNC_ERROR_ARG = -1, - GNC_ERROR_OVERFLOW = -2, - GNC_ERROR_DENOM_DIFF = -3, - GNC_ERROR_REMAINDER = -4 -}; - -#define GNC_DENOM_AUTO 0 - -#define GNC_DENOM_RECIPROCAL( a ) (- ( a )) -#define GNC_DENOM_SIGFIGS( a ) ( ((( a ) & 0xff) << 8) | GNC_DENOM_SIGFIG) -#define GNC_NUMERIC_GET_SIGFIGS( a ) ( (( a ) & 0xff00 ) >> 8) - -/* make a gnc_numeric from numerator and denominator */ -gnc_numeric gnc_numeric_create(gint64 num, gint64 denom); - -/* create a zero-value gnc_numeric */ -gnc_numeric gnc_numeric_zero(void); - -/* make a special error-signalling gnc_numeric */ -gnc_numeric gnc_numeric_error(int error_code); - -/* check for error signal in value */ -int gnc_numeric_check(gnc_numeric a); - -/* get parts */ -gint64 gnc_numeric_num(gnc_numeric a); -gint64 gnc_numeric_denom(gnc_numeric a); - -/* tests */ -int gnc_numeric_zero_p(gnc_numeric a); /* 1 if 0, 0 else */ -int gnc_numeric_compare(gnc_numeric a, gnc_numeric b); -int gnc_numeric_negative_p(gnc_numeric a); -int gnc_numeric_positive_p(gnc_numeric a); - -/* equivalence predicates : - * eq : a and b are exactly the same (same numerator and denominator) - * equal : a and b represent exactly the same number (ratio of numerator - * to denominator is exactly equal) - * same : after both are converted to DENOM using method HOW, a and b - * are equal(). - */ -int gnc_numeric_eq(gnc_numeric a, gnc_numeric b); -int gnc_numeric_equal(gnc_numeric a, gnc_numeric b); -int gnc_numeric_same(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how); - -/* arithmetic operations */ -gnc_numeric gnc_numeric_add(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how); -gnc_numeric gnc_numeric_sub(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how); -gnc_numeric gnc_numeric_mul(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how); -gnc_numeric gnc_numeric_div(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how); -gnc_numeric gnc_numeric_neg(gnc_numeric a); -gnc_numeric gnc_numeric_abs(gnc_numeric a); - -/* some shortcuts for common operations */ -gnc_numeric gnc_numeric_add_fixed(gnc_numeric a, gnc_numeric b); -gnc_numeric gnc_numeric_sub_fixed(gnc_numeric a, gnc_numeric b); - -/* arithmetic functions with exact error returns */ -gnc_numeric gnc_numeric_add_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error); -gnc_numeric gnc_numeric_sub_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error); -gnc_numeric gnc_numeric_mul_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error); -gnc_numeric gnc_numeric_div_with_error(gnc_numeric a, gnc_numeric b, - gint64 denom, gint how, - gnc_numeric * error); - -/* change the denominator of a gnc_numeric value */ -gnc_numeric gnc_numeric_convert(gnc_numeric in, gint64 denom, - gint how); - -gnc_numeric gnc_numeric_convert_with_error(gnc_numeric in, gint64 denom, - gint how, - gnc_numeric * error); - -/* reduce by GCF elimination */ -gnc_numeric gnc_numeric_reduce(gnc_numeric in); - -/* convert to and from floating-point values */ -gnc_numeric double_to_gnc_numeric(double in, gint64 denom, - gint how); -double gnc_numeric_to_double(gnc_numeric in); - -gchar *gnc_numeric_to_string(gnc_numeric n); - -/* Read a gnc_numeric from str, skipping any leading whitespace, and - returning a pointer to just past the last byte read. Return NULL - on error. */ -const gchar *string_to_gnc_numeric(const gchar* str, gnc_numeric *n); - -#endif diff --git a/src/scm/gnc-numeric.scm b/src/engine/gnc-numeric.scm similarity index 97% rename from src/scm/gnc-numeric.scm rename to src/engine/gnc-numeric.scm index 694f51982e..986645cb5f 100644 --- a/src/scm/gnc-numeric.scm +++ b/src/engine/gnc-numeric.scm @@ -21,8 +21,6 @@ ;; Boston, MA 02111-1307, USA gnu@gnu.org ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "gnc-numeric.scm") - ;; use 'logior' in guile to bit-combine RND and DENOM flags. (define GNC-RND-FLOOR 1) @@ -65,7 +63,7 @@ (define gnc:gnc-numeric-denom (record-accessor 'denom)) -(define (gnc:numeric-denom-reciprocal arg) +(define (gnc:gnc-numeric-denom-reciprocal arg) (- arg)) diff --git a/src/engine/gnc-pricedb-p.h b/src/engine/gnc-pricedb-p.h deleted file mode 100644 index f4f0063727..0000000000 --- a/src/engine/gnc-pricedb-p.h +++ /dev/null @@ -1,89 +0,0 @@ -/******************************************************************** - * gnc-pricedb-p.h -- a simple price database for gnucash. * - * Copyright (C) 2001 Rob Browning * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#ifndef GNC_PRICEDB_P_H -#define GNC_PRICEDB_P_H - -#include - -#include "gnc-book.h" -#include "BackendP.h" -#include "gnc-pricedb.h" - -struct _GNCPrice { - /* 'public' data fields */ - GUID guid; /* globally unique price id */ - GNCPriceDB *db; - gnc_commodity *commodity; - gnc_commodity *currency; - Timespec time; - char *source; - char *type; - gnc_numeric value; - gint32 version; /* version number, for syncing with backend */ - guint32 version_check; /* data aging timestamp */ - - /* 'private' object management fields */ - guint32 refcount; /* garbage collection reference count */ - gint32 editlevel; /* nesting level of begin/end edit calls */ - gboolean not_saved; /* price edit saved flag */ - gboolean do_free; /* price is going to be destroyed soon */ -}; - - - -struct _GNCPriceDB { - GHashTable *commodity_hash; - Backend *backend; - gboolean dirty; -}; - -/* These structs define the kind of price lookup being done - * so that it can be passed to the backend. This is a rather - * cheesy, low-brow interface. It could stand improvement. - */ -typedef enum { - LOOKUP_LATEST = 1, - LOOKUP_ALL, - LOOKUP_AT_TIME, - LOOKUP_NEAREST_IN_TIME, - LOOKUP_LATEST_BEFORE, - LOOKUP_EARLIEST_AFTER -} PriceLookupType; - - -struct _GNCPriceLookup { - PriceLookupType type; - GNCPriceDB *prdb; - gnc_commodity *commodity; - gnc_commodity *currency; - Timespec date; -}; - -void gnc_pricedb_mark_clean(GNCPriceDB *db); -void gnc_pricedb_substitute_commodity(GNCPriceDB *db, - gnc_commodity *old_c, - gnc_commodity *new_c); -void gnc_price_set_guid (GNCPrice *p, const GUID *guid); - -#endif diff --git a/src/engine/gnc-pricedb.c b/src/engine/gnc-pricedb.c deleted file mode 100644 index dc4016a95e..0000000000 --- a/src/engine/gnc-pricedb.c +++ /dev/null @@ -1,1257 +0,0 @@ -/******************************************************************** - * gnc-pricedb.c -- a simple price database for gnucash. * - * Copyright (C) 2001 Rob Browning, Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#include "config.h" - -#include -#include - -#include "Backend.h" -#include "GNCId.h" -#include "GNCIdP.h" -#include "gnc-engine.h" -#include "gnc-engine-util.h" -#include "gnc-event.h" -#include "gnc-event-p.h" -#include "gnc-pricedb.h" -#include "gnc-pricedb-p.h" -#include "guid.h" - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_PRICE; - -static gboolean add_price(GNCPriceDB *db, GNCPrice *p); -static gboolean remove_price(GNCPriceDB *db, GNCPrice *p, gboolean cleanup); - -/* ==================================================================== */ -/* GNCPrice functions - */ - -/* allocation */ -GNCPrice * -gnc_price_create(void) -{ - GNCPrice *p = g_new0(GNCPrice, 1); - ENTER(" "); - p->refcount = 1; - p->editlevel = 0; - p->not_saved = FALSE; - p->do_free = FALSE; - p->version = 0; - p->version_check = 0; - xaccGUIDNew (&p->guid); - xaccStoreEntity(p, &p->guid, GNC_ID_PRICE); - gnc_engine_generate_event (&p->guid, GNC_EVENT_CREATE); - return p; -} - -static void -gnc_price_destroy (GNCPrice *p) -{ - ENTER(" "); - gnc_engine_generate_event (&p->guid, GNC_EVENT_DESTROY); - xaccRemoveEntity(&p->guid); - - if(p->type) g_cache_remove(gnc_engine_get_string_cache(), p->type); - if(p->source) g_cache_remove(gnc_engine_get_string_cache(), p->source); - - memset(p, 0, sizeof(GNCPrice)); - g_free(p); -} - -void -gnc_price_ref(GNCPrice *p) -{ - if(!p) return; - p->refcount++; -} - -void -gnc_price_unref(GNCPrice *p) -{ - if(!p) return; - ENTER("pr=%p refcount=%d", p, p->refcount); - if(p->refcount == 0) { - PERR("refcount == 0 !!!!"); - assert(p->refcount != 0); - } - - p->refcount--; - - if(p->refcount <= 0) { - if (NULL != p->db) { - PERR("last unref while price in database"); - } - gnc_price_destroy (p); - } -} - -/* ==================================================================== */ - -GNCPrice * -gnc_price_clone(GNCPrice* p) -{ - /* the clone doesn't belong to a PriceDB */ - GNCPrice *new_p; - - ENTER ("pr=%p", p); - if(!p) return NULL; - new_p = gnc_price_create(); - if(!new_p) return NULL; - - new_p->version = p->version; - - gnc_price_begin_edit(new_p); - /* never ever clone guid's */ - gnc_price_set_commodity(new_p, gnc_price_get_commodity(p)); - gnc_price_set_time(new_p, gnc_price_get_time(p)); - gnc_price_set_source(new_p, gnc_price_get_source(p)); - gnc_price_set_type(new_p, gnc_price_get_type(p)); - gnc_price_set_value(new_p, gnc_price_get_value(p)); - gnc_price_set_currency(new_p, gnc_price_get_currency(p)); - gnc_price_commit_edit(new_p); - - return(new_p); -} - -/* ==================================================================== */ - -void -gnc_price_begin_edit (GNCPrice *p) -{ - if (!p) return; - p->editlevel++; - if (1 < p->editlevel) return; - ENTER ("pr=%p, not-saved=%d do-free=%d", p, p->not_saved, p->do_free); - - if (0 >= p->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", p->editlevel); - p->editlevel = 1; - } - - /* See if there's a backend. If there is, invoke it. */ - /* We may not be able to find the backend, so make not of that .. */ - if (p->db) { - Backend *be; - be = xaccPriceDBGetBackend (p->db); - if (be && be->price_begin_edit) { - (be->price_begin_edit) (be, p); - } - p->not_saved = FALSE; - } else { - p->not_saved = TRUE; - } - - LEAVE ("pr=%p, not-saved=%d do-free=%d", p, p->not_saved, p->do_free); -} - -void -gnc_price_commit_edit (GNCPrice *p) -{ - if (!p) return; - - p->editlevel--; - if (0 < p->editlevel) return; - - ENTER ("pr=%p, not-saved=%d do-free=%d", p, p->not_saved, p->do_free); - if (0 > p->editlevel) - { - PERR ("unbalanced call - resetting (was %d)", p->editlevel); - p->editlevel = 0; - } - - /* See if there's a backend. If there is, invoke it. */ - /* We may not be able to find the backend, so make not of that .. */ - if (p->db) { - Backend *be; - be = xaccPriceDBGetBackend (p->db); - if (be && be->price_commit_edit) { - GNCBackendError errcode; - - /* clear errors */ - do { - errcode = xaccBackendGetError (be); - } while (ERR_BACKEND_NO_ERR != errcode); - - /* if we haven't been able to call begin edit before, call it now */ - if (TRUE == p->not_saved) { - if (be->price_begin_edit) { - (be->price_begin_edit) (be, p); - } - } - - (be->price_commit_edit) (be, p); - errcode = xaccBackendGetError (be); - if (ERR_BACKEND_NO_ERR != errcode) - { - /* XXX hack alert FIXME implement price rollback */ - PERR (" backend asked engine to rollback, but this isn't" - " handled yet. Return code=%d", errcode); - - /* push error back onto the stack */ - xaccBackendSetError (be, errcode); - } - } - p->not_saved = FALSE; - } else { - p->not_saved = TRUE; - } - LEAVE ("pr=%p, not-saved=%d do-free=%d", p, p->not_saved, p->do_free); -} - -/* ==================================================================== */ -/* setters */ - -void -gnc_price_set_guid (GNCPrice *p, const GUID *guid) -{ - if (!p || !guid) return; - xaccRemoveEntity (&p->guid); - p->guid = *guid; - if(p->db) p->db->dirty = TRUE; - xaccStoreEntity(p, &p->guid, GNC_ID_PRICE); -} - -void -gnc_price_set_commodity(GNCPrice *p, gnc_commodity *c) -{ - if(!p) return; - - if(!gnc_commodity_equiv(p->commodity, c)) - { - /* Changing the commodity requires the hash table - * position to be modified. The easiest way of doing - * this is to remove and reinsert. */ - gnc_price_ref (p); - remove_price (p->db, p, TRUE); - gnc_price_begin_edit (p); - p->commodity = c; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - add_price (p->db, p); - gnc_price_unref (p); - } -} - - -void -gnc_price_set_currency(GNCPrice *p, gnc_commodity *c) -{ - if(!p) return; - - if(!gnc_commodity_equiv(p->currency, c)) - { - /* Changing the currency requires the hash table - * position to be modified. The easiest way of doing - * this is to remove and reinsert. */ - gnc_price_ref (p); - remove_price (p->db, p, TRUE); - gnc_price_begin_edit (p); - p->currency = c; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - add_price (p->db, p); - gnc_price_unref (p); - } -} - -void -gnc_price_set_time(GNCPrice *p, Timespec t) -{ - if(!p) return; - if(!timespec_equal(&(p->time), &t)) - { - /* Changing the datesatamp requires the hash table - * position to be modified. The easiest way of doing - * this is to remove and reinsert. */ - remove_price (p->db, p, FALSE); - gnc_price_begin_edit (p); - p->time = t; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - add_price (p->db, p); - } -} - -void -gnc_price_set_source(GNCPrice *p, const char *s) -{ - if(!p) return; - if(safe_strcmp(p->source, s) != 0) - { - GCache *cache; - char *tmp; - - gnc_price_begin_edit (p); - cache = gnc_engine_get_string_cache(); - tmp = g_cache_insert(cache, (gpointer) s); - if(p->source) g_cache_remove(cache, p->source); - p->source = tmp; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - } -} - -void -gnc_price_set_type(GNCPrice *p, const char* type) -{ - if(!p) return; - if(safe_strcmp(p->type, type) != 0) - { - GCache *cache; - gchar *tmp; - - gnc_price_begin_edit (p); - cache = gnc_engine_get_string_cache(); - tmp = g_cache_insert(cache, (gpointer) type); - if(p->type) g_cache_remove(cache, p->type); - p->type = tmp; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - } -} - -void -gnc_price_set_value(GNCPrice *p, gnc_numeric value) -{ - if(!p) return; - if(!gnc_numeric_eq(p->value, value)) - { - gnc_price_begin_edit (p); - p->value = value; - if(p->db) p->db->dirty = TRUE; - gnc_price_commit_edit (p); - } -} - -void -gnc_price_set_version(GNCPrice *p, gint32 vers) -{ - /* begin/end edit is inappropriate here, this is a backend thing only. */ - if(!p) return; - p->version = vers; -} - - -/* ==================================================================== */ -/* getters */ - -GNCPrice * -gnc_price_lookup (const GUID *guid) -{ - if (!guid) return NULL; - return xaccLookupEntity (guid, GNC_ID_PRICE); -} - -const GUID * -gnc_price_get_guid (GNCPrice *p) -{ - if (!p) return xaccGUIDNULL(); - return &p->guid; -} - -gnc_commodity * -gnc_price_get_commodity(GNCPrice *p) -{ - if(!p) return NULL; - return p->commodity; -} - -Timespec -gnc_price_get_time(GNCPrice *p) -{ - if(!p) { - Timespec result; - result.tv_sec = 0; - result.tv_nsec = 0; - return result; - } - return p->time; -} - -const char * -gnc_price_get_source(GNCPrice *p) -{ - if(!p) return NULL; - return p->source; -} - -const char * -gnc_price_get_type(GNCPrice *p) -{ - if(!p) return NULL; - return p->type; -} - -gnc_numeric -gnc_price_get_value(GNCPrice *p) -{ - if(!p) { - PERR("price NULL.\n"); - return gnc_numeric_zero(); - } - return p->value; -} - -gnc_commodity * -gnc_price_get_currency(GNCPrice *p) -{ - if(!p) return NULL; - return p->currency; -} - -gint32 -gnc_price_get_version(GNCPrice *p) -{ - if(!p) return 0; - return (p->version); -} - -gboolean -gnc_price_equal (GNCPrice *p1, GNCPrice *p2) -{ - Timespec ts1; - Timespec ts2; - - if (p1 == p2) return TRUE; - if (!p1 || !p2) return FALSE; - - if (!gnc_commodity_equiv (gnc_price_get_commodity (p1), - gnc_price_get_commodity (p2))) - return FALSE; - - if (!gnc_commodity_equiv (gnc_price_get_currency (p1), - gnc_price_get_currency (p2))) - return FALSE; - - ts1 = gnc_price_get_time (p1); - ts2 = gnc_price_get_time (p2); - - if (!timespec_equal (&ts1, &ts2)) - return FALSE; - - if (!safe_strcmp (gnc_price_get_source (p1), - gnc_price_get_source (p2))) - return FALSE; - - if (!safe_strcmp (gnc_price_get_type (p1), - gnc_price_get_type (p2))) - return FALSE; - - if (!gnc_numeric_eq (gnc_price_get_value (p1), - gnc_price_get_value (p2))) - return FALSE; - - return TRUE; -} - -/* ==================================================================== */ -/* price list manipulation functions */ - -static gint -compare_prices_by_date(gconstpointer a, gconstpointer b) -{ - Timespec time_a; - Timespec time_b; - gint result; - - if(!a && !b) return 0; - /* nothing is always less than something */ - if(!a) return -1; - - time_a = gnc_price_get_time((GNCPrice *) a); - time_b = gnc_price_get_time((GNCPrice *) b); - - result = -timespec_cmp(&time_a, &time_b); - if (result) return result; - - /* For a stable sort */ - return guid_compare (gnc_price_get_guid((GNCPrice *) a), - gnc_price_get_guid((GNCPrice *) b)); -} - -gboolean -gnc_price_list_insert(GList **prices, GNCPrice *p) -{ - GList *result_list; - - if(!prices || !p) return FALSE; - gnc_price_ref(p); - result_list = g_list_insert_sorted(*prices, p, compare_prices_by_date); - if(!result_list) return FALSE; - *prices = result_list; - return TRUE; -} - -gboolean -gnc_price_list_remove(GList **prices, GNCPrice *p) -{ - GList *result_list; - GList *found_element; - - if(!prices || !p) return FALSE; - - found_element = g_list_find(*prices, p); - if(!found_element) return TRUE; - - result_list = g_list_remove_link(*prices, found_element); - gnc_price_unref((GNCPrice *) found_element->data); - g_list_free(found_element); - - *prices = result_list; - return TRUE; -} - -static void -price_list_destroy_helper(gpointer data, gpointer user_data) -{ - gnc_price_unref((GNCPrice *) data); -} - -void -gnc_price_list_destroy(GList *prices) -{ - g_list_foreach(prices, price_list_destroy_helper, NULL); - g_list_free(prices); -} - -/* ==================================================================== */ -/* GNCPriceDB functions - - Structurally a GNCPriceDB contains a hash mapping price commodities - (of type gnc_commodity*) to hashes mapping price currencies (of - type gnc_commodity*) to GNCPrice lists (see gnc-pricedb.h for a - description of GNCPrice lists). The top-level key is the commodity - you want the prices for, and the second level key is the commodity - that the value is expressed in terms of. - - */ - -GNCPriceDB * -gnc_pricedb_create(void) -{ - GNCPriceDB * result = g_new0(GNCPriceDB, 1); - result->backend = NULL; - result->commodity_hash = g_hash_table_new(g_direct_hash, g_direct_equal); - g_return_val_if_fail (result->commodity_hash, NULL); - return result; -} - -static void -destroy_pricedb_currency_hash_data(gpointer key, - gpointer data, - gpointer user_data) -{ - GList *price_list = (GList *) data; - GList *node; - - for (node = price_list; node; node = node->next) - { - GNCPrice *p = node->data; - - p->db = NULL; - } - - gnc_price_list_destroy(price_list); -} - -static void -destroy_pricedb_commodity_hash_data(gpointer key, - gpointer data, - gpointer user_data) -{ - GHashTable *currency_hash = (GHashTable *) data; - if (!currency_hash) return; - g_hash_table_foreach (currency_hash, - destroy_pricedb_currency_hash_data, - NULL); - g_hash_table_destroy(currency_hash); -} - -void -gnc_pricedb_destroy(GNCPriceDB *db) -{ - if(!db) return; - g_hash_table_foreach (db->commodity_hash, - destroy_pricedb_commodity_hash_data, - NULL); - g_hash_table_destroy (db->commodity_hash); - db->commodity_hash = NULL; - db->backend = NULL; - g_free(db); -} - -/* ==================================================================== */ - -gboolean -gnc_pricedb_dirty(GNCPriceDB *p) -{ - if(!p) return FALSE; - return p->dirty; -} - -void -gnc_pricedb_mark_clean(GNCPriceDB *p) -{ - if(!p) return; - p->dirty = FALSE; -} - -/* ==================================================================== */ - -static gboolean -num_prices_helper (GNCPrice *p, gpointer user_data) -{ - guint *count = user_data; - - *count += 1; - - return TRUE; -} - -guint -gnc_pricedb_get_num_prices(GNCPriceDB *db) -{ - guint count; - - if (!db) return 0; - - count = 0; - - gnc_pricedb_foreach_price(db, num_prices_helper, &count, FALSE); - - return count; -} - -/* ==================================================================== */ -/* The add_price() function is a utility that only manages the - * dual hash table instertion */ - -static gboolean -add_price(GNCPriceDB *db, GNCPrice *p) -{ - /* this function will use p, adding a ref, so treat p as read-only - if this function succeeds. */ - GList *price_list; - gnc_commodity *commodity; - gnc_commodity *currency; - GHashTable *currency_hash; - - if(!db || !p) return FALSE; - ENTER ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - commodity = gnc_price_get_commodity(p); - if(!commodity) { - PWARN("no commodity"); - return FALSE; - } - currency = gnc_price_get_currency(p); - if(!currency) { - PWARN("no currency"); - return FALSE; - } - if(!db->commodity_hash) return FALSE; - - currency_hash = g_hash_table_lookup(db->commodity_hash, commodity); - if(!currency_hash) { - currency_hash = g_hash_table_new(g_direct_hash, g_direct_equal); - g_hash_table_insert(db->commodity_hash, commodity, currency_hash); - } - - price_list = g_hash_table_lookup(currency_hash, currency); - if(!gnc_price_list_insert(&price_list, p)) return FALSE; - if(!price_list) return FALSE; - g_hash_table_insert(currency_hash, currency, price_list); - p->db = db; - - LEAVE ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - return TRUE; -} - -/* the gnc_pricedb_add_price() function will use p, adding a ref, so treat p as read-only - if this function succeeds. (Huh ???) */ -gboolean -gnc_pricedb_add_price(GNCPriceDB *db, GNCPrice *p) -{ - - if(!db || !p) return FALSE; - ENTER ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - - if (FALSE == add_price(db, p)) return FALSE; - - /* if we haven't been able to call the backend before, call it now */ - if (TRUE == p->not_saved) { - gnc_price_begin_edit(p); - db->dirty = TRUE; - gnc_price_commit_edit(p); - } - LEAVE ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - return TRUE; -} - -/* remove_price() is a utility; its only function is to remove the price - * from the double-hash tables. - */ - -static gboolean -remove_price(GNCPriceDB *db, GNCPrice *p, gboolean cleanup) -{ - GList *price_list; - gnc_commodity *commodity; - gnc_commodity *currency; - GHashTable *currency_hash; - - if(!db || !p) return FALSE; - ENTER ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - commodity = gnc_price_get_commodity(p); - if(!commodity) return FALSE; - currency = gnc_price_get_currency(p); - if(!currency) return FALSE; - if(!db->commodity_hash) return FALSE; - - currency_hash = g_hash_table_lookup(db->commodity_hash, commodity); - if(!currency_hash) return FALSE; - - price_list = g_hash_table_lookup(currency_hash, currency); - gnc_price_ref(p); - if(!gnc_price_list_remove(&price_list, p)) { - gnc_price_unref(p); - return FALSE; - } - - /* if the price list is empty, then remove this currency from the commodity hash */ - if(price_list) { - g_hash_table_insert(currency_hash, currency, price_list); - } else { - g_hash_table_remove(currency_hash, currency); - - if (cleanup) { - /* chances are good that this commodity had only one currency ... - * if there are no currencies, we may as well destroy the commodity too. */ - guint num_currencies = g_hash_table_size (currency_hash); - if (0 == num_currencies) { - g_hash_table_remove (db->commodity_hash, commodity); - g_hash_table_destroy (currency_hash); - } - } - } - - gnc_price_unref(p); - LEAVE ("db=%p, pr=%p", db, p); - return TRUE; -} - -gboolean -gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p) -{ - gboolean rc; - if(!db || !p) return FALSE; - ENTER ("db=%p, pr=%p not-saved=%d do-free=%d", db, p, p->not_saved, p->do_free); - - gnc_price_ref(p); - rc = remove_price (db, p, TRUE); - - /* invoke the backend to delete this price */ - gnc_price_begin_edit (p); - db->dirty = TRUE; - p->do_free = TRUE; - gnc_price_commit_edit (p); - - p->db = NULL; - gnc_price_unref(p); - LEAVE ("db=%p, pr=%p", db, p); - return rc; -} - -/* ==================================================================== */ -/* lookup/query functions */ - -GNCPrice * -gnc_pricedb_lookup_latest(GNCPriceDB *db, - gnc_commodity *commodity, - gnc_commodity *currency) -{ - GList *price_list; - GNCPrice *result; - GHashTable *currency_hash; - - ENTER ("db=%p commodity=%p currency=%p", db, commodity, currency); - if(!db || !commodity || !currency) return NULL; - - if (db->backend && db->backend->price_lookup) - { - GNCPriceLookup pl; - pl.type = LOOKUP_LATEST; - pl.prdb = db; - pl.commodity = commodity; - pl.currency = currency; - (db->backend->price_lookup) (db->backend, &pl); - } - - currency_hash = g_hash_table_lookup(db->commodity_hash, commodity); - if(!currency_hash) return NULL; - - price_list = g_hash_table_lookup(currency_hash, currency); - if(!price_list) return NULL; - - /* This works magically because prices are inserted in date-sorted order, - * and the latest date always comes first. So return the first in the list. */ - result = price_list->data; - gnc_price_ref(result); - LEAVE(" "); - return result; -} - -GList * -gnc_pricedb_get_prices(GNCPriceDB *db, - gnc_commodity *commodity, - gnc_commodity *currency) -{ - GList *price_list; - GList *result; - GList *node; - GHashTable *currency_hash; - - ENTER ("db=%p commodity=%p currency=%p", db, commodity, currency); - if(!db || !commodity || !currency) return NULL; - - if (db->backend && db->backend->price_lookup) - { - GNCPriceLookup pl; - pl.type = LOOKUP_ALL; - pl.prdb = db; - pl.commodity = commodity; - pl.currency = currency; - (db->backend->price_lookup) (db->backend, &pl); - } - - currency_hash = g_hash_table_lookup(db->commodity_hash, commodity); - if(!currency_hash) return NULL; - - price_list = g_hash_table_lookup(currency_hash, currency); - if(!price_list) return NULL; - - result = g_list_copy (price_list); - for (node = result; node; node = node->next) - gnc_price_ref (node->data); - - LEAVE (" "); - return result; -} - -GList * -gnc_pricedb_lookup_at_time(GNCPriceDB *db, - gnc_commodity *c, - gnc_commodity *currency, - Timespec t) -{ - GList *price_list; - GList *result = NULL; - GList *item = NULL; - GHashTable *currency_hash; - - ENTER ("db=%p commodity=%p currency=%p", db, c, currency); - if(!db || !c || !currency) return NULL; - - if (db->backend && db->backend->price_lookup) - { - GNCPriceLookup pl; - pl.type = LOOKUP_AT_TIME; - pl.prdb = db; - pl.commodity = c; - pl.currency = currency; - pl.date = t; - (db->backend->price_lookup) (db->backend, &pl); - } - - currency_hash = g_hash_table_lookup(db->commodity_hash, c); - if(!currency_hash) return NULL; - - price_list = g_hash_table_lookup(currency_hash, currency); - if(!price_list) return NULL; - - item = price_list; - while(item) { - GNCPrice *p = item->data; - Timespec price_time = gnc_price_get_time(p); - if(timespec_equal(&price_time, &t)) { - result = g_list_prepend(result, p); - gnc_price_ref(p); - } - item = item->next; - } - LEAVE (" "); - return result; -} - - -GNCPrice * -gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db, - gnc_commodity *c, - gnc_commodity *currency, - Timespec t) -{ - GList *price_list; - GNCPrice *current_price = NULL; - GNCPrice *next_price = NULL; - GNCPrice *result = NULL; - GList *item = NULL; - GHashTable *currency_hash; - - ENTER ("db=%p commodity=%p currency=%p", db, c, currency); - if(!db || !c || !currency) return NULL; - - if (db->backend && db->backend->price_lookup) - { - GNCPriceLookup pl; - pl.type = LOOKUP_NEAREST_IN_TIME; - pl.prdb = db; - pl.commodity = c; - pl.currency = currency; - pl.date = t; - (db->backend->price_lookup) (db->backend, &pl); - } - - currency_hash = g_hash_table_lookup(db->commodity_hash, c); - if(!currency_hash) return NULL; - - price_list = g_hash_table_lookup(currency_hash, currency); - if(!price_list) return NULL; - - item = price_list; - - /* default answer */ - current_price = item->data; - - /* find the first candidate past the one we want. Remember that - prices are in most-recent-first order. */ - while (!next_price && item) { - GNCPrice *p = item->data; - Timespec price_time = gnc_price_get_time(p); - if (timespec_cmp(&price_time, &t) <= 0) { - next_price = item->data; - break; - } - current_price = item->data; - item = item->next; - } - - if (current_price) { - if (!next_price) { - result = current_price; - } else { - Timespec current_t = gnc_price_get_time(current_price); - Timespec next_t = gnc_price_get_time(next_price); - Timespec diff_current = timespec_diff(¤t_t, &t); - Timespec diff_next = timespec_diff(&next_t, &t); - Timespec abs_current = timespec_abs(&diff_current); - Timespec abs_next = timespec_abs(&diff_next); - - if (timespec_cmp(&abs_current, &abs_next) <= 0) { - result = current_price; - } else { - result = next_price; - } - } - } - - gnc_price_ref(result); - LEAVE (" "); - return result; -} - -/* ==================================================================== */ -/* gnc_pricedb_foreach_price infrastructure - */ - -typedef struct { - gboolean ok; - gboolean (*func)(GNCPrice *p, gpointer user_data); - gpointer user_data; -} GNCPriceDBForeachData; - -static void -pricedb_foreach_pricelist(gpointer key, gpointer val, gpointer user_data) -{ - GList *price_list = (GList *) val; - GList *node = price_list; - GNCPriceDBForeachData *foreach_data = (GNCPriceDBForeachData *) user_data; - - /* stop traversal when func returns FALSE */ - while(foreach_data->ok && node) { - GNCPrice *p = (GNCPrice *) node->data; - foreach_data->ok = foreach_data->func(p, foreach_data->user_data); - node = node->next; - } -} - -static void -pricedb_foreach_currencies_hash(gpointer key, gpointer val, gpointer user_data) -{ - GHashTable *currencies_hash = (GHashTable *) val; - g_hash_table_foreach(currencies_hash, pricedb_foreach_pricelist, user_data); -} - -static gboolean -unstable_price_traversal(GNCPriceDB *db, - gboolean (*f)(GNCPrice *p, gpointer user_data), - gpointer user_data) -{ - GNCPriceDBForeachData foreach_data; - - if(!db || !f) return FALSE; - foreach_data.ok = TRUE; - foreach_data.func = f; - foreach_data.user_data = user_data; - - g_hash_table_foreach(db->commodity_hash, - pricedb_foreach_currencies_hash, - &foreach_data); - - return foreach_data.ok; -} - -static gint -compare_kvpairs_by_commodity_key(gconstpointer a, gconstpointer b) -{ - GHashTableKVPair *kvpa = (GHashTableKVPair *) a; - GHashTableKVPair *kvpb = (GHashTableKVPair *) b; - gnc_commodity *ca; - gnc_commodity *cb; - int cmp_result; - - if(a == b) return 0; - if(!a && !b) return 0; - if(!a) return -1; - if(!b) return 1; - - ca = (gnc_commodity *) kvpa->key; - cb = (gnc_commodity *) kvpb->key; - - cmp_result = safe_strcmp(gnc_commodity_get_namespace(ca), - gnc_commodity_get_namespace(cb)); - - if(cmp_result != 0) return cmp_result; - - return safe_strcmp(gnc_commodity_get_mnemonic(ca), - gnc_commodity_get_mnemonic(cb)); -} - -static gboolean -stable_price_traversal(GNCPriceDB *db, - gboolean (*f)(GNCPrice *p, gpointer user_data), - gpointer user_data) -{ - GSList *currency_hashes = NULL; - GSList *foo = NULL; - gboolean ok = TRUE; - GSList *i = NULL; - - if(!db || !f) return FALSE; - - currency_hashes = g_hash_table_key_value_pairs(db->commodity_hash); - currency_hashes = g_slist_sort(currency_hashes, - compare_kvpairs_by_commodity_key); - - for(i = currency_hashes; i; i = i->next) { - GHashTableKVPair *kv_pair = (GHashTableKVPair *) i->data; - GHashTable *currency_hash = (GHashTable *) kv_pair->value; - GSList *price_lists = g_hash_table_key_value_pairs(currency_hash); - GSList *j; - - price_lists = g_slist_sort(price_lists, compare_kvpairs_by_commodity_key); - for(j = price_lists; j; j = j->next) { - GHashTableKVPair *pricelist_kvp = (GHashTableKVPair *) j->data; - GList *price_list = (GList *) pricelist_kvp->value; - GList *node; - - for(node = (GList *) price_list; node; node = node->next) { - GNCPrice *price = (GNCPrice *) node->data; - - /* stop traversal when f returns FALSE */ - if (FALSE == ok) break; - if(!f(price, user_data)) ok = FALSE; - } - } - if(price_lists) { - g_slist_foreach(price_lists, g_hash_table_kv_pair_free_gfunc, NULL); - g_slist_free(price_lists); - price_lists = NULL; - } - } - - if(currency_hashes) { - g_slist_foreach(currency_hashes, g_hash_table_kv_pair_free_gfunc, NULL); - g_slist_free(currency_hashes); - } - return ok; -} - -gboolean -gnc_pricedb_foreach_price(GNCPriceDB *db, - gboolean (*f)(GNCPrice *p, gpointer user_data), - gpointer user_data, - gboolean stable_order) -{ - ENTER ("db=%p f=%p", db, f); - if(stable_order) return stable_price_traversal(db, f, user_data); - return unstable_price_traversal(db, f, user_data); - LEAVE (" "); -} - -/* ==================================================================== */ -/* commodity substitution */ - -typedef struct { - gnc_commodity *old_c; - gnc_commodity *new_c; -} GNCPriceFixupData; - -static gboolean -add_price_to_list (GNCPrice *p, gpointer data) -{ - GList **list = data; - - *list = g_list_prepend (*list, p); - - return TRUE; -} - -static void -gnc_price_fixup_legacy_commods(gpointer data, gpointer user_data) -{ - GNCPrice *p = data; - GNCPriceFixupData *fixup_data = user_data; - gnc_commodity *price_c; - - if (!p) return; - - price_c = gnc_price_get_commodity(p); - if (gnc_commodity_equiv(price_c, fixup_data->old_c)) { - gnc_price_set_commodity (p, fixup_data->new_c); - } - price_c = gnc_price_get_currency(p); - if (gnc_commodity_equiv(price_c, fixup_data->old_c)) { - gnc_price_set_currency (p, fixup_data->new_c); - } -} - -void -gnc_pricedb_substitute_commodity(GNCPriceDB *db, - gnc_commodity *old_c, - gnc_commodity *new_c) -{ - GHashTable *currency_hash; - GNCPriceFixupData data; - GList *prices = NULL; - - if(!db || !old_c || !new_c) return; - - data.old_c = old_c; - data.new_c = new_c; - - gnc_pricedb_foreach_price (db, add_price_to_list, &prices, FALSE); - - g_list_foreach (prices, gnc_price_fixup_legacy_commods, &data); - - g_list_free (prices); -} - -/***************************************************************************/ - -/* Semi-lame debugging code */ - -void -gnc_price_print(GNCPrice *p, FILE *f, int indent) -{ - gnc_commodity *commodity; - gnc_commodity *currency; - gchar *istr = NULL; /* indent string */ - const char *str; - - if(!p) return; - if(!f) return; - - commodity = gnc_price_get_commodity(p); - currency = gnc_price_get_currency(p); - - if(!commodity) return; - if(!currency) return; - - istr = g_strnfill(indent, ' '); - - fprintf(f, "%s\n", istr); - fprintf(f, "%s \n", istr, commodity); - str = gnc_commodity_get_namespace(commodity); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - str = gnc_commodity_get_mnemonic(commodity); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - fprintf(f, "%s \n", istr); - fprintf(f, "%s \n", istr, currency); - str = gnc_commodity_get_namespace(currency); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - str = gnc_commodity_get_mnemonic(currency); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - fprintf(f, "%s \n", istr); - str = gnc_price_get_source(p); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - str = gnc_price_get_type(p); - str = str ? str : "(null)"; - fprintf(f, "%s %s\n", istr, str); - fprintf(f, "%s %g\n", istr, gnc_numeric_to_double(gnc_price_get_value(p))); - fprintf(f, "%s\n", istr); - - g_free(istr); -} - -static void -gnc_price_print_stdout(GNCPrice *p, int indent) -{ - gnc_price_print(p, stdout, indent); -} - -static gboolean -print_pricedb_adapter(GNCPrice *p, gpointer user_data) -{ - FILE *f = (FILE *) user_data; - gnc_price_print(p, f, 1); - return TRUE; -} - -void -gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f) -{ - if(!db) { PERR("NULL PriceDB\n"); return; } - if(!f) { PERR("NULL FILE*\n"); return; } - - fprintf(f, "\n"); - gnc_pricedb_foreach_price(db, print_pricedb_adapter, f, FALSE); - fprintf(f, "\n"); -} - -/* ========================= END OF FILE ============================== */ diff --git a/src/engine/gnc-pricedb.h b/src/engine/gnc-pricedb.h deleted file mode 100644 index dac158bb29..0000000000 --- a/src/engine/gnc-pricedb.h +++ /dev/null @@ -1,290 +0,0 @@ -/******************************************************************** - * gnc-pricedb.h -- a simple price database for gnucash. * - * Copyright (C) 2001 Rob Browning, Linas Vepstas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - *******************************************************************/ - -#ifndef GNC_PRICEDB_H -#define GNC_PRICEDB_H - -#include "date.h" -#include "gnc-numeric.h" -#include "gnc-commodity.h" -#include "guid.h" - -#include - -/**********************************************************************\ - - Introduction: - - The PriceDB is intended to be a database of price quotes, or more - specifically, a database of GNCPrices. For the time being, it is - still a fairly simple database supporting only fairly simple - queries. It is expected that new queries will be added as needed, - and that there is some advantage to delaying complex queries for - now in the hope that we get a real DB implementation before - they're really needed. - - Every GNCBook contains a GNCPriceDB, accessable via - gnc_book_get_pricedb. - -*/ - - -/**********************************************************************\ - - GNCPrice: - - Each price in the database represents an "instantaneous" quote for - a given commodity with respect to another commodity. For example, - a given price might represent the value of LNUX in USD on - 2001-02-03. - - Fields: - - commodity: the item being priced. - - currency: the denomination of the value of the item being priced. - - value: the value of the item being priced. - - time: the time the price was valid. - - source: a string describing the source of the quote. These - strings will be something like this: "Finance::Quote", - "user:misc", "user:foo", etc. If the quote came from a user, - as a matter of policy, you *must* prefix the string you give - with "user:". For now, the only other reserved values are - "Finance::Quote" and "old-file-import". - - type: the type of quote - types possible right now are bid, ask, - last, nav, and unknown. - - Implementation Details: - - NOTE: for source and type, NULL and the empty string are - considered the same, so if one of these is "", then after a file - save/restore, it might be NULL. Behave accordingly. - - GNCPrices are reference counted. When you gnc_price_create one - or clone it, the new price's count is set to 1. When you are - finished with a price, call gnc_price_unref. If you hand the - price pointer to some other code that needs to keep it, make - sure it calls gnc_price_ref to indicate its interest in that - price, and calls gnc_price_unref when it's finished with the - price. For those unfamiliar with reference counting, basically - each price stores an integer count which starts at 1 and is - incremented every time someone calls gnc_price_ref. Conversely, - the count is decremented every time someone calls - gnc_price_unref. If the count ever reaches 0, the price is - destroyed. - - All of the getters return data that's internal to the GNCPrice, - not copies, so don't free these values. - - All of the setters store copies of the data given, with the - exception of the commodity field which just stores the pointer - given. It is assumed that commodities are a global resource and - are pointer unique. - - */ - -typedef struct _GNCPrice GNCPrice; -typedef struct _GNCPriceLookup GNCPriceLookup; - -/****************/ -/* constructors */ - -/* gnc_price_create - returns a newly allocated and initialized price - with a reference count of 1. */ -GNCPrice *gnc_price_create(void); - -/* gnc_price_clone - returns a newly allocated price that's a - content-wise duplicate of the given price, p. The returned clone - will have a reference count of 1. */ -GNCPrice *gnc_price_clone(GNCPrice* p); - -/*********************/ -/* memory management */ - -/* gnc_price_ref - indicate your need for a given price to stick - around (i.e. increase its reference count by 1). */ -void gnc_price_ref(GNCPrice *p); - -/* gnc_price_ref - indicate you're finished with a price - (i.e. decrease its reference count by 1). */ -void gnc_price_unref(GNCPrice *p); - -/***********/ -/* setters */ - -/* As mentioned above, all of the setters store copies of the data - * given, with the exception of the commodity field which just stores - * the pointer given. It is assumed that commodities are a global - * resource and are pointer unique. - * - * Invocations of the setters should be wrapped with calls to - * gnc_price_begin_edit() and commit_edit(). The begin/commit - * calls help ensure that the local price db is synchronized with - * the backend. - */ -void gnc_price_begin_edit (GNCPrice *p); -void gnc_price_commit_edit (GNCPrice *p); - -void gnc_price_set_commodity(GNCPrice *p, gnc_commodity *c); -void gnc_price_set_currency(GNCPrice *p, gnc_commodity *c); -void gnc_price_set_time(GNCPrice *p, Timespec t); -void gnc_price_set_source(GNCPrice *p, const char *source); -void gnc_price_set_type(GNCPrice *p, const char* type); -void gnc_price_set_value(GNCPrice *p, gnc_numeric value); -void gnc_price_set_version(GNCPrice *p, gint32 versn); - -/***********/ -/* getters */ - -/* As mentioned above all of the getters return data that's internal - to the GNCPrice, not copies, so don't free these values. */ -GNCPrice * gnc_price_lookup (const GUID *guid); -const GUID * gnc_price_get_guid (GNCPrice *p); -gnc_commodity * gnc_price_get_commodity(GNCPrice *p); -gnc_commodity * gnc_price_get_currency(GNCPrice *p); -Timespec gnc_price_get_time(GNCPrice *p); -const char * gnc_price_get_source(GNCPrice *p); -const char * gnc_price_get_type(GNCPrice *p); -gnc_numeric gnc_price_get_value(GNCPrice *p); -gint32 gnc_price_get_version(GNCPrice *p); - -gboolean gnc_price_equal (GNCPrice *p1, GNCPrice *p2); - -/********************************************************************** - GNCPrice lists: - - The database communicates multiple prices in and out via gnc price - lists. These are just time sorted GLists of GNCPrice pointers. - Functions for manipulating these lists are provided. These - functions are helpful in that they handle maintaining proper - reference counts on behalf of the price list for every price being - held in a given list. I.e. insert "refs" the prices being - inserted, remove and destroy "unref" the prices that will no - longer be referred to by the list. - -*/ - -/* gnc_price_list_insert - insert a price into the given list, calling - gnc_price_ref on it during the process. */ -gboolean gnc_price_list_insert(GList **prices, GNCPrice *p); -/* gnc_price_list_remove - remove the price, p, from the given list, - calling gnc_price_unref on it during the process. */ -gboolean gnc_price_list_remove(GList **prices, GNCPrice *p); -/* gnc_price_list_destroy - destroy the given price list, calling - gnc_price_unref on all the prices included in the list. */ -void gnc_price_list_destroy(GList *prices); - - -/********************************************************************** - GNCPriceDB - - Whenever a you store a price in the pricedb, the pricedb adds its - own reference to the price, so you can safely unref that price after - inserting it into the DB if you're finished with it otherwise. - - Similarly, when the pricedb returns a price to you, either singly, - or in a price list, the price will have had a ref added for you, so - you only need to unref the price(s) when you're finished with - it/them. - -*/ - -typedef struct _GNCPriceDB GNCPriceDB; - - -/* gnc_pricedb_create - create a new pricedb. Normally you won't need - this; you will get the pricedb via gnc_book_get_pricedb. */ -GNCPriceDB * gnc_pricedb_create(void); - -/* gnc_pricedb_destroy - destroy the given pricedb and unref all of - the prices it contains. This may not deallocate all of those - prices. Other code may still be holding references to them. */ -void gnc_pricedb_destroy(GNCPriceDB *db); - -/* gnc_pricedb_add_price - add a price to the pricedb, you may drop - your reference to the price (i.e. call unref) after this - succeeds, whenever you're finished with the price. */ -gboolean gnc_pricedb_add_price(GNCPriceDB *db, GNCPrice *p); - -/* gnc_pricedb_remove_price - removes the given price, p, from the - pricedb. Returns TRUE if successful, FALSE otherwise. */ -gboolean gnc_pricedb_remove_price(GNCPriceDB *db, GNCPrice *p); - -/* gnc_pricedb_lookup_latest - find the most recent price for the - given commodity in the given currency. Returns NULL on - failure. */ -GNCPrice * gnc_pricedb_lookup_latest(GNCPriceDB *db, - gnc_commodity *commodity, - gnc_commodity *currency); - -/* gnc_pricedb_get_prices - return all the prices for a given - commodity in the given currency. Returns NULL on failure. The - result is a GNCPrice list (see above). */ -GList * gnc_pricedb_get_prices(GNCPriceDB *db, - gnc_commodity *commodity, - gnc_commodity *currency); - -/* gnc_pricedb_lookup_at_time - return all prices that match the given - commodity, currency, and timespec. Prices will be returned as a - GNCPrice list (see above). */ -GList * gnc_pricedb_lookup_at_time(GNCPriceDB *db, - gnc_commodity *commodity, - gnc_commodity *currency, - Timespec t); - -/* gnc_pricedb_lookup_nearest_in_time - return the price for the given - commodity in the given currency nearest to the given time t. */ -GNCPrice * -gnc_pricedb_lookup_nearest_in_time(GNCPriceDB *db, - gnc_commodity *c, - gnc_commodity *currency, - Timespec t); - -/* gnc_pricedb_foreach_price - call f once for each price in db, until - and unless f returns FALSE. If stable_order is not FALSE, make - sure the ordering of the traversal is stable (i.e. the same order - every time given the same db contents -- stable traversals may be - less efficient). */ -gboolean gnc_pricedb_foreach_price(GNCPriceDB *db, - gboolean (*f)(GNCPrice *p, - gpointer user_data), - gpointer user_data, - gboolean stable_order); - -/* gnc_pricedb_dirty - return FALSE if the database has not been - modified. */ -gboolean gnc_pricedb_dirty(GNCPriceDB *db); - -/* gnc_pricedb_get_num_prices - return the number of prices - in the database. */ -guint gnc_pricedb_get_num_prices(GNCPriceDB *db); - -/* semi-lame debugging code */ -void gnc_price_print(GNCPrice *db, FILE *f, int indent); -void gnc_pricedb_print_contents(GNCPriceDB *db, FILE *f); - -#endif diff --git a/src/engine/gncmod-engine.c b/src/engine/gncmod-engine.c new file mode 100644 index 0000000000..c5db3c909c --- /dev/null +++ b/src/engine/gncmod-engine.c @@ -0,0 +1,60 @@ +/********************************************************************* + * gnc-mod-engine.c + * module definition/initialization for the Engine module + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include +#include +#include "gnc-engine.h" + +#include "gw-engine.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) +{ + return g_strdup("gnucash/engine"); +} + +char * +gnc_module_description(void) +{ + return g_strdup("The Gnucash accounting engine"); +} + +int +gnc_module_init(int refcount) +{ + if(refcount == 0) + { + /* initialize the engine on the first load */ + gnc_engine_init(0, NULL); + } + + gh_eval_str("(use-modules (gnucash engine))"); + gh_eval_str("(use-modules (g-wrapped gw-engine))"); + + if(refcount == 0) + { + /* and set up the gnc-commodity stuff */ + gh_eval_str("(gnc:load-iso-4217-currencies)"); + gh_eval_str("(gnc:setup-default-namespaces)"); + } + return TRUE; +} + +int +gnc_module_end(int refcount) { + return TRUE; +} + diff --git a/src/engine/guid.c b/src/engine/guid.c deleted file mode 100644 index 1cd2cb4e21..0000000000 --- a/src/engine/guid.c +++ /dev/null @@ -1,571 +0,0 @@ -/********************************************************************\ - * guid.c -- globally unique ID implementation * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#define _GNU_SOURCE - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include "guid.h" -#include "md5.h" -#include "gnc-engine-util.h" - -# ifndef P_tmpdir -# define P_tmpdir "/tmp" -# endif - - -/** Constants *******************************************************/ -#define DEBUG_GUID 0 -#define BLOCKSIZE 4096 -#define THRESHOLD (2 * BLOCKSIZE) - - -/** Static global variables *****************************************/ -static gboolean guid_initialized = FALSE; -static struct md5_ctx guid_context; - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - - -/** Function implementations ****************************************/ - -/* This code is based on code in md5.c in GNU textutils. */ -static size_t -init_from_stream(FILE *stream, size_t max_size) -{ - char buffer[BLOCKSIZE + 72]; - size_t sum, block_size, total; - - if (max_size <= 0) - return 0; - - total = 0; - - /* Iterate over file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - * computation function processes the whole buffer so that with the - * next round of the loop another block can be read. */ - size_t n; - sum = 0; - - if (max_size < BLOCKSIZE) - block_size = max_size; - else - block_size = BLOCKSIZE; - - /* Read block. Take care for partial reads. */ - do - { - n = fread (buffer + sum, 1, block_size - sum, stream); - - sum += n; - } - while (sum < block_size && n != 0); - - max_size -= sum; - - if (n == 0 && ferror (stream)) - return total; - - /* If end of file or max_size is reached, end the loop. */ - if ((n == 0) || (max_size == 0)) - break; - - /* Process buffer with BLOCKSIZE bytes. Note that - * BLOCKSIZE % 64 == 0 */ - md5_process_block (buffer, BLOCKSIZE, &guid_context); - - total += sum; - } - - /* Add the last bytes if necessary. */ - if (sum > 0) - { - md5_process_bytes (buffer, sum, &guid_context); - total += sum; - } - - return total; -} - -static size_t -init_from_file(const char *filename, size_t max_size) -{ - struct stat stats; - size_t total = 0; - size_t file_bytes; - FILE *fp; - - if (stat(filename, &stats) != 0) - return 0; - - md5_process_bytes(&stats, sizeof(stats), &guid_context); - total += sizeof(stats); - - if (max_size <= 0) - return total; - - fp = fopen (filename, "r"); - if (fp == NULL) - return total; - - file_bytes = init_from_stream(fp, max_size); - -#if DEBUG_GUID - g_warning ("guid_init got %u bytes from %s", file_bytes, filename); -#endif - - total += file_bytes; - - fclose(fp); - - return total; -} - -static size_t -init_from_dir(const char *dirname, unsigned int max_files) -{ - char filename[1024]; - struct dirent *de; - struct stat stats; - size_t total; - int result; - DIR *dir; - - if (max_files <= 0) - return 0; - - dir = opendir (dirname); - if (dir == NULL) - return 0; - - total = 0; - - do - { - de = readdir(dir); - if (de == NULL) - break; - - md5_process_bytes(de, sizeof(struct dirent), &guid_context); - total += sizeof(struct dirent); - - result = snprintf(filename, sizeof(filename), - "%s/%s", dirname, de->d_name); - if ((result < 0) || (result >= sizeof(filename))) - continue; - - if (stat(filename, &stats) != 0) - continue; - md5_process_bytes(&stats, sizeof(stats), &guid_context); - total += sizeof(stats); - - max_files--; - } while (max_files > 0); - - closedir(dir); - - return total; -} - -static size_t -init_from_time(void) -{ - size_t total; - time_t t_time; - clock_t clocks; - struct tms tms_buf; - - total = 0; - - t_time = time(NULL); - md5_process_bytes(&t_time, sizeof(t_time), &guid_context); - total += sizeof(t_time); - - clocks = times(&tms_buf); - md5_process_bytes(&clocks, sizeof(clocks), &guid_context); - md5_process_bytes(&tms_buf, sizeof(tms_buf), &guid_context); - total += sizeof(clocks) + sizeof(tms_buf); - - return total; -} - -void -guid_init(void) -{ - size_t bytes = 0; - - md5_init_ctx(&guid_context); - - /* entropy pool */ - bytes += init_from_file ("/dev/urandom", 512); - - /* files */ - { - const char * files[] = - { "/etc/passwd", - "/proc/loadavg", - "/proc/meminfo", - "/proc/net/dev", - "/proc/rtc", - "/proc/self/environ", - "/proc/self/stat", - "/proc/stat", - "/proc/uptime", - NULL - }; - int i; - - for (i = 0; files[i] != NULL; i++) - bytes += init_from_file(files[i], BLOCKSIZE); - } - - /* directories */ - { - const char * dirname; - const char * dirs[] = - { - "/proc", - P_tmpdir, - "/var/lock", - "/var/log", - "/var/mail", - "/var/spool/mail", - "/var/run", - NULL - }; - int i; - - for (i = 0; dirs[i] != NULL; i++) - bytes += init_from_dir(dirs[i], 32); - - dirname = getenv("HOME"); - if (dirname != NULL) - bytes += init_from_dir(dirname, 32); - } - - /* process and parent ids */ - { - pid_t pid; - - pid = getpid(); - md5_process_bytes(&pid, sizeof(pid), &guid_context); - bytes += sizeof(pid); - - pid = getppid(); - md5_process_bytes(&pid, sizeof(pid), &guid_context); - bytes += sizeof(pid); - } - - /* user info */ - { - uid_t uid; - gid_t gid; - char *s; - - s = getlogin(); - if (s != NULL) - { - md5_process_bytes(s, strlen(s), &guid_context); - bytes += strlen(s); - } - - uid = getuid(); - md5_process_bytes(&uid, sizeof(uid), &guid_context); - bytes += sizeof(uid); - - gid = getgid(); - md5_process_bytes(&gid, sizeof(gid), &guid_context); - bytes += sizeof(gid); - } - - /* host info */ - { - char string[1024]; - - gethostname(string, sizeof(string)); - md5_process_bytes(string, sizeof(string), &guid_context); - bytes += sizeof(string); - } - - /* plain old random */ - { - int n, i; - - srand((unsigned int) time(NULL)); - - for (i = 0; i < 32; i++) - { - n = rand(); - - md5_process_bytes(&n, sizeof(n), &guid_context); - bytes += sizeof(n); - } - } - - /* time in secs and clock ticks */ - bytes += init_from_time(); - -#if DEBUG_GUID - g_warning ("guid_init got %u bytes", bytes); -#endif - - if (bytes < THRESHOLD) - g_warning("WARNING: guid_init only got %u bytes.\n" - "The identifiers might not be very random.\n", bytes); - - guid_initialized = TRUE; -} - -void -guid_init_with_salt(const void *salt, size_t salt_len) -{ - guid_init(); - - md5_process_bytes(salt, salt_len, &guid_context); -} - -void -guid_init_only_salt(const void *salt, size_t salt_len) -{ - md5_init_ctx(&guid_context); - - md5_process_bytes(salt, salt_len, &guid_context); - - guid_initialized = TRUE; -} - -#define GUID_PERIOD 5000 - -void -guid_new(GUID *guid) -{ - static int counter = 0; - struct md5_ctx ctx; - - if (guid == NULL) - return; - - if (!guid_initialized) - guid_init(); - - /* make the id */ - ctx = guid_context; - md5_finish_ctx(&ctx, guid->data); - - /* update the global context */ - init_from_time(); - - if (counter == 0) - { - FILE *fp; - - fp = fopen ("/dev/urandom", "r"); - if (fp == NULL) - return; - - init_from_stream(fp, 32); - - fclose(fp); - - counter = GUID_PERIOD; - } - - counter--; -} - -/* needs 32 bytes exactly, doesn't print a null char */ -static void -encode_md5_data(const unsigned char *data, char *buffer) -{ - size_t count; - - for (count = 0; count < 16; count++, buffer += 2) - sprintf(buffer, "%02x", data[count]); -} - -/* returns true if the first 32 bytes of buffer encode - * a hex number. returns false otherwise. Decoded number - * is packed into data in little endian order. */ -static gboolean -decode_md5_string(const char *string, unsigned char *data) -{ - unsigned char n1, n2; - size_t count = -1; - char c1, c2; - - if (NULL == data) return FALSE; - if (NULL == string) goto badstring; - - for (count = 0; count < 16; count++) - { - /* check for a short string e.g. null string ... */ - if ((0==string[2*count]) || (0==string[2*count+1])) goto badstring; - - c1 = tolower(string[2 * count]); - if (!isxdigit(c1)) goto badstring; - - c2 = tolower(string[2 * count + 1]); - if (!isxdigit(c2)) goto badstring; - - if (isdigit(c1)) - n1 = c1 - '0'; - else - n1 = c1 - 'a' + 10; - - if (isdigit(c2)) - n2 = c2 - '0'; - else - n2 = c2 - 'a' + 10; - - data[count] = (n1 << 4) | n2; - } - return TRUE; - -badstring: - PERR ("bad string, stopped at %d\n", count); - for (count = 0; count < 16; count++) - { - data[count] = 0; - } - return FALSE; - -} - -char * -guid_to_string(const GUID * guid) -{ - char *string; - - if(!guid) return(NULL); - - string = g_malloc(GUID_ENCODING_LENGTH+1); - - encode_md5_data(guid->data, string); - - string[GUID_ENCODING_LENGTH] = '\0'; - - return string; -} - -char * -guid_to_string_buff(const GUID * guid, char *string) -{ - if (!string || !guid) return NULL; - - encode_md5_data(guid->data, string); - - string[GUID_ENCODING_LENGTH] = '\0'; - return &string[GUID_ENCODING_LENGTH]; -} - -gboolean -string_to_guid(const char * string, GUID * guid) -{ - return decode_md5_string(string, (guid != NULL) ? guid->data : NULL); -} - -gboolean -guid_equal(const GUID *guid_1, const GUID *guid_2) -{ - if (guid_1 && guid_2) - return (memcmp(guid_1, guid_2, sizeof(GUID)) == 0); - else - return FALSE; -} - -gint -guid_compare(const GUID *guid_1, const GUID *guid_2) -{ - if (guid_1 == guid_2) - return 0; - - /* nothing is always less than something */ - if (!guid_1 && guid_2) - return -1; - - if (guid_1 && !guid_2) - return 1; - - return memcmp (guid_1, guid_2, sizeof (GUID)); -} - -guint -guid_hash_to_guint (gconstpointer ptr) -{ - const GUID *guid = ptr; - - if (!guid) - { - PERR ("received NULL guid pointer."); - return 0; - } - - if (sizeof(guint) <= sizeof(guid->data)) - { - return (*((guint *) guid->data)); - } - else - { - guint hash = 0; - int i, j; - - for (i = 0, j = 0; i < sizeof(guint); i++, j++) { - if (j == 16) j = 0; - - hash <<= 4; - hash |= guid->data[j]; - } - - return hash; - } -} - -static gint -guid_g_hash_table_equal (gconstpointer guid_a, gconstpointer guid_b) -{ - return guid_equal (guid_a, guid_b); -} - -GHashTable * -guid_hash_table_new (void) -{ - return g_hash_table_new (guid_hash_to_guint, guid_g_hash_table_equal); -} diff --git a/src/engine/guid.h b/src/engine/guid.h deleted file mode 100644 index 9428530568..0000000000 --- a/src/engine/guid.h +++ /dev/null @@ -1,112 +0,0 @@ -/********************************************************************\ - * guid.h -- globally unique ID User API * - * Copyright (C) 2000 Dave Peticolas * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef GUID_H -#define GUID_H - -#ifdef HAVE_CONFIG_H -# include "config.h" -#endif - -#include -#include - -/* This file defines an API for using globally unique identifiers. */ - -/* The type used to store guids */ -typedef union _GUID -{ - unsigned char data[16]; - - int __align_me; /* this just ensures that GUIDs are 32-bit - * aligned on systems that need them to be. */ -} GUID; - - -/* number of characters needed to encode a guid as a string - * not including the null terminator. */ -#define GUID_ENCODING_LENGTH 32 - - -/* Three functions to initialize the id generator. Only one needs to - * be called. Calling any initialization function a second time will - * reset the generator and erase the effect of the first call. - * - * guid_init() will initialize the generator with a variety of random - * sources. - * - * guid_init_with_salt() will initialize the generator with guid_init() - * and with the data given in the salt argument. This argument can be - * used to add additional randomness to the generated ids. - * - * guid_init_only_salt() will initialize the generator with the data - * given in the salt argument, but not with any other source. Calling - * guid_init_only_salt() with a specific argument will produce a - * specific sequence of ids reliably. */ -void guid_init(void); -void guid_init_with_salt(const void *salt, size_t salt_len); -void guid_init_only_salt(const void *salt, size_t salt_len); - - -/* Generate a new id. If no initialization function has been called, - * guid_init() will be called before the id is created. */ -void guid_new(GUID *guid); - - -/* The guid_to_string() routine returns a null-terminated string - * encoding of the id. String encodings of identifiers are hex - * numbers printed only with the characters '0' through '9' and - * 'a' through 'f'. The encoding will always be GUID_ENCODING_LENGTH - * characters long. The returned string should be freed when no - * longer needed. - * - * The guid_to_string_buff() routine does the same, except that the - * string is written into the memory pointed at by buff. The - * buffer must be at least GUID_ENCODING_LENGTH+1 characters long. - * This routine is handy for avoiding a malloc/free cycle. - * It returns a pointer to the >>end<< of what was written. - * (i.e. it can be used like 'stpcpy' during string concatenation) - */ -char * guid_to_string (const GUID * guid); -char * guid_to_string_buff (const GUID * guid, char *buff); - - -/* Given a string, decode the id into the guid if guid is non-NULL. - * The function returns TRUE if the string was a valid 32 character - * hexadecimal number. This function accepts both upper and lower case - * hex digits. If the return value is FALSE, the effect on guid is - * undefined. */ -gboolean string_to_guid(const char * string, GUID * guid); - - -/* Given two GUIDs, return TRUE if they are non-NULL and equal. - * Return FALSE, otherwise. */ -gboolean guid_equal(const GUID *guid_1, const GUID *guid_2); -gint guid_compare(const GUID *g1, const GUID *g2); - -/* Given a GUID *, hash it to a guint */ -guint guid_hash_to_guint(gconstpointer ptr); - -GHashTable *guid_hash_table_new(void); - -#endif diff --git a/src/engine/gw-engine-spec.scm b/src/engine/gw-engine-spec.scm new file mode 100644 index 0000000000..f68942f58a --- /dev/null +++ b/src/engine/gw-engine-spec.scm @@ -0,0 +1,2302 @@ +;;; -*-scheme-*- + +(define-module (g-wrapped gw-engine-spec)) + +(use-modules (g-wrap)) +(use-modules (g-wrapped gw-glib-spec)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(let ((mod (gw:new-module "gw-engine"))) + (define (standard-c-call-gen result func-call-code) + (list (gw:result-get-c-name result) " = " func-call-code ";\n")) + + (define (add-standard-result-handlers! type c->scm-converter) + (define (standard-pre-handler result) + (let* ((ret-type-name (gw:result-get-proper-c-type-name result)) + (ret-var-name (gw:result-get-c-name result))) + (list "{\n" + " " ret-type-name " " ret-var-name ";\n"))) + + (gw:type-set-pre-call-result-ccodegen! type standard-pre-handler) + + (gw:type-set-post-call-result-ccodegen! + type + (lambda (result) + (let* ((scm-name (gw:result-get-scm-name result)) + (c-name (gw:result-get-c-name result))) + (list + (c->scm-converter scm-name c-name) + " }\n"))))) + + (gw:module-depends-on mod "gw-runtime") + (gw:module-depends-on mod "gw-glib") + (gw:module-set-guile-module! mod '(g-wrapped gw-engine)) + + ;; Timespec + (let ((wt (gw:wrap-type mod ' "Timespec" "const Timespec"))) + + (gw:type-set-scm-arg-type-test-ccodegen! + wt (lambda (param) + (list "gnc_timepair_p(" (gw:param-get-scm-name param) ")"))) + + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_timepair2timespec(" x ")")))) + (list c-name " = " (old-func scm-name) ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_timespec2timepair(" x ")")))) + (list scm-name " = " (old-func c-name) ";\n"))))) + + ;; GUID + (let ((wt (gw:wrap-type mod ' "GUID" "const GUID"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) (list "gnc_guid_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param))) + (list c-name " = gnc_scm2guid(" scm-name ");\n")))) + + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (list scm-name " = gnc_guid2scm(" c-name ");\n")))) + + ;; have to specially wrap a list of gnc_commodities + (let ((wt (gw:wrap-type + mod + ' + "GList *" "const GList *"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) + (list "gnc_glist_commodity_ptr_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_scm_to_glist_commodity_ptr(" x ")")))) + (list c-name + " = " + (old-func scm-name) + ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_glist_commodity_ptr_to_scm(" x ")")))) + (list scm-name + " = " + (old-func c-name) + ";\n"))))) + + ;; price list + (let ((wt + (gw:wrap-type mod ' "GList *" "const GList *"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) + (list "gnc_glist_price_ptr_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_scm_to_glist_price_ptr(" x ")")))) + (list c-name + " = " + (old-func scm-name) + ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_glist_price_ptr_to_scm(" x ")")))) + (list scm-name + " = " + (old-func c-name) + ";\n"))))) + + ;; list of account * + (let ((wt (gw:wrap-type mod ' + "GList *" "const GList *"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) + (list "gnc_glist_account_ptr_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_scm_to_glist_account_ptr(" x ")")))) + (list c-name + " = " + (old-func scm-name) + ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_glist_account_ptr_to_scm(" x ")")))) + (list scm-name + " = " + (old-func c-name) + ";\n"))))) + + (let ((wt (gw:wrap-type mod ' + "GList *" "const GList *"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) + (list "gnc_glist_account_ptr_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_scm_to_glist_account_ptr(" x ")")))) + (list c-name " = " (old-func scm-name) ";\n")))) + + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_glist_account_ptr_to_scm_no_free(" x ")")))) + (list scm-name " = " (old-func c-name) ";\n"))))) + + ;; gnc-numeric + (let ((wt + (gw:wrap-type mod ' "gnc_numeric" "const gnc_numeric"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) (list "gnc_numeric_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) (list "gnc_scm_to_numeric(" x ")")))) + (list c-name " = " (old-func scm-name) ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) (list "gnc_numeric_to_scm(" x ")")))) + (list scm-name " = " (old-func c-name) ";\n"))))) + + (gw:module-set-declarations-ccodegen! + mod + (lambda (client-only?) + (list + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n" + "#include \n"))) + + (gw:module-set-init-ccodegen! + mod + (lambda (client-only?) + (if client-only? + '() + (gw:inline-scheme '(use-modules (gnucash engine)))))) + + (gw:wrap-non-native-type mod ' "Account*" "const Account*") + (gw:wrap-non-native-type mod ' "Account**" "const Account**") + + (gw:wrap-non-native-type mod ' "InvAcct*" "const InvAcct*") + (gw:wrap-non-native-type mod ' "AccInfo*" "const AccInfo*") + (gw:wrap-non-native-type mod ' + "AccountGroup*" "const AccountGroup*") + (gw:wrap-non-native-type mod ' "GNCBook*" "const GNCBook*") + (gw:wrap-non-native-type mod ' + "kvp_frame*" "const kvp_frame*") + (gw:wrap-non-native-type mod ' + "kvp_value*" "const kvp_value*") + + (gw:wrap-non-native-type mod ' "Split*" "const Split*") + (gw:wrap-non-native-type mod ' + "Transaction*" "const Transaction*") + + (gw:wrap-non-native-type mod ' + "gnc_commodity*" "const gnc_commodity*") + (gw:wrap-non-native-type mod ' "gnc_commodity_table*" + "const gnc_commodity_table*") + + (gw:wrap-non-native-type mod ' "Query *" "const Query *") + (gw:wrap-non-native-type mod ' + "QueryTerm *" "const QueryTerm *") + + (let ((wt (gw:wrap-enumeration mod ' + "QueryOp" "const QueryOp"))) + (gw:enum-add-value! wt "QUERY_AND" 'query-and) + (gw:enum-add-value! wt "QUERY_OR" 'query-or) + (gw:enum-add-value! wt "QUERY_NAND" 'query-nadd) + (gw:enum-add-value! wt "QUERY_NOR" 'query-nor) + (gw:enum-add-value! wt "QUERY_XOR" 'query-xor)) + + (let ((wt (gw:wrap-enumeration mod ' + "sort_type_t" "const sort_type_t"))) + (gw:enum-add-value! wt "BY_STANDARD" 'by-standard) + (gw:enum-add-value! wt "BY_DATE" 'by-date) + (gw:enum-add-value! wt "BY_DATE_ROUNDED" ' by-date-rounded) + (gw:enum-add-value! wt "BY_DATE_ENTERED" 'by-date-entered) + (gw:enum-add-value! wt "BY_DATE_ENTERED_ROUNDED" 'by-date-entered-rounded) + (gw:enum-add-value! wt "BY_DATE_RECONCILED" 'by-date-reconciled) + (gw:enum-add-value! wt "BY_DATE_RECONCILED_ROUNDED" + 'by-date-reconciled-rounded) + (gw:enum-add-value! wt "BY_NUM" 'by-num) + (gw:enum-add-value! wt "BY_AMOUNT" 'by-amount) + (gw:enum-add-value! wt "BY_MEMO" 'by-memo) + (gw:enum-add-value! wt "BY_DESC" 'by-desc) + (gw:enum-add-value! wt "BY_RECONCILE" 'by-reconcile) + (gw:enum-add-value! wt "BY_ACCOUNT_FULL_NAME" 'by-account-full-name) + (gw:enum-add-value! wt "BY_ACCOUNT_CODE" 'by-account-code) + (gw:enum-add-value! wt "BY_CORR_ACCOUNT_FULL_NAME" 'by-corr-account-full-name) + (gw:enum-add-value! wt "BY_CORR_ACCOUNT_CODE" 'by-corr-account-code) + (gw:enum-add-value! wt "BY_NONE" 'by-none) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "pd_type_t" "const pd_type_t"))) + (gw:enum-add-value! wt "PD_DATE" 'pd-date) + (gw:enum-add-value! wt "PD_AMOUNT" 'pd-amount) + (gw:enum-add-value! wt "PD_ACCOUNT" 'pd-account) + (gw:enum-add-value! wt "PD_STRING" 'pd-string) + (gw:enum-add-value! wt "PD_CLEARED" 'pd-cleared) + (gw:enum-add-value! wt "PD_BALANCE" 'pd-balance) + (gw:enum-add-value! wt "PD_GUID" 'pd-guid) + (gw:enum-add-value! wt "PD_MISC" 'pd-misc) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "pr_type_t" "const pr_type_t"))) + (gw:enum-add-value! wt "PR_ACCOUNT" 'pr-account) + (gw:enum-add-value! wt "PR_ACTION" 'pr-action) + (gw:enum-add-value! wt "PR_AMOUNT" 'pr-amount) + (gw:enum-add-value! wt "PR_BALANCE" 'pr-balance) + (gw:enum-add-value! wt "PR_CLEARED" 'pr-cleared) + (gw:enum-add-value! wt "PR_DATE" 'pr-date) + (gw:enum-add-value! wt "PR_DESC" 'pr-desc) + (gw:enum-add-value! wt "PR_GUID" 'pr-guid) + (gw:enum-add-value! wt "PR_MEMO" 'pr-memo) + (gw:enum-add-value! wt "PR_NUM" 'pr-num) + (gw:enum-add-value! wt "PR_PRICE" 'pr-price) + (gw:enum-add-value! wt "PR_SHRS" 'pr-shares) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "acct_match_t" "const acct_match_t"))) + (gw:enum-add-value! wt "ACCT_MATCH_ALL" 'acct-match-all) + (gw:enum-add-value! wt "ACCT_MATCH_ANY" 'acct-match-any) + (gw:enum-add-value! wt "ACCT_MATCH_NONE" 'acct-match-none)) + + (let ((wt (gw:wrap-enumeration mod ' + "amt_match_t" "const amt_match_t"))) + (gw:enum-add-value! wt "AMT_MATCH_ATLEAST" 'amt-match-atleast) + (gw:enum-add-value! wt "AMT_MATCH_ATMOST" 'amt-match-atmost) + (gw:enum-add-value! wt "AMT_MATCH_EXACTLY" 'amt-match-exactly) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "amt_match_sgn_t" "const amt_match_sgn_t"))) + (gw:enum-add-value! wt "AMT_SGN_MATCH_EITHER" 'amt-sgn-match-either) + (gw:enum-add-value! wt "AMT_SGN_MATCH_CREDIT" 'amt-sgn-match-credit) + (gw:enum-add-value! wt "AMT_SGN_MATCH_DEBIT" 'amt-sgn-match-debit) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "cleared_match_t" "const cleared_match_t"))) + (gw:enum-add-value! wt "CLEARED_NO" 'cleared-match-no) + (gw:enum-add-value! wt "CLEARED_CLEARED" 'cleared-match-cleared) + (gw:enum-add-value! wt "CLEARED_RECONCILED" 'cleared-match-reconciled) + (gw:enum-add-value! wt "CLEARED_FROZEN" 'cleared-match-frozen) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "balance_match_t" "const balance_match_t"))) + (gw:enum-add-value! wt "BALANCE_BALANCED" 'balance-match-balanced) + (gw:enum-add-value! wt "BALANCE_UNBALANCED" 'balance-match-unbalanced) + #t) + + (let ((wt (gw:wrap-enumeration mod ' + "query_run_t" "const query_run_t"))) + (gw:enum-add-value! wt "QUERY_MATCH_ALL" 'query-match-all) + (gw:enum-add-value! wt "QUERY_MATCH_ANY" 'query-match-any) + #t) + + (let ((we + (gw:wrap-enumeration mod ' + "GNCAccountType" "const GNCAccountType"))) + ;; From Account.h + (gw:enum-add-value! we "BAD_TYPE" 'bad-type) + (gw:enum-add-value! we "NO_TYPE" 'no-type) + (gw:enum-add-value! we "BANK" 'bank) + (gw:enum-add-value! we "CASH" 'cash) + (gw:enum-add-value! we "CREDIT" 'credit) + (gw:enum-add-value! we "ASSET" 'asset) + (gw:enum-add-value! we "LIABILITY" 'liability) + (gw:enum-add-value! we "STOCK" 'stock) + (gw:enum-add-value! we "MUTUAL" 'mutual-fund) + (gw:enum-add-value! we "CURRENCY" 'currency) + (gw:enum-add-value! we "INCOME" 'income) + (gw:enum-add-value! we "EXPENSE" 'expense) + (gw:enum-add-value! we "EQUITY" 'equity) + (gw:enum-add-value! we "NUM_ACCOUNT_TYPES" 'num-account-types) + (gw:enum-add-value! we "CHECKING" 'checking) + (gw:enum-add-value! we "SAVINGS" 'savings) + (gw:enum-add-value! we "MONEYMRKT" 'money-market) + (gw:enum-add-value! we "CREDITLINE" 'credit-line) + #t) + + (let ((we (gw:wrap-enumeration mod + ' + "GNCBackendError" "const GNCBackendError"))) + + (gw:enum-add-value! we "ERR_BACKEND_NO_ERR" 'no-err) + (gw:enum-add-value! we "ERR_BACKEND_NO_BACKEND" 'no-backend) + (gw:enum-add-value! we "ERR_BACKEND_BAD_URL" 'bad-url) + (gw:enum-add-value! we "ERR_BACKEND_CANT_CONNECT" 'cant-connect) + (gw:enum-add-value! we "ERR_BACKEND_CONN_LOST" 'connection-lost) + (gw:enum-add-value! we "ERR_BACKEND_NO_SUCH_DB" 'no-such-db) + (gw:enum-add-value! we "ERR_BACKEND_LOCKED" 'locked) + (gw:enum-add-value! we "ERR_BACKEND_DATA_CORRUPT" 'data-corrupt) + (gw:enum-add-value! we "ERR_BACKEND_SERVER_ERR" 'server-error) + (gw:enum-add-value! we "ERR_BACKEND_ALLOC" 'alloc) + (gw:enum-add-value! we "ERR_BACKEND_MISC" 'misc) + +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_BAD_READ" 'file-bad-read) +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_EMPTY" 'file-empty) +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_LOCKERR" 'file-lockerr) +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_NOT_FOUND" 'file-not-found) +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_TOO_NEW" 'file-too-new) +;; (gw:enum-add-value! we "ERR_FILEIO_FILE_TOO_OLD" 'file-too-old) + +;; (gw:enum-add-value! we "ERR_NETIO_SHORT_READ" 'netio-short-read) +;; (gw:enum-add-value! we "ERR_NETIO_WRONG_CONTENT_TYPE" +;; 'netio-wrong-content-type) +;; (gw:enum-add-value! we "ERR_NETIO_NOT_GNCXML" 'netio-not-gncxml) + +;; (gw:enum-add-value! we "ERR_SQL_MISSING_DATA" 'sql-missing-data) + +;; (gw:enum-add-value! we "ERR_RPC_HOST_UNK" 'rpc_host_unk) +;; (gw:enum-add-value! we "ERR_RPC_CANT_BIND" 'rpc_cant_bind) +;; (gw:enum-add-value! we "ERR_RPC_CANT_ACCEPT" 'rpc_cant_accept) +;; (gw:enum-add-value! we "ERR_RPC_NO_CONNECTION" 'rpc_no_connection) +;; (gw:enum-add-value! we "ERR_RPC_BAD_VERSION" 'rpc_bad_version) +;; (gw:enum-add-value! we "ERR_RPC_FAILED" 'rpc_failed) +;; (gw:enum-add-value! we "ERR_RPC_NOT_ADDED" 'rpc_not_added) + #t) + + (gw:wrap-function + mod + 'gnc:split-get-balance + ' + "xaccSplitGetBalance" + '(( s)) + "Return balance at split.") + + (gw:wrap-function + mod + 'gnc:split-get-memo + '( gw:const) + "xaccSplitGetMemo" + '(( s)) + "Return split's memo.") + + (gw:wrap-function + mod + 'gnc:split-get-action + '( gw:const) + "xaccSplitGetAction" + '(( s)) + "Return split's action.") + + (gw:wrap-function + mod + 'gnc:split-get-reconcile-state + ' + "xaccSplitGetReconcile" + '(( s)) + "Return split's reconcile state.") + + (gw:wrap-function + mod + 'gnc:split-get-reconciled-date + ' + "gnc_split_get_date_reconciled" + '(( s)) + "Return split's reconciliation date.") + + (gw:wrap-function + mod + 'gnc:split-get-amount + ' + "xaccSplitGetAmount" + '(( s)) + "Return split's amount.") + + (gw:wrap-function + mod + 'gnc:split-get-share-price + ' + "xaccSplitGetSharePrice" + '(( s)) + "Return split's share price.") + + (gw:wrap-function + mod + 'gnc:split-get-value + ' + "xaccSplitGetValue" + '(( s)) + "Return split's value.") + + (gw:wrap-function + mod + 'gnc:split-get-account + ' + "xaccSplitGetAccount" + '(( s)) + "Return split's account.") + + (gw:wrap-function + mod + 'gnc:split-get-parent + ' + "xaccSplitGetParent" + '(( s)) + "Return the parent transaction of the split.") + + (gw:wrap-function + mod + 'gnc:split-get-other-split + ' + "xaccSplitGetOtherSplit" + '(( s)) + "Return the 'other' split of the parent transaction or NULL.") + + (gw:wrap-function + mod + 'gnc:split-compare-account-full-names + ' + "xaccSplitCompareAccountFullNames" + '(( sa) ( sb)) + "Compare two splits on the full names of their parent accounts") + + (gw:wrap-function + mod + 'gnc:split-compare-account-codes + ' + "xaccSplitCompareAccountCodes" + '(( sa) ( sb)) + "Compare two splits on the codes of their parent accounts") + + (gw:wrap-function + mod + 'gnc:split-compare-other-account-full-names + ' + "xaccSplitCompareOtherAccountFullNames" + '(( sa) ( sb)) + "Compare two splits on the full names of the *other* +split in the transaction") + + (gw:wrap-function + mod + 'gnc:split-compare-other-account-codes + ' + "xaccSplitCompareOtherAccountCodes" + '(( sa) ( sb)) + "Compare two splits on the codes of the *other* split in the transaction") + + (gw:wrap-function + mod + 'gnc:split-get-corr-account-name + '( gw:const) + "xaccSplitGetCorrAccountName" + '(( sa)) + "Find the split on the other side of the transaction, and return the name of +its account") + + (gw:wrap-function + mod + 'gnc:split-get-corr-account-full-name-internal + ' + "xaccSplitGetCorrAccountFullName" + '(( sa) ( separator)) + "Find the split on the other side of the transaction, and return the +name of its account. Don't use directly, use +gnc:split-get-corr-account-full-name in src/scm/report-utilities.scm") + (gw:wrap-function + mod + 'gnc:split-get-corr-account-code + '( gw:const) + "xaccSplitGetCorrAccountCode" + '(( sa)) + "Find the split on the other side of the transaction, and return the +code of its account") + + + (gw:wrap-function + mod + 'gnc:transaction-get-split + ' + "xaccTransGetSplit" + '(( t) ( i)) + "Returns a pointer to each of the splits in this transaction. Valid +values for i are zero to (number_of__splits-1). An invalid value of i +will cause NULL to be returned. A convenient way of cycling through +all splits is to start at zero, and kep incrementing until a null +pointer is returned.") + + (gw:wrap-function + mod + 'gnc:transaction-get-num + '( gw:const) + "xaccTransGetNum" + '(( t)) + "Return the transaction's num, an arbitrary user-assigned field. It +is intended to store a short id number, typically the check number, +deposit number, invoice number or other tracking number.") + + (gw:wrap-function + mod + 'gnc:transaction-get-description + '( gw:const) + "xaccTransGetDescription" + '(( t)) + "Return the transaction description, an arbitrary user-assigned +value. It is meant to be a short descriptive phrase.") + + (gw:wrap-function + mod + 'gnc:transaction-get-notes + '( gw:const) + "xaccTransGetNotes" + '(( t)) + "Return the transaction notes field.") + + (gw:wrap-function + mod + 'gnc:dmy2timespec + ' + "gnc_dmy2timespec" + '(( day) ( month) ( year)) + "Return a given day, month, and year as a pair where the car is the +number of seconds and the cdr is the number of nanoseconds.") + + (gw:wrap-function + mod + 'gnc:transaction-get-date-posted + ' + "gnc_transaction_get_date_posted" + '(( t)) + "Return the date the transaction was posted at the bank as a pair of +integers. The car is the number of seconds and the cdr is the number +of nanoseconds.") + + (gw:wrap-function + mod + 'gnc:transaction-get-date-entered + ' + "gnc_transaction_get_date_entered" + '(( t)) + "Return the date the transaction was entered into the register as a +pair of integers. The car is the number of seconds and the cdr is the +number of nanoseconds.") + + (gw:wrap-function + mod + 'gnc:transaction-set-date-posted + ' + "gnc_transaction_set_date_posted" + '(( t) ( date)) + "Modifies the posted date of the transaction. Footnote: this +shouldn't matter to a user, but anyone modifying the engine should +understand that when the transaction is committed, the date order of +each of the component splits will be checked, and they will be +restored in ascending date order. The date given should be a pair of +integers. The car is the number of seconds and the cdr is the number +of nanoseconds.") + + (gw:wrap-function + mod + 'gnc:transaction-set-date-entered + ' + "gnc_transaction_set_date_entered" + '(( t) ( date)) + "Modifies entered date of the transaction. The date given should be a +pair of integers. The car is the number of seconds and the cdr is the +number of nanoseconds.") + + (gw:wrap-function + mod + 'gnc:transaction-get-split-count + ' + "xaccTransCountSplits" + '(( t)) + "Return the number of splits in the transaction.") + + (gw:wrap-function + mod + 'gnc:transaction-get-currency + ' + "xaccTransGetCurrency" + '(( trans)) + "Returns the commodity common for this transaction. ATM it gives the same result as xaccTransFindCommonCurrency.") + + (gw:wrap-function + mod + 'gnc:transaction-set-currency + ' + "xaccTransSetCurrency" + '(( trans) ( comm)) + "Sets the commodity common for this transaction.") + + (gw:wrap-function + mod + 'gnc:malloc-account + ' + "xaccMallocAccount" + '() + "Allocate a new account structure.") + + (gw:wrap-function + mod + 'gnc:account-destroy + ' + "xaccAccountDestroy" + '(( account)) + "Free an account structure. (Must call gnc:account-begin-edit first)") + + (let ((docstr + "The gnc:account-begin-edit and gnc:account-commit-edit + subroutines provide a two-phase-commit wrapper for account updates.")) + (gw:wrap-function + mod + 'gnc:account-begin-edit + ' + "xaccAccountBeginEdit" + '(( a)) + docstr) + (gw:wrap-function + mod + 'gnc:account-commit-edit + ' + "xaccAccountCommitEdit" + '(( a)) + docstr)) + + (gw:wrap-function + mod + 'gnc:account-insert-split + ' + "xaccAccountInsertSplit" + '(( a) ( s)) + "Insert the split s into account a. If the split already belongs +to another account, it will be removed from that account first.") + + (gw:wrap-function + mod + 'gnc:account-fix-split-date-order + ' + "xaccAccountFixSplitDateOrder" + '(( a) ( s)) + "Check to see if split s is in proper sorted date order with respect +to the other splits in account a.") + + (gw:wrap-function + mod + 'gnc:trans-fix-split-date-order + ' + "xaccTransFixSplitDateOrder" + '(( t)) + "Check to see if all of the splits in transaction t are in proper +date order.") + + (gw:wrap-function + mod + 'gnc:account-order + ' + "xaccAccountOrder" + '(( a1) ( a2)) + "Defines a sorting order on accounts. Returns -1 if a1 is \"less +than\" the second, +1 if the a1 is \"greater than\" the second, and 0 +if they are equal. To determine the sort order, the account codes are +compared, and if these are equal, then account types, and, if these +are equal, then account names.") + + (gw:wrap-function + mod + 'gnc:account-set-type + ' + "xaccAccountSetType" + '(( a) ( type)) + "Set Account type. See definition of scheme GNCAccountType for values.") + + (gw:wrap-function + mod + 'gnc:account-set-name + ' + "xaccAccountSetName" + '(( a) (( gw:const) name)) + "Set account name") + + (gw:wrap-function + mod + 'gnc:account-set-code + ' + "xaccAccountSetCode" + '(( a) (( gw:const) code)) + "Set whatever cryptic code we wish to use as the alternative to +the account name. + +Commonly these codes are numeric, and organize asset accounts together +in one number range, liability accounts in another number range, and +so forth...") + + (gw:wrap-function + mod + 'gnc:account-set-description + ' + "xaccAccountSetDescription" + '(( a) (( gw:const) description)) + "Set a slightly-more-verbose description for the account.") + + (gw:wrap-function + mod + 'gnc:account-set-notes + ' + "xaccAccountSetNotes" + '(( a) (( gw:const) notes)) + "Set up a longer set of notes that provide a perhaps-very-verbose +description of the nature of a particular account.") + + (gw:wrap-function + mod + 'gnc:account-set-tax-related + ' + "xaccAccountSetTaxRelated" + '(( a) ( tax-related)) + "Set the tax-related flag of the account.") + + (gw:wrap-function + mod + 'gnc:account-get-type-string + '( gw:const) + "xaccAccountGetTypeStr" + '(( type)) + "What's the account type's name.") + + (gw:wrap-function + mod + 'gnc:account-get-type + ' + "xaccAccountGetType" + '(( a)) + "What's the account type? See scheme GNCAccountType enum def values.") + + (gw:wrap-function + mod + 'gnc:account-get-name + '( gw:const) + "xaccAccountGetName" + '(( a)) + "Get the brief name for the account.") + + (gw:wrap-function + mod + 'gnc:account-get-code + '( gw:const) + "xaccAccountGetCode" + '(( a)) + "Get the account's ``account code.'' + +Commonly this is used to provide a hierarchy where accounts with +similar classifications (e.g. - Assets, Liabilities, Equity, Income, +Expenses) are given numeric codes in corresponding ``number ranges.''") + + (gw:wrap-function + mod + 'gnc:account-get-description + '( gw:const) + "xaccAccountGetDescription" + '(( a)) + "Get the slightly-verbose description of the account.") + + (gw:wrap-function + mod + 'gnc:account-get-notes + '( gw:const) + "xaccAccountGetNotes" + '(( a)) + "Get the fully-verbose description of the account.") + + (gw:wrap-function + mod + 'gnc:account-get-commodity + '( gw:const) + "xaccAccountGetCommodity" + '(( a)) + "Get the commodity in which the account is denominated.") + + (gw:wrap-function + mod + 'gnc:account-set-commodity + ' + "xaccAccountSetCommodity" + '(( a) ( comm)) + "Set the commodity in which the account is denominated.") + + (gw:wrap-function + mod + 'gnc:account-get-tax-related + ' + "xaccAccountGetTaxRelated" + '(( a)) + "Get the tax related flag of the account.") + + (gw:wrap-function + mod + 'gnc:account-get-tax-US-code + '( gw:const) + "xaccAccountGetTaxUSCode" + '(( a)) + "Get the tax code set on the account.") + + (gw:wrap-function + mod + 'gnc:account-get-tax-US-payer-name-source + '( gw:const) + "xaccAccountGetTaxUSPayerNameSource" + '(( a)) + "Get the tax payer name source set on the account.") + + (gw:wrap-function + mod + 'gnc:account-get-price-src + '( gw:const) + "xaccAccountGetPriceSrc" + '(( a)) + "Get the account's price source, if any.") + + (gw:wrap-function + mod + 'gnc:account-get-quote-tz + '( gw:const) + "xaccAccountGetQuoteTZ" + '(( a)) + "Get the quote source's timezone, if any.") + + (gw:wrap-function + mod + 'gnc:account-get-children + ' + "xaccAccountGetChildren" + '(( a)) + "Get a pointer to an AccountGroup that represents the set of +children to this account.") + + (gw:wrap-function + mod + 'gnc:account-get-parent + ' + "xaccAccountGetParent" + '(( a)) + "Get the pointer to the account's parent.") + + (gw:wrap-function + mod + 'gnc:account-get-parent-account + ' + "xaccAccountGetParentAccount" + '(( a)) + "Get the pointer to the account's parent account.") + + (gw:wrap-function + mod + 'gnc:account-get-balance + ' + "xaccAccountGetBalance" + '(( a)) + "Undocumented.") + + (gw:wrap-function + mod + 'gnc:account-get-cleared-balance + ' + "xaccAccountGetClearedBalance" + '(( a)) + "Undocumented.") + + (gw:wrap-function + mod + 'gnc:account-get-reconciled-balance + ' + "xaccAccountGetReconciledBalance" + '(( a)) + "Undocumented.") + + (gw:wrap-function + mod + 'gnc:account-get-split-list + ' + "xaccAccountGetSplitList" + '(( a)) + "Get the GList of splits in account a.") + + (gw:wrap-function + mod + 'gnc:malloc-account-group + ' + "xaccMallocAccountGroup" + '() + "Create a newaccount group.") + + (gw:wrap-function + mod + 'gnc:free-account-group + ' + "xaccFreeAccountGroup" + '(( g)) + "Free an account group.") + + (gw:wrap-function + mod + 'gnc:group-merge-accounts + ' + "xaccGroupMergeAccounts" + '(( g)) + "Merge accounts which have the same name and description. Used in +importing Quicken files.") + + (gw:wrap-function + mod + 'gnc:group-concat-group + ' + "xaccGroupConcatGroup" + '(( old) + ( new)) + "Catenate accounts from one group into another. Used in Quicken +import.") + + (gw:wrap-function + mod + 'gnc:group-get-num-subaccounts + ' + "xaccGroupGetNumSubAccounts" + '(( g)) + "Return the number of accounts, including subaccounts, in the account +group") + + (gw:wrap-function + mod + 'gnc:group-get-num-accounts + ' + "xaccGroupGetNumAccounts" + '(( g)) + "Return the number of accounts in the indicated group only" + "(children not counted).") + + (gw:wrap-function + mod + 'gnc:group-get-account + ' + "xaccGroupGetAccount" + '(( g) ( n)) + "Return account number n in account group g.") + + (gw:wrap-function + mod + 'gnc:get-account-from-full-name + ' + "xaccGetAccountFromFullName" + '(( g) + (( gw:const) name) + ( separator)) + "Return account named name in group g. full path with separators.") + + (gw:wrap-function + mod + 'gnc:group-get-parent + ' + "xaccGroupGetParentAccount" + '(( g)) + "Return the parent acount for the group.") + + (gw:wrap-function + mod + 'gnc:group-insert-account + ' + "xaccGroupInsertAccount" + '(( g) ( a)) + "Add account a to group g.") + + (gw:wrap-function + mod + 'gnc:account-insert-subaccount + ' + "xaccAccountInsertSubAccount" + '(( p) ( c)) + "Add a child account c to parent p") + + (gw:wrap-function + mod + 'gnc:group-get-subaccounts + ' + "xaccGroupGetSubAccounts" + '(( g)) + "Return a GList containing all of the accounts, including +subaccounts, in the account group. The returned array should be freed +when no longer needed.") + + (gw:wrap-function + mod + 'gnc:group-get-account-list + ' + "xaccGroupGetAccountList" + '(( g)) + "Return a GList containing the immediate children of g.") + + (gw:wrap-function + mod + 'gnc:group-begin-staged-transaction-traversals + ' + "xaccGroupBeginStagedTransactionTraversals" + '(( group)) + "Sets things up to begin a sequence of staged traversals.") + + (gw:wrap-function + mod + 'gnc:group-staged-transaction-traversal + ' + "gnc_scmGroupStagedTransactionTraversal" + '(( group) + ( stage) + ( thunk)) + "FIXME: For now, see Group.h for info...") + + (gw:wrap-function + mod + 'gnc:account-staged-transaction-traversal + ' + "gnc_scmAccountStagedTransactionTraversal" + '(( account) + ( stage) + ( thunk)) + "FIXME: For now, see Group.h for info...") + + ;;============ + ;; GNCPriceDB + + (gw:wrap-non-native-type mod ' + "GNCPriceDB *" "const GNCPriceDB *") + (gw:wrap-non-native-type mod ' + "GNCPrice *" "const GNCPrice *") + + (gw:wrap-function + mod + 'gnc:price-create + ' + "gnc_price_create" + '() + "Create and return a new price.") + + (gw:wrap-function + mod + 'gnc:price-unref + ' + "gnc_price_unref" + '(( p)) + "Indicate you're finished with this price.") + + (gw:wrap-function + mod + 'gnc:price-set-commodity + ' + "gnc_price_set_commodity" + '(( p) ( c)) + "Set the price's commodity.") + + (gw:wrap-function + mod + 'gnc:price-set-currency + ' + "gnc_price_set_currency" + '(( p) ( c)) + "Set the price's currency.") + + (gw:wrap-function + mod + 'gnc:price-set-time + ' + "gnc_price_set_time" + '(( p) ( t)) + "Set the price's time stamp.") + + (gw:wrap-function + mod + 'gnc:price-set-source + ' + "gnc_price_set_source" + '(( p) ( src)) + "Set the price's source.") + + (gw:wrap-function + mod + 'gnc:price-set-type + ' + "gnc_price_set_type" + '(( p) ( type)) + "Set the price's type.") + + (gw:wrap-function + mod + 'gnc:price-set-value + ' + "gnc_price_set_value" + '(( p) ( value)) + "Set the price's value.") + + (gw:wrap-function + mod + 'gnc:price-get-value + ' + "gnc_price_get_value" + '(( p)) + "Get the price's value") + + (gw:wrap-function + mod + 'gnc:price-get-commodity + ' + "gnc_price_get_commodity" + '(( p)) + "Get the commodity this price is for.") + + (gw:wrap-function + mod + 'gnc:price-get-currency + ' + "gnc_price_get_currency" + '(( p)) + "Get the currency (commodity) this price's value is denominated in.") + + (gw:wrap-function + mod + 'gnc:price-get-time + ' + "gnc_price_get_time" + '(( p)) + "Get the time stamp of this price.") + + (gw:wrap-function + mod + 'gnc:pricedb-add-price + ' + "gnc_pricedb_add_price" + '(( db) ( p)) + "Add a price to the DB. Unref the price when you're finished with it.") + + (gw:wrap-function + mod + 'gnc:pricedb-lookup-latest + ' + "gnc_pricedb_lookup_latest" + '(( db) + ( commodity) ( currency)) + "Returns the latest price. Unref the price when you're finished with it.") + + (gw:wrap-function + mod + 'gnc:pricedb-lookup-nearest-in-time + ' + "gnc_pricedb_lookup_nearest_in_time" + '(( db) + ( commodity) ( currency) + ( t)) + "Returns the price quote nearest to t. Unref price when finished with it.") + + (gw:wrap-function + mod + 'gnc:pricedb-get-prices + ' + "gnc_pricedb_get_prices" + '(( db) + ( commodity) + ( currency)) + "Get all prices for commodity in currency.") + + (gw:wrap-function + mod + 'gnc:pricedb-lookup-at-time + ' + "gnc_pricedb_lookup_at_time" + '(( db) + ( commodity) ( currency) + ( t)) + "Lookup a price at time t.") + + ;;=========== + ;; GNCBook + + (gw:wrap-function + mod + 'gnc:book-new ' "gnc_book_new" '() + "Create a new book.") + + (gw:wrap-function + mod + 'gnc:book-destroy ' "gnc_book_destroy" '(( book)) + "Destroy the given book.") + + (gw:wrap-function + mod + 'gnc:book-begin + ' + "gnc_book_begin" + '(( book) + (( gw:const) id) + ( ignore-lock?) + ( create-if-nonexistent?)) + "Setup the book for use.") + + (gw:wrap-function + mod + 'gnc:book-load + ' + "gnc_book_load" + '(( book)) + "Load the data associated with the given book.") + + (gw:wrap-function + mod + 'gnc:book-save + ' + "gnc_book_save" + '(( book)) + "Save the data in the book.") + + (gw:wrap-function + mod + 'gnc:book-end + ' + "gnc_book_end" + '(( book)) + "Indicate you're finished with the book.") + + (gw:wrap-function + mod + 'gnc:book-get-group + ' + "gnc_book_get_group" + '(( book)) + "Get the book's account group.") + + (gw:wrap-function + mod + 'gnc:book-set-group + ' + "gnc_book_set_group" + '(( book) ( group)) + "Set the book's account group.") + + (gw:wrap-function + mod + 'gnc:book-get-commodity-table + ' + "gnc_book_get_commodity_table" + '(( book)) + "Get the book's commodity table.") + + (gw:wrap-function + mod + 'gnc:book-get-pricedb + ' + "gnc_book_get_pricedb" + '(( book)) + "Get the book's pricedb.") + + (gw:wrap-function + mod + 'gnc:book-get-error + ' + "gnc_book_get_error" + '(( book)) + "Check for a pending error.") + + (gw:wrap-function + mod + 'gnc:book-pop-error + ' + "gnc_book_pop_error" + '(( book)) + "Remove an error, if any, from the error stack.") + + (gw:wrap-function + mod + 'gnc:set-log-level-global + ' + "gnc_set_log_level_global" + '(( level)) + "Set the logging level for all modules to level.") + + (gw:wrap-function + mod + 'gnc:print-date + '( gw:const) + "gnc_print_date" + '(( date)) + "Returns a string with the date formatted according to the +current settings") + + (gw:wrap-function + mod + 'gnc:transaction-destroy + ' + "xaccTransDestroy" + '(( t)) + "Destroys the transaction in question.") + + (gw:wrap-function + mod + 'gnc:transaction-begin-edit + ' + "xaccTransBeginEdit" + '(( t)) + "Start an edit session on a transaction.") + + (gw:wrap-function + mod + 'gnc:transaction-commit-edit + ' + "xaccTransCommitEdit" + '(( t)) + "Commit edits to a transaction.") + + (gw:wrap-function + mod + 'gnc:transaction-is-open + ' + "xaccTransIsOpen" + '(( t)) + "Returns true if the transaction t is open for editing.") + + (gw:wrap-function + mod + 'gnc:split-destroy + ' + "xaccSplitDestroy" + '(( s)) + "Destroys the split in question. Probably only useful inside the context +of having a parent transaction with which one is working...") + + (gw:wrap-function + mod + 'gnc:transaction-append-split + ' + "xaccTransAppendSplit" + '(( t) ( s)) + "Adds a split to a transaction.") + + (gw:wrap-function + mod + 'gnc:transaction-set-date + ' + "xaccTransSetDate" + '(( t) + ( day) + ( month) + ( year)) + "Set date on transaction based on day, month, year values") + + (gw:wrap-function + mod + 'gnc:transaction-set-date-time-pair + ' + "gnc_transaction_set_date" + '(( t) ( date)) + "Set date on transaction based on the time-pair") + + (gw:wrap-function + mod + 'gnc:transaction-set-xnum + ' + "xaccTransSetNum" + '(( t) (( gw:const) xnum)) + "Set the XNUM - e.g. - cheque number or other identifier") + + (gw:wrap-function + mod + 'gnc:transaction-set-description + ' + "xaccTransSetDescription" + '(( t) (( gw:const) desc)) + "Set the transaction description.") + + (gw:wrap-function + mod + 'gnc:transaction-set-notes + ' + "xaccTransSetNotes" + '(( t) (( gw:const) notes)) + "Set the transaction notes field.") + + (gw:wrap-function + mod + 'gnc:transaction-create + ' + "xaccMallocTransaction" + '() + "Create a Transaction structure") + + (gw:wrap-function + mod + 'gnc:split-create + ' + "xaccMallocSplit" + '() + "Create a Split structure") + + (gw:wrap-function + mod + 'gnc:split-set-value + ' + "xaccSplitSetValue" + '(( s) ( amount)) + "Set value for split") + + (gw:wrap-function + mod + 'gnc:split-set-base-value + ' + "xaccSplitSetBaseValue" + '(( s) + ( amount) + ( currency)) + "Set value for split with currency") + + (gw:wrap-function + mod + 'gnc:split-set-memo + ' + "xaccSplitSetMemo" + '(( s) (( gw:const) memo)) + "Set memo for a split") + + (gw:wrap-function + mod + 'gnc:split-set-action + ' + "xaccSplitSetAction" + '(( s) (( gw:const) action)) + "Set Action for a split.") + + (gw:wrap-function + mod + 'gnc:split-set-reconcile + ' + "xaccSplitSetReconcile" + '(( s) ( value)) + "Set reconcile state for split entry") + + (gw:wrap-function + mod + 'd-gnc:split-set-share-price + ' + "DxaccSplitSetSharePrice" + '(( s) ( value)) + "Set share price for split entry") + + (gw:wrap-function + mod + 'gnc:split-set-share-price + ' + "xaccSplitSetSharePrice" + '(( s) ( value)) + "Set share price for split entry") + + (gw:wrap-function + mod + 'gnc:split-set-amount + ' + "xaccSplitSetAmount" + '(( s) ( value)) + "Set amount for split entry") + + (gw:wrap-function + mod + 'gnc:split-set-share-price-and-amount + ' + "xaccSplitSetSharePriceAndAmount" + '(( s) + ( price) + ( amount)) + "Set the share price and amount for split entry") + + (gw:wrap-function + mod + 'gnc:split-get-slots + ' + "xaccSplitGetSlots" + '(( s)) + "Get the split's slots.") + + (gw:wrap-function + mod + 'gnc:transaction-get-slots + ' + "xaccTransGetSlots" + '(( s)) + "Get the transaction's slots.") + + (gw:wrap-function + mod + 'gnc:account-get-slots + ' + "xaccAccountGetSlots" + '(( s)) + "Get the account's slots.") + + (gw:wrap-function + mod + 'gnc:malloc-query + ' + "xaccMallocQuery" + '() + "Create a new (empty) Query structure.") + + (gw:wrap-function + mod + 'gnc:free-query + ' + "xaccFreeQuery" + '(( q)) + "Delete the Query and its terms.") + + (gw:wrap-function + mod + 'gnc:query-set-group + ' + "xaccQuerySetGroup" + '(( q) ( group)) + "Set the account-group that a query pertains to.") + + (gw:wrap-function + mod + 'gnc:query-invert + ' + "xaccQueryInvert" + '(( q)) + "Logically invert a Query (returns a newly-allocated Query object)") + + (gw:wrap-function + mod + 'gnc:query-merge + ' + "xaccQueryMerge" + '(( q1) ( q2) ( qop)) + "Merge two queries (returns a newly allocated object") + + (gw:wrap-function + mod + 'gnc:query-clear + ' + "xaccQueryClear" + '(( q)) + "Clear the terms from a query object") + + (gw:wrap-function + mod + 'gnc:query-purge-terms + ' + "xaccQueryPurgeTerms" + '(( q) ( tt)) + "Remove query terms of a particular type.") + + (gw:wrap-function + mod + 'gnc:query-has-terms? + ' + "xaccQueryHasTerms" + '(( q)) + "Check if a Query is clear or has terms.") + + (gw:wrap-function + mod + 'gnc:query-get-splits + ' + "xaccQueryGetSplits" + '(( q)) + "Return a list of splits matching the Query.") + + (gw:wrap-function + mod + 'gnc:query-get-splits-unique-trans + ' + "xaccQueryGetSplitsUniqueTrans" + '(( q)) + "Return a list of splits matching the Query, but at most one per transaction") + + (gw:wrap-function + mod + 'gnc:query-get-transactions + ' + "xaccQueryGetTransactions" + '(( q) ( rt)) + "Find transactions with splits matching the Query.") + + (gw:wrap-function + mod + 'gnc:query-add-account-match + ' + "xaccQueryAddAccountMatch" + '(( q) + ( accts) + ( acctmatch) + ( how)) + "Match one or all of a set of accounts.") + + (gw:wrap-function + mod + 'gnc:query-add-single-account-match + ' + "xaccQueryAddSingleAccountMatch" + '(( q) ( acct) ( how)) + "Match a single account.") + + (gw:wrap-function + mod + 'gnc:query-add-description-match + ' + "xaccQueryAddDescriptionMatch" + '(( q) + (( gw:const) mstring) + ( case-sens) + ( use-regexp) + ( how)) + "Match transaction description.") + + (gw:wrap-function + mod + 'gnc:query-add-number-match + ' + "xaccQueryAddNumberMatch" + '(( q) + (( gw:const) mstring) + ( case-sens) + ( use-regexp) + ( how)) + "Match the Number field.") + + (gw:wrap-function + mod + 'gnc:query-add-action-match + ' + "xaccQueryAddActionMatch" + '(( q) + (( gw:const) mstring) + ( case-sens) + ( use-regexp) + ( how)) + "Match the Action field (a string).") + + (gw:wrap-function + mod + 'd-gnc:query-add-amount-match + ' + "DxaccQueryAddAmountMatch" + '(( q) + ( amount) + ( sgn) + ( mhow) + ( how)) + "Match the amount (including inequalities)") + + (gw:wrap-function + mod + 'd-gnc:query-add-share-price-match + ' + "DxaccQueryAddSharePriceMatch" + '(( q) + ( amount) + ( mhow) + ( how)) + "Match the share price (including inequalities)") + + (gw:wrap-function + mod + 'd-gnc:query-add-shares-match + ' + "DxaccQueryAddSharesMatch" + '(( q) + ( amount) + ( mhow) + ( how)) + "Match the share price (ncluding inequalities)") + + (gw:wrap-function + mod + 'gnc:query-add-date-match + ' + "xaccQueryAddDateMatch" + '(( q) + ( use-start) + ( st-year) + ( st-mon) + ( st-day) + ( use-end) + ( end-year) + ( end-mon) + ( end-day) + ( how)) + "Match the transaction date.") + + (gw:wrap-function + mod + 'gnc:query-add-date-match-timepair + ' + "xaccQueryAddDateMatchTS" + '(( q) + ( use-start) + ( start) + ( use-end) + ( end) + ( how)) + "Match the transaction date.") + + (gw:wrap-function + mod + 'gnc:query-add-memo-match + ' + "xaccQueryAddMemoMatch" + '(( q) + (( gw:const) mstring) + ( case-sens) + ( use-regexp) + ( how)) + "Match the Number field.") + + (gw:wrap-function + mod + 'gnc:query-add-cleared-match + ' + "xaccQueryAddClearedMatch" + '(( q) ( cleared-how) ( how)) + "match the cleared state.") + + (gw:wrap-function + mod + 'gnc:query-set-sort-order + ' + "xaccQuerySetSortOrder" + '(( q) + ( primary) + ( secondary) + ( tertiary)) + "set sort order.") + + (gw:wrap-function + mod + 'gnc:query-set-sort-increasing + ' + "xaccQuerySetSortIncreasing" + '(( q) + ( prim-increasing) + ( sec-increasing) + ( tert-increasing)) + "sort in increasing rather than decreasing order.") + + (gw:wrap-function + mod + 'gnc:query-set-max-splits + ' + "xaccQuerySetMaxSplits" + '(( q) ( n)) + "Set the max number of splits to be returned by a query.") + + (gw:wrap-function + mod + 'gnc:query->scm + ' + "gnc_query2scm" + '(( q)) + "Convert a query to an scm representation.") + + (gw:wrap-function + mod + 'gnc:scm->query + ' + "gnc_scm2query" + '(( query_scm)) + "Convert an scm representation of a query to a real query.") + + + ;;============= + ;; gnc-commodity + + (gw:wrap-function + mod + 'gnc:commodity-create + ' + "gnc_commodity_new" + '((( gw:const) fullname) + (( gw:const) namespace) + (( gw:const) mnemonic) + (( gw:const) exchange-code) + ( smallest-fraction)) + "Create a new gnc_commodity object.") + + (gw:wrap-function + mod + 'gnc:commodity-destroy + ' + "gnc_commodity_destroy" + '(( comm)) + "Delete a gnc_commodity structure.") + + (gw:wrap-function + mod + 'gnc:commodity-get-mnemonic + '( gw:const) + "gnc_commodity_get_mnemonic" + '(( comm)) + "Get the mnemonic (ISO 3-letter string, ticker symbol, etc)") + + (gw:wrap-function + mod + 'gnc:commodity-get-namespace + '( gw:const) + "gnc_commodity_get_namespace" + '(( comm)) + "Get the mnemonic's namespace (ISO-4217, NASDAQ, NYSE, etc)") + + (gw:wrap-function + mod + 'gnc:commodity-get-printname + '( gw:const) + "gnc_commodity_get_printname" + '(( comm)) + "Get the currency's printable name .. 'USD (US Dollars)'") + + (gw:wrap-function + mod + 'gnc:commodity-get-fullname + '( gw:const) + "gnc_commodity_get_fullname" + '(( comm)) + "Get the currency's full name (US Dollars).") + + (gw:wrap-function + mod + 'gnc:commodity-get-exchange-code + '( gw:const) + "gnc_commodity_get_exchange_code" + '(( comm)) + "Get the exchange code (ISO numeric code)") + + (gw:wrap-function + mod + 'gnc:commodity-get-fraction + ' + "gnc_commodity_get_fraction" + '(( comm)) + "Get the number of smallest transactional units per unit of the currency") + + (gw:wrap-function + mod + 'gnc:commodity-equiv? + ' + "gnc_commodity_equiv" + '(( comm1) ( comm2)) + "Return true if the two commodities are equivalent.") + + (gw:wrap-function + mod + 'gnc:commodity-table-lookup + ' + "gnc_commodity_table_lookup" + '(( table) + (( gw:const) namespace) + (( gw:const) mnemonic)) + "Find a known gnc_commodity structure.") + + (gw:wrap-function + mod + 'gnc:commodity-table-find-full + ' + "gnc_commodity_table_find_full" + '(( table) + (( gw:const) namespace) + (( gw:const) printname)) + "Find a gnc_commodity structure from its printable name.") + + (gw:wrap-function + mod + 'gnc:commodity-table-insert + ' + "gnc_commodity_table_insert" + '(( table) + ( commodity)) + "Add a commodity to the table.") + + (gw:wrap-function + mod + 'gnc:commodity-table-has-namespace + ' + "gnc_commodity_table_has_namespace" + '(( table) + (( gw:const) namespace)) + "Predicate to test for existence of a namespace.") + + (gw:wrap-function + mod + 'gnc:commodity-table-get-namespaces + ' + "gnc_commodity_table_get_namespaces" + '(( table)) + "Return a list of all the namespaces in the table.") + + (gw:wrap-function + mod + 'gnc:commodity-table-add-namespace + ' + "gnc_commodity_table_add_namespace" + '(( table) + (( gw:const) namespace)) + "Add a new namespace to the commodity table") + + (gw:wrap-function + mod + 'gnc:commodity-table-delete-namespace + ' + "gnc_commodity_table_delete_namespace" + '(( table) + (( gw:const) namespace)) + "Delete a namespace from the commodity table") + + (gw:wrap-function + mod + 'gnc:commodity-table-get-commodities + ' + "gnc_commodity_table_get_commodities" + '(( table) + (( gw:const) namespace)) + "Return a list of all the namespaces in the table.") + + (gw:wrap-function + mod + 'gnc:engine-commodities + ' + "gnc_engine_commodities" + '() + "Get the engine's list of known commodity types.") + + + ;;========= + + + (gw:wrap-function + mod + 'gnc:engine-shutdown + ' + "gnc_engine_shutdown" + '() + "Shutdown the gnucash engine.") + + ;;============ + ;; gnc_numeric + + (gw:wrap-function + mod + 'gnc:numeric-create + ' + "gnc_numeric_create" + '(( num) ( denom)) + "Create a new gnc_numeric object") + + (gw:wrap-function + mod + 'gnc:numeric-zero + ' + "gnc_numeric_zero" + '() + "Create a zero-valued gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-error + ' + "gnc_numeric_error" + '(( code)) + "Create an error-signaling gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-check + ' + "gnc_numeric_check" + '(( val)) + "Check for error code in a gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-num + ' + "gnc_numeric_num" + '(( arg)) + "Return the numerator of a gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-denom + ' + "gnc_numeric_denom" + '(( arg)) + "Return the denominator of a gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-zero-p + ' + "gnc_numeric_zero_p" + '(( arg)) + "Check for zero.") + + (gw:wrap-function + mod + 'gnc:numeric-compare + ' + "gnc_numeric_compare" + '(( arg1) ( arg2)) + "Compare 2 gnc_numeric (1 if a>b, 0 if a==b, -1 if a + "gnc_numeric_negative_p" + '(( arg)) + "Check for arg < 0") + + (gw:wrap-function + mod + 'gnc:numeric-positive-p + ' + "gnc_numeric_positive_p" + '(( arg)) + "Check for arg > 0") + + (gw:wrap-function + mod + 'gnc:numeric-eq + ' + "gnc_numeric_eq" + '(( arg1) ( arg2)) + "Check for arg1 exactly arg2") + + (gw:wrap-function + mod + 'gnc:numeric-equal + ' + "gnc_numeric_equal" + '(( arg1) ( arg2)) + "Check for arg1 same number as arg2") + + (gw:wrap-function + mod + 'gnc:numeric-same + ' + "gnc_numeric_same" + '(( arg1) + ( arg2) + ( denom) + ( how)) + "Check for arg1 same number as arg2 if converted to common denom") + + (gw:wrap-function + mod + 'gnc:numeric-add + ' + "gnc_numeric_add" + '(( arg1) + ( arg2) + ( denom) + ( how)) + "Return a+b") + + (gw:wrap-function + mod + 'gnc:numeric-sub + ' + "gnc_numeric_sub" + '(( arg1) + ( arg2) + ( denom) + ( how)) + "Return a-b") + + (gw:wrap-function + mod + 'gnc:numeric-mul + ' + "gnc_numeric_mul" + '(( arg1) + ( arg2) + ( denom) + ( how)) + "Return a*b") + + (gw:wrap-function + mod + 'gnc:numeric-div + ' + "gnc_numeric_div" + '(( arg1) + ( arg2) + ( denom) + ( how)) + "Return a/b") + + (gw:wrap-function + mod + 'gnc:numeric-neg + ' + "gnc_numeric_neg" + '(( arg)) + "Return -a") + + (gw:wrap-function + mod + 'gnc:numeric-abs + ' + "gnc_numeric_abs" + '(( arg)) + "Return |a|") + + (gw:wrap-function + mod + 'gnc:numeric-add-fixed + ' + "gnc_numeric_add_fixed" + '(( arg1) ( arg2)) + "Return a+b under strict fixed-denom rules") + + (gw:wrap-function + mod + 'gnc:numeric-sub-fixed + ' + "gnc_numeric_sub_fixed" + '(( arg1) ( arg2)) + "Return a-b under strict fixed-denom rules") + + (gw:wrap-function + mod + 'gnc:numeric-convert + ' + "gnc_numeric_convert" + '(( arg) ( denom) ( how)) + "Convert a gnc_numeric to a new denominator") + + (gw:wrap-function + mod + 'gnc:double-to-gnc-numeric + ' + "double_to_gnc_numeric" + '(( in) ( denom) ( how)) + "Convert to gnc_numeric") + + (gw:wrap-function + mod + 'gnc:numeric-to-double + ' + "gnc_numeric_to_double" + '(( in)) + "Convert gnc_numeric to double") + + (gw:wrap-function + mod + 'gnc:numeric-to-string + '( gw:const) + "gnc_numeric_to_string" + '(( arg)) + "Convert gnc_numeric to a printable string") + + + (gw:wrap-function + mod + 'gnc:run-rpc-server + ' + "gnc_run_rpc_server" + '() + "Run the RPC Server")) + + + diff --git a/src/engine/gw-glib-spec.scm b/src/engine/gw-glib-spec.scm new file mode 100644 index 0000000000..2970c53782 --- /dev/null +++ b/src/engine/gw-glib-spec.scm @@ -0,0 +1,195 @@ +(use-modules (g-wrap)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(define-module (g-wrapped gw-glib-spec) + :use-module (g-wrap)) + +(let ((mod (gw:new-module "gw-glib"))) + + (define (standard-c-call-gen result func-call-code) + (list (gw:result-get-c-name result) " = " func-call-code ";\n")) + + (define (add-standard-result-handlers! type c->scm-converter) + (define (standard-pre-handler result) + (let* ((ret-type-name (gw:result-get-proper-c-type-name result)) + (ret-var-name (gw:result-get-c-name result))) + (list "{\n" + " " ret-type-name " " ret-var-name ";\n"))) + + (gw:type-set-pre-call-result-ccodegen! type standard-pre-handler) + + (gw:type-set-post-call-result-ccodegen! + type + (lambda (result) + (let* ((scm-name (gw:result-get-scm-name result)) + (c-name (gw:result-get-c-name result))) + (list + (c->scm-converter scm-name c-name) + " }\n"))))) + + (gw:module-depends-on mod "gw-runtime") + + (gw:module-set-guile-module! mod '(g-wrapped gw-glib)) + + ;; All of this glib string code needs to be moved to the (g-wrapped + ;; glib) module, as does the supporting header code above -- we'll + ;; do that next time round. + + (let ((nnt (gw:wrap-non-native-type mod ' + "GList*" "const GList*"))) + #t) + + (gw:wrap-function + mod + 'gnc:glist->list + ' "gnc_glist_to_scm_list" '(( glist) ( wct)) + "Convert glist to scheme list of wcp's of type wct.") + + (gw:wrap-function + mod + 'gnc:list->glist + ' "gnc_scm_list_to_glist" '(( wcp-list)) + "Convert scheme list of wcp's to GList*.") + + (gw:wrap-function + mod + 'gnc:glist-map + ' "gnc_glist_scm_map" '(( wct) ( thunk) ( glist)) + "Call thunk on every element of glist after conversion to wcp of type wct, " + "and return a list of the results.") + + (gw:wrap-function + mod + 'gnc:glist-for-each + ' "gnc_glist_scm_for_each" + '(( wct) ( thunk) ( glist)) + "Call thunk on every element of glist after conversion to wcp of type wct.") + + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; gint64 + (let ((wt (gw:wrap-type mod ' "gint64" "const gint64"))) + + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + ;; I don't know if it's more efficient to work on the C side or + ;; the scheme side... + (let ((x (gw:param-get-scm-name param))) + (list "gnc_gh_gint64_p(" x ")")))) + + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param))) + (list + c-name " = gnc_scm_to_gint64(" scm-name ");\n")))) + + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (list scm-name " = gnc_gint64_to_scm(" c-name ");\n")))) + + +;; until we have a case for g-chars-callee-owned as arg or +;; g-chars-caller-owned for result, then we don't need these, but +;; they're ready to go right now. + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; g-chars-caller-owned + ;; g_newed gchar* (string), caller-owned + ;; + ;; arg temps will be allocated with g_new before call, g_freed on return. + ;; result temps will be g_freed after conversion to scheme. + ;; + + (let ((wt (gw:wrap-type mod ' + "gchar *" "const gchar *"))) + + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (type param) + (let ((x (gw:param-get-scm-name param))) + (list "((" x " == SCM_BOOL_F) || SCM_STRINGP(" x "))")))) + + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (type param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param))) + (list + "{\n" + " if(" scm-name " == SCM_BOOL_F) {\n" + " " c-name " = NULL;\n" + " } else {\n" + " char *tmpstr = gh_scm2newstr(" scm-name ", NULL);\n" + " " c-name " = g_strdup(tmpstr);\n" + " free(tmpstr);\n" + " }\n" + "}\n")))) + + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (gw:type-set-post-call-arg-ccodegen! + wt + (lambda (type param) + (let* ((c-name (gw:param-get-c-name param))) + (list "g_free((void *) " c-name ");\n")))) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (list + scm-name " = ((" c-name ") ? gh_str02scm(" c-name ") : SCM_BOOL_F);\n" + "g_free((void *) " c-name ");\n")))) + + (let ((wt (gw:wrap-type + mod + ' + "GList *" "const GList *"))) + (gw:type-set-scm-arg-type-test-ccodegen! + wt + (lambda (param) + (let ((old-func + (lambda (x) (list "gnc_glist_string_p(" x ")")))) + (old-func (gw:param-get-scm-name param))))) + (gw:type-set-pre-call-arg-ccodegen! + wt + (lambda (param) + (let* ((scm-name (gw:param-get-scm-name param)) + (c-name (gw:param-get-c-name param)) + (old-func + (lambda (x) + (list "gnc_scm_to_glist_string(" x ")")))) + (list c-name + " = " + (old-func scm-name) + ";\n")))) + (gw:type-set-call-ccodegen! wt standard-c-call-gen) + + (add-standard-result-handlers! + wt + (lambda (scm-name c-name) + (let ((old-func + (lambda (x) + (list "gnc_glist_string_to_scm(" x ")")))) + (list scm-name + " = " + (old-func c-name) + ";\n"))))) + + (gw:module-set-declarations-ccodegen! + mod + (lambda (client-only?) + (list + "#include \n" + "#include \"glib-helpers.h\"\n")))) + + + + diff --git a/src/scm/iso-4217-currencies.scm b/src/engine/iso-4217-currencies.scm similarity index 100% rename from src/scm/iso-4217-currencies.scm rename to src/engine/iso-4217-currencies.scm diff --git a/src/engine/kvp_doc.txt b/src/engine/kvp_doc.txt deleted file mode 100644 index 359ddc58cf..0000000000 --- a/src/engine/kvp_doc.txt +++ /dev/null @@ -1,176 +0,0 @@ -This file documents the use of keys in the key-value pair system -used by the Engine. Before assigning keys for use, please read -the Key-Value Policy in the GnuCash Design Document located -under src/doc/design. - -The format of the data below is: - -Name: The name of the key, including key names of parent frames - with the parent frames listed first, as in a fully-qualified - filename. Use the '/' character to separate keys. - -Type: The type of value stored in the key. The types are listed in - 'kvp_frame.h'. - -Entities: Which engine entities (Accounts, Transactions, Splits) - can use this key. Use 'All' if every entity could have - the key. - -Use: The use to which the key will be put. Include any requirements - for using the key here. Also include any API calls which use - the key. If more than one entity can use the key, - - -Example: - -Name: my-favorite-thing -Type: string -Entities: Accounts -Use: xaccGetMyFavoriteThing(), xaccSetMyFavoriteThing() - This key stores a text description of the user's - favorite thing. Do not use this key to store things - which the user merely likes! - - -Please put the keys in alphabetical order. - --------------------------------------------------------------------------- - -Name: last-num -Type: string -Entities: Account -Use: xaccAccountGetLastNum, xaccAccountSetLastNum - Store the last number used in an account's transactions. - Used in auto-filling the Num field. - -Name: memo -Type: string -Entities: Split -Use: xaccSplitGetMemo, xaccSplitSetMemo - Store the 'Memo' string associated with Splits. - -Name: notes -Type: string -Entities: Account, Transaction -Use: xaccAccountGetNotes, xaccAccountSetNotes, - xaccTransGetNotes, xaccTransSetNotes - Store the 'Notes' string which was previously stored in - the Account structure directly. - -Name: old-currency -Type: string -Entities: Account -Use: This string holds the canonical name of the old Account - currency. This may be deleted at some point in the future. - -Name: old-currency-scu -Type: gint64 -Entities: Account -Use: This holds the old currency scu. This may be deleted at - some point in the future. - -Name: old-docref -Type: string -Entities: Transactions, Splits -Use: This string holds the old Docref value which was supported in earlier - versions of GnuCash but which was never used for any purpose. The - value is retained in case any users were making use of it. - -Name: old-price-source -Type: string -Entities: Account -Use: This string holds the old Price Source code used by earlier versions - of GnuCash and stored in the obsolete AccInfo structure. The use of - this value will be deprecated when the new version of Finance::Quote - is fully supported. The new version of Finance::Quote uses a different - scheme to identify sources for price quotes. - -Name: old-security -Type: string -Entities: Account -Use: This string holds the canonical name of the old Account - security. This may be deleted at some point in the future. - -Name: old-security-scu -Type: gint64 -Entities: Account -Use: This holds the old security scu. This may be deleted at - some point in the future. - -Name: reconcile-info -Type: frame -Entities: Account -Use: store reconcile information about accounts - -Name: reconcile-info/last-date -Type: frame -Entities: Account -Use: store the statement date of the last reconciliation - -Name: reconcile-info/postpone/date -Type: gint64 -Entities: Account -Use: store the ending statement date of a postponed reconciliation - -Name: reconcile-info/postpone/balance -Type: numeric -Entities: Account -Use: store the ending balance of a postponed reconciliation - -Name: reconcile-info/auto-interest-transfer -Type: string -Entities: Account -Use: allows the user to override the global reconcile option - "Automatic interest transfer" on a per-account basis. - Acceptable values are "true" and "false". - (This really could use a KVP_TYPE_BOOLEAN.) - -Name: split-type -Entities: Split -Use: xaccSplitGetType, xaccSplitMakeStockSplit - Store a string representing the type of split, if not normal. - -Name: tax-US/code -Type: string -Entities: Account -Use: see src/scm/report/[tax,txf]*.scm - -Name: tax-US/payer-name-source -Type: string -Entities: Account -Use: see src/scm/report/[tax,txf]*.scm - -Name: tax-related -Type: gint64 -Entities: Account -Use: A boolean flag indicated whether the Account is tax-related. - -Name: sched-xaction -Type: frame -Entities: Split in a SchedXaction -Use: Storage for the various fields of a scheduled transaction's - template Splits. - -Name: sched-xaction/xfrm -Type: GUID -Entities: Split associated with a SchedXaction -Use: The GUID of this Split's xfrm account. - -Name: sched-xaction/amnt -Type: string -Entities: Split associated with a SchedXaction -Use: The amount field of a SchedXaction might be a formula, which we - store here. - -Name: from-sched-xaction -Type: GUID -Entities: Transaction -Use: Identifies that the Transaction was created from a ScheduledTransaction, - and stores the GUID of that SX. - -Name: user-keys -Type: frame -Entities: All -Use: This frame is used to store keys which are editable directly by - the user. The program should not attach any semantics to keys - under this frame. diff --git a/src/engine/kvp_frame.c b/src/engine/kvp_frame.c deleted file mode 100644 index 14454bac61..0000000000 --- a/src/engine/kvp_frame.c +++ /dev/null @@ -1,1107 +0,0 @@ -/******************************************************************** - * kvp_frame.c -- a key-value frame system for gnucash. * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * - ********************************************************************/ - -#include "config.h" - -#define _GNU_SOURCE -#include -#include -#include -#include - -#include "gnc-engine.h" -#include "gnc-engine-util.h" -#include "gnc-numeric.h" -#include "guid.h" -#include "kvp_frame.h" - - - /* Note that we keep the keys for this hash table in a GCache - * (gnc_string_cache), as it is likely we will see the same keys - * over and over again */ -struct _kvp_frame { - GHashTable * hash; -}; - - -typedef struct { - void *data; - int datasize; -} kvp_value_binary_data; - -struct _kvp_value { - kvp_value_t type; - union { - gint64 int64; - double dbl; - gnc_numeric numeric; - gchar *str; - GUID *guid; - kvp_value_binary_data binary; - GList *list; - kvp_frame *frame; - } value; -}; - -/* This static indicates the debugging module that this .o belongs to. */ -static short module = MOD_ENGINE; - -/******************************************************************** - * kvp_frame functions - ********************************************************************/ - -static guint -kvp_hash_func(gconstpointer v) { - return g_str_hash(v); -} - -static gint -kvp_comp_func(gconstpointer v, gconstpointer v2) { - return g_str_equal(v, v2); -} - -static gboolean -init_frame_body_if_needed(kvp_frame *f) { - if(!f->hash) { - f->hash = g_hash_table_new(&kvp_hash_func, - &kvp_comp_func); - } - return(f->hash != NULL); -} - -kvp_frame * -kvp_frame_new(void) { - kvp_frame * retval = g_new0(kvp_frame, 1); - /* save space until we have data */ - retval->hash = NULL; - return retval; -} - -static void -kvp_frame_delete_worker(gpointer key, gpointer value, gpointer user_data) { - g_cache_remove(gnc_engine_get_string_cache(), key); - kvp_value_delete((kvp_value *)value); -} - -void -kvp_frame_delete(kvp_frame * frame) { - if (!frame) - return; - - if(frame->hash) { - /* free any allocated resource for frame or its children */ - g_hash_table_foreach(frame->hash, & kvp_frame_delete_worker, - (gpointer)frame); - - /* delete the hash table */ - g_hash_table_destroy(frame->hash); - frame->hash = NULL; - } - g_free(frame); -} - -gboolean -kvp_frame_is_empty(kvp_frame * frame) -{ - if (!frame) return TRUE; - if (!frame->hash) return TRUE; - return FALSE; -} - -static void -kvp_frame_copy_worker(gpointer key, gpointer value, gpointer user_data) { - kvp_frame * dest = (kvp_frame *)user_data; - g_hash_table_freeze(dest->hash); - g_hash_table_insert(dest->hash, - (gpointer)g_cache_insert(gnc_engine_get_string_cache(), key), - (gpointer)kvp_value_copy(value)); - g_hash_table_thaw(dest->hash); -} - -kvp_frame * -kvp_frame_copy(const kvp_frame * frame) { - kvp_frame * retval = kvp_frame_new(); - - if (!frame) - return retval; - - if(frame->hash) { - if(!init_frame_body_if_needed(retval)) return(NULL); - g_hash_table_foreach(frame->hash, - & kvp_frame_copy_worker, - (gpointer)retval); - } - return retval; -} - -static void -kvp_frame_set_slot_destructively(kvp_frame * frame, const char * slot, - kvp_value * new_value) { - /* FIXME: no way to indicate errors... */ - - gpointer orig_key; - gpointer orig_value; - int key_exists; - - if(!new_value && !frame->hash) return; /* don't need to do anything */ - if(!init_frame_body_if_needed(frame)) return; - - g_hash_table_freeze(frame->hash); - - key_exists = g_hash_table_lookup_extended(frame->hash, slot, - & orig_key, & orig_value); - if(key_exists) { - g_hash_table_remove(frame->hash, slot); - g_cache_remove(gnc_engine_get_string_cache(), orig_key); - kvp_value_delete(orig_value); - } - - if(new_value) { - g_hash_table_insert(frame->hash, - g_cache_insert(gnc_engine_get_string_cache(), - (gpointer) slot), - new_value); - } - - g_hash_table_thaw(frame->hash); -} - -void -kvp_frame_set_slot(kvp_frame * frame, const char * slot, - const kvp_value * value) { - /* FIXME: no way to indicate errors... */ - - kvp_value *new_value = NULL; - - if (!frame) - return; - - if(value) new_value = kvp_value_copy(value); - kvp_frame_set_slot_destructively(frame, slot, new_value); -} - -void -kvp_frame_set_slot_nc(kvp_frame * frame, const char * slot, - kvp_value * value) { - /* FIXME: no way to indicate errors... */ - - if (!frame) - return; - - kvp_frame_set_slot_destructively(frame, slot, value); -} - -kvp_value * -kvp_frame_get_slot(kvp_frame * frame, const char * slot) { - if (!frame) - return NULL; - if(!frame->hash) return(NULL); - return (kvp_value *)g_hash_table_lookup(frame->hash, slot); -} - -/* ============================================================ */ - -void -kvp_frame_set_slot_path (kvp_frame *frame, - const kvp_value *new_value, - const char *first_key, ...) { - va_list ap; - const char *key; - - if (!frame || !first_key) - return; - - va_start (ap, first_key); - - key = first_key; - - while (TRUE) { - kvp_value *value; - const char *next_key; - - next_key = va_arg (ap, const char *); - if (!next_key) { - kvp_frame_set_slot (frame, key, new_value); - break; - } - - value = kvp_frame_get_slot (frame, key); - if (!value) { - kvp_frame *new_frame = kvp_frame_new (); - kvp_value *frame_value = kvp_value_new_frame (new_frame); - - kvp_frame_set_slot_nc (frame, key, frame_value); - - value = kvp_frame_get_slot (frame, key); - if (!value) - break; - } - - frame = kvp_value_get_frame (value); - if (!frame) - break; - - key = next_key; - } - - va_end (ap); -} - -void -kvp_frame_set_slot_path_gslist (kvp_frame *frame, - const kvp_value *new_value, - GSList *key_path) { - if (!frame || !key_path) - return; - - while (TRUE) { - const char *key = key_path->data; - kvp_value *value; - - if (!key) - return; - - key_path = key_path->next; - if (!key_path) { - kvp_frame_set_slot (frame, key, new_value); - return; - } - - value = kvp_frame_get_slot (frame, key); - if (!value) { - kvp_frame *new_frame = kvp_frame_new (); - kvp_value *frame_value = kvp_value_new_frame (new_frame); - - kvp_frame_set_slot_nc (frame, key, frame_value); - - value = kvp_frame_get_slot (frame, key); - if (!value) - return; - } - - frame = kvp_value_get_frame (value); - if (!frame) - return; - } -} - -/* ============================================================ */ - - -kvp_frame * -kvp_frame_get_frame_gslist (kvp_frame *frame, GSList *key_path) -{ - if (!frame || !key_path) - return frame; - - while (TRUE) { - const char *key = key_path->data; - kvp_value *value; - - if (!key) - return frame; /* an unusual but valid exit for this routine. */ - - /* get the named frame, or create it if it doesn't exist */ - value = kvp_frame_get_slot (frame, key); - if (!value) { - kvp_frame *new_frame = kvp_frame_new (); - kvp_value *frame_value = kvp_value_new_frame (new_frame); - - kvp_frame_set_slot_nc (frame, key, frame_value); - - value = kvp_frame_get_slot (frame, key); - if (!value) - return frame; /* this should never happen */ - } - - frame = kvp_value_get_frame (value); - if (!frame) - return NULL; /* this should never happen */ - - key_path = key_path->next; - if (!key_path) { - return frame; /* this is the normal exit for this func */ - } - } -} - -static GSList* -charstar_va_list_to_gslist(va_list lst) -{ - const char *val; - GSList *ret = NULL; - - while(TRUE) - { - val = va_arg(lst, const char*); - - if(!val) - { - break; - } - - ret = g_slist_append(ret, (gpointer)val); - } - - return ret; -} - -kvp_frame * -kvp_frame_get_frame (kvp_frame *frame, ...) -{ - va_list ap; - GSList *lst; - kvp_frame *ret; - - if (!frame) - return NULL; - - va_start (ap, frame); - - lst = charstar_va_list_to_gslist(ap); - - ret = kvp_frame_get_frame_gslist(frame, lst); - - va_end (ap); - - g_slist_free(lst); - - return ret; -} - -static GSList* -kvp_frame_parse_slash_path(const char *key_path) -{ - char *root, *key, *next; - GSList *ret; - - ret = NULL; - - root = g_strdup (key_path); - key = root; - key --; - - while (key) { - key ++; - while ('/' == *key) { key++; } - if ('\0' == *key) break; /* trailing slash */ - next = strchr (key, '/'); - if (next) *next = '\0'; - - ret = g_slist_append(ret, g_strdup(key)); - - key = next; - } - - g_free(root); - return ret; -} - -static void -kvp_frame_sp_free_string(gpointer data, gpointer ignored) -{ - g_free(data); -} - -static void -kvp_frame_delete_slash_path_gslist(GSList *lst) -{ - g_slist_foreach(lst, kvp_frame_sp_free_string, NULL); - g_slist_free(lst); -} - -kvp_frame * -kvp_frame_get_frame_slash (kvp_frame *frame, const char *key_path) -{ - GSList *lst; - kvp_frame *ret; - - if (!frame || !key_path) - return frame; - - lst = kvp_frame_parse_slash_path(key_path); - ret = kvp_frame_get_frame_gslist(frame, lst); - kvp_frame_delete_slash_path_gslist(lst); - - return ret; -} - -/* ============================================================ */ - -kvp_value * -kvp_frame_get_slot_path (kvp_frame *frame, - const char *first_key, ...) { - va_list ap; - kvp_value *value; - const char *key; - - if (!frame || !first_key) - return NULL; - - va_start (ap, first_key); - - key = first_key; - value = NULL; - - while (TRUE) { - value = kvp_frame_get_slot (frame, key); - if (!value) - break; - - key = va_arg (ap, const char *); - if (!key) - break; - - frame = kvp_value_get_frame (value); - if (!frame) - { - value = NULL; - break; - } - } - - va_end (ap); - - return value; -} - -kvp_value * -kvp_frame_get_slot_path_gslist (kvp_frame *frame, - GSList *key_path) { - if (!frame || !key_path) - return NULL; - - while (TRUE) { - const char *key = key_path->data; - kvp_value *value; - - if (!key) - return NULL; - - value = kvp_frame_get_slot (frame, key); - if (!value) - return NULL; - - key_path = key_path->next; - if (!key_path) - return value; - - frame = kvp_value_get_frame (value); - if (!frame) - return NULL; - } -} - -/******************************************************************** - * kvp glist functions - ********************************************************************/ - -static void -kvp_glist_delete_worker(gpointer datum, gpointer user_data) { - kvp_value * val = (kvp_value *)datum; - kvp_value_delete(val); -} - -void -kvp_glist_delete(GList * list) { - if(list) { - /* delete the data in the list */ - g_list_foreach(list, & kvp_glist_delete_worker, NULL); - - /* free the backbone */ - g_list_free(list); - } -} - -GList * -kvp_glist_copy(const GList * list) { - GList * retval = NULL; - GList * lptr; - - if(!list) return retval; - - /* duplicate the backbone of the list (this duplicates the POINTERS - * to the values; we need to deep-copy the values separately) */ - retval = g_list_copy((GList *) list); - - /* this step deep-copies the values */ - for(lptr = retval; lptr; lptr = lptr->next) { - lptr->data = kvp_value_copy(lptr->data); - } - - return retval; -} - -gint -kvp_glist_compare(const GList * list1, const GList * list2) { - const GList *lp1; - const GList *lp2; - - if(list1 == list2) return 0; - /* nothing is always less than something */ - if(!list1 && list2) return -1; - if(list1 && !list2) return 1; - - lp1 = list1; - lp2 = list2; - while(lp1 && lp2) { - kvp_value *v1 = (kvp_value *) lp1->data; - kvp_value *v2 = (kvp_value *) lp2->data; - gint vcmp = kvp_value_compare(v1, v2); - if(vcmp != 0) return vcmp; - lp1 = lp1->next; - lp2 = lp2->next; - } - if(!lp1 && lp2) return -1; - if(!lp2 && lp1) return 1; - return 0; -} - -/******************************************************************** - * kvp_value functions - ********************************************************************/ - -kvp_value * -kvp_value_new_gint64(gint64 value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_GINT64; - retval->value.int64 = value; - return retval; -} - -kvp_value * -kvp_value_new_double(double value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_DOUBLE; - retval->value.dbl = value; - return retval; -} - -kvp_value * -kvp_value_new_gnc_numeric(gnc_numeric value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_NUMERIC; - retval->value.numeric = value; - return retval; -} - -kvp_value * -kvp_value_new_string(const char * value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_STRING; - retval->value.str = g_strdup(value); - return retval; -} - -kvp_value * -kvp_value_new_guid(const GUID * value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_GUID; - retval->value.guid = g_new0(GUID, 1); - memcpy(retval->value.guid, value, sizeof(GUID)); - return retval; -} - -kvp_value * -kvp_value_new_binary(const void * value, guint64 datasize) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_BINARY; - retval->value.binary.data = g_new0(char, datasize); - retval->value.binary.datasize = datasize; - memcpy(retval->value.binary.data, value, datasize); - return retval; -} - -kvp_value * -kvp_value_new_binary_nc(void * value, guint64 datasize) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_BINARY; - retval->value.binary.data = value; - retval->value.binary.datasize = datasize; - return retval; -} - -kvp_value * -kvp_value_new_glist(const GList * value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_GLIST; - retval->value.list = kvp_glist_copy(value); - return retval; -} - -kvp_value * -kvp_value_new_glist_nc(GList * value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_GLIST; - retval->value.list = value; - return retval; -} - -kvp_value * -kvp_value_new_frame(const kvp_frame * value) { - kvp_value * retval = g_new0(kvp_value, 1); - retval->type = KVP_TYPE_FRAME; - retval->value.frame = kvp_frame_copy(value); - return retval; -} - -void -kvp_value_delete(kvp_value * value) { - if(!value) return; - - switch(value->type) { - case KVP_TYPE_STRING: - g_free(value->value.str); - break; - case KVP_TYPE_GUID: - g_free(value->value.guid); - break; - case KVP_TYPE_BINARY: - g_free(value->value.binary.data); - break; - case KVP_TYPE_GLIST: - kvp_glist_delete(value->value.list); - break; - case KVP_TYPE_FRAME: - kvp_frame_delete(value->value.frame); - break; - - case KVP_TYPE_GINT64: - case KVP_TYPE_DOUBLE: - case KVP_TYPE_NUMERIC: - default: - break; - } - g_free(value); -} - -kvp_value_t -kvp_value_get_type(const kvp_value * value) { - if (!value) return -1; - return value->type; -} - -gint64 -kvp_value_get_gint64(const kvp_value * value) { - if (!value) return 0; - if(value->type == KVP_TYPE_GINT64) { - return value->value.int64; - } - else { - return 0; - } -} - -double -kvp_value_get_double(const kvp_value * value) { - if (!value) return 0.0; - if(value->type == KVP_TYPE_DOUBLE) { - return value->value.dbl; - } - else { - return 0.0; - } -} - -gnc_numeric -kvp_value_get_numeric(const kvp_value * value) { - if (!value) return gnc_numeric_zero (); - if(value->type == KVP_TYPE_NUMERIC) { - return value->value.numeric; - } - else { - return gnc_numeric_zero (); - } -} - -char * -kvp_value_get_string(const kvp_value * value) { - if (!value) return NULL; - if(value->type == KVP_TYPE_STRING) { - return value->value.str; - } - else { - return NULL; - } -} - -GUID * -kvp_value_get_guid(const kvp_value * value) { - if (!value) return NULL; - if(value->type == KVP_TYPE_GUID) { - return value->value.guid; - } - else { - return NULL; - } -} - -void * -kvp_value_get_binary(const kvp_value * value, guint64 * size_return) { - if (!value) - { - if (size_return) - *size_return = 0; - return NULL; - } - - if(value->type == KVP_TYPE_BINARY) { - if (size_return) - *size_return = value->value.binary.datasize; - return value->value.binary.data; - } - else { - if (size_return) - *size_return = 0; - return NULL; - } -} - -GList * -kvp_value_get_glist(const kvp_value * value) { - if (!value) return NULL; - if(value->type == KVP_TYPE_GLIST) { - return value->value.list; - } - else { - return NULL; - } -} - -kvp_frame * -kvp_value_get_frame(const kvp_value * value) { - if (!value) return NULL; - if(value->type == KVP_TYPE_FRAME) { - return value->value.frame; - } - else { - return NULL; - } -} - -/* manipulators */ - -kvp_value * -kvp_value_copy(const kvp_value * value) { - - if(!value) return NULL; - - switch(value->type) { - case KVP_TYPE_GINT64: - return kvp_value_new_gint64(value->value.int64); - break; - case KVP_TYPE_DOUBLE: - return kvp_value_new_double(value->value.dbl); - break; - case KVP_TYPE_NUMERIC: - return kvp_value_new_gnc_numeric(value->value.numeric); - break; - case KVP_TYPE_STRING: - return kvp_value_new_string(value->value.str); - break; - case KVP_TYPE_GUID: - return kvp_value_new_guid(value->value.guid); - break; - case KVP_TYPE_BINARY: - return kvp_value_new_binary(value->value.binary.data, - value->value.binary.datasize); - break; - case KVP_TYPE_GLIST: - return kvp_value_new_glist(value->value.list); - break; - case KVP_TYPE_FRAME: - return kvp_value_new_frame(value->value.frame); - break; - } - return NULL; -} - -void -kvp_frame_for_each_slot(kvp_frame *f, - void (*proc)(const char *key, - kvp_value *value, - gpointer data), - gpointer data) { - - if(!f) return; - if(!proc) return; - if(!(f->hash)) return; - - g_hash_table_foreach(f->hash, (GHFunc) proc, data); -} - -gint -double_compare(double d1, double d2) -{ - if(isnan(d1) && isnan(d2)) return 0; - if(d1 < d2) return -1; - if(d1 > d2) return 1; - return 0; -} - -gint -kvp_value_compare(const kvp_value * kva, const kvp_value * kvb) { - if(kva == kvb) return 0; - /* nothing is always less than something */ - if(!kva && kvb) return -1; - if(kva && !kvb) return 1; - - if(kva->type < kvb->type) return -1; - if(kva->type > kvb->type) return 1; - - switch(kva->type) { - case KVP_TYPE_GINT64: - if(kva->value.int64 < kvb->value.int64) return -1; - if(kva->value.int64 > kvb->value.int64) return 1; - return 0; - break; - case KVP_TYPE_DOUBLE: - return double_compare(kva->value.dbl, kvb->value.dbl); - break; - case KVP_TYPE_NUMERIC: - return gnc_numeric_compare (kva->value.numeric, kvb->value.numeric); - break; - case KVP_TYPE_STRING: - return strcmp(kva->value.str, kvb->value.str); - break; - case KVP_TYPE_GUID: - return guid_compare(kva->value.guid, kvb->value.guid); - break; - case KVP_TYPE_BINARY: - /* I don't know that this is a good compare. Ab is bigger than Acef. - But I'm not sure that actually matters here. */ - if(kva->value.binary.datasize < kvb->value.binary.datasize) return -1; - if(kva->value.binary.datasize > kvb->value.binary.datasize) return 1; - return memcmp(kva->value.binary.data, - kvb->value.binary.data, - kva->value.binary.datasize); - break; - case KVP_TYPE_GLIST: - return kvp_glist_compare(kva->value.list, kvb->value.list); - break; - case KVP_TYPE_FRAME: - return kvp_frame_compare(kva->value.frame, kvb->value.frame); - break; - } - PERR ("reached unreachable code."); - return FALSE; -} - -typedef struct { - gint compare; - kvp_frame *other_frame; -} kvp_frame_cmp_status; - -static void -kvp_frame_compare_helper(const char *key, kvp_value* val, gpointer data) { - kvp_frame_cmp_status *status = (kvp_frame_cmp_status *) data; - if(status->compare == 0) { - kvp_frame *other_frame = status->other_frame; - kvp_value *other_val = kvp_frame_get_slot(other_frame, key); - - if(other_val) { - status->compare = kvp_value_compare(val, other_val); - } else { - status->compare = 1; - } - } -} - -gint -kvp_frame_compare(const kvp_frame *fa, const kvp_frame *fb) { - kvp_frame_cmp_status status; - - if(fa == fb) return 0; - /* nothing is always less than something */ - if(!fa && fb) return -1; - if(fa && !fb) return 1; - - /* nothing is always less than something */ - if(!fa->hash && fb->hash) return -1; - if(fa->hash && !fb->hash) return 1; - - status.compare = 0; - status.other_frame = (kvp_frame *) fb; - - kvp_frame_for_each_slot((kvp_frame *) fa, kvp_frame_compare_helper, &status); - - return(status.compare); -} - -gchar* -binary_to_string(const void *data, guint32 size) -{ - GString *output; - guint32 i; - guchar *data_str = (guchar*)data; - - output = g_string_sized_new(size * sizeof(char)); - - for(i = 0; i < size; i++) - { - g_string_sprintfa(output, "%02x", (unsigned int) (data_str[i])); - } - - return output->str; -} - -gchar* -kvp_value_glist_to_string(const GList *list) -{ - gchar *tmp1; - gchar *tmp2; - const GList *cursor; - - tmp1 = g_strdup_printf("[ "); - - for(cursor = list; cursor; cursor = cursor->next) - { - gchar *tmp3; - - tmp3 = kvp_value_to_string((kvp_value*)cursor->data); - tmp2 = g_strdup_printf("%s %s,", tmp1, tmp3 ? tmp3 : ""); - g_free(tmp1); - g_free(tmp3); - tmp1 = tmp2; - } - - tmp2 = g_strdup_printf("%s ]", tmp1); - g_free(tmp1); - - return tmp2; -} - -gchar* -kvp_value_to_string(const kvp_value *val) -{ - gchar *tmp1; - gchar *tmp2; - - g_return_val_if_fail(val, NULL); - - switch(kvp_value_get_type(val)) - { - case KVP_TYPE_GINT64: - return g_strdup_printf("KVP_VALUE_GINT64(%lld)", - (long long int) kvp_value_get_gint64(val)); - break; - - case KVP_TYPE_DOUBLE: - return g_strdup_printf("KVP_VALUE_DOUBLE(%g)", - kvp_value_get_double(val)); - break; - - case KVP_TYPE_NUMERIC: - tmp1 = gnc_numeric_to_string(kvp_value_get_numeric(val)); - tmp2 = g_strdup_printf("KVP_VALUE_NUMERIC(%s)", tmp1 ? tmp1 : ""); - g_free(tmp1); - return tmp2; - break; - - case KVP_TYPE_STRING: - tmp1 = kvp_value_get_string (val); - return g_strdup_printf("KVP_VALUE_STRING(%s)", tmp1 ? tmp1 : ""); - break; - - case KVP_TYPE_GUID: - tmp1 = guid_to_string(kvp_value_get_guid(val)); - tmp2 = g_strdup_printf("KVP_VALUE_GUID(%s)", tmp1 ? tmp1 : ""); - g_free(tmp1); - return tmp2; - break; - - case KVP_TYPE_BINARY: - { - guint64 len; - void *data; - data = kvp_value_get_binary(val, &len); - tmp1 = binary_to_string(data, len); - return g_strdup_printf("KVP_VALUE_BINARY(%s)", tmp1 ? tmp1 : ""); - } - break; - - case KVP_TYPE_GLIST: - tmp1 = kvp_value_glist_to_string(kvp_value_get_glist(val)); - tmp2 = g_strdup_printf("KVP_VALUE_GLIST(%s)", tmp1 ? tmp1 : ""); - g_free(tmp1); - return tmp2; - break; - - case KVP_TYPE_FRAME: - tmp1 = kvp_frame_to_string(kvp_value_get_frame(val)); - tmp2 = g_strdup_printf("KVP_VALUE_FRAME(%s)", tmp1 ? tmp1 : ""); - g_free(tmp1); - return tmp2; - break; - - default: - return g_strdup_printf(" "); - break; - } -} - -static void -kvp_frame_to_string_helper(gpointer key, gpointer value, gpointer data) -{ - gchar *tmp_val; - gchar **str = (gchar**)data; - gchar *old_data = *str; - - tmp_val = kvp_value_to_string((kvp_value*)value); - - *str = g_strdup_printf("%s %s => %s,\n", - *str ? *str : "", - key ? (char *) key : "", - tmp_val ? tmp_val : ""); - - g_free(old_data); - g_free(tmp_val); -} - -gchar* -kvp_frame_to_string(const kvp_frame *frame) -{ - gchar *tmp1; - - g_return_val_if_fail (frame != NULL, NULL); - - tmp1 = g_strdup_printf("{\n"); - - g_hash_table_foreach(frame->hash, kvp_frame_to_string_helper, &tmp1); - - { - gchar *tmp2; - tmp2 = g_strdup_printf("%s}\n", tmp1); - g_free(tmp1); - tmp1 = tmp2; - } - - return tmp1; -} - -GHashTable* -kvp_frame_get_hash(const kvp_frame *frame) -{ - g_return_val_if_fail (frame != NULL, NULL); - return frame->hash; -} diff --git a/src/engine/kvp_frame.h b/src/engine/kvp_frame.h deleted file mode 100644 index b4aa13e912..0000000000 --- a/src/engine/kvp_frame.h +++ /dev/null @@ -1,197 +0,0 @@ -/********************************************************************\ - * kvp_frame.h -- a key-value frame system for gnucash. * - * Copyright (C) 2000 Bill Gribble * - * * - * 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 2 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, contact: * - * * - * Free Software Foundation Voice: +1-617-542-5942 * - * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * - * Boston, MA 02111-1307, USA gnu@gnu.org * - * * -\********************************************************************/ - -#ifndef KVP_FRAME_H -#define KVP_FRAME_H - -#include - -#include "gnc-numeric.h" -#include "guid.h" - - -/* a kvp_frame is a set of associations between character strings - * (keys) and kvp_value structures. A kvp_value is a union with - * possible types enumerated in the kvp_value_t enum. - * - * Pointers passed as arguments into set_slot and get_slot are the - * responsibility of the caller. Pointers returned by get_slot are - * owned by the kvp_frame. Make copies as needed. - * - * kvp_frame_delete and kvp_value_delete are deep (recursive) deletes. - * kvp_frame_copy and kvp_value_copy are deep value copies. - */ - -typedef enum { - KVP_TYPE_GINT64, - KVP_TYPE_DOUBLE, - KVP_TYPE_NUMERIC, - KVP_TYPE_STRING, - KVP_TYPE_GUID, - KVP_TYPE_BINARY, - KVP_TYPE_GLIST, - KVP_TYPE_FRAME -} kvp_value_t; - -typedef struct _kvp_frame kvp_frame; -typedef struct _kvp_value kvp_value; - - -/* kvp_frame functions */ -kvp_frame * kvp_frame_new(void); -void kvp_frame_delete(kvp_frame * frame); -kvp_frame * kvp_frame_copy(const kvp_frame * frame); -gboolean kvp_frame_is_empty(kvp_frame * frame); - -gchar* kvp_frame_to_string(const kvp_frame *frame); -gchar* binary_to_string(const void *data, guint32 size); -gchar* kvp_value_glist_to_string(const GList *list); - -GHashTable* kvp_frame_get_hash(const kvp_frame *frame); - -/* The kvp_frame_set_slot() routine copies the value into the frame, - * associating it with 'key'. - * The kvp_frame_set_slot_nc() routine puts the value (without copying - * it) into the frame, associating it with 'key'. This routine is - * handy for avoiding excess memory allocations & frees. - * Pointers passed as arguments into set_slot and get_slot are the - * responsibility of the caller. Pointers returned by get_slot are - * owned by the kvp_frame. Make copies as needed. - */ -void kvp_frame_set_slot(kvp_frame * frame, - const char * key, const kvp_value * value); -void kvp_frame_set_slot_nc(kvp_frame * frame, - const char * key, kvp_value * value); -kvp_value * kvp_frame_get_slot(kvp_frame * frame, - const char * key); - -/* The kvp_frame_set_slot_path() routines walk the hierarchy, - * using the key falues to pick each branch. When the terminal node - * is reached, the value is copied into it. - */ -void kvp_frame_set_slot_path (kvp_frame *frame, - const kvp_value *value, - const char *first_key, ...); - -void kvp_frame_set_slot_path_gslist (kvp_frame *frame, - const kvp_value *value, - GSList *key_path); - -/* The following routines return the last frame of the path. - * If the frame path doesn't exist, it is created. - * - * The kvp_frame_get_frame_slash() routine takes a single string - * where the keys are separated by slashes; thus, for example: - * /this/is/a/valid/path and///so//is////this/ - * Multiple slashes are compresed. leading slash is optional. - * The pointers . and .. are *not* followed/obeyed. (This is - * arguably a bug that needs fixing). - * - * - */ -kvp_frame * kvp_frame_get_frame (kvp_frame *frame, ...); - -kvp_frame * kvp_frame_get_frame_gslist (kvp_frame *frame, - GSList *key_path); - -kvp_frame * kvp_frame_get_frame_slash (kvp_frame *frame, - const char *path); - -/* The following routines return the value att the end of the - * path, or NULL if any portion of the path doesn't exist. - */ -kvp_value * kvp_frame_get_slot_path (kvp_frame *frame, - const char *first_key, ...); - -kvp_value * kvp_frame_get_slot_path_gslist (kvp_frame *frame, - GSList *key_path); - -gint kvp_frame_compare(const kvp_frame *fa, const kvp_frame *fb); -gint double_compare(double v1, double v2); - -void kvp_value_delete(kvp_value * value); -kvp_value * kvp_value_copy(const kvp_value * value); -/** - * Similar returns as strcmp. - **/ -gint kvp_value_compare(const kvp_value *va, const kvp_value *vb); - -/* list convenience funcs. */ -gint kvp_glist_compare(const GList * list1, const GList * list2); - -GList * kvp_glist_copy(const GList * list); - /* deep copy: same as mapping kvp_value_copy over the - elements and then copying the spine. */ -void kvp_glist_delete(GList * list); - /* deep delete: same as mapping kvp_value_delete over the - elements and then deleting the GList. */ - -/* value constructors (copying for pointer args) */ -kvp_value * kvp_value_new_gint64(gint64 value); -kvp_value * kvp_value_new_double(double value); -kvp_value * kvp_value_new_gnc_numeric(gnc_numeric value); -kvp_value * kvp_value_new_string(const char * value); -kvp_value * kvp_value_new_guid(const GUID * guid); -kvp_value * kvp_value_new_binary(const void * data, guint64 datasize); -kvp_value * kvp_value_new_glist(const GList * value); -kvp_value * kvp_value_new_frame(const kvp_frame * value); - -/* value constructors (non-copying - kvp_value takes pointer ownership) - values *must* have been allocated via glib allocators! (gnew, etc.) */ -kvp_value * kvp_value_new_binary_nc(void * data, guint64 datasize); -kvp_value * kvp_value_new_glist_nc(GList *lst); - -/* value accessors (NON-copying for frames/lists/guids/binary) */ -kvp_value_t kvp_value_get_type(const kvp_value * value); - -gint64 kvp_value_get_gint64(const kvp_value * value); -double kvp_value_get_double(const kvp_value * value); -gnc_numeric kvp_value_get_numeric(const kvp_value * value); -char * kvp_value_get_string(const kvp_value * value); -GUID * kvp_value_get_guid(const kvp_value * value); -void * kvp_value_get_binary(const kvp_value * value, - guint64 * size_return); -GList * kvp_value_get_glist(const kvp_value * value); -kvp_frame * kvp_value_get_frame(const kvp_value * value); - -gchar* kvp_value_to_string(const kvp_value *val); - -/* manipulators */ - -gboolean kvp_value_binary_append(kvp_value *v, void *data, guint64 size); -/* copying - but more efficient than creating a new kvp_value manually. */ - -/* iterators */ - -/* Traverse all of the slots in the given kvp_frame. This function - does not descend recursively to traverse any kvp_frames stored as - slot values. You must handle that in proc, with a suitable - recursive call if desired. */ -void kvp_frame_for_each_slot(kvp_frame *f, - void (*proc)(const char *key, - kvp_value *value, - gpointer data), - gpointer data); - - -#endif diff --git a/src/engine/md5.c b/src/engine/md5.c deleted file mode 100644 index 465ebe1284..0000000000 --- a/src/engine/md5.c +++ /dev/null @@ -1,444 +0,0 @@ -/* md5.c - Functions to compute MD5 message digest of files or memory blocks - according to the definition of MD5 in RFC 1321 from April 1992. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - 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 2, 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, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -/* Written by Ulrich Drepper , 1995. */ - -#ifdef HAVE_CONFIG_H -# include -#endif - -#include - -#if STDC_HEADERS || defined _LIBC -# include -# include -#else -# ifndef HAVE_MEMCPY -# define memcpy(d, s, n) bcopy ((s), (d), (n)) -# endif -#endif - -#include "md5.h" - -#ifdef _LIBC -# include -# if __BYTE_ORDER == __BIG_ENDIAN -# define WORDS_BIGENDIAN 1 -# endif -#endif - -#ifdef WORDS_BIGENDIAN -# define SWAP(n) \ - (((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24)) -#else -# define SWAP(n) (n) -#endif - - -/* This array contains the bytes used to pad the buffer to the next - 64-byte boundary. (RFC 1321, 3.1: Step 1) */ -static const unsigned char fillbuf[64] = { 0x80, 0 /* , 0, 0, ... */ }; - - -/* Initialize structure containing state of computation. - (RFC 1321, 3.3: Step 3) */ -void -md5_init_ctx (ctx) - struct md5_ctx *ctx; -{ - ctx->A = 0x67452301; - ctx->B = 0xefcdab89; - ctx->C = 0x98badcfe; - ctx->D = 0x10325476; - - ctx->total[0] = ctx->total[1] = 0; - ctx->buflen = 0; -} - -/* Put result from CTX in first 16 bytes following RESBUF. The result - must be in little endian byte order. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_read_ctx (ctx, resbuf) - const struct md5_ctx *ctx; - void *resbuf; -{ - ((md5_uint32 *) resbuf)[0] = SWAP (ctx->A); - ((md5_uint32 *) resbuf)[1] = SWAP (ctx->B); - ((md5_uint32 *) resbuf)[2] = SWAP (ctx->C); - ((md5_uint32 *) resbuf)[3] = SWAP (ctx->D); - - return resbuf; -} - -/* Process the remaining bytes in the internal buffer and the usual - prolog according to the standard and write the result to RESBUF. - - IMPORTANT: On some systems it is required that RESBUF is correctly - aligned for a 32 bits value. */ -void * -md5_finish_ctx (ctx, resbuf) - struct md5_ctx *ctx; - void *resbuf; -{ - /* Take yet unprocessed bytes into account. */ - md5_uint32 bytes = ctx->buflen; - size_t pad; - - /* Now count remaining bytes. */ - ctx->total[0] += bytes; - if (ctx->total[0] < bytes) - ++ctx->total[1]; - - pad = bytes >= 56 ? 64 + 56 - bytes : 56 - bytes; - memcpy (&ctx->buffer[bytes], fillbuf, pad); - - /* Put the 64-bit file length in *bits* at the end of the buffer. */ - *(md5_uint32 *) &ctx->buffer[bytes + pad] = SWAP (ctx->total[0] << 3); - *(md5_uint32 *) &ctx->buffer[bytes + pad + 4] = SWAP ((ctx->total[1] << 3) | - (ctx->total[0] >> 29)); - - /* Process last bytes. */ - md5_process_block (ctx->buffer, bytes + pad + 8, ctx); - - return md5_read_ctx (ctx, resbuf); -} - -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. */ -int -md5_stream (stream, resblock) - FILE *stream; - void *resblock; -{ - /* Important: BLOCKSIZE must be a multiple of 64. */ -#define BLOCKSIZE 4096 - struct md5_ctx ctx; - char buffer[BLOCKSIZE + 72]; - size_t sum; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Iterate over full file contents. */ - while (1) - { - /* We read the file in blocks of BLOCKSIZE bytes. One call of the - computation function processes the whole buffer so that with the - next round of the loop another block can be read. */ - size_t n; - sum = 0; - - /* Read block. Take care for partial reads. */ - do - { - n = fread (buffer + sum, 1, BLOCKSIZE - sum, stream); - - sum += n; - } - while (sum < BLOCKSIZE && n != 0); - if (n == 0 && ferror (stream)) - return 1; - - /* If end of file is reached, end the loop. */ - if (n == 0) - break; - - /* Process buffer with BLOCKSIZE bytes. Note that - BLOCKSIZE % 64 == 0 - */ - md5_process_block (buffer, BLOCKSIZE, &ctx); - } - - /* Add the last bytes if necessary. */ - if (sum > 0) - md5_process_bytes (buffer, sum, &ctx); - - /* Construct result in desired memory. */ - md5_finish_ctx (&ctx, resblock); - return 0; -} - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. */ -void * -md5_buffer (buffer, len, resblock) - const char *buffer; - size_t len; - void *resblock; -{ - struct md5_ctx ctx; - - /* Initialize the computation context. */ - md5_init_ctx (&ctx); - - /* Process whole buffer but last len % 64 bytes. */ - md5_process_bytes (buffer, len, &ctx); - - /* Put result in desired memory area. */ - return md5_finish_ctx (&ctx, resblock); -} - - -void -md5_process_bytes (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; -{ -#define NUM_MD5_WORDS 1024 - size_t add = 0; - - /* When we already have some bits in our internal buffer concatenate - both inputs first. */ - if (ctx->buflen != 0) - { - size_t left_over = ctx->buflen; - - add = 128 - left_over > len ? len : 128 - left_over; - - memcpy (&ctx->buffer[left_over], buffer, add); - ctx->buflen += add; - - if (left_over + add > 64) - { - md5_process_block (ctx->buffer, (left_over + add) & ~63, ctx); - /* The regions in the following copy operation cannot overlap. */ - memcpy (ctx->buffer, &ctx->buffer[(left_over + add) & ~63], - (left_over + add) & 63); - ctx->buflen = (left_over + add) & 63; - } - - buffer = (const char *) buffer + add; - len -= add; - } - - /* Process available complete blocks. */ - if (len > 64) - { - if ((add & 3) == 0) /* buffer is still 32-bit aligned */ - { - md5_process_block (buffer, len & ~63, ctx); - buffer = (const char *) buffer + (len & ~63); - } - else /* buffer is not 32-bit aligned */ - { - md5_uint32 md5_buffer[NUM_MD5_WORDS]; - size_t num_bytes; - size_t buf_bytes; - - num_bytes = len & ~63; - while (num_bytes > 0) - { - buf_bytes = (num_bytes < sizeof(md5_buffer)) ? - num_bytes : sizeof(md5_buffer); - memcpy (md5_buffer, buffer, buf_bytes); - md5_process_block (md5_buffer, buf_bytes, ctx); - num_bytes -= buf_bytes; - buffer = (const char *) buffer + buf_bytes; - } - } - - len &= 63; - } - - /* Move remaining bytes in internal buffer. */ - if (len > 0) - { - memcpy (ctx->buffer, buffer, len); - ctx->buflen = len; - } -} - - -/* These are the four functions used in the four steps of the MD5 algorithm - and defined in the RFC 1321. The first function is a little bit optimized - (as found in Colin Plumbs public domain implementation). */ -/* #define FF(b, c, d) ((b & c) | (~b & d)) */ -#define FF(b, c, d) (d ^ (b & (c ^ d))) -#define FG(b, c, d) FF (d, b, c) -#define FH(b, c, d) (b ^ c ^ d) -#define FI(b, c, d) (c ^ (b | ~d)) - -/* Process LEN bytes of BUFFER, accumulating context into CTX. - It is assumed that LEN % 64 == 0. */ - -void -md5_process_block (buffer, len, ctx) - const void *buffer; - size_t len; - struct md5_ctx *ctx; -{ - md5_uint32 correct_words[16]; - const md5_uint32 *words = buffer; - size_t nwords = len / sizeof (md5_uint32); - const md5_uint32 *endp = words + nwords; - md5_uint32 A = ctx->A; - md5_uint32 B = ctx->B; - md5_uint32 C = ctx->C; - md5_uint32 D = ctx->D; - - /* First increment the byte count. RFC 1321 specifies the possible - length of the file up to 2^64 bits. Here we only compute the - number of bytes. Do a double word increment. */ - ctx->total[0] += len; - if (ctx->total[0] < len) - ++ctx->total[1]; - - /* Process all bytes in the buffer with 64 bytes in each round of - the loop. */ - while (words < endp) - { - md5_uint32 *cwp = correct_words; - md5_uint32 A_save = A; - md5_uint32 B_save = B; - md5_uint32 C_save = C; - md5_uint32 D_save = D; - - /* First round: using the given function, the context and a constant - the next context is computed. Because the algorithms processing - unit is a 32-bit word and it is determined to work on words in - little endian byte order we perhaps have to change the byte order - before the computation. To reduce the work for the next steps - we store the swapped words in the array CORRECT_WORDS. */ - -#define OP(a, b, c, d, s, T) \ - do \ - { \ - a += FF (b, c, d) + (*cwp++ = SWAP (*words)) + T; \ - ++words; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* It is unfortunate that C does not provide an operator for - cyclic rotation. Hope the C compiler is smart enough. */ -#define CYCLIC(w, s) (w = (w << s) | (w >> (32 - s))) - - /* Before we start, one word to the strange constants. - They are defined in RFC 1321 as - - T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 - */ - - /* Round 1. */ - OP (A, B, C, D, 7, 0xd76aa478); - OP (D, A, B, C, 12, 0xe8c7b756); - OP (C, D, A, B, 17, 0x242070db); - OP (B, C, D, A, 22, 0xc1bdceee); - OP (A, B, C, D, 7, 0xf57c0faf); - OP (D, A, B, C, 12, 0x4787c62a); - OP (C, D, A, B, 17, 0xa8304613); - OP (B, C, D, A, 22, 0xfd469501); - OP (A, B, C, D, 7, 0x698098d8); - OP (D, A, B, C, 12, 0x8b44f7af); - OP (C, D, A, B, 17, 0xffff5bb1); - OP (B, C, D, A, 22, 0x895cd7be); - OP (A, B, C, D, 7, 0x6b901122); - OP (D, A, B, C, 12, 0xfd987193); - OP (C, D, A, B, 17, 0xa679438e); - OP (B, C, D, A, 22, 0x49b40821); - - /* For the second to fourth round we have the possibly swapped words - in CORRECT_WORDS. Redefine the macro to take an additional first - argument specifying the function to use. */ -#undef OP -#define OP(f, a, b, c, d, k, s, T) \ - do \ - { \ - a += f (b, c, d) + correct_words[k] + T; \ - CYCLIC (a, s); \ - a += b; \ - } \ - while (0) - - /* Round 2. */ - OP (FG, A, B, C, D, 1, 5, 0xf61e2562); - OP (FG, D, A, B, C, 6, 9, 0xc040b340); - OP (FG, C, D, A, B, 11, 14, 0x265e5a51); - OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); - OP (FG, A, B, C, D, 5, 5, 0xd62f105d); - OP (FG, D, A, B, C, 10, 9, 0x02441453); - OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); - OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); - OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); - OP (FG, D, A, B, C, 14, 9, 0xc33707d6); - OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); - OP (FG, B, C, D, A, 8, 20, 0x455a14ed); - OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); - OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); - OP (FG, C, D, A, B, 7, 14, 0x676f02d9); - OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); - - /* Round 3. */ - OP (FH, A, B, C, D, 5, 4, 0xfffa3942); - OP (FH, D, A, B, C, 8, 11, 0x8771f681); - OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); - OP (FH, B, C, D, A, 14, 23, 0xfde5380c); - OP (FH, A, B, C, D, 1, 4, 0xa4beea44); - OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); - OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); - OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); - OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); - OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); - OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); - OP (FH, B, C, D, A, 6, 23, 0x04881d05); - OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); - OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); - OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); - OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); - - /* Round 4. */ - OP (FI, A, B, C, D, 0, 6, 0xf4292244); - OP (FI, D, A, B, C, 7, 10, 0x432aff97); - OP (FI, C, D, A, B, 14, 15, 0xab9423a7); - OP (FI, B, C, D, A, 5, 21, 0xfc93a039); - OP (FI, A, B, C, D, 12, 6, 0x655b59c3); - OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); - OP (FI, C, D, A, B, 10, 15, 0xffeff47d); - OP (FI, B, C, D, A, 1, 21, 0x85845dd1); - OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); - OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); - OP (FI, C, D, A, B, 6, 15, 0xa3014314); - OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); - OP (FI, A, B, C, D, 4, 6, 0xf7537e82); - OP (FI, D, A, B, C, 11, 10, 0xbd3af235); - OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); - OP (FI, B, C, D, A, 9, 21, 0xeb86d391); - - /* Add the starting values of the context. */ - A += A_save; - B += B_save; - C += C_save; - D += D_save; - } - - /* Put checksum in context given as argument. */ - ctx->A = A; - ctx->B = B; - ctx->C = C; - ctx->D = D; -} diff --git a/src/engine/md5.h b/src/engine/md5.h deleted file mode 100644 index 346bfec3a6..0000000000 --- a/src/engine/md5.h +++ /dev/null @@ -1,163 +0,0 @@ -/* md5.h - Declaration of functions and data types used for MD5 sum - computing library functions. - Copyright (C) 1995, 1996 Free Software Foundation, Inc. - NOTE: The canonical source of this file is maintained with the GNU C - Library. Bugs can be reported to bug-glibc@prep.ai.mit.edu. - - 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 2, 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, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - -#ifndef _MD5_H -#define _MD5_H 1 - -#include -#include - -#if defined HAVE_LIMITS_H || _LIBC -# include -#endif - -/* The following contortions are an attempt to use the C preprocessor - to determine an unsigned integral type that is 32 bits wide. An - alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but - doing that would require that the configure script compile and *run* - the resulting executable. Locally running cross-compiled executables - is usually not possible. */ - -#ifdef _LIBC -# include -typedef u_int32_t md5_uint32; -#else -# if defined __STDC__ && __STDC__ -# define UINT_MAX_32_BITS 4294967295U -# else -# define UINT_MAX_32_BITS 0xFFFFFFFF -# endif - -/* If UINT_MAX isn't defined, assume it's a 32-bit type. - This should be valid for all systems GNU cares about because - that doesn't include 16-bit systems, and only modern systems - (that certainly have ) have 64+-bit integral types. */ - -# ifndef UINT_MAX -# define UINT_MAX UINT_MAX_32_BITS -# endif - -# if UINT_MAX == UINT_MAX_32_BITS - typedef unsigned int md5_uint32; -# else -# if USHRT_MAX == UINT_MAX_32_BITS - typedef unsigned short md5_uint32; -# else -# if ULONG_MAX == UINT_MAX_32_BITS - typedef unsigned long md5_uint32; -# else - /* The following line is intended to evoke an error. - Using #error is not portable enough. */ - "Cannot determine unsigned 32-bit data type." -# endif -# endif -# endif -#endif - -#undef __P -#if defined (__STDC__) && __STDC__ -#define __P(x) x -#else -#define __P(x) () -#endif - -/* Structure to save state of computation between the single steps. */ -struct md5_ctx -{ - md5_uint32 A; - md5_uint32 B; - md5_uint32 C; - md5_uint32 D; - - md5_uint32 total[2]; - md5_uint32 buflen; - char buffer[128]; -}; - -/* - * The following three functions are build up the low level used in - * the functions `md5_stream' and `md5_buffer'. - */ - -/* Initialize structure containing state of computation. - (RFC 1321, 3.3: Step 3) */ -extern void md5_init_ctx __P ((struct md5_ctx *ctx)); - - -/* Starting with the result of former calls of this function (or the - initialization function update the context for the next LEN bytes - starting at BUFFER. - - It is necessary that LEN is a multiple of 64!!! - - IMPORTANT: On some systems it is required that buffer be 32-bit - aligned. */ -extern void md5_process_block __P ((const void *buffer, size_t len, - struct md5_ctx *ctx)); - -/* Starting with the result of former calls of this function (or the - initialization function) update the context for the next LEN bytes - starting at BUFFER. - - It is NOT required that LEN is a multiple of 64. - - IMPORTANT: On some systems it is required that buffer be 32-bit - aligned. */ -extern void md5_process_bytes __P ((const void *buffer, size_t len, - struct md5_ctx *ctx)); - -/* Process the remaining bytes in the buffer and put result from CTX - in first 16 bytes following RESBUF. The result is always in little - endian byte order, so that a byte-wise output yields to the wanted - ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 32 bits value. */ -extern void *md5_finish_ctx __P ((struct md5_ctx *ctx, void *resbuf)); - - -/* Put result from CTX in first 16 bytes following RESBUF. The result is - always in little endian byte order, so that a byte-wise output yields - to the wanted ASCII representation of the message digest. - - IMPORTANT: On some systems it is required that RESBUF be correctly - aligned for a 32 bits value. */ -extern void *md5_read_ctx __P ((const struct md5_ctx *ctx, void *resbuf)); - - -/* Compute MD5 message digest for bytes read from STREAM. The - resulting message digest number will be written into the 16 bytes - beginning at RESBLOCK. - - IMPORTANT: On some systems it is required that resblock be 32-bit - aligned. */ -extern int md5_stream __P ((FILE *stream, void *resblock)); - - -/* Compute MD5 message digest for LEN bytes beginning at BUFFER. The - result is always in little endian byte order, so that a byte-wise - output yields to the wanted ASCII representation of the message - digest. - - IMPORTANT: On some systems it is required that buffer and resblock - be correctly 32-bit aligned. */ -extern void *md5_buffer __P ((const char *buffer, size_t len, void *resblock)); - -#endif diff --git a/src/engine/test/Makefile.am b/src/engine/test/Makefile.am new file mode 100644 index 0000000000..a3bdd6ff56 --- /dev/null +++ b/src/engine/test/Makefile.am @@ -0,0 +1,13 @@ +INCLUDES=-I${top_srcdir}/src/gnc-module ${GUILE_INCS} +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} +LDADD=${top_srcdir}/src/gnc-module/libgncmodule.la ${GLIB_LIBS} -lltdl + +TESTS = test-load-engine test-create-account +TESTS_ENVIRONMENT = \ + GNC_MODULE_PATH="${top_srcdir}/src/engine" \ + GUILE_LOAD_PATH="${G_WRAP_MODULE_DIR}:..:../../gnc-module" \ + LTDL_LIBRARY_PATH=../../gnc-module + +bin_PROGRAMS = test-load-engine +test_load_engine_SOURCES=test-load-engine.c + diff --git a/src/engine/test/test-create-account b/src/engine/test/test-create-account new file mode 100755 index 0000000000..d3b743690b --- /dev/null +++ b/src/engine/test/test-create-account @@ -0,0 +1,2 @@ +#!/bin/sh +guile -l test-create-account.scm -c "(exit (run-test))"diff -up /dev/null 'gnucash-1.7/src/engine/test/test-create-account.scm' diff --git a/src/engine/test/test-create-account.scm b/src/engine/test/test-create-account.scm new file mode 100644 index 0000000000..70b4d15792 --- /dev/null +++ b/src/engine/test/test-create-account.scm @@ -0,0 +1,20 @@ +;; test-create-account.scm +;; load the engine and create an account + +(use-modules (gnucash gnc-module)) + +(define (run-test) + (gnc:module-system-init) + (gnc:module-load "gnucash/engine" 0) + + (let ((group (gnc:malloc-account-group)) + (acct (gnc:malloc-account))) + (gnc:account-begin-edit acct) + (gnc:account-set-name acct "foo") + (gnc:account-commit-edit acct) + (gnc:group-insert-account group acct)) + #t) + + + + diff --git a/src/engine/test/test-load-engine.c b/src/engine/test/test-load-engine.c new file mode 100644 index 0000000000..7568adf30b --- /dev/null +++ b/src/engine/test/test-load-engine.c @@ -0,0 +1,34 @@ +#include +#include +#include + +#include "gnc-module.h" + +static void +guile_main(int argc, char ** argv) { + GNCModule engine; + + printf(" test-load-engine.c: loading/unloading engine module ... "); + + gnc_module_system_init(); + engine = gnc_module_load("gnucash/engine", 0); + + if(!engine) { + printf(" Failed to load engine\n"); + exit(-1); + } + + if(!gnc_module_unload(engine)) { + printf(" Failed to unload engine\n"); + exit(-1); + } + printf(" successful.\n"); + + exit(0); +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} diff --git a/src/gnc-module/Makefile.am b/src/gnc-module/Makefile.am new file mode 100644 index 0000000000..a6df16d78f --- /dev/null +++ b/src/gnc-module/Makefile.am @@ -0,0 +1,42 @@ +SUBDIRS=. test + +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} + +lib_LTLIBRARIES=libgncmodule.la + +libgncmodule_la_SOURCES=gnc-module.c +libgncmodule_la_LIBADD=${G_WRAP_LINK_ARGS} ${GLIB_LIBS} +libgncmodule_la_LDFLAGS=-module + +libgw_gnc_module_la_SOURCES=gw-gnc-module.c +libgw_gnc_module_la_LIBADD=${G_WRAP_LINK_ARGS} ${GLIB_LIBS} +libgw_gnc_module_la_LDFLAGS=-module + +gncmoddir=${GNC_SHAREDIR}/guile-modules/gnucash +gncmod_DATA=gnc-module.scm + +gwmoddir=${GNC_SHAREDIR}/guile-modules/g-wrapped +gwmod_LTLIBRARIES=libgw-gnc-module.la +gwmod_DATA=gw-gnc-module-spec.scm + +noinst_DATA=.scm-links + +.scm-links: + rm -f gnucash g-wrapped + ln -sf . gnucash + ln -sf . g-wrapped + touch .scm-links + +gw-gnc-module.c gw-gnc-module.h: gw-gnc-module-spec.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (primitive-load \"./gw-gnc-module-spec.scm\") \ + (gw:generate-module \"gw-gnc-module\")" + +BUILT_SOURCES += gw-gnc-module.h gw-gnc-module.c +CLEANFILES += gw-gnc-module.h gw-gnc-module.c gw-gnc-module.html g-wrapped \ +gnucash .scm-links + + + + diff --git a/src/gnc-module/README b/src/gnc-module/README new file mode 100644 index 0000000000..5d418aae46 --- /dev/null +++ b/src/gnc-module/README @@ -0,0 +1,6 @@ +This is gnc-module, a plugin/module system for gnucash and related +software. The documentation currently consists of 'doc/design.txt'. + +Bill Gribble + + diff --git a/src/gnc-module/doc/design.txt b/src/gnc-module/doc/design.txt new file mode 100644 index 0000000000..77dcef5c12 --- /dev/null +++ b/src/gnc-module/doc/design.txt @@ -0,0 +1,132 @@ +What is a Gnucash module? +------------------------- + +A gnucash module is a dynamically loadable libtool library that +defines the following symbols: + + /* what version of the module system interface is assumed */ + int gnc_module_system_interface; + + /* information about the module's version */ + int gnc_module_current; + int gnc_module_revision; + int gnc_module_age; + + /* init is called each time a module is loaded; + * 'refcount' is 0 the first time the module is loaded. */ + int gnc_module_init(int refcount); + + /* end is called each time the module is unloaded, if present. + * 'refcount' is 0 the last time the module is unloaded. */ + void gnc_module_end(int refcount); + + /* descriptive information */ + char * gnc_module_path(void); + char * gnc_module_description(void); + + +gnc_module_system_interface is the revision number of the interface +listed above (i.e. the names and type signatures of the symbols each +module must define). The current revision number is 0; all modules +should assign gnc_module_system_interface = 0. As the interface +evolves, this should allow us to continue to load older modules. + +The current, revision, age triplet describe the module version +according to libtool(1) conventions. To quote from the libtool info +pages: + + 1. Start with version information of `0:0:0' for each libtool library. + + 2. Update the version information only immediately before a public + release of your software. More frequent updates are unnecessary, + and only guarantee that the current interface number gets larger + faster. + + 3. If the library source code has changed at all since the last + update, then increment REVISION (`C:R:A' becomes `C:r+1:A'). + + 4. If any interfaces have been added, removed, or changed since the + last update, increment CURRENT, and set REVISION to 0. + + 5. If any interfaces have been added since the last public release, + then increment AGE. + + 6. If any interfaces have been removed since the last public release, + then set AGE to 0. + +gnc_module_path should return a newly-allocated string containing the +"module path". The module path is a logical path with elements +separated by /. The path will be used to structure views of available +modules so that similar modules can be grouped together; it may or may +not actually correspond to a filesystem path. The last element of the +module path is the name of this module. For example, + char * path = "gnucash/core/engine"; +defines the "engine" module, which is in the gnucash/core group of +modules. + +gnc_module_description should return a newly-allocated 1-line +description of what the module does. This can be displayed by GUI +elements to allow users to select modules to load. + + +Initializing the module system +------------------------------ + +Somewhere at program startup time, you need to call +gnc_module_system_init from C (see below from Scheme). This scans the +directories in the GNC_MODULE_PATH and builds a database of the +available modules. + +In Scheme, you need to (use-modules (gnucash gnc-module)) and call +(gnc:module-system-init) if it was not called from C. You will need +to use-modules this module is you intend to use any module system +functions from Scheme. + +On the Scheme side, gnc:module-system-init is not a g-wrapped +function. It uses Guile's dynamic-link to open the libgncmodule.la +library directly and call gnc_module_system_init. dynamic-link uses +lt_dlopen() under the hood, so you need to make sure that the +libgncmodule.la install directory is in your LD_LIBRARY_PATH or +LTDL_LIBRARY_PATH. The Gnucash app will set up this path by default. + +You can rebuild the module database at any time (say, if you know a +new module has been installed or the user has changed the module path +via some in-program mechanism) by calling gnc_module_system_refresh. + +Loading modules +--------------- + +From C call gnc_module_load(path, interface), or gnc:module-load from +Scheme. This returns a GNCModule () if a qualifying +module was successfully loaded, #f / FALSE otherside. GNCModule is an +opaque type. + +A qualifying module is any module whose gnc_module_path matches the +path specification and for whom "interface" falls between +gnc_module_current and (gnc_module_current - gnc_module_age). If +multiple modules qualify, libtool's rules are used to determine which +to load: the larger of gnc_module_interface, gnc_module_age, and +gnc_module_revision take precedence, in that order. + +Module initialization/cleanup +----------------------------- + +Each time a module is loaded, its gnc_module_init function is called +with an integer argument, 'refcount'. The refcount is the number of +times that gnc_module_load has been called on that particular module. +It is 0 the first time gnc_module_load is called on a module. + +Any startup/initialization code should be defined in this function. +If this module depends on other modules, put the necessary +gnc_module_load calls in the init function. + +If gnc_module_init returns FALSE, the module is immediately unloaded. +Any cleanup must be done within gnc_module_init before returning. + +Each time a module is unloaded via gnc_module_unload, its +gnc_module_end function is called with an integer refcount argument. +refcount is 0 if this 'unload' drops the last reference. In this +case, after the gnc_module_end handler is called the library is +dlclose()-ed. + + diff --git a/src/gnc-module/gnc-module.c b/src/gnc-module/gnc-module.c new file mode 100644 index 0000000000..43ec179b95 --- /dev/null +++ b/src/gnc-module/gnc-module.c @@ -0,0 +1,567 @@ +/************************************************************* + * gnc-module.c -- loadable plugin/module system for gnucash + * Copyright 2001 Linux Developers Group, Inc. + *************************************************************/ + +#include +#include +#include +#include +#include +#include +#include + +#include "gnc-module.h" +#include "gw-gnc-module.h" + +#include +#include + +static GHashTable * loaded_modules = NULL; +static GList * module_info = NULL; + +typedef struct +{ + lt_dlhandle handle; + gchar * filename; + int load_count; + GNCModuleInfo * info; + int (* init_func)(int refcount); +} GNCLoadedModule; + + +/************************************************************* + * gnc_module_system_search_dirs + * return a list of dirs to look in for gnc_module libraries + *************************************************************/ + +static GList * +gnc_module_system_search_dirs(void) +{ + char * spath = getenv("GNC_MODULE_PATH"); + GList * list = NULL; + GString * token = g_string_new(NULL); + int escchar = 0; + char * cpos; + + if(!spath) + { + spath = DEFAULT_MODULE_PATH; + } + + for(cpos = spath; *cpos; cpos++) + { + switch(*cpos) + { + case '\\': + if(!escchar) + { + escchar = TRUE; + } + else + { + g_string_append_c(token, *cpos); + escchar = FALSE; + } + break; + + case ':': + if(!escchar) + { + list = g_list_append(list, token->str); + g_string_free(token, FALSE); + token = g_string_new(NULL); + } + else + { + g_string_append_c(token, *cpos); + escchar = FALSE; + } + break; + + default: + g_string_append_c(token, *cpos); + escchar = FALSE; + break; + } + } + if(token->len) + { + list = g_list_append(list, token->str); + g_string_free(token, FALSE); + } + else + { + g_string_free(token, TRUE); + } + return list; +} + +/************************************************************* + * gnc_module_system_setup_load_path + * initialize the Guile load path + *************************************************************/ + +static void +gnc_module_system_setup_load_path() +{ + GList * dirs = gnc_module_system_search_dirs(); + GList * lp; + SCM loadpath = gh_lookup("%load-path"); + + for(lp=dirs; lp; lp=lp->next) + { + SCM dirname = gh_str02scm(lp->data); + if(scm_member(dirname, loadpath) == SCM_BOOL_F) + { + char * evalstr = + g_strdup_printf("(set! %%load-path (cons \"%s\" %%load-path))", + (char *)lp->data); + gh_eval_str(evalstr); + g_free(evalstr); + } + } +} + + +/************************************************************* + * gnc_module_system_init + * initialize the module system + *************************************************************/ + +void +gnc_module_system_init(void) + +{ + if(loaded_modules == NULL) + { + loaded_modules = g_hash_table_new(g_direct_hash, g_direct_equal); + lt_dlinit(); + + gnc_module_system_setup_load_path(); + + /* now crawl the GNC_MODULE_PATH to find likely libraries */ + gnc_module_system_refresh(); + } +} + + +/************************************************************* + * gnc_module_system_refresh + * build the database of modules by looking through the + * GNC_MODULE_PATH + *************************************************************/ + +void +gnc_module_system_refresh(void) +{ + GList * search_dirs; + GList * current; + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + /* get the GNC_MODULE_PATH and split it into directories */ + search_dirs = gnc_module_system_search_dirs(); + + /* look in each search directory */ + for(current = search_dirs; current; current = current->next) + { + DIR * d = opendir(current->data); + struct dirent * dent = NULL; + char * fullpath = NULL; + int namelen; + GNCModuleInfo * info; + + if(d) + { + while((dent = readdir(d)) != NULL) + { + namelen = strlen(dent->d_name); + + /* is the file a .so shared lib? */ + if((namelen > 3) && + ((!strncmp(dent->d_name + namelen - 3, ".so", 3)) || + (!strncmp(dent->d_name + namelen - 3, ".la", 3)))) + { + /* get the full path name, then dlopen the library and see + * if it has the appropriate symbols to be a gnc_module */ + fullpath = g_strdup_printf("%s/%s", (char *)(current->data), + dent->d_name); + info = gnc_module_get_info(fullpath); + + if(info) + { + module_info = g_list_prepend(module_info, info); + } + g_free(fullpath); + } + } + } + } + + /* free the search dir strings */ + for(current = search_dirs; current; current=current->next) + { + g_free(current->data); + } + g_list_free(current); +} + + +/************************************************************* + * gnc_module_system_modinfo + * return the list of module information + *************************************************************/ + +GList * +gnc_module_system_modinfo(void) +{ + if(!loaded_modules) + { + gnc_module_system_init(); + } + + return module_info; +} + + +/************************************************************* + * gnc_module_get_info + * check a proposed gnc_module by looking for specific symbols in it; + * if it's a gnc_module, return a struct describing it. + *************************************************************/ + +GNCModuleInfo * +gnc_module_get_info(const char * fullpath) +{ + lt_dlhandle handle = lt_dlopen(fullpath); + + if(handle) + { + lt_ptr modsysver = lt_dlsym(handle, "gnc_module_system_interface"); + + /* the modsysver tells us what the expected symbols and their + * types are */ + if (!modsysver) + { + lt_dlclose(handle); + return NULL; + } + + if(*(int *)modsysver == 0) + { + lt_ptr initfunc = lt_dlsym(handle, "gnc_module_init"); + lt_ptr pathfunc = lt_dlsym(handle, "gnc_module_path"); + lt_ptr descripfunc = lt_dlsym(handle, "gnc_module_description"); + lt_ptr interface = lt_dlsym(handle, "gnc_module_current"); + lt_ptr revision = lt_dlsym(handle, "gnc_module_revision"); + lt_ptr age = lt_dlsym(handle, "gnc_module_age"); + + if(initfunc && pathfunc && descripfunc && interface && + revision && age) + { + /* we have found a gnc_module. */ + GNCModuleInfo * info = g_new0(GNCModuleInfo, 1); + char * (* f_path)(void) = pathfunc; + char * (* f_descrip)(void) = descripfunc; + info->module_path = f_path(); + info->module_description = f_descrip(); + info->module_filepath = g_strdup(fullpath); + info->module_interface = *(int *)interface; + info->module_age = *(int *)age; + info->module_revision = *(int *)revision; + lt_dlclose(handle); + return info; + } + else + { + printf("\n** WARNING ** : module '%s' does not match module signature\n", + fullpath); + lt_dlclose(handle); + return NULL; + } + } + else + { + /* unsupported module system interface version */ + /* printf("\n** WARNING ** : module '%s' requires newer module system\n", + fullpath); */ + lt_dlclose(handle); + return NULL; + } + } + else + { + printf("\n** WARNING ** : Failed to dlopen() '%s': %s\n", + fullpath, lt_dlerror()); + return NULL; + } +} + + +/************************************************************* + * gnc_module_locate + * find the best matching module for the name, interface pair + *************************************************************/ + +static GNCModuleInfo * +gnc_module_locate(const gchar * module_name, int interface) +{ + GNCModuleInfo * best = NULL; + GNCModuleInfo * current = NULL; + GList * lptr; + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + for(lptr = module_info; lptr; lptr = lptr->next) + { + current = lptr->data; + if(!strcmp(module_name, current->module_path) && + (interface >= (current->module_interface - current->module_age)) && + (interface <= current->module_interface)) + { + if(best) + { + if((current->module_interface > best->module_interface) || + ((current->module_interface == best->module_interface) && + (current->module_age > best->module_age)) || + ((current->module_interface == best->module_interface) && + (current->module_age == best->module_age) && + (current->module_revision > best->module_revision))) + { + best = current; + } + } + else + { + best = current; + } + } + } + return best; +} + +static void +list_loaded (gpointer k, gpointer v, gpointer data) +{ + GList ** l = data; + *l = g_list_prepend(*l, v); +} + +static GNCLoadedModule * +gnc_module_check_loaded(const char * module_name, gint interface) +{ + GNCModuleInfo * modinfo = gnc_module_locate(module_name, interface); + GList * modules = NULL; + GList * p = NULL; + GNCLoadedModule * rv = NULL; + + if(modinfo == NULL) + { + return NULL; + } + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + /* turn the loaded-modules table into a list */ + g_hash_table_foreach(loaded_modules, list_loaded, &modules); + + /* walk the list to see if the file we want is already open */ + for(p=modules; p; p=p->next) + { + GNCLoadedModule * lm = p->data; + if(!strcmp(lm->filename, modinfo->module_filepath)) + { + rv = lm; + break; + } + } + g_list_free(modules); + return rv; +} + + +/************************************************************* + * gnc_module_load + * Ensure that the module named by "module_name" is loaded. + *************************************************************/ + +GNCModule +gnc_module_load(char * module_name, gint interface) +{ + + GNCLoadedModule * info; + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + info = gnc_module_check_loaded(module_name, interface); + + /* if the module's already loaded, just increment its use count. + * otherwise, load it and check for the initializer + * "gnc_module_init". if we find that, assume it's a gnucash module + * and run the function. */ + + if(info) + { + /* module already loaded ... call the init thunk */ + if(info->init_func) + { + if(info->init_func(info->load_count)) + { + info->load_count++; + return info; + } + else + { + return NULL; + } + } + else { + return NULL; + } + } + else + { + GNCModuleInfo * modinfo = gnc_module_locate(module_name, interface); + lt_dlhandle handle = NULL; + + if(modinfo && ((handle = lt_dlopen(modinfo->module_filepath)) != NULL)) + { + lt_ptr initfunc = lt_dlsym(handle, "gnc_module_init"); + + if(initfunc) + { + /* stick it in the hash table */ + info = g_new0(GNCLoadedModule, 1); + info->handle = handle; + info->filename = g_strdup(modinfo->module_filepath); + info->load_count = 1; + info->init_func = initfunc; + g_hash_table_insert(loaded_modules, info, info); + + /* now call its init function. this should load any dependent + * modules, too. If it doesn't return TRUE unload the module. */ + if(!info->init_func(0)) + { + /* init failed. unload the module. */ + printf("Initialization failed for module %s\n", module_name); + g_hash_table_remove(loaded_modules, info); + g_free(info->filename); + g_free(info); + lt_dlclose(handle); + return NULL; + } + + return info; + } + else + { + printf("Module %s (%s) is not a gnc-module.\n", module_name, + modinfo->module_filepath); + lt_dlclose(handle); + } + return info; + } + else + { + printf("Failed to open module %s", module_name); + if(modinfo) printf(": %s\n", lt_dlerror()); + else printf(": could not locate %s interface v.%d", + module_name, interface); + return NULL; + } + } +} + + +/************************************************************* + * gnc_module_unload + * unload a module (only actually unload it if the use count goes to 0) + *************************************************************/ + +int +gnc_module_unload(GNCModule module) +{ + GNCLoadedModule * info; + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + if((info = g_hash_table_lookup(loaded_modules, module)) != NULL) + { + lt_ptr unload_thunk = lt_dlsym(info->handle, "gnc_module_end"); + int unload_val = TRUE; + + info->load_count--; + if(unload_thunk) + { + int (* thunk)(int) = unload_thunk; + unload_val = thunk(info->load_count); + } + + /* actually unload the module if necessary */ + if(info->load_count == 0) + { + /* now close the module and free the struct */ + lt_dlclose(info->handle); + g_hash_table_remove(loaded_modules, module); + g_free(info); + } + return unload_val; + } + else + { + printf("Failed to unload module %p (it is not loaded)\n", module); + return 0; + } +} + + +/************************************************************* + * gnc_module_lookup + * find a symbol in a module + *************************************************************/ + +void * +gnc_module_lookup(GNCModule module, gchar * symbol) +{ + GNCLoadedModule * info; + lt_ptr ltptr; + + if(!loaded_modules) + { + gnc_module_system_init(); + } + + if(module && symbol) + { + info = g_hash_table_lookup(loaded_modules, module); + if(info) + { + ltptr = lt_dlsym(info->handle, symbol); + return (void *)ltptr; + } + else + { + return NULL; + } + } + else + { + return NULL; + } +} diff --git a/src/gnc-module/gnc-module.h b/src/gnc-module/gnc-module.h new file mode 100644 index 0000000000..a98c7d3b6d --- /dev/null +++ b/src/gnc-module/gnc-module.h @@ -0,0 +1,42 @@ +/************************************************************* + * gnc-module.h -- loadable plugin/module system for gnucash + * Copyright 2001 Linux Developers Group, Inc. + *************************************************************/ + +#include +#include + +#ifndef lt_ptr +#define lt_ptr lt_ptr_t +#endif + +typedef void * GNCModule; + +typedef struct { + char * module_path; + char * module_description; + char * module_filepath; + int module_interface; + int module_age; + int module_revision; +} GNCModuleInfo; + +#define DEFAULT_MODULE_PATH "/usr/local/gnucash/lib/modules" + +/* the basics: initialize the module system, refresh its module + * database, and get a list of all known modules */ +void gnc_module_system_init(void); +void gnc_module_system_refresh(void); +GList * gnc_module_system_modinfo(void); + +/* load and unload a module. gnc_module_system_init() must be called + * before loading and unloading. */ +GNCModule gnc_module_load(gchar * module_name, gint interface); +int gnc_module_unload(GNCModule mod); +GNCModuleInfo * gnc_module_get_info(const char * lib_path); +int gnc_module_use_scm_module(gchar * module_path); + +/* gnc_module_lookup locates the given 'symbol' in module + * 'mod'. 'mod' must be previously loaded. */ +void * gnc_module_lookup(GNCModule mod, gchar * symbol); + diff --git a/src/gnc-module/gnc-module.scm b/src/gnc-module/gnc-module.scm new file mode 100644 index 0000000000..36f10fdd00 --- /dev/null +++ b/src/gnc-module/gnc-module.scm @@ -0,0 +1,28 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; gnc-module.scm +;;; Guile module which allows initialization of the gnucash module +;;; system from Scheme +;;; +;;; Copyright 2001 Linux Developers Group +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define-module (gnucash gnc-module)) +(use-modules (g-wrapped gw-gnc-module)) +(use-modules (g-wrapped gw-runtime)) + +(export gnc:module-system-init) + +;; symbols from gw-gnc-module +(export gnc:module-system-refresh) +(export gnc:module-load) +(export gnc:module-unload) +(export gnc:module-lookup) + +(define (gnc:module-system-init) + (let ((lib (dynamic-link "libgncmodule.la"))) + (if lib + (dynamic-call "gnc_module_system_init" lib) + (throw 'gnc:module-system-init-failed)))) + + diff --git a/src/gnc-module/gw-gnc-module-spec.scm b/src/gnc-module/gw-gnc-module-spec.scm new file mode 100644 index 0000000000..5371260cf2 --- /dev/null +++ b/src/gnc-module/gw-gnc-module-spec.scm @@ -0,0 +1,43 @@ +;; -*-scheme-*- +(use-modules (g-wrap)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(let ((mod (gw:new-module "gw-gnc-module"))) + (gw:module-depends-on mod "gw-runtime") + (gw:module-set-guile-module! mod '(g-wrapped gw-gnc-module)) + + (gw:wrap-non-native-type mod ' "GNCModule" "const GNCModule") + + (gw:module-set-declarations-ccodegen! + mod + (lambda (unused) + (list "#include \"gnc-module.h\"\n"))) + + (gw:wrap-function + mod 'gnc:module-system-refresh + ' "gnc_module_system_refresh" + '() "Reload the database of modules in the GNC_MODULE_PATH.") + + (gw:wrap-function + mod 'gnc:module-load + ' "gnc_module_load" + '(( module-name) ( interface)) + "Load and initialize a gnc-module") + + (gw:wrap-function + mod 'gnc:module-unload + ' "gnc_module_unload" + '(( module)) + "Unreference a gnc-module. Module will unload when refcount goes to 0") + + (gw:wrap-function + mod 'gnc:module-lookup + ' "gnc_module_lookup" + '(( module) + ( symbol)) + "Look up a symbol in the module. module must be loaded already.") + + ) + diff --git a/src/gnc-module/test/Makefile.am b/src/gnc-module/test/Makefile.am new file mode 100644 index 0000000000..3988351ba4 --- /dev/null +++ b/src/gnc-module/test/Makefile.am @@ -0,0 +1,28 @@ +SUBDIRS=mod-foo mod-bar mod-baz misc-mods + +LDADD=../libgncmodule.la ${GLIB_LIBS} -lltdl +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} -I../ + +TESTS=test-load-c test-load-scm test-gwrapped-c test-scm-module \ +test-scm-multi test-load-deps test-modsysver test-incompatdep test-agedver \ +test-dynload test-scm-dynload test-scm-init + +TESTS_ENVIRONMENT = \ + GNC_MODULE_PATH=${PWD}/mod-foo:${PWD}/mod-bar:${PWD}/mod-baz:${PWD}/misc-mods \ + GUILE_LOAD_PATH=..:${G_WRAP_MODULE_DIR} \ + LTDL_LIBRARY_PATH=../ \ + LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:mod-foo:mod-foo/.libs:mod-bar:mod-bar/.libs:mod-baz:mod-baz/.libs + +noinst_PROGRAMS=test-load-c test-modsysver test-incompatdep test-agedver \ +test-dynload + +test_load_c_SOURCES=test-load-c.c + +test_modsysver_SOURCES=test-modsysver.c + +test_incompatdep_SOURCES=test-incompatdep.c + +test_agedver_SOURCES=test-agedver.c + +test_dynload_SOURCES=test-dynload.c +test_dynload_LDFLAGS=-lltdl ${GUILE_LIBS} diff --git a/src/gnc-module/test/README b/src/gnc-module/test/README new file mode 100644 index 0000000000..3d6330ccfd --- /dev/null +++ b/src/gnc-module/test/README @@ -0,0 +1,13 @@ +gnc-module tests: + test-gwrapped-c.c: load a gnc-module from Scheme and test gwrapped fns + test-load-c.c: load a gnc-module from C + test-load-deps.{c,scm}: load a module that depends on another module + test-load-scm.scm: basic module load test from Scheme + test-scm-module.c: add a Scheme module load to the init fn and make sure + the symbols are visible + test-scm-multi.{c,scm}: load multiple gnc-modules from Scheme + + +gnc-module support files: + mod-{foo,bar,baz}/: sample modules for testing + diff --git a/src/gnc-module/test/misc-mods/Makefile.am b/src/gnc-module/test/misc-mods/Makefile.am new file mode 100644 index 0000000000..a50deac485 --- /dev/null +++ b/src/gnc-module/test/misc-mods/Makefile.am @@ -0,0 +1,15 @@ +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} -I../../ + +checklibdir=${PWD} +checklib_LTLIBRARIES=libfuturemodsys.la libincompatdep.la libagedver.la + +libfuturemodsys_la_SOURCES=futuremodsys.c +libfuturemodsys_la_LDFLAGS=-module + +libincompatdep_la_SOURCES=incompatdep.c +libincompatdep_la_LDFLAGS=-module + +libagedver_la_SOURCES=agedver.c +libagedver_la_LDFLAGS=-module + +CLEANFILES += *.so* *.adiff -up /dev/null 'gnucash-1.7/src/gnc-module/test/misc-mods/agedver.c' diff --git a/src/gnc-module/test/misc-mods/agedver.c b/src/gnc-module/test/misc-mods/agedver.c new file mode 100644 index 0000000000..8c616dbb54 --- /dev/null +++ b/src/gnc-module/test/misc-mods/agedver.c @@ -0,0 +1,28 @@ +/* incompatdep.c : a gnucash module that depends on an incompatible + * version of another module. the initialization should fail. */ + +#include +#include +#include "gnc-module.h" + +int gnc_module_system_interface = 0; + +int gnc_module_current = 12; +int gnc_module_age = 9; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/agedver"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is a frequently extended module"); +} + +int +gnc_module_init(void) { + return TRUE; +} + diff --git a/src/gnc-module/test/misc-mods/futuremodsys.c b/src/gnc-module/test/misc-mods/futuremodsys.c new file mode 100644 index 0000000000..56af303e2b --- /dev/null +++ b/src/gnc-module/test/misc-mods/futuremodsys.c @@ -0,0 +1,29 @@ +/* futuremodsys.c : a gnucash module compiled with a future version of + * the module system. gnucash should not be able to load it. but if + * it doesn't motice that, the actual interface is compatible with + * version 0 so it will load all the way before failing. */ + +#include +#include + +int gnc_module_system_interface = 123456; + +int gnc_module_current = 0; +int gnc_module_age = 0; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/futuremodsys"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is a broken future module"); +} + +int +gnc_module_init(int refcount) { + return TRUE; +} + diff --git a/src/gnc-module/test/misc-mods/incompatdep.c b/src/gnc-module/test/misc-mods/incompatdep.c new file mode 100644 index 0000000000..2a62c30ffd --- /dev/null +++ b/src/gnc-module/test/misc-mods/incompatdep.c @@ -0,0 +1,35 @@ +/* incompatdep.c : a gnucash module that depends on an incompatible + * version of another module. the initialization should fail. */ + +#include +#include +#include "gnc-module.h" + +int gnc_module_system_interface = 0; + +int gnc_module_current = 0; +int gnc_module_age = 0; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/incompatdep"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is a broken module"); +} + +int +gnc_module_init(int refcount) { + if (gnc_module_load("gnucash/foo", 25)) + { + return TRUE; + } + else + { + return FALSE; + } +} + diff --git a/src/gnc-module/test/mod-bar/Makefile.am b/src/gnc-module/test/mod-bar/Makefile.am new file mode 100644 index 0000000000..ee38580708 --- /dev/null +++ b/src/gnc-module/test/mod-bar/Makefile.am @@ -0,0 +1,20 @@ +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} + +checklibdir=${PWD} +checklib_LTLIBRARIES = libbar.la libgncmodbar.la + +libbar_la_LDFLAGS = -module +libbar_la_SOURCES = bar.c + +libgncmodbar_la_SOURCES=bar-gwrap.c gnc-mod-bar.c +libgncmodbar_la_LDFLAGS=-module -L.libs +libgncmodbar_la_LIBADD=-lbar + +bar-gwrap.c bar-gwrap.h: bar-gwrap.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (primitive-load \"./bar-gwrap.scm\") \ + (gw:generate-module \"bar-gwrap\")" + +BUILT_SOURCES += bar-gwrap.c bar-gwrap.h +CLEANFILES += *.so* *.a bar-gwrap.c bar-gwrap.h bar-gwrap.htmldiff -up /dev/null 'gnucash-1.7/src/gnc-module/test/mod-bar/bar-gwrap.scm' diff --git a/src/gnc-module/test/mod-bar/bar-gwrap.scm b/src/gnc-module/test/mod-bar/bar-gwrap.scm new file mode 100644 index 0000000000..5c5270d9a0 --- /dev/null +++ b/src/gnc-module/test/mod-bar/bar-gwrap.scm @@ -0,0 +1,17 @@ +(use-modules (g-wrap)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(let ((mod (gw:new-module "bar-gwrap"))) + (gw:module-depends-on mod "gw-runtime") + (gw:module-set-declarations-ccodegen! + mod + (lambda (unused) + (list "#include \"bar.h\"\n"))) + + (gw:wrap-function + mod 'bar:hello + ' "bar_hello" + '() + "Print a simple message from C")) diff --git a/src/gnc-module/test/mod-bar/bar.c b/src/gnc-module/test/mod-bar/bar.c new file mode 100644 index 0000000000..1050fd9785 --- /dev/null +++ b/src/gnc-module/test/mod-bar/bar.c @@ -0,0 +1,10 @@ +/* libfoo. this is a dependency-free client library, equivalent to + * the engine or some other core component that's ignorant of guile + * and the module system */ + +#include + +int +bar_hello(void) { + return 1; +} diff --git a/src/gnc-module/test/mod-bar/bar.h b/src/gnc-module/test/mod-bar/bar.h new file mode 100644 index 0000000000..ecad0e3e5b --- /dev/null +++ b/src/gnc-module/test/mod-bar/bar.h @@ -0,0 +1,8 @@ +/* bar.h: header for a dependency-free, guile-free client lib */ + +#ifndef BAR_H +#define BAR_H + +int bar_hello(void); + +#endif diff --git a/src/gnc-module/test/mod-bar/gnc-mod-bar.c b/src/gnc-module/test/mod-bar/gnc-mod-bar.c new file mode 100644 index 0000000000..dcd434eaf8 --- /dev/null +++ b/src/gnc-module/test/mod-bar/gnc-mod-bar.c @@ -0,0 +1,36 @@ +/* gnc-mod-bar.c : the Gnucash plugin that wraps the library + * 'libbar.so'. it does this by being linked against libbar.so */ + +#include +#include +#include +#include "bar-gwrap.h" + +int gnc_module_system_interface = 0; + +int gnc_module_current = 0; +int gnc_module_age = 0; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/bar"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is a bar module"); +} + +int +gnc_module_init(int refcount) { + /* publish the g-wrapped Scheme bindings for libbar */ + gw_init_module_bar_gwrap(); + + /* use the (bar) module */ + gh_eval_str("(use-modules (gnucash bar))"); + + return TRUE; +} + + diff --git a/src/gnc-module/test/mod-bar/gnucash/bar.scm b/src/gnc-module/test/mod-bar/gnucash/bar.scm new file mode 100644 index 0000000000..1ea162d9f5 --- /dev/null +++ b/src/gnc-module/test/mod-bar/gnucash/bar.scm @@ -0,0 +1,12 @@ +;; test of a Scheme module called gnc-mod-bar, which should get +;; loaded by the Gnucash module "bar" + +(define-module (gnucash bar)) + +(export bar:scheme-hello) + +(define (bar:scheme-hello) + #t) + + + diff --git a/src/gnc-module/test/mod-baz/Makefile.am b/src/gnc-module/test/mod-baz/Makefile.am new file mode 100644 index 0000000000..7e8b643186 --- /dev/null +++ b/src/gnc-module/test/mod-baz/Makefile.am @@ -0,0 +1,20 @@ +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} -I../mod-foo -I../.. + +checklibdir=${PWD} +checklib_LTLIBRARIES=libbaz.la libgncmodbaz.la + +libbaz_la_LDFLAGS=-module +libbaz_la_SOURCES=baz.c + +libgncmodbaz_la_SOURCES=baz-gwrap.c gnc-mod-baz.c +libgncmodbaz_la_LDFLAGS=-module -L.libs -L../mod-foo/.libs +libgncmodbaz_la_LIBADD=-lbaz -lfoo + +baz-gwrap.c baz-gwrap.h: baz-gwrap.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (primitive-load \"./baz-gwrap.scm\") \ + (gw:generate-module \"baz-gwrap\")" + +BUILT_SOURCES += baz-gwrap.c baz-gwrap.h +CLEANFILES += *.so* *.a baz-gwrap.c baz-gwrap.h baz-gwrap.html diff --git a/src/gnc-module/test/mod-baz/baz-gwrap.scm b/src/gnc-module/test/mod-baz/baz-gwrap.scm new file mode 100644 index 0000000000..4fc7fed85d --- /dev/null +++ b/src/gnc-module/test/mod-baz/baz-gwrap.scm @@ -0,0 +1,17 @@ +(use-modules (g-wrap)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(let ((mod (gw:new-module "baz-gwrap"))) + (gw:module-depends-on mod "gw-runtime") + (gw:module-set-declarations-ccodegen! + mod + (lambda (unused) + (list "#include \"baz.h\"\n"))) + + (gw:wrap-function + mod 'baz:hello + ' "baz_hello" + '() + "Print a simple message from C")) diff --git a/src/gnc-module/test/mod-baz/baz.c b/src/gnc-module/test/mod-baz/baz.c new file mode 100644 index 0000000000..d8849f2dc8 --- /dev/null +++ b/src/gnc-module/test/mod-baz/baz.c @@ -0,0 +1,13 @@ +/* libbaz. this library depends on foo */ + +#include + +#include "baz.h" +#include "foo.h" + +int +baz_hello(void) { + foo_hello(); + return 1; +} + diff --git a/src/gnc-module/test/mod-baz/baz.h b/src/gnc-module/test/mod-baz/baz.h new file mode 100644 index 0000000000..a06761d73a --- /dev/null +++ b/src/gnc-module/test/mod-baz/baz.h @@ -0,0 +1,8 @@ +/* baz.h: header for a dependency-free, guile-free client lib */ + +#ifndef BAZ_H +#define BAZ_H + +int baz_hello(void); + +#endif diff --git a/src/gnc-module/test/mod-baz/gnc-mod-baz.c b/src/gnc-module/test/mod-baz/gnc-mod-baz.c new file mode 100644 index 0000000000..ee7a321657 --- /dev/null +++ b/src/gnc-module/test/mod-baz/gnc-mod-baz.c @@ -0,0 +1,41 @@ +/* gnc-mod-baz.c : the Gnucash plugin that wraps the library + * 'libbaz.so'. it does this by being linked against libbaz.so */ + +#include +#include +#include "gnc-module.h" +#include "baz-gwrap.h" + +int gnc_module_system_interface = 0; + +int gnc_module_current = 0; +int gnc_module_age = 0; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/baz"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is the baz module"); +} + +int +gnc_module_init(int refcount) { + /* load libfoo */ + if(gnc_module_load("gnucash/foo", 0)) { + /* publish the g-wrapped Scheme bindings for libbaz */ + gw_init_module_baz_gwrap(); + + /* use the scheme module */ + gh_eval_str("(use-modules (gnucash baz))"); + + return TRUE; + } + else { + return FALSE; + } +} + diff --git a/src/gnc-module/test/mod-baz/gnucash/baz.scm b/src/gnc-module/test/mod-baz/gnucash/baz.scm new file mode 100644 index 0000000000..7c3940aa91 --- /dev/null +++ b/src/gnc-module/test/mod-baz/gnucash/baz.scm @@ -0,0 +1,12 @@ +;; test of a Scheme module called gnc-mod-baz, which should get +;; loaded by the Gnucash module "baz" + +(define-module (gnucash baz)) + +(export baz:scheme-hello) + +(define (baz:scheme-hello) + #t) + + + diff --git a/src/gnc-module/test/mod-foo/Makefile.am b/src/gnc-module/test/mod-foo/Makefile.am new file mode 100644 index 0000000000..56308d5fad --- /dev/null +++ b/src/gnc-module/test/mod-foo/Makefile.am @@ -0,0 +1,20 @@ +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} + +checklibdir=${PWD} +checklib_LTLIBRARIES=libfoo.la libgncmodfoo.la + +libfoo_la_LDFLAGS = -module +libfoo_la_SOURCES = foo.c + +libgncmodfoo_la_SOURCES = foo-gwrap.c gnc-mod-foo.c +libgncmodfoo_la_LDFLAGS = -module -L.libs +libgncmodfoo_la_LIBADD = -lfoo + +foo-gwrap.c foo-gwrap.h: foo-gwrap.scm + FLAVOR=gnome guile -c \ + "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \ + (primitive-load \"./foo-gwrap.scm\") \ + (gw:generate-module \"foo-gwrap\")" + +BUILT_SOURCES += foo-gwrap.c foo-gwrap.h +CLEANFILES += *.so* *.a foo-gwrap.c foo-gwrap.h foo-gwrap.html diff --git a/src/gnc-module/test/mod-foo/foo-gwrap.scm b/src/gnc-module/test/mod-foo/foo-gwrap.scm new file mode 100644 index 0000000000..98eae42027 --- /dev/null +++ b/src/gnc-module/test/mod-foo/foo-gwrap.scm @@ -0,0 +1,17 @@ +(use-modules (g-wrap)) + +(debug-set! maxdepth 100000) +(debug-set! stack 2000000) + +(let ((mod (gw:new-module "foo-gwrap"))) + (gw:module-depends-on mod "gw-runtime") + (gw:module-set-declarations-ccodegen! + mod + (lambda (unused) + (list "#include \"foo.h\"\n"))) + + (gw:wrap-function + mod 'foo:hello + ' "foo_hello" + '() + "Print a simple message from C")) diff --git a/src/gnc-module/test/mod-foo/foo.c b/src/gnc-module/test/mod-foo/foo.c new file mode 100644 index 0000000000..1348ca3142 --- /dev/null +++ b/src/gnc-module/test/mod-foo/foo.c @@ -0,0 +1,10 @@ +/* libfoo. this is a dependency-free client library, equivalent to + * the engine or some other core component that's ignorant of guile + * and the module system */ + +#include + +int +foo_hello(void) { + return 10; +} diff --git a/src/gnc-module/test/mod-foo/foo.h b/src/gnc-module/test/mod-foo/foo.h new file mode 100644 index 0000000000..ec0d4068a1 --- /dev/null +++ b/src/gnc-module/test/mod-foo/foo.h @@ -0,0 +1,8 @@ +/* foo.h: header for a dependency-free, guile-free client lib */ + +#ifndef FOO_H +#define FOO_H + +int foo_hello(void); + +#endif diff --git a/src/gnc-module/test/mod-foo/gnc-mod-foo.c b/src/gnc-module/test/mod-foo/gnc-mod-foo.c new file mode 100644 index 0000000000..b709ba294f --- /dev/null +++ b/src/gnc-module/test/mod-foo/gnc-mod-foo.c @@ -0,0 +1,34 @@ +/* gnc-mod-foo.c : the Gnucash plugin that wraps the library + * 'libfoo.so'. it does this by being linked against libfoo.so */ + +#include +#include +#include +#include "foo-gwrap.h" + +int gnc_module_system_interface = 0; + +int gnc_module_current = 0; +int gnc_module_age = 0; +int gnc_module_revision = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/foo"); +} + +char * +gnc_module_description(void) { + return g_strdup("this is a foo module"); +} + +int +gnc_module_init(int refcount) { + /* publish the g-wrapped Scheme bindings for libfoo */ + gw_init_module_foo_gwrap(); + + /* use the Scheme "foo" module */ + gh_eval_str("(use-modules (gnucash foo))"); + + return TRUE; +} diff --git a/src/gnc-module/test/mod-foo/gnucash/foo.scm b/src/gnc-module/test/mod-foo/gnucash/foo.scm new file mode 100644 index 0000000000..088cdb9a7f --- /dev/null +++ b/src/gnc-module/test/mod-foo/gnucash/foo.scm @@ -0,0 +1,12 @@ +;; test of a Scheme module called gnc-mod-foo, which should get +;; loaded by the Gnucash module "foo" + +(define-module (gnucash foo)) + +(export foo:scheme-hello) + +(define (foo:scheme-hello) + #t) + + + diff --git a/src/gnc-module/test/test-agedver.c b/src/gnc-module/test/test-agedver.c new file mode 100644 index 0000000000..f1049a016f --- /dev/null +++ b/src/gnc-module/test/test-agedver.c @@ -0,0 +1,31 @@ +#include +#include +#include + +#include "gnc-module.h" + +static void +guile_main(int argc, char ** argv) { + GNCModule foo; + + printf(" test-agedver.c: asking for an old but supported interface ..."); + + gnc_module_system_init(); + + foo = gnc_module_load("gnucash/agedver", 5); + + if(foo) { + printf(" ok\n"); + exit(0); + } + else { + printf(" failed\n"); + exit(-1); + } +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} diff --git a/src/gnc-module/test/test-dynload.c b/src/gnc-module/test/test-dynload.c new file mode 100644 index 0000000000..42d4eda648 --- /dev/null +++ b/src/gnc-module/test/test-dynload.c @@ -0,0 +1,44 @@ +/********************************************************************* + * test-dynload.c + * test the ability to dlopen the gnc_module library and initialize + * it via dlsym + *********************************************************************/ + +#include +#include +#include + +#include "gnc-module.h" + +void +guile_main(int argc, char ** argv) { + lt_dlhandle handle; + + printf(" test-dynload.c: testing dynamic linking of libgncmodule ..."); + handle = lt_dlopen("libgncmodule.la"); + if(handle) { + lt_ptr ptr = lt_dlsym(handle, "gnc_module_system_init"); + if(ptr) { + void (* fn)(void) = ptr; + fn(); + printf(" OK\n"); + exit(0); + } + else { + printf(" failed to find gnc_module_system_init\n"); + exit(-1); + } + } + else { + printf(" failed to open library.\n"); + printf("%s\n", lt_dlerror()); + exit(-1); + } +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} + diff --git a/src/gnc-module/test/test-gwrapped-c b/src/gnc-module/test/test-gwrapped-c new file mode 100755 index 0000000000..c5bb7b0153 --- /dev/null +++ b/src/gnc-module/test/test-gwrapped-c @@ -0,0 +1,5 @@ +#! /bin/sh +guile -c "(use-modules (gnucash gnc-module)) + (gnc:module-system-init) + (gnc:module-load \"gnucash/foo\" 0) + (exit (foo:hello))" diff --git a/src/gnc-module/test/test-incompatdep.c b/src/gnc-module/test/test-incompatdep.c new file mode 100644 index 0000000000..bfd778e158 --- /dev/null +++ b/src/gnc-module/test/test-incompatdep.c @@ -0,0 +1,31 @@ +#include +#include +#include + +#include "gnc-module.h" + +static void +guile_main(int argc, char ** argv) { + GNCModule foo; + + printf(" test-incompatdep.c: loading a module with bad deps ...\n"); + + gnc_module_system_init(); + + foo = gnc_module_load("gnucash/incompatdeps", 0); + + if(!foo) { + printf(" ok\n"); + exit(0); + } + else { + printf(" oops! loaded incompatible module\n"); + exit(-1); + } +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} diff --git a/src/gnc-module/test/test-load-c.c b/src/gnc-module/test/test-load-c.c new file mode 100644 index 0000000000..0861020301 --- /dev/null +++ b/src/gnc-module/test/test-load-c.c @@ -0,0 +1,45 @@ + +#include +#include +#include + +#include "gnc-module.h" + +static void +guile_main(int argc, char ** argv) { + int (*foo_hello)(void); + int helloval; + GNCModule foo; + + printf(" test-load-c.c: testing module load/unload from C ... "); + + gnc_module_system_init(); + + foo = gnc_module_load("gnucash/foo", 0); + + if(!foo) { + printf(" Failed to load foo\n"); + exit(-1); + } + + foo_hello = gnc_module_lookup(foo, "foo_hello"); + helloval = foo_hello(); + if(helloval != 10) { + printf(" Call of module function failed.\n"); + exit(-1); + } + + if(!gnc_module_unload(foo)) { + printf(" Failed to unload foo\n"); + exit(-1); + } + printf(" successful.\n"); + + exit(0); +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} diff --git a/src/gnc-module/test/test-load-deps b/src/gnc-module/test/test-load-deps new file mode 100755 index 0000000000..839822f437 --- /dev/null +++ b/src/gnc-module/test/test-load-deps @@ -0,0 +1,2 @@ +#! /bin/sh +guile -l test-load-deps.scm ; diff --git a/src/gnc-module/test/test-load-deps.scm b/src/gnc-module/test/test-load-deps.scm new file mode 100644 index 0000000000..f2cf453a8e --- /dev/null +++ b/src/gnc-module/test/test-load-deps.scm @@ -0,0 +1,13 @@ +;; test-load-deps.scm : load gnc-mod-baz, which depends on gnc-mod-foo + +(use-modules (gnucash gnc-module)) + +(gnc:module-system-init) +(gnc:module-load "gnucash/baz" 0) + +(baz:hello) +(foo:hello) +(baz:scheme-hello) +(foo:scheme-hello) + +(exit 0) diff --git a/src/gnc-module/test/test-load-scm b/src/gnc-module/test/test-load-scm new file mode 100755 index 0000000000..1628d125b5 --- /dev/null +++ b/src/gnc-module/test/test-load-scm @@ -0,0 +1,4 @@ +#! /bin/sh +guile -c "(use-modules (gnucash gnc-module)) + (gnc:module-system-init) + (gnc:module-load \"gnucash/foo\" 0)" diff --git a/src/gnc-module/test/test-modsysver.c b/src/gnc-module/test/test-modsysver.c new file mode 100644 index 0000000000..bbe01f2c3f --- /dev/null +++ b/src/gnc-module/test/test-modsysver.c @@ -0,0 +1,31 @@ +#include +#include +#include + +#include "gnc-module.h" + +static void +guile_main(int argc, char ** argv) { + GNCModule foo; + + printf(" test-modsysver.c: checking for a module we shouldn't find ...\n"); + + gnc_module_system_init(); + + foo = gnc_module_load("gnucash/futuremodsys", 0); + + if(!foo) { + printf(" ok\n"); + exit(0); + } + else { + printf(" oops! loaded incompatible module\n"); + exit(-1); + } +} + +int +main(int argc, char ** argv) { + gh_enter(argc, argv, guile_main); + return 0; +} diff --git a/src/gnc-module/test/test-scm-dynload b/src/gnc-module/test/test-scm-dynload new file mode 100755 index 0000000000..5f3551b4ce --- /dev/null +++ b/src/gnc-module/test/test-scm-dynload @@ -0,0 +1,4 @@ +#! /bin/sh +echo " test-scm-dynload: testing dynamic-link of libgncmodule from Scheme."; +guile -c "(dynamic-link \"libgncmodule.la\")"; + diff --git a/src/gnc-module/test/test-scm-init b/src/gnc-module/test/test-scm-init new file mode 100755 index 0000000000..b8b0fb5869 --- /dev/null +++ b/src/gnc-module/test/test-scm-init @@ -0,0 +1,5 @@ +#! /bin/sh +echo " test-scm-init: testing Scheme-only module system init. "; +guile -c "(set! %load-path (cons \"..\" %load-path)) + (set! %load-path (cons \"/usr/local/g-wrap/share/guile\" %load-path)) + (use-modules (gnucash gnc-module)) (gnc:module-system-init)" diff --git a/src/gnc-module/test/test-scm-module b/src/gnc-module/test/test-scm-module new file mode 100755 index 0000000000..f75f9768b7 --- /dev/null +++ b/src/gnc-module/test/test-scm-module @@ -0,0 +1,5 @@ +#! /bin/sh +guile -c "(use-modules (gnucash gnc-module)) + (gnc:module-system-init) + (if (not (gnc:module-load \"gnucash/foo\" 0)) (exit -1)) + (exit (foo:scheme-hello))" diff --git a/src/gnc-module/test/test-scm-multi b/src/gnc-module/test/test-scm-multi new file mode 100755 index 0000000000..a2b9f1dd38 --- /dev/null +++ b/src/gnc-module/test/test-scm-multi @@ -0,0 +1,11 @@ +#! /bin/sh +guile -c "(use-modules (gnucash gnc-module)) + (gnc:module-system-init) + (gnc:module-load \"gnucash/foo\" 0) + (foo:hello) + (foo:scheme-hello) + (gnc:module-load \"gnucash/bar\" 0) + (foo:hello) + (foo:scheme-hello) + (bar:hello) + (bar:scheme-hello)" diff --git a/src/gnc-module/test/test-scm-multi.scm b/src/gnc-module/test/test-scm-multi.scm new file mode 100644 index 0000000000..15291e8504 --- /dev/null +++ b/src/gnc-module/test/test-scm-multi.scm @@ -0,0 +1,12 @@ +;; test-scm-multi.scm : load multiple gnucash modules from Scheme + +(gnc:module-load "gnucash/foo" 0) +(foo:hello) +(foo:scheme-hello) + +(gnc:module-load "gnucash/bar" 0) +(foo:hello) +(foo:scheme-hello) +(bar:hello) +(bar:scheme-hello) + diff --git a/src/gnome/Makefile.am b/src/gnome/Makefile.am index 9b9553e68a..cc313ca4b2 100644 --- a/src/gnome/Makefile.am +++ b/src/gnome/Makefile.am @@ -5,7 +5,6 @@ noinst_LIBRARIES = libgncgnome.a libgncgnome_a_SOURCES = \ account-tree.c \ cursors.c \ - dialog-account-picker.c \ dialog-account.c \ dialog-column-view.c \ dialog-commodities.c \ @@ -28,7 +27,6 @@ libgncgnome_a_SOURCES = \ dialog-scheduledxaction.c \ druid-commodity.c \ druid-hierarchy.c \ - druid-qif-import.c \ druid-stock-split.c \ druid-utils.c \ extensions.c \ @@ -73,7 +71,6 @@ mime_DATA = gnucash.keys gnucash.mime noinst_HEADERS = \ account-tree.h \ - dialog-account-picker.h \ dialog-account.h \ dialog-column-view.h \ dialog-commodity.h \ @@ -90,7 +87,6 @@ noinst_HEADERS = \ dialog-scheduledxaction.h \ druid-commodity.h \ druid-hierarchy.h \ - druid-qif-import.h \ druid-utils.h \ extensions.h \ gnc-amount-edit.h \ @@ -142,10 +138,13 @@ INCLUDES = \ -I${top_srcdir}/src \ -I${top_srcdir}/src/calculation \ -I${top_srcdir}/src/engine \ + -I${top_srcdir}/src/backend/file \ -I${top_srcdir}/src/g-wrap \ -I${top_srcdir}/src/guile \ - -I${top_srcdir}/src/register \ - -I${top_srcdir}/src/register/gnome \ + -I${top_srcdir}/src/register/ledger-core \ + -I${top_srcdir}/src/register/register-core \ + -I${top_srcdir}/src/register/register-gnome \ + -I${top_srcdir}/src/import-export/qif-import \ ${GNOME_INCLUDEDIR} \ ${GUILE_INCS} diff --git a/src/gnome/dialog-options.c b/src/gnome/dialog-options.c index 3e2f0f8e41..3ec3f2fc42 100644 --- a/src/gnome/dialog-options.c +++ b/src/gnome/dialog-options.c @@ -29,7 +29,7 @@ #include "option-util.h" #include "guile-util.h" #include "query-user.h" -#include "gnc-helpers.h" +#include "engine-helpers.h" #include "account-tree.h" #include "gnc-dateedit.h" #include "gnc-commodity-edit.h" diff --git a/src/gnome/dialog-price-editor.c b/src/gnome/dialog-price-editor.c index 572703091b..3844da0fd8 100644 --- a/src/gnome/dialog-price-editor.c +++ b/src/gnome/dialog-price-editor.c @@ -39,6 +39,7 @@ #include "gnc-pricedb.h" #include "gnc-ui.h" #include "guile-util.h" +#include "engine-helpers.h" #include "messages.h" diff --git a/src/gnome/glade/Makefile.am b/src/gnome/glade/Makefile.am index d4f30231e8..3450ccd81c 100644 --- a/src/gnome/glade/Makefile.am +++ b/src/gnome/glade/Makefile.am @@ -9,7 +9,6 @@ glade_DATA = \ price.glade \ print.glade \ progress.glade \ - qif.glade \ register.glade \ report.glade \ stocks.glade \ @@ -28,7 +27,6 @@ STRING_FILES = \ price_strings.c \ print_strings.c \ progress_strings.c \ - qif_strings.c \ register_strings.c \ report_strings.c \ stocks_strings.c \ diff --git a/src/gnome/top-level.c b/src/gnome/top-level.c index 25b5442b1f..505eb35841 100644 --- a/src/gnome/top-level.c +++ b/src/gnome/top-level.c @@ -56,7 +56,7 @@ #endif #include "gnc-gpg.h" #include "gnc-ui.h" -#include "gnc.h" +#include "gw-gnc.h" #include "gnucash-color.h" #include "gnucash-sheet.h" #include "gnucash-style.h" diff --git a/src/gnome/window-acct-tree.c b/src/gnome/window-acct-tree.c index d0ae23dffd..c6bf4633a1 100644 --- a/src/gnome/window-acct-tree.c +++ b/src/gnome/window-acct-tree.c @@ -61,9 +61,6 @@ #include "io-gncxml-v2.h" #include "gnc-book.h" -/* FIXME get rid of these */ -#include "gnc.h" - static short module = MOD_GUI; #define WINDOW_ACCT_TREE_CM_CLASS "window-acct-tree" diff --git a/src/gnome/window-register.c b/src/gnome/window-register.c index 947ca1a248..570adca086 100644 --- a/src/gnome/window-register.c +++ b/src/gnome/window-register.c @@ -830,15 +830,6 @@ gnc_register_create_tool_bar (RegWindow *regData) GnomeUIInfo toolbar_info[] = { - { - GNOME_APP_UI_ITEM, - N_("Close"), - N_("Close this register window"), - closeCB, NULL, NULL, - GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_CLOSE, - 0, 0, NULL - }, - GNOMEUIINFO_SEPARATOR, { GNOME_APP_UI_ITEM, N_("Enter"), @@ -936,6 +927,15 @@ gnc_register_create_tool_bar (RegWindow *regData) GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_PRINT, 0, 0, NULL }, + GNOMEUIINFO_SEPARATOR, + { + GNOME_APP_UI_ITEM, + N_("Close"), + N_("Close this register window"), + closeCB, NULL, NULL, + GNOME_APP_PIXMAP_STOCK, GNOME_STOCK_PIXMAP_CLOSE, + 0, 0, NULL + }, GNOMEUIINFO_END }; @@ -946,7 +946,7 @@ gnc_register_create_tool_bar (RegWindow *regData) regData->toolbar = toolbar; - regData->split_button = toolbar_info[8].widget; + regData->split_button = toolbar_info[6].widget; return toolbar; } diff --git a/src/gnucash-make-guids.c b/src/gnucash-make-guids.c index 44c8c1cf17..0d955f542a 100644 --- a/src/gnucash-make-guids.c +++ b/src/gnucash-make-guids.c @@ -24,6 +24,7 @@ #include #include +#include "gnc-module.h" #include "GNCIdP.h" static void @@ -48,6 +49,9 @@ main (int argc, char **argv) usage (); } + gnc_module_system_init(); + gnc_module_load("gnucash/engine", 0); + while (num_to_make-- > 0) { GUID guid; diff --git a/src/import-export/Makefile.am b/src/import-export/Makefile.am new file mode 100644 index 0000000000..0f78245183 --- /dev/null +++ b/src/import-export/Makefile.am @@ -0,0 +1 @@ +SUBDIRS=qif-import diff --git a/src/import-export/qif-import/Makefile.am b/src/import-export/qif-import/Makefile.am new file mode 100644 index 0000000000..4675ed8a56 --- /dev/null +++ b/src/import-export/qif-import/Makefile.am @@ -0,0 +1,54 @@ + +lib_LTLIBRARIES=libgncmod-qif-import.la + +libgncmod_qif_import_la_SOURCES=gncmod-qif-import.c druid-qif-import.c dialog-account-picker.c +libgncmod_qif_import_la_LDFLAGS=-module -L${top_srcdir}/src/engine \ +-L${top_srcdir}/src/engine/.libs \ +-lgncmod-engine ${GNOME_LIBS} ${GLADE_LIBS} ${GLIB_LIBS} ${GUILE_LIBS} + +gncscmmoddir=${GNC_SHAREDIR}/guile-modules/gnucash/import-export +gncscmmod_DATA = qif-import.scm + +gncscmdir = ${GNC_SCM_INSTALL_DIR}/qif-import + +gncscm_DATA = \ + qif-dialog-utils.scm \ + qif-file.scm \ + qif-guess-map.scm \ + qif-merge-groups.scm \ + qif-objects.scm \ + qif-parse.scm \ + qif-to-gnc.scm \ + qif-utils.scm \ + simple-obj.scm + +gladedir = ${GNC_GLADE_DIR} +glade_DATA = qif.glade + +STRING_FILES = qif_strings.c + +CFLAGS = @CFLAGS@ ${G_WRAP_COMPILE_ARGS} + +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/engine \ + -I${top_srcdir}/src/gnc-module \ + -I${top_srcdir}/src/guile \ + -I${top_srcdir}/src/gnome \ + ${GLIB_CFLAGS} \ + ${GNOME_INCLUDEDIR} \ + ${GUILE_INCS} + +EXTRA_DIST = \ + .cvsignore \ + ${gncscm_DATA} \ + ${glade_DATA} \ + ${STRING_FILES} \ + file-format.txt + +guile-strings.c: ${gncscm_DATA} + rm -f guile-strings.c + guile -s ../../scm/xgettext.scm ${gncscm_DATA} +CLEANFILES += guile-strings.c + +all-local: guile-strings.c diff --git a/src/gnome/dialog-account-picker.c b/src/import-export/qif-import/dialog-account-picker.c similarity index 100% rename from src/gnome/dialog-account-picker.c rename to src/import-export/qif-import/dialog-account-picker.c diff --git a/src/gnome/dialog-account-picker.h b/src/import-export/qif-import/dialog-account-picker.h similarity index 100% rename from src/gnome/dialog-account-picker.h rename to src/import-export/qif-import/dialog-account-picker.h diff --git a/src/gnome/druid-qif-import.c b/src/import-export/qif-import/druid-qif-import.c similarity index 100% rename from src/gnome/druid-qif-import.c rename to src/import-export/qif-import/druid-qif-import.c diff --git a/src/gnome/druid-qif-import.h b/src/import-export/qif-import/druid-qif-import.h similarity index 100% rename from src/gnome/druid-qif-import.h rename to src/import-export/qif-import/druid-qif-import.h diff --git a/src/scm/qif-import/file-format.txt b/src/import-export/qif-import/file-format.txt similarity index 100% rename from src/scm/qif-import/file-format.txt rename to src/import-export/qif-import/file-format.txt diff --git a/src/import-export/qif-import/gncmod-qif-import.c b/src/import-export/qif-import/gncmod-qif-import.c new file mode 100644 index 0000000000..dcc0ded968 --- /dev/null +++ b/src/import-export/qif-import/gncmod-qif-import.c @@ -0,0 +1,48 @@ +/********************************************************************* + * gncmod-qif-import.c + * module definition/initialization for old QIF importer (deprecated) + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) +{ + return g_strdup("gnucash/import-export/qif-import"); +} + +char * +gnc_module_description(void) +{ + return g_strdup("Gnome GUI and Scheme code for QIF importer"); +} + +int +gnc_module_init(int refcount) +{ + if(!gnc_module_load("gnucash/engine", 0)) + { + return FALSE; + } + gh_eval_str("(use-modules (gnucash import-export qif-import))"); + return TRUE; +} + +int +gnc_module_end(int refcount) +{ + return TRUE; +} + diff --git a/src/scm/qif-import/qif-dialog-utils.scm b/src/import-export/qif-import/qif-dialog-utils.scm similarity index 99% rename from src/scm/qif-import/qif-dialog-utils.scm rename to src/import-export/qif-import/qif-dialog-utils.scm index 33de3bd509..78553035e6 100644 --- a/src/scm/qif-import/qif-dialog-utils.scm +++ b/src/import-export/qif-import/qif-dialog-utils.scm @@ -7,10 +7,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-dialog-utils.scm") - -(gnc:depend "utilities.scm") - (use-modules (ice-9 regex)) (define (default-stock-acct brokerage security) diff --git a/src/scm/qif-import/qif-file.scm b/src/import-export/qif-import/qif-file.scm similarity index 99% rename from src/scm/qif-import/qif-file.scm rename to src/import-export/qif-import/qif-file.scm index 4b3e12fd05..6c6cba0bbd 100644 --- a/src/scm/qif-import/qif-file.scm +++ b/src/import-export/qif-import/qif-file.scm @@ -6,11 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-file.scm") -(gnc:depend "qif-import/qif-objects.scm") -(gnc:depend "qif-import/qif-parse.scm") -(gnc:depend "qif-import/qif-utils.scm") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; qif-file:read-file self path ;; suck in all the transactions; don't do any string interpretation, @@ -460,7 +455,7 @@ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (define (qif-file:parse-fields self) - (false-if-exception +; (false-if-exception (let* ((error #f) (all-ok #f) (set-error @@ -574,7 +569,8 @@ (cond (error (cons all-ok error)) - (#t #t))))) + (#t #t)))) +;) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; parse-field diff --git a/src/scm/qif-import/qif-guess-map.scm b/src/import-export/qif-import/qif-guess-map.scm similarity index 99% rename from src/scm/qif-import/qif-guess-map.scm rename to src/import-export/qif-import/qif-guess-map.scm index 52e8e0c1a3..1de76a14c0 100644 --- a/src/scm/qif-import/qif-guess-map.scm +++ b/src/import-export/qif-import/qif-guess-map.scm @@ -6,8 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-guess-map.scm") - (define GNC-BANK-TYPE 0) (define GNC-CASH-TYPE 1) (define GNC-ASSET-TYPE 2) diff --git a/src/import-export/qif-import/qif-import.scm b/src/import-export/qif-import/qif-import.scm new file mode 100644 index 0000000000..6f1ddc2ed1 --- /dev/null +++ b/src/import-export/qif-import/qif-import.scm @@ -0,0 +1,67 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-import.scm +;;; virtual loader for QIF import facility +;;; +;;; Bill Gribble 20 Feb 2000 +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(gnc:depend "utilities.scm") +(gnc:depend "report-utilities.scm") + +(define-module (gnucash import-export qif-import)) +(use-modules (g-wrapped gw-runtime)) +(use-modules (gnucash gnc-module)) +(use-modules (ice-9 slib)) +(use-modules (ice-9 regex)) +(use-modules (srfi srfi-1)) + +(debug-enable 'debug) +(debug-enable 'backtrace) + +(gnc:module-load "gnucash/engine" 0) + +(load-from-path "qif-import/simple-obj.scm") +(load-from-path "qif-import/qif-objects.scm") ;; class definitions +(load-from-path "qif-import/qif-parse.scm") ;; string-to-value +(load-from-path "qif-import/qif-utils.scm") +(load-from-path "qif-import/qif-file.scm") ;; actual file reading +(load-from-path "qif-import/qif-dialog-utils.scm") ;; build displays +(load-from-path "qif-import/qif-guess-map.scm") ;; build acct mappings +(load-from-path "qif-import/qif-to-gnc.scm") ;; conv QIF xtns to GNC +(load-from-path "qif-import/qif-merge-groups.scm") ;; merge into user's acct + +(export make-qif-file) +(export make-ticker-map) +(export qif-import:qif-to-gnc) +(export qif-import:get-all-accts) +(export qif-import:fix-from-acct) +(export qif-import:any-new-accts?) +(export qif-import:update-stock-hash) +(export qif-import:refresh-match-selection) +(export qif-import:save-map-prefs) +(export qif-import:load-map-prefs) + +(export qif-map-entry:gnc-name) +(export qif-map-entry:set-gnc-name!) +(export qif-map-entry:clone) +(export qif-map-entry:qif-name) +(export qif-map-entry:new-acct?) + +(export qif-file:read-file) +(export qif-file:parse-fields) +(export qif-file:check-from-acct) +(export qif-file:reparse-dates) +(export qif-file:check-from-acct) +(export qif-file:path-to-accountname) +(export qif-file:path) + +(export qif-dialog:qif-file-loaded?) +(export qif-dialog:unload-qif-file) +(export qif-dialog:make-account-display) +(export qif-dialog:make-category-display) +(export qif-dialog:make-memo-display) + +(export gnc:group-find-duplicates) +(export gnc:group-catenate-and-merge) +(export gnc:prune-matching-transactions) diff --git a/src/scm/qif-import/qif-merge-groups.scm b/src/import-export/qif-import/qif-merge-groups.scm similarity index 98% rename from src/scm/qif-import/qif-merge-groups.scm rename to src/import-export/qif-import/qif-merge-groups.scm index d70ca7c286..6084698ed9 100644 --- a/src/scm/qif-import/qif-merge-groups.scm +++ b/src/import-export/qif-import/qif-merge-groups.scm @@ -6,9 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-merge-groups.scm") -(gnc:depend "report-utilities.scm") - (define (gnc:group-get-transactions group) (let ((query (gnc:malloc-query)) (xtns #f)) diff --git a/src/scm/qif-import/qif-objects.scm b/src/import-export/qif-import/qif-objects.scm similarity index 99% rename from src/scm/qif-import/qif-objects.scm rename to src/import-export/qif-import/qif-objects.scm index a2a794491e..3ed95a27b3 100644 --- a/src/scm/qif-import/qif-objects.scm +++ b/src/import-export/qif-import/qif-objects.scm @@ -6,9 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-objects.scm") -(gnc:depend "qif-import/simple-obj.scm") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; qif-file class diff --git a/src/scm/qif-import/qif-parse.scm b/src/import-export/qif-import/qif-parse.scm similarity index 99% rename from src/scm/qif-import/qif-parse.scm rename to src/import-export/qif-import/qif-parse.scm index 3e20fc9b88..d1b3dda56f 100644 --- a/src/scm/qif-import/qif-parse.scm +++ b/src/import-export/qif-import/qif-parse.scm @@ -6,8 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;(gnc:support "qif-import/qif-parse.scm") - (define qif-category-compiled-rexp (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/?)([^\|]*)(\\|(\\[)?([^]/]*)(]?)(/?)(.*))? *$")) diff --git a/src/scm/qif-import/qif-to-gnc.scm b/src/import-export/qif-import/qif-to-gnc.scm similarity index 99% rename from src/scm/qif-import/qif-to-gnc.scm rename to src/import-export/qif-import/qif-to-gnc.scm index b4dcceaed8..9fff86e17f 100644 --- a/src/scm/qif-import/qif-to-gnc.scm +++ b/src/import-export/qif-import/qif-to-gnc.scm @@ -7,10 +7,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-to-gnc.scm") - -(gnc:depend "utilities.scm") - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; find-or-make-acct: ;; given a colon-separated account path, return an Account* to diff --git a/src/scm/qif-import/qif-utils.scm b/src/import-export/qif-import/qif-utils.scm similarity index 95% rename from src/scm/qif-import/qif-utils.scm rename to src/import-export/qif-import/qif-utils.scm index d81a5d6ab9..ec7931567f 100644 --- a/src/scm/qif-import/qif-utils.scm +++ b/src/import-export/qif-import/qif-utils.scm @@ -6,8 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/qif-utils.scm") - (define (simple-filter pred list) (let ((retval '())) (map (lambda (elt) @@ -64,4 +62,5 @@ (string->symbol (string-downcase (string-remove-leading-space - (string-remove-trailing-space str))))) \ No newline at end of file + (string-remove-trailing-space str))))) + diff --git a/src/gnome/glade/qif.glade b/src/import-export/qif-import/qif.glade similarity index 100% rename from src/gnome/glade/qif.glade rename to src/import-export/qif-import/qif.glade diff --git a/src/gnome/glade/qif_strings.c b/src/import-export/qif-import/qif_strings.c similarity index 100% rename from src/gnome/glade/qif_strings.c rename to src/import-export/qif-import/qif_strings.c diff --git a/src/scm/qif-import/simple-obj.scm b/src/import-export/qif-import/simple-obj.scm similarity index 97% rename from src/scm/qif-import/simple-obj.scm rename to src/import-export/qif-import/simple-obj.scm index 9204b2bf7b..e46e093b25 100644 --- a/src/scm/qif-import/simple-obj.scm +++ b/src/import-export/qif-import/simple-obj.scm @@ -6,8 +6,6 @@ ;;; $Id$ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -(gnc:support "qif-import/simple-obj.scm") - ;; this is an extremely rudimentary object system. Each object is a ;; cons cell, where the car is a symbol with the class name and the ;; cdr is a vector of the slots. diff --git a/src/import-export/qif-io-core/Makefile.am b/src/import-export/qif-io-core/Makefile.am new file mode 100644 index 0000000000..59e47a044e --- /dev/null +++ b/src/import-export/qif-io-core/Makefile.am @@ -0,0 +1,33 @@ +SUBDIRS=. test + +lib_LTLIBRARIES=libgncmod-qifiocore.la +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} + +INCLUDES = -I${top_srcdir}/src/gnc-module ${GUILE_INCS} + +libgncmod_qifiocore_la_SOURCES=gnc-qifiocore.c +libgncmod_qifiocore_la_LDFLAGS=-module + +noinst_DATA=.scm-links + +.scm-links: + rm -f gnucash import-export + ln -sf . gnucash + ln -sf . import-export + touch .scm-links + +gncscmmoddir=${GNC_SHAREDIR}/guile-modules/gnucash/import-export/ +gncscmmod_DATA=qif-io-core.scm + +gncscmdir=${GNC_SHAREDIR}/scm +gncscm_DATA=\ + qif-acct-table.scm \ + qif-bank-xtn-import.scm \ + qif-file.scm \ + qif-format-check.scm \ + qif-invst-xtn-import.scm \ + qif-objects.scm \ + qif-parse.scm \ + qif-record-xform.scm + +CLEANFILES += gnucash import-export .scm-links diff --git a/src/import-export/qif-io-core/README b/src/import-export/qif-io-core/README new file mode 100644 index 0000000000..8466d060fd --- /dev/null +++ b/src/import-export/qif-io-core/README @@ -0,0 +1,57 @@ +qif-io-core module: top-level docs +---------------------------------- + +The file: + +A QIF file is a line-oriented text file. A file consists of a series +of objects; each object is either a "bang switch" or a "record". + +A bang switch is a single line starting with the "!" character. + +A record is a set of newline-delimited tag-value pairs, terminated by +a line starting with "^". The tag is the first character of the line, +the value is the remainder of the line. + +There are several different types of records: bank transactions, +investment transactions, accounts, classes, categories, securities are +handled by this module. Currently unhandled are memorized +transactions and prices. + +Tests for reading and writing various kinds of records from sample +QIF files are in test/test-readwrite.scm. + +Interpreting the file: + +We read each "record" and convert it to a Scheme structure depending +on the record type. Type is determined by "bang switches" indicating +that the following records are of a certain type. + +qif-io:read-file reads records and converts them into the appropriate +Scheme data structure. All values are strings. + +current scheme (with qif-import module): + - translate strings to gnucash data types. transform transactions to + make them look more like they will look in gnucash (account types, + balance signs, etc) + - build the map of gnucash accounts and commodities + - eliminate duplicate transactions within the qif files + - translate to gnucash transactions + - eliminate duplicates within the gnucash files + +new plan: + - scan strings in transactions to make sure we know how to interpret + them + - build the map of gnucash accounts and commodities + - go to gnc transactions + - find matches within the gnc transaction set and eliminate them + automatically + - find matches between the new set and the existing one + +i.e. in the new scheme we do as little interpretation and editing as +possible in the qif realm. we translate to gnc transactions as early +as possible and work in that domain. If nothing else it will be +faster. It's also clearer because you know the QIF data structure +never contains anything except uninterpreted strings from the QIF +file. with the qif-import module you're never sure what's in those +slots. + diff --git a/src/import-export/qif-io-core/gncmod-qifiocore.c b/src/import-export/qif-io-core/gncmod-qifiocore.c new file mode 100644 index 0000000000..816f207057 --- /dev/null +++ b/src/import-export/qif-io-core/gncmod-qifiocore.c @@ -0,0 +1,58 @@ +/********************************************************************* + * gnc-mod-qifiocore.c + * module definition/initialization for the QIF i/o module + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include +#include +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/qif-io/core"); +} + +char * +gnc_module_description(void) { + return g_strdup("Core components of QIF import/export (non-GUI)"); +} + +int +gnc_module_init(void) { + /* load the engine (we depend on it) */ + if(!gnc_module_load("gnucash/engine", 0)) { + return FALSE; + } + + /* load the QIF Scheme code */ + if(gh_eval_str("(use-modules (gnucash qif-io core))") == + SCM_BOOL_F) { + return FALSE; + } + + return TRUE; +} + +void +gnc_module_on_load(void) { + /* load the engine (we depend on it) */ + gnc_module_load("gnucash/engine", 0); + gh_eval_str("(use-modules (gnucash qif-io core))"); +} + +void +gnc_module_finish(void) { + +} + diff --git a/src/import-export/qif-io-core/qif-acct-table.scm b/src/import-export/qif-io-core/qif-acct-table.scm new file mode 100644 index 0000000000..e4147de1b8 --- /dev/null +++ b/src/import-export/qif-io-core/qif-acct-table.scm @@ -0,0 +1,127 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-acct-table.scm +;;; handle tables of qif-to-gnucash account mappings +;;; +;;; Copyright (c) 2001 Linux Developers Group, Inc. +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:acct-table-lookup +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:acct-table-lookup table name type) + (case type + ((account) + (hash-ref (qif-io:acct-table-accounts table) name)) + ((category) + (hash-ref (qif-io:acct-table-categories table) name)) + ((security) + (hash-ref (qif-io:acct-table-securities table) name)) + ((brokerage) + (hash-ref (qif-io:acct-table-brokerage-accts table) name)) + (else + (throw 'qif-io:unknown-acct-type type)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:acct-table-insert! +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:acct-table-insert! table name type gnc-acct) + (case type + ((account) + (hash-set! (qif-io:acct-table-accounts table) name gnc-acct)) + ((category) + (hash-set! (qif-io:acct-table-categories table) name gnc-acct)) + ((security) + (hash-set! (qif-io:acct-table-securities table) name gnc-acct)) + ((brokerage) + (hash-set! (qif-io:acct-table-brokerage-accts table) name gnc-acct)) + (else + (throw 'qif-io:unknown-acct-type 'qif-io:acct-table-insert! type)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:acct-table-make-gnc-group +;; fill in information for the gnucash accounts and organize them +;; in a group tree +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:acct-table-make-gnc-group acct-table qif-file commodity) + (let ((group (gnc:malloc-account-group))) + ;; poke through the qif-file accounts to see if any of them + ;; show up in the data + (let ((qif-acct-table (qif-io:acct-table-accounts acct-table))) + (for-each + (lambda (qif-acct) + (let* ((name (qif-io:account-name qif-acct)) + (type (qif-io:account-type qif-acct)) + (desc (qif-io:account-description qif-acct)) + (gnc-acct (hash-ref qif-acct-table name))) + (if gnc-acct + (let ((gnc-type (qif-io:parse-acct-type type))) + (gnc:account-begin-edit gnc-acct) + (if gnc-type + (gnc:account-set-type gnc-acct gnc-type) + (gnc:account-set-type gnc-acct GNC-BANK-TYPE)) + (if desc + (gnc:account-set-description gnc-acct desc)) + (gnc:account-commit-edit gnc-acct))))) + (qif-io:file-accounts qif-file)) + + (hash-fold + (lambda (name acct p) + (let ((cmdty (gnc:account-get-commodity acct))) + (if (not cmdty) + (begin + (gnc:account-begin-edit acct) + (gnc:account-set-commodity acct commodity) + (gnc:account-commit-edit acct)))) + (let ((type (gnc:account-get-type acct))) + (if (= type -1) + (gnc:account-set-type acct GNC-BANK-TYPE))) + (gnc:group-insert-account group acct) + #t) #t (qif-io:acct-table-accounts acct-table))) + + ;; now the categories + (let ((qif-cat-table (qif-io:acct-table-categories acct-table))) + ;; poke through the qif-file accounts to see if any of them + ;; show up in the data + (for-each + (lambda (qif-cat) + (let* ((name (qif-io:category-name qif-cat)) + (income? (qif-io:category-income-cat qif-cat)) + (desc (qif-io:category-description qif-cat)) + (gnc-acct (hash-ref qif-cat-table name))) + (if gnc-acct + (begin + (gnc:account-begin-edit gnc-acct) + (cond (income? + (gnc:account-set-type gnc-acct GNC-INCOME-TYPE)) + (#t + (gnc:account-set-type gnc-acct GNC-EXPENSE-TYPE))) + (gnc:account-set-description gnc-acct desc) + (gnc:account-commit-edit gnc-acct))))) + (qif-io:file-categories qif-file)) + + (hash-fold + (lambda (name acct p) + (let ((cmdty (gnc:account-get-commodity acct))) + (if (not cmdty) + (begin + (gnc:account-begin-edit acct) + (gnc:account-set-commodity acct commodity) + (gnc:account-commit-edit acct)))) + (let ((type (gnc:account-get-type acct))) + (if (= type -1) + (gnc:account-set-type acct GNC-EXPENSE-TYPE))) + (gnc:group-insert-account group acct) + #t) #t (qif-io:acct-table-categories acct-table))) + + ;; the securities + + ;; the other brokerage-related accounts + + group)) diff --git a/src/import-export/qif-io-core/qif-bank-xtn-import.scm b/src/import-export/qif-io-core/qif-bank-xtn-import.scm new file mode 100644 index 0000000000..749ae725c4 --- /dev/null +++ b/src/import-export/qif-io-core/qif-bank-xtn-import.scm @@ -0,0 +1,147 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-bank-xtn-import.scm +;;; routines for converting a QIF bank-type transaction to a gnc +;;; transaction +;;; +;;; Copyright (c) 2001 Linux Developers Group, Inc. +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:bank-xtn-opening-bal-acct +;; if this is an "opening balance" transaction, return the +;; account name from the transfer field +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:bank-xtn-opening-bal-acct qif-xtn) + (let ((payee (qif-io:bank-xtn-payee qif-xtn))) + (if (and (string? payee) + (string-ci=? payee "Opening Balance")) + (let ((category (qif-io:bank-xtn-category qif-xtn))) + (if (string? category) + (let ((parsed-cat (qif-io:parse-category category))) + (if (list-ref parsed-cat 1) + (car parsed-cat) + #f)) + #f)) + #f))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:bank-xtn-import +;; translate a single bank transaction into a GNC transaction +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:bank-xtn-import qif-xtn qif-file gnc-acct-info commodity) + (let* ((format-info + (qif-io:file-bank-xtn-format qif-file)) + (gnc-xtn (gnc:transaction-create)) + (near-split-amt + ;; the u-amount has a larger range and is more correct, + ;; but is optional + (let ((uamt (qif-io:bank-xtn-u-amount qif-xtn))) + (if uamt + (qif-io:parse-number/format + uamt (qif-io:bank-xtn-u-amount format-info)) + (qif-io:parse-number/format + (qif-io:bank-xtn-t-amount qif-xtn) + (qif-io:bank-xtn-t-amount format-info)))))) + + ;; utility to make a new split and add it both to an + ;; account and to the transaction + (define (add-split acct-info amount memo reconcile) + (let* ((acct-name (car acct-info)) + (acct-type (cdr acct-info)) + (acct (qif-io:acct-table-lookup + gnc-acct-info acct-name acct-type)) + (split (gnc:split-create))) + ;; make the account if necessary + (if (not acct) + (begin + (set! acct (gnc:malloc-account)) + (gnc:account-begin-edit acct) + (gnc:account-set-name acct acct-name) + (gnc:account-commit-edit acct) + (qif-io:acct-table-insert! gnc-acct-info + acct-name acct-type acct))) + ;; fill in the split + (gnc:split-set-amount split amount) + (gnc:split-set-value split amount) + (gnc:split-set-memo split memo) + (gnc:split-set-reconcile split reconcile) + + ;; add it to the account and the transaction + (gnc:account-begin-edit acct) + (gnc:account-insert-split acct split) + (gnc:account-commit-edit acct) + (gnc:transaction-append-split gnc-xtn split) + split)) + + (gnc:transaction-begin-edit gnc-xtn) + (gnc:transaction-set-commodity gnc-xtn commodity) + + ;; set the transaction date, number and description + (let ((date (qif-io:parse-date/format + (qif-io:bank-xtn-date qif-xtn) + (qif-io:bank-xtn-date format-info)))) + (apply gnc:transaction-set-date gnc-xtn date)) + + (gnc:transaction-set-xnum gnc-xtn (qif-io:bank-xtn-number qif-xtn)) + (gnc:transaction-set-description gnc-xtn (qif-io:bank-xtn-payee qif-xtn)) + + ;; create the near split (the one that goes to the source-acct) + (let* ((near-acct-name (qif-io:bank-xtn-source-acct qif-xtn))) + (if (not near-acct-name) + (set! near-acct-name (qif-io:file-default-src-acct qif-file))) + (add-split (cons near-acct-name 'account) near-split-amt + (qif-io:bank-xtn-memo qif-xtn) + (qif-io:parse-cleared-field + (qif-io:bank-xtn-cleared qif-xtn)))) + + ;; create any far splits. If no "S" splits were specified, + ;; make a magic mirroring split. + (let ((qif-splits (qif-io:bank-xtn-splits qif-xtn))) + (if (or (not (list? qif-splits)) (null? qif-splits)) + ;; common case: no splits are specified. Make one with the + ;; appropriate category and an amount that's the opposite of + ;; the near-split amount. Reuse the memo. + (let* ((category (qif-io:bank-xtn-category qif-xtn)) + (parsed-cat + (if category (qif-io:parse-category category) #f)) + (acct-name + (if parsed-cat (list-ref parsed-cat 0) #f)) + (acct-is-acct + (if parsed-cat (list-ref parsed-cat 1) #f))) + (add-split (cons acct-name + (if acct-is-acct 'account 'category)) + (gnc:numeric-neg near-split-amt) + (qif-io:bank-xtn-memo qif-xtn) #\n)) + + ;; split case: iterate over a list of qif splits and make a + ;; separate far-end split for each. + (let ((amt-format + (qif-io:split-amount + (car (qif-io:bank-xtn-splits format-info))))) + (for-each + (lambda (split) + (let* ((category (qif-io:split-category split)) + (parsed-cat + (if category (qif-io:parse-category category) #f)) + (acct-name + (if parsed-cat (list-ref parsed-cat 0) #f)) + (acct-is-acct + (if parsed-cat (list-ref parsed-cat 1) #f)) + (amount + (qif-io:parse-number/format + (qif-io:split-amount split) amt-format))) + (add-split (cons acct-name + (if acct-is-acct 'account 'category)) + (gnc:numeric-neg amount) + (qif-io:split-memo split) #\n))) + qif-splits)))) + + ;; we're done. + (gnc:transaction-commit-edit gnc-xtn) + gnc-xtn)) + diff --git a/src/import-export/qif-io-core/qif-file.scm b/src/import-export/qif-io-core/qif-file.scm new file mode 100644 index 0000000000..043198ecc5 --- /dev/null +++ b/src/import-export/qif-io-core/qif-file.scm @@ -0,0 +1,402 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-file.scm +;;; read a QIF file into a object +;;; +;;; Copyright (c) 2001 Linux Developers Group +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(debug-enable 'debug) +(debug-enable 'backtrace) + +(define end-of-line (string #\cr #\nl)) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:read-record +;; this reads a "record", which is a block of tag-value lines ended +;; by a line starting with "^". A line starting with "!" generates +;; an exception. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:read-record port) + (if (not (input-port? port)) + (throw 'qif-io:arg-type 'input-port port)) + + (let ((byte-count 0) + (eof? #f) + (record '())) + (let line-loop ((line (read-delimited end-of-line port))) + (if (and (string? line) + (not (string=? line ""))) + (let ((tag (string-ref line 0)) + (value (make-shared-substring line 1))) + (set! byte-count (+ (string-length line) byte-count)) + (case tag + ((#\^) #t) + ((#\!) + (throw 'qif-io:parser-state value)) + (else + (set! record (cons (cons tag value) record)) + (line-loop (read-delimited end-of-line port))))) + (if (eof-object? line) + (set! eof? #t) + (if (not (string? line)) + (throw 'qif-io:record-error 'qif-io:read-record line) + (line-loop (read-delimited end-of-line port)))))) + (list (reverse record) byte-count eof?))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:write-record pairs port +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:write-record record-pairs port) + (if (not (list? record-pairs)) + (throw 'qif-io:arg-type 'list record-pairs)) + (if (not (output-port? port)) + (throw 'qif-io:arg-type 'output-port port)) + (for-each + (lambda (kvp) + (simple-format port "~A~A\n" (car kvp) (cdr kvp))) + record-pairs) + (simple-format port "^\n")) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:read-file path +;; suck in all the transactions; don't do any string interpretation, +;; just store the fields "raw". +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:read-file file-obj path progress-thunk) + (define (string-prune arg) + (string-remove-trailing-space arg)) + + (if (not (string? path)) + (throw 'qif-io:arg-type 'string path)) + + (let* ((port + (catch #t + (lambda () + (open-input-file path)) + (lambda (tag . args) + (throw 'qif-io:file-error path)))) + (file-stats (stat path)) + (file-size (stat:size file-stats)) + (bytes-read 0) + (exception #f) + (record #f) + (record-info #f) + (record-type #f) + (bank-xtns '()) + (invst-xtns '()) + (accounts '()) + (classes '()) + (categories '()) + (securities '()) + (autoswitch #t) + (autoswitch-acct #f) + (opening-bal-acct #f) + (some-bank-need-src-acct #f) + (some-invst-need-src-acct #f)) + (let record-loop () + (catch #t + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; record processor + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (lambda () + ;; read the record + (set! record-info (qif-io:read-record port)) + (set! record (car record-info)) + (set! bytes-read (+ bytes-read (cadr record-info))) + (if (procedure? progress-thunk) + (progress-thunk bytes-read file-size)) + + ;; convert it to the relevant struct + (if (not (null? record)) + (case record-type + ;; bank transactions + ((bank-xtn) + (let ((xtn (qif-io:record->bank-xtn record))) + (if autoswitch-acct + (qif-io:bank-xtn-set-source-acct! + xtn autoswitch-acct) + ;; the Opening Balance transaction is special. + ;; if there's no autoswitch account set, the OB + ;; will set it. But beware because it doesn't + ;; have to be the first xtn. + (let ((obacct + (qif-io:bank-xtn-opening-bal-acct xtn))) + (if obacct + (begin + (qif-io:bank-xtn-set-source-acct! + xtn obacct) + (set! autoswitch-acct obacct) + (set! opening-bal-acct obacct)) + (set! some-bank-need-src-acct #t)))) + (set! bank-xtns (cons xtn bank-xtns)))) + + ;; investment transactions + ((invst-xtn) + (let ((xtn (qif-io:record->invst-xtn record))) + (if autoswitch-acct + (qif-io:invst-xtn-set-source-acct! + xtn autoswitch-acct) + (set! some-invst-need-src-acct #t)) + (set! invst-xtns (cons xtn invst-xtns)))) + + ;; account records + ((account) + (let ((account (qif-io:record->account record))) + (if autoswitch + (set! autoswitch-acct + (qif-io:account-name account)) + (set! accounts (cons account accounts))))) + + ;; class records + ((class) + (set! classes + (cons (qif-io:record->class record) + classes))) + + ;; category records + ((category) + (set! categories + (cons (qif-io:record->category record) + categories))) + + ;; anything we don't know about + ((unknown) #t) + (else + (throw 'qif-io:format-error path record-type))))) + + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + ;; record exception handler + ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + (lambda (key . args) + (set! exception #t) + (case key + ;; when the parser sees a ! line, it throws this + ;; exception + ((qif-io:parser-state) + (let ((new-state (string-prune (car args)))) + (cond ((or (string-ci=? new-state "type:bank") + (string-ci=? new-state "type:cash") + (string-ci=? new-state "type:ccard") + (string-ci=? new-state "type:oth a") + (string-ci=? new-state "type:oth l")) + (set! record-type 'bank-xtn)) + ((or (string-ci=? new-state "type:invst") + (string-ci=? new-state "type:port")) + (set! record-type 'invst-xtn)) + ((string-ci=? new-state "account") + (set! record-type 'account)) + ((string-ci=? new-state "type:class") + (set! record-type 'class)) + ((string-ci=? new-state "type:cat") + (set! record-type 'category)) + ((string-ci=? new-state "type:security") + (set! record-type 'security)) + ((string-ci=? new-state "option:autoswitch") + (set! autoswitch #f)) + ((string-ci=? new-state "clear:autoswitch") + (set! autoswitch #t)) + (#t + (set! record-type 'unknown))))) + ((qif-io:record-error) + (simple-format #t "record processing error ~S\n" args)) + (else + (apply throw key args))))) + + ;; third element of record-info tells whether an eof was + ;; encountered + (if (or exception (and (list? record-info) (not (caddr record-info)))) + (begin + (set! exception #f) + (record-loop)))) + + ;; if any bank transactions don't have a source account, we need + ;; to set it for them (if we found an Opening Balance record) or + ;; set a flag in the file struct so that we can ask the user. + + (if some-bank-need-src-acct + (if opening-bal-acct + (begin + (for-each + (lambda (xtn) + (if (not (qif-io:bank-xtn-src-acct xtn)) + (qif-io:bank-xtn-set-src-acct! xtn opening-bal-acct))) + bank-xtns) + (set! some-bank-need-src-acct #f)))) + (if (or some-bank-need-src-acct some-invst-need-src-acct) + (qif-io:file-set-xtns-need-acct?! file-obj #t)) + + ;; done reading all the records. fill in the qif-file object. + (qif-io:file-set-bank-xtns! file-obj (reverse bank-xtns)) + (qif-io:file-set-invst-xtns! file-obj (reverse invst-xtns)) + (qif-io:file-set-accounts! file-obj (reverse accounts)) + (qif-io:file-set-categories! file-obj (reverse categories)) + (qif-io:file-set-classes! file-obj (reverse classes)) + (qif-io:file-set-securities! file-obj (reverse securities)) + #t)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:write-file file-obj path +;; write a out. all objects must have fields in +;; string form. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:write-file qif-obj path) + (if (not (string? path)) + (throw 'qif-io:arg-type 'string path)) + (if (not (qif-io:file? qif-obj)) + (throw 'qif-io:arg-type 'qif-io:file qif-obj)) + + (let ((port (open-output-file path)) + (accts (qif-io:file-accounts qif-obj)) + (cats (qif-io:file-categories qif-obj)) + (classes (qif-io:file-classes qif-obj)) + (bank-xtns (qif-io:file-bank-xtns qif-obj)) + (invst-xtns (qif-io:file-invst-xtns qif-obj))) + + ;; write out the list of "classes" (user tags on transactions... + ;; these will be dummies since Gnucash doesn't do tags the same + ;; way) + (if (not (null? classes)) + (begin + (simple-format port "!Type:Class\n") + (for-each + (lambda (class) + (qif-io:write-record (qif-io:class->record class) port)) + classes))) + + ;; write out the list of "categories" (income and expense + ;; accounts) + (if (not (null? cats)) + (begin + (simple-format port "!Type:Cat\n") + (for-each + (lambda (cat) + (qif-io:write-record (qif-io:category->record cat) port)) + cats))) + + ;; write out the list of "accounts" (asset and liability + ;; accounts) + (if (not (null? accts)) + (begin + (simple-format port "!Option:Autoswitch\n") + (simple-format port "!Account\n") + (for-each + (lambda (acct) + (qif-io:write-record (qif-io:account->record acct) port)) + accts) + (simple-format port "!Clear:Autoswitch\n"))) + + ;; write out bank transactions. Make sure to preface each + ;; section with the source-account record. + (if (not (null? bank-xtns)) + (let ((this-acct '()) + (not-this-acct '())) + ;; first write out all the transactions that don't have + ;; a source-acct string + (for-each + (lambda (xtn) + (if (not (string? (qif-io:bank-xtn-source-acct xtn))) + (set! this-acct (cons xtn this-acct)) + (set! not-this-acct (cons xtn not-this-acct)))) + bank-xtns) + (if (not (null? this-acct)) + (begin + (simple-format port "!Type:Bank\n") + (for-each + (lambda (xtn) + (qif-io:write-record (qif-io:bank-xtn->record xtn) port)) + this-acct))) + (set! bank-xtns (reverse not-this-acct)) + (set! this-acct '()) + (set! not-this-acct '()) + + ;; iterate over accounts, writing out all the bank xtns + ;; that are in that account + (for-each + (lambda (acct) + (for-each + (lambda (xtn) + (if (and (string? (qif-io:bank-xtn-source-acct xtn)) + (string=? (qif-io:account-name acct) + (qif-io:bank-xtn-source-acct xtn))) + (set! this-acct (cons xtn this-acct)) + (set! not-this-acct (cons xtn not-this-acct)))) + bank-xtns) + (if (not (null? this-acct)) + (begin + (simple-format port "!Account\n") + (qif-io:write-record (qif-io:account->record acct) port) + (simple-format port "!Type:~A\n" + (qif-io:account-type acct)) + (set! this-acct (reverse this-acct)) + (for-each + (lambda (xtn) + (qif-io:write-record (qif-io:bank-xtn->record xtn) + port)) + this-acct))) + (set! bank-xtns (reverse not-this-acct)) + (set! this-acct '()) + (set! not-this-acct '())) + accts))) + + ;; write out invst transactions. Make sure to preface each + ;; section with the source-account record. + (if (not (null? invst-xtns)) + (let ((this-acct '()) + (not-this-acct '())) + ;; first write out all the transactions that don't have + ;; a source-acct string + (for-each + (lambda (xtn) + (if (not (string? (qif-io:invst-xtn-source-acct xtn))) + (set! this-acct (cons xtn this-acct)) + (set! not-this-acct (cons xtn not-this-acct)))) + invst-xtns) + (if (not (null? this-acct)) + (begin + (simple-format port "!Type:Invst\n") + (for-each + (lambda (xtn) + (qif-io:write-record (qif-io:invst-xtn->record xtn) port)) + this-acct))) + (set! invst-xtns (reverse not-this-acct)) + (set! this-acct '()) + (set! not-this-acct '()) + + ;; iterate over accounts, writing out all the invst xtns + ;; that are in that account + (for-each + (lambda (acct) + (for-each + (lambda (xtn) + (if (and (string? (qif-io:invst-xtn-source-acct xtn)) + (string=? (qif-io:account-name acct) + (qif-io:invst-xtn-source-acct xtn))) + (set! this-acct (cons xtn this-acct)) + (set! not-this-acct (cons xtn not-this-acct)))) + invst-xtns) + (if (not (null? this-acct)) + (begin + (simple-format port "!Account\n") + (qif-io:write-record (qif-io:account->record acct) port) + (simple-format port "!Type:~A\n" + (qif-io:account-type acct)) + (set! this-acct (reverse this-acct)) + (for-each + (lambda (xtn) + (qif-io:write-record (qif-io:invst-xtn->record xtn) + port)) + this-acct))) + (set! invst-xtns (reverse not-this-acct)) + (set! this-acct '()) + (set! not-this-acct '())) + accts))) + (close-output-port port))) + diff --git a/src/import-export/qif-io-core/qif-format-check.scm b/src/import-export/qif-io-core/qif-format-check.scm new file mode 100644 index 0000000000..c6b4d5037d --- /dev/null +++ b/src/import-export/qif-io-core/qif-format-check.scm @@ -0,0 +1,231 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-format-check.scm +;;; scan a set of QIF data records to try to guess how to +;;; interpret number and date fields +;;; +;;; Copyright (c) 2001 Linux Developers Group +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:file-setup-data-formats file +;; +;; we try to find a unique data format for all the relevant fields. +;; if that fails, we throw an exception with a continuation proc that +;; allows us to resume work. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:setup-data-formats file) + ;; first: narrow down the possible field formats + (qif-io:check-possible-formats file) + + ;; then: make sure there's exactly one format per slot. + (let ((invst-format-info (qif-io:file-invst-xtn-format file)) + (invst-field-info + (list (list qif-io:invst-xtn-date + qif-io:invst-xtn-set-date! "Date" 'date) + (list qif-io:invst-xtn-t-amount + qif-io:invst-xtn-set-t-amount! "Total" 'amount) + (list qif-io:invst-xtn-u-amount + qif-io:invst-xtn-set-u-amount! "UTotal" 'amount) + (list qif-io:invst-xtn-$-amount + qif-io:invst-xtn-set-$-amount! "$Total" 'amount) + (list qif-io:invst-xtn-share-amount + qif-io:invst-xtn-set-share-amount! "Num Shares" 'amount) + (list qif-io:invst-xtn-share-price + qif-io:invst-xtn-set-share-price! "Share Price" 'amount) + (list qif-io:invst-xtn-commission + qif-io:invst-xtn-set-commission! "Commission" 'amount))) + (bank-format-info (qif-io:file-bank-xtn-format file)) + (bank-field-info + (list (list qif-io:bank-xtn-date + qif-io:bank-xtn-set-date! "Date" 'date) + (list qif-io:bank-xtn-t-amount + qif-io:bank-xtn-set-t-amount! "Total" 'amount) + (list qif-io:bank-xtn-u-amount + qif-io:bank-xtn-set-u-amount! "UTotal" 'amount) + (list (lambda (format-xtn) + (let ((splits (qif-io:bank-xtn-splits format-xtn))) + (qif-io:split-amount (car splits)))) + (lambda (format-xtn format-obj) + (let ((splits (qif-io:bank-xtn-splits format-xtn))) + (qif-io:split-set-amount! (car splits) format-obj))) + "Split total" 'amount)))) + + ;; 'format-info' is some object. 'field-info' tells us how to get + ;; and set its fields. next-proc tells us what to do when we + ;; finish. + (define (do-xtn-format format-info field-info next-proc) + (let loop ((fields field-info)) + (let* ((this-field (car fields)) + (getter (car this-field)) + (setter (cadr this-field)) + (field-name (caddr this-field)) + (field-type (cadddr this-field)) + (formats (getter format-info))) + (cond + ((null? formats) + (throw 'qif-io:inconsistent-data-format field-name)) + ((not (list? formats)) + (if (not (null? (cdr fields))) (loop (cdr fields)))) + ((null? (cdr formats)) + (setter format-info (car formats)) + (if (not (null? (cdr fields))) (loop (cdr fields)))) + (#t + ;; if there are multiple possible formats, throw an + ;; exception. the catcher should determine which of + ;; 'formats' is correct and call the thunk with it as an + ;; arg. + (throw 'qif-io:ambiguous-data-format field-type field-name formats + (lambda (correct-format) + (setter format-info correct-format) + (if (not (null? (cdr fields))) (loop (cdr fields))) + (next-proc))))))) + ;; we call next-proc here if there was no exception during the + ;; normal loop execution. + (next-proc)) + + ;; do the work. We pass the investment format processing as a + ;; continuation-proc so that it gets done no matter how we get out + ;; of the loop in do-xtn-format + (do-xtn-format + bank-format-info bank-field-info + (lambda () + (do-xtn-format + invst-format-info invst-field-info + (lambda () #t)))))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; check-field-formats +;; this is is the engine that runs all the format tests on the qif +;; transactions. we apply the 'checker' to the value returned by the +;; 'getter' for each object. we successively narrow 'formats' as we +;; go along. If there are no non-#f elements to check we return +;; #f +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (check-field-formats getter equiv-thunk checker formats objects) + (let ((good-formats formats) + (records-checked #f)) + ;; loop over objects. If the formats list ever gets empty + ;; we can stop right there. + (if (not (null? objects)) + (let loop ((current (car objects)) + (rest (cdr objects))) + (let ((val (getter current))) + (if val + (begin + (set! records-checked #t) + (set! good-formats (checker val good-formats))))) + (if (and (not (null? good-formats)) + (not (null? rest))) + (loop (car rest) (cdr rest))))) + + ;; we're done. Return the formats that work for all the values. + (if records-checked good-formats #f))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; check-possible-formats builds the file's format objects for +;; investment and bank transactions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:check-possible-formats file) + (let ((bank-formats (qif-io:make-empty-bank-xtn))) + ;; bank transactions + (qif-io:bank-xtn-set-date! + bank-formats + (check-field-formats + qif-io:bank-xtn-date equal? + qif-io:check-date-format '(m-d-y d-m-y y-m-d y-d-m) + (qif-io:file-bank-xtns file))) + + (qif-io:bank-xtn-set-t-amount! + bank-formats + (check-field-formats + qif-io:bank-xtn-t-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-bank-xtns file))) + + (qif-io:bank-xtn-set-u-amount! + bank-formats + (check-field-formats + qif-io:bank-xtn-u-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-bank-xtns file))) + + (let ((split (qif-io:make-empty-split))) + (define (get-split-amounts xtn) + (map (lambda (split) + (qif-io:split-amount split)) + (qif-io:bank-xtn-splits xtn))) + (qif-io:split-set-amount! + split + (check-field-formats + get-split-amounts gnc:numeric-equal + qif-io:check-multi-number-format '(decimal comma) + (qif-io:file-bank-xtns file))) + (qif-io:bank-xtn-set-splits! bank-formats (list split))) + + ;; stuff the formats into the file + (qif-io:file-set-bank-xtn-format! file bank-formats)) + + (let ((invst-formats (qif-io:make-empty-invst-xtn))) + ;; invst transactions + (qif-io:invst-xtn-set-date! + invst-formats + (check-field-formats + qif-io:invst-xtn-date equal? + qif-io:check-date-format '(m-d-y d-m-y y-m-d y-d-m) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-t-amount! + invst-formats + (check-field-formats + qif-io:invst-xtn-t-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-u-amount! + invst-formats + (check-field-formats + qif-io:invst-xtn-u-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-$-amount! + invst-formats + (check-field-formats + qif-io:invst-xtn-$-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-share-amount! + invst-formats + (check-field-formats + qif-io:invst-xtn-share-amount gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-share-price! + invst-formats + (check-field-formats + qif-io:invst-xtn-share-price gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + (qif-io:invst-xtn-set-commission! + invst-formats + (check-field-formats + qif-io:invst-xtn-commission gnc:numeric-equal + qif-io:check-number-format '(decimal comma) + (qif-io:file-invst-xtns file))) + + ;; stuff the formats into the file + (qif-io:file-set-invst-xtn-format! file invst-formats))) + + + + + diff --git a/src/import-export/qif-io-core/qif-invst-xtn-import.scm b/src/import-export/qif-io-core/qif-invst-xtn-import.scm new file mode 100644 index 0000000000..de46b42cfd --- /dev/null +++ b/src/import-export/qif-io-core/qif-invst-xtn-import.scm @@ -0,0 +1,315 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-invst-xtn-import.scm +;;; routines for converting a QIF investment transaction to a gnc +;;; transaction +;;; +;;; Copyright (c) 2001 Linux Developers Group, Inc. +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; account name generators. these are changeable by the user during +;; the mapping phase but you have to start somewhere. + +(define (default-stock-acct brokerage security) + (string-append brokerage ":" security)) + +(define (default-dividend-acct brokerage security) + (string-append (_ "Dividends") ":" + brokerage ":" + security)) + +(define (default-interest-acct brokerage security) + (string-append (_ "Interest") ":" + brokerage ":" + security)) + +(define (default-capital-return-acct brokerage security) + (string-append (_ "Cap Return") ":" + brokerage ":" + security)) + +(define (default-cglong-acct brokerage security) + (string-append (_ "Cap. gain (long)") ":" + brokerage ":" + security)) + +(define (default-cgmid-acct brokerage security) + (string-append (_ "Cap. gain (mid)") ":" + brokerage ":" + security)) + +(define (default-cgshort-acct brokerage security) + (string-append (_ "Cap. gain (short)") ":" + brokerage ":" + security)) + +(define (default-equity-holding security) (_ "Retained Earnings")) + +(define (default-equity-account) (_ "Retained Earnings")) + +(define (default-commission-acct brokerage) + (string-append (_ "Commissions") ":" + brokerage)) + +(define (default-margin-interest-acct brokerage) + (string-append (_ "Margin Interest") ":" + brokerage)) + +(define (default-unspec-acct) + (_ "Unspecified")) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; (qif-io:invst-xtn-accounts-affected xtn) +;; What accounts are affected by the transaction? it depends on +;; the 'action' field. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:invst-xtn-accounts-affected xtn) + (let* ((near-acct #f) + (far-acct #f) + (security (qif-io:invst-xtn-security xtn)) + (action (qif-io:parse-action-field (qif-io:invst-xtn-action xtn))) + (from-acct (qif-io:invst-xtn-source-acct xtn)) + (category (qif-io:invst-xtn-category xtn)) + (parsed-cat + (if category (qif-io:parse-category category) + (list "" #f #f #f #f #f)))) + + ;; the "near split", i.e. the split that would normally go to the + ;; source account. + (case action + ((buy buyx sell sellx reinvint reinvdiv reinvsg reinvsh + reinvlg reinvmd shrsin shrsout stksplit) + (set! near-acct + (cons (default-stock-acct from-acct security) 'security))) + ((div cgshort cglong cgmid intinc miscinc miscexp + rtrncap margint xin xout) + (set! near-acct (cons from-acct 'account))) + ((divx cgshortx cglongx cgmidx intincx rtrncapx margintx) + (set! near-acct + (cons (car parsed-cat) + (if (list-ref parsed-cat 1) 'account 'category)))) + ((miscincx miscexpx) + (set! near-acct + (cons (list-ref parsed-cat 3) + (if (list-ref parsed-cat 4) 'account 'category)))) + (else + (throw 'qif-io:unhandled-action action))) + + ;; the far split: where is the money coming from? Either the + ;; brokerage account, the category, or an external account + (case action + ((buy sell) + (set! far-acct + (cons from-acct 'account))) + ((buyx sellx miscinc miscincx miscexp miscexpx xin xout) + (set! far-acct + (cons (list-ref parsed-cat 0) + (if (list-ref parsed-cat 1) 'account 'category)))) + ((stksplit) + (set! far-acct + (cons (default-stock-acct from-acct security) 'security))) + ((cgshort cgshortx reinvsg reinvsh) + (set! far-acct + (cons (default-cgshort-acct from-acct security) 'brokerage))) + ((cglong cglongx reinvlg) + (set! far-acct + (cons (default-cglong-acct from-acct security) 'brokerage))) + ((cgmid cgmidx reinvmd) + (set! far-acct + (cons (default-cgmid-acct from-acct security) 'brokerage))) + ((intinc intincx reinvint) + (set! far-acct + (cons (default-interest-acct from-acct security) 'brokerage))) + ((margint margintx) + (set! far-acct + (cons (default-margin-interest-acct from-acct) 'brokerage))) + ((rtrncap rtrncapx) + (set! far-acct + (cons (default-return-capital-acct from-acct) 'brokerage))) + ((div divx reinvdiv) + (set! far-acct + (cons (default-dividend-acct from-acct security) 'brokerage))) + ((shrsin shrsout) + (set! far-acct + (cons (default-equity-holding security) 'account))) + (else + (throw 'qif-io:unhandled-action action))) + + (list near-acct far-acct (default-commission-acct from-acct)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:invst-xtn-import +;; translate a single invst transaction into a GNC transaction +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:invst-xtn-import qif-xtn qif-file gnc-acct-info commodity) + (let ((gnc-xtn (gnc:transaction-create)) + (format-info (qif-io:file-invst-xtn-format qif-file))) + ;; utility to make a new split and add it both to an + ;; account and to the transaction + (define (add-split acct-info amount value memo reconcile) + (let* ((acct-name (car acct-info)) + (acct-type (cdr acct-info)) + (acct (qif-io:acct-table-lookup + gnc-acct-info acct-name acct-type)) + (split (gnc:split-create))) + ;; make the account if necessary + (if (not acct) + (begin + (set! acct (gnc:malloc-account)) + (gnc:account-set-name acct acct-name) + (qif-io:acct-table-insert! gnc-acct-info + acct-name acct-type acct))) + ;; fill in the split + (gnc:split-set-amount split amount) + (gnc:split-set-value split value) + (gnc:split-set-memo split memo) + (gnc:split-set-reconcile split reconcile) + + ;; add it to the account and the transaction + (gnc:account-begin-edit acct) + (gnc:account-insert-split acct split) + (gnc:account-commit-edit acct) + (gnc:transaction-append-split gnc-xtn split) + split)) + + (define (lookup-balance acct-info) + (let ((acct (qif-io:acct-table-lookup gnc-acct-info + (car acct-info) (cdr acct-info)))) + (gnc:account-get-balance acct))) + + (if (not (qif-io:invst-xtn-source-acct qif-xtn)) + (qif-io:invst-xtn-set-source-acct! + qif-xtn (qif-io:file-default-src-acct qif-file))) + + (gnc:transaction-begin-edit gnc-xtn) + (gnc:transaction-set-commodity gnc-xtn commodity) + + ;; set the transaction date, number and description + (let ((date (qif-io:parse-date/format + (qif-io:invst-xtn-date qif-xtn) + (qif-io:invst-xtn-date format-info)))) + (apply gnc:transaction-set-date gnc-xtn date)) + + (gnc:transaction-set-xnum gnc-xtn (qif-io:invst-xtn-action qif-xtn)) + (gnc:transaction-set-description gnc-xtn (qif-io:invst-xtn-payee qif-xtn)) + + ;; get the relevant info, including 'near-acct' and 'far-acct', + ;; the accounts affected by the transaction + (let* ((action + (qif-io:parse-action-field (qif-io:invst-xtn-action qif-xtn))) + (num-shares + (let ((val (qif-io:invst-xtn-share-amount qif-xtn))) + (if val + (qif-io:parse-number/format + val (qif-io:invst-xtn-share-amount format-info)) + #f))) + (share-price + (let ((val (qif-io:invst-xtn-share-price qif-xtn))) + (if val + (qif-io:parse-number/format + val (qif-io:invst-xtn-share-price format-info)) + #f))) + (commission-val + (let ((val (qif-io:invst-xtn-commission qif-xtn))) + (if val + (qif-io:parse-number/format + val (qif-io:invst-xtn-commission format-info)) + #f))) + (total-val + (let ((uamt (qif-io:invst-xtn-u-amount qif-xtn)) + (tamt (qif-io:invst-xtn-t-amount qif-xtn)) + ($amt (qif-io:invst-xtn-$-amount qif-xtn))) + (cond + (uamt + (qif-io:parse-number/format + uamt (qif-io:invst-xtn-u-amount format-info))) + (tamt + (qif-io:parse-number/format + tamt (qif-io:invst-xtn-t-amount format-info))) + ($amt + (qif-io:parse-number/format + $amt (qif-io:invst-xtn-$-amount format-info))) + (#t (gnc:numeric-zero))))) + (action-val + (if (and num-shares share-price) + (gnc:numeric-mul num-shares share-price + (gnc:numeric-denom total-val) + GNC-RND-ROUND) + (gnc:numeric-zero))) + (cleared + (qif-io:parse-cleared-field (qif-io:invst-xtn-cleared qif-xtn))) + (payee (qif-io:invst-xtn-payee qif-xtn)) + (memo (qif-io:invst-xtn-memo qif-xtn)) + (accounts-affected + (qif-io:invst-xtn-accounts-affected qif-xtn)) + (near-acct (car accounts-affected)) + (far-acct (cadr accounts-affected)) + (commission-acct + (cons (default-commission-acct + (qif-io:invst-xtn-source-acct qif-xtn)) 'brokerage)) + (n- (lambda (n) (gnc:numeric-neg n)))) + + ;; now build the splits. We have to switch on the action + ;; again to get the signs of the amounts, and whether we use the + ;; monetary value or share count. + (case action + ((buy buyx reinvint reinvdiv reinvsg reinvsh reinvmd reinvlg) + (add-split near-acct num-shares action-val memo cleared) + (add-split far-acct (n- total-val) (n- total-val) memo cleared) + (if commission-val + (add-split commission-acct commission-val commission-val + memo cleared))) + + ((sell sellx) + (add-split near-acct (n- num-shares) (n- action-val) memo cleared) + (add-split far-acct total-val total-val memo cleared) + (if commission-val + (add-split commission-acct commission-val commission-val + memo cleared))) + + ;; fixme: can these have commissions? + ((cgshort cgshortx cgmid cgmidx cglong cglongx intinc intincx + div divx miscinc miscincx xin rtrncap rtrncapx) + (add-split near-acct total-val total-val memo cleared) + (add-split far-acct (n- total-val) (n- total-val) memo #\n)) + + ;; fixme: can these have commissions? + ((xout miscexp miscexpx margint margintx) + (add-split near-acct (n- total-val) (n- total-val) memo cleared) + (add-split far-acct total-val total-val memo #\n)) + ((shrsin) + (add-split near-acct num-shares action-val memo cleared) + (add-split far-acct (n- total-val) (n- total-val) memo cleared) + (if commission-val + (add-split commission-acct commission-val commission-val + memo cleared))) + ((shrsout) + (add-split near-acct (n- num-shares) (n- action-val) memo cleared) + (add-split far-acct total-val total-val memo cleared) + (if commission-val + (add-split commission-acct commission-val commission-val + memo cleared))) + ((stksplit) + (let* ((splitratio (gnc:numeric-div + num-shares (gnc:numeric-create 10 1) + GNC-DENOM-AUTO GNC-DENOM-REDUCE)) + (in-shares (lookup-balance near-acct)) + (out-shares (n* in-shares splitratio))) + (add-split near-acct out-shares (n- action-amt) memo cleared) + (add-split far-acct in-shares action-amt memo cleared))) + (else + (throw 'qif-io:unhandled-action action)))) + + (gnc:transaction-commit-edit gnc-xtn) + gnc-xtn)) + + + + + + + diff --git a/src/import-export/qif-io-core/qif-io-core.scm b/src/import-export/qif-io-core/qif-io-core.scm new file mode 100644 index 0000000000..2f6fb7c490 --- /dev/null +++ b/src/import-export/qif-io-core/qif-io-core.scm @@ -0,0 +1,86 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io-core.scm +;; top-level module for QIF i/o code +;; +;; Copyright (c) 2001 Linux Developers Group, Inc. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define-module (gnucash import-export qif-io-core)) +(use-modules (ice-9 regex)) +(use-modules (gnucash gnc-module)) + +(gnc:module-load "gnucash/engine" 0) + +(load-from-path "qif-parse.scm") +(load-from-path "qif-format-check.scm") +(load-from-path "qif-file.scm") +(load-from-path "qif-objects.scm") +(load-from-path "qif-record-xform.scm") +(load-from-path "qif-bank-xtn-import.scm") +(load-from-path "qif-invst-xtn-import.scm") +(load-from-path "qif-acct-table.scm") + +;; qif-parse.scm +(export qif-io:parse-category) +(export qif-io:parse-year) +(export qif-io:parse-acct-type) +(export qif-io:parse-bang-field) +(export qif-io:parse-action-field) +(export qif-io:parse-cleared-field) +(export qif-io:check-date-format) +(export qif-io:parse-date/format) +(export qif-io:check-number-format) +(export qif-io:check-multi-number-format) +(export qif-io:parse-number/format) + +;; qif-format-check.scm +(export qif-io:setup-data-formats) +(export qif-io:check-possible-formats) + +;; qif-file.scm +(export qif-io:read-file) +(export qif-io:write-file) +(export qif-io:read-record) +(export qif-io:write-record) + +;; qif-objects.scm +(export qif-io:make-file) +(export qif-io:make-empty-file) +(export qif-io:file-bank-xtns) +(export qif-io:file-invst-xtns) +(export qif-io:file-bank-xtn-format) +(export qif-io:file-invst-xtn-format) +(export qif-io:file-set-bank-xtn-format!) +(export qif-io:file-set-invst-xtn-format!) +(export qif-io:file-xtns-need-acct?) +(export qif-io:file-set-default-src-acct!) + +(export qif-io:make-empty-acct-table) +(export qif-io:acct-table-accounts) +(export qif-io:acct-table-categories) +(export qif-io:acct-table-securities) +(export qif-io:acct-table-brokerage-accts) + +;; qif-record-xform.scm +(export qif-io:record->bank-xtn) +(export qif-io:record->invst-xtn) +(export qif-io:record->account) +(export qif-io:record->category) +(export qif-io:record->class) +(export qif-io:record->security) + +(export qif-io:bank-xtn->record) +(export qif-io:invst-xtn->record) +(export qif-io:account->record) +(export qif-io:category->record) +(export qif-io:class->record) +(export qif-io:security->record) + +;; qif-bank-xtn-import.scm +(export qif-io:bank-xtn-import) +(export qif-io:invst-xtn-import) + +;; acct-table.scm +(export qif-io:acct-table-lookup) +(export qif-io:acct-table-insert!) +(export qif-io:acct-table-make-gnc-group) diff --git a/src/import-export/qif-io-core/qif-objects.scm b/src/import-export/qif-io-core/qif-objects.scm new file mode 100644 index 0000000000..bcc47b4043 --- /dev/null +++ b/src/import-export/qif-io-core/qif-objects.scm @@ -0,0 +1,351 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-objects.scm +;;; record type definitions for QIF objects. +;;; +;;; Bill Gribble 20 Feb 2000 +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;; this should be a GOOPS class. later, I guess. +(define + (make-record-type + "qif-file" + '(path + bank-xtns + bank-xtn-format + invst-xtns + invst-xtn-format + xtns-need-acct? + default-src-acct + accounts + categories + classes + securities))) + +(define qif-io:make-file + (record-constructor )) +(define (qif-io:make-empty-file) + (qif-io:make-file #f #f #f #f #f #f #f #f #f #f #f)) + +(define qif-io:file? + (record-predicate )) +(define qif-io:file-path + (record-accessor 'path)) +(define qif-io:file-set-path! + (record-modifier 'path)) +(define qif-io:file-bank-xtns + (record-accessor 'bank-xtns)) +(define qif-io:file-set-bank-xtns! + (record-modifier 'bank-xtns)) +(define qif-io:file-bank-xtn-format + (record-accessor 'bank-xtn-format)) +(define qif-io:file-set-bank-xtn-format! + (record-modifier 'bank-xtn-format)) +(define qif-io:file-invst-xtns + (record-accessor 'invst-xtns)) +(define qif-io:file-set-invst-xtns! + (record-modifier 'invst-xtns)) +(define qif-io:file-invst-xtn-format + (record-accessor 'invst-xtn-format)) +(define qif-io:file-set-invst-xtn-format! + (record-modifier 'invst-xtn-format)) +(define qif-io:file-xtns-need-acct? + (record-accessor 'xtns-need-acct?)) +(define qif-io:file-set-xtns-need-acct?! + (record-modifier 'xtns-need-acct?)) +(define qif-io:file-default-src-acct + (record-accessor 'default-src-acct)) +(define qif-io:file-set-default-src-acct! + (record-modifier 'default-src-acct)) +(define qif-io:file-accounts + (record-accessor 'accounts)) +(define qif-io:file-set-accounts! + (record-modifier 'accounts)) +(define qif-io:file-categories + (record-accessor 'categories)) +(define qif-io:file-set-categories! + (record-modifier 'categories)) +(define qif-io:file-classes + (record-accessor 'classes)) +(define qif-io:file-set-classes! + (record-modifier 'classes)) +(define qif-io:file-securities + (record-accessor 'securities)) +(define qif-io:file-set-securities! + (record-modifier 'securities)) + + +(define + (make-record-type + "qif-split" '(category amount memo))) + +(define qif-io:make-split + (record-constructor )) +(define (qif-io:make-empty-split) + (qif-io:make-split #f #f #f)) +(define qif-io:split-category + (record-accessor 'category)) +(define qif-io:split-set-category! + (record-modifier 'category)) +(define qif-io:split-amount + (record-accessor 'amount)) +(define qif-io:split-set-amount! + (record-modifier 'amount)) +(define qif-io:split-memo + (record-accessor 'memo)) +(define qif-io:split-set-memo! + (record-modifier 'memo)) + + +(define + (make-record-type + "qif-bank-xtn" + '(source-acct date number payee memo t-amount u-amount + cleared category address splits))) + +(define qif-io:make-bank-xtn + (record-constructor )) +(define (qif-io:make-empty-bank-xtn) + (qif-io:make-bank-xtn #f #f #f #f #f #f #f #f #f #f #f)) +(define qif-io:bank-xtn-source-acct + (record-accessor 'source-acct)) +(define qif-io:bank-xtn-set-source-acct! + (record-modifier 'source-acct)) +(define qif-io:bank-xtn-date + (record-accessor 'date)) +(define qif-io:bank-xtn-set-date! + (record-modifier 'date)) +(define qif-io:bank-xtn-number + (record-accessor 'number)) +(define qif-io:bank-xtn-set-number! + (record-modifier 'number)) +(define qif-io:bank-xtn-payee + (record-accessor 'payee)) +(define qif-io:bank-xtn-set-payee! + (record-modifier 'payee)) +(define qif-io:bank-xtn-memo + (record-accessor 'memo)) +(define qif-io:bank-xtn-set-memo! + (record-modifier 'memo)) +(define qif-io:bank-xtn-t-amount + (record-accessor 't-amount)) +(define qif-io:bank-xtn-set-t-amount! + (record-modifier 't-amount)) +(define qif-io:bank-xtn-u-amount + (record-accessor 'u-amount)) +(define qif-io:bank-xtn-set-u-amount! + (record-modifier 'u-amount)) +(define qif-io:bank-xtn-cleared + (record-accessor 'cleared)) +(define qif-io:bank-xtn-set-cleared! + (record-modifier 'cleared)) +(define qif-io:bank-xtn-category + (record-accessor 'category)) +(define qif-io:bank-xtn-set-category! + (record-modifier 'category)) +(define qif-io:bank-xtn-address + (record-accessor 'address)) +(define qif-io:bank-xtn-set-address! + (record-modifier 'address)) +(define qif-io:bank-xtn-splits + (record-accessor 'splits)) +(define qif-io:bank-xtn-set-splits! + (record-modifier 'splits)) + +(define + (make-record-type + "qif-invst-xtn" + '(source-acct date action security payee memo t-amount + u-amount $-amount share-price share-amount commission + cleared category address))) + +(define qif-io:make-invst-xtn + (record-constructor )) +(define (qif-io:make-empty-invst-xtn) + (qif-io:make-invst-xtn #f #f #f #f #f #f #f #f #f #f #f #f #f #f #f)) +(define qif-io:invst-xtn-source-acct + (record-accessor 'source-acct)) +(define qif-io:invst-xtn-set-source-acct! + (record-modifier 'source-acct)) +(define qif-io:invst-xtn-date + (record-accessor 'date)) +(define qif-io:invst-xtn-set-date! + (record-modifier 'date)) +(define qif-io:invst-xtn-action + (record-accessor 'action)) +(define qif-io:invst-xtn-set-action! + (record-modifier 'action)) +(define qif-io:invst-xtn-security + (record-accessor 'security)) +(define qif-io:invst-xtn-set-security! + (record-modifier 'security)) +(define qif-io:invst-xtn-payee + (record-accessor 'payee)) +(define qif-io:invst-xtn-set-payee! + (record-modifier 'payee)) +(define qif-io:invst-xtn-memo + (record-accessor 'memo)) +(define qif-io:invst-xtn-set-memo! + (record-modifier 'memo)) +(define qif-io:invst-xtn-t-amount + (record-accessor 't-amount)) +(define qif-io:invst-xtn-set-t-amount! + (record-modifier 't-amount)) +(define qif-io:invst-xtn-u-amount + (record-accessor 'u-amount)) +(define qif-io:invst-xtn-set-u-amount! + (record-modifier 'u-amount)) +(define qif-io:invst-xtn-$-amount + (record-accessor '$-amount)) +(define qif-io:invst-xtn-set-$-amount! + (record-modifier '$-amount)) +(define qif-io:invst-xtn-share-price + (record-accessor 'share-price)) +(define qif-io:invst-xtn-set-share-price! + (record-modifier 'share-price)) +(define qif-io:invst-xtn-share-amount + (record-accessor 'share-amount)) +(define qif-io:invst-xtn-set-share-amount! + (record-modifier 'share-amount)) +(define qif-io:invst-xtn-commission + (record-accessor 'commission)) +(define qif-io:invst-xtn-set-commission! + (record-modifier 'commission)) +(define qif-io:invst-xtn-cleared + (record-accessor 'cleared)) +(define qif-io:invst-xtn-set-cleared! + (record-modifier 'cleared)) +(define qif-io:invst-xtn-category + (record-accessor 'category)) +(define qif-io:invst-xtn-set-category! + (record-modifier 'category)) +(define qif-io:invst-xtn-address + (record-accessor 'address)) +(define qif-io:invst-xtn-set-address! + (record-modifier 'address)) + +(define + (make-record-type + "qif-account" + '(name type description limit budget))) + +(define qif-io:make-account + (record-constructor )) +(define qif-io:account-name + (record-accessor 'name)) +(define qif-io:account-set-name! + (record-modifier 'name)) +(define qif-io:account-type + (record-accessor 'type)) +(define qif-io:account-set-type! + (record-modifier 'type)) +(define qif-io:account-description + (record-accessor 'description)) +(define qif-io:account-set-description! + (record-modifier 'description)) +(define qif-io:account-limit + (record-accessor 'limit)) +(define qif-io:account-set-limit! + (record-modifier 'limit)) +(define qif-io:account-budget + (record-accessor 'budget)) +(define qif-io:account-set-budget! + (record-modifier 'budget)) + +(define + (make-record-type + "qif-category" + '(name description taxable expense-cat income-cat tax-class budget-amt))) + +(define qif-io:make-category + (record-constructor )) +(define qif-io:category-name + (record-accessor 'name)) +(define qif-io:category-set-name! + (record-modifier 'name)) +(define qif-io:category-description + (record-accessor 'description)) +(define qif-io:category-set-description! + (record-modifier 'description)) +(define qif-io:category-taxable + (record-accessor 'taxable)) +(define qif-io:category-set-taxable! + (record-modifier 'taxable)) +(define qif-io:category-expense-cat + (record-accessor 'expense-cat)) +(define qif-io:category-set-expense-cat! + (record-modifier 'expense-cat)) +(define qif-io:category-income-cat + (record-accessor 'income-cat)) +(define qif-io:category-set-income-cat! + (record-modifier 'income-cat)) +(define qif-io:category-tax-class + (record-accessor 'tax-class)) +(define qif-io:category-set-tax-class! + (record-modifier 'tax-class)) +(define qif-io:category-budget-amt + (record-accessor 'budget-amt)) +(define qif-io:category-set-budget-amt! + (record-modifier 'budget-amt)) + +(define + (make-record-type + "qif-class" + '(name description))) + +(define qif-io:make-class + (record-constructor )) +(define qif-io:class-name + (record-accessor 'name)) +(define qif-io:class-set-name! + (record-modifier 'name)) +(define qif-io:class-description + (record-accessor 'description)) +(define qif-io:class-set-description! + (record-modifier 'description)) + +(define + (make-record-type + "qif-security" + '(name symbol type))) + +(define qif-io:make-security + (record-constructor )) +(define qif-io:security-name + (record-accessor 'name)) +(define qif-io:security-set-name! + (record-modifier 'name)) +(define qif-io:security-symbol + (record-accessor 'symbol)) +(define qif-io:security-set-symbol! + (record-modifier 'symbol)) +(define qif-io:security-type + (record-accessor 'type)) +(define qif-io:security-set-type! + (record-modifier 'type)) + +(define + (make-record-type + "qif-acct-table" + '(accounts categories securities brokerage-accts))) + +(define qif-io:make-acct-table + (record-constructor )) + +(define (qif-io:make-empty-acct-table) + (qif-io:make-acct-table + (make-hash-table 13) + (make-hash-table 13) + (make-hash-table 13) + (make-hash-table 13))) + +(define qif-io:acct-table-accounts + (record-accessor 'accounts)) +(define qif-io:acct-table-categories + (record-accessor 'categories)) +(define qif-io:acct-table-securities + (record-accessor 'securities)) +(define qif-io:acct-table-brokerage-accts + (record-accessor 'brokerage-accts)) + + diff --git a/src/import-export/qif-io-core/qif-parse.scm b/src/import-export/qif-io-core/qif-parse.scm new file mode 100644 index 0000000000..5af4955816 --- /dev/null +++ b/src/import-export/qif-io-core/qif-parse.scm @@ -0,0 +1,633 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;; qif-parse.scm +;;; routines to parse values and dates in QIF files. +;;; +;;; Bill Gribble 20 Feb 2000 +;;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define GNC-BANK-TYPE 0) +(define GNC-CASH-TYPE 1) +(define GNC-ASSET-TYPE 2) +(define GNC-LIABILITY-TYPE 4) +(define GNC-CCARD-TYPE 3) +(define GNC-STOCK-TYPE 5) +(define GNC-MUTUAL-TYPE 6) +(define GNC-INCOME-TYPE 8) +(define GNC-EXPENSE-TYPE 9) +(define GNC-EQUITY-TYPE 10) + + + +(define qif-category-compiled-rexp + (make-regexp "^ *(\\[)?([^]/\\|]*)(]?)(/([^\|]*))?(\\|(\\[)?([^]/]*)(]?)(/(.*))?)? *$")) + +(define qif-date-compiled-rexp + (make-regexp "^ *([0-9]+) *[-/.'] *([0-9]+) *[-/.'] *([0-9]+).*$|^ *([0-9][0-9][0-9][0-9])([0-9][0-9])([0-9][0-9]).*$")) + +(define decimal-radix-regexp + (make-regexp + "^ *\\$?-?\\$?[0-9]+$|^ *\\$?-?\\$?[0-9]?[0-9]?[0-9]?(,[0-9][0-9][0-9])*(\\.[0-9]*)? *$|^ *\\$?-?\\$?[0-9]+\\.[0-9]* *$")) + +(define comma-radix-regexp + (make-regexp + "^ *\\$?-?\\$?[0-9]+$|^ *\\$?-?\\$?[0-9]?[0-9]?[0-9]?(\\.[0-9][0-9][0-9])*(,[0-9]*) *$|^ *\\$?-?\\$?[0-9]+,[0-9]* *$")) + +(define integer-regexp (make-regexp "^\\$?-?\\$?[0-9]+ *$")) + +(define remove-trailing-space-rexp + (make-regexp "^(.*[^ ]+) *$")) + +(define remove-leading-space-rexp + (make-regexp "^ *([^ ].*)$")) + +(define (string-remove-trailing-space str) + (let ((match (regexp-exec remove-trailing-space-rexp str))) + (if match + (string-copy (match:substring match 1)) + ""))) + +(define (string-remove-trailing-space! str) + (let ((match (regexp-exec remove-trailing-space-rexp str))) + (if match + (match:substring match 1) + ""))) + +(define (string-remove-leading-space str) + (let ((match (regexp-exec remove-leading-space-rexp str))) + (if match + (string-copy (match:substring match 1)) + ""))) + +(define (string-remove-leading-space! str) + (let ((match (regexp-exec remove-leading-space-rexp str))) + (if match + (match:substring match 1) + ""))) + +(define (string-remove-char str char) + (let ((rexpstr + (case char + ((#\.) "\\.") + ((#\^) "\\^") + ((#\$) "\\$") + ((#\*) "\\*") + ((#\+) "\\+") + ((#\\) "\\\\") + ((#\?) "\\?") + (else + (make-string 1 char))))) + (regexp-substitute/global #f rexpstr str 'pre 'post))) + +(define (string-replace-char! str old new) + (let ((rexpstr + (if (not (eq? old #\.)) + (make-string 1 old) + "\\.")) + (newstr (make-string 1 new))) + (regexp-substitute/global #f rexpstr str 'pre newstr 'post))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:parse-category +;; we return a list of 6 elements: +;; 0 parsed category name (without [] if it was an account name) +;; 1 bool stating if it was an account name (a transfer) +;; 2 class of account or #f +;; 3 string representing the "miscx category" if any +;; 4 bool if miscx category is an account +;; 5 class of miscx cat or #f +;; gosh, I love regular expressions. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-category value) + (if (not (string? value)) + (throw 'qif-io:arg-type 'qif-io:parse-category 'string value)) + + (let ((match (regexp-exec qif-category-compiled-rexp value))) + ;; what the substrings mean: + ;; 1 the opening [ for a transfer + ;; 2 the category + ;; 3 the closing ] + ;; 4 the class / + ;; 5 the class + ;; 6 the miscx expression (whole thing) + ;; 7 the opening [ + ;; 8 the miscx category + ;; 9 the closing ] + ;; 10 the class / + ;; 11 the class + (if match + (let ((rv + (list (match:substring match 2) + (if (and (match:substring match 1) + (match:substring match 3)) + #t #f) + (if (match:substring match 4) + (match:substring match 5) + #f) + ;; miscx category name + (if (match:substring match 6) + (match:substring match 8) + #f) + ;; is it an account? + (if (and (match:substring match 7) + (match:substring match 9)) + #t #f) + (if (match:substring match 10) + (match:substring match 11) + #f)))) + rv) + (throw 'qif-io:parse-failed 'qif-io:parse-category value)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:parse-year +;; this is where we handle y2k fixes etc. input is a string +;; containing the year ("00", "2000", and "19100" all mean the same +;; thing). output is an integer representing the year in the C.E. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-year year-string y2k-threshold) + (if (not (string? year-string)) + (throw 'qif-io:arg-type 'qif-io:parse-year 'string year-string)) + (if (not (number? y2k-threshold)) + (throw 'qif-io:arg-type 'qif-io:parse-year 'number y2k-threshold)) + + (let ((fixed-string #f) + (post-read-value #f) + (y2k-fixed-value #f)) + + ;; quicken prints 2000 as "' 0" for at least some versions. + ;; thanks dave p for reporting this. + (if (eq? (string-ref year-string 0) #\') + (begin + (set! fixed-string + (substring year-string 2 (string-length year-string)))) + (set! fixed-string year-string)) + + ;; now the string should just have a number in it plus some + ;; optional trailing space. + (set! post-read-value + (with-input-from-string fixed-string + (lambda () (read)))) + + (cond + ;; 2-digit numbers less than the window size are interpreted to + ;; be post-2000. + ((and (integer? post-read-value) + (< post-read-value y2k-threshold)) + (set! y2k-fixed-value (+ 2000 post-read-value))) + + ;; there's a common bug in printing post-2000 dates that + ;; prints 2000 as 19100 etc. + ((and (integer? post-read-value) + (> post-read-value 19000)) + (set! y2k-fixed-value (+ 1900 (- post-read-value 19000)))) + + ;; normal dates represented in unix years (i.e. year-1900, so + ;; 2000 => 100.) We also want to allow full year specifications, + ;; (i.e. 1999, 2001, etc) and there's a point at which you can't + ;; determine which is which. mktime in scheme doesn't deal with + ;; dates before December 14, 1901, at least for now, so let's + ;; give ourselves until at least 3802 before this does the wrong + ;; thing. + ((and (integer? post-read-value) + (< post-read-value 1902)) + (set! y2k-fixed-value (+ 1900 post-read-value))) + + ;; this is a normal, 4-digit year spec (1999, 2000, etc). + ((integer? post-read-value) + (set! y2k-fixed-value post-read-value)) + + ;; No idea what the string represents. Maybe a new bug in Quicken! + (#t + (throw 'qif-io:parse-failed 'qif-io:parse-year year-string))) + y2k-fixed-value)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parse-bang-field : the bang fields switch the parse context for +;; the qif file. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-bang-field read-value) + (if (not (string? read-value)) + (throw 'qif-io:arg-type 'qif-io:parse-bang-field 'string read-value)) + (string->symbol (string-downcase + (string-remove-trailing-space read-value)))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parse-action-field : stock transaction actions +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-action-field read-value) + (define (canonicalize string) + (string->symbol + (string-downcase + (string-remove-trailing-space! + (string-remove-leading-space! string))))) + + (if (not (string? read-value)) + (throw 'qif-io:arg-type 'qif-io:parse-action-field 'string read-value)) + + (let ((action-symbol (canonicalize read-value))) + (case action-symbol + ;; buy + ((buy kauf) + 'buy) + ((buyx kaufx) + 'buyx) + ((cglong kapgew) ;; Kapitalgewinnsteuer + 'cglong) + ((cglongx kapgewx) + 'cglongx) + ((cgmid) ;; Kapitalgewinnsteuer + 'cgmid) + ((cgmidx) + 'cgmidx) + ((cgshort k.gewsp) + 'cgshort) + ((cgshortx k.gewspx) + 'cgshortx) + ((div) ;; dividende + 'div) + ((divx) + 'divx) + ;; ((exercise) + ;; 'exercise) + ;; ((exercisx) + ;; 'exercisx) + ;; ((expire) + ;; 'expire) + ;; ((grant) + ;; 'grant) + ((int intinc aktzu) ;; zinsen + 'intinc) + ((intx intincx) + 'intincx) + ((margint) + 'margint) + ((margintx) + 'margintx) + ((miscexp) + 'miscexp) + ((miscexpx) + 'miscexpx) + ((miscinc) + 'miscinc) + ((miscincx) + 'miscincx) + ((reinvdiv) + 'reinvdiv) + ((reinvint reinvzin) + 'reinvint) + ((reinvlg reinvkur) + 'reinvlg) + ((reinvmd) + 'reinvmd) + ((reinvsg reinvksp) + 'reinvsg) + ((reinvsh) + 'reinvsh) + ((reminder erinnerg) + 'reminder) + ((sell verkauf) ;; verkaufen + 'sell) + ((sellx verkaufx) + 'sellx) + ((shrsin aktzu) + 'shrsin) + ((shrsout aktab) + 'shrsout) + ((stksplit aktsplit) + 'stksplit) + ((xin) + 'xin) + ((xout) + 'xout) + ;; ((vest) + ;; 'vest) + (else + (throw 'qif-io:parse-failed 'qif-io:parse-action-field read-value))))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; parse-cleared-field : in a C (cleared) field in a QIF transaction, +;; * means cleared, x or X means reconciled, and ! or ? mean some +;; budget related stuff I don't understand. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-cleared-field read-value) + (if (not (string? read-value)) + #\n + (if (> (string-length read-value) 0) + (let ((secondchar (string-ref read-value 0))) + (cond ((eq? secondchar #\*) + #\c) + ((or (eq? secondchar #\x) + (eq? secondchar #\X) + (eq? secondchar #\r) + (eq? secondchar #\R)) + #\y) + ((or (eq? secondchar #\?) + (eq? secondchar #\!)) + #\n) + (#t + (throw 'qif-io:parse-failed + 'qif-io:parse-cleared-field read-value)))) + #f))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:check-date-format +;; given a list of possible date formats, return a pruned list +;; of possibilities. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:check-date-format date-string possible-formats) + (if (not (string? date-string)) + (throw 'qif-io:arg-type 'qif-io:check-date-format 'string date-string)) + (if (not (list? possible-formats)) + (throw 'qif-io:arg-type 'qif-io:check-date-format + 'list possible-formats)) + + (let ((retval #f)) + (if (not (> (string-length date-string) 0)) + (set! retval possible-formats) + (let ((date-parts '()) + (numeric-date-parts '()) + (match (regexp-exec qif-date-compiled-rexp date-string))) + + (if (not match) + (throw 'qif-io:parse-failed 'qif-io:check-date-format + date-string)) + + (if (match:substring match 1) + (set! date-parts (list (match:substring match 1) + (match:substring match 2) + (match:substring match 3))) + (set! date-parts (list (match:substring match 4) + (match:substring match 5) + (match:substring match 6)))) + + ;; get the strings into numbers (but keep the strings around) + (set! numeric-date-parts + (map (lambda (elt) + (with-input-from-string elt + (lambda () (read)))) + date-parts)) + + (let ((possibilities possible-formats) + (n1 (car numeric-date-parts)) + (n2 (cadr numeric-date-parts)) + (n3 (caddr numeric-date-parts))) + + ;; filter the possibilities to eliminate (hopefully) + ;; all but one + (if (or (not (number? n1)) (> n1 12)) + (set! possibilities (delq 'm-d-y possibilities))) + (if (or (not (number? n1)) (> n1 31)) + (set! possibilities (delq 'd-m-y possibilities))) + (if (or (not (number? n1)) (< n1 1)) + (set! possibilities (delq 'd-m-y possibilities))) + (if (or (not (number? n1)) (< n1 1)) + (set! possibilities (delq 'm-d-y possibilities))) + + (if (or (not (number? n2)) (> n2 12)) + (begin + (set! possibilities (delq 'd-m-y possibilities)) + (set! possibilities (delq 'y-m-d possibilities)))) + + (if (or (not (number? n2)) (> n2 31)) + (begin + (set! possibilities (delq 'm-d-y possibilities)) + (set! possibilities (delq 'y-d-m possibilities)))) + + (if (or (not (number? n3)) (> n3 12)) + (set! possibilities (delq 'y-d-m possibilities))) + (if (or (not (number? n3)) (> n3 31)) + (set! possibilities (delq 'y-m-d possibilities))) + + (if (or (not (number? n3)) (< n3 1)) + (set! possibilities (delq 'y-m-d possibilities))) + (if (or (not (number? n3)) (< n3 1)) + (set! possibilities (delq 'y-d-m possibilities))) + (set! retval possibilities)))) + retval)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:parse-date/format +;; given a date string and a particular format spec, return a date +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-date/format date-string format) + (if (not (string? date-string)) + (throw 'qif-io:arg-type 'qif-io:parse-date/format 'string date-string)) + + (let ((date-parts '()) + (numeric-date-parts '()) + (retval date-string) + (match (regexp-exec qif-date-compiled-rexp date-string))) + (if (not match) + (throw 'qif-io:parse-failed 'qif-io:parse-date/format date-string)) + + (if (match:substring match 1) + (set! date-parts (list (match:substring match 1) + (match:substring match 2) + (match:substring match 3))) + (set! date-parts (list (match:substring match 4) + (match:substring match 5) + (match:substring match 6)))) + + ;; get the strings into numbers (but keep the strings around) + (set! numeric-date-parts + (map (lambda (elt) + (with-input-from-string elt + (lambda () (read)))) + date-parts)) + + ;; if the date parts list doesn't have 3 parts, we're in + ;; trouble + (if (not (eq? 3 (length date-parts))) + ;; bomb out on bad parts + (throw 'qif-io:parse-failed 'qif-io:parse-date/format date-string) + + ;; otherwise try to interpret + (case format + ((d-m-y) + (let ((d (car numeric-date-parts)) + (m (cadr numeric-date-parts)) + (y (qif-io:parse-year (caddr date-parts) 50))) + (if (and (integer? d) (integer? m) (integer? y) + (<= m 12) (<= d 31)) + (set! retval (list d m y)) + (throw 'qif-io:parse-failed + 'qif-io:parse-date/format date-string)))) + ((m-d-y) + (let ((m (car numeric-date-parts)) + (d (cadr numeric-date-parts)) + (y (qif-io:parse-year (caddr date-parts) 50))) + (if (and (integer? d) (integer? m) (integer? y) + (<= m 12) (<= d 31)) + (set! retval (list d m y)) + (throw 'qif-io:parse-failed + 'qif-io:parse-date/format date-string)))) + ((y-m-d) + (let ((y (qif-io:parse-year (car date-parts) 50)) + (m (cadr numeric-date-parts)) + (d (caddr numeric-date-parts))) + (if (and (integer? d) (integer? m) (integer? y) + (<= m 12) (<= d 31)) + (set! retval (list d m y)) + (throw 'qif-io:parse-failed + 'qif-io:parse-date/format date-string)))) + ((y-d-m) + (let ((y (qif-io:parse-year (car date-parts) 50)) + (d (cadr numeric-date-parts)) + (m (caddr numeric-date-parts))) + (if (and (integer? d) (integer? m) (integer? y) + (<= m 12) (<= d 31)) + (set! retval (list d m y)) + (throw 'qif-io:parse-failed + 'qif-io:parse-date/format date-string)))) + (else + (throw 'qif-io:parse-failed 'qif-io:parse-date/format + format)))) + retval)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:check-number-format +;; given a list of possible number formats, return a pruned list +;; of possibilities. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:check-number-format value-string possible-formats) + (if (not (string? value-string)) + (throw 'qif-io:arg-type 'qif-io:check-number-format 'string value-string)) + (if (not (list? possible-formats)) + (throw 'qif-io:arg-type 'qif-io:check-number-format + 'list possible-formats)) + + (let ((retval '())) + (for-each + (lambda (format) + (case format + ((decimal) + (if (regexp-exec decimal-radix-regexp value-string) + (set! retval (cons 'decimal retval)))) + ((comma) + (if (regexp-exec comma-radix-regexp value-string) + (set! retval (cons 'comma retval)))) + ((integer) + (if (regexp-exec integer-regexp value-string) + (set! retval (cons 'integer retval)))) + (else + (throw 'qif-io:arg-type 'qif-io:check-number-format + 'number-format format)))) + possible-formats) + (reverse! retval))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:check-multi-number-format +;; apply check-number-format to a list of numbers +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:check-multi-number-format value-list possible-formats) + (let ((retval possible-formats)) + (for-each + (lambda (val) + (if (string? val) + (set! retval (qif-io:check-number-format val retval)))) + value-list) + retval)) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:parse-number/format +;; assuming we know what the format is, parse the string. +;; returns a gnc-numeric; the denominator is set so as to exactly +;; represent the number +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-number/format value-string format) + (if (not (string? value-string)) + (throw 'qif-io:arg-type 'qif-io:parse-number/format + 'string value-string)) + + (case format + ((decimal) + (let* ((filtered-string + (string-remove-char + (string-remove-char value-string #\,) + #\$)) + (read-val + (with-input-from-string filtered-string + (lambda () (read))))) + (if (number? read-val) + (gnc:double-to-gnc-numeric + (+ 0.0 read-val) GNC-DENOM-AUTO + (logior (GNC-DENOM-SIGFIGS + (string-length (string-remove-char filtered-string #\.))) + GNC-RND-ROUND)) + (gnc:numeric-zero)))) + ((comma) + (let* ((filtered-string + (string-remove-char + (string-replace-char! + (string-remove-char value-string #\.) + #\, #\.) + #\$)) + (read-val + (with-input-from-string filtered-string + (lambda () (read))))) + (if (number? read-val) + (gnc:double-to-gnc-numeric + (+ 0.0 read-val) GNC-DENOM-AUTO + (logior (GNC-DENOM-SIGFIGS + (string-length (string-remove-char filtered-string #\.))) + GNC-RND-ROUND)) + (gnc:numeric-zero)))) + ((integer) + (let ((read-val + (with-input-from-string + (string-remove-char value-string #\$) + (lambda () (read))))) + (if (number? read-val) + (gnc:double-to-gnc-numeric + (+ 0.0 read-val) 1 GNC-RND-ROUND) + (gnc:numeric-zero)))) + (else + (throw 'qif-io:arg-type 'qif-io:parse-number/format + 'number-format format)))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:parse-acct-type +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:parse-acct-type read-value) + (if (not (string? read-value)) + #f + (let ((mangled-string + (string-remove-trailing-space + (string-remove-leading-space read-value)))) + (cond + ((string-ci=? mangled-string "bank") + GNC-BANK-TYPE) + ((string-ci=? mangled-string "port") + GNC-BANK-TYPE) + ((string-ci=? mangled-string "cash") + GNC-CASH-TYPE) + ((string-ci=? mangled-string "ccard") + GNC-CCARD-TYPE) + ((string-ci=? mangled-string "invst") ;; these are brokerage accounts. + GNC-BANK-TYPE) + ((string-ci=? mangled-string "oth a") + GNC-ASSET-TYPE) + ((string-ci=? mangled-string "oth l") + GNC-LIABILITY-TYPE) + ((string-ci=? mangled-string "mutual") + GNC-BANK-TYPE) + (else + #f))))) diff --git a/src/import-export/qif-io-core/qif-record-xform.scm b/src/import-export/qif-io-core/qif-record-xform.scm new file mode 100644 index 0000000000..c750036aa1 --- /dev/null +++ b/src/import-export/qif-io-core/qif-record-xform.scm @@ -0,0 +1,455 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-record-xform +;; routines to convert tag-value lists into various QIF data +;; structures +;; +;; Copyright (c) 2001 Linux Developers Group, Inc. +;; $Id$ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->bank-xtn +;; take a list of key-value pairs representing a transaction and +;; turn them into an actual transaction record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->bank-xtn record-pairs) + (let ((tag #f) + (value #f) + (date #f) + (number #f) + (payee #f) + (memo #f) + (address #f) + (cleared #f) + (t-amount #f) + (u-amount #f) + (category #f) + (split-category #f) + (split-amount #f) + (split-memo #f) + (complete-splits '()) + (split-records '())) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\D) (set! date value)) ;; D : transaction date + ((#\N) (set! number value)) ;; N : check number + ((#\P) (set! payee value)) ;; P : payee + ((#\M) (set! memo value)) ;; M : memo + ((#\T) (set! t-amount value)) ;; T : total amount + ((#\U) (set! u-amount value)) ;; U : total amount + ((#\C) (set! cleared value)) ;; C : cleared flag + ((#\L) (set! category value)) ;; L : category + ((#\A) ;; A : address + ;; multiple "A" lines are appended together with + ;; newlines; some Quicken files have a lot of + ;; A lines. + (if (string? address) + (set! address + (string-append address "\n" value)) + (set! address value))) + + ((#\S) ;; S : split category + ;; if we have already seen another split, this S line + ;; finishes it and starts a new one + (if split-category + (begin + (set! complete-splits + (cons (list split-category split-amount split-memo) + complete-splits)) + (set! split-category value) + (set! split-amount #f) + (set! split-memo #f)) + (set! split-category value))) + ((#\E) (set! split-memo value)) ;; E : split memo + ((#\$) (set! split-amount value)))) + record-pairs) + + ;; if there's an open split, do the right thing + (if (string? split-category) + (set! complete-splits + (cons (list split-category split-amount split-memo) + complete-splits))) + + ;; convert the splits to split records + ;; (reversing the list again to get the right order) + (for-each + (lambda (split) + (set! split-records + (cons (qif-io:make-split (car split) + (cadr split) + (caddr split)) + split-records))) + complete-splits) + + ;; check for bogosity and make a record if everything's ok + (if (and date t-amount) + (qif-io:make-bank-xtn #f date number payee memo + t-amount u-amount cleared category + address split-records) + (throw 'qif-io:record-error 'qif-io:record->bank-xtn record-pairs)))) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:bank-xtn->record +;; turn a bank-xtn into tag-value pairs. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:bank-xtn->record bank-xtn) + (let ((kvp '())) + (let ((date (qif-io:bank-xtn-date bank-xtn))) + (if date + (set! kvp (cons (cons #\D date) kvp)))) + (let ((number (qif-io:bank-xtn-number bank-xtn))) + (if number + (set! kvp (cons (cons #\N number) kvp)))) + (let ((payee (qif-io:bank-xtn-payee bank-xtn))) + (if payee + (set! kvp (cons (cons #\P payee) kvp)))) + (let ((memo (qif-io:bank-xtn-memo bank-xtn))) + (if memo + (set! kvp (cons (cons #\M memo) kvp)))) + (let ((t-amount (qif-io:bank-xtn-t-amount bank-xtn))) + (if t-amount + (set! kvp (cons (cons #\T t-amount) kvp)))) + (let ((u-amount (qif-io:bank-xtn-u-amount bank-xtn))) + (if u-amount + (set! kvp (cons (cons #\U u-amount) kvp)))) + (let ((cleared (qif-io:bank-xtn-cleared bank-xtn))) + (if cleared + (set! kvp (cons (cons #\C cleared) kvp)))) + (let ((category (qif-io:bank-xtn-category bank-xtn))) + (if category + (set! kvp (cons (cons #\L category) kvp)))) + (let ((address (qif-io:bank-xtn-address bank-xtn))) + (if address + (with-input-from-string address + (lambda () + (let loop ((line (read-line))) + (if (not (eof-object? line)) + (begin + (set! kvp (cons (cons #\A line) kvp)) + (loop (read-line))))))))) + (let ((splits (qif-io:bank-xtn-splits bank-xtn))) + (for-each + (lambda (split) + (let ((split-cat (qif-io:split-category split)) + (split-memo (qif-io:split-memo split)) + (split-amount (qif-io:split-amount split))) + (if split-cat + (set! kvp (cons (cons #\S split-cat) kvp)) + (if (or split-memo split-amount) + (set! kvp (cons (cons #\S "") kvp)))) + (if split-memo + (set! kvp (cons (cons #\E split-memo) kvp))) + (if split-amount + (set! kvp (cons (cons #\$ split-amount) kvp))))) + splits)) + (reverse! kvp))) + + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->invst-xtn +;; take a list of key-value pairs representing a transaction and +;; turn them into an actual transaction record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->invst-xtn record-pairs) + (let ((tag #f) + (value #f) + (date #f) + (action #f) + (payee #f) + (memo #f) + (address #f) + (cleared #f) + (t-amount #f) + (u-amount #f) + (security #f) + (category #f) + (commission #f) + ($-amount #f) + (share-price #f) + (share-amount #f)) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\D) (set! date value)) ;; D : transaction date + ((#\N) (set! action value)) ;; N : investment action + ((#\P) (set! payee value)) ;; P : payee + ((#\M) (set! memo value)) ;; M : memo + ((#\T) (set! t-amount value)) ;; T : total amount + ((#\U) (set! u-amount value)) ;; U : total amount + ((#\$) (set! $-amount value)) ;; $ : total amount + ((#\Y) (set! security value)) ;; Y : security + ((#\I) (set! share-price value)) ;; I : share price + ((#\Q) (set! share-amount value)) ;; Q : share quantity + ((#\O) (set! commission value)) ;; O : commission + ((#\C) (set! cleared value)) ;; C : cleared flag + ((#\L) (set! category value)) ;; L : category + ((#\A) ;; A : address + ;; multiple "A" lines are appended together with + ;; newlines; some Quicken files have a lot of + ;; A lines. + (if (string? address) + (set! address + (string-append address "\n" value)) + (set! address value))))) + record-pairs) + (qif-io:make-invst-xtn #f date action security payee memo t-amount + u-amount $-amount share-price share-amount + commission cleared category address))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:invst-xtn->record +;; turn a invst-xtn into tag-value pairs. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:invst-xtn->record invst-xtn) + (let ((kvp '())) + (let ((date (qif-io:invst-xtn-date invst-xtn))) + (if date + (set! kvp (cons (cons #\D date) kvp)))) + (let ((action (qif-io:invst-xtn-action invst-xtn))) + (if action + (set! kvp (cons (cons #\N action) kvp)))) + (let ((payee (qif-io:invst-xtn-payee invst-xtn))) + (if payee + (set! kvp (cons (cons #\P payee) kvp)))) + (let ((security (qif-io:invst-xtn-security invst-xtn))) + (if security + (set! kvp (cons (cons #\Y security) kvp)))) + (let ((share-price (qif-io:invst-xtn-share-price invst-xtn))) + (if share-price + (set! kvp (cons (cons #\I share-price) kvp)))) + (let ((share-amount (qif-io:invst-xtn-share-amount invst-xtn))) + (if share-amount + (set! kvp (cons (cons #\Q share-amount) kvp)))) + (let ((t-amount (qif-io:invst-xtn-t-amount invst-xtn))) + (if t-amount + (set! kvp (cons (cons #\T t-amount) kvp)))) + (let ((u-amount (qif-io:invst-xtn-u-amount invst-xtn))) + (if u-amount + (set! kvp (cons (cons #\U u-amount) kvp)))) + (let ((commission (qif-io:invst-xtn-commission invst-xtn))) + (if commission + (set! kvp (cons (cons #\O commission) kvp)))) + (let ((cleared (qif-io:invst-xtn-cleared invst-xtn))) + (if cleared + (set! kvp (cons (cons #\C cleared) kvp)))) + (let ((address (qif-io:invst-xtn-address invst-xtn))) + (if address + (with-input-from-string address + (lambda () + (let loop ((line (read-line))) + (if (not (eof-object? line)) + (begin + (set! kvp (cons (cons #\A line) kvp)) + (loop (read-line))))))))) + (let ((memo (qif-io:invst-xtn-memo invst-xtn))) + (if memo + (set! kvp (cons (cons #\M memo) kvp)))) + (let ((category (qif-io:invst-xtn-category invst-xtn))) + (if category + (set! kvp (cons (cons #\L category) kvp)))) + (let (($-amount (qif-io:invst-xtn-$-amount invst-xtn))) + (if $-amount + (set! kvp (cons (cons #\$ $-amount) kvp)))) + (reverse! kvp '()))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->account +;; take a list of key-value pairs representing a transaction and +;; turn them into an actual transaction record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->account record-pairs) + (let ((tag #f) + (value #f) + (name #f) + (type #f) + (description #f) + (limit #f) + (budget #f)) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\N) (set! name value)) ;; N : account name + ((#\D) (set! description value)) ;; D : account descrip + ((#\T) (set! type value)) ;; T : account type + ((#\L) (set! limit value)) ;; L : credit limit + ((#\B) (set! budget value)))) ;; B : budget amount (?) + record-pairs) + (qif-io:make-account name type description limit budget))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:account->record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:account->record acct) + (let ((kvp '())) + (let ((name (qif-io:account-name acct))) + (if name + (set! kvp (cons (cons #\N name) kvp)))) + (let ((type (qif-io:account-type acct))) + (if type + (set! kvp (cons (cons #\T type) kvp)))) + (let ((description (qif-io:account-description acct))) + (if description + (set! kvp (cons (cons #\D description) kvp)))) + (let ((limit (qif-io:account-limit acct))) + (if limit + (set! kvp (cons (cons #\L limit) kvp)))) + (let ((budget (qif-io:account-budget acct))) + (if budget + (set! kvp (cons (cons #\B budget) kvp)))) + (reverse! kvp '()))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->category +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->category record-pairs) + (let ((tag #f) + (value #f) + (name #f) + (taxable #f) + (description #f) + (expense-cat #f) + (income-cat #f) + (tax-class #f) + (budget-amt #f)) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\N) (set! name value)) + ((#\D) (set! description value)) + ((#\T) (set! taxable value)) + ((#\E) (set! expense-cat value)) + ((#\I) (set! income-cat value)) + ((#\R) (set! tax-class value)) + ((#\B) (set! budget-amt value)))) + record-pairs) + (qif-io:make-category name description taxable + expense-cat income-cat tax-class budget-amt))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:category->record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:category->record cat) + (let ((kvp '())) + (let ((name (qif-io:category-name cat))) + (if name + (set! kvp (cons (cons #\N name) kvp)))) + (let ((description (qif-io:category-description cat))) + (if description + (set! kvp (cons (cons #\D description) kvp)))) + (let ((taxable (qif-io:category-taxable cat))) + (if taxable + (set! kvp (cons (cons #\T taxable) kvp)))) + (let ((tax-class (qif-io:category-tax-class cat))) + (if tax-class + (set! kvp (cons (cons #\R tax-class) kvp)))) + (let ((expense-cat (qif-io:category-expense-cat cat))) + (if expense-cat + (set! kvp (cons (cons #\E expense-cat) kvp)))) + (let ((income-cat (qif-io:category-income-cat cat))) + (if income-cat + (set! kvp (cons (cons #\I income-cat) kvp)))) + (let ((budget-amt (qif-io:category-budget-amt cat))) + (if budget-amt + (set! kvp (cons (cons #\B budget-amt) kvp)))) + (reverse! kvp '()))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->class +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->class record-pairs) + (let ((tag #f) + (value #f) + (name #f) + (description #f)) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\N) (set! name value)) + ((#\D) (set! description value)))) + record-pairs) + (qif-io:make-class name description))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:class->record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:class->record class) + (let ((kvp '())) + (let ((name (qif-io:class-name class))) + (if name + (set! kvp (cons (cons #\N name) kvp)))) + (let ((description (qif-io:class-description class))) + (if description + (set! kvp (cons (cons #\D description) kvp)))) + (reverse! kvp '()))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:record->security +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:record->security record-pairs) + (let ((tag #f) + (value #f) + (name #f) + (symbol #f) + (type #f)) + (for-each + (lambda (pair) + (set! tag (car pair)) + (set! value (cdr pair)) + (case tag + ((#\N) (set! name value)) + ((#\S) (set! symbol value)) + ((#\T) (set! type value)))) + record-pairs) + (qif-io:make-security name symbol type))) + + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; qif-io:security->record +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(define (qif-io:security->record security) + (let ((kvp '())) + (let ((name (qif-io:security-name security))) + (if name + (set! kvp (cons (cons #\N name) kvp)))) + (let ((type (qif-io:security-type security))) + (if type + (set! kvp (cons (cons #\T type) kvp)))) + (let ((symbol (qif-io:security-symbol security))) + (if symbol + (set! kvp (cons (cons #\S symbol) kvp)))) + (reverse! kvp '()))) + + + diff --git a/src/import-export/qif-io-core/test/Makefile.am b/src/import-export/qif-io-core/test/Makefile.am new file mode 100644 index 0000000000..3f440ef0cc --- /dev/null +++ b/src/import-export/qif-io-core/test/Makefile.am @@ -0,0 +1,10 @@ +LDADD=${top_srcdir}/src/gnc-module/libgncmodule.la ${GLIB_LIBS} -lltdl +CFLAGS=@CFLAGS@ ${GLIB_CFLAGS} +INCLUDES = -I${top_srcdir}/src/gnc-module ${GUILE_INCS} + +TESTS=test-load-module test-parser test-reader test-file-formats \ +test-import-phase-1 + +TESTS_ENVIRONMENT = \ + GNC_MODULE_PATH="${top_srcdir}/src/modules/qif-io-core:${top_srcdir}/src/modules/engine" GUILE_LOAD_PATH="../:../../engine/:../../../gnc-module/:${G_WRAP_MODULE_DIR}" + diff --git a/src/import-export/qif-io-core/test/data/category-data.txt b/src/import-export/qif-io-core/test/data/category-data.txt new file mode 100644 index 0000000000..d2a3d04fcd --- /dev/null +++ b/src/import-export/qif-io-core/test/data/category-data.txt @@ -0,0 +1,11 @@ +(("plain category") #f ("plain category" #f #f #f #f #f)) +(("[transfer]") #f ("transfer" #t #f #f #f #f)) +((bad-data) #t (qif-io:arg-type qif-io:parse-category string bad-data)) +(("category/class") #f ("category" #f "class" #f #f #f)) +(("[transfer]/class") #f ("transfer" #t "class" #f #f #f)) +(("[transfer]/class|[miscxfer]") #f ("transfer" #t "class" "miscxfer" #t #f)) +(("[transfer]/class|miscxfer") #f ("transfer" #t "class" "miscxfer" #f #f)) +(("[transfer]/class|[miscxfer]/class2") #f + ("transfer" #t "class" "miscxfer" #t "class2")) +(("class1/class2:ISDN|[Telecom]") #f ("class1" #f "class2:ISDN" "Telecom" #t #f)) + diff --git a/src/import-export/qif-io-core/test/data/date-data.txt b/src/import-export/qif-io-core/test/data/date-data.txt new file mode 100644 index 0000000000..0f7ffe41ae --- /dev/null +++ b/src/import-export/qif-io-core/test/data/date-data.txt @@ -0,0 +1,15 @@ +(("01/20/2001" m-d-y) #f (20 1 2001)) +(("20.1.01" d-m-y) #f (20 1 2001)) +(("19101-1-20" y-m-d) #f (20 1 2001)) +(("1/20/1" y-d-m) #f (20 1 2001)) +(("1/20'01" m-d-y) #f (20 1 2001)) +(("1/20' 1" m-d-y) #f (20 1 2001)) +(("2/dd/2001" d-m-y) #t + (qif-io:parse-failed qif-io:parse-date/format "2/dd/2001")) +(("not a date" d-m-y) #t + (qif-io:parse-failed qif-io:parse-date/format "not a date")) +((nonstring d-m-y) #t (qif-io:arg-type qif-io:parse-date/format string nonstring)) +(("01/04/2001" bad-format) #t + (qif-io:parse-failed qif-io:parse-date/format bad-format)) +(("3-3" d-m-y) #t + (qif-io:parse-failed qif-io:parse-date/format "3-3")) diff --git a/src/import-export/qif-io-core/test/data/date-format-data.txt b/src/import-export/qif-io-core/test/data/date-format-data.txt new file mode 100644 index 0000000000..e5e601cbbf --- /dev/null +++ b/src/import-export/qif-io-core/test/data/date-format-data.txt @@ -0,0 +1,19 @@ +(("01/20/2001" (d-m-y m-d-y y-m-d y-d-m)) #f (m-d-y)) +(("20.1.01" (d-m-y m-d-y y-m-d y-d-m)) #f (d-m-y y-m-d y-d-m)) +(("19101-1-20" (d-m-y m-d-y y-m-d y-d-m)) #f (y-m-d)) +(("1/20/1" (d-m-y m-d-y y-m-d y-d-m)) #f (m-d-y y-d-m)) +(("1/20'01" (d-m-y m-d-y y-m-d y-d-m)) #f (m-d-y y-d-m)) +(("1/20' 1" (d-m-y m-d-y y-m-d y-d-m)) #f (m-d-y y-d-m)) +(("2/dd/2001" (d-m-y m-d-y y-m-d y-d-m)) #t + (qif-io:parse-failed qif-io:check-date-format "2/dd/2001")) +(("not a date" (d-m-y)) #t + (qif-io:parse-failed qif-io:check-date-format "not a date")) +((nonstring d-m-y) #t (qif-io:arg-type qif-io:check-date-format string nonstring)) +(("01/04/2001" bad-format) #t + (qif-io:arg-type qif-io:check-date-format list bad-format)) +(("3-3" d-m-y) #t + (qif-io:arg-type qif-io:check-date-format list d-m-y)) +(("3-3" (d-m-y)) #t + (qif-io:parse-failed qif-io:check-date-format "3-3")) + + diff --git a/src/import-export/qif-io-core/test/data/file-formats-data.txt b/src/import-export/qif-io-core/test/data/file-formats-data.txt new file mode 100644 index 0000000000..d875dad3d2 --- /dev/null +++ b/src/import-export/qif-io-core/test/data/file-formats-data.txt @@ -0,0 +1,58 @@ +(("../../../../doc/examples/quicktest.qif") + #f (() + ((#\D m-d-y) (#\I decimal) (#\Q decimal) (#\T decimal) + (#\O decimal) (#\$ decimal)))) + +(("../../../../doc/examples/Money95bank_fr.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal)) ())) + +(("../../../../doc/examples/Money95invst_fr.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal comma)) ())) + +(("../../../../doc/examples/Money95mfunds_fr.qif") + #f (() + ((#\D m-d-y) (#\I decimal) (#\Q decimal comma) (#\T decimal) + (#\O decimal) (#\$ decimal)))) + +(("../../../../doc/examples/Money95stocks_fr.qif") + #f (() + ((#\D m-d-y) (#\I decimal) (#\Q decimal) (#\T decimal) + (#\O decimal) (#\$ decimal)))) + +(("../../../../doc/examples/abc-all.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal)) + ())) + +(("../../../../doc/examples/abc.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal comma)) + ())) + +(("../../../../doc/examples/bogus.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal comma)) + ())) + +(("../../../../doc/examples/cbb-export.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal)) + ())) + +(("../../../../doc/examples/divx.qif") + #f (((#\D m-d-y) (#\T decimal) (#\U decimal) (#\S . "") (#\$ decimal)) + ((#\D m-d-y) (#\T decimal) (#\U decimal) (#\$ decimal)))) + +(("../../../../doc/examples/every.qif") + #f (() + ((#\D m-d-y) (#\I decimal) (#\Q decimal) (#\T decimal) + (#\O decimal) (#\$ decimal)))) + +(("../../../../doc/examples/ms-money.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal comma)) + ())) + +(("../../../../doc/examples/swipe.qif") + #f (() + ((#\D m-d-y) (#\I decimal) (#\Q decimal) (#\T decimal) + (#\$ decimal)))) + +(("../../../../doc/examples/web.qif") + #f (((#\D m-d-y) (#\T decimal) (#\S . "") (#\$ decimal comma)) + ())) diff --git a/src/import-export/qif-io-core/test/data/import-phase-1-data.txt b/src/import-export/qif-io-core/test/data/import-phase-1-data.txt new file mode 100644 index 0000000000..687a84138d --- /dev/null +++ b/src/import-export/qif-io-core/test/data/import-phase-1-data.txt @@ -0,0 +1,15 @@ +(("../../../../doc/examples/quicktest.qif") #f 0) +(("../../../../doc/examples/Money95bank_fr.qif") #f 0) +(("../../../../doc/examples/Money95invst_fr.qif") #f 0) +(("../../../../doc/examples/Money95mfunds_fr.qif") #f 0) +(("../../../../doc/examples/Money95stocks_fr.qif") #f 0) +(("../../../../doc/examples/abc-all.qif") #f 0) +(("../../../../doc/examples/abc.qif") #f 0) +(("../../../../doc/examples/bogus.qif") #f 0) +(("../../../../doc/examples/cbb-export.qif") #f 0) +(("../../../../doc/examples/divx.qif") #f 0) +(("../../../../doc/examples/every.qif") #f 0) +(("../../../../doc/examples/ms-money.qif") #f 0) +(("../../../../doc/examples/quicktest.qif") #f 0) +(("../../../../doc/examples/swipe.qif") #f 0) +(("../../../../doc/examples/web.qif") #f 0) diff --git a/src/import-export/qif-io-core/test/data/number-data.txt b/src/import-export/qif-io-core/test/data/number-data.txt new file mode 100644 index 0000000000..f80eb25f00 --- /dev/null +++ b/src/import-export/qif-io-core/test/data/number-data.txt @@ -0,0 +1,3 @@ +(("1,000.00" decimal) #f "100000/100") +(("1,000.01" decimal) #f "100001/100") +(("1,000" decimal) #f "1000/1") diff --git a/src/import-export/qif-io-core/test/data/number-format-data.txt b/src/import-export/qif-io-core/test/data/number-format-data.txt new file mode 100644 index 0000000000..f7c4f70ad2 --- /dev/null +++ b/src/import-export/qif-io-core/test/data/number-format-data.txt @@ -0,0 +1,11 @@ +(("1,000.00" (decimal comma integer)) #f (decimal)) +(("1,000.000" (decimal comma integer)) #f (decimal)) +(("1.000,000" (decimal comma integer)) #f (comma)) +(("1000" (decimal comma integer)) #f (decimal comma integer)) +(("1000" (decimal comma)) #f (decimal comma)) +(("1,000" (decimal comma integer)) #f (decimal comma)) +(("1,000" (decimal comma integer)) #f (decimal comma)) +(("1,000.00" (comma)) #f ()) +(("1,000.01" (foo bar)) #t (qif-io:arg-type qif-io:check-number-format number-format foo)) +(("1,000" decimal) #t (qif-io:arg-type qif-io:check-number-format list decimal)) +((#f (decimal comma)) #t (qif-io:arg-type qif-io:check-number-format string #f)) diff --git a/src/import-export/qif-io-core/test/data/reader-data.txt b/src/import-export/qif-io-core/test/data/reader-data.txt new file mode 100644 index 0000000000..687a84138d --- /dev/null +++ b/src/import-export/qif-io-core/test/data/reader-data.txt @@ -0,0 +1,15 @@ +(("../../../../doc/examples/quicktest.qif") #f 0) +(("../../../../doc/examples/Money95bank_fr.qif") #f 0) +(("../../../../doc/examples/Money95invst_fr.qif") #f 0) +(("../../../../doc/examples/Money95mfunds_fr.qif") #f 0) +(("../../../../doc/examples/Money95stocks_fr.qif") #f 0) +(("../../../../doc/examples/abc-all.qif") #f 0) +(("../../../../doc/examples/abc.qif") #f 0) +(("../../../../doc/examples/bogus.qif") #f 0) +(("../../../../doc/examples/cbb-export.qif") #f 0) +(("../../../../doc/examples/divx.qif") #f 0) +(("../../../../doc/examples/every.qif") #f 0) +(("../../../../doc/examples/ms-money.qif") #f 0) +(("../../../../doc/examples/quicktest.qif") #f 0) +(("../../../../doc/examples/swipe.qif") #f 0) +(("../../../../doc/examples/web.qif") #f 0) diff --git a/src/import-export/qif-io-core/test/dump-qifobj.scm b/src/import-export/qif-io-core/test/dump-qifobj.scm new file mode 100644 index 0000000000..44d9fd22cd --- /dev/null +++ b/src/import-export/qif-io-core/test/dump-qifobj.scm @@ -0,0 +1,20 @@ +(debug-enable 'backtrace) + +(define (line-dump filename thunk) + (with-input-from-file filename + (lambda () + (let loop ((this-line (read))) + (if (not (eof-object? this-line)) + (begin + (apply thunk (car this-line)) + (loop (read)))))))) + +(define (read-file-thunk infile) + (let ((qiffile (qif-io:make-file #f #f #f #f #f #f #f))) + (simple-format #t "======= ~A ======\n" infile) + (qif-io:read-file qiffile infile #f) + (qif-io:write-file qiffile (simple-format #f "~A.out" infile)))) + +(gnc:module-load "qifiocore") + +(line-dump "data/reader-data.txt" read-file-thunk) diff --git a/src/import-export/qif-io-core/test/qiftest.gnc b/src/import-export/qif-io-core/test/qiftest.gnc new file mode 100644 index 0000000000..f03043fa92 --- /dev/null +++ b/src/import-export/qif-io-core/test/qiftest.gnc @@ -0,0 +1,218 @@ + + +2 +7 + + + 676b480e5cfaa3457ee392e3c51ced88 + NO_TYPE + 100000 + + + + e67c88bb5901cbd39a577e196258bb1d + NO_TYPE + 100000 + + + a45aab10729e86f89a09fdade4ccc2e0 + + 1999-03-18 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 329019000 + + Check Number: 203 + + + 9d2a30fa881189fbc8384f81e13fa709 + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + e2e6868646216b8e96d6c9273dda2dff + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + d46556507b3b7b19682763a184499486 + + 1999-03-19 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 315763000 + + Direct Deposit + + + 7035db7e9ba78c6dd4cc8967c5f5f954 + ADMINISTAFF COMP + c + 9999000/100000 + 9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 427cce0e2b033b697ca6433cd4f5ad13 + ADMINISTAFF COMP + n + -9999000/100000 + -9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + e3a6834c0a9695aa082562e48223e845 + + 1999-03-20 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 314187000 + + Point of Sale Transaction FRY'S + + + 71222dc2c372f559ce3a0ce4e2ae09ef + FOOD STOR 7770 E. MCDOWELL SCOTTSDALE + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 7af77bf9af90902aef1d1ec745614c4f + FOOD STOR 7770 E. MCDOWELL SCOTTSDALE + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + 5470ac24f1f928b1722720b4be94073a + + 1999-03-21 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 312579000 + + Point of Sale Transaction ABCO + + + 62a43470f3850db3af8be603292e0664 + FOODS #425 4101 N. 28TH STREET PHOENIX + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 0a6ed5cdf4aeaa0bb8540de7f118291b + FOODS #425 4101 N. 28TH STREET PHOENIX + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + 6500bf9438dcda6eef08336db1d6e309 + + 1999-03-22 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 310653000 + + Check Number: 200 + + + 221dc1b9ae283c96a330f8281849eced + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 82279f63494c9d3b4469e9eab793315b + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + dd52a96000be560b831a3c6b72756997 + + 1999-03-24 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 309076000 + + Point of Sale Transaction + + + 30f71490ba4dc5004f957994efa46ce5 + TGI FRIDAYS #1859 SCOTTSDALE AZUS + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 24c1b63b4037f310044c440eb25d6afa + TGI FRIDAYS #1859 SCOTTSDALE AZUS + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + c9106cc5f7fb3c5d89d019b67058b208 + + 1999-03-25 00:00:00 -0600 + + + 2001-07-27 11:28:22 -0500 + 307172000 + + Share Withdrawal + + + 32367c2efb4d0585c7e57443be43556c + c + -9999000/100000 + -9999000/100000 + e67c88bb5901cbd39a577e196258bb1d + + + 884a392c130f96856c0ffb3887c9eb9f + n + 9999000/100000 + 9999000/100000 + 676b480e5cfaa3457ee392e3c51ced88 + + + + + + + + diff --git a/src/import-export/qif-io-core/test/test-file-formats b/src/import-export/qif-io-core/test/test-file-formats new file mode 100755 index 0000000000..5cb5c299b6 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-file-formats @@ -0,0 +1,2 @@ +#!/bin/sh +guile -l test-file-formats.scm -c "(exit (run-test))" diff --git a/src/import-export/qif-io-core/test/test-file-formats.scm b/src/import-export/qif-io-core/test/test-file-formats.scm new file mode 100644 index 0000000000..b3064bf7ce --- /dev/null +++ b/src/import-export/qif-io-core/test/test-file-formats.scm @@ -0,0 +1,62 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; test-file-formats.scm +;; test the QIF file data format checker. +;; read each file, check field formats, compare with truth. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(debug-enable 'backtrace) + +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(gnc:module-load "gnucash/qif-io/core" 0) + +(define (run-test) + (define (line-test filename title thunk compare) + (let ((pass 0) + (fail 0) + (total 0)) + (with-input-from-file filename + (lambda () + (let loop ((this-line (read))) + (if (not (eof-object? this-line)) + (let* ((exception? #f) + (result + (catch #t + (lambda () + (apply thunk (car this-line))) + (lambda (key . rest) + (set! exception? #t) + (cons key rest)))) + (exception-expected? (cadr this-line)) + (correct-result (caddr this-line)) + (ok? (and (eq? exception? exception-expected?) + (compare result correct-result)))) + (set! total (+ 1 total)) + (if ok? + (set! pass (+ 1 pass)) + (begin + (simple-format #t "[fail] received ~S\n" result) + (simple-format #t " expected ~S\n" + correct-result) + (set! fail (+ 1 fail)))) + (loop (read))))))) + (simple-format #t "test ~A: pass=~S fail=~S\n" title pass fail) + (= pass total))) + + (let ((all-pass #t)) + (define (fmt-check-test filename) + (let ((qiffile (qif-io:make-empty-file))) + (qif-io:read-file qiffile filename #f) + (qif-io:check-possible-formats qiffile) + (list (qif-io:bank-xtn->record (qif-io:file-bank-xtn-format qiffile)) + (qif-io:invst-xtn->record + (qif-io:file-invst-xtn-format qiffile))))) + (set! all-pass + (and all-pass (line-test "data/file-formats-data.txt" + "qif-io:check-possible-formats" + fmt-check-test equal?))) + all-pass)) + + + diff --git a/src/import-export/qif-io-core/test/test-import-phase-1 b/src/import-export/qif-io-core/test/test-import-phase-1 new file mode 100755 index 0000000000..bc31467b79 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-import-phase-1 @@ -0,0 +1,2 @@ +#! /bin/sh +guile -l test-import-phase-1.scm -c "(run-test)" diff --git a/src/import-export/qif-io-core/test/test-import-phase-1.scm b/src/import-export/qif-io-core/test/test-import-phase-1.scm new file mode 100644 index 0000000000..748ae5756b --- /dev/null +++ b/src/import-export/qif-io-core/test/test-import-phase-1.scm @@ -0,0 +1,112 @@ +;; test-import-phase-1 +;; import the file by direct transaction mapping (don't remove any +;; duplicates) + +(debug-enable 'debug) +(debug-enable 'backtrace) + +(define (_ arg) arg) +(define (N_ arg) arg) + +(define (do-file filename) + (use-modules (gnucash gnc-module)) + (gnc:module-system-init) + (gnc:module-load "gnucash/qif-io/core" 0) + + (let ((qiffile (qif-io:make-empty-file)) + (acct-table (qif-io:make-empty-acct-table))) + + ;; read the file and look at data formats. we need to do this + ;; immediately when loading a file. + (qif-io:read-file qiffile filename #f) + + ;; this will throw out an exception if there are no possible correct + ;; interpretations. we'll correct the ambiguities + (catch 'qif-io:ambiguous-data-format + (lambda () + (qif-io:setup-data-formats qiffile)) + (lambda (key field-type field-name possible-formats continue-proc) + (simple-format #t "field format: n='~S' t='~S' v='~S' u='~S'\n" + field-name field-type possible-formats + (car possible-formats)) + (continue-proc (car possible-formats)))) + + ;; now we need to figure out what information is missing from this + ;; file. + (if (qif-io:file-xtns-need-acct? qiffile) + (qif-io:file-set-default-src-acct! qiffile filename)) + + (let ((commodity + (gnc:commodity-table-lookup + (gnc:engine-commodities) "ISO4217" "USD"))) + ;; import the bank transactions + (for-each + (lambda (xtn) + (qif-io:bank-xtn-import xtn qiffile acct-table commodity)) + (qif-io:file-bank-xtns qiffile)) + + ;; and the investment transactions + (for-each + (lambda (xtn) + (qif-io:invst-xtn-import xtn qiffile acct-table commodity)) + (qif-io:file-invst-xtns qiffile)) + + ;; build a gnucash account group + (let ((group (qif-io:acct-table-make-gnc-group + acct-table qiffile commodity))) + ;; write the file + (let ((book (gnc:book-new)) + (name (simple-format #f "file:~A.gnc" filename))) + (simple-format #t "using book name='~A'\n" name) + (gnc:book-set-group book group) + (gnc:book-begin book name #t #t) + (gnc:book-save book) + (gnc:book-end book))))) + 0) + +(define (run-test) + (define (line-test filename title thunk compare) + (let ((pass 0) + (fail 0) + (total 0)) + (with-input-from-file filename + (lambda () + (let loop ((this-line (read))) + (if (not (eof-object? this-line)) + (let* ((exception? #f) + (result + (apply thunk (car this-line))) +; (catch #t +; (lambda () +; (apply thunk (car this-line))) +; (lambda (key . rest) +; (set! exception? #t) +; (cons key rest)))) + (exception-expected? (cadr this-line)) + (correct-result (caddr this-line)) + (ok? (and (eq? exception? exception-expected?) + (compare result correct-result)))) + (set! total (+ 1 total)) + (if ok? + (set! pass (+ 1 pass)) + (begin + (simple-format #t "[fail] test ~S\n" (car this-line)) + (simple-format #t " received ~S\n" result) + (simple-format #t " expected ~S\n" + correct-result) + (set! fail (+ 1 fail)))) + (loop (read))))))) + (simple-format #t "test ~A: pass=~S fail=~S\n" title pass fail) + (= pass total))) + + (let ((all-pass #t)) + (set! all-pass + (and all-pass (line-test "data/import-phase-1-data.txt" + "import phase 1" + do-file equal?))) + (if all-pass + (exit 0) + (exit -1)))) + + + diff --git a/src/import-export/qif-io-core/test/test-load-module b/src/import-export/qif-io-core/test/test-load-module new file mode 100755 index 0000000000..bb4492c8f1 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-load-module @@ -0,0 +1,2 @@ +#!/bin/sh +guile -l ./test-load-module.scm -c "(run-test)" diff --git a/src/import-export/qif-io-core/test/test-load-module.scm b/src/import-export/qif-io-core/test/test-load-module.scm new file mode 100644 index 0000000000..d1781697b0 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-load-module.scm @@ -0,0 +1,7 @@ + +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(define (run-test) + (gnc:module-load "gnucash/qif-io/core" 0)) + diff --git a/src/import-export/qif-io-core/test/test-parser b/src/import-export/qif-io-core/test/test-parser new file mode 100755 index 0000000000..47e368ac3e --- /dev/null +++ b/src/import-export/qif-io-core/test/test-parser @@ -0,0 +1,2 @@ +#!/bin/sh +guile -l test-parser.scm -c "(exit (run-test))" diff --git a/src/import-export/qif-io-core/test/test-parser.scm b/src/import-export/qif-io-core/test/test-parser.scm new file mode 100644 index 0000000000..834b097628 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-parser.scm @@ -0,0 +1,81 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; test-parser.scm +;; +;; test the QIF parser. the data files are just scheme data; the +;; first element is the arg to be parsed, the second indicates +;; whether an exception is expected, and the third indicates either +;; the return value (if no exception) or the type of exception and +;; args. For example, for the date file, +;; ("02/01/2001" #f (2 1 2001)) +;; (#f #t (qif-io:arg-type string #f)) +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(gnc:module-load "gnucash/qif-io/core" 0) + +(debug-enable 'debug) +(debug-enable 'backtrace) + +(define (run-test) + (define (line-test filename title thunk compare) + (let ((pass 0) + (fail 0) + (total 0)) + (with-input-from-file filename + (lambda () + (let loop ((this-line (read))) + (if (not (eof-object? this-line)) + (let* ((exception? #f) + (result + (catch #t + (lambda () + (apply thunk (car this-line))) + (lambda (key . rest) + (set! exception? #t) + (cons key rest)))) + (exception-expected? (cadr this-line)) + (correct-result (caddr this-line)) + (ok? (and (eq? exception? exception-expected?) + (compare result correct-result)))) + (set! total (+ 1 total)) + (if ok? + (set! pass (+ 1 pass)) + (begin + (simple-format #t "[fail] received ~S\n" result) + (simple-format #t " expected ~S\n" + correct-result) + (set! fail (+ 1 fail)))) + (loop (read))))))) + (simple-format #t "test ~A: pass=~S fail=~S\n" title pass fail) + (= pass total))) + + (let ((all-pass #t)) + (define (parse-number/format num fmt) + (let* ((gncn (qif-io:parse-number/format num fmt)) + (nstr (gnc:numeric-to-string gncn))) + nstr)) + + ;; test category reading + (set! all-pass + (and all-pass (line-test "data/category-data.txt" "parse-category" + qif-io:parse-category equal?))) + ;; date parsing + (set! all-pass + (and all-pass (line-test "data/date-data.txt" "parse-date/format" + qif-io:parse-date/format equal?))) + (set! all-pass + (and all-pass (line-test "data/date-format-data.txt" + "check-date-format" + qif-io:check-date-format equal?))) + + ;; number parsing + (set! all-pass + (and all-pass (line-test "data/number-data.txt" "parse-number/format" + parse-number/format equal?))) + (set! all-pass + (and all-pass (line-test "data/number-format-data.txt" + "check-number-format" + qif-io:check-number-format equal?))) + all-pass)) diff --git a/src/import-export/qif-io-core/test/test-reader b/src/import-export/qif-io-core/test/test-reader new file mode 100755 index 0000000000..80b8f7e77e --- /dev/null +++ b/src/import-export/qif-io-core/test/test-reader @@ -0,0 +1,2 @@ +#!/bin/sh +guile -l ./test-reader.scm -c "(exit (run-test))" diff --git a/src/import-export/qif-io-core/test/test-reader.scm b/src/import-export/qif-io-core/test/test-reader.scm new file mode 100644 index 0000000000..7724c7ba55 --- /dev/null +++ b/src/import-export/qif-io-core/test/test-reader.scm @@ -0,0 +1,76 @@ +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;; test-reader.scm +;; +;; test the QIF reader. see test-parser.scm for info on the structure +;; of the test data files. +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; + +(use-modules (gnucash gnc-module)) +(gnc:module-system-init) + +(gnc:module-load "gnucash/qif-io/core" 0) + +(define (read-record-test qiffile) + (let ((inport (open-input-file qiffile)) + (outport (open-output-file "/tmp/test-reader.tmp")) + (record '()) + (eof? #f)) + (let loop () + (catch 'qif-io:parser-state + (lambda () + (let ((record (qif-io:read-record inport))) + (set! eof? (caddr record)) + (if (not eof?) + (qif-io:write-record (car record) outport)))) + (lambda (key new-state) + (simple-format outport "!~A\n" new-state))) + (if (not eof?) + (loop))) + (close-output-port outport) + (close-input-port inport) + (system (simple-format #f "diff -b -I \"\\^*\" ~A /tmp/test-reader.tmp" + qiffile)))) + + +(define (run-test) + (define (line-test filename title thunk compare) + (let ((pass 0) + (fail 0) + (total 0)) + (with-input-from-file filename + (lambda () + (let loop ((this-line (read))) + (if (not (eof-object? this-line)) + (let* ((exception? #f) + (result + (catch #t + (lambda () + (apply thunk (car this-line))) + (lambda (key . rest) + (set! exception? #t) + (cons key rest)))) + (exception-expected? (cadr this-line)) + (correct-result (caddr this-line)) + (ok? (and (eq? exception? exception-expected?) + (compare result correct-result)))) + (set! total (+ 1 total)) + (if ok? + (set! pass (+ 1 pass)) + (begin + (simple-format #t "[fail] received ~S\n" result) + (simple-format #t " expected ~S\n" + correct-result) + (set! fail (+ 1 fail)))) + (loop (read))))))) + (simple-format #t "test ~A: pass=~S fail=~S\n" title pass fail) + (= pass total))) + + (let ((all-pass #t)) + ;; test record reading / writing + (set! all-pass + (and all-pass (line-test "data/reader-data.txt" "read-record" + read-record-test equal?))) + all-pass)) + + + diff --git a/src/register/Makefile.am b/src/register/Makefile.am index 59a3ad3211..a1de4da451 100644 --- a/src/register/Makefile.am +++ b/src/register/Makefile.am @@ -1,51 +1 @@ -SUBDIRS = gnome - -noinst_LIBRARIES = libgncregister.a - -libgncregister_a_SOURCES = \ - QuickFill.c \ - basiccell.c \ - cell-factory.c \ - cellblock.c \ - gtable.c \ - numcell.c \ - pricecell.c \ - quickfillcell.c \ - recncell.c \ - register-common.c \ - splitreg.c \ - table-allgui.c \ - table-gnome.c \ - table-model.c \ - textcell.c - -noinst_HEADERS = \ - QuickFill.h \ - basiccell.h \ - cell-factory.h \ - cellblock.h \ - combocell.h \ - datecell.h \ - gtable.h \ - numcell.h \ - pricecell.h \ - quickfillcell.h \ - recncell.h \ - register-common.h \ - splitreg.h \ - table-allgui.h \ - table-model.h \ - textcell.h - -EXTRA_DIST = \ - .cvsignore - -CFLAGS = @CFLAGS@ - -INCLUDES = \ - -I${top_srcdir}/src \ - -I${top_srcdir}/src/engine \ - -I${top_srcdir}/src/guile \ - -I${top_srcdir}/src/register/gnome \ - ${GNOME_INCLUDEDIR} \ - ${GUILE_INCS} +SUBDIRS=ledger-core register-core register-gnome diff --git a/src/register/gnome/.cvsignore b/src/register/gnome/.cvsignore deleted file mode 100644 index 051d1bd50b..0000000000 --- a/src/register/gnome/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -.deps diff --git a/src/register/ledger-core/Makefile.am b/src/register/ledger-core/Makefile.am new file mode 100644 index 0000000000..dddb8f0fba --- /dev/null +++ b/src/register/ledger-core/Makefile.am @@ -0,0 +1,20 @@ +lib_LTLIBRARIES=libgncmod-ledger-core.la + +libgncmod_ledger_core_la_SOURCES=\ + gncmod-ledger-core.c \ + SplitLedger.c \ + MultiLedger.c + +libgncmod_ledger_core_la_LDFLAGS=-module -L${top_srcdir}/src/engine \ + -L${top_srcdir}/src/engine/.libs -lgncmod-engine + +CFLAGS=@CFLAGS@ + +INCLUDES= \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/engine \ + -I${top_srcdir}/src/guile \ + -I${top_srcdir}/src/gnc-module \ + -I${top_srcdir}/src/register/register-core \ + ${GNOME_INCLUDEDIR} \ + ${GLIB_CFLAGS} diff --git a/src/MultiLedger.c b/src/register/ledger-core/MultiLedger.c similarity index 100% rename from src/MultiLedger.c rename to src/register/ledger-core/MultiLedger.c diff --git a/src/MultiLedger.h b/src/register/ledger-core/MultiLedger.h similarity index 100% rename from src/MultiLedger.h rename to src/register/ledger-core/MultiLedger.h diff --git a/src/RegWindow.h b/src/register/ledger-core/RegWindow.h similarity index 100% rename from src/RegWindow.h rename to src/register/ledger-core/RegWindow.h diff --git a/src/SplitLedger.c b/src/register/ledger-core/SplitLedger.c similarity index 100% rename from src/SplitLedger.c rename to src/register/ledger-core/SplitLedger.c diff --git a/src/SplitLedger.h b/src/register/ledger-core/SplitLedger.h similarity index 100% rename from src/SplitLedger.h rename to src/register/ledger-core/SplitLedger.h diff --git a/src/register/ledger-core/gncmod-ledger-core.c b/src/register/ledger-core/gncmod-ledger-core.c new file mode 100644 index 0000000000..80b84ef0e3 --- /dev/null +++ b/src/register/ledger-core/gncmod-ledger-core.c @@ -0,0 +1,44 @@ +/********************************************************************* + * gncmod-ledgercore.c + * module definition/initialization for core (gui-independent) ledger + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/register/ledger-core"); +} + +char * +gnc_module_description(void) { + return g_strdup("Toolkit-independent GUI for financial ledgers"); +} + +int +gnc_module_init(int refcount) { + if(refcount == 0) + { + if(!gnc_module_load("gnucash/engine", 0)) + { + return FALSE; + } + if(!gnc_module_load("gnucash/register/register-core", 0)) + { + return FALSE; + } + } + return TRUE; +} + diff --git a/src/register/register-core/Makefile.am b/src/register/register-core/Makefile.am new file mode 100644 index 0000000000..ed2b13a0c0 --- /dev/null +++ b/src/register/register-core/Makefile.am @@ -0,0 +1,52 @@ +lib_LTLIBRARIES = libgncmod-register-core.la + +libgncmod_register_core_la_SOURCES = \ + gncmod-register-core.c \ + QuickFill.c \ + basiccell.c \ + cell-factory.c \ + cellblock.c \ + gtable.c \ + numcell.c \ + pricecell.c \ + quickfillcell.c \ + recncell.c \ + register-common.c \ + splitreg.c \ + table-allgui.c \ + table-model.c \ + textcell.c + +noinst_HEADERS = \ + QuickFill.h \ + basiccell.h \ + cell-factory.h \ + cellblock.h \ + combocell.h \ + datecell.h \ + gtable.h \ + numcell.h \ + pricecell.h \ + quickfillcell.h \ + recncell.h \ + register-common.h \ + splitreg.h \ + table-allgui.h \ + table-model.h \ + textcell.h + +EXTRA_DIST = \ + .cvsignore + +CFLAGS = @CFLAGS@ + +INCLUDES = \ + -I${top_srcdir}/src \ + -I${top_srcdir}/src/engine \ + -I${top_srcdir}/src/gnc-module \ + -I${top_srcdir}/src/guile \ + ${GLIB_CFLAGS} \ + ${GNOME_INCLUDEDIR} \ + ${GUILE_INCS} + + diff --git a/src/register/QuickFill.c b/src/register/register-core/QuickFill.c similarity index 100% rename from src/register/QuickFill.c rename to src/register/register-core/QuickFill.c diff --git a/src/register/QuickFill.h b/src/register/register-core/QuickFill.h similarity index 100% rename from src/register/QuickFill.h rename to src/register/register-core/QuickFill.h diff --git a/src/register/README b/src/register/register-core/README similarity index 100% rename from src/register/README rename to src/register/register-core/README diff --git a/src/register/basiccell.c b/src/register/register-core/basiccell.c similarity index 100% rename from src/register/basiccell.c rename to src/register/register-core/basiccell.c diff --git a/src/register/basiccell.h b/src/register/register-core/basiccell.h similarity index 100% rename from src/register/basiccell.h rename to src/register/register-core/basiccell.h diff --git a/src/register/cell-factory.c b/src/register/register-core/cell-factory.c similarity index 100% rename from src/register/cell-factory.c rename to src/register/register-core/cell-factory.c diff --git a/src/register/cell-factory.h b/src/register/register-core/cell-factory.h similarity index 100% rename from src/register/cell-factory.h rename to src/register/register-core/cell-factory.h diff --git a/src/register/cellblock.c b/src/register/register-core/cellblock.c similarity index 100% rename from src/register/cellblock.c rename to src/register/register-core/cellblock.c diff --git a/src/register/cellblock.h b/src/register/register-core/cellblock.h similarity index 100% rename from src/register/cellblock.h rename to src/register/register-core/cellblock.h diff --git a/src/register/combocell.h b/src/register/register-core/combocell.h similarity index 100% rename from src/register/combocell.h rename to src/register/register-core/combocell.h diff --git a/src/register/datecell.h b/src/register/register-core/datecell.h similarity index 100% rename from src/register/datecell.h rename to src/register/register-core/datecell.h diff --git a/src/register/formulacell.h b/src/register/register-core/formulacell.h similarity index 100% rename from src/register/formulacell.h rename to src/register/register-core/formulacell.h diff --git a/src/register/register-core/gncmod-register-core.c b/src/register/register-core/gncmod-register-core.c new file mode 100644 index 0000000000..eac73399cd --- /dev/null +++ b/src/register/register-core/gncmod-register-core.c @@ -0,0 +1,41 @@ +/********************************************************************* + * gncmod-registercore.c + * module definition/initialization for core (gui-independent) register + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/register/register-core"); +} + +char * +gnc_module_description(void) { + return g_strdup("Toolkit-independent GUI for ledger-like table displays"); +} + +int +gnc_module_init(int refcount) { + if(refcount == 0) + { + if(!gnc_module_load("gnucash/engine", 0)) + { + return FALSE; + } + } + return TRUE; +} + + diff --git a/src/register/gtable.c b/src/register/register-core/gtable.c similarity index 100% rename from src/register/gtable.c rename to src/register/register-core/gtable.c diff --git a/src/register/gtable.h b/src/register/register-core/gtable.h similarity index 100% rename from src/register/gtable.h rename to src/register/register-core/gtable.h diff --git a/src/register/numcell.c b/src/register/register-core/numcell.c similarity index 100% rename from src/register/numcell.c rename to src/register/register-core/numcell.c diff --git a/src/register/numcell.h b/src/register/register-core/numcell.h similarity index 100% rename from src/register/numcell.h rename to src/register/register-core/numcell.h diff --git a/src/register/pricecell.c b/src/register/register-core/pricecell.c similarity index 100% rename from src/register/pricecell.c rename to src/register/register-core/pricecell.c diff --git a/src/register/pricecell.h b/src/register/register-core/pricecell.h similarity index 100% rename from src/register/pricecell.h rename to src/register/register-core/pricecell.h diff --git a/src/register/quickfillcell.c b/src/register/register-core/quickfillcell.c similarity index 100% rename from src/register/quickfillcell.c rename to src/register/register-core/quickfillcell.c diff --git a/src/register/quickfillcell.h b/src/register/register-core/quickfillcell.h similarity index 100% rename from src/register/quickfillcell.h rename to src/register/register-core/quickfillcell.h diff --git a/src/register/recncell.c b/src/register/register-core/recncell.c similarity index 100% rename from src/register/recncell.c rename to src/register/register-core/recncell.c diff --git a/src/register/recncell.h b/src/register/register-core/recncell.h similarity index 100% rename from src/register/recncell.h rename to src/register/register-core/recncell.h diff --git a/src/register/register-common.c b/src/register/register-core/register-common.c similarity index 100% rename from src/register/register-common.c rename to src/register/register-core/register-common.c diff --git a/src/register/register-common.h b/src/register/register-core/register-common.h similarity index 100% rename from src/register/register-common.h rename to src/register/register-core/register-common.h diff --git a/src/register/splitreg.c b/src/register/register-core/splitreg.c similarity index 100% rename from src/register/splitreg.c rename to src/register/register-core/splitreg.c diff --git a/src/register/splitreg.h b/src/register/register-core/splitreg.h similarity index 100% rename from src/register/splitreg.h rename to src/register/register-core/splitreg.h diff --git a/src/register/table-allgui.c b/src/register/register-core/table-allgui.c similarity index 100% rename from src/register/table-allgui.c rename to src/register/register-core/table-allgui.c diff --git a/src/register/table-allgui.h b/src/register/register-core/table-allgui.h similarity index 100% rename from src/register/table-allgui.h rename to src/register/register-core/table-allgui.h diff --git a/src/register/register-core/table-html.c b/src/register/register-core/table-html.c new file mode 100644 index 0000000000..e9ae7105a4 --- /dev/null +++ b/src/register/register-core/table-html.c @@ -0,0 +1,253 @@ +/********************************************************************\ + * table-html.c -- print table as html * + * * + * 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 2 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, contact: * + * * + * Free Software Foundation Voice: +1-617-542-5942 * + * 59 Temple Place - Suite 330 Fax: +1-617-542-2652 * + * Boston, MA 02111-1307, USA gnu@gnu.org * + * * +\********************************************************************/ + +/* + * FILE: + * table-html.c + * + * FUNCTION: + * Implements the infrastructure for the displayed table. + * This is just a sample hack for printing html to a file, + * or by acting as a web server. Its cheesey, for several + * reasons: + * + * (1) HTML should never be put in the same file as C code. + * Some sort of template file should be used. + * + * (2) The data printed hre is obtained from the displayed + * ledger/register. Thus, it accurately reflects + * what's in the ledger, but is otherwise a cheesy way + * of doing a report. Real report generators should + * get the financial data straight from the engine, + * not from the register. + * + * (3) The so-called "webserver" has less intelligence + * than a mosquito. + * + * But this code is fun, so what the hey. + * + * + * HISTORY: + * Copyright (c) 1998 Linas Vepstas + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +#include "cellblock.h" +#include "table-allgui.h" +#include "table-html.h" +#include "util.h" + +/* This static indicates the debugging module that this .o belongs to. */ +static short module = MOD_REGISTER; + +/* ==================================================== */ + +CellBlock * +getcurs (Table *table, int prow) +{ + int vrow; + vrow = table->locators[prow][0]->virt_row; + return (table->handlers[vrow][0]); +} + +int +xaccTableDumpHTML (Table * table, int fd) +{ + FILE * fh; + int i, j; + CellBlock *curs, *head, *trans; + int cnt = 0; + + if ((!table) || (0 > fd)) return 0; + + /* fd could be a file descriptor for a file, or for a socket. */ + fh = fdopen (fd, "a"); + if (!fh) { + int norr = errno; + PERR ("can't open fd=%d \n" + "\t(%d) %s \n", fd, norr, strerror (norr)); + return 0; + } + + /* print the header */ + cnt += fprintf (fh, + "\n" + "GnuCash Regsiter\n" + "\n" + "

GnuCash Register

\n" + "\n"); + + /* print the table header rows */ + head = getcurs (table, 0); + i = 0; + do { + cnt += fprintf (fh, "\n"); + for (j=0; jnum_phys_cols; j++) { + cnt += fprintf (fh, "", table->entries[i][j]); + } + cnt += fprintf (fh, "\n"); + + i++; + curs = getcurs (table, i); + } while (head == curs); + trans = curs; + + /* print the body of the table */ + for (; inum_phys_rows; i++) { + curs = getcurs (table, i); + + if (trans == curs) { + cnt += fprintf (fh, "\n"); + } else { + cnt += fprintf (fh, "\n"); + } + + for (j=0; jnum_phys_cols; j++) { + if (0x0 == table->entries[i][j][0]) { + cnt += fprintf (fh, ""); + } else { + cnt += fprintf (fh, "", table->entries[i][j]); + } + } + cnt += fprintf (fh, "\n"); + } + + cnt += fprintf (fh, "
%s
 %s
"); + fflush (fh); + + return cnt; +} + +/* ==================================================== */ + +int +xaccTablePrintHTML (Table * table, char *filename) +{ + int fd; + int cnt; + + if ((!table) || (!filename)) return 0; + + fd = open (filename, O_CREAT | O_APPEND | O_WRONLY, S_IRUSR | S_IWUSR); + if (0 > fd) { + int norr = errno; + PERR ("can't open file %s\n" + "\t(%d) %s\n", filename, norr, strerror (norr)); + return 0; + } + cnt = xaccTableDumpHTML (table, fd); + close (fd); + return (cnt); +} + +/* ==================================================== */ +/* implement a cheesy web server */ +/* maybe not the worlds smallest web server, but close */ + +#define CHKERR(val, msg) { \ + if (0 > val) { \ + int norr = errno; \ + PERR ( msg "\n" \ + "(%d) %s \n", norr, strerror (norr)); \ + if (pid) return; \ + exit (0); \ + } \ +} + +void +xaccTableWebServeHTML (Table * table, unsigned short port) +{ + int listen_fd, accept_fd; + pid_t pid; + int rc; + struct sockaddr_in myaddr; + struct sockaddr clientsock; + int clientaddrsize = sizeof (struct sockaddr); + fd_set readfds; + struct timeval timeout; + char buff[255]; + int cnt; + + if (!table) return; + + /* don't slow down the parent, fork into background */ + pid = fork(); + if (0 < pid) return; /* parent */ + CHKERR (pid, "cant fork"); + + /* create a socket */ + listen_fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); + CHKERR (listen_fd, "cant listen"); + + memset ((void*) &myaddr, 0, sizeof (struct sockaddr_in)); + myaddr.sin_family = AF_INET; + myaddr.sin_addr.s_addr = htonl (INADDR_ANY); + myaddr.sin_port = htons (port); /* WWW server is port 80 but that is usperuser only */ + rc = bind (listen_fd, (struct sockaddr *) &myaddr, sizeof (struct sockaddr)); + CHKERR (rc, "cant bind"); + + rc = listen (listen_fd, 10); + CHKERR (rc, "cant listen"); + + /* if no one connects to us after 8 minutes, just exit */ + FD_ZERO (&readfds); + FD_SET (listen_fd, &readfds); + timeout.tv_sec = 500; + timeout.tv_usec = 0; + rc = select (160, &readfds, NULL, NULL, &timeout); + CHKERR (rc, "cant select"); + if (0 == rc) exit (0); + + accept_fd = accept (listen_fd, &clientsock, &clientaddrsize); + CHKERR (rc, "cant accept"); + + /* count the number of chars, for content-length */ + cnt = xaccTablePrintHTML (table, "/dev/null"); + snprintf (buff, 255, + "HTTP/1.0 200 OK\n" + "Connection: close\n" + "Content-Length: %d\n" + "Content-Type: text/html\n\n", cnt); + write (accept_fd, buff, sizeof (buff)); + xaccTableDumpHTML (table, accept_fd); + + /* linger for some @#$%^ reason, otherwise browser complains */ + sleep (30); + shutdown (accept_fd, 1); + close (accept_fd); + close (listen_fd); + exit (0); +} + +/* ================== end of file ======================= */ diff --git a/src/engine/DateUtils.h b/src/register/register-core/table-html.h similarity index 73% rename from src/engine/DateUtils.h rename to src/register/register-core/table-html.h index a70de67c93..f1f6b70894 100644 --- a/src/engine/DateUtils.h +++ b/src/register/register-core/table-html.h @@ -1,6 +1,5 @@ /********************************************************************\ - * DateUtils.h -- Date Handling Utilities * - * Copyright (C) 1998 Linas Vepstas * + * table-html.h -- print table as html * * * * This program is free software; you can redistribute it and/or * * modify it under the terms of the GNU General Public License as * @@ -21,17 +20,24 @@ * * \********************************************************************/ -#ifndef XACC_DATE_UTILS_H -#define XACC_DATE_UTILS_H +/* + * FILE: + * table-html.h + * + * FUNCTION: + * This header defines the HTML specific functions + * associated with the Table GUI. This is just sample code. + * + * HISTORY: + * Copyright (c) 1998 Linas Vepstas + */ -#include +#ifndef XACC_TABLE_HTML_H +#define XACC_TABLE_HTML_H -#include "config.h" +int xaccTableDumpHTML (Table * table, int fd); +int xaccTablePrintHTML (Table * table, char *filename); +void xaccTableWebServeHTML (Table * table, unsigned short port); -char * xaccDateUtilGetStamp (time_t thyme); -char * xaccDateUtilGetStampNow (void); -#endif /* XACC_DATE_UTILS_H */ - -/************************ END OF ************************************\ -\************************* FILE *************************************/ +#endif XACC_TABLE_HTML_H diff --git a/src/register/table-model.c b/src/register/register-core/table-model.c similarity index 100% rename from src/register/table-model.c rename to src/register/register-core/table-model.c diff --git a/src/register/table-model.h b/src/register/register-core/table-model.h similarity index 100% rename from src/register/table-model.h rename to src/register/register-core/table-model.h diff --git a/src/register/textcell.c b/src/register/register-core/textcell.c similarity index 100% rename from src/register/textcell.c rename to src/register/register-core/textcell.c diff --git a/src/register/textcell.h b/src/register/register-core/textcell.h similarity index 100% rename from src/register/textcell.h rename to src/register/register-core/textcell.h diff --git a/src/register/gnome/Makefile.am b/src/register/register-gnome/Makefile.am similarity index 64% rename from src/register/gnome/Makefile.am rename to src/register/register-gnome/Makefile.am index f01037aeb8..374d6a6fcb 100644 --- a/src/register/gnome/Makefile.am +++ b/src/register/register-gnome/Makefile.am @@ -1,7 +1,7 @@ +lib_LTLIBRARIES = libgncmod-register-gnome.la -noinst_LIBRARIES = libgncregistergnome.a - -libgncregistergnome_a_SOURCES = \ +libgncmod_register_gnome_la_SOURCES = \ + gncmod-register-gnome.c \ combocell-gnome.c \ datecell-gnome.c \ gnucash-color.c \ @@ -15,7 +15,8 @@ libgncregistergnome_a_SOURCES = \ gnucash-sheet.c \ gnucash-style.c \ quickfillcell-gnome.c \ - pricecell-gnome.c + pricecell-gnome.c \ + table-gnome.c noinst_HEADERS = \ gnucash-color.h \ @@ -32,10 +33,14 @@ noinst_HEADERS = \ EXTRA_DIST = \ .cvsignore -CFLAGS = @CFLAGS@ ${GTK_XIM_FLAGS} ${GNOME_INCLUDEDIR} ${GLIB_CFLAGS} +CFLAGS = @CFLAGS@ ${GTK_XIM_FLAGS} INCLUDES = \ -I${top_srcdir}/src \ -I${top_srcdir}/src/engine \ - -I${top_srcdir}/src/register \ + -I${top_srcdir}/src/guile \ + -I${top_srcdir}/src/gnc-module \ + -I${top_srcdir}/src/register/ledger-core \ + -I${top_srcdir}/src/register/register-core \ + ${GLIB_CFLAGS} \ ${GNOME_INCLUDEDIR} diff --git a/src/register/gnome/combocell-gnome.c b/src/register/register-gnome/combocell-gnome.c similarity index 100% rename from src/register/gnome/combocell-gnome.c rename to src/register/register-gnome/combocell-gnome.c diff --git a/src/register/gnome/datecell-gnome.c b/src/register/register-gnome/datecell-gnome.c similarity index 100% rename from src/register/gnome/datecell-gnome.c rename to src/register/register-gnome/datecell-gnome.c diff --git a/src/register/register-gnome/gncmod-register-gnome.c b/src/register/register-gnome/gncmod-register-gnome.c new file mode 100644 index 0000000000..3d74ddb315 --- /dev/null +++ b/src/register/register-gnome/gncmod-register-gnome.c @@ -0,0 +1,43 @@ +/********************************************************************* + * gncmod-register-gnome.c + * module definition/initialization for Gnome parts of register + * + * Copyright (c) 2001 Linux Developers Group, Inc. + *********************************************************************/ + +#include +#include "gnc-module.h" + +/* version of the gnc module system interface we require */ +int gnc_module_system_interface = 0; + +/* module versioning uses libtool semantics. */ +int gnc_module_current = 0; +int gnc_module_revision = 0; +int gnc_module_age = 0; + +char * +gnc_module_path(void) { + return g_strdup("gnucash/register/register-gnome"); +} + +char * +gnc_module_description(void) { + return g_strdup("Gnome GUI for ledger-like table displays"); +} + +int +gnc_module_init(int refcount) { + if(refcount == 0) + { + if(!gnc_module_load("gnucash/engine", 0)) { + return FALSE; + } + if(!gnc_module_load("gnucash/register/register-core", 0)) { + return FALSE; + } + } + return TRUE; +} + + diff --git a/src/register/gnome/gnucash-color.c b/src/register/register-gnome/gnucash-color.c similarity index 100% rename from src/register/gnome/gnucash-color.c rename to src/register/register-gnome/gnucash-color.c diff --git a/src/register/gnome/gnucash-color.h b/src/register/register-gnome/gnucash-color.h similarity index 100% rename from src/register/gnome/gnucash-color.h rename to src/register/register-gnome/gnucash-color.h diff --git a/src/register/gnome/gnucash-cursor.c b/src/register/register-gnome/gnucash-cursor.c similarity index 100% rename from src/register/gnome/gnucash-cursor.c rename to src/register/register-gnome/gnucash-cursor.c diff --git a/src/register/gnome/gnucash-cursor.h b/src/register/register-gnome/gnucash-cursor.h similarity index 100% rename from src/register/gnome/gnucash-cursor.h rename to src/register/register-gnome/gnucash-cursor.h diff --git a/src/register/gnome/gnucash-date-picker.c b/src/register/register-gnome/gnucash-date-picker.c similarity index 100% rename from src/register/gnome/gnucash-date-picker.c rename to src/register/register-gnome/gnucash-date-picker.c diff --git a/src/register/gnome/gnucash-date-picker.h b/src/register/register-gnome/gnucash-date-picker.h similarity index 100% rename from src/register/gnome/gnucash-date-picker.h rename to src/register/register-gnome/gnucash-date-picker.h diff --git a/src/register/gnome/gnucash-grid.c b/src/register/register-gnome/gnucash-grid.c similarity index 100% rename from src/register/gnome/gnucash-grid.c rename to src/register/register-gnome/gnucash-grid.c diff --git a/src/register/gnome/gnucash-grid.h b/src/register/register-gnome/gnucash-grid.h similarity index 100% rename from src/register/gnome/gnucash-grid.h rename to src/register/register-gnome/gnucash-grid.h diff --git a/src/register/gnome/gnucash-header.c b/src/register/register-gnome/gnucash-header.c similarity index 100% rename from src/register/gnome/gnucash-header.c rename to src/register/register-gnome/gnucash-header.c diff --git a/src/register/gnome/gnucash-header.h b/src/register/register-gnome/gnucash-header.h similarity index 100% rename from src/register/gnome/gnucash-header.h rename to src/register/register-gnome/gnucash-header.h diff --git a/src/register/gnome/gnucash-item-edit.c b/src/register/register-gnome/gnucash-item-edit.c similarity index 100% rename from src/register/gnome/gnucash-item-edit.c rename to src/register/register-gnome/gnucash-item-edit.c diff --git a/src/register/gnome/gnucash-item-edit.h b/src/register/register-gnome/gnucash-item-edit.h similarity index 100% rename from src/register/gnome/gnucash-item-edit.h rename to src/register/register-gnome/gnucash-item-edit.h diff --git a/src/register/gnome/gnucash-item-list.c b/src/register/register-gnome/gnucash-item-list.c similarity index 100% rename from src/register/gnome/gnucash-item-list.c rename to src/register/register-gnome/gnucash-item-list.c diff --git a/src/register/gnome/gnucash-item-list.h b/src/register/register-gnome/gnucash-item-list.h similarity index 100% rename from src/register/gnome/gnucash-item-list.h rename to src/register/register-gnome/gnucash-item-list.h diff --git a/src/register/gnome/gnucash-scrolled-window.c b/src/register/register-gnome/gnucash-scrolled-window.c similarity index 100% rename from src/register/gnome/gnucash-scrolled-window.c rename to src/register/register-gnome/gnucash-scrolled-window.c diff --git a/src/register/gnome/gnucash-scrolled-window.h b/src/register/register-gnome/gnucash-scrolled-window.h similarity index 100% rename from src/register/gnome/gnucash-scrolled-window.h rename to src/register/register-gnome/gnucash-scrolled-window.h diff --git a/src/register/gnome/gnucash-sheet.c b/src/register/register-gnome/gnucash-sheet.c similarity index 100% rename from src/register/gnome/gnucash-sheet.c rename to src/register/register-gnome/gnucash-sheet.c diff --git a/src/register/gnome/gnucash-sheet.h b/src/register/register-gnome/gnucash-sheet.h similarity index 100% rename from src/register/gnome/gnucash-sheet.h rename to src/register/register-gnome/gnucash-sheet.h diff --git a/src/register/gnome/gnucash-style.c b/src/register/register-gnome/gnucash-style.c similarity index 100% rename from src/register/gnome/gnucash-style.c rename to src/register/register-gnome/gnucash-style.c diff --git a/src/register/gnome/gnucash-style.h b/src/register/register-gnome/gnucash-style.h similarity index 100% rename from src/register/gnome/gnucash-style.h rename to src/register/register-gnome/gnucash-style.h diff --git a/src/register/gnome/pricecell-gnome.c b/src/register/register-gnome/pricecell-gnome.c similarity index 100% rename from src/register/gnome/pricecell-gnome.c rename to src/register/register-gnome/pricecell-gnome.c diff --git a/src/register/gnome/quickfillcell-gnome.c b/src/register/register-gnome/quickfillcell-gnome.c similarity index 100% rename from src/register/gnome/quickfillcell-gnome.c rename to src/register/register-gnome/quickfillcell-gnome.c diff --git a/src/register/table-gnome.c b/src/register/register-gnome/table-gnome.c similarity index 100% rename from src/register/table-gnome.c rename to src/register/register-gnome/table-gnome.c diff --git a/src/scm/Makefile.am b/src/scm/Makefile.am index d96b117fce..a99752e338 100644 --- a/src/scm/Makefile.am +++ b/src/scm/Makefile.am @@ -1,5 +1,5 @@ -SUBDIRS = gnumeric printing qif-import report +SUBDIRS = gnumeric printing report gncscmdir = ${GNC_SCM_INSTALL_DIR} gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash @@ -13,18 +13,13 @@ gnc_regular_scm_files = \ c-interface.scm \ command-line.scm \ commodity-import.scm \ - commodity-table.scm \ commodity-utilities.scm \ config-var.scm \ date-utilities.scm \ depend.scm \ doc.scm \ - engine-init.scm \ - engine-interface.scm \ - engine-utilities.scm \ extensions.scm \ graph.scm \ - gnc-numeric.scm \ help-topics-index.scm \ hooks.scm \ html-barchart.scm \ @@ -36,7 +31,6 @@ gnc_regular_scm_files = \ html-text.scm \ html-table.scm \ html-utilities.scm \ - iso-4217-currencies.scm \ main.scm \ main-window.scm \ options.scm \ @@ -87,6 +81,7 @@ bootstrap.scm: bootstrap.scm.in Makefile -e 's:@-VERSION-@:${VERSION}:' \ -e 's:@-GNC_CONFIGDIR-@:${GNC_CONFIGDIR}:' \ -e 's:@-GNC_SHAREDIR-@:${GNC_SHAREDIR}:' \ + -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \ -e 's:@-GNC_HELPDIR-@:${GNC_HELPDIR}:' mv $@.tmp $@ CLEANFILES += bootstrap.scm diff --git a/src/scm/bootstrap.scm.in b/src/scm/bootstrap.scm.in index d1756239fd..f6952375e8 100644 --- a/src/scm/bootstrap.scm.in +++ b/src/scm/bootstrap.scm.in @@ -94,12 +94,18 @@ (define gnc:_config-dir-default_ "@-GNC_CONFIGDIR-@") (define gnc:_share-dir-default_ "@-GNC_SHAREDIR-@") (define gnc:_help-dir-default_ "@-GNC_HELPDIR-@") +(define gnc:_lib-dir-default_ "@-GNC_LIB_INSTALLDIR-@") (define gnc:version "@-VERSION-@") +(set! %load-path + (cons (string-append gnc:_share-dir-default_ "/scm") + %load-path)) (set! %load-path (cons (string-append gnc:_share-dir-default_ "/guile-modules") %load-path)) +(simple-format #t "load-path == ~S\n" %load-path) + ;; These will be converted to config vars later (see prefs.scm) (define gnc:*load-path* #f) (define gnc:*debugging?* (if (getenv "GNC_DEBUG") #t #f)) diff --git a/src/scm/commodity-table.scm b/src/scm/commodity-table.scm deleted file mode 100644 index a59d04b0e7..0000000000 --- a/src/scm/commodity-table.scm +++ /dev/null @@ -1,78 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; commodity-table.scm -;;; load and save commodity tables -;;; -;;; Bill Gribble 3 Aug 2000 -;;; $Id$ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - - -(define gnc:*iso-4217-currency-file* - (gnc:make-config-var - "Database of ISO-4217 currency definitions" - (lambda (var value) (if (string? value) (list value) #f)) - string=? - "iso-4217-currencies.scm")) - -(define GNC_COMMODITY_NS_ISO "ISO4217") -(define GNC_COMMODITY_NS_NASDAQ "NASDAQ") -(define GNC_COMMODITY_NS_NYSE "NYSE") -(define GNC_COMMODITY_NS_AMEX "AMEX") -(define GNC_COMMODITY_NS_EUREX "EUREX") -(define GNC_COMMODITY_NS_MUTUAL "FUND") - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (gnc:setup-default-namespaces) -;; make sure there are some reasonable commodity namespaces -;; in the engine -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define (gnc:setup-default-namespaces) - (let ((table (gnc:engine-commodities))) - (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_AMEX) - (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_NYSE) - (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_NASDAQ) - (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_EUREX) - (gnc:commodity-table-add-namespace table GNC_COMMODITY_NS_MUTUAL))) - - -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;; (gnc:load-iso-4217-currencies) -;; load the default table of ISO-4217 currency information. -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(define (gnc:load-iso-4217-currencies) - (let ((table (gnc:engine-commodities))) - (with-input-from-file - (gnc:find-in-directories - (gnc:config-var-value-get gnc:*iso-4217-currency-file*) - gnc:*load-path*) - (lambda () - (let loop ((form (read))) - (if (not (eof-object? form)) - (begin - (if (and (list? form) - (eq? 8 (length form))) - (let ((fullname (list-ref form 0)) - (unitname (list-ref form 1)) - (partname (list-ref form 2)) - (namespace (list-ref form 3)) - (mnemonic (list-ref form 4)) - (exchange-code (list-ref form 5)) - (parts-per-unit (list-ref form 6)) - (smallest-fraction (list-ref form 7))) - (if (and (string? fullname) - (string? unitname) - (string? partname) - (string? namespace) - (string? mnemonic) - (string? exchange-code) - (number? parts-per-unit) - (number? smallest-fraction)) - (let ((comm - (gnc:commodity-create - fullname namespace - mnemonic exchange-code - smallest-fraction))) - (gnc:commodity-table-insert table comm))))) - (loop (read))))))))) diff --git a/src/scm/main.scm b/src/scm/main.scm index 89c7e720bc..3e28e5a198 100644 --- a/src/scm/main.scm +++ b/src/scm/main.scm @@ -19,21 +19,53 @@ ;; and only have the use-modules statements in those files). (use-modules (srfi srfi-1)) (use-modules (srfi srfi-8)) +(use-modules (gnucash gnc-module)) ;; A list of things to do when in batch mode after the initial -;; startup. List items may be strings, in wich case they're read and +;; startup. List items may be strings, in which case they're read and ;; evaluated or procedures, in which case they're just executed. ;; The items will be done in reverse order. (define gnc:*batch-mode-things-to-do* '()) (define (gnc:startup) (gnc:debug "starting up.") - (if (not (gnc:handle-command-line-args)) - (gnc:shutdown 1)) - (gnc:setup-debugging) + ;; initialize the gnucash module system + + ;; first make sure the search paths are reasonable. probably shouldn't + ;; need to do this. + (let ((ev (getenv "LD_LIBRARY_PATH"))) + (setenv "LD_LIBRARY_PATH" + (if ev + (string-append ev ":" gnc:_lib-dir-default_) + gnc:_lib-dir-default_))) + (let ((ev (getenv "GNC_MODULE_PATH"))) + (setenv "GNC_MODULE_PATH" + (if ev + (string-append ev ":" gnc:_lib-dir-default_) + gnc:_lib-dir-default_))) + + (simple-format #t "LD_LIBRARY_PATH=~S\n" (getenv "LD_LIBRARY_PATH")) + (gnc:module-system-init) + + ;; right now we have to statically load all these at startup time. + ;; Hopefully we can gradually make them autoloading. + (gnc:module-load "gnucash/engine" 0) + (gnc:module-load "gnucash/register/ledger-core" 0) + (gnc:module-load "gnucash/register/register-core" 0) + (gnc:module-load "gnucash/register/register-gnome" 0) + (gnc:module-load "gnucash/import-export/qif-import" 0) + ;; Now we can load a bunch of files. + (gnc:depend "config-var.scm") + (gnc:depend "utilities.scm") + (gnc:depend "path.scm") + (gnc:depend "c-interface.scm") + (gnc:depend "options.scm") + (gnc:depend "prefs.scm") + (gnc:depend "command-line.scm") + (gnc:depend "hooks.scm") (gnc:depend "doc.scm") (gnc:depend "extensions.scm") (gnc:depend "text-export.scm") @@ -41,9 +73,12 @@ (gnc:depend "main-window.scm") (gnc:depend "commodity-import.scm") (gnc:depend "report/report-list.scm") - (gnc:depend "qif-import/qif-import.scm") (gnc:depend "printing/print-check.scm") (gnc:depend "price-quotes.scm") + (gnc:depend "tip-of-the-day.scm") + + (if (not (gnc:handle-command-line-args)) + (gnc:shutdown 1)) ;; Load the system configs (if (not (gnc:load-system-config-if-needed)) diff --git a/src/scm/price-quotes.scm b/src/scm/price-quotes.scm index fd482391dc..0c7db8f9e4 100644 --- a/src/scm/price-quotes.scm +++ b/src/scm/price-quotes.scm @@ -23,12 +23,7 @@ (use-modules (gnucash process)) (gnc:support "price-quotes.scm") - -(gnc:depend "gnc-numeric.scm") (gnc:depend "utilities.scm") -(gnc:depend "engine-utilities.scm") - - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; diff --git a/src/scm/qif-import/.cvsignore b/src/scm/qif-import/.cvsignore deleted file mode 100644 index a403b17fe4..0000000000 --- a/src/scm/qif-import/.cvsignore +++ /dev/null @@ -1,3 +0,0 @@ -Makefile -Makefile.in -guile-strings.c diff --git a/src/scm/qif-import/Makefile.am b/src/scm/qif-import/Makefile.am deleted file mode 100644 index 8177577d83..0000000000 --- a/src/scm/qif-import/Makefile.am +++ /dev/null @@ -1,26 +0,0 @@ - -gncscmdir = ${GNC_SCM_INSTALL_DIR}/qif-import - -gncscm_DATA = \ - qif-dialog-utils.scm \ - qif-file.scm \ - qif-guess-map.scm \ - qif-import.scm \ - qif-merge-groups.scm \ - qif-objects.scm \ - qif-parse.scm \ - qif-to-gnc.scm \ - qif-utils.scm \ - simple-obj.scm - -EXTRA_DIST = \ - .cvsignore \ - ${gncscm_DATA} \ - file-format.txt - -guile-strings.c: ${gncscm_DATA} - rm -f guile-strings.c - guile -s ../xgettext.scm ${gncscm_DATA} -CLEANFILES += guile-strings.c - -all-local: guile-strings.c diff --git a/src/scm/qif-import/qif-import.scm b/src/scm/qif-import/qif-import.scm deleted file mode 100644 index cc9cad82ce..0000000000 --- a/src/scm/qif-import/qif-import.scm +++ /dev/null @@ -1,21 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; qif-import.scm -;;; virtual loader for QIF import facility -;;; -;;; Bill Gribble 20 Feb 2000 -;;; $Id$ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(gnc:support "qif-import/qif-import.scm") - -(gnc:depend "qif-import/simple-obj.scm") -(gnc:depend "qif-import/qif-objects.scm") ;; class definitions -(gnc:depend "qif-import/qif-parse.scm") ;; string-to-value, date parsing -(gnc:depend "qif-import/qif-utils.scm") -(gnc:depend "qif-import/qif-file.scm") ;; actual file reading -(gnc:depend "qif-import/qif-dialog-utils.scm") ;; build displays for dialog -(gnc:depend "qif-import/qif-guess-map.scm") ;; build QIF->gnc acct mappings -(gnc:depend "qif-import/qif-to-gnc.scm") ;; conv QIF xtns/acct to GNC -(gnc:depend "qif-import/qif-merge-groups.scm") ;; merge into user's acct - - diff --git a/src/scm/qif-import/qif-quick-import.scm b/src/scm/qif-import/qif-quick-import.scm deleted file mode 100644 index 720d3960e5..0000000000 --- a/src/scm/qif-import/qif-quick-import.scm +++ /dev/null @@ -1,40 +0,0 @@ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; -;;; qif-quick-import.scm -;;; import 1 file, accepting all defaults and not modifying -;;; saved preferences -;;; -;;; Copyright 2001 Bill Gribble -;;; $Id$ -;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; - -(gnc:support "qif-import/qif-merge-groups.scm") -(gnc:depend "report-utilities.scm") - -(define (qif-import:quick-import qif-filename) - (false-if-exception - (call-with-current-continuation - (lambda (exit) - - ;; read the file - (let ((read-success (qif-file:read-file qif-file filename))) - (if (not read-success) - (exit (cons #f "An error occurred while reading the QIF file.")))) - - ;; parse fields. Take the default (first) date format if the - ;; file is ambiguous -- FIXME - (let ((parse-success (qif-file:parse-fields qif-file))) - (if (not parse-success) - (exit (cons #f "An error occurred while parsing the QIF file."))) - (if (and (list? parse-success) - (car parse-success)) - (qif-import:reparse-dates qif-file (caadr parse-return)))) - - ;; load the account, category, and stock map information. - - ;; load into a GNC account group - - ;; check for duplicate transactions - - ;; catenate and merge the transactions - )))) - diff --git a/src/scm/report-utilities.scm b/src/scm/report-utilities.scm index aabdcb69d1..1de6d92705 100644 --- a/src/scm/report-utilities.scm +++ b/src/scm/report-utilities.scm @@ -18,7 +18,6 @@ ;; Boston, MA 02111-1307, USA gnu@gnu.org (gnc:support "report-utilities.scm") -(gnc:depend "engine-utilities.scm") (define (gnc:amount->string amount info) (d-gnc:amount->string-helper (exact->inexact amount) info)) diff --git a/src/scm/startup.scm b/src/scm/startup.scm index 18406a8936..3a1c9c5f78 100644 --- a/src/scm/startup.scm +++ b/src/scm/startup.scm @@ -25,17 +25,4 @@ (gnc:load "slib-backup.scm")) (gnc:load "depend.scm") -(gnc:load "config-var.scm") -(gnc:load "utilities.scm") -(gnc:load "path.scm") -(gnc:load "c-interface.scm") -(gnc:load "gnc-numeric.scm") -(gnc:load "commodity-table.scm") -(gnc:load "engine-init.scm") -(gnc:load "engine-interface.scm") -(gnc:load "options.scm") -(gnc:load "prefs.scm") -(gnc:load "command-line.scm") -(gnc:load "hooks.scm") -(gnc:load "tip-of-the-day.scm") (gnc:load "main.scm") diff --git a/src/scm/text-export.scm b/src/scm/text-export.scm index 37e3e82efa..edcb71c899 100644 --- a/src/scm/text-export.scm +++ b/src/scm/text-export.scm @@ -22,7 +22,6 @@ (gnc:support "text-export.scm") (require 'pretty-print) -(gnc:depend "engine-utilities.scm") ;; TODO ;;