Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bammerlaan opened this issue Apr 29, 2019 · 2 comments

Comments

@bammerlaan
Copy link

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 [<ns0:GncEntry xmlns:ns0="http://www.gnucash.org/XML/gnc" xmlns:ns1="http://www.gnucash.org/XML/entry" xmlns:ns2="http://www.gnucash.org/XML/ts" version="2.0.0"> <ns1:guid type="guid">f9293a1ac3d24dbb848a2dcaa0e30d8d</ns1:guid> <ns1:date> <ns2:date>2018-03-30 10:00:00</ns2:date> </ns1:date> <ns1:entered> <ns2:date>2018-04-01 12:53:28</ns2:date> </ns1:entered> <ns1:description>Test entry</ns1:description> <ns1:qty>1000000/1000000</ns1:qty> <ns1:i-acct type="guid">ff7664ebca81a12de837157bb14d691b</ns1:i-acct> <ns1:i-price>100000000/1000000</ns1:i-price> <ns1:invoice type="guid">73fd48af7e3044f8bed13b19c1654b1f</ns1:invoice> <ns1:i-disc-type>PERCENT</ns1:i-disc-type> <ns1:i-disc-how>PRETAX</ns1:i-disc-how> <ns1:i-taxable>1</ns1:i-taxable> <ns1:i-taxincluded>1</ns1:i-taxincluded> <ns1:i-taxtable type="guid">75b9a59cf2d3edf16458febf919a50f1</ns1:i-taxtable> </ns0:GncEntry> ]
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
Copy link
Owner

ngiger commented Apr 30, 2019

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
Copy link
Author

Hi Niklaus,

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants