ngiger / gcinvoice

GnuCash to Lates (see http://www.smoerz.org/gcinvoice/) + my personal templates
5 stars 2 forks source link

GnuCash database seems to have changed, needs slight edit to gcinvoice.py #5

Open bammerlaan opened 5 years ago

bammerlaan commented 5 years ago

First off: I'm not exactly well-versed in Python or Gnucash databases, just a user with a very basic understanding of programming.

After a recent Gnucash update, gcinvoice.py started giving the following error, one per Gnucash database entry:

`Traceback (most recent call last): File "gcinvoice.py", line 319, in parse ns('entry:entered/ts:date'))) File "gcinvoice.py", line 751, in _readdatetime "%Y-%m-%d %H:%M:%S") File "/usr/lib/python2.7/_strptime.py", line 332, in _strptime (data_string, format)) ValueError: time data '2016-10-15' does not match format '%Y-%m-%d %H:%M:%S' WARNING:gcinvoice:Problem parsing GncEntry [

f9293a1ac3d24dbb848a2dcaa0e30d8d 2018-03-30 10:00:00 2018-04-01 12:53:28 Test entry 1000000/1000000 ff7664ebca81a12de837157bb14d691b 100000000/1000000 73fd48af7e3044f8bed13b19c1654b1f PERCENT PRETAX 1 1 75b9a59cf2d3edf16458febf919a50f1 ] ` Editing gcinvoice.py and changing line 751 from ` "%Y-%m-%d %H:%M:%S")` to ` "%Y-%m-%d")` Resolved this error. I freely admit I found this out through trial-and-error. I imagine this would be nice to add to the main branch. Thanks for the work on gcinvoice, it's been a great tool so far.
ngiger commented 5 years ago

Thanks for reporting this error. Which version of gnucash are you running? I used the script with my gnucahs 2.6.15 a month ago and it worked fine. Anyway I will try your fix after my vacations.

bammerlaan commented 5 years ago

Hi Niklaus,

Sorry for the late reply. I'm running GnuCash 3.5 on Arch Linux.