Code Monkey home page Code Monkey logo

Comments (7)

dckc avatar dckc commented on July 20, 2024

so close! I worked thru all the funky TSV quoting issues and got all the data from the export files into sqlite, but gnucash won't eat it:

$ gnucash d1.gnucash 
Found Finance::Quote version 1.51.
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Requested time64 from non-time64 column.
Aborted (core dumped)

the stack trace reveals only a little info:

(gdb) bt
#0  __pthread_kill_implementation (no_tid=0, signo=6, threadid=140737165647872) at ./nptl/pthread_kill.c:44
#1  __pthread_kill_internal (signo=6, threadid=140737165647872) at ./nptl/pthread_kill.c:78
#2  __GI___pthread_kill (threadid=140737165647872, signo=signo@entry=6) at ./nptl/pthread_kill.c:89
#3  0x00007ffff67e2476 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#4  0x00007ffff67c87f3 in __GI_abort () at ./stdlib/abort.c:79
#5  0x00007ffff6a8abbe in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff6a9624c in ?? () from /lib/x86_64-linux-gnu/libstdc++.so.6
#7  0x00007ffff6a962b7 in std::terminate() () from /lib/x86_64-linux-gnu/libstdc++.so.6
#8  0x00007fffe99138e3 in ?? () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so
#9  0x00007fffe9947b01 in gnc_sql_load_object(GncSqlBackend const*, GncSqlRow&, char const*, void*, std::vector<std::shared_ptr<GncSqlColumnTableEntry>, std::allocator<std::shared_ptr<GncSqlColumnTableEntry> > > const&) () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so
#10 0x00007fffe99359a8 in gnc_sql_slots_load_for_sql_subquery(GncSqlBackend*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, QofInstance_s* (*)(_gncGuid const*, _QofBook const*)) () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so
#11 0x00007fffe9922097 in GncSqlAccountBackend::load_all(GncSqlBackend*) () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so
#12 0x00007fffe993b702 in GncSqlBackend::load(_QofBook*, QofBackendLoadType) () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-backend-sql.so
#13 0x00007fffea20f349 in ?? () from /usr/lib/x86_64-linux-gnu/gnucash/gnucash/libgncmod-backend-dbi.so
#14 0x00007ffff6e4b6e2 in QofSessionImpl::load(void (*)(char const*, double)) () from /usr/lib/x86_64-linux-gnu/gnucash/libgnc-engine.so

I'd like to print that sql art,but...

There is no simple way to do this. --https://stackoverflow.com/a/31729484/7963

from finquick.

dckc avatar dckc commented on July 20, 2024

so close! I worked thru all the funky TSV quoting issues and got all the data from the export files into sqlite

... in 1d8b8ce

from finquick.

dckc avatar dckc commented on July 20, 2024

aha!

using nix, built gnucash with debug symbols.

https://nixos.wiki/wiki/Debug_Symbols

https://github.com/Gnucash/gnucash/blob/maint/libgnucash/backend/sql/gnc-sql-column-table-entry.cpp#L375

problems were in timespec_val column of slots and reconcile_date of splits:

sqlite> select distinct reconcile_date from splits order by reconcile_date limit 10;

0000-00-00 00:00:00
1603-01-01 05:50:35
1970-01-01 00:00:00
2010-07-01 04:59:59
...
sqlite> update splits set reconcile_date =null where reconcile_date < '1970';

after a little clean-up, it starts up and I see my accounts!

from finquick.

dckc avatar dckc commented on July 20, 2024

TODO:

  • match version-controlled split_detail.tsv by cleaning up quoting in TSV
  • then switch to CSV?

from finquick.

dckc avatar dckc commented on July 20, 2024
  • then switch to CSV?

or to https://github.com/simonw/sqlite-diffable ?

from finquick.

dckc avatar dckc commented on July 20, 2024

Verified Cash on Hand on MacBook

Looks like the db was generated using 79ca8fd like this:

connolly@bldbox:~/projects/finquick/brcal$ git log --pretty=reference src/loadTables.js
79ca8fd (feat(loadTables): handle gnucash mysql export, 2022-09-17)

node src/loadTables.js --tsv src/gnucash_mysql_schema.csv ~/qtrx/dm93finance/ ,d.db
cp ,d.db ~/qtrx/d1.gnucash
connolly@bldbox:~/qtrx$ ls -l d1.gnucash 
-rw-r--r-- 1 connolly connolly 49152000 Sep 22 10:24 d1.gnucash

I downloaded GnuCash:

$ ls -l Gnucash-Intel-4.12-1.dmg 
-rw-r--r--@ 1 connolly  staff  177827950 Oct  4 08:53 Gnucash-Intel-4.12-1.dmg

Selecting the accounts was a pain. Command is the modifier key for multi-select. Go figure.

The balances match:

  • Total Assets: $xx59.63
  • Total Liabilities: -$xx03.55

And the report config seems to be outside the database; I manually re-created it, though it looks like I once knew how it's stored:

connolly@bldbox:~/qtrx$ rg 'Cash on Hand'
gnucash-config/saved-reports-2.4
388:;; Options for saved report "Cash on Hand Quarterly", based on template "d8b63264186b11e19038001558291366"

1431   fa1da8f3b2e9   2021-06-06 09:17 -0500   http://dm93
  Cash on Hand Quarterly report

from finquick.

dckc avatar dckc commented on July 20, 2024

let's call this fixed in bb3fd06

from finquick.

Related Issues (17)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.